]> Creatis software - creaMaracasVisu.git/blobdiff - lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasIRMViewManager.h
BUG contour line
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / wxMaracasIRMViewManager.h
index 255cc0410f106203001cbc010b4545090ddaae78..b3be47c7724a7f917617aeb84cf692ebb7906d7a 100644 (file)
@@ -3,8 +3,8 @@
   Program:   wxMaracas
   Module:    $RCSfile: wxMaracasIRMViewManager.h,v $
   Language:  C++
-  Date:      $Date: 2009/04/01 16:16:59 $
-  Version:   $Revision: 1.1 $
+  Date:      $Date: 2009/04/14 12:47:30 $
+  Version:   $Revision: 1.3 $
 
   Copyright: (c) 2002, 2003
   License:
 #include "vtkPolyDataMapper.h"
 #include "vtkActor.h"
 #include "vtkProperty.h"
+#include "vtkMetaImageReader.h"
+#include "vtkMarchingCubes.h"
+#include "vtkCleanPolyData.h"
+#include "vtkImageData.h"
+
+
+
+
+class wxMaracasIRMViewManagerData  {
+
+public:
+       wxMaracasIRMViewManagerData(vtkProp3D* _prop3Dvect, std::string dataname="");
+       wxMaracasIRMViewManagerData(vtkImageData* imagedata, std::string dataname="");
+       ~wxMaracasIRMViewManagerData();
+
+       
+       /**
+       **      Adds a prop3D to the world of the application
+       **/
+       void setVtkImageData(vtkImageData* imagedata);
+       /**
+       **      Adds a prop3D to the world of the application
+       **/
+       void setProp3D(vtkProp3D* prop3D);
+       /**
+       **      Changes the opacity in a prop3D
+       **/
+       void changeOpacity(int value);
+       /**
+       **      changes the isovalue in a prop3D
+       **/
+       void changeIsoValue(int value); 
+       /**
+       **      Check if the variables are setted correctly
+       **/
+       void checkInvariant();
+       /**
+       **      get the prop3D 
+       **/
+       vtkProp3D* getProp3D();
+       /**
+       **      return the id from the daat
+       **/
+       int getId();
+       /**
+       **      set data id
+       **/
+       void setId(int propid);
+       /**
+       **      Get the filanme
+       **/
+    std::string getDataname();
+       /**
+       ** Set the filanme
+       **/
+    void setDataname(std::string dataname);
+       /**
+       **      Returns the grey max level of the image
+       **/
+
+       int getMaxGreyLevel();
+
+       /**
+       **      creates the image 
+       **/
+       void contourExtractor(int isovalue);
+
+       /**
+       **      Changes the color of the actor
+       **/
+       void changeColor(double red, double green, double blue);
+       
+private:       
+       vtkProp3D* _prop3D;
+       vtkImageData* _imagedata;
+       int _id; 
+       std::string _dataname;
+       int _maxgreylevel;
+
+       /**
+       **
+       **/
+       vtkPolyDataMapper* _dataMapper;
+       vtkPolyData* _polydata;
+       /**
+       ** Get's the max grey level of the image
+       **/
+       int getMaxLevel(vtkImageData* img);
+       
+
+       
+};
 
 class wxMaracasIRMViewManager  {
 
@@ -44,27 +136,66 @@ public:
        /**
        **      Adds a prop3D to the manager and returns the identifier
        **/
-       int addProp3D(vtkProp3D* prop3D);
+       int addProp3D(vtkProp3D* prop3D, std::string dataname) throw (char*);
+       /**
+       **      Adds a prop3D to the manager and returns the identifier
+       **/
+       int addPropMHD(vtkImageData* imagedata, std::string dataname);
        /**
        **      Changes the opacity in a prop3D
        **/
-       void changeOpacity(int propid, int value);
+       void changeOpacity(int propid, int value)throw(char*);
 
        /**
        **      changes the isovalue in a prop3D
        **/
-       void changeIsoValue(int propid, int value);
+       void changeIsoValue(int propid, int value)throw(char*);
 
        /**
        **      loads a prop3D from a nSTL file
        **/
        vtkProp3D* getProp3D(std::string filename);
+
+       /**
+       **      loads a MHD file to convert it into an actor
+       **/
+       vtkImageData* getImageData(std::string filename);
+
+       /**
+       **      adds or removes an actor depending of the bool value
+       **/
+       void addRemoveActor(int propid, bool addremove)throw(char*);
+       /**
+       **      Check if the variables are setted correctly
+       **/
+       void checkInvariant()throw(char*);
+
+       /**
+       **      Given an id search the data in the vector
+       **/
+       wxMaracasIRMViewManagerData* getViewData(int id)throw(char*);
+
+       /**
+       **      Given the id, return the max iso value from the imagedata
+       **/
+       int getMaxIsoValue(int propid)throw(char*);
+
+
+       /**
+       **      Changes the color of the actor
+       **/
+       void changeColor(int propid, double red, double green, double blue) throw(char*);
        
 private:       
-       std::vector<vtkProp3D*> prop3Dvect;
+       std::vector<wxMaracasIRMViewManagerData*> prop3Dvect;
 
        vtkRenderer*  _renderer;
 
+       int _idCount;
+
+       
+
        
 };
+
 #endif