VTK
Public Member Functions | Protected Member Functions | Protected Attributes
vtkPolyhedron Class Reference

a 3D cell defined by a set of polygonal faces More...

#include <vtkPolyhedron.h>

Inheritance diagram for vtkPolyhedron:
[legend]
Collaboration diagram for vtkPolyhedron:
[legend]

List of all members.

- Public Types inherited from vtkCell3D - Public Types inherited from vtkCell - Public Types inherited from vtkObject

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 ()
- Public Member Functions inherited from vtkCell3D
virtual void GetEdgePoints (int edgeId, int *&pts)=0
virtual void GetFacePoints (int faceId, int *&pts)=0
virtual int GetCellDimension ()
virtual void SetMergeTolerance (double)
virtual double GetMergeTolerance ()
- Public Member Functions inherited from vtkCell
void Initialize (int npts, vtkIdType *pts, vtkPoints *p)
virtual void ShallowCopy (vtkCell *c)
virtual void DeepCopy (vtkCell *c)
virtual int IsLinear ()
virtual int IsExplicitCell ()
vtkPointsGetPoints ()
vtkIdType GetNumberOfPoints ()
vtkIdListGetPointIds ()
vtkIdType GetPointId (int ptId)
void GetBounds (double bounds[6])
double * GetBounds ()
double GetLength2 ()
virtual double GetParametricDistance (double pcoords[3])
virtual void SetFaces (vtkIdType *vtkNotUsed(faces))
virtual void InterpolateFunctions (double pcoords[3], double weights[3])
virtual void InterpolateDerivs (double pcoords[3], double derivs[3])
- Public Member Functions inherited from vtkObject
virtual void DebugOn ()
virtual void DebugOff ()
unsigned char GetDebug ()
void SetDebug (unsigned char debugFlag)
virtual void Modified ()
virtual unsigned long GetMTime ()
unsigned long AddObserver (unsigned long event, vtkCommand *, float priority=0.0f)
unsigned long AddObserver (const char *event, vtkCommand *, float priority=0.0f)
vtkCommandGetCommand (unsigned long tag)
void RemoveObserver (vtkCommand *)
void RemoveObservers (unsigned long event, vtkCommand *)
void RemoveObservers (const char *event, vtkCommand *)
int HasObserver (unsigned long event, vtkCommand *)
int HasObserver (const char *event, vtkCommand *)
void RemoveObserver (unsigned long tag)
void RemoveObservers (unsigned long event)
void RemoveObservers (const char *event)
void RemoveAllObservers ()
int HasObserver (unsigned long event)
int HasObserver (const char *event)
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f)
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
int InvokeEvent (unsigned long event, void *callData)
int InvokeEvent (const char *event, void *callData)
int InvokeEvent (unsigned long event)
int InvokeEvent (const char *event)
- Public Member Functions inherited from vtkObjectBase
const char * GetClassName () const
virtual void Delete ()
virtual void FastDelete ()
void Print (ostream &os)
virtual void Register (vtkObjectBase *o)
virtual void UnRegister (vtkObjectBase *o)
void SetReferenceCount (int)
void PrintRevisions (ostream &os)
virtual void PrintHeader (ostream &os, vtkIndent indent)
virtual void PrintTrailer (ostream &os, vtkIndent indent)
int GetReferenceCount ()

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 Member Functions inherited from vtkCell3D
 vtkCell3D ()
 ~vtkCell3D ()
- Protected Member Functions inherited from vtkCell
 vtkCell ()
 ~vtkCell ()
- Protected Member Functions inherited from vtkObject
 vtkObject ()
virtual ~vtkObject ()
virtual void RegisterInternal (vtkObjectBase *, int check)
virtual void UnRegisterInternal (vtkObjectBase *, int check)
void InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL)
void InternalReleaseFocus ()
- Protected Member Functions inherited from vtkObjectBase
 vtkObjectBase ()
virtual ~vtkObjectBase ()
virtual void CollectRevisions (ostream &os)
virtual void ReportReferences (vtkGarbageCollector *)
 vtkObjectBase (const vtkObjectBase &)
