41 #ifndef vtkSlicerMarkupsRepresentation_h 42 #define vtkSlicerMarkupsRepresentation_h 44 #include "vtkSlicerMarkupsModuleVTKWidgetsExport.h" 50 #include "vtkSmartPointer.h" 53 class vtkAppendPolyData;
55 class vtkArrayCalculator;
62 class vtkPointSetToLabelHierarchy;
63 class vtkPolyDataMapper2D;
65 class vtkRegularPolygonSource;
66 class vtkSphereSource;
68 class vtkTextProperty;
82 NumberOfControlPointTypes
87 void PrintSelf(ostream& os, vtkIndent indent)
override;
93 void GetActors(vtkPropCollection*)
override;
101 virtual int GetNumberOfControlPoints();
106 virtual int GetNthControlPointDisplayPosition(
int n,
double pos[2]);
119 virtual void UpdateCenter();
122 virtual bool GetTransformationReferencePoint(
double referencePointWorld[3]);
128 int &foundComponentType,
int &foundComponentIndex,
double &closestDistance2);
130 virtual int FindClosestPointOnWidget(
const int displayPos[2],
double worldPos[3],
int *idx);
132 virtual vtkPointPlacer* GetPointPlacer();
136 virtual vtkPolyData* GetControlPointsPolyData(
int controlPointType);
139 virtual vtkPolyData* GetLabelControlPointsPolyData(
int pipeline);
142 virtual vtkStringArray* GetLabels(
int pipeline);
149 bool IsDisplayable();
153 virtual void GetInteractionHandleAxisWorld(
int type,
int index,
double axis[3]);
155 virtual void GetInteractionHandleOriginWorld(
double origin[3]);
162 static int GetGlyphTypeSourceFromDisplay(
int glyphTypeDisplay);
215 vtkSmartPointer<vtkAppendPolyData>
Append;
219 vtkSmartPointer<vtkPolyDataMapper2D>
Mapper;
223 double StartFadeAngle{30};
224 double EndFadeAngle{20};
225 double InteractionHandleScaleFactor{7.0};
227 virtual void InitializePipeline();
228 virtual void CreateRotationHandles();
229 virtual void CreateTranslationHandles();
230 virtual void CreateScaleHandles();
231 virtual void UpdateHandleColors();
234 virtual void SetWidgetScale(
double scale);
237 virtual void GetHandleColor(
int type,
int index,
double color[4]);
239 virtual double GetHandleOpacity(
int type,
int index);
242 virtual void GetViewPlaneNormal(
double normal[3]);
246 virtual void GetInteractionHandlePositionWorld(
int type,
int index,
double position[3]);
249 virtual void GetInteractionHandleAxis(
int type,
int index,
double axis[3]);
251 virtual void GetInteractionHandleAxisWorld(
int type,
int index,
double axis[3]);
253 virtual void GetInteractionHandleOriginWorld(
double origin[3]);
257 HandleInfo(
int index,
int componentType,
double positionWorld[3],
double positionLocal[3],
double color[4])
259 , ComponentType(componentType)
261 for (
int i = 0; i < 3; ++i)
263 this->PositionWorld[i] = positionWorld[i];
265 this->PositionWorld[3] = 1.0;
266 for (
int i = 0; i < 3; ++i)
268 this->PositionLocal[i] = positionLocal[i];
270 this->PositionLocal[3] = 1.0;
271 for (
int i = 0; i < 4; ++i)
273 this->Color[i] = color[i];
278 double PositionLocal[4];
279 double PositionWorld[4];
283 double epsilon = 0.001;
284 return this->Color[3] > epsilon;
289 virtual std::vector<HandleInfo> GetHandleInfoList();
294 virtual void UpdateViewScaleFactor() = 0;
296 virtual void UpdateControlPointSize() = 0;
319 virtual bool GetAllControlPointsVisible();
322 bool GetAllControlPointsSelected();
328 void BuildLine(vtkPolyData* linePolyData,
bool displayPosition);
332 double* GetWidgetColor(
int controlPointType);
336 virtual void SetupInteractionPipeline();
340 virtual void UpdateInteractionPipeline();
Abstract Superclass for all specific types of MRML nodes.