[Ves] Modifying actors properties before rendering them

Aashish Chaudhary aashish.chaudhary at kitware.com
Thu Mar 21 09:06:12 EDT 2013


On Thu, Mar 21, 2013 at 4:20 AM, Carlos <ves at calculoandamios.com> wrote:
> Hi,
>
> Regarding the first question about fixing the trihedron in the screen I will
> try to suggestion but I ' afraid that setting the ReferenceFrame to Absolute
> it will change also the orientation behavior.  that is something that the
> trihedron must match to the scene, as it gives orientation information.
> The goal is to display geometric objects in the space and the trihedron
> gives the orientation but is fixed in the screen , ie, the translation is
> blocked. A similar feature can be found in CAD software.
> At this point I forgot to ask about if there is in VES a similar flag to
> SetUseBounds() in order to avoid use the bound of one specific actor to
> calculate the bounds of the scene.
> I will post the checkings with setReferenceFrame.

Have a look at the vesActor class
http://public.kitware.com/ves-docs/classvesActor-members.html and like
Pat said, you could use setIsOverlayNode(true) for your purpose. As
fart as the setUseBounds(), I could add that but so far we didn't have
a use case for this.

>
>
> Regarding the possibility to add a image (jpg for example) to the background
> I already checked vesBackground.h and I saw some functions that could work,
> specially setimage, that accepts a vesImage object. But in vesImage.h the
> best function I have found is setData(const void *data, unsigned int size).
> At this point I'm block as I do not know how to read a jpg file and pass it
> to this function. Does setdata accept an vtkImageData object or something
> similar?

If you have not looked at the vesKiwiViewerApp, then have a look at this
class vesKiwiDataLoader and vesKiwiDataConversionTools and there you
can use loadDataSet() and ConvertImage() like show below:

vtkSmartPointer<vtkImageData> imageData = vtkImageData::SafeDownCast(
  loader.loadDataset(imgFilename));
this->Image = vesKiwiDataConversionTools::ConvertImage(imageData);
this->Texture = vesSharedPtr<vesTexture>(new vesTexture());
this->Texture->setImage(this->Image);

Hope this helps.

- Aashish




>
> Regards,
>
> Carlos
>
>
>
> -----Mensaje original-----
> De: Aashish Chaudhary [mailto:aashish.chaudhary at kitware.com]
> Enviado el: miércoles, 20 de marzo de 2013 22:44
> Para: Carlos
> CC: ves at public.kitware.com
> Asunto: Re: [Ves] Modifying actors properties before rendering them
>
> Hi Carlos,
>
> On Wed, Mar 20, 2013 at 5:22 PM, Carlos <ves at calculoandamios.com> wrote:
>> Hi,
>>
>>
>>
>> In VTK I have derived the vtkAxesActor class in order to fix the
>> trihedron in a fixed place on the screen. For this I have override the
>> RenderOpaqueGeometry() method that is called for each actor when a
>> renderer->render() is invoked and I modify the position of the Axes to
>> display it in the desired position.
>
> Have a look at the vesTransformInteface.h. Based on your description, I am
> thinking that you can call setReferenceFrame on the actor and pass it
> vesTransformInterface::Absolute option.
>
>>
>>
>>
>> I’m aware of the limitations of this class in VES as it has been
>> discussed in a previous thread but I would like to know if there is a
>> similar way to modify the position of one actor before rendering it
>> with the camera parameters already established. My problem is that I
>> do not fully understand the workflow generated after a
>> renderer->render() call. I have checked the VES code and there are
>> some other classes involved as vesVisitor that I do not understand.
>>
>>
>>
>> In VTK I also display an image background using a second camera not
>> related with the interactor but as I understand it is not possible to
>> use a second camera in VES. I’m thinking in using the first approach
>> and modify the image position before rendering it. Does it make sense?
>
> You can grab the background object from the renderer then you can set an
> image on it. Look at the vesRenderer.h and vesBackground.h headers.
>
> Let me know if this helps.
>
>>
>>
>>
>> Regards,
>>
>>
>>
>> Carlos
>>
>>
>>
>>
>> _______________________________________________
>> Ves mailing list
>> Ves at public.kitware.com
>> http://public.kitware.com/cgi-bin/mailman/listinfo/ves
>>
>
>
>
> --
> | Aashish Chaudhary
> | R&D Engineer
> | Kitware Inc.
> | www.kitware.com
>



-- 
| Aashish Chaudhary
| R&D Engineer
| Kitware Inc.
| www.kitware.com



More information about the Ves mailing list