[Ves] Add other models to the scene
Pat Marion
pat.marion at kitware.com
Fri Nov 16 04:47:51 EST 2012
Yes, I think so. I have work in progress that does something just like
that, it's on the stage/midas-kiwi branch. The work on that branch is
progressing slowly, but I hope it will eventually make it's way into master
and can be part of a future release.
I still recommend that William derive a custom app class. The
vesKiwiViewerApp class is reusable for basic functions, but most apps will
eventually require some customizations that are beyond the scope of the
KiwiViewer base app.
Pat
On Wed, Nov 14, 2012 at 3:39 PM, Aashish Chaudhary <
aashish.chaudhary at kitware.com> wrote:
> 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/20121116/334da8e5/attachment-0001.html>
More information about the Ves
mailing list