#ifndef __wxVtkBaseView_SceneManager_h_INCLUDED_H__ #define __wxVtkBaseView_SceneManager_h_INCLUDED_H__ // ----------------------------------------------------------------------------------------------------------- // WX headers inclusion. // For compilers that support precompilation, includes . // ----------------------------------------------------------------------------------------------------------- #include #ifdef __BORLANDC__ #pragma hdrstop #endif #ifndef WX_PRECOMP #include #endif //------------------------------------------------------------------------------------------------------------ // Includes //------------------------------------------------------------------------------------------------------------ #include "ContourWrap_ViewControl.h" #include "wxVtkBaseView.h" #include #include #include #include //------------------------------------------------------------------------------------------------------------ // Events declaration //------------------------------------------------------------------------------------------------------------ BEGIN_DECLARE_EVENT_TYPES() DECLARE_EVENT_TYPE( wxEVT_START_CREATE_MULT_ROI, -1 ) DECLARE_EVENT_TYPE( wxEVT_STOP_CREATE_MULT_ROI, -1 ) DECLARE_EVENT_TYPE( wxEVT_SELECTED_MULT_ROI, -1 ) DECLARE_EVENT_TYPE( wxEVT_START_CREATE_ROI, -1 ) DECLARE_EVENT_TYPE( wxEVT_STOP_CREATE_ROI, -1) DECLARE_EVENT_TYPE( wxEVT_DELETE_ROI, -1 ) DECLARE_EVENT_TYPE( wxEVT_SELECTED_ROI, -1 ) DECLARE_EVENT_TYPE( wxEVT_UNSLECTED_ROI, -1 ) DECLARE_EVENT_TYPE( wxEVT_MANUAL_HIDED_ROI, -1 ) DECLARE_EVENT_TYPE( wxEVT_MANUAL_SHOWED_ROI, -1 ) DECLARE_EVENT_TYPE( wxEVT_EDITING_ROI, -1 ) DECLARE_EVENT_TYPE( wxEVT_MOVING_ROI, -1 ) DECLARE_EVENT_TYPE( wxEVT_MOVING_ROI_POINT, -1 ) DECLARE_EVENT_TYPE( wxEVT_SELECTED_ROI_POINT, -1 ) DECLARE_EVENT_TYPE( wxEVT_UNSELECTED_ROI_POINT, -1 ) DECLARE_EVENT_TYPE( wxEVT_CHANGED_DEEP, -1 ) END_DECLARE_EVENT_TYPES() /** file wxVtkBaseView_SceneManager.h */ //------------------------------------------------------------------------------------------------------------ // Class definition //------------------------------------------------------------------------------------------------------------ class wxVtkBaseView_SceneManager : public InteractorStyleMaracas { public: //------------------------------------------------------------------------------------------------------------ // Constructors & Destructors //------------------------------------------------------------------------------------------------------------ wxVtkBaseView_SceneManager( wxVtkBaseView * theWxBaseViewToManage, wxEvtHandler * theEventHandler, double * spc ); ~wxVtkBaseView_SceneManager(); //------------------------------------------------------------------------------------------------------------ // Methods for capturing events //------------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------------ // Methods for sending events //------------------------------------------------------------------------------------------------------------ void sendEnvent( WXTYPE theEventType, std::string text ); //------------------------------------------------------------------------------------------------------------ // Attributes getters and setters //------------------------------------------------------------------------------------------------------------ void setWxVtkViewBase( wxVtkBaseView * theBaseView ); void setWxEventHandler( wxEvtHandler * theEventHandler ); wxVtkBaseView * getWxVtkViewBase(); void configureViewControlTo( std::string theKeyName, manualContourModel * manContourControl, double * spc ,int typeContour); void configureSelectionROI( double * spc ); ContourWrap_ViewControl * insertWrap( std::string theKeyName, manualContourBaseControler * manContourControl, manualViewBaseContour * manViewerContour ); void desconfigureViewControlOf( std::string theKeyName ); void removeWrap( std::string theKeyName ); ContourWrap_ViewControl * getContourWrap_ViewControlOf ( std::string theName ); ContourWrap_ViewControl * getContourWrap_ViewControlOf ( std::string theName, std::map * theMap ); manualContourBaseControler * getControlerOf( std::string theName ); manualViewBaseContour * getViewerOf( std::string theName ); void set_creatingMULT_ROI( bool condition ); void set_editingROI( bool condition ); void set_toIncludeAtInteractionGroup( bool condition ); void set_waiting( bool condition ); bool get_creatingMULT_ROI( ); bool get_editingROI( ); bool get_toIncludeAtInteractionGroup( ); bool get_waiting( ); bool get_creatingROI(); void set_creatingROI( bool theCondition ); //------------------------------------------------------------------------------------------------------------ // Other functional methods //------------------------------------------------------------------------------------------------------------ void createCopyContourOf( std::string anExistingKName, std::string cloneName, manualContourModel * manualModel, bool append = false ); void removeFromScene( ContourWrap_ViewControl * contourWRP, bool visualization = true, bool control = true ); void removeFromScene( std::string theKeyName, bool visualization = true, bool control = true ); void removeSceneContours( ); void removeAllOutlines(); void addToScene( std::string theKeyName, bool append = true, bool visualization = true, bool control = true, bool ifActive = true, bool ifShowCtrlPoints = true ); void addToScene( std::string theKeyName, ContourWrap_ViewControl * contourWRP, bool append = true, bool visualization = true, bool control = true, bool ifActive = true, bool ifShowCtrlPoints = true ); void removeFromScene( std::vector< std::string> theKeyNameVector, bool visualization = true, bool control = true ); void addToScene( std::vector< std::string> theKeyNameVector, bool append = true, bool visualization = true, bool control = true, bool ifActive = true, bool ifShowCtrlPoints = true ); void setControlActiveStateOfALL( bool stateCondition ); void setControlActiveStateOf( std::string theKeyName, bool stateCondition ); void setControlActiveStateOf( ContourWrap_ViewControl * contourWRP, bool stateCondition ); void setVisibleStateOf( std::string theKeyName, bool stateCondition ); std::vector< std::string > getSelectedObjects(); void selectObjects( std::vector< std::string > theExistingObjectsToSelect ); void selectObjects( std::map * theMap ); void setControlActiveStateOf( std::vector< std::string> &theKeyNameVector, bool controlCondition = false ); void setControlActiveStateOf( std::map * theMap, bool controlCondition = false ); void drawSelectionROI(); void setSelection2DROIInternalOutlines( ); void writeCoords( std::string method ); // EED void SaveThingName(FILE *ff, std::string nameThing); void GetPointsOfActualContour( std::vector *vecX, std::vector *vecY, std::vector *vecZ ); vtkImageData *GetImageData(); std::vector GetlstContoursNameActualSlice(); //------------------------------------------------------------------------------------------------------------ // Inherited Methods //------------------------------------------------------------------------------------------------------------ virtual bool OnChar(); virtual bool OnMouseMove(); virtual bool OnLeftButtonDown(); virtual bool OnLeftButtonUp(); virtual bool OnMiddleButtonDown(); virtual bool OnMiddleButtonUp(); virtual bool OnRightButtonDown(); virtual bool OnRightButtonUp(); virtual bool OnLeftDClick(); virtual bool OnRightDClick(); virtual bool OnMiddleDClick(); virtual bool OnMouseWheel(); int GetImageDataSizeZ(); void GetImageDataRange( double *range ); void SetWidthContour(double width); private: //------------------------------------------------------------------------------------------------------------ // Private methods //------------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------------ // Creational and initialization methods //------------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------------ // Attributtes //------------------------------------------------------------------------------------------------------------ std::map * _contours_ViewControl; std::map * _sceneContours_ViewControl; wxVtkBaseView *_wxVtk_BaseView; wxEvtHandler *_eventHandler; ContourWrap_ViewControl *_lastInteraction; std::string _lastInteractionName; std::map * _workingGroup; bool _creatingMULT_ROI; bool _editingROI; bool _toIncludeAtInteractionGroup; bool _waiting; bool _creatingROI; int _enventID; int _leftClickCount; int _rigthClickCount; int clickX; int clickY; char _lastKeyCode; long int onCharCallBackTimeEnd; long int onCharNeeded; bool _drawingSelectionROI; manualRoiControler *_controlerSelectionROI; manualViewRoi *_viewerSelectionROI; manualContourModel *_modelSelectionROI; double _widthOfContour; }; #endif // __wxVtkBaseView_SceneManager_HEADER_FILE__