VTK
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes
vtkStreamingTessellator Class Reference

An algorithm that refines an initial simplicial tessellation using edge subdivision. More...

#include <vtkStreamingTessellator.h>

Inheritance diagram for vtkStreamingTessellator:
Inheritance graph
[legend]
Collaboration diagram for vtkStreamingTessellator:
Collaboration graph
[legend]

List of all members.

Public Types

enum  { MaxFieldSize = 18 }
typedef vtkObject Superclass
typedef void(* VertexProcessorFunction )(const double *, vtkEdgeSubdivisionCriterion *, void *, const void *)
typedef void(* EdgeProcessorFunction )(const double *, const double *, vtkEdgeSubdivisionCriterion *, void *, const void *)
typedef void(* TriangleProcessorFunction )(const double *, const double *, const double *, vtkEdgeSubdivisionCriterion *, void *, const void *)
typedef void(* TetrahedronProcessorFunction )(const double *, const double *, const double *, const double *, vtkEdgeSubdivisionCriterion *, void *, const void *)

Public Member Functions

virtual int IsA (const char *type)
vtkStreamingTessellatorNewInstance () const
virtual void PrintSelf (ostream &os, vtkIndent indent)
virtual void SetTetrahedronCallback (TetrahedronProcessorFunction)
virtual
TetrahedronProcessorFunction 
GetTetrahedronCallback () const
virtual void SetTriangleCallback (TriangleProcessorFunction)
virtual TriangleProcessorFunction GetTriangleCallback () const
virtual void SetEdgeCallback (EdgeProcessorFunction)
virtual EdgeProcessorFunction GetEdgeCallback () const
virtual void SetVertexCallback (VertexProcessorFunction)
virtual VertexProcessorFunction GetVertexCallback () const
virtual void SetPrivateData (void *Private)
virtual void * GetPrivateData () const
virtual void SetConstPrivateData (const void *ConstPrivate)
virtual const void * GetConstPrivateData () const
virtual void SetSubdivisionAlgorithm (vtkEdgeSubdivisionCriterion *)
virtual
vtkEdgeSubdivisionCriterion
GetSubdivisionAlgorithm ()
virtual const
vtkEdgeSubdivisionCriterion
GetSubdivisionAlgorithm () const
virtual void SetEmbeddingDimension (int k, int d)
int GetEmbeddingDimension (int k) const
virtual void SetFieldSize (int k, int s)
int GetFieldSize (int k) const
virtual void SetMaximumNumberOfSubdivisions (int num_subdiv_in)
int GetMaximumNumberOfSubdivisions ()
void AdaptivelySample3Facet (double *v1, double *v2, double *v3, double *v4) const
void AdaptivelySample2Facet (double *v1, double *v2, double *v3) const
void AdaptivelySample1Facet (double *v1, double *v2) const
void AdaptivelySample0Facet (double *v1) const
void ResetCounts ()
vtkIdType GetCaseCount (int c)
vtkIdType GetSubcaseCount (int casenum, int sub)

Static Public Member Functions

static int IsTypeOf (const char *type)
static vtkStreamingTessellatorSafeDownCast (vtkObjectBase *o)
static vtkStreamingTessellatorNew ()

Protected Member Functions

virtual vtkObjectBaseNewInstanceInternal () const
 vtkStreamingTessellator ()
 ~vtkStreamingTessellator ()
void AdaptivelySample3Facet (double *v1, double *v2, double *v3, double *v4, int maxDepth) const
void AdaptivelySample2Facet (double *v1, double *v2, double *v3, int maxDepth, int move=7) const
void AdaptivelySample1Facet (double *v1, double *v2, int maxDepth) const
int BestTets (int *, double **, int, int) const

Protected Attributes

void * PrivateData
const void * ConstPrivateData
vtkEdgeSubdivisionCriterionAlgorithm
VertexProcessorFunction Callback0
EdgeProcessorFunction Callback1
TriangleProcessorFunction Callback2
TetrahedronProcessorFunction Callback3
int PointDimension [4]
int EmbeddingDimension [4]
int MaximumNumberOfSubdivisions