void operator= (const vtkObjectBase &)

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
- Protected Attributes inherited from vtkCell3D
vtkOrderedTriangulatorTriangulator
double MergeTolerance
vtkTetraClipTetra
vtkDoubleArrayClipScalars
- Protected Attributes inherited from vtkCell
double Bounds [6]
- Protected Attributes inherited from vtkObject
unsigned char Debug
vtkTimeStamp MTime
vtkSubjectHelper * SubjectHelper
- Protected Attributes inherited from vtkObjectBase
int ReferenceCount
vtkWeakPointerBase ** WeakPointers
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)

Additional Inherited 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.


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 
)
inlinevirtual

See vtkCell3D API for description of these methods.

Definition at line 70 of file vtkPolyhedron.h.

virtual void vtkPolyhedron::GetFacePoints ( int   vtkNotUsedfaceId,
int *&  vtkNotUsedpts 
)
inlinevirtual

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 ( )
inlinevirtual

See the vtkCell API for descriptions of these methods.

Implements vtkCell.

Definition at line 76 of file vtkPolyhedron.h.

virtual int vtkPolyhedron::RequiresInitialization ( )
inlinevirtual

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])
inlinevirtual

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 ( )
inlinevirtual

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 ( )
inlinevirtual

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

vtkLine* vtkPolyhedron::Line
protected

Definition at line 220 of file vtkPolyhedron.h.

vtkTriangle* vtkPolyhedron::Triangle
protected

Definition at line 221 of file vtkPolyhedron.h.

vtkQuad* vtkPolyhedron::Quad
protected

Definition at line 222 of file vtkPolyhedron.h.

vtkPolygon* vtkPolyhedron::Polygon
protected

Definition at line 223 of file vtkPolyhedron.h.

vtkTetra* vtkPolyhedron::Tetra
protected

Definition at line 224 of file vtkPolyhedron.h.

vtkIdTypeArray* vtkPolyhedron::GlobalFaces
protected

Definition at line 225 of file vtkPolyhedron.h.

vtkIdTypeArray* vtkPolyhedron::FaceLocations
protected

Definition at line 226 of file vtkPolyhedron.h.

vtkPointIdMap* vtkPolyhedron::PointIdMap
protected

Definition at line 233 of file vtkPolyhedron.h.

int vtkPolyhedron::EdgesGenerated
protected

Definition at line 237 of file vtkPolyhedron.h.

vtkEdgeTable* vtkPolyhedron::EdgeTable
protected

Definition at line 238 of file vtkPolyhedron.h.

vtkIdTypeArray* vtkPolyhedron::Edges
protected

Definition at line 239 of file vtkPolyhedron.h.

vtkIdTypeArray* vtkPolyhedron::Faces
protected

Definition at line 245 of file vtkPolyhedron.h.

int vtkPolyhedron::FacesGenerated
protected

Definition at line 246 of file vtkPolyhedron.h.

int vtkPolyhedron::BoundsComputed
protected

Definition at line 250 of file vtkPolyhedron.h.

int vtkPolyhedron::PolyDataConstructed
protected

Definition at line 256 of file vtkPolyhedron.h.

vtkPolyData* vtkPolyhedron::PolyData
protected

Definition at line 257 of file vtkPolyhedron.h.

vtkCellArray* vtkPolyhedron::Polys
protected

Definition at line 258 of file vtkPolyhedron.h.

vtkIdTypeArray* vtkPolyhedron::PolyConnectivity
protected

Definition at line 259 of file vtkPolyhedron.h.

int vtkPolyhedron::LocatorConstructed
protected

Definition at line 261 of file vtkPolyhedron.h.

vtkCellLocator* vtkPolyhedron::CellLocator
protected

Definition at line 262 of file vtkPolyhedron.h.

vtkIdList* vtkPolyhedron::CellIds
protected

Definition at line 264 of file vtkPolyhedron.h.

vtkGenericCell* vtkPolyhedron::Cell
protected

Definition at line 265 of file vtkPolyhedron.h.


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