[vtk-developers] vtkLODProp3D and vtkProp3D:SetUserTransform ? (+ GetActors bug ?)

Sebastien BARRE sebastien at barre.nom.fr
Sun Jul 16 16:59:04 EDT 2000


I was wondering if the vtkLODProp3D might be seen as a kind of assembly ?

If it's the case, wouldn't it be logical that, being a subclass of 
vtkProp3D, a vtkLODProp3D should propage the UserTransform as an assembly 
does ? Modifying the UserTransform would automatically modify the aspect of 
the objects in the LODProp3D, as it is implemented for an assembly (in the 
current CVS, doing so on the LODProp3D does not affect anything).

I know that I might use the UserMatrix, the I found the UserTransform more 
powerful most of the time.

Here is the beginning of the implementation :

// The real method for adding an actor LOD.
int vtkLODProp3D::AddLOD( vtkMapper *m, vtkProperty *p,
			  vtkTexture *t, float time )
{
   int          index;
   vtkActor     *actor;
   vtkMatrix4x4 *matrix;

   index = this->GetNextEntryIndex();

   actor = vtkActor::New();
   matrix = vtkMatrix4x4::New();
   this->GetMatrix(matrix);
   actor->SetUserMatrix(matrix);
   matrix->Delete();
   actor->SetMapper( m );

The UserMatrix is shared I guess, but it's missing the UserTransform, am I 
right ? Something like :

actor->SetUserTransform(this->GetUserTransform());

Am I missing a point somewhere ?

For the moment, I could correct this by adding some mapper/property 
combination to the LODProp3D, then browse the collection of prop3D that 
were internally created by the LODProp3D, and set their UserTransform.
Sadly, there is no way to get this collection of prop3D. The 
LODProp3D::GetActors is documented as :

"For some exporters and other other operations we must be able to collect 
all the actors or volumes. These methods are used in that process."

But this is not what happens. Here is the beginning of the code :

void vtkLODProp3D::GetActors(vtkPropCollection *ac)
{
   vtkDebugMacro(<< "vtkLODProp3D::GetActors");
   int index = 0;
   if (this->AutomaticPickLODSelection)
     {
     if ( this->SelectedLODIndex < 0 ||
	this->SelectedLODIndex >= this->NumberOfEntries )
       {
       index = this->GetAutomaticPickPropIndex();
       }
     else
       {
       index = this->SelectedLODIndex;
       }
     if (! this->LODs[index].Prop3D->IsA("vtkVolume"))
       {
       ac->AddItem(this->LODs[index].Prop3D);
       }
     }

=> I might be wrong, but GetActors() seems to have been written so that :
	a) only the prop that shall be used for the given estimated time will be 
returned
	b) NO vtkVolume !

My question : is that behaviour OK ? I guess LODProp3D was mainly 
introduced to handle volume rendering issues, therefore is there any 
rational for b) ? Should we add a method to get real access to every prop3D 
that have been created internally ?

Thanks 





More information about the vtk-developers mailing list