<div dir="ltr">Dear David Doria, John,<div><br></div><div>Many thanks for your response.</div><div><br></div><div>I sort of have a clear picture on what I want to achieve and how I am going to go about achieving it.</div><div><br></div><div>I have a few questions, and I would really appreciate it if you could answer them or give me some suggestions.</div><div><br></div><div>1) Since I intend on using the<b> 'vtkInteractorStyleTrackballActor' </b>to interact with actors individually, I know that I will need to manually do the mathematics to allow the user to interact with the actor. I intend on using matrices, however I am not sure how to incorporate it into my class structure. At the moment, I have an <b>Actor</b> class, which basically stores a <b>vtkActor's</b> properties such as opacity, lighting and scale. The thing is, I am not sure if I should store the functions that the <b>vtkTransform</b> and <b>vtkMatrix4x4</b> offer in the <b>Actor </b>class. Should they be part of my <b>Actor</b> class, or should they be somewhere else? Because, ideally I want to apply transformations on each actor, but I am not sure if I should store each transformation in the <b>Actor </b>class.</div><div><br></div><div>2) In terms of data structure for handling multiple <b>vtkActors</b> and <b>vtkAssembly's</b>, I am not sure if I should opt for the <b>std::vector </b> data structure or use a <b>linked list</b>. Ideally, I want the user to load a few stl/obj files and then my software to store each stl/obj file into memory. I can't really use an array, because it is unknown how many <b>vtkActors</b>, the user wants on the screen. What is the best sort of way of storing each <b>vtkActor</b> into memory? As for <b>vtkAssemblys</b>, some actors can be grouped into parts, so there will definitely be more than one <b>vtkAssembly</b> but again, I am not sure which data structure to go for. Should I go for a <b>std::vector </b>or a <b>linked list?</b></div><div><b><br></b></div><div>3) If I understand <b>vtkPolyDatas </b>correctly, they are basically the geometry and mesh behind a physical <b>vtkActor</b>? Should I have a separate class to handle <b>vtkPolyData</b>, because at the moment I have the <b>vtkPolyDataMapper</b> in my Actor class.</div><div><br></div><div>4) What is the difference between <b>vtkActorCollection</b> and <b>vtkAssembly</b>? Ideally, I want to 'group' some <b>vtkActors</b>, so that they can be interacted with and rotated in unison, but again I am not too sure which one to go for. After, you recommended the <b>vtkAssembly</b>, I did some research into it and it seems to be the more appropriate one, but now the <b>vtkActorCollection</b> is confusing me.</div><div><br></div><div>Once again, thank you for answering my previous queries, it has meant a lot to me. I would really appreciate it if you could answer my questions.</div><div><br></div><div>Thanks</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 7, 2015 at 1:21 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"><span class="">On Tue, Jan 6, 2015 at 5:51 PM, Student Life <span dir="ltr"><<a href="mailto:lifestudent37@gmail.com" target="_blank">lifestudent37@gmail.com</a>></span> wrote:<br></span><div class="gmail_extra"><div class="gmail_quote"><span class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Dear David Doria,<div><br></div><div>Thank you for your response. </div><div><br></div><div>I did some research into the<b> vtkAssembly</b> class and found that the method, <b>'void AddPart (vtkProp3D *)'</b> adds the part. However, it takes a <b>vtkProp3D</b> object as its parameter, but then <b>vtkActor </b>inherits from <b>vtkProp3D.</b> Would I be right in saying that this function would still work, as my objects are all declared as <b>vtkActor </b>and not <b>vtkProp3D?</b></div></div></blockquote><div><br></div></span><div>Yes, that's exactly how it is done in the example I sent.<br></div><span class=""><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>The only sort of difficulty/concern I am having is storing more than one <b>vtkActor </b>in a <b>vtkRenderer.</b></div><div><br></div><div>So far, I intend on implementing an actor class in C++, and then another class called 'MultipleActors' which takes instances of the actor class and stores it as a linked list. However, I am not sure if this is a wise thing to do. Is there another way/data structure that I could use for storing multiple actors into memory in C++?</div></div></blockquote><div><br></div></span><div>Sure, you can do whatever you want with your pointers (such as store them in a std::vector, as John pointed out).<br></div><span class=""><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Also, in regards to moving the actor independently, I want to make use of matrices? How do I incorporate this into my actor class/VTK?</div></div></blockquote></span><div><br>You can set the "transform" (vtkActor::SetTransform) of an actor like this:<br><br><a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/TransformActor" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/TransformActor</a><br><br></div><div>and you can use vtkTransform::SetMatrix to specify a transform matrix directly:<br><br><a href="http://www.vtk.org/doc/nightly/html/classvtkTransform.html" target="_blank">http://www.vtk.org/doc/nightly/html/classvtkTransform.html</a><br><br></div><span class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Finally, I am slightly confused about how the<b> vtkPolyDataMapper</b> works/is incorporated with <b>vtkActors</b>? Does every <b>vtkActor </b>have its own <b>vtkPolyDataMapper?</b> Are rotations and the mathematics behind the <b>vtkPolyDataMapper?</b></div></div></blockquote><div><br></div></span><div>Yes, every actor needs a mapper. I don't believe any transforms are applied in the mapper, but rather directly to the actor as I mentioned above.<span class="HOEnZb"><font color="#888888"><br></font></span></div><span class="HOEnZb"><font color="#888888"><div> <br></div><div>David<br></div></font></span></div><br></div></div>
</blockquote></div><br></div>