[Ves] Add other models to the scene

Pat Marion pat.marion at kitware.com
Tue Nov 13 19:37:02 EST 2012


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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/ves/attachments/20121114/5aee0652/attachment-0001.html>


More information about the Ves mailing list