00001 //-------------------------------------------------- 00011 //--------------------------------------------------- 00012 00013 #ifndef IMEDGINEIMEDGINE_IMAGE_VIEWER_H 00014 #define IMEDGINEIMEDGINE_IMAGE_VIEWER_H 00015 00016 #include "imedgine_viewer.h" 00017 #include "../global/global_definitions.h" 00018 #include "view_definitions.h" 00019 #include "../datasets/dataset.h" 00020 #include "../exceptions/null_pointer_exception.h" 00021 00022 #include <Inventor/SbTime.h> 00023 #include <Inventor/nodes/SoCube.h> 00024 #include <Inventor/nodes/SoTransform.h> 00025 #include <Inventor/nodes/SoText2.h> 00026 #include <Inventor/nodes/SoMaterial.h> 00027 #include <Inventor/nodes/SoSwitch.h> 00028 #include <Inventor/draggers/SoTranslate1Dragger.h> 00029 00030 namespace imedgine 00031 { 00032 00033 //-------------------------------------------------- 00035 class ROIBase; 00036 00037 //-------------------------------------------------- 00039 00040 class ImagePixelView; 00041 00042 //-------------------------------------------------- 00053 //-------------------------------------------------- 00054 00055 class ImedgineImageViewer : public ImedgineViewer 00056 { 00057 public: 00058 00059 //-------------------------------------------------- 00062 00063 ImedgineImageViewer(ImagePixelView* image_view, 00064 QWidget* parent, const char* name = NULL); 00065 00066 //-------------------------------------------------- 00069 00070 virtual ~ImedgineImageViewer(); 00071 00072 //-------------------------------------------------- 00077 00078 virtual SbBool processSoEvent(const SoEvent * const ev); 00079 00080 //-------------------------------------------------- 00089 00090 bool convertCoordsFromScreenToTexture(SbVec2s const& screen_coords, SbVec2s& texture_coords); 00091 00092 //-------------------------------------------------- 00097 00098 void convertCoordsFromTextureToWorld(SbVec2s const& texture_coords, SbVec2f& space_coords); 00099 00100 //-------------------------------------------------- 00106 00107 void updateDatasetStatusInfo(); 00108 00109 //-------------------------------------------------- 00113 00114 ImagePixelView* getImagePixelView() const { return (image_view_); } 00115 00116 protected: 00117 00118 //-------------------------------------------------- 00123 00124 SbVec3f convertCoordsFromWorldToSpace(SbVec2s screen_coords) 00125 throw(NullPointerException); 00126 00127 //-------------------------------------------------- 00130 00131 ImagePixelView* image_view_; 00132 00133 //-------------------------------------------------- 00136 00137 view_mode_type view_mode_; 00138 00139 //-------------------------------------------------- 00142 00143 SoSeparator* popup_button_sep_; 00144 00145 //-------------------------------------------------- 00148 00149 SoCube* popup_button_; 00150 00151 //-------------------------------------------------- 00154 00155 SoSeparator* status_info_sep_; 00156 00157 //-------------------------------------------------- 00160 00161 SoText2* slice_status_info_text_; 00162 00163 //-------------------------------------------------- 00167 00168 SoTransform* dataset_status_info_transform_; 00169 00170 //-------------------------------------------------- 00174 00175 SoText2* dataset_status_info_text_; 00176 00177 //-------------------------------------------------- 00180 00181 SoSeparator* region_of_interest_sep_; 00182 00183 //-------------------------------------------------- 00186 00187 ROIBase* region_of_interest_; 00188 00189 //-------------------------------------------------- 00193 00194 std::auto_ptr<SoMouseButtonEvent> last_button_click_event_; 00195 00196 //-------------------------------------------------- 00199 00200 SbVec2s last_position_; 00201 00202 //-------------------------------------------------- 00205 00206 SoQtPopupMenu *popup_menu; 00207 00208 //-------------------------------------------------- 00212 00213 SbTime double_click_check_time_; 00214 00215 //-------------------------------------------------- 00218 00219 bool left_mouse_button_pressed_; 00220 00221 //-------------------------------------------------- 00224 00225 SbVec2s left_mouse_button_press_location_; 00226 00227 //-------------------------------------------------- 00233 double mouse_movement_scaling_factor_; 00234 00235 }; 00236 } 00237 00238 #endif