<div dir="ltr">Dear David Doria,<div><br></div><div>Thank you for your response.</div><div><br></div><div>I have an actor class which will store the properties of the actor on screen. For example, its opacity, colour etc. Basically, as I have previously mentioned, I only want to move the actor sometimes meaning that I would need to make use of the <b>'vtkInteractorStyleTrackballActor'. </b>However, this will mean that I will need to handle the mathematics behind it, so I am not sure where to store an actors transformation. Should I store it in the actor class or implement another class?</div><div><b><br></b></div><div>As for the polydata and polydata mapper, should I keep it in the same class as the actor class?</div><div><b><br></b></div><div>There is currently an example on YouTube, of a similar software that I am trying to implement. Basically, I want to group and ungroup objects on screen/memory, but I am not sure on how to implement the data structure.<b> </b>This is the link to the video - <a href="https://www.youtube.com/watch?v=iy0gTaN3BKI">https://www.youtube.com/watch?v=iy0gTaN3BKI</a>, I am trying to implement a feature similar to the one shown between 3:00 - 6:05 minutes of the video. I was thinking of using the vtkAssembly, but I am struggling with the memory management of all the vtkActors/objects on screen. I don't know if I should use a vector or linked list</div><div><br></div><div>Would greatly appreciate it if you could give me ideas.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 9, 2015 at 1:22 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 class="gmail_extra"><div class="gmail_quote"><span class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><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></blockquote><div><br></div></span><div>It is not clear why you are trying to duplicate the VTK class structure/functionality? It sounds like all you need is to have a contain of these objects and use their functions (and NOT manually do the mathematics).<br></div><span class=""><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><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></blockquote><div><br></div></span><div>The container you choose should only matter for the speed of insertions and removals.<br></div><span class=""><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><b></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></blockquote><div><br></div></span><div>Again, it's still not clear why you are duplicating the hierarchy.<br></div><span class=""><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><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></blockquote><div><br></div></span><div>I'm not too sure, but after a quick look it looks like vtkAssembly allows hierarchy to be encoded, whereas vtkActorCollection is more like your #2 above where it is simply a flat container to store a collection of actors.<span class="HOEnZb"><font color="#888888"><br><br></font></span></div><span class="HOEnZb"><font color="#888888"><div>David<br></div></font></span></div><br></div></div>
</blockquote></div><br></div>