34 #ifndef __vtkAnnotationROIRepresentation_h 35 #define __vtkAnnotationROIRepresentation_h 38 #include "vtkSlicerAnnotationsModuleVTKWidgetsExport.h" 41 #include "vtkWidgetRepresentation.h" 50 class vtkPointHandleRepresentation3D;
53 class vtkPolyDataAlgorithm;
54 class vtkPolyDataMapper;
56 class vtkSphereSource;
59 class VTK_SLICER_ANNOTATIONS_MODULE_VTKWIDGETS_EXPORT
61 :
public vtkWidgetRepresentation
71 void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
73 static const int NUMBER_HANDLES = 7;
82 void GetPlanes(vtkPlanes *planes);
89 vtkSetMacro(InsideOut,
int);
90 vtkGetMacro(InsideOut,
int);
91 vtkBooleanMacro(InsideOut,
int);
94 void SetWorldToLocalMatrix(vtkMatrix4x4 *worldToLocalMatrix);
95 vtkGetObjectMacro(WorldToLocalMatrix,vtkMatrix4x4);
103 virtual void GetTransform(vtkTransform *t);
110 virtual void SetTransform(vtkTransform* t);
121 void GetPolyData(vtkPolyData *pd);
128 vtkGetObjectMacro(SelectedHandleProperty,vtkProperty);
134 vtkGetObjectMacro(FaceProperty,vtkProperty);
135 vtkGetObjectMacro(SelectedFaceProperty,vtkProperty);
141 vtkGetObjectMacro(OutlineProperty,vtkProperty);
142 vtkGetObjectMacro(SelectedOutlineProperty,vtkProperty);
147 void SetOutlineFaceWires(
int);
148 vtkGetMacro(OutlineFaceWires,
int);
156 void SetOutlineCursorWires(
int);
157 vtkGetMacro(OutlineCursorWires,
int);
169 virtual void PlaceWidget(
double bounds[6]) VTK_OVERRIDE;
170 virtual void BuildRepresentation() VTK_OVERRIDE;
171 virtual
int ComputeInteractionState(
int X,
int Y,
int modify=0) VTK_OVERRIDE;
172 virtual
void StartWidgetInteraction(
double e[2]) VTK_OVERRIDE;
173 virtual
void WidgetInteraction(
double e[2]) VTK_OVERRIDE;
174 virtual
double *GetBounds() VTK_OVERRIDE;
178 virtual
void ReleaseGraphicsResources(vtkWindow*) VTK_OVERRIDE;
179 virtual
int RenderOpaqueGeometry(vtkViewport*) VTK_OVERRIDE;
180 virtual
int RenderTranslucentPolygonalGeometry(vtkViewport*) VTK_OVERRIDE;
181 virtual
int HasTranslucentPolygonalGeometry() VTK_OVERRIDE;
183 enum {Outside=0,MoveF0,MoveF1,MoveF2,MoveF3,MoveF4,MoveF5,
Translating,Rotating,Scaling};
193 virtual void SetInteractionState(
int state);
197 void GetCenter(
double center[]);
201 void GetExtents(
double bounds[]);
203 virtual void GetActors(vtkPropCollection *actors) VTK_OVERRIDE;
211 double LastEventPosition[4];
229 virtual void PositionHandles();
230 virtual int HighlightHandle(vtkProp *prop);
231 virtual void HighlightFace(
int cellId);
232 void HighlightOutline(
int highlight);
233 void ComputeNormals();
234 virtual void SizeHandles();
257 vtkProperty *HandleProperties[NUMBER_HANDLES];
263 virtual void CreateDefaultProperties();
269 void GenerateOutline();
272 virtual void Translate(
double *p1,
double *p2);
273 virtual void Scale(
double *p1,
double *p2,
int X,
int Y);
274 virtual void Rotate(
int X,
int Y,
double *p1,
double *p2,
double *vpn);
275 void MovePlusXFace(
double *p1,
double *p2);
276 void MoveMinusXFace(
double *p1,
double *p2);
277 void MovePlusYFace(
double *p1,
double *p2);
278 void MoveMinusYFace(
double *p1,
double *p2);
279 void MovePlusZFace(
double *p1,
double *p2);
280 void MoveMinusZFace(
double *p1,
double *p2);
291 void MoveFace(
double *p1,
double *p2,
double *dir,
292 double *x1,
double *x2,
double *x3,
double *x4,
296 void GetDirection(
const double Nx[3],
const double Ny[3],
297 const double Nz[3],
double dir[3]);
int InsideOut
Control the orientation of the normals.
vtkPolyDataMapper ** HandleMapper
vtkProperty * SelectedFaceProperty
vtkActor * HexActor
the hexahedron (6 faces)
vtkCellPicker * LastPicker
vtkProperty * FaceProperty
vtkProperty * OutlineProperty
vtkPolyData * HexPolyData
void OutlineFaceWiresOn()
vtkBox * BoundingBox
Support GetBounds() method.
void OutlineCursorWiresOff()
void OutlineCursorWiresOn()
vtkActor * HexOutline
wireframe outline
vtkPolyDataMapper * HexMapper
vtkSphereSource ** HandleGeometry
vtkActor ** Handle
glyphs representing hot spots (e.g., handles)
vtkPolyDataMapper * HexFaceMapper
vtkPoints * PlanePoints
Internal ivars for performance.
vtkMatrix4x4 * WorldToLocalMatrix
vtkProperty * SelectedHandleProperty
vtkProperty * SelectedOutlineProperty
vtkDoubleArray * PlaneNormals
vtkCellPicker * HandlePicker
Do the picking.
vtkPolyDataMapper * OutlineMapper
void OutlineFaceWiresOff()
vtkTransform * Transform
Transform the hexahedral points (used for rotations)
vtkPolyData * OutlinePolyData
vtkActor * HexFace
A face of the hexahedron.
vtkPolyData * HexFacePolyData