VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
vtkBridgeCell Class Reference

Implementation of vtkGenericAdaptorCell. More...

#include <vtkBridgeCell.h>

Inherits vtkGenericAdaptorCell.

Collaboration diagram for vtkBridgeCell:
[legend]

Public Types

typedef vtkGenericAdaptorCell Superclass
 

Public Member Functions

virtual int IsA (const char *type)
 
vtkBridgeCellNewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent)
 
virtual vtkIdType GetId ()
 
virtual int IsInDataSet ()
 
virtual int GetType ()
 
virtual int GetDimension ()
 
virtual int GetGeometryOrder ()
 
int IsGeometryLinear ()
 
virtual int GetAttributeOrder (vtkGenericAttribute *a)
 
int IsAttributeLinear (vtkGenericAttribute *a)
 
virtual int IsPrimary ()
 
virtual int GetNumberOfPoints ()
 
virtual int GetNumberOfBoundaries (int dim=-1)
 
virtual int GetNumberOfDOFNodes ()
 
virtual void GetPointIterator (vtkGenericPointIterator *it)
 
virtual vtkGenericCellIterator * NewCellIterator ()
 
virtual void GetBounds (double bounds[6])
 
virtual double * GetBounds ()
 
virtual double GetLength2 ()
 
virtual int GetParametricCenter (double pcoords[3])
 
virtual double GetParametricDistance (double pcoords[3])
 
int * GetFaceArray (int faceId)
 
int GetNumberOfVerticesOnFace (int faceId)
 
int * GetEdgeArray (int edgeId)
 
void DeepCopy (vtkBridgeCell *other)
 
virtual void GetBoundaryIterator (vtkGenericCellIterator *boundaries, int dim=-1)
 
virtual int CountNeighbors (vtkGenericAdaptorCell *boundary)
 
void CountEdgeNeighbors (int *sharing)
 
virtual void GetNeighbors (vtkGenericAdaptorCell *boundary, vtkGenericCellIterator *neighbors)
 
virtual int FindClosestBoundary (int subId, double pcoords[3], vtkGenericCellIterator *&boundary)
 
virtual int EvaluatePosition (double x[3], double *closestPoint, int &subId, double pcoords[3], double &dist2)
 
virtual void EvaluateLocation (int subId, double pcoords[3], double x[3])
 
virtual void InterpolateTuple (vtkGenericAttribute *a, double pcoords[3], double *val)
 
virtual void InterpolateTuple (vtkGenericAttributeCollection *c, double pcoords[3], double *val)
 
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], vtkGenericAttribute *attribute, double *derivs)
 
virtual double * GetParametricCoords ()
 
virtual int IsFaceOnBoundary (vtkIdType faceId)
 
virtual int IsOnBoundary ()
 
virtual void GetPointIds (vtkIdType *id)
 
void Init (vtkBridgeDataSet *ds, vtkIdType cellid)
 
void InitWithCell (vtkCell *c, vtkIdType id)
 

Static Public Member Functions

static vtkBridgeCellNew ()
 
static int IsTypeOf (const char *type)
 
static vtkBridgeCellSafeDownCast (vtkObjectBase *o)
 

Protected Member Functions

virtual vtkObjectBase * NewInstanceInternal () const
 
 vtkBridgeCell ()
 
virtual ~vtkBridgeCell ()
 
void AllocateWeights ()
 
void InterpolationFunctions (double pcoords[3], double *weights)
 

Protected Attributes

vtkCell * Cell
 
vtkBridgeDataSetDataSet
 
vtkIdType Id
 
int BoolIsInDataSet
 
vtkBridgeCellIteratorInternalIterator
 
double * Weights
 
int WeightsCapacity
 

Friends

class vtkBridgeDataSet
 
class vtkBridgeAttribute
 
class vtkBridgeCellIterator
 
class vtkBridgeCellIteratorOnDataSet
 
class vtkBridgeCellIteratorOne
 
class vtkBridgeCellIteratorOnCellBoundaries
 
class vtkBridgePointIteratorOnCell
 

Detailed Description

Implementation of vtkGenericAdaptorCell.

It is just an example that show how to implement the Generic. It is also used for testing and evaluating the Generic.

See Also
vtkGenericAdaptorCell, vtkBridgeDataSet
Tests:
vtkBridgeCell (Tests)

Definition at line 37 of file vtkBridgeCell.h.

