vtkGenericAdaptorCell Class Reference
#include <vtkGenericAdaptorCell.h>
Inheritance diagram for vtkGenericAdaptorCell:
[legend]Collaboration diagram for vtkGenericAdaptorCell:
[legend]List of all members.
Detailed Description
defines cell interface
In VTK, spatial-temporal data is defined in terms of a dataset which is composed of cells. The cells are topological entities over which an interpolation field is applied. Cells are defined in terms of a topology (e.g., vertices, lines, triangles, polygons, tetrahedra, etc.), points that instantiate the geometry of the cells, and interpolation fields (in the general case one interpolation field is for geometry, the other is for attribute data associated with the cell).
Currently most algorithms in VTK use vtkCell and vtkDataSet, which make assumptions about the nature of datasets, cells, and attributes. In particular, this abstraction assumes that cell interpolation functions are linear, or products of linear functions. Further, VTK implements most of the interpolation functions. This implementation starts breaking down as the complexity of the interpolation (or basis) functions increases.
vtkGenericAdaptorCell addresses these issues by providing more general abstraction for cells. It also adopts modern C++ practices including using iterators. The vtkGenericAdaptorCell is designed to fit within the adaptor framework; meaning that it is meant to adapt VTK to external simulation systems (see the GenericFiltering/README.html).
Please note that most cells are defined in terms of other cells (the boundary cells). They are also defined in terms of points, which are not the same as vertices (vertices are a 0-D cell; points represent a position in space).
Another important concept is the notion of DOFNodes. These concept supports cell types with complex interpolation functions. For example, higher-order p-method finite elements may have different functions on each of their topological features (edges, faces, region). The coefficients of these polynomial functions are associated with DOFNodes. (There is a single DOFNode for each topological feature.) Note that from this perspective, points are used to establish the topological form of the cell; mid-side nodes and such are considered DOFNodes.
- See also:
- vtkGenericDataSet
- Created by:
-
- CVS contributions (if > 5%):
-
- CVS logs (CVSweb):
.h (/Filtering/vtkGenericAdaptorCell
.h)
.cxx (/Filtering/vtkGenericAdaptorCell
.cxx)
- Tests:
- vtkGenericAdaptorCell (Tests)
Definition at line 95 of file vtkGenericAdaptorCell.h.
|
Public Types |
typedef vtkObject | Superclass |
Public Member Functions |
virtual const char * | GetClassName () |
virtual int | IsA (const char *type) |
void | PrintSelf (ostream &os, vtkIndent indent) |
virtual vtkIdType | GetId ()=0 |
virtual int | IsInDataSet ()=0 |
virtual int | GetType ()=0 |
virtual int | GetDimension ()=0 |
virtual int | GetGeometryOrder ()=0 |
int | IsGeometryLinear () |
virtual int | GetAttributeOrder (vtkGenericAttribute *a)=0 |
int | IsAttributeLinear (vtkGenericAttribute *a) |
virtual int | IsPrimary ()=0 |
virtual int | GetNumberOfPoints ()=0 |
virtual int | GetNumberOfBoundaries (int dim=-1)=0 |
virtual int | GetNumberOfDOFNodes ()=0 |
virtual vtkGenericCellIterator * | NewCellIterator ()=0 |
virtual void | GetBounds (double bounds[6])=0 |
virtual double * | GetBounds ()=0 |
virtual double | GetLength2 ()=0 |
virtual int | GetParametricCenter (double pcoords[3])=0 |
virtual double | GetParametricDistance (double pcoords[3])=0 |
virtual double * | GetParametricCoords ()=0 |
virtual int | IsFaceOnBoundary (vtkIdType faceId)=0 |
virtual int | IsOnBoundary ()=0 |
virtual void | GetPointIds (vtkIdType *id)=0 |
virtual void | TriangulateFace (vtkGenericAttributeCollection *attributes, vtkGenericCellTessellator *tess, int index, vtkPoints *pts, vtkCellArray *cellArray, vtkPointData *pd, vtkCellData *cd) |
virtual int * | GetFaceArray (int faceId)=0 |
|
virtual void | GetBoundaryIterator (vtkGenericCellIterator *boundaries, int dim=-1)=0 |
|
virtual int | CountNeighbors (vtkGenericAdaptorCell *boundary)=0 |
virtual void | CountEdgeNeighbors (int *sharing)=0 |
|
virtual void | GetNeighbors (vtkGenericAdaptorCell *boundary, vtkGenericCellIterator *neighbors)=0 |
|
virtual int | FindClosestBoundary (int subId, double pcoords[3], vtkGenericCellIterator *&boundary)=0 |
|
virtual int | EvaluatePosition (double x[3], double *closestPoint, int &subId, double pcoords[3], double &dist2)=0 |
|
virtual void | EvaluateLocation (int subId, double pcoords[3], double x[3])=0 |
|
virtual void | InterpolateTuple (vtkGenericAttribute *a, double pcoords[3], double *val)=0 |
|
virtual void | InterpolateTuple (vtkGenericAttributeCollection *c, double pcoords[3], double *val)=0 |
|
virtual void | Contour (vtkContourValues *values, vtkImplicitFunction *f, vtkGenericAttributeCollection *attributes, vtkGenericCellTessellator *tess, vtkPointLocator *locator, vtkCellArray *verts, vtkCellArray *lines, vtkCellArray *polys, vtkPointData *outPd, vtkCellData *outCd) |
|
virtual void | Clip (double value, vtkImplicitFunction *f, vtkGenericAttributeCollection *attributes, vtkGenericCellTessellator *tess, int insideOut, vtkPointLocator *locator, vtkCellArray *connectivity, vtkPointData *outPd, vtkCellData *outCd) |
|
virtual int | IntersectWithLine (double p1[3], double p2[3], double tol, double &t, double x[3], double pcoords[3], int &subId)=0 |
|
virtual void | Derivatives (int subId, double pcoords[3], vtkGenericAttribute *attribute, double *derivs)=0 |
|
virtual void | Tessellate (vtkGenericAttributeCollection *attributes, vtkGenericCellTessellator *tess, vtkPoints *points, vtkCellArray *cellArray, vtkPointData *pd, vtkCellData *cd) |
Static Public Member Functions |
int | IsTypeOf (const char *type) |
vtkGenericAdaptorCell * | SafeDownCast (vtkObject *o) |
Protected Member Functions |
| vtkGenericAdaptorCell () |
virtual | ~vtkGenericAdaptorCell () |
void | Reset () |
Protected Attributes |
vtkTetra * | Tetra |
vtkTriangle * | Triangle |
vtkLine * | Line |
vtkVertex * | Vertex |
vtkDoubleArray * | InternalPoints |
vtkCellArray * | InternalCellArray |
vtkDoubleArray * | InternalScalars |
vtkDoubleArray * | PointDataScalars |
vtkDoubleArray * | Scalars |
vtkPointData * | PointData |
vtkCellData * | CellData |
Member Typedef Documentation
Constructor & Destructor Documentation
vtkGenericAdaptorCell::vtkGenericAdaptorCell |
( |
|
) |
[protected] |
|
Member Function Documentation
virtual const char* vtkGenericAdaptorCell::GetClassName |
( |
|
) |
[virtual] |
|
int vtkGenericAdaptorCell::IsTypeOf |
( |
const char * |
type |
) |
[static] |
|
|
Return 1 if this class type is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeRevisionMacro found in vtkSetGet.h.
Reimplemented from vtkObject. |
virtual int vtkGenericAdaptorCell::IsA |
( |
const char * |
type |
) |
[virtual] |
|
|
Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeRevisionMacro found in vtkSetGet.h.
Reimplemented from vtkObject. |
void vtkGenericAdaptorCell::PrintSelf |
( |
ostream & |
os, |
|
|
vtkIndent |
indent |
|
) |
[virtual] |
|
|
Methods invoked by print to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.
Reimplemented from vtkObject. |
virtual vtkIdType vtkGenericAdaptorCell::GetId |
( |
|
) |
[pure virtual] |
|
|
Unique identification number of the cell over the whole data set. This unique key may not be contiguous. |
virtual int vtkGenericAdaptorCell::IsInDataSet |
( |
|
) |
[pure virtual] |
|
|
Does `this' a cell of a dataset? (otherwise, it is a boundary cell) |
virtual int vtkGenericAdaptorCell::GetType |
( |
|
) |
[pure virtual] |
|
|
Return the type of the current cell. - Postcondition:
- (result==VTK_HIGHER_ORDER_EDGE)|| (result==VTK_HIGHER_ORDER_TRIANGLE)|| (result==VTK_HIGHER_ORDER_TETRAHEDRON)
|
virtual int vtkGenericAdaptorCell::GetDimension |
( |
|
) |
[pure virtual] |
|
|
Return the topological dimension of the current cell. - Postcondition:
- valid_result: result>=0 && result<=3
|
virtual int vtkGenericAdaptorCell::GetGeometryOrder |
( |
|
) |
[pure virtual] |
|
|
Return the interpolation order of the geometry. - Postcondition:
- positive_result: result>=0
|
int vtkGenericAdaptorCell::IsGeometryLinear |
( |
|
) |
|
|
|
Does the cell have a non-linear interpolation for the geometry? - Postcondition:
- definition: result==(GetGeometryOrder()==1)
|
virtual int vtkGenericAdaptorCell::GetAttributeOrder |
( |
vtkGenericAttribute * |
a |
) |
[pure virtual] |
|
|
(may differ by cell). - Precondition:
- a_exists: a!=0
- Postcondition:
- positive_result: result>=0
|
|
Does the attribute `a' have a non-linear interpolation? - Precondition:
- a_exists: a!=0
- Postcondition:
- definition: result==(GetAttributeOrder()==1)
|
virtual int vtkGenericAdaptorCell::IsPrimary |
( |
|
) |
[pure virtual] |
|
|
Is the cell primary (i.e. not composite) ? |
virtual int vtkGenericAdaptorCell::GetNumberOfPoints |
( |
|
) |
[pure virtual] |
|
|
Return the number of points that compose the cell. - Postcondition:
- positive_result: result>=0
|
virtual int vtkGenericAdaptorCell::GetNumberOfBoundaries |
( |
int |
dim = -1 |
) |
[pure virtual] |
|
|
Return the number of boundaries of dimension `dim' (or all dimensions less than GetDimension() if -1) of the cell. - Precondition:
- valid_dim_range: (dim==-1) || ((dim>=0)&&(dim<GetDimension()))
- Postcondition:
- positive_result: result>=0
|
virtual int vtkGenericAdaptorCell::GetNumberOfDOFNodes |
( |
|
) |
[pure 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 7 DOF: 1 face, 3 edges, 3 vertices. An hexahedron has 27 DOF: 1 region, 6 faces, 12 edges, 8 vertices. - Postcondition:
- valid_result: result==GetNumberOfBoundaries(-1)+1
|
|
Create an empty cell iterator. The user is responsible for deleting it. - Postcondition:
- result_exists: result!=0
|
virtual void vtkGenericAdaptorCell::GetBoundaryIterator |
( |
vtkGenericCellIterator * |
boundaries, |
|
|
int |
dim = -1 |
|
) |
[pure virtual] |
|
|
Return the `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
|
|
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 vtkGenericAdaptorCell::CountEdgeNeighbors |
( |
int * |
sharing |
) |
[pure 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
|
|
Put into `neighbors' the cells (dimension>boundary->GetDimension()) of the dataset that share the boundary `boundary' with this cell. `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 vtkGenericAdaptorCell::FindClosestBoundary |
( |
int |
subId, |
|
|
double |
pcoords[3], |
|
|
vtkGenericCellIterator *& |
boundary |
|
) |
[pure 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 vtkGenericAdaptorCell::EvaluatePosition |
( |
double |
x[3], |
|
|
double * |
closestPoint, |
|
|
int & |
subId, |
|
|
double |
pcoords[3], |
|
|
double & |
dist2 |
|
) |
[pure 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 vtkGenericAdaptorCell::EvaluateLocation |
( |
int |
subId, |
|
|
double |
pcoords[3], |
|
|
double |
x[3] |
|
) |
[pure virtual] |
|
|
Determine the 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 vtkGenericAdaptorCell::InterpolateTuple |
( |
vtkGenericAttribute * |
a, |
|
|
double |
pcoords[3], |
|
|
double * |
val |
|
) |
[pure virtual] |
|
|
Interpolate the attribute `a' at local position `pcoords' of the cell into `val'. - Precondition:
- a_exists: a!=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)==a->GetNumberOfComponents()
|
|
Interpolate the whole collection of attributes `c' at local position `pcoords' of the cell into `val'. - 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->GetNumberOfComponents()
|
|
Generate a contour (contouring primitives) for each `values' or with respect to an implicit function `f'. Contouring is performed on the scalar attribute (`attributes->GetActiveAttribute()' `attributes->GetActiveComponent()'). Contouring interpolates the `attributes->GetNumberOfattributesToInterpolate()' attributes `attributes->GetAttributesToInterpolate()'. The `locator', `verts', `lines', `polys', `outPd' and `outCd' are cumulative data arrays over cell iterations: they store the result of each call to Contour(): - `locator' is points list that merges points as they are inserted (i.e., prevents duplicates). - `verts' is an array of generated vertices - `lines' is an array of generated lines - `polys' is an array of generated polygons - `outPd' is an array of interpolated point data along the edge (if not-NULL) - `outCd' is an array of copied cell data of the current cell (if not-NULL) Note: the CopyAllocate() method must be invoked on both the output cell and point data. NOTE: `vtkGenericAttributeCollection *attributes' will be replaced by a `vtkInformation'. - Precondition:
- values_exist: (values!=0 && f==0) || (values==0 && f!=0)
attributes_exist: attributes!=0
locator_exists: locator!=0
verts_exist: verts!=0
lines_exist: lines!=0
polys_exist: polys!=0
|
|
Cut (or clip) the current cell with respect to the contour defined by the `value' or the implicit function `f' of the scalar attribute (`attributes->GetActiveAttribute()',`attributes->GetActiveComponent() '). If `f' exists, `value' is not used. The output is the part of the current cell which is inside the contour. The output is a set of zero, one or more cells of the same topological dimension as the current cell. Normally, cell points whose scalar value is greater than "value" are considered inside. If `insideOut' is on, this is reversed. Clipping interpolates the `attributes->GetNumberOfattributesToInterpolate()' attributes `attributes->GetAttributesToInterpolate()'. `locator', `connectivity', `outPd' and `outCd' are cumulative data arrays over cell iterations: they store the result of each call to Clip(): - `locator' is points list that merges points as they are inserted (i.e., prevents duplicates). - `connectivity' is an array of generated cells - `outPd' is an array of interpolated point data along the edge (if not-NULL) - `outCd' is an array of copied cell data of the current cell (if not-NULL) Note: the CopyAllocate() method must be invoked on both the output cell and point data. Also, if the output cell data is non-NULL, the cell data from the clipped cell is passed to the generated contouring primitives. (Note: the CopyAllocate() method must be invoked on both the output cell and point data.) NOTE: `vtkGenericAttributeCollection *attributes' will be replaced by a `vtkInformation'. - Precondition:
- attributes_exist: attributes!=0
locator_exists: locator!=0
connectivity_exists: connectivity!=0
|
virtual int vtkGenericAdaptorCell::IntersectWithLine |
( |
double |
p1[3], |
|
|
double |
p2[3], |
|
|
double |
tol, |
|
|
double & |
t, |
|
|
double |
x[3], |
|
|
double |
pcoords[3], |
|
|
int & |
subId |
|
) |
[pure 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 vtkGenericAdaptorCell::Derivatives |
( |
int |
subId, |
|
|
double |
pcoords[3], |
|
|
vtkGenericAttribute * |
attribute, |
|
|
double * |
derivs |
|
) |
[pure 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 vtkGenericAdaptorCell::GetBounds |
( |
double |
bounds[6] |
) |
[pure virtual] |
|
|
Compute the bounding box of the current cell in `bounds' in global coordinates. THREAD SAFE |
virtual double* vtkGenericAdaptorCell::GetBounds |
( |
|
) |
[pure 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 vtkGenericAdaptorCell::GetLength2 |
( |
|
) |
[pure virtual] |
|
|
Return the bounding box diagonal squared of the current cell. - Postcondition:
- positive_result: result>=0
|
virtual int vtkGenericAdaptorCell::GetParametricCenter |
( |
double |
pcoords[3] |
) |
[pure virtual] |
|
|
Get the center of the current cell (in parametric coordinates)and place in the `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 vtkGenericAdaptorCell::GetParametricDistance |
( |
double |
pcoords[3] |
) |
[pure virtual] |
|
|
Return the 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* vtkGenericAdaptorCell::GetParametricCoords |
( |
|
) |
[pure 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()
|
|
Tessellate the cell if it is not linear or if at least one attribute of `attributes' is not linear. The output are linear cells of the same dimension than than cell. If the cell is linear and all attributes are linear, the output is just a copy of the current cell. `points', `cellArray', `pd' and `cd' are cumulative output data arrays over cell iterations: they store the result of each call to Tessellate(). - Precondition:
- attributes_exist: attributes!=0
points_exist: points!=0
cellArray_exists: cellArray!=0
pd_exist: pd!=0
cd_exists: cd!=0
|
virtual int vtkGenericAdaptorCell::IsFaceOnBoundary |
( |
vtkIdType |
faceId |
) |
[pure virtual] |
|
|
Is the face `faceId' of the current cell on a exterior boundary of the dataset? - Precondition:
- 3d: GetDimension()==3
|
virtual int vtkGenericAdaptorCell::IsOnBoundary |
( |
|
) |
[pure virtual] |
|
|
Is the cell on the exterior boundary of the dataset? - Precondition:
- 2d: GetDimension()==2
|
virtual void vtkGenericAdaptorCell::GetPointIds |
( |
vtkIdType * |
id |
) |
[pure virtual] |
|
|
Put into `id' the list of ids the point of the cell. - Precondition:
- id_exists: id!=0
valid_size: sizeof(id)==GetNumberOfPoints();
|
virtual int* vtkGenericAdaptorCell::GetFaceArray |
( |
int |
faceId |
) |
[pure virtual] |
|
|
Return the 3 ids of the vertices defining face `faceId', assuming the cell is a tetrahedron - Precondition:
- is_a_tetra: GetType()==VTK_TETRA || GetType()==VTK_QUADRATIC_TETRA GetType()==VTK_HIGHER_ORDER_TETRAHEDRON
valid_faceId_range: faceId>=0 && faceId<=3
- Postcondition:
- result_exists: result!=0
valid_size: sizeof(result)>=3
|
void vtkGenericAdaptorCell::Reset |
( |
|
) |
[protected] |
|
|
Reset internal structures. |
Member Data Documentation
The documentation for this class was generated from the following file: