vtkPolyhedron Class Reference

#include <vtkPolyhedron.h>

Inheritance diagram for vtkPolyhedron:

Inheritance graph
[legend]
Collaboration diagram for vtkPolyhedron:

Collaboration graph
[legend]

List of all members.


Detailed Description

a 3D cell defined by a set of polygonal faces

vtkPolyhedron is a concrete implementation that represents a 3D cell defined by a set of polygonal faces. The polyhedron should be watertight, non-self-intersecting and manifold (each edge is used twice).

Interpolation functions and weights are defined / computed using the method of Mean Value Coordinates (MVC). See the VTK class vtkMeanValueCoordinatesInterpolator for more information.

The class assumes that the polyhedron is non-convex. However, the polygonal faces should be planar. Non-planar polygonal faces will definitely cause problems, especially in severely warped situations.

See also:
vtkCell3D vtkConvecPointSet vtkMeanValueCoordinatesInterpolator
Tests:
vtkPolyhedron (Tests)

Definition at line 58 of file vtkPolyhedron.h.

typedef vtkCell3D Superclass
static vtkPolyhedronNew ()
static int IsTypeOf (const char *type)
static vtkPolyhedronSafeDownCast (vtkObject *o)
virtual const char * GetClassName ()
virtual int IsA (const char *type)
void PrintSelf (ostream &os, vtkIndent indent)

Public Member Functions

virtual int GetCellType ()
virtual int Triangulate (int index, vtkIdList *ptIds, vtkPoints *pts)
virtual int CellBoundary (int subId, double pcoords[3], vtkIdList *pts)
virtual int GetParametricCenter (double pcoords[3])
int IsPrimaryCell ()
int IsInside (double x[3], double tolerance)
vtkPolyDataGetPolyData ()
virtual void GetEdgePoints (int vtkNotUsed(edgeId), int *&vtkNotUsed(pts))
virtual void GetFacePoints (int vtkNotUsed(faceId), int *&vtkNotUsed(pts))
virtual double * GetParametricCoords ()
virtual int RequiresInitialization ()
virtual void Initialize ()
virtual int GetNumberOfEdges ()
virtual vtkCellGetEdge (int)
virtual int GetNumberOfFaces ()
virtual vtkCellGetFace (int faceId)
virtual void Contour (double value, vtkDataArray *scalars, vtkIncrementalPointLocator *locator, vtkCellArray *verts, vtkCellArray *lines, vtkCellArray *polys, vtkPointData *inPd, vtkPointData *outPd, vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd)
virtual void Clip (double value, vtkDataArray *scalars, vtkIncrementalPointLocator *locator, vtkCellArray *connectivity, vtkPointData *inPd, vtkPointData *outPd, vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd, int insideOut)
virtual int EvaluatePosition (double x[3], double *closestPoint, int &subId, double pcoords[3], double &dist2, double *weights)
virtual void EvaluateLocation (int &subId, double pcoords[3], double x[3], double *weights)
virtual int IntersectWithLine (double p1[3], double p2[3], double tol, double &t, double x[3], double pcoords[3], int &subId)
virtual void Derivatives (int subId, double pcoords[3], double *values, int dim, double *derivs)
virtual void InterpolateFunctions (double x[3], double *sf)
virtual void InterpolateDerivs (double x[3], double *derivs)
virtual int RequiresExplicitFaceRepresentation ()
virtual void SetFaces (vtkIdType *faces)
virtual vtkIdTypeGetFaces ()

Protected Member Functions

 vtkPolyhedron ()
 ~vtkPolyhedron ()
int GenerateEdges ()
void GenerateFaces ()
void ComputeBounds ()
void ComputeParametricCoordinate (double x[3], double pc[3])
void ComputePositionFromParametricCoordinate (double pc[3], double x[3])
void ConstructPolyData ()
void ConstructLocator ()
int InternalContour (double value, int insideOut, vtkIncrementalPointLocator *locator, vtkDataArray *inScalars, vtkDataArray *outScalars, vtkPointData *inPd, vtkPointData *outPd, vtkCellArray *contourPolys, vtkIdToIdVectorMapType &faceToPointsMap, vtkIdToIdVectorMapType &pointToFacesMap, vtkIdToIdMapType &pointIdMap)
int IntersectWithContour (double value, int insideOut, vtkDataArray *inScalars)

Protected Attributes

vtkLineLine
vtkTriangleTriangle
vtkQuadQuad
vtkPolygonPolygon
vtkTetraTetra
vtkIdTypeArrayGlobalFaces
vtkIdTypeArrayFaceLocations
vtkPointIdMap * PointIdMap
int EdgesGenerated
vtkEdgeTableEdgeTable
vtkIdTypeArrayEdges
vtkIdTypeArrayFaces
int FacesGenerated
int BoundsComputed
int PolyDataConstructed
vtkPolyDataPolyData
vtkCellArrayPolys
vtkIdTypeArrayPolyConnectivity
int LocatorConstructed
vtkCellLocatorCellLocator
vtkIdListCellIds
vtkGenericCellCell

Member Typedef Documentation

Standard new methods.

Reimplemented from vtkCell3D.

Definition at line 64 of file vtkPolyhedron.h.


Constructor & Destructor Documentation

vtkPolyhedron::vtkPolyhedron (  )  [protected]

vtkPolyhedron::~vtkPolyhedron (  )  [protected]


Member Function Documentation

static vtkPolyhedron* vtkPolyhedron::New (  )  [static]

Standard new methods.

Reimplemented from vtkObject.

virtual const char* vtkPolyhedron::GetClassName (  )  [virtual]

Standard new methods.

Reimplemented from vtkCell3D.

static int vtkPolyhedron::IsTypeOf ( const char *  type  )  [static]

Standard new methods.

Reimplemented from vtkCell3D.

virtual int vtkPolyhedron::IsA ( const char *  type  )  [virtual]

Standard new methods.

Reimplemented from vtkCell3D.

static vtkPolyhedron* vtkPolyhedron::SafeDownCast ( vtkObject o  )  [static]

Standard new methods.

Reimplemented from vtkCell3D.

void vtkPolyhedron::PrintSelf ( ostream &  os,
vtkIndent  indent 
) [virtual]

Standard new methods.

Reimplemented from vtkCell3D.

virtual void vtkPolyhedron::GetEdgePoints ( int   vtkNotUsededgeId,
int *&  vtkNotUsedpts 
) [inline, virtual]

See vtkCell3D API for description of these methods.

Definition at line 70 of file vtkPolyhedron.h.

virtual void vtkPolyhedron::GetFacePoints ( int   vtkNotUsedfaceId,
int *&  vtkNotUsedpts 
) [inline, virtual]

See vtkCell3D API for description of these methods.

Definition at line 71 of file vtkPolyhedron.h.

virtual double* vtkPolyhedron::GetParametricCoords (  )  [virtual]

See vtkCell3D API for description of these methods.

Reimplemented from vtkCell.

virtual int vtkPolyhedron::GetCellType (  )  [inline, virtual]

See the vtkCell API for descriptions of these methods.

Implements vtkCell.

Definition at line 76 of file vtkPolyhedron.h.

virtual int vtkPolyhedron::RequiresInitialization (  )  [inline, virtual]

This cell requires that it be initialized prior to access.

Reimplemented from vtkCell.

Definition at line 80 of file vtkPolyhedron.h.

virtual void vtkPolyhedron::Initialize (  )  [virtual]

This cell requires that it be initialized prior to access.

Reimplemented from vtkCell.

virtual int vtkPolyhedron::GetNumberOfEdges (  )  [virtual]

A polyhedron is represented internally by a set of polygonal faces. These faces can be processed to explicitly determine edges.

Implements vtkCell.

virtual vtkCell* vtkPolyhedron::GetEdge ( int   )  [virtual]

A polyhedron is represented internally by a set of polygonal faces. These faces can be processed to explicitly determine edges.

Implements vtkCell.

virtual int vtkPolyhedron::GetNumberOfFaces (  )  [virtual]

A polyhedron is represented internally by a set of polygonal faces. These faces can be processed to explicitly determine edges.

Implements vtkCell.

virtual vtkCell* vtkPolyhedron::GetFace ( int  faceId  )  [virtual]

A polyhedron is represented internally by a set of polygonal faces. These faces can be processed to explicitly determine edges.

Implements vtkCell.

virtual void vtkPolyhedron::Contour ( double  value,
vtkDataArray scalars,
vtkIncrementalPointLocator locator,
vtkCellArray verts,
vtkCellArray lines,
vtkCellArray polys,
vtkPointData inPd,
vtkPointData outPd,
vtkCellData inCd,
vtkIdType  cellId,
vtkCellData outCd 
) [virtual]

Satisfy the vtkCell API. This method contours the input polyhedron and outputs a polygon. When the result polygon is not planar, it will be triangulated. The current implementation assumes water-tight polyhedron cells.

