[Ves] Add other models to the scene

Aashish Chaudhary aashish.chaudhary at kitware.com
Wed Nov 14 00:39:54 EST 2012


Pat,

Should we add an API to addDataset(..) or something similar so that we can
support this use case?

Thanks


On Tue, Nov 13, 2012 at 7:37 PM, Pat Marion <pat.marion at kitware.com> wrote:

> Are you are using the vesKiwiViewerApp class?  And you are using
> vesKiwiViewerApp::loadDataset(std::string filename) to load the skull
> dataset?  If that's the case, then the problem you're having is that the
> loadDataset() method calls this->resetScene() before loading the new data,
> so each time you call it, it replaces the current scene.
>
> What I recommend is that you subclass vesKiwiViewerApp so that you have
> your own custom app class that can implement your app's behavior.  Then
> write some methods like this:
>
> class MyApp : public vesKiwiViewerApp
> {
> public:
>
> void loadScene()
> {
>   vtkSmartPointer<vtkDataSet> skull = this->getSkull();
>   vtkSmartPointer<vtkDataSet> pin = this->getPin();
>
>   this->addRepresentationsForDataSet(skull);
>   this->addRepresentationsForDataSet(pin);
> }
>
> vtkSmartPointer<vtkDataSet> getSkull()
> {
>   std::string filename = "/path/to/skull.vtp";
>   vesKiwiDataLoader loader;
>   return this->Internal->loader.loadDataset(filename);
> }
>
> vtkSmartPointer<vtkDataSet> getPin()
> {
>   std::string filename = "/path/to/pin.vtp";
>   vesKiwiDataLoader loader;
>   return this->Internal->loader.loadDataset(filename);
> }
>
> };
>
>
> On Wed, Nov 14, 2012 at 8:52 AM, William Grand <
> wgrand at grandinteractive.com> wrote:
>
>> Hi,
>>
>> I have a model of a skull, but I want the ability to add 3D pins to it.
>>
>> How would I add my 3D pin to the scene?  Can someone point me the right
>> direction?
>> I'm not sure how to add objects without swapping out the skull model.
>>
>> Thanks,
>> William
>>
>>
>> _________________________________
>> *William Grand* | Founder & CEO
>> Grand Interactive, Boston
>> 617.652-0545 | www.grandinteractive.com
>>
>>
>> _______________________________________________
>> Ves mailing list
>> Ves at public.kitware.com
>> http://public.kitware.com/cgi-bin/mailman/listinfo/ves
>>
>>
>
> _______________________________________________
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/ves/attachments/20121114/7d1d07e3/attachment-0001.html>


More information about the Ves mailing list