62 #ifndef vtkContourRepresentation_h
63 #define vtkContourRepresentation_h
65 #include "vtkInteractionWidgetsModule.h"
94 std::vector<vtkContourRepresentationPoint*>
Points;
104 std::vector<vtkContourRepresentationNode*>
Nodes;
107 for (
unsigned int i = 0; i < this->Nodes.size(); i++)
109 for (
unsigned int j = 0; j < this->Nodes[i]->Points.size(); j++)
111 delete this->Nodes[i]->Points[j];
113 this->Nodes[i]->Points.clear();
114 delete this->Nodes[i];
138 virtual int AddNodeAtWorldPosition(
double x,
double y,
double z);
139 virtual int AddNodeAtWorldPosition(
double worldPos[3]);
140 virtual int AddNodeAtWorldPosition(
double worldPos[3],
double worldOrient[9]);
150 virtual int AddNodeAtDisplayPosition(
double displayPos[2]);
151 virtual int AddNodeAtDisplayPosition(
int displayPos[2]);
152 virtual int AddNodeAtDisplayPosition(
int X,
int Y);
162 virtual int ActivateNode(
double displayPos[2]);
163 virtual int ActivateNode(
int displayPos[2]);
164 virtual int ActivateNode(
int X,
int Y);
172 virtual int SetActiveNodeToWorldPosition(
double pos[3]);
173 virtual int SetActiveNodeToWorldPosition(
double pos[3],
double orient[9]);
183 virtual int SetActiveNodeToDisplayPosition(
double pos[2]);
184 virtual int SetActiveNodeToDisplayPosition(
int pos[2]);
185 virtual int SetActiveNodeToDisplayPosition(
int X,
int Y);
192 virtual int ToggleActiveNodeSelected();
193 virtual int GetActiveNodeSelected();
194 virtual int GetNthNodeSelected(
int);
195 virtual int SetNthNodeSelected(
int);
202 virtual int GetActiveNodeWorldPosition(
double pos[3]);
208 virtual int GetActiveNodeWorldOrientation(
double orient[9]);
214 virtual int GetActiveNodeDisplayPosition(
double pos[2]);
219 virtual int GetNumberOfNodes();
226 virtual int GetNthNodeDisplayPosition(
int n,
double pos[2]);
233 virtual int GetNthNodeWorldPosition(
int n,
double pos[3]);
245 virtual int GetNthNodeWorldOrientation(
int n,
double orient[9]);
256 virtual int SetNthNodeDisplayPosition(
int n,
int X,
int Y);
257 virtual int SetNthNodeDisplayPosition(
int n,
int pos[2]);
258 virtual int SetNthNodeDisplayPosition(
int n,
double pos[2]);
269 virtual int SetNthNodeWorldPosition(
int n,
double pos[3]);
270 virtual int SetNthNodeWorldPosition(
int n,
double pos[3],
double orient[9]);
278 virtual int GetNthNodeSlope(
int idx,
double slope[3]);
287 virtual int GetNumberOfIntermediatePoints(
int n);
295 virtual int GetIntermediatePointWorldPosition(
int n,
int idx,
double point[3]);
302 virtual int AddIntermediatePointWorldPosition(
int n,
double point[3]);
310 virtual int AddIntermediatePointWorldPosition(
int n,
double point[3],
vtkIdType ptId);
316 virtual int DeleteLastNode();
322 virtual int DeleteActiveNode();
328 virtual int DeleteNthNode(
int n);
333 virtual void ClearAllNodes();
339 virtual int AddNodeOnContour(
int X,
int Y);
346 vtkSetClampMacro(PixelTolerance,
int, 1, 100);
347 vtkGetMacro(PixelTolerance,
int);
356 vtkGetMacro(WorldTolerance,
double);
379 vtkGetMacro(CurrentOperation,
int);
456 virtual vtkPolyData* GetContourRepresentationAsPolyData() = 0;
464 vtkSetMacro(RebuildLocator,
bool);
487 void AddNodeAtPositionInternal(
double worldPos[3],
double worldOrient[9],
int displayPos[2]);
488 void AddNodeAtPositionInternal(
double worldPos[3],
double worldOrient[9],
double displayPos[2]);
489 void SetNthNodeWorldPositionInternal(
int n,
double worldPos[3],
double worldOrient[9]);
496 void GetRendererComputedDisplayPositionFromWorldPosition(
497 double worldPos[3],
double worldOrient[9],
int displayPos[2]);
498 void GetRendererComputedDisplayPositionFromWorldPosition(
499 double worldPos[3],
double worldOrient[9],
double displayPos[2]);
502 virtual void UpdateLines(
int index);
503 void UpdateLine(
int idx1,
int idx2);
505 virtual int FindClosestPointOnContour(
int X,
int Y,
double worldPos[3],
int* idx);
507 virtual void BuildLines() = 0;
512 virtual int UpdateContour();
517 mid[0] = (p1[0] + p2[0]) / 2;
518 mid[1] = (p1[1] + p2[1]) / 2;
519 mid[2] = (p1[2] + p2[2]) / 2;
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.