Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members Related Pages
vtkWeightedTransformFilter Class Reference
#include <vtkWeightedTransformFilter.h>
Inheritance diagram for vtkWeightedTransformFilter:
[legend]Collaboration diagram for vtkWeightedTransformFilter:
[legend]List of all members.
Detailed Description
- Date:
-
2002/08/07 23:12:10
- Revision:
-
1.8
vtkWeightedTransformFilter is a filter that can be used to "skin" structures and to create new and complex shapes. Unlike a traditional transform filter (which has one transform for a data set) or an assembly (which has one transform per part or group of parts), a weighted transform produces the weighted sum of transforms on a per-point or per-cell basis.
Each point or cell in the filter's input has an attached DataArray that contains tuples of weighting functions, one per point or cell. The filter also has a set of fixed transforms. When the filter executes, each input point/cell is transformed by each of the transforms. These results are weighted by the point/cell's weighting factors to produce final output data.
Linear transforms are performance-optimized. Using arbitrary transforms will work, but performance may suffer.
As an example of the utility of weighted transforms, here's how this filter can be used for "skinning." Skinning is the process of putting a mesh cover over an underlying structure, like skin over bone. Joints are difficult to skin because deformation is hard to do. Visualize skin over an elbow joint. Part of the skin moves with one bone, part of the skin moves with the other bone, and the skin in the middle moves a little with each.
Weighted filtering can be used for a simple and efficient kind of skinning. Begin with a cylindrical mesh. Create a FloatArray with two components per tuple, and one tuple for each point in the mesh. Assign transform weights that linear interpolate the distance along the cylinder (one component is the distance along the cylinder, the other is one minus that distance). Set the filter up to use two transforms, the two used to transform the two bones. Now, when the transforms change, the mesh will deform so as to, hopefully, continue to cover the bones.
vtkWeightedTransformFilter is also useful for creating "strange and complex" shapes using pinching, bending, and blending.
- Warning:
-
Weighted combination of normals and vectors are probably not appropriate in many cases. Surface normals are treated somewhat specially, but in many cases you may need to regenerate the surface normals.
- Warning:
-
Cell data can only be transformed if all transforms are linear.
- See also:
-
vtkAbstractTransform vtkLinearTransform vtkTransformPolyDataFilter vtkActor
- Created by:
-
- CVS contributions (if > 5%):
-
- Halle, Michael (75%)
- Geveci, Berk (21%)
- CVS logs (CVSweb):
-
- .
cxx
(/Hybrid/vtkWeightedTransformFilter.cxx)
- .
h
(/Hybrid/vtkWeightedTransformFilter.h)
- Tests:
-
vtkWeightedTransformFilter (Tests)
Definition at line 94 of file vtkWeightedTransformFilter.h.
Member Typedef Documentation
Constructor & Destructor Documentation
vtkWeightedTransformFilter::vtkWeightedTransformFilter |
( |
|
) |
[protected] |
|
vtkWeightedTransformFilter::~vtkWeightedTransformFilter |
( |
|
) |
[protected] |
|
Member Function Documentation
vtkWeightedTransformFilter* vtkWeightedTransformFilter::New |
( |
|
) |
[static] |
|
|
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
Reimplemented from vtkObject. |
virtual const char* vtkWeightedTransformFilter::GetClassName |
( |
|
) |
[virtual] |
|
int vtkWeightedTransformFilter::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 vtkPointSetToPointSetFilter. |
virtual int vtkWeightedTransformFilter::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 vtkPointSetToPointSetFilter. |
vtkWeightedTransformFilter* vtkWeightedTransformFilter::SafeDownCast |
( |
vtkObject * |
o |
) |
[static] |
|
void vtkWeightedTransformFilter::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 vtkPointSetToPointSetFilter. |
unsigned long vtkWeightedTransformFilter::GetMTime |
( |
|
) |
[virtual] |
|
|
Return the MTime also considering the filter's transforms.
Reimplemented from vtkObject. |
virtual void vtkWeightedTransformFilter::SetWeightArray |
( |
const char * |
|
) |
[virtual] |
|
|
WeightArray is the string name of the DataArray in the input's FieldData that holds the weighting coefficients for each point. The filter will first look for the array in the input's PointData FieldData. If the array isn't there, the filter looks in the input's FieldData. The WeightArray can have tuples of any length, but must have a tuple for every point in the input data set. This array transforms points, normals, and vectors. |
virtual char* vtkWeightedTransformFilter::GetWeightArray |
( |
|
) |
[virtual] |
|
|
WeightArray is the string name of the DataArray in the input's FieldData that holds the weighting coefficients for each point. The filter will first look for the array in the input's PointData FieldData. If the array isn't there, the filter looks in the input's FieldData. The WeightArray can have tuples of any length, but must have a tuple for every point in the input data set. This array transforms points, normals, and vectors. |
virtual void vtkWeightedTransformFilter::SetCellDataWeightArray |
( |
const char * |
|
) |
[virtual] |
|
|
The CellDataWeightArray is analogous to the WeightArray, except for CellData. The array is searched for first in the CellData FieldData, then in the input's FieldData. The data array must have a tuple for each cell. This array is used to transform only normals and vectors. |
virtual char* vtkWeightedTransformFilter::GetCellDataWeightArray |
( |
|
) |
[virtual] |
|
|
The CellDataWeightArray is analogous to the WeightArray, except for CellData. The array is searched for first in the CellData FieldData, then in the input's FieldData. The data array must have a tuple for each cell. This array is used to transform only normals and vectors. |
virtual void vtkWeightedTransformFilter::SetTransform |
( |
vtkAbstractTransform * |
transform, |
|
|
int |
num |
|
) |
[virtual] |
|
|
Set or Get one of the filter's transforms. The transform number must be less than the number of transforms allocated for the object. Setting a transform slot to NULL is equivalent to assigning an overriding weight of zero to that filter slot. |
|
Set or Get one of the filter's transforms. The transform number must be less than the number of transforms allocated for the object. Setting a transform slot to NULL is equivalent to assigning an overriding weight of zero to that filter slot. |
virtual void vtkWeightedTransformFilter::SetNumberOfTransforms |
( |
int |
num |
) |
[virtual] |
|
|
Set the number of transforms for the filter. References to non-existent filter numbers in the data array is equivalent to a weight of zero (i.e., no contribution of that filter or weight). |
virtual int vtkWeightedTransformFilter::GetNumberOfTransforms |
( |
|
) |
[virtual] |
|
|
Set the number of transforms for the filter. References to non-existent filter numbers in the data array is equivalent to a weight of zero (i.e., no contribution of that filter or weight). |
virtual void vtkWeightedTransformFilter::AddInputValuesOn |
( |
|
) |
[virtual] |
|
|
If AddInputValues is true, the output values of this filter will be offset from the input values. The effect is exactly equivalent to having an identity transform of weight 1 added into each output point. |
virtual void vtkWeightedTransformFilter::AddInputValuesOff |
( |
|
) |
[virtual] |
|
|
If AddInputValues is true, the output values of this filter will be offset from the input values. The effect is exactly equivalent to having an identity transform of weight 1 added into each output point. |
virtual void vtkWeightedTransformFilter::SetAddInputValues |
( |
int |
|
) |
[virtual] |
|
|
If AddInputValues is true, the output values of this filter will be offset from the input values. The effect is exactly equivalent to having an identity transform of weight 1 added into each output point. |
virtual int vtkWeightedTransformFilter::GetAddInputValues |
( |
|
) |
[virtual] |
|
|
If AddInputValues is true, the output values of this filter will be offset from the input values. The effect is exactly equivalent to having an identity transform of weight 1 added into each output point. |
void vtkWeightedTransformFilter::Execute |
( |
|
) |
[protected, virtual] |
|
|
This method is the old style execute method
Reimplemented from vtkSource. |
Member Data Documentation
int vtkWeightedTransformFilter::NumberOfTransforms [protected]
|
|
int vtkWeightedTransformFilter::AddInputValues [protected]
|
|
char* vtkWeightedTransformFilter::CellDataWeightArray [protected]
|
|
char* vtkWeightedTransformFilter::WeightArray [protected]
|
|
The documentation for this class was generated from the following file: