]> Creatis software - creaContours.git/blobdiff - lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.h
Version with out wxEventHandler
[creaContours.git] / lib / Interface_ManagerContour_NDimensions / wxContourMainFrame.h
index 04969ffa281375eb1e19ad06e21d66fe80412089..5f2ad32edd3789d9aa334e182ad365551410e26c 100644 (file)
 //------------------------------------------------------------------------------------------------------------
 #include "wx/aui/aui.h"
 
-#include "ContourThing.h"
-#include "AxeThing.h"
-#include "ImageSourceThing.h"
-#include "ImageSectionThing.h"
-#include "InstantMembersNameList.h"
-#include "OutlineGroup.h"
+#include "interfMainPanel.h"
+
+#include "wxVtkBaseView_SceneManager.h"
+#include "wxInstantChooserPanel.h"
+#include "wxContourViewPanel.h"
+
+#include "KernelManagerContour.h"
+
+#include "ContourWorkspace.h"
+#include "contour/contourextractdata.h"
+
+
+
+
+#include "PerformingOperation.h"
+
+
+
+//#include "ContourThing.h"
+//#include "AxeThing.h"
+//#include "ImageSourceThing.h"
+//#include "ImageSectionThing.h"
+//#include "InstantMembersNameList.h"
+//#include "OutlineGroup.h"
 #include "SomeEnvironment.h"
 #include "ContourWorkspace.h"
 #include "ContourWrap_ViewControl.h"
 #include "Instant.h"
+#include "PerformingOperation.h"
+
+#include "ContourThing.h"
+
+//#include "OutlineModelManager.h"
 
-#include "OutlineModelManager.h"
-#include "wxInstantChooserPanel.h"
 #include "wxContour_ButtonsBar.h"
 #include "wxContour_ControlPanel.h"
-#include "wxContourViewPanel.h"
+
 #include "wxContour_Grid.h"
 #include "wxContour_DrawToolsPanel.h"
 #include "wxContour_OperationsToolsPanel.h"
 #include "wxContour_EdtionToolsPanel.h"
 #include "wxContour_ListViewPanel.h"
 
-#include "wxVtkBaseView_SceneManager.h"
+
+
+
+#include "vtkContourFilter.h"
+#include "vtkPolyDataConnectivityFilter.h"
+#include "vtkCleanPolyData.h"
+#include "vtkImageReslice.h"
+#include "vtkMetaImageWriter.h"
+#include "vtkImageData.h"
+#include "vtkMetaImageReader.h"
 
 //------------------------------------------------------------------------------------------------------------
 // Events declaration
