vtkSlicerSeedWidgetClass.h

Go to the documentation of this file.
00001 #ifndef __vtkSlicerSeedWidgetClass_h
00002 #define __vtkSlicerSeedWidgetClass_h
00003 
00004 #include "vtkSlicerBaseGUIWin32Header.h"
00005 
00006 #include "vtkObject.h"
00007 #include "vtkPolyData.h"
00008 #include "vtkSphereSource.h"
00009 
00010 #include <map>
00011 
00012 class vtkSlicerGlyphSource2D;
00013 class vtkSeedWidget;
00014 class vtkPolygonalHandleRepresentation3D;
00015 class vtkOrientedPolygonalHandleRepresentation3D;
00016 class vtkSeedRepresentation;
00017 class vtkPolygonalSurfacePointPlacer;
00018 class vtkProperty;
00019 class vtkCamera;
00022 class VTK_SLICER_BASE_GUI_EXPORT vtkSlicerSeedWidgetClass : public vtkObject
00023 {
00024 public:
00025   static vtkSlicerSeedWidgetClass* New();
00026   vtkTypeRevisionMacro(vtkSlicerSeedWidgetClass, vtkObject);
00027   vtkSlicerSeedWidgetClass();
00028   ~vtkSlicerSeedWidgetClass();
00031   void PrintSelf ( ostream& os, vtkIndent indent );
00032 
00035   vtkGetObjectMacro(HandleRepresentation, vtkPolygonalHandleRepresentation3D);
00036   vtkGetObjectMacro(OrientedHandleRepresentation, vtkOrientedPolygonalHandleRepresentation3D);
00037 //  vtkGetObjectMacro(Representation, vtkSeedRepresentation);
00038   vtkGetObjectMacro(Widget, vtkSeedWidget);
00039   vtkGetObjectMacro(ModelPointPlacer, vtkPolygonalSurfacePointPlacer);
00040 
00043   vtkGetObjectMacro(Glyph, vtkSlicerGlyphSource2D);
00044 
00047   vtkGetObjectMacro(DiamondGlyphPolyData, vtkPolyData);
00048   vtkSetObjectMacro(DiamondGlyphPolyData, vtkPolyData);
00049 
00052   vtkGetObjectMacro(SphereSource, vtkSphereSource);
00053   vtkSetObjectMacro(SphereSource, vtkSphereSource);
00054 
00057   vtkGetMacro(GlyphType, int);
00060   vtkGetMacro(TextScale, double);
00063   vtkGetMacro(GlyphScale, double);
00066   vtkGetVectorMacro(ListColor, double, 3);
00067   vtkSetVectorMacro(ListColor, double, 3);
00068   vtkGetVectorMacro(ListSelectedColor, double, 3);
00069   vtkSetVectorMacro(ListSelectedColor, double, 3);
00070 
00071   
00075   int AddSeed(double *position, const char *id);
00076 
00079   void RemoveSeedByID(const char *id);
00080   
00083   void RemoveSeed(int index);
00084 
00087   void RemoveAllSeeds();
00088 
00092   vtkProperty *GetProperty();
00093  
00096   void SetNthSeedTextScale(int n, double scale);
00099   void SetTextScale(double scale);
00102   double * GetTextScaleFromWidget();
00103  
00107   void SetGlyphScale(double scale);
00108   void SetNthSeedGlyphScale(int n, double scale);
00109 
00113   int SetGlyphToStarburst();
00114   int SetGlyphToSphere();
00115   int SetGlyphToDiamond3D();
00116   int SetGlyphTo2D(int val);
00117 
00118 //BTX
00121   enum GlyphTypes
00122   {
00123     Starburst = 1,
00124     Sphere = 2,
00125     Diamond3D = 3,
00126     TwoD = 4,
00127   };
00128 //ETX
00129 
00132   void SetNthSeedVisibility(int n, int flag);
00133 
00136   void SetNthLabelTextVisibility(int n, int flag);
00137   void SetLabelTextVisibility(int flag);
00140   void SetNthLabelText(int n, const char *txt);
00141   char *GetNthLabelText(int n);
00142   
00145   void SetNthSeedPosition(int n, double *position);
00146   
00149   void SetNthSeedSelected(int n, int selectedFlag);
00150 
00153   void SetNthSeedLocked(int n, int lockedFlag);
00154   void SetSeedsLocked(int lockedFlag);
00155 
00159   void SetNthSeedCamera(int n, vtkCamera *cam);
00162   void SetCamera(vtkCamera *cam);
00163 
00164 
00168   int GetNthSeedExists(int n);
00169 
00172   void SetOpacity(double opacity);
00173 
00174   //
00175   // set the material properties on all seeds
00176   void  SetMaterialProperties(double opacity, double ambient, double diffuse, double specular, double power);
00177   //
00178   // set the material properties on the nth seed
00179   void  SetNthSeedMaterialProperties(int n,
00180                                      double opacity, double ambient, double diffuse, double specular, double power);
00181   
00184   void SetNthSeed(int n, vtkCamera *cam, double *position, const char *text,
00185                   int visibilityFlag, int lockedFlag, int selectedFlag,
00186                   double *colour, double *selectedColour,
00187                   double textScale, double glyphScale,
00188                   int glyphType,
00189                   double opacity, double ambient, double diffuse, double specular, double power);
00190 
00193 //BTX
00194   std::string GetIDFromIndex(int index);
00195 //ETX
00199   int GetIndexFromID(const char *id);
00200   
00204   void SwapIndexIDs(int index1, int index2);
00205 
00208   int GetNumberOfSeeds();
00209 
00210 protected:
00211 
00212   vtkGetObjectMacro(Representation, vtkSeedRepresentation);
00213   
00216   vtkSlicerGlyphSource2D *Glyph;
00217 
00220   vtkPolyData * DiamondGlyphPolyData;
00221   
00224   vtkSphereSource * SphereSource;
00225   
00228   vtkPolygonalHandleRepresentation3D *HandleRepresentation;
00231   vtkOrientedPolygonalHandleRepresentation3D *OrientedHandleRepresentation;
00232   
00235   vtkSeedRepresentation *Representation;
00238   vtkSeedWidget *Widget;
00241   vtkPolygonalSurfacePointPlacer *ModelPointPlacer;
00242 
00246   double ListColor[3];
00247   double ListSelectedColor[3];
00248 
00251   int GlyphType;
00252 
00255   double GlyphScale;
00256   double TextScale;
00257 
00260 //BTX
00261   std::map<std::string, int> PointIDToWidgetIndex;
00262 //ETX
00263 
00264 private:
00265   vtkSlicerSeedWidgetClass (const vtkSlicerSeedWidgetClass& ); 
00266   void operator = ( const vtkSlicerSeedWidgetClass& ); 
00267 };
00268 
00269 #endif

Generated on 6 Apr 2011 for Slicer3 by  doxygen 1.6.1