00001 //-------------------------------------------------- 00011 //--------------------------------------------------- 00012 00013 #ifndef IMEDGINE_SPATIAL_PIXEL_VIEW_H_ 00014 #define IMEDGINE_SPATIAL_PIXEL_VIEW_H_ 00015 00016 #include "volume_pixel_view.h" 00017 #include "imedgine_spatial_viewer.h" 00018 #include "../global/global_definitions.h" 00019 #include "../exceptions/null_pointer_exception.h" 00020 00021 #include <memory> // std::auto_ptr 00022 00023 #include <VolumeViz/nodes/SoTransferFunction.h> 00024 #include <VolumeViz/nodes/SoVolumeData.h> 00025 #include <VolumeViz/nodes/SoVolumeRender.h> 00026 #include <Inventor/nodes/SoClipPlane.h> 00027 00028 namespace imedgine 00029 { 00030 00031 enum ViewMode {STANDARD, ALPHA_BLENDING}; 00032 enum Color {GREY, RED, GREEN, BLUE}; 00033 00034 //-------------------------------------------------- 00045 //-------------------------------------------------- 00046 00047 class SpatialPixelView : public VolumePixelView 00048 { 00049 public: 00050 00051 //-------------------------------------------------- 00054 00055 SpatialPixelView(); 00056 00057 //-------------------------------------------------- 00060 00061 virtual ~SpatialPixelView(); 00062 00063 //-------------------------------------------------- 00066 virtual view_pointer_type clone() const; 00067 00068 //-------------------------------------------------- 00072 00073 virtual void setDataset(dataset_pointer_type dataset) 00074 throw(NullPointerException, InvalidCastException); 00075 00076 //-------------------------------------------------- 00080 00081 virtual void setParent(QWidget* view_parent) 00082 throw(NullPointerException); 00083 00084 //-------------------------------------------------- 00088 00089 virtual void onDataChangedEvent(dataset_attribute_type changed_attribute); 00090 00091 //-------------------------------------------------- 00094 00095 void updateView() throw(NullPointerException); 00096 00097 //-------------------------------------------------- 00101 00102 ImedgineSpatialViewer* getRenderArea() { return(render_area_.get()); } 00103 00104 protected: 00105 00106 //-------------------------------------------------- 00109 00110 SpatialPixelView(SpatialPixelView const& src); 00111 00112 //-------------------------------------------------- 00117 00118 virtual void createSceneGraph(); 00119 00120 void createColorMap(); 00121 00122 //--------------------------------------------------- 00124 00125 std::auto_ptr<ImedgineSpatialViewer> render_area_; 00126 00127 //--------------------------------------------------- 00129 00130 SoVolumeData *current_volume_; 00131 00132 //--------------------------------------------------- 00134 00135 SoTransferFunction* transfunc_; 00136 00137 //--------------------------------------------------- 00139 00140 SoVolumeRender * volrend_; 00141 00142 //--------------------------------------------------- 00144 00145 int render_view_mode_; 00146 00147 //--------------------------------------------------- 00149 00150 int render_color_; 00151 }; 00152 } 00153 00154 #endif