I had a typo in my code example<br><br>vesKiwiBrain  should be:  vesKiwiBrainAtlasRepresentation* rep = self->renderer.app->getBrainRepresentation();<div id=":74"></div><br><br><div class="gmail_quote">On Thu, Apr 19, 2012 at 11:32 AM, Pat Marion <span dir="ltr"><<a href="mailto:pat.marion@kitware.com">pat.marion@kitware.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Dan,<br>
<br>Are you using vesKiwiViewerApp or have to forked/renamed it to create your own app class?  Either way, I'd add a new convenience method to your app class (or vesKiwiViewerApp) that returns the representation:<br>



<br>vesKiwiBrainAtlasRepresentation* vesKiwiViewerApp::getBrainRepresentation();<br><br>Next, modify vesKiwiBrainAtlasRepresentation (or fork and rename it to be your own class), so that rather than show a text label, it stores the 2D screen coordinates and the model id and string.  Then add api to the representation, something like:<br>



<br>// return whether or not a model was selected during the last double tap event<br>bool modelWasSelected();<br><br>// return information about the model that was selected during the last double tap event<br>int selectedModelId();<br>


std::string selectedModelName();<br>vesVector2f selectedModelScreenCoordinates();<br>
<br><br>Then, in objective-c, after calling:<br><br><i> </i>self->renderer.app->handleDoubleTap(currentLocation.x, currentLocation.y);<br><br>You could do:<br><br>vesKiwiBrain<br><i> </i>if (rep->modelWasSelected()) {<br>



<br>  NSString* modelName = [NSString stringWithUTF8String:rep->selectedModelName().c_str()];<br>  ...<br><br>}<br><br>Hope this helps!<span class="HOEnZb"><font color="#888888"><br><br>Pat</font></span><div class="HOEnZb">

<div class="h5"><br><br><br><div class="gmail_quote">On Thu, Apr 19, 2012 at 11:13 AM, Aashish Chaudhary <span dir="ltr"><<a href="mailto:aashish.chaudhary@kitware.com" target="_blank">aashish.chaudhary@kitware.com</a>></span> wrote:<br>



<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Dan,<br>
<div><br>
On Thu, Apr 19, 2012 at 10:46 AM, Belsey, Daniel (UK)<br>
<<a href="mailto:Daniel.Belsey@baesystems.com" target="_blank">Daniel.Belsey@baesystems.com</a>> wrote:<br>
> Hi,<br>
><br>
><br>
><br>
> I’m new to all of VES, VTK, objective-C and iOS dev – so apologies if any of<br>
> this is obvious!<br>
<br>
<br>
><br>
> My initial task is to modify the brain atlas example included in Kiwiviewer,<br>
> so that when a part of the brain is double-tapped, instead of the part’s<br>
> name appearing as it does now, it instead appears in a message-box. The idea<br>
> being, further down the line we’ll be storing a web link instead of the<br>
> part’s name, and then hopefully get some content from the web link and<br>
> display this in the message box.<br>
><br>
><br>
><br>
> We were originally going to do it with Android, but we don’t have a linux<br>
> machine available and had no joy getting it working on my windows machine<br>
> (and then found from this mailing list that Cygwin was unsupported too!) so<br>
> now there’s a Mac in the process of being set up and I’ve been asked to do<br>
> it for iOS instead.<br>
><br>
><br>
><br>
> I’m having trouble wrapping my head around how to do this, however. I’ve got<br>
> a rough idea – presumably EAGLView.mm’s handleDoubleTapGesture method can be<br>
> modified to show a UIAlertView, but I don’t know quite how to get the data<br>
> from the app’s handleDoubleTap method.<br>
><br>
><br>
><br>
> I’m assuming (and please correct me on this!) that<br>
> vesKiwiViewerApp::handleDoubleTap gets called first, and that then calls<br>
> BrainRepresentation::handleDoubleTap.<br>
<br>
</div>If I recall this sounds correct.<br>
<div><br>
I’m not sure if this is true because I<br>
> don’t really understand the use of rep; but, if this is true, I’m guessing<br>
> it wouldn’t be too hard to change the return types to String in both cases<br>
> (and make sure the conditionals still make sense), but even if this is true,<br>
> I’m then not sure how to handle this on the object-C side of things. Would<br>
> it just be as simple as adding:<br>
><br>
><br>
><br>
> NSString* name = self->renderer.app->handleDoubleTap(currentLocation.x,<br>
> currentLocation.y);<br>
<br>
</div>I will let Pat give you more details on it but I would think that you<br>
can derive your own representation from<br>
vesKiwiBrainAtlasRepresentation and  then add a new  method that can<br>
give<br>
a string name of the model, call this method findModel(x,y) or something.<br>
<br>
HTH,<br>
Aashish<br>
<div><br>
<br>
<br>
><br>
<br>
<br>
><br>
><br>
> Apologies for the vague email – I think I just need some direction!<br>
><br>
><br>
><br>
> Many thanks in advance,<br>
><br>
><br>
><br>
> Dan<br>
><br>
><br>
><br>
><br>
> ********************************************************************<br>
> This email and any attachments are confidential to the intended<br>
> recipient and may also be privileged. If you are not the intended<br>
> recipient please delete it from your system and notify the sender.<br>
> You should not copy it or use it for any purpose nor disclose or<br>
> distribute its contents to any other person.<br>
> ********************************************************************<br>
><br>
><br>
</div>> _______________________________________________<br>
> Ves mailing list<br>
> <a href="mailto:Ves@public.kitware.com" target="_blank">Ves@public.kitware.com</a><br>
> <a href="http://public.kitware.com/cgi-bin/mailman/listinfo/ves" target="_blank">http://public.kitware.com/cgi-bin/mailman/listinfo/ves</a><br>
><br>
<span><font color="#888888"><br>
<br>
<br>
--<br>
| Aashish Chaudhary<br>
| R&D Engineer<br>
| Kitware Inc.<br>
| <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
_______________________________________________<br>
Ves mailing list<br>
<a href="mailto:Ves@public.kitware.com" target="_blank">Ves@public.kitware.com</a><br>
<a href="http://public.kitware.com/cgi-bin/mailman/listinfo/ves" target="_blank">http://public.kitware.com/cgi-bin/mailman/listinfo/ves</a><br>
</font></span></blockquote></div><br>
</div></div></blockquote></div><br>