Static Protected Attributes

static int EdgeCodesToCaseCodesPlusPermutation [64][2]
static vtkIdType PermutationsFromIndex [24][14]
static vtkIdType TetrahedralDecompositions []

Detailed Description

An algorithm that refines an initial simplicial tessellation using edge subdivision.

$Date$ $Revision$

This class is a simple algorithm that takes a single starting simplex -- a tetrahedron, triangle, or line segment -- and calls a function you pass it with (possibly many times) tetrahedra, triangles, or lines adaptively sampled from the one you specified. It uses an algorithm you specify to control the level of adaptivity.

This class does not create vtkUnstructuredGrid output because it is intended for use in mappers as well as filters. Instead, it calls the registered function with simplices as they are created.

The subdivision algorithm should change the vertex coordinates (it must change both geometric and, if desired, parametric coordinates) of the midpoint. These coordinates need not be changed unless the EvaluateEdge() member returns true. The vtkStreamingTessellator itself has no way of creating a more accurate midpoint vertex.

Here's how to use this class:

Definition at line 90 of file vtkStreamingTessellator.h.


Member Typedef Documentation

Reimplemented from vtkObject.

Definition at line 93 of file vtkStreamingTessellator.h.

typedef void(* vtkStreamingTessellator::VertexProcessorFunction)(const double *, vtkEdgeSubdivisionCriterion *, void *, const void *)

Definition at line 98 of file vtkStreamingTessellator.h.

typedef void(* vtkStreamingTessellator::EdgeProcessorFunction)(const double *, const double *, vtkEdgeSubdivisionCriterion *, void *, const void *)

Definition at line 99 of file vtkStreamingTessellator.h.

typedef void(* vtkStreamingTessellator::TriangleProcessorFunction)(const double *, const double *, const double *, vtkEdgeSubdivisionCriterion *, void *, const void *)

Definition at line 100 of file vtkStreamingTessellator.h.

typedef void(* vtkStreamingTessellator::TetrahedronProcessorFunction)(const double *, const double *, const double *, const double *, vtkEdgeSubdivisionCriterion *, void *, const void *)

Definition at line 101 of file vtkStreamingTessellator.h.


Member Enumeration Documentation

anonymous enum
Enumerator:
MaxFieldSize 

Definition at line 103 of file vtkStreamingTessellator.h.


Constructor & Destructor Documentation


Member Function Documentation

static int vtkStreamingTessellator::IsTypeOf ( const char *  name) [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 vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkObject.

virtual int vtkStreamingTessellator::IsA ( const char *  name) [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 vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkObject.

Reimplemented from vtkObject.

virtual vtkObjectBase* vtkStreamingTessellator::NewInstanceInternal ( ) const [protected, virtual]

Reimplemented from vtkObject.

Reimplemented from vtkObject.

Create an object with Debug turned off, modified time initialized to zero, and reference counting on.

Reimplemented from vtkObject.

virtual void vtkStreamingTessellator::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.

Get/Set the function called for each output tetrahedron (3-facet).

Get/Set the function called for each output tetrahedron (3-facet).

Get/Set the function called for each output triangle (2-facet).

Get/Set the function called for each output triangle (2-facet).

Get/Set the function called for each output line segment (1-facet).

Get/Set the function called for each output line segment (1-facet).

Get/Set the function called for each output line segment (1-facet).

Get/Set the function called for each output line segment (1-facet).

virtual void vtkStreamingTessellator::SetPrivateData ( void *  Private) [virtual]

Get/Set a void pointer passed to the triangle and edge output functions.

virtual void* vtkStreamingTessellator::GetPrivateData ( ) const [virtual]

Get/Set a void pointer passed to the triangle and edge output functions.

virtual void vtkStreamingTessellator::SetConstPrivateData ( const void *  ConstPrivate) [virtual]

Get/Set a constant void pointer passed to the simplex output functions.

virtual const void* vtkStreamingTessellator::GetConstPrivateData ( ) const [virtual]

Get/Set a constant void pointer passed to the simplex output functions.

Get/Set the algorithm used to determine whether an edge should be subdivided or left as-is. This is used once for each call to AdaptivelySample1Facet (which is recursive and will call itself resulting in additional edges to be checked) or three times for each call to AdaptivelySample2Facet (also recursive).

Get/Set the algorithm used to determine whether an edge should be subdivided or left as-is. This is used once for each call to AdaptivelySample1Facet (which is recursive and will call itself resulting in additional edges to be checked) or three times for each call to AdaptivelySample2Facet (also recursive).

Get/Set the algorithm used to determine whether an edge should be subdivided or left as-is. This is used once for each call to AdaptivelySample1Facet (which is recursive and will call itself resulting in additional edges to be checked) or three times for each call to AdaptivelySample2Facet (also recursive).

virtual void vtkStreamingTessellator::SetEmbeddingDimension ( int  k,
int  d 
) [virtual]

Get/Set the number of parameter-space coordinates associated with each input and output point. The default is k for k -facets. You may specify a different dimension, d, for each type of k -facet to be processed. For example, SetEmbeddingDimension( 2, 3 ) would associate r, s, and t coordinates with each input and output point generated by AdaptivelySample2Facet but does not say anything about input or output points generated by AdaptivelySample1Facet. Call SetEmbeddingDimension( -1, d ) to specify the same dimension for all possible k values. d may not exceed 8, as that would be plain silly.

Get/Set the number of parameter-space coordinates associated with each input and output point. The default is k for k -facets. You may specify a different dimension, d, for each type of k -facet to be processed. For example, SetEmbeddingDimension( 2, 3 ) would associate r, s, and t coordinates with each input and output point generated by AdaptivelySample2Facet but does not say anything about input or output points generated by AdaptivelySample1Facet. Call SetEmbeddingDimension( -1, d ) to specify the same dimension for all possible k values. d may not exceed 8, as that would be plain silly.

Definition at line 335 of file vtkStreamingTessellator.h.

virtual void vtkStreamingTessellator::SetFieldSize ( int  k,
int  s 
) [virtual]

Get/Set the number of field value coordinates associated with each input and output point. The default is 0; no field values are interpolated. You may specify a different size, s, for each type of k -facet to be processed. For example, SetFieldSize( 2, 3 ) would associate 3 field value coordinates with each input and output point of an AdaptivelySample2Facet call, but does not say anything about input or output points of AdaptivelySample1Facet. Call SetFieldSize( -1, s ) to specify the same dimension for all possible k values. s may not exceed vtkStreamingTessellator::MaxFieldSize. This is a compile-time constant that defaults to 18, which is large enough for a scalar, vector, tensor, normal, and texture coordinate to be included at each point. Normally, you will not call SetFieldSize() directly; instead, subclasses of vtkEdgeSubdivisionCriterion, such as vtkShoeMeshSubdivisionAlgorithm, will call it for you. In any event, setting FieldSize to a non-zero value means you must pass field values to the AdaptivelySamplekFacet routines; For example,

vtkStreamingTessellator* t =
   vtkStreamingTessellator::New(); t->SetFieldSize( 1, 3 );
   t->SetEmbeddingDimension( 1, 1 ); // not really required, this is
   the default double p0[3+1+3] = { x0, y0, z0, r0, fx0, fy0, fz0 };
   double p1[3+1+3] = { x1, y1, z1, r1, fx1, fy1, fz1 };
   t->AdaptivelySample1Facet( p0, p1 ); 

This would adaptively sample an curve (1-facet) with geometry and a vector field at every output point on the curve.

Get/Set the number of field value coordinates associated with each input and output point. The default is 0; no field values are interpolated. You may specify a different size, s, for each type of k -facet to be processed. For example, SetFieldSize( 2, 3 ) would associate 3 field value coordinates with each input and output point of an AdaptivelySample2Facet call, but does not say anything about input or output points of AdaptivelySample1Facet. Call SetFieldSize( -1, s ) to specify the same dimension for all possible k values. s may not exceed vtkStreamingTessellator::MaxFieldSize. This is a compile-time constant that defaults to 18, which is large enough for a scalar, vector, tensor, normal, and texture coordinate to be included at each point. Normally, you will not call SetFieldSize() directly; instead, subclasses of vtkEdgeSubdivisionCriterion, such as vtkShoeMeshSubdivisionAlgorithm, will call it for you. In any event, setting FieldSize to a non-zero value means you must pass field values to the AdaptivelySamplekFacet routines; For example,

vtkStreamingTessellator* t =
   vtkStreamingTessellator::New(); t->SetFieldSize( 1, 3 );
   t->SetEmbeddingDimension( 1, 1 ); // not really required, this is
   the default double p0[3+1+3] = { x0, y0, z0, r0, fx0, fy0, fz0 };
   double p1[3+1+3] = { x1, y1, z1, r1, fx1, fy1, fz1 };
   t->AdaptivelySample1Facet( p0, p1 ); 

This would adaptively sample an curve (1-facet) with geometry and a vector field at every output point on the curve.

Definition at line 338 of file vtkStreamingTessellator.h.

virtual void vtkStreamingTessellator::SetMaximumNumberOfSubdivisions ( int  num_subdiv_in) [virtual]

Get/Set the maximum number of subdivisions that may occur.

Get/Set the maximum number of subdivisions that may occur.

Definition at line 341 of file vtkStreamingTessellator.h.

void vtkStreamingTessellator::AdaptivelySample3Facet ( double v1,
double v2,
double v3,
double v4 
) const [inline]

This will adaptively subdivide the tetrahedron (3-facet), triangle (2-facet), or edge (1-facet) until the subdivision algorithm returns false for every edge or the maximum recursion depth is reached. Use SetMaximumNumberOfSubdivisions to change the maximum recursion depth. The AdaptivelySample0Facet method is provided as a convenience. Obviously, there is no way to adaptively subdivide a vertex. Instead the input vertex is passed unchanged to the output via a call to the registered VertexProcessorFunction callback. .SECTION Warning This assumes that you have called SetSubdivisionAlgorithm(), SetEdgeCallback(), SetTriangleCallback(), and SetTetrahedronCallback() with valid values!

Definition at line 328 of file vtkStreamingTessellator.h.

void vtkStreamingTessellator::AdaptivelySample2Facet ( double v1,
double v2,
double v3 
) const [inline]

This will adaptively subdivide the tetrahedron (3-facet), triangle (2-facet), or edge (1-facet) until the subdivision algorithm returns false for every edge or the maximum recursion depth is reached. Use SetMaximumNumberOfSubdivisions to change the maximum recursion depth. The AdaptivelySample0Facet method is provided as a convenience. Obviously, there is no way to adaptively subdivide a vertex. Instead the input vertex is passed unchanged to the output via a call to the registered VertexProcessorFunction callback. .SECTION Warning This assumes that you have called SetSubdivisionAlgorithm(), SetEdgeCallback(), SetTriangleCallback(), and SetTetrahedronCallback() with valid values!

Definition at line 330 of file vtkStreamingTessellator.h.

void vtkStreamingTessellator::AdaptivelySample1Facet ( double v1,
double v2 
) const [inline]

This will adaptively subdivide the tetrahedron (3-facet), triangle (2-facet), or edge (1-facet) until the subdivision algorithm returns false for every edge or the maximum recursion depth is reached. Use SetMaximumNumberOfSubdivisions to change the maximum recursion depth. The AdaptivelySample0Facet method is provided as a convenience. Obviously, there is no way to adaptively subdivide a vertex. Instead the input vertex is passed unchanged to the output via a call to the registered VertexProcessorFunction callback. .SECTION Warning This assumes that you have called SetSubdivisionAlgorithm(), SetEdgeCallback(), SetTriangleCallback(), and SetTetrahedronCallback() with valid values!

Definition at line 332 of file vtkStreamingTessellator.h.

This will adaptively subdivide the tetrahedron (3-facet), triangle (2-facet), or edge (1-facet) until the subdivision algorithm returns false for every edge or the maximum recursion depth is reached. Use SetMaximumNumberOfSubdivisions to change the maximum recursion depth. The AdaptivelySample0Facet method is provided as a convenience. Obviously, there is no way to adaptively subdivide a vertex. Instead the input vertex is passed unchanged to the output via a call to the registered VertexProcessorFunction callback. .SECTION Warning This assumes that you have called SetSubdivisionAlgorithm(), SetEdgeCallback(), SetTriangleCallback(), and SetTetrahedronCallback() with valid values!

Reset/access the histogram of subdivision cases encountered. The histogram may be used to examine coverage during testing as well as characterizing the tessellation algorithm's performance. You should call ResetCounts() once, at the beginning of a stream of tetrahedra. It must be called before AdaptivelySample3Facet() to prevent uninitialized memory reads. These functions have no effect (and return 0) when PARAVIEW_DEBUG_TESSELLATOR has not been defined. By default, PARAVIEW_DEBUG_TESSELLATOR is not defined, and your code will be fast and efficient. Really!

Definition at line 241 of file vtkStreamingTessellator.h.

Reset/access the histogram of subdivision cases encountered. The histogram may be used to examine coverage during testing as well as characterizing the tessellation algorithm's performance. You should call ResetCounts() once, at the beginning of a stream of tetrahedra. It must be called before AdaptivelySample3Facet() to prevent uninitialized memory reads. These functions have no effect (and return 0) when PARAVIEW_DEBUG_TESSELLATOR has not been defined. By default, PARAVIEW_DEBUG_TESSELLATOR is not defined, and your code will be fast and efficient. Really!

Definition at line 254 of file vtkStreamingTessellator.h.

vtkIdType vtkStreamingTessellator::GetSubcaseCount ( int  casenum,
int  sub 
) [inline]

Reset/access the histogram of subdivision cases encountered. The histogram may be used to examine coverage during testing as well as characterizing the tessellation algorithm's performance. You should call ResetCounts() once, at the beginning of a stream of tetrahedra. It must be called before AdaptivelySample3Facet() to prevent uninitialized memory reads. These functions have no effect (and return 0) when PARAVIEW_DEBUG_TESSELLATOR has not been defined. By default, PARAVIEW_DEBUG_TESSELLATOR is not defined, and your code will be fast and efficient. Really!

Definition at line 263 of file vtkStreamingTessellator.h.

void vtkStreamingTessellator::AdaptivelySample3Facet ( double v1,
double v2,
double v3,
double v4,
int  maxDepth 
) const [protected]
void vtkStreamingTessellator::AdaptivelySample2Facet ( double v1,
double v2,
double v3,
int  maxDepth,
int  move = 7 
) const [protected]
void vtkStreamingTessellator::AdaptivelySample1Facet ( double v1,
double v2,
int  maxDepth 
) const [protected]
int vtkStreamingTessellator::BestTets ( int ,
double **  ,
int  ,
int   
) const [protected]

Member Data Documentation

Definition at line 277 of file vtkStreamingTessellator.h.

Definition at line 278 of file vtkStreamingTessellator.h.

Definition at line 279 of file vtkStreamingTessellator.h.

Definition at line 282 of file vtkStreamingTessellator.h.

Definition at line 283 of file vtkStreamingTessellator.h.

Definition at line 284 of file vtkStreamingTessellator.h.

Definition at line 286 of file vtkStreamingTessellator.h.

Definition at line 287 of file vtkStreamingTessellator.h.

Definition at line 288 of file vtkStreamingTessellator.h.

Definition at line 289 of file vtkStreamingTessellator.h.

PointDimension is the length of each double* array associated with each point passed to a subdivision algorithm: PointDimension[i] = 3 + EmbeddingDimension[i] + FieldSize[i] We store this instead of FieldSize for speed. Only entries 1 through 3 are used; you can't subdivide 0-facets (points). Well, maybe you can, but I can't!

Definition at line 302 of file vtkStreamingTessellator.h.

The parametric dimension of each point passed to the subdivision algorithm. Only entries 1 through 3 are used; you can't subdivide 0-facets (points). Well, maybe you can, but I can't!

Definition at line 307 of file vtkStreamingTessellator.h.

The number of subdivisions allowed.

Definition at line 310 of file vtkStreamingTessellator.h.


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