59 #ifndef vtkContourRepresentation_h
60 #define vtkContourRepresentation_h
92 std::vector<vtkContourRepresentationPoint*>
Points;
102 std::vector<vtkContourRepresentationNode*>
Nodes;
105 for(
unsigned int i=0;i<this->Nodes.size();i++)
107 for (
unsigned int j=0;j<this->Nodes[i]->Points.size();j++)
109 delete this->Nodes[i]->Points[j];
111 this->Nodes[i]->Points.clear();
112 delete this->Nodes[i];
134 virtual int AddNodeAtWorldPosition(
double x,
double y,
double z);
135 virtual int AddNodeAtWorldPosition(
double worldPos[3] );
136 virtual int AddNodeAtWorldPosition(
double worldPos[3],
137 double worldOrient[9] );
144 virtual int AddNodeAtDisplayPosition(
double displayPos[2] );
145 virtual int AddNodeAtDisplayPosition(
int displayPos[2] );
146 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],
172 virtual int SetActiveNodeToDisplayPosition(
double pos[2] );
173 virtual int SetActiveNodeToDisplayPosition(
int pos[2] );
174 virtual int SetActiveNodeToDisplayPosition(
int X,
int Y );
179 virtual int ToggleActiveNodeSelected();
180 virtual int GetActiveNodeSelected();
181 virtual int GetNthNodeSelected(
int);
182 virtual int SetNthNodeSelected(
int);
187 virtual int GetActiveNodeWorldPosition(
double pos[3] );
191 virtual int GetActiveNodeWorldOrientation(
double orient[9] );
195 virtual int GetActiveNodeDisplayPosition(
double pos[2] );
198 virtual int GetNumberOfNodes();
202 virtual int GetNthNodeDisplayPosition(
int n,
double pos[2] );
206 virtual int GetNthNodeWorldPosition(
int n,
double pos[3] );
217 virtual int GetNthNodeWorldOrientation(
int n,
double orient[9] );
225 virtual int SetNthNodeDisplayPosition(
int n,
int X,
int Y );
226 virtual int SetNthNodeDisplayPosition(
int n,
int pos[2] );
227 virtual int SetNthNodeDisplayPosition(
int n,
double pos[2] );
234 virtual int SetNthNodeWorldPosition(
int n,
double pos[3] );
235 virtual int SetNthNodeWorldPosition(
int n,
double pos[3],
241 virtual int GetNthNodeSlope(
int idx,
double slope[3] );
250 virtual int GetNumberOfIntermediatePoints(
int n );
256 virtual int GetIntermediatePointWorldPosition(
int n,
257 int idx,
double point[3] );
264 virtual int AddIntermediatePointWorldPosition(
int n,
272 virtual int AddIntermediatePointWorldPosition(
int n,
278 virtual int DeleteLastNode();
282 virtual int DeleteActiveNode();
285 virtual int DeleteNthNode(
int n );
288 virtual void ClearAllNodes();
292 virtual int AddNodeOnContour(
int X,
int Y );
297 vtkSetClampMacro(PixelTolerance,
int,1,100);
298 vtkGetMacro(PixelTolerance,
int);
305 vtkGetMacro(WorldTolerance,
double);
325 vtkGetMacro( CurrentOperation,
int );
326 vtkSetClampMacro( CurrentOperation,
int,
374 void SetClosedLoop(
int val );
375 vtkGetMacro( ClosedLoop,
int );
376 vtkBooleanMacro( ClosedLoop,
int );
382 virtual void SetShowSelectedNodes(
int);
383 vtkGetMacro( ShowSelectedNodes,
int );
384 vtkBooleanMacro( ShowSelectedNodes,
int );
390 virtual vtkPolyData* GetContourRepresentationAsPolyData() = 0;
398 vtkSetMacro(RebuildLocator,
bool);
421 void AddNodeAtPositionInternal(
double worldPos[3],
422 double worldOrient[9],
int displayPos[2] );
423 void AddNodeAtPositionInternal(
double worldPos[3],
424 double worldOrient[9],
double displayPos[2] );
425 void SetNthNodeWorldPositionInternal(
int n,
double worldPos[3],
426 double worldOrient[9] );
431 void GetRendererComputedDisplayPositionFromWorldPosition(
double worldPos[3],
432 double worldOrient[9],
int displayPos[2] );
433 void GetRendererComputedDisplayPositionFromWorldPosition(
double worldPos[3],
434 double worldOrient[9],
double displayPos[2] );
437 virtual void UpdateLines(
int index );
438 void UpdateLine(
int idx1,
int idx2 );
440 virtual int FindClosestPointOnContour(
int X,
int Y,
444 virtual void BuildLines()=0;
451 virtual int UpdateContour();
456 mid[0] = (p1[0] + p2[0])/2;
457 mid[1] = (p1[1] + p2[1])/2;
458 mid[2] = (p1[2] + p2[2])/2;
std::vector< vtkContourRepresentationNode * > Nodes
std::vector< vtkContourRepresentationPoint * > Points
void SetCurrentOperationToInactive()
double NormalizedDisplayPosition[2]
abstract specification for Viewports
record modification and/or execution time
void SetCurrentOperationToTranslate()
concrete dataset represents vertices, lines, polygons, and triangle strips
vtkIncrementalOctreePointLocator * Locator
double WorldOrientation[9]
represent the vtkContourWidget
void SetCurrentOperationToShift()
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()
double NormalizedDisplayPosition[2]
vtkPointPlacer * PointPlacer
vtkContourLineInterpolator * LineInterpolator
Incremental octree in support of both point location and point insertion.