Section: Visualization Toolkit Filtering Classes
vtkGenericAttribute provides a more general interface to attribute data than its counterpart vtkDataArray (which assumes a linear, contiguous array). It adopts an iterator interface, and allows attributes to be associated with points, edges, faces, or edges.
To create an instance of class vtkGenericAttribute, simply invoke its constructor as follows
obj = vtkGenericAttribute
obj
is an instance of the vtkGenericAttribute class.
string = obj.GetClassName ()
int = obj.IsA (string name)
vtkGenericAttribute = obj.NewInstance ()
vtkGenericAttribute = obj.SafeDownCast (vtkObject o)
string = obj.GetName ()
- Name of the attribute. (e.g. "velocity")
\post result_may_not_exist: result!=0 || result==0
int = obj.GetNumberOfComponents ()
- Dimension of the attribute. (1 for scalar, 3 for velocity)
\post positive_result: result>=0
\post GetType()==VTK_SCALARS implies result==1
\post (GetType()==VTK_VECTORS||(GetType()==VTK_NORMALS)||(GetType()==VTK_TCOORDS) implies result==3
\post GetType()==VTK_TENSORS implies result==6
int = obj.GetCentering ()
- Is the attribute centered either on points, cells or boundaries?
\post valid_result: (result==vtkPointCentered)||(result==vtkCellCentered)
int = obj.GetType ()
- Type of the attribute: scalar, vector, normal, texture coordinate, tensor
\post valid_result: (result==vtkDataSetAttributes::SCALARS)
||(result==vtkDataSetAttributes::VECTORS)
||(result==vtkDataSetAttributes::NORMALS)
||(result==vtkDataSetAttributes::TCOORDS)
||(result==vtkDataSetAttributes::TENSORS)
int = obj.GetComponentType ()
- Type of the components of the attribute: int, float, double
\post valid_result: (result==VTK_BIT) ||(result==VTK_CHAR)
||(result==VTK_UNSIGNED_CHAR) ||(result==VTK_SHORT)
||(result==VTK_UNSIGNED_SHORT)||(result==VTK_INT)
||(result==VTK_UNSIGNED_INT) ||(result==VTK_LONG)
||(result==VTK_UNSIGNED_LONG) ||(result==VTK_FLOAT)
||(result==VTK_DOUBLE) ||(result==VTK_ID_TYPE)
vtkIdType = obj.GetSize ()
- Number of tuples.
\post valid_result: result>=0
long = obj.GetActualMemorySize ()
- Size in kilobytes taken by the attribute.
obj.GetRange (int component, double range[2])
- Range of the attribute component `component'. If `component'==-1, it
returns the range of the magnitude (euclidean norm).
THREAD SAFE
\pre valid_component: (component>=-1)&&(component<GetNumberOfComponents())
double = obj.GetMaxNorm ()
- Return the maximum euclidean norm for the tuples.
\post positive_result: result>=0
obj.GetTuple (vtkGenericAdaptorCell c, double tuple)
- Put attribute at all points of cell `c' in `tuple'.
\pre c_exists: c!=0
\pre c_valid: !c->IsAtEnd()
\pre tuple_exists: tuple!=0
\pre valid_tuple: sizeof(tuple)>=GetNumberOfComponents()*c->GetCell()->GetNumberOfPoints()
obj.GetTuple (vtkGenericCellIterator c, double tuple)
- Put attribute at all points of cell `c' in `tuple'.
\pre c_exists: c!=0
\pre c_valid: !c->IsAtEnd()
\pre tuple_exists: tuple!=0
\pre valid_tuple: sizeof(tuple)>=GetNumberOfComponents()*c->GetCell()->GetNumberOfPoints()
obj.GetTuple (vtkGenericPointIterator p, double tuple)
- Put the value of the attribute at position `p' into `tuple'.
\pre p_exists: p!=0
\pre p_valid: !p->IsAtEnd()
\pre tuple_exists: tuple!=0
\pre valid_tuple_size: sizeof(tuple)>=GetNumberOfComponents()
obj.GetComponent (int i, vtkGenericCellIterator c, double values)
- Put component `i' of the attribute at all points of cell `c' in `values'.
\pre valid_component: (i>=0) && (i<GetNumberOfComponents())
\pre c_exists: c!=0
\pre c_valid: !c->IsAtEnd()
\pre values_exist: values!=0
\pre valid_values: sizeof(values)>=c->GetCell()->GetNumberOfPoints()
double = obj.GetComponent (int i, vtkGenericPointIterator p)
- Value of the component `i' of the attribute at position `p'.
\pre valid_component: (i>=0) && (i<GetNumberOfComponents())
\pre p_exists: p!=0
\pre p_valid: !p->IsAtEnd()
obj.DeepCopy (vtkGenericAttribute other)
- Recursive duplication of `other' in `this'.
\pre other_exists: other!=0
\pre not_self: other!=this
obj.ShallowCopy (vtkGenericAttribute other)
- Update `this' using fields of `other'.
\pre other_exists: other!=0
\pre not_self: other!=this