[vtkusers] vtkDataSetAttributes problem

David E DeMarle dave.demarle at kitware.com
Tue Oct 4 10:04:43 EDT 2011


> Not sure if I follow you. So Theoretically only the active arrays of each
> type should return a -1 then?

You've got it backward, only the active arrays return something > -1.

In your example:
* "Materials" returns 0==active scalars,
* "Strain" returns 4==active tensors,
* "Displacement" returns 1==active vectors.
* everything else returns -1==not one of the active arrays.

See this enum:
enum  	AttributeTypes {
  SCALARS = 0, VECTORS = 1, NORMALS = 2, TCOORDS = 3,
  TENSORS = 4, GLOBALIDS = 5, PEDIGREEIDS = 6, EDGEFLAG = 7,
  NUM_ATTRIBUTES
}
in http://www.vtk.org/doc/nightly/html/classvtkDataSetAttributes.html



Materials  Attr.Type: 0        (Scalar)
Strain                        Type: double                Attr.Type:
> 4        (Tensor)
> Array5: Displacement               Type: double                Attr.Type: 1
> (Vector)

David E DeMarle
Kitware, Inc.
R&D Engineer
21 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-881-4909



On Tue, Oct 4, 2011 at 9:50 AM, Frable <zemitis.janis at inbox.lv> wrote:
> Not sure if I follow you. So Theoretically only the active arrays of each
> type should return a -1 then?
> These are the values I get (Name, Data type and attribute type) of my
> arrays. The last entry shows the correct attribute type.
> As you see it does identify Array0,Array1 and Array5 correctly. Tough I get
> -1 for all the following Scalars and Tensor.
>
> Array0: Materials                    Type: int
> Attr.Type: 0        (Scalar)
> Array1: Strain                        Type: double                Attr.Type:
> 4        (Tensor)
> Array2: vonMisesStrain            Type: double                Attr.Type: -1
> (Scalar)
> Array3: Stress                        Type: double                Attr.Type:
> -1      (Tensor)
> Array4: vonMisesStress            Type: double               Attr.Type: -1
> (Scalar)
> Array5: Displacement               Type: double                Attr.Type: 1
> (Vector)
> Array6: DisplacementMagnitude Type: double                Attr.Type: -1
> (Scalar)
>
> Hmmm, ok after taking a look upon them now it seems, that it might return
> the actual type for the active array(the first scalar,tensor,vector it comes
> accross) and -1 for the rest?
> In that case what approach would be best to differentiate them. Do I have to
> set each of the arrays as the active one first, to be able to read out it's
> attribute type or is there a better approach?
>
> I have the feeling I still lack some basic knowledge about
> Scalars,Tensors,Vectors in general and missing something simple.
> Will try to read up on it in the following days. Any advice and suggestions
> on how to handle the differentiating would be welcome.
>
> Frable
>
> --
> View this message in context: http://vtk.1045678.n5.nabble.com/vtkDataSetAttributes-problem-tp4868353p4868586.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>



More information about the vtkusers mailing list