1 #ifndef VTKVIEWER_TRIHEDRON_H
2 #define VTKVIEWER_TRIHEDRON_H
7 #include <vtkFollower.h>
10 class vtkActorCollection;
13 class vtkPolyDataMapper;
18 class VTKViewer_VectorText;
20 /*! \class vtkFollower
21 * See <a href="http://www.vtk.org/">vtk documentation</a>
23 /*!a subclass of actor that always faces the camera
26 class VTKVIEWER_EXPORT VTKViewer_UnScaledActor: public vtkFollower
28 VTKViewer_UnScaledActor(const VTKViewer_UnScaledActor&);
32 vtkTypeMacro(VTKViewer_UnScaledActor,vtkFollower);
34 /*!Create new instance of VTKViewer_UnScaledActor.*/
35 static VTKViewer_UnScaledActor *New();
37 virtual float* GetBounds();
38 virtual void SetSize(int theSize);
39 virtual void Render(vtkRenderer *theRenderer);
42 VTKViewer_UnScaledActor();
43 /*!Destructor. Do nothing.*/
44 ~VTKViewer_UnScaledActor(){}
49 /*!a subclass of actor that always faces the camera
52 class VTKVIEWER_EXPORT VTKViewer_LineActor: public vtkFollower
54 VTKViewer_LineActor(const VTKViewer_LineActor&);
58 vtkTypeMacro(VTKViewer_LineActor,vtkFollower);
60 /*!Create new instance of VTKViewer_LineActor.*/
61 static VTKViewer_LineActor *New();
64 * \param theLabelActor - VTKViewer_UnScaledActor
66 void SetLabelActor(VTKViewer_UnScaledActor* theLabelActor);
69 * \param theLabelActor - VTKViewer_UnScaledActor
71 void SetArrowActor(VTKViewer_UnScaledActor* theLabelActor);
73 virtual void Render(vtkRenderer *theRenderer);
77 /*! Constructor which sets \a LabelActor and \a ArrowActor to NULL*/
78 VTKViewer_LineActor(){
83 /*!Destructor which call SetLabelActor(NULL) and SetArrowActor(NULL)*/
84 ~VTKViewer_LineActor(){
89 /*!Label actor pointer*/
90 VTKViewer_UnScaledActor* LabelActor;
92 /*!Arrow actor pointer*/
93 VTKViewer_UnScaledActor* ArrowActor;
96 //****************************************************************
97 /*!This class provide support trihedron object in vtk viewer.*/
98 class VTKVIEWER_EXPORT VTKVIEWER_EXPORT VTKViewer_Trihedron : public vtkObject
101 /*!Initialize fields by default values.*/
102 VTKViewer_Trihedron();
104 /*!Const copy constructor.*/
105 VTKViewer_Trihedron(const VTKViewer_Trihedron&);
107 /*!Destructor. Remove all fileds.*/
108 virtual ~VTKViewer_Trihedron();
111 /*!vtk type macros.*/
112 vtkTypeMacro(VTKViewer_Trihedron,vtkObject);
114 /*!Create new instance of VTKViewer_Trihedron.*/
115 static VTKViewer_Trihedron *New();
117 /*!Sets size of trihedron.
118 * \param theSize - float value
120 virtual void SetSize(float theSize);
122 /*! Get size of trihedron.
123 * \retval mySize - float value
125 virtual float GetSize() { return mySize;}
127 enum TVisibility{eOff, eOn, eOnlyLineOn};
129 /*! Sets visibility for all Axis to \a theVis*/
130 virtual void SetVisibility(TVisibility theVis);
132 /*! OFF visibility for all Axis.*/
133 virtual void VisibilityOff() { SetVisibility(eOff);}
135 /*! ON visibility for all Axis.*/
136 virtual void VisibilityOn() { SetVisibility(eOn);}
138 /*! Gets visibility of myAxis[0] actor.*/
139 virtual TVisibility GetVisibility();
141 /*! Add to render all Axis
142 * \param theRenderer - vtkRenderer pointer
144 virtual void AddToRender(vtkRenderer* theRenderer);
146 /*! Remove all actors from \a theRenderer which are in myPresent.
147 * \param theRenderer - vtkRenderer pointer
149 virtual void RemoveFromRender(vtkRenderer* theRenderer);
151 /*! Return count of visible actors.
152 * \param theRenderer - vtkRenderer pointer
154 virtual int GetVisibleActorCount(vtkRenderer* theRenderer);
157 /*! Actor collection*/
158 vtkActorCollection* myPresent;
160 /*! \li myAxis[0] - X Axis actor
161 * \li myAxis[1] - Y Axis actor
162 * \li myAxis[2] - Z Axis actor
164 VTKViewer_Axis* myAxis[3];
166 /*! Common size for trihedron, for each axis.*/
170 //****************************************************************
171 /*!The base class for concreate Axis.
172 * Its only duty is to give correct initialization and destruction
175 class VTKVIEWER_EXPORT VTKViewer_Axis : public vtkObject
179 VTKViewer_Axis(const VTKViewer_Axis&);
180 virtual ~VTKViewer_Axis();
183 /*!vtk type macros.*/
184 vtkTypeMacro(VTKViewer_Axis,vtkObject);
186 /*! Add to \a theRenderer actors: myLineActor,myLabelActor,myArrowActor
188 virtual void AddToRender(vtkRenderer* theRenderer);
189 virtual void RemoveFromRender(vtkRenderer* theRenderer);
191 /*! Sets visibility for actors: myLineActor,myLabelActor,myArrowActor
193 virtual void SetVisibility(VTKViewer_Trihedron::TVisibility theVis);
195 /*! Return visibility of VTKViewer_Axis
196 * \retval myVisibility
198 virtual VTKViewer_Trihedron::TVisibility GetVisibility() { return myVisibility; }
200 /*! Set camera for myLabelActor
202 virtual void SetCamera(vtkCamera* theCamera);
204 /*! Sets \a theProperty for actors: myLineActor,myLabelActor,myArrowActor
206 virtual void SetProperty(vtkProperty* theProperty);
208 /*! Set size of VTKViewer_Axis
210 virtual void SetSize(float theSize);
213 * \retval Return myLabelActor.
215 virtual VTKViewer_UnScaledActor* GetLabel() { return myLabelActor; }
218 * \retval Return myArrowActor
220 virtual VTKViewer_UnScaledActor* GetArrow() { return myArrowActor; }
225 VTKViewer_Trihedron::TVisibility myVisibility;
233 float myDir[3], myRot[3];
235 /*! VTKViewer_LineActor actor pointer
237 VTKViewer_LineActor *myLineActor;
239 /*! VTKViewer_UnScaledActor actor pointer
241 VTKViewer_UnScaledActor *myArrowActor;
243 /*! VTKViewer_UnScaledActor actor pointer
245 VTKViewer_UnScaledActor *myLabelActor;
247 /*! \li myMapper[0] - for the Line pipe-line representation
248 * \li myMapper[1] - for the Arrow pipe-line representation
249 * \li myMapper[2] - for the Label pipe-line representation
251 vtkPolyDataMapper *myMapper[3];
253 /*! vtkLineSource pointer (Line)
255 vtkLineSource *myLineSource;
257 /*! vtkConeSource pointer (Arrow)
259 vtkConeSource *myConeSource;
261 /*! VTKViewer_VectorText pointer (Label)
263 VTKViewer_VectorText* myVectorText;