MantisBT - VTK
View Issue Details
0002489VTK(No Category)public2005-11-15 08:102016-08-12 09:54
m.danilouchkine1 
Will Schroeder 
normalminoralways
closedmoved 
 
 
0002489: vtkAssignAttribute Assign problem
When I tried to assign the scalar attributes to the vector using the Assign methods as follows:

vtkSmartPointer<vtkReassignAttribute> imgComp2Atrrib;
imgComp2Atrrib = vtkSmartPointer<vtkReassignAttribute>::New();
imgComp2Atrrib->SetInput(<and image with 3 scalar component>);
imgComp2Atrrib->Assign(vtkDataSetAttributes::SCALARS,
 vtkDataSetAttributes::VECTORS,
 vtkReassignAttribute::POINT_DATA);

It did not work out.

I fixed the problem by changing the RequestData procedure.

    if (this->FieldType == vtkReassignAttribute::NAME && this->FieldName)
      {
      ods->SetActiveAttribute(this->FieldName, this->AttributeType);
      }
    else if (this->FieldType == vtkReassignAttribute::ATTRIBUTE &&
             (this->InputAttributeType != -1))
      {
      // If labeling an attribute as another attribute, we
      // need to get it's index and call SetActiveAttribute()
      // with that index
      int attributeIndices[vtkDataSetAttributes::NUM_ATTRIBUTES];
      ods->GetAttributeIndices(attributeIndices);
      ods->SetActiveAttribute(attributeIndices[this->InputAttributeType],this->AttributeType);
      //vtkDataArray *oda = ods->GetAttribute(this->InputAttributeType);
      //if (oda)
      // {
      // ods->SetActiveAttribute(oda->GetName(),this->AttributeType);
      // }
      }
No tags attached.
Issue History
2011-06-16 13:11Zack GalbreathCategory => (No Category)
2016-08-12 09:54Kitware RobotNote Added: 0036805
2016-08-12 09:54Kitware RobotStatusexpired => closed
2016-08-12 09:54Kitware RobotResolutionopen => moved

Notes
(0003839)
m.danilouchkine1   
2006-03-07 08:14   
The previous code should read:
vtkAssignAttribute instead of vtkReassignAttribute
(0036805)
Kitware Robot   
2016-08-12 09:54   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current VTK Issues page linked in the banner at the top of this page.