@@ -71,6 +101,7 @@ class wxContourMainFrame : public wxPanel {
        
 
        wxContourMainFrame(wxWindow* parent, wxWindowID id,const wxString& title,const wxPoint& pos,const wxSize& size,long style  = wxDEFAULT_FRAME_STYLE | wxSUNKEN_BORDER);
+       wxContourMainFrame(wxWindow* parent, wxWindowID id,const wxString& title,const wxPoint& pos,const wxSize& size,std::vector<vtkImageData*> images, long style  = wxDEFAULT_FRAME_STYLE | wxSUNKEN_BORDER);
 
        ~wxContourMainFrame();
 
@@ -90,8 +121,6 @@ class wxContourMainFrame : public wxPanel {
        void createInstantChooserPanel(wxWindow * parent);
 
        void createViewPanel(wxWindow * parent);
-               
-       void setViewPanel(  wxContourViewPanel * theViewPanel );
 
        void setInstantChooserPanel(  wxInstantChooserPanel * theInstantChooserPanel );
 
@@ -125,11 +154,109 @@ class wxContourMainFrame : public wxPanel {
        //------------------------------------------------------------------------------------------------------------
        //  Attributes getters and setters
        //------------------------------------------------------------------------------------------------------------
-
+       static wxContourMainFrame* getInstance(wxWindow* parent, wxWindowID id,const wxString& title,const wxPoint& pos,const wxSize& size,std::vector<vtkImageData*> images, long style  = wxDEFAULT_FRAME_STYLE | wxSUNKEN_BORDER);
+       static wxContourMainFrame* getInstance();
        //------------------------------------------------------------------------------------------------------------
        //  Other functional methods
        //------------------------------------------------------------------------------------------------------------
 
+       /*
+       ** This method returns the vector of images selected by the user 
+       **      return value std::vector<vtkImageData*>
+       */
+       std::vector<vtkImageData*> getVectImages();
+
+       /**
+       **      This methods connect the event in the class interfMainPanel with the world of the appli
+       **/
+       void onCreateContourSpline( );
+       void onCreateContourRectangle( );
+       void onCreateContourCircle( );
+       void onCreateContourBullEye(wxPanel* pan);
+       /////////////////////////////////
+       void onDeleteContour();
+       void deleteContours( std::vector<std::string>  keyNamesVector );
+       void deleteContour( std::string theKeyName );
+       void onDeleteContoursActSlice();
+       void onDeleteAllContours();
+       void deleteAllContours();
+       void setConceptValue( std::string name, int value );
+       ConceptDataWrap* getLastConceptData();
+       bool getIfConceptCheckedAt( std::string name, int pos );
+
+       void changeInstant();
+
+       int getNamesWrappingSize();
+
+       std::string getNameWrapping(int i);
+
+
+       void updateInstantOutlines();
+       void updateInstantImageData();
+       void updateInstantAxes();
+
+       void onChangeDeep(int val);
+
+///////////////////////////
+       void onCopy();
+       void onPaste();
+       void onUndo();
+       void onRedo();
+       void createCopyContourOf ( std::string anExistingKName, std::vector<int> &instantNoTouchData, bool append );
+///////////////////////7
+       void onLoad();
+       void onSave();
+       
+       void openContours( FILE *pFile, bool staticContour );
+
+       void RefreshInterface();
+
+       vtkImageData* getImageData();
+
+       void onSegmentationOneSlice(int isovalue,int sampling,int method);
+
+       void SegmentationOneSlice( int x, int y, int z, int isovalue, int sampling, int method );
+
+       int GetImageDataSizeZ();
+
+       void GetImageDataRange(double *range);
+
+       void onSegmentationAllSlice(int minZ,int maxZ,int isovalue,int sampling,int method);
+
+       void showAxis(bool show);
+
+       void onRigidPressed();
+
+       void onWidthOfContour(double width);
+
+       int getColorWindow();
+       int getWindowLevel();
+
+       void onBrigthnessColorWindowLevel(int colorwindow,int windowlevel);
+
+       void onInterpolation(bool interpolate);
+
+       void onChangeInstant(std::string name,int actual);
+
+       void resetAppend();
+
+       void onSpreadAdd();
+
+       void onSpreadGo(int type);
+
+       void getInstantVector(std::vector<int>& tempVector);
+
+       std::vector<std::string> getOutlinesName(int slide);
+
+       void onInformationContourLabels(int typeContourGroup,int selection,int minimumZ,int maximumZ);
+
+       void onSaveResults(std::string directory,std::string namefile, std::string filename, int typeContourGroup);
+
+       void SaveValuesXYZ(std::string directory,std::string namefile, int typeContourGroup);
+
+       void SaveImageResult(std::string directory,std::string namefile, int typeContourGroup);
+
+       void onChangeInstantInstantPanel(std::string name,int value, int minshow, int maxshow);
 
 private:
        //------------------------------------------------------------------------------------------------------------
@@ -140,6 +267,12 @@ private:
        //------------------------------------------------------------------------------------------------------------
        // Attributtes
        //------------------------------------------------------------------------------------------------------------
+       static wxContourMainFrame* instance;
+
+       KernelManagerContour* kernelManager;
+
+       wxContourViewPanel* _theViewPanel;
+
 
        wxAuiManager m_mgr;
     /*
@@ -148,10 +281,9 @@ private:
        */
     long m_notebook_style;
     long m_notebook_theme;
+       int _numberOfVariablesStatistics;
 
-       wxContourViewPanel * _theViewPanel;
-
-       OutlineModelManager * _modelManager;
+       //OutlineModelManager * _modelManager;
 
        wxInstantChooserPanel * _instantPanel;
 
@@ -173,12 +305,38 @@ private:
 
        wxVtkBaseView_SceneManager * _sceneManager;
 
-       Instant * _actualInstant;
+       //Instant * _actualInstant;
+
+       
 
        /*DECLARE_CLASS(wxContourMainFrame)
        // any class wishing to process wxWindows events must use this macro
        DECLARE_EVENT_TABLE()*/
        bool _creatingContoursActive;
+////////JCP 21 - 11 - 08
+       void createContour( int typeContour );
+
+       //manualContourModel * factoryManualContourModel(int typeContour);
+
+       manualContourModel * factoryManualContourModel(wxPanel* panel);
+
+
+
+       void saveState();
+       void loadState(std::string filename);
+
+       void saveFileWithContours( std::string filename );
+
+       int inredo;
+       int inundo;
+       std::string     stundoredo;
+
+       
+
+       //wxContourViewPanel* _viewPan;
+       PerformingOperation* _performingOperation;
+
+       static char COPY;
 
 };