50 #ifndef vtkContourRepresentation_h
51 #define vtkContourRepresentation_h
53 #include "vtkInteractionWidgetsModule.h"
58 VTK_ABI_NAMESPACE_BEGIN
84 std::vector<vtkContourRepresentationPoint*>
Points;
94 std::vector<vtkContourRepresentationNode*>
Nodes;
97 for (
unsigned int i = 0; i < this->Nodes.size(); i++)
99 for (
unsigned int j = 0; j < this->Nodes[i]->Points.size(); j++)
101 delete this->Nodes[i]->Points[j];
103 this->Nodes[i]->Points.clear();
104 delete this->Nodes[i];
129 virtual int AddNodeAtWorldPosition(
double x,
double y,
double z);
130 virtual int AddNodeAtWorldPosition(
double worldPos[3]);
131 virtual int AddNodeAtWorldPosition(
double worldPos[3],
double worldOrient[9]);
141 virtual int AddNodeAtDisplayPosition(
double displayPos[2]);
142 virtual int AddNodeAtDisplayPosition(
int displayPos[2]);
143 virtual int AddNodeAtDisplayPosition(
int X,
int Y);
153 virtual int ActivateNode(
double displayPos[2]);
154 virtual int ActivateNode(
int displayPos[2]);
155 virtual int ActivateNode(
int X,
int Y);
163 virtual int SetActiveNodeToWorldPosition(
double pos[3]);
164 virtual int SetActiveNodeToWorldPosition(
double pos[3],
double orient[9]);
174 virtual int SetActiveNodeToDisplayPosition(
double pos[2]);
175 virtual int SetActiveNodeToDisplayPosition(
int pos[2]);
176 virtual int SetActiveNodeToDisplayPosition(
int X,
int Y);
183 virtual int ToggleActiveNodeSelected();
184 virtual int GetActiveNodeSelected();
185 virtual int GetNthNodeSelected(
int);
186 virtual int SetNthNodeSelected(
int);
193 virtual int GetActiveNodeWorldPosition(
double pos[3]);
199 virtual int GetActiveNodeWorldOrientation(
double orient[9]);
205 virtual int GetActiveNodeDisplayPosition(
double pos[2]);
210 virtual int GetNumberOfNodes();
217 virtual int GetNthNodeDisplayPosition(
int n,
double pos[2]);
224 virtual int GetNthNodeWorldPosition(
int n,
double pos[3]);
236 virtual int GetNthNodeWorldOrientation(
int n,
double orient[9]);
247 virtual int SetNthNodeDisplayPosition(
int n,
int X,
int Y);
248 virtual int SetNthNodeDisplayPosition(
int n,
int pos[2]);
249 virtual int SetNthNodeDisplayPosition(
int n,
double pos[2]);
260 virtual int SetNthNodeWorldPosition(
int n,
double pos[3]);
261 virtual int SetNthNodeWorldPosition(
int n,
double pos[3],
double orient[9]);
269 virtual int GetNthNodeSlope(
int idx,
double slope[3]);
278 virtual int GetNumberOfIntermediatePoints(
int n);
286 virtual int GetIntermediatePointWorldPosition(
int n,
int idx,
double point[3]);
293 virtual int AddIntermediatePointWorldPosition(
int n,
double point[3]);
301 virtual int AddIntermediatePointWorldPosition(
int n,
double point[3],
vtkIdType ptId);
307 virtual int DeleteLastNode();
313 virtual int DeleteActiveNode();
319 virtual int DeleteNthNode(
int n);
324 virtual void ClearAllNodes();
330 virtual int AddNodeOnContour(
int X,
int Y);
337 vtkSetClampMacro(PixelTolerance,
int, 1, 100);
338 vtkGetMacro(PixelTolerance,
int);
347 vtkGetMacro(WorldTolerance,
double);
370 vtkGetMacro(CurrentOperation,
int);
447 virtual vtkPolyData* GetContourRepresentationAsPolyData() = 0;
455 vtkSetMacro(RebuildLocator,
bool);
478 void AddNodeAtPositionInternal(
double worldPos[3],
double worldOrient[9],
int displayPos[2]);
479 void AddNodeAtPositionInternal(
double worldPos[3],
double worldOrient[9],
double displayPos[2]);
480 void SetNthNodeWorldPositionInternal(
int n,
double worldPos[3],
double worldOrient[9]);
487 void GetRendererComputedDisplayPositionFromWorldPosition(
488 double worldPos[3],
double worldOrient[9],
int displayPos[2]);
489 void GetRendererComputedDisplayPositionFromWorldPosition(
490 double worldPos[3],
double worldOrient[9],
double displayPos[2]);
493 virtual void UpdateLines(
int index);
494 void UpdateLine(
int idx1,
int idx2);
496 virtual int FindClosestPointOnContour(
int X,
int Y,
double worldPos[3],
int* idx);
498 virtual void BuildLines() = 0;
503 virtual int UpdateContour();
508 mid[0] = (p1[0] + p2[0]) / 2;
509 mid[1] = (p1[1] + p2[1]) / 2;
510 mid[2] = (p1[2] + p2[2]) / 2;
559 VTK_ABI_NAMESPACE_END
std::vector< vtkContourRepresentationNode * > Nodes
std::vector< vtkContourRepresentationPoint * > Points
void SetCurrentOperationToInactive()
Set / get the current operation.
double NormalizedDisplayPosition[2]
abstract specification for Viewports
record modification and/or execution time
void SetCurrentOperationToTranslate()
Set / get the current operation.
concrete dataset represents vertices, lines, polygons, and triangle strips
vtkIncrementalOctreePointLocator * Locator
Adding a point locator to the representation to speed up lookup of the active node when dealing with ...
double WorldOrientation[9]
represent the vtkContourWidget
void SetCurrentOperationToShift()
Set / get the current operation.
window superclass for vtkRenderWindow
a simple class to control print indentation
void ComputeMidpoint(double p1[3], double p2[3], double mid[3])
list of point or cell ids
Abstract interface to translate 2D display positions to world coordinates.
vtkTimeStamp ContourBuildTime
vtkContourRepresentationInternals * Internal
Defines API for interpolating/modifying nodes from a vtkContourRepresentation.
void SetCurrentOperationToScale()
Set / get the current operation.
double NormalizedDisplayPosition[2]
vtkPointPlacer * PointPlacer
vtkContourLineInterpolator * LineInterpolator
vtkTypeBool ShowSelectedNodes
Incremental octree in support of both point location and point insertion.