Reimplemented from vtkCell3D.

virtual void vtkPolyhedron::Clip ( double  value,
vtkDataArray scalars,
vtkIncrementalPointLocator locator,
vtkCellArray connectivity,
vtkPointData inPd,
vtkPointData outPd,
vtkCellData inCd,
vtkIdType  cellId,
vtkCellData outCd,
int  insideOut 
) [virtual]

Satisfy the vtkCell API. This method clips the input polyhedron and outputs a new polyhedron. The face information of the output polyhedron is encoded in the output vtkCellArray using a special format: CellLength [nCellFaces, nFace0Pts, i, j, k, nFace1Pts, i, j, k, ...]. Use the static method vtkUnstructuredGrid::DecomposePolyhedronCellArray to convert it into a standard format. Note: the algorithm assumes water-tight polyhedron cells.

Reimplemented from vtkCell3D.

virtual int vtkPolyhedron::EvaluatePosition ( double  x[3],
double *  closestPoint,
int &  subId,
double  pcoords[3],
double &  dist2,
double *  weights 
) [virtual]

Satisfy the vtkCell API. The subId is ignored and zero is always returned. The parametric coordinates pcoords are normalized values in the bounding box of the polyhedron. The weights are determined by evaluating the MVC coordinates. The dist is always zero if the point x[3] is inside the polyhedron; otherwise it's the distance to the surface.

Implements vtkCell.

virtual void vtkPolyhedron::EvaluateLocation ( int &  subId,
double  pcoords[3],
double  x[3],
double *  weights 
) [virtual]

The inverse of EvaluatePosition. Note the weights should be the MVC weights.

Implements vtkCell.

virtual int vtkPolyhedron::IntersectWithLine ( double  p1[3],
double  p2[3],
double  tol,
double &  t,
double  x[3],
double  pcoords[3],
int &  subId 
) [virtual]

Intersect the line (p1,p2) with a given tolerance tol to determine a point of intersection x[3] with parametric coordinate t along the line. The parametric coordinates are returned as well (subId can be ignored). Returns the number of intersection points.

Implements vtkCell.

virtual int vtkPolyhedron::Triangulate ( int  index,
vtkIdList ptIds,
vtkPoints pts 
) [virtual]

Use vtkOrderedTriangulator to tetrahedralize the polyhedron mesh. This method works well for a convex polyhedron but may return wrong result in a concave case. Once triangulation has been performed, the results are saved in ptIds and pts. The ptIds is a vtkIdList with 4xn number of ids (n is the number of result tetrahedrons). The first 4 represent the point ids of the first tetrahedron, the second 4 represents the point ids of the second tetrahedron and so on. The point ids represent global dataset ids. The points of result tetrahedons are stored in pts. Note that there are 4xm output points (m is the number of points in the original polyhedron). A point may be stored multiple times when it is shared by more than one tetrahedrons. The points stored in pts are ordered the same as they are listed in ptIds.

Implements vtkCell.

virtual void vtkPolyhedron::Derivatives ( int  subId,
double  pcoords[3],
double *  values,
int  dim,
double *  derivs 
) [virtual]

Computes derivatives at the point specified by the parameter coordinate. Current implementation uses all vertices and subId is not used. To accelerate the speed, the future implementation can triangulate and extract the local tetrahedron from subId and pcoords, then evaluate derivatives on the local tetrahedron.

Implements vtkCell.

virtual int vtkPolyhedron::CellBoundary ( int  subId,
double  pcoords[3],
vtkIdList pts 
) [virtual]

Find the boundary face closest to the point defined by the pcoords[3] and subId of the cell (subId can be ignored).

Implements vtkCell.

int vtkPolyhedron::GetParametricCenter ( double  pcoords[3]  )  [inline, virtual]

Return the center of the cell in parametric coordinates. In this cell, the center of the bounding box is returned.

Reimplemented from vtkCell.

Definition at line 300 of file vtkPolyhedron.h.

int vtkPolyhedron::IsPrimaryCell (  )  [inline, virtual]

A polyhedron is a full-fledged primary cell.

Reimplemented from vtkCell.

Definition at line 183 of file vtkPolyhedron.h.

virtual void vtkPolyhedron::InterpolateFunctions ( double  x[3],
double *  sf 
) [virtual]

Compute the interpolation functions/derivatives (aka shape functions/derivatives). Here we use the MVC calculation process to compute the interpolation functions.