Member Typedef Documentation

typedef vtkGenericAdaptorCell vtkBridgeCell::Superclass

Definition at line 41 of file vtkBridgeCell.h.

Constructor & Destructor Documentation

vtkBridgeCell::vtkBridgeCell ( )
protected
virtual vtkBridgeCell::~vtkBridgeCell ( )
protectedvirtual

Member Function Documentation

static vtkBridgeCell* vtkBridgeCell::New ( )
static
static int vtkBridgeCell::IsTypeOf ( const char *  type)
static
virtual int vtkBridgeCell::IsA ( const char *  type)
virtual
static vtkBridgeCell* vtkBridgeCell::SafeDownCast ( vtkObjectBase *  o)
static
virtual vtkObjectBase* vtkBridgeCell::NewInstanceInternal ( ) const
protectedvirtual
vtkBridgeCell* vtkBridgeCell::NewInstance ( ) const
void vtkBridgeCell::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
virtual vtkIdType vtkBridgeCell::GetId ( )
virtual

Unique identification number of the cell over the whole data set. This unique key may not be contiguous.

virtual int vtkBridgeCell::IsInDataSet ( )
virtual

Does `this' a cell of a dataset? (otherwise, it is a boundary cell)

virtual int vtkBridgeCell::GetType ( )
virtual

Type of the current cell.

Postcondition
(result==VTK_HIGHER_ORDER_EDGE)|| (result==VTK_HIGHER_ORDER_TRIANGLE)|| (result==VTK_HIGHER_ORDER_TETRAHEDRON)
virtual int vtkBridgeCell::GetDimension ( )
virtual

Topological dimension of the current cell.

Postcondition
valid_result: result>=0 && result<=3
virtual int vtkBridgeCell::GetGeometryOrder ( )
virtual

Interpolation order of the geometry.

Postcondition
positive_result: result>=0
int vtkBridgeCell::IsGeometryLinear ( )

Does the cell have no higher-order interpolation for geometry?

Postcondition
definition: result==(GetGeometryOrder()==1)
virtual int vtkBridgeCell::GetAttributeOrder ( vtkGenericAttribute *  a)
virtual

Interpolation order of attribute `a' on the cell (may differ by cell).

Precondition
a_exists: a!=0
Postcondition
positive_result: result>=0
int vtkBridgeCell::IsAttributeLinear ( vtkGenericAttribute *  a)

Does the attribute `a' have no higher-order interpolation for the cell?

Precondition
a_exists: a!=0
Postcondition
definition: result==(GetAttributeOrder()==1)
virtual int vtkBridgeCell::IsPrimary ( )
virtual

Is the cell primary (i.e. not composite) ?

virtual int vtkBridgeCell::GetNumberOfPoints ( )
virtual

Number of points that compose the cell.

Postcondition
positive_result: result>=0
virtual int vtkBridgeCell::GetNumberOfBoundaries ( int  dim = -1)
virtual

Return the number of boundaries of dimension `dim' (or all dimensions greater than 0 and less than GetDimension() if -1) of the cell. When dim is -1, the number of vertices is not included in the count because vertices are a special case: a vertex will have at most a single field value associated with it; DOF nodes may have an arbitrary number of field values associated with them.

Precondition
valid_dim_range: (dim==-1) || ((dim>=0)&&(dim<GetDimension()))
Postcondition
positive_result: result>=0
virtual int vtkBridgeCell::GetNumberOfDOFNodes ( )
virtual

Accumulated number of DOF nodes of the current cell. A DOF node is a component of cell with a given topological dimension. e.g.: a triangle has 4 DOF: 1 face and 3 edges. An hexahedron has 19 DOF: 1 region, 6 faces, and 12 edges. The number of vertices is not included in the count because vertices are a special case: a vertex will have at most a single field value associated with it; DOF nodes may have an arbitrary number of field values associated with them.

Postcondition
valid_result: result==GetNumberOfBoundaries(-1)+1
virtual void vtkBridgeCell::GetPointIterator ( vtkGenericPointIterator *  it)
virtual

Return the points of cell into `it'.

Precondition
it_exists: it!=0
virtual vtkGenericCellIterator* vtkBridgeCell::NewCellIterator ( )
virtual

Create an empty cell iterator.

Postcondition
result_exists: result!=0
virtual void vtkBridgeCell::GetBoundaryIterator ( vtkGenericCellIterator *  boundaries,
int  dim = -1 
)
virtual

Return in `boundaries' the cells of dimension `dim' (or all dimensions less than GetDimension() if -1) that are part of the boundary of the cell.

