[vtk-developers] vtkLODProp3D and vtkProp3D:SetUserTransform ? (+ GetActors bug ?)
David Gobbi
dgobbi at irus.rri.on.ca
Sun Jul 16 20:45:08 EDT 2000
I can't answer all the questions here, but I'll take a stab at some of
them:
On Mon, 17 Jul 2000, Sebastien BARRE wrote:
> 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).
This seems to make sense.
> I know that I might use the UserMatrix, the I found the UserTransform more
> powerful most of the time.
Yeah, that's why I added SetUserTransform a few months back.
> 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 ?
The UserTransform and UserMatrix _should_ be unified, i.e. they should
always be the same transformation. Right now, they aren't... I was
waiting for the new Assembly code to stabilize before unifying the
UserTransform and UserMatrix. I'll look into it sometime soon, I
already know exactly what has to be done.
- David
> 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
>
> _______________________________________________
> vtk-developers mailing list
> vtk-developers at public.kitware.com
> http://public.kitware.com/mailman/listinfo/vtk-developers
More information about the vtk-developers
mailing list