50 #ifndef vtkContourRepresentation_h
51 #define vtkContourRepresentation_h
53 #include "vtkInteractionWidgetsModule.h"
57 VTK_ABI_NAMESPACE_BEGIN
83 std::vector<vtkContourRepresentationPoint*>
Points;
93 std::vector<vtkContourRepresentationNode*>
Nodes;
96 for (
unsigned int i = 0; i < this->Nodes.size(); i++)
98 for (
unsigned int j = 0; j < this->Nodes[i]->Points.size(); j++)
100 delete this->Nodes[i]->Points[j];
102 this->Nodes[i]->Points.clear();
103 delete this->Nodes[i];
127 virtual int AddNodeAtWorldPosition(
double x,
double y,
double z);
128 virtual int AddNodeAtWorldPosition(
double worldPos[3]);
129 virtual int AddNodeAtWorldPosition(
double worldPos[3],
double worldOrient[9]);
139 virtual int AddNodeAtDisplayPosition(
double displayPos[2]);
140 virtual int AddNodeAtDisplayPosition(
int displayPos[2]);
141 virtual int AddNodeAtDisplayPosition(
int X,
int Y);
151 virtual int ActivateNode(
double displayPos[2]);
152 virtual int ActivateNode(
int displayPos[2]);
153 virtual int ActivateNode(
int X,
int Y);
161 virtual int SetActiveNodeToWorldPosition(
double pos[3]);
162 virtual int SetActiveNodeToWorldPosition(
double pos[3],
double orient[9]);
172 virtual int SetActiveNodeToDisplayPosition(
double pos[2]);
173 virtual int SetActiveNodeToDisplayPosition(
int pos[2]);
174 virtual int SetActiveNodeToDisplayPosition(
int X,
int Y);
181 virtual int ToggleActiveNodeSelected();
182 virtual int GetActiveNodeSelected();
183 virtual int GetNthNodeSelected(
int);
184 virtual int SetNthNodeSelected(
int);
191 virtual int GetActiveNodeWorldPosition(
double pos[3]);
197 virtual int GetActiveNodeWorldOrientation(
double orient[9]);
203 virtual int GetActiveNodeDisplayPosition(
double pos[2]);
208 virtual int GetNumberOfNodes();
215 virtual int GetNthNodeDisplayPosition(
int n,
double pos[2]);
222 virtual int GetNthNodeWorldPosition(
int n,
double pos[3]);
234 virtual int GetNthNodeWorldOrientation(
int n,
double orient[9]);
245 virtual int SetNthNodeDisplayPosition(
int n,
int X,
int Y);
246 virtual int SetNthNodeDisplayPosition(
int n,
int pos[2]);
247 virtual int SetNthNodeDisplayPosition(
int n,
double pos[2]);
258 virtual int SetNthNodeWorldPosition(
int n,
double pos[3]);
259 virtual int SetNthNodeWorldPosition(
int n,
double pos[3],
double orient[9]);
267 virtual int GetNthNodeSlope(
int idx,
double slope[3]);
276 virtual int GetNumberOfIntermediatePoints(
int n);
284 virtual int GetIntermediatePointWorldPosition(
int n,
int idx,
double point[3]);
291 virtual int AddIntermediatePointWorldPosition(
int n,
double point[3]);
299 virtual int AddIntermediatePointWorldPosition(
int n,
double point[3],
vtkIdType ptId);
305 virtual int DeleteLastNode();
311 virtual int DeleteActiveNode();
317 virtual int DeleteNthNode(
int n);
322 virtual void ClearAllNodes();
328 virtual int AddNodeOnContour(
int X,
int Y);
335 vtkSetClampMacro(PixelTolerance,
int, 1, 100);
336 vtkGetMacro(PixelTolerance,
int);
345 vtkGetMacro(WorldTolerance,
double);
368 vtkGetMacro(CurrentOperation,
int);
445 virtual vtkPolyData* GetContourRepresentationAsPolyData() = 0;
453 vtkSetMacro(RebuildLocator,
bool);
476 void AddNodeAtPositionInternal(
double worldPos[3],
double worldOrient[9],
int displayPos[2]);
477 void AddNodeAtPositionInternal(
double worldPos[3],
double worldOrient[9],
double displayPos[2]);
478 void SetNthNodeWorldPositionInternal(
int n,
double worldPos[3],
double worldOrient[9]);
485 void GetRendererComputedDisplayPositionFromWorldPosition(
486 double worldPos[3],
double worldOrient[9],
int displayPos[2]);
487 void GetRendererComputedDisplayPositionFromWorldPosition(
488 double worldPos[3],
double worldOrient[9],
double displayPos[2]);
491 virtual void UpdateLines(
int index);
492 void UpdateLine(
int idx1,
int idx2);
494 virtual int FindClosestPointOnContour(
int X,
int Y,
double worldPos[3],
int* idx);
496 virtual void BuildLines() = 0;
501 virtual int UpdateContour();
506 mid[0] = (p1[0] + p2[0]) / 2;
507 mid[1] = (p1[1] + p2[1]) / 2;
508 mid[2] = (p1[2] + p2[2]) / 2;
557 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.