<div dir="ltr"><div><div>Dear Mr David Doria,<br><br></div></div><div><div><div><div><div><div><div><div><div><div>Thank you for your response.<br><br></div>I am going to be using C++ to develop a software that allows the user to interact with multiple objects/actors on the screen.<br></div>They should be able to move objects/actors independently from one another.<br><br></div>The
thing is, I need to store all of this in memory and so I have come up
with this class structure to store objects/actors in memory. I also have
another class to handle the vtkPicker, i.e. if points are selected on
the actor, then they stay there even if that object/actor is moved
independently the points should move with it. I am thinking of using
inheritance, this is my sort of class structure...<br><br></div>Actor Class...<span class="im"><br>class ScreenObjects<br>{<br> vtkActor (LinkedList); // I intend on using a linkedlist to store all the actors<br><br> public:<br> ScreenObjects(); // Constructor. Initializes vtkActor to null.<br> void readSTLFile(); // Reads the STL File<br> bool setObject(); // Sets current object, so you can only interact with the selected object<br></span> void reset(); //Resets everything, including vtkActors<br>}<br><br></div>Picker Class...<br></div>class PickerActor : class ScreenObjects<br>{<br></div> public:<br></div> PickerActor();<br>}<br><br><br></div>Would really appreciate it if you could give me some ideas or suggestions for my class structure.<br><br></div>Thanks<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 30, 2014 at 6:33 PM, David Doria <span dir="ltr"><<a href="mailto:daviddoria@gmail.com" target="_blank">daviddoria@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div class="h5">On Tue, Dec 30, 2014 at 1:29 PM, Student Life <span dir="ltr"><<a href="mailto:lifestudent37@gmail.com" target="_blank">lifestudent37@gmail.com</a>></span> wrote:<br></div></div><div class="gmail_extra"><div class="gmail_quote"><div><div class="h5"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div><div dir="ltr"><div>Hi,<br><br></div><div>Basically, I have multiple actors in my render window, and so far if I rotate one actor all the actors move with it as well.<br><br></div><div>I want to interact with multiple objects independently. For example,
if I have 5 objects in a render window, I want to only move, rotate and
interact with the one selected object; whilst the rest of the 4 objects
stay where it is.
<p>At the moment, the camera is doing the magic and as I rotate the
independent object, other objects move at the same time and I don't want
that to happen. </p>
<p>I also want to store all the objects in memory.</p>
<p>I intend to use C++.</p>
<p>This is my sort of class structure...</p></div><pre><code><span>class</span><span> </span><span>ScreenObjects</span><span>
</span><span>{</span><span>
vtkActor </span><span>(</span><span>LinkedList</span><span>);</span><span> </span><span>// I intend on using a linkedlist to store all the actors</span><span>
</span><span>public</span><span>:</span><span>
</span><span>ScreenObjects</span><span>();</span><span> </span><span>// Constructor. Initializes vtkActor to null.</span><span>
</span><span>void</span><span> readSTLFile</span><span>();</span><span> </span><span>// Reads the STL File</span><span>
</span><span>bool</span><span> setObject</span><span>();</span><span> </span><span>// Sets current object, so you can only interact with the selected object</span><span>
</span><span>}<br><br></span></code></pre><p>I am missing quite a lot of functions and detail in my class, as I
don't know what else to include that would be of use. I was also
thinking of joining two objects together, but again, I don't know how to
incorporate that in my class; any information on that would be
appreciated.</p>
Would really appreciate it if I could be given ideas.</div></div></div></blockquote></div></div><div><br>You need to specify an "interactor style" - the one you are looking for
here is vtkInteractorStyleTrackballActor. Here is an example:
<a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/Interaction/TrackballActor" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/Cxx/Interaction/TrackballActor</a><span class="HOEnZb"><font color="#888888"><br><div><div><br>David</div></div></font></span></div></div></div></div>
</blockquote></div><br></div>