virtual void vtkPolyhedron::InterpolateDerivs ( double  x[3],
double *  derivs 
) [virtual]

Compute the interpolation functions/derivatives (aka shape functions/derivatives). Here we use the MVC calculation process to compute the interpolation functions.

virtual int vtkPolyhedron::RequiresExplicitFaceRepresentation (  )  [inline, virtual]

Methods supporting the definition of faces. Note that the GetFaces() returns a list of faces in vtkCellArray form; use the method GetNumberOfFaces() to determine the number of faces in the list. The SetFaces() method is also in vtkCellArray form, except that it begins with a leading count indicating the total number of faces in the list.

Reimplemented from vtkCell.

Definition at line 200 of file vtkPolyhedron.h.

virtual void vtkPolyhedron::SetFaces ( vtkIdType faces  )  [virtual]

Methods supporting the definition of faces. Note that the GetFaces() returns a list of faces in vtkCellArray form; use the method GetNumberOfFaces() to determine the number of faces in the list. The SetFaces() method is also in vtkCellArray form, except that it begins with a leading count indicating the total number of faces in the list.

virtual vtkIdType* vtkPolyhedron::GetFaces (  )  [virtual]

Methods supporting the definition of faces. Note that the GetFaces() returns a list of faces in vtkCellArray form; use the method GetNumberOfFaces() to determine the number of faces in the list. The SetFaces() method is also in vtkCellArray form, except that it begins with a leading count indicating the total number of faces in the list.

Reimplemented from vtkCell.

int vtkPolyhedron::IsInside ( double  x[3],
double  tolerance 
)

vtkPolyData* vtkPolyhedron::GetPolyData (  ) 

Construct polydata if no one exist, then return this->PolyData

int vtkPolyhedron::GenerateEdges (  )  [protected]

void vtkPolyhedron::GenerateFaces (  )  [protected]

void vtkPolyhedron::ComputeBounds (  )  [protected]

void vtkPolyhedron::ComputeParametricCoordinate ( double  x[3],
double  pc[3] 
) [protected]

void vtkPolyhedron::ComputePositionFromParametricCoordinate ( double  pc[3],
double  x[3] 
) [protected]

void vtkPolyhedron::ConstructPolyData (  )  [protected]

void vtkPolyhedron::ConstructLocator (  )  [protected]

int vtkPolyhedron::InternalContour ( double  value,
int  insideOut,
vtkIncrementalPointLocator locator,
vtkDataArray inScalars,
vtkDataArray outScalars,
vtkPointData inPd,
vtkPointData outPd,
vtkCellArray contourPolys,
vtkIdToIdVectorMapType &  faceToPointsMap,
vtkIdToIdVectorMapType &  pointToFacesMap,
vtkIdToIdMapType &  pointIdMap 
) [protected]

int vtkPolyhedron::IntersectWithContour ( double  value,
int  insideOut,
vtkDataArray inScalars 
) [protected]


Member Data Documentation

Definition at line 220 of file vtkPolyhedron.h.

Definition at line 221 of file vtkPolyhedron.h.

Definition at line 222 of file vtkPolyhedron.h.

Definition at line 223 of file vtkPolyhedron.h.

Definition at line 224 of file vtkPolyhedron.h.

Definition at line 225 of file vtkPolyhedron.h.

Definition at line 226 of file vtkPolyhedron.h.

vtkPointIdMap* vtkPolyhedron::PointIdMap [protected]

Definition at line 233 of file vtkPolyhedron.h.

Definition at line 237 of file vtkPolyhedron.h.

Definition at line 238 of file vtkPolyhedron.h.

Definition at line 239 of file vtkPolyhedron.h.

Definition at line 245 of file vtkPolyhedron.h.

Definition at line 246 of file vtkPolyhedron.h.

Definition at line 250 of file vtkPolyhedron.h.

Definition at line 256 of file vtkPolyhedron.h.

Definition at line 257 of file vtkPolyhedron.h.

Definition at line 258 of file vtkPolyhedron.h.

Definition at line 259 of file vtkPolyhedron.h.

Definition at line 261 of file vtkPolyhedron.h.

Definition at line 262 of file vtkPolyhedron.h.

Definition at line 264 of file vtkPolyhedron.h.

Definition at line 265 of file vtkPolyhedron.h.


The documentation for this class was generated from the following file:

Generated on Wed Aug 24 11:57:27 2011 for VTK by  doxygen 1.5.6