Precondition
valid_dim_range: (dim==-1) || ((dim>=0)&&(dim<GetDimension()))
boundaries_exist: boundaries!=0
virtual int vtkBridgeCell::CountNeighbors ( vtkGenericAdaptorCell *  boundary)
virtual

Number of cells (dimension>boundary->GetDimension()) of the dataset that share the boundary `boundary' of `this'. `this' IS NOT INCLUDED.

Precondition
boundary_exists: boundary!=0
real_boundary: !boundary->IsInDataSet()
cell_of_the_dataset: IsInDataSet()
boundary: HasBoundary(boundary)
Postcondition
positive_result: result>=0
void vtkBridgeCell::CountEdgeNeighbors ( int *  sharing)

Number of cells (dimension>boundary->GetDimension()) of the dataset that share the boundary `boundary' of `this'. `this' IS NOT INCLUDED.

Precondition
boundary_exists: boundary!=0
real_boundary: !boundary->IsInDataSet()
cell_of_the_dataset: IsInDataSet()
boundary: HasBoundary(boundary)
Postcondition
positive_result: result>=0
virtual void vtkBridgeCell::GetNeighbors ( vtkGenericAdaptorCell *  boundary,
vtkGenericCellIterator *  neighbors 
)
virtual

Put into `neighbors' the cells (dimension>boundary->GetDimension()) of the dataset that share the boundary `boundary' of `this'. `this' IS NOT INCLUDED.

Precondition
boundary_exists: boundary!=0
real_boundary: !boundary->IsInDataSet()
cell_of_the_dataset: IsInDataSet()
boundary: HasBoundary(boundary)
neighbors_exist: neighbors!=0
virtual int vtkBridgeCell::FindClosestBoundary ( int  subId,
double  pcoords[3],
vtkGenericCellIterator *&  boundary 
)
virtual

Compute the closest boundary of the current sub-cell `subId' for point `pcoord' (in parametric coordinates) in `boundary', and return whether the point is inside the cell or not. `boundary' is of dimension GetDimension()-1.

Precondition
positive_subId: subId>=0
virtual int vtkBridgeCell::EvaluatePosition ( double  x[3],
double *  closestPoint,
int &  subId,
double  pcoords[3],
double &  dist2 
)
virtual

Is `x' inside the current cell? It also evaluate parametric coordinates `pcoords', sub-cell id `subId' (0 means primary cell), distance squared to the sub-cell in `dist2' and closest corner point `closestPoint'. `dist2' and `closestPoint' are not evaluated if `closestPoint'==0. If a numerical error occurred, -1 is returned and all other results should be ignored.

Postcondition
valid_result: result==-1 || result==0 || result==1
positive_distance: result!=-1 implies (closestPoint!=0 implies dist2>=0)
virtual void vtkBridgeCell::EvaluateLocation ( int  subId,
double  pcoords[3],
double  x[3] 
)
virtual

Determine global coordinates `x' from sub-cell `subId' and parametric coordinates `pcoords' in the cell.

Precondition
positive_subId: subId>=0
clamped_pcoords: (0<=pcoords[0])&&(pcoords[0]<=1)&&(0<=pcoords[1]) &&(pcoords[1]<=1)&&(0<=pcoords[2])&&(pcoords[2]<=1)
virtual void vtkBridgeCell::InterpolateTuple ( vtkGenericAttribute *  a,
double  pcoords[3],
double *  val 
)
virtual

Interpolate the attribute `a' at local position `pcoords' of the cell into `val'.

Precondition
a_exists: a!=0
a_is_point_centered: a->GetCentering()==vtkPointCentered
clamped_point: pcoords[0]>=0 && pcoords[0]<=1 && pcoords[1]>=0 && pcoords[1]<=1 && pcoords[2]>=0 && pcoords[2]<=1
val_exists: val!=0
valid_size: sizeof(val)==a->GetNumberOfComponents()
virtual void vtkBridgeCell::InterpolateTuple ( vtkGenericAttributeCollection *  c,
double  pcoords[3],
double *  val 
)
virtual

Interpolate the whole collection of attributes `c' at local position `pcoords' of the cell into `val'. Only point centered attributes are taken into account.

Precondition
c_exists: c!=0
clamped_point: pcoords[0]>=0 && pcoords[0]<=1 && pcoords[1]>=0 && pcoords[1]<=1 && pcoords[2]>=0 && pcoords[2]<=1
val_exists: val!=0
valid_size: sizeof(val)==c->GetNumberOfPointCenteredComponents()
virtual int vtkBridgeCell::IntersectWithLine ( double  p1[3],
double  p2[3],
double  tol,
double &  t,
double  x[3],
double  pcoords[3],
int &  subId 
)
virtual

Is there an intersection between the current cell and the ray (`p1',`p2') according to a tolerance `tol'? If true, `x' is the global intersection, `t' is the parametric coordinate for the line, `pcoords' are the parametric coordinates for cell. `subId' is the sub-cell where the intersection occurs.

Precondition
positive_tolerance: tol>0
virtual void vtkBridgeCell::Derivatives ( int  subId,
double  pcoords[3],
vtkGenericAttribute *  attribute,
double *  derivs 
)
virtual

Compute derivatives `derivs' of the attribute `attribute' (from its values at the corner points of the cell) given sub-cell `subId' (0 means primary cell) and parametric coordinates `pcoords'. Derivatives are in the x-y-z coordinate directions for each data value.

Precondition
positive_subId: subId>=0
clamped_pcoords: (0<=pcoords[0])&&(pcoords[0]<=1)&&(0<=pcoords[1]) &&(pcoords[1]<=1)&&(0<=pcoords[2])%%(pcoords[2]<=1)
attribute_exists: attribute!=0
derivs_exists: derivs!=0
valid_size: sizeof(derivs)>=attribute->GetNumberOfComponents()*3
virtual void vtkBridgeCell::GetBounds ( double  bounds[6])
virtual

Compute the bounding box of the current cell in `bounds' in global coordinates. THREAD SAFE

virtual double* vtkBridgeCell::GetBounds ( )
virtual

Return the bounding box of the current cell in global coordinates. NOT THREAD SAFE

Postcondition
result_exists: result!=0
valid_size: sizeof(result)>=6
virtual double vtkBridgeCell::GetLength2 ( )
virtual

Bounding box diagonal squared of the current cell.

Postcondition
positive_result: result>=0
virtual int vtkBridgeCell::GetParametricCenter ( double  pcoords[3])
virtual

Center of the current cell in parametric coordinates `pcoords'. If the current cell is a composite, the return value is the sub-cell id that the center is in.

Postcondition
valid_result: (result>=0) && (IsPrimary() implies result==0)
virtual double vtkBridgeCell::GetParametricDistance ( double  pcoords[3])
virtual

Distance of the parametric coordinate `pcoords' to the current cell. If inside the cell, a distance of zero is returned. This is used during picking to get the correct cell picked. (The tolerance will occasionally allow cells to be picked who are not really intersected "inside" the cell.)

Postcondition
positive_result: result>=0
virtual double* vtkBridgeCell::GetParametricCoords ( )
virtual

Return a contiguous array of parametric coordinates of the points defining the current cell. In other words, (px,py,pz, px,py,pz, etc..) The coordinates are ordered consistent with the definition of the point ordering for the cell. Note that 3D parametric coordinates are returned no matter what the topological dimension of the cell. It includes the DOF nodes.

Postcondition
valid_result_exists: ((IsPrimary()) && (result!=0)) || ((!IsPrimary()) && (result==0)) result!=0 implies sizeof(result)==GetNumberOfPoints()
virtual int vtkBridgeCell::IsFaceOnBoundary ( vtkIdType  faceId)
virtual

Return a contiguous array of parametric coordinates of the points defining the current cell. In other words, (px,py,pz, px,py,pz, etc..) The coordinates are ordered consistent with the definition of the point ordering for the cell. Note that 3D parametric coordinates are returned no matter what the topological dimension of the cell. It includes the DOF nodes.

Postcondition
valid_result_exists: ((IsPrimary()) && (result!=0)) || ((!IsPrimary()) && (result==0)) result!=0 implies sizeof(result)==GetNumberOfPoints()
virtual int vtkBridgeCell::IsOnBoundary ( )
virtual

Return a contiguous array of parametric coordinates of the points defining the current cell. In other words, (px,py,pz, px,py,pz, etc..) The coordinates are ordered consistent with the definition of the point ordering for the cell. Note that 3D parametric coordinates are returned no matter what the topological dimension of the cell. It includes the DOF nodes.

Postcondition
valid_result_exists: ((IsPrimary()) && (result!=0)) || ((!IsPrimary()) && (result==0)) result!=0 implies sizeof(result)==GetNumberOfPoints()
virtual void vtkBridgeCell::GetPointIds ( vtkIdType *  id)
virtual

Put into `id' the list of ids the point of the cell.

Precondition
id_exists: id!=0
valid_size: sizeof(id)==GetNumberOfPoints();
int* vtkBridgeCell::GetFaceArray ( int  faceId)

Return the ids of the vertices defining face `faceId'.

Precondition
is_3d: this->GetDimension()==3
valid_faceId_range: faceId>=0 && faceId<this->GetNumberOfBoundaries(2)
Postcondition
result_exists: result!=0
valid_size: sizeof(result)>=GetNumberOfVerticesOnFace(faceId)
int vtkBridgeCell::GetNumberOfVerticesOnFace ( int  faceId)

Return the number of vertices defining face `faceId'

Precondition
is_3d: this->GetDimension()==3
valid_faceId_range: faceId>=0 && faceId<this->GetNumberOfBoundaries(2)
Postcondition
positive_result: && result>0
int* vtkBridgeCell::GetEdgeArray ( int  edgeId)

Return the ids of the vertices defining edge `edgeId'.

Precondition
valid_dimension: this->GetDimension()>=2
valid_edgeId_range: edgeId>=0 && edgeId<this->GetNumberOfBoundaries(1)
Postcondition
result_exists: result!=0
valid_size: sizeof(result)==2
void vtkBridgeCell::Init ( vtkBridgeDataSet ds,
vtkIdType  cellid 
)

Used internally for the Bridge. Initialize the cell from a dataset `ds' and `cellid'.

Precondition
ds_exists: ds!=0
valid_cellid: (cellid>=0) && (cellid<ds->GetNumberOfCells())
void vtkBridgeCell::InitWithCell ( vtkCell *  c,
vtkIdType  id 
)

Used internally for the Bridge. Initialize the cell from a cell `c' and an `id'.

Precondition
c_exists: c!=0
void vtkBridgeCell::DeepCopy ( vtkBridgeCell other)

Recursive copy of `other' into `this'.

Precondition
other_exists: other!=0
other_differ: this!=other
void vtkBridgeCell::AllocateWeights ( )
protected

Allocate an array for the weights, only if it does not exist yet or if the capacity is too small.

void vtkBridgeCell::InterpolationFunctions ( double  pcoords[3],
double *  weights 
)
protected

Compute the weights for parametric coordinates `pcoords'.

Friends And Related Function Documentation

friend class vtkBridgeDataSet
friend

Definition at line 419 of file vtkBridgeCell.h.

friend class vtkBridgeAttribute
friend

Definition at line 420 of file vtkBridgeCell.h.

friend class vtkBridgeCellIterator
friend

Definition at line 421 of file vtkBridgeCell.h.

friend class vtkBridgeCellIteratorOnDataSet
friend

Definition at line 422 of file vtkBridgeCell.h.

friend class vtkBridgeCellIteratorOne
friend

Definition at line 423 of file vtkBridgeCell.h.

friend class vtkBridgeCellIteratorOnCellBoundaries
friend

Definition at line 424 of file vtkBridgeCell.h.

friend class vtkBridgePointIteratorOnCell
friend

Definition at line 425 of file vtkBridgeCell.h.

Member Data Documentation

vtkCell* vtkBridgeCell::Cell
protected

Definition at line 427 of file vtkBridgeCell.h.

vtkBridgeDataSet* vtkBridgeCell::DataSet
protected

Definition at line 428 of file vtkBridgeCell.h.

vtkIdType vtkBridgeCell::Id
protected

Definition at line 429 of file vtkBridgeCell.h.

int vtkBridgeCell::BoolIsInDataSet
protected

Definition at line 430 of file vtkBridgeCell.h.

vtkBridgeCellIterator* vtkBridgeCell::InternalIterator
protected

Definition at line 431 of file vtkBridgeCell.h.

double* vtkBridgeCell::Weights
protected

Definition at line 433 of file vtkBridgeCell.h.

int vtkBridgeCell::WeightsCapacity
protected

Definition at line 434 of file vtkBridgeCell.h.


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