Log in or register to post comments

sequence diagram

November 12, 2012 - 11:44am #1

anyone can help give me example about sequence diagram in imagetarget...i'm so confused...thnk

sequence diagram

November 13, 2012 - 4:45am #7

I see.

I don't have an official sequence diagram for the sample app, but it should not be too difficult for you to try and build one out of the information provided.

 

sequence diagram

November 13, 2012 - 4:39am #6

yes... i'm understand about that..i know how apllication start and end.but i'm confused make the uml or documentation about it...i'm advanced in coding but in documentation i;m a begginer...hehehehe.thnks

sequence diagram

November 13, 2012 - 2:03am #5

Hi,

as harism pointed out, the code in ImageTargets is quite self-explanatory; however these are a few things that can help you understand it better:

first, I assume you know how the Android activity life-cycle works in general (as that's the prerequisite for understanding the workflow of a QCAR application like ImageTargets);
in case you don't fully master that topic, or you wish to refresh it, I recommend a quick reading of:

http://developer.android.com/reference/android/app/Activity.html

Also, you should be familiar with the AsyncTask class, as this is a fundamental block and you must understand how it works (although it's very simple).

Then, assuming you are all clear on the above, some main key points about ImageTargets sample (and other Vuforia sample apps as well):

- the updateApplicationStatus() is the key function to look at, as it clearly shows all the transitions from one application status to another (the code is quite self-explanatory)

- starting from the onCreate() method, the app does some general initialization (such as loading textures) and it jumps into APPSTATUS_INIT_APP, where it performs basic initialization steps like setting the screen orientation, storing the screen dimensions, setting up the splashscreen, etc.

- then it continues with QCAR initialization (APPSTATUS_INIT_QCAR): here the important thing to remark is that this phase is delegated to an asynchronous task which runs in a background thread, so that the Activity life-cycle and the GUI thread can continue without being blocked to wait for QCAR initialization to finish

- it is important to understand that the Activity at this point might already move ahead and jump into the onResume() method, while QCAR is perhaps still initializing (and so no OpenGL view is yet available, among other things); this is not a problem, since the onResume() method includes some code to check if the mGLView is null or not (i.e. if it has been created or not);
note that during this time (OpenGL view not available) you will see the Splash screen on your device screen; also check the code "case APPSTATUS_INITED: " and see that the mSplashScreenView is set to invisible when the mGLView is added.

- then, coming back to our asynchronous QCAR initialization, once it is done (see onPostExecute() method), the app status will switch to _INIT_TRACKER, then to _INIT_APP_AR, then to _LOAD_TRACKER;

- the LoadTracker phase is once again asynchronous (using AsyncTask), so, same story as above;

- once the Tracker Loading is done (see onPostExecute method), the app status goes to APPSTATUS_INITED; at this point the OpenGL view is added and the splash screen goes away, then the status switches to _CAMERA_RUNNING

Also, check the onPause and onResume methods to see how the APPSTATUS_CAMERA_RUNNING and APPSTATUS_CAMERA_STOPPED are toggled.

During all of the above, various native functions (C++ JNI) are invoked from Java (you can find them out by yourself).

Last thing: the OpenGL rendering thread is a different thread, so for example, the native function _renderFrame() is called from this thread (check the ImageTaregtsRenderer.java to see what functions are called for OpenGL rendering)

I hope this helps.

 

 

sequence diagram

November 13, 2012 - 1:09am #4

ImageTargets sample application is pretty well written and split into many smaller pieces. Is there something specific in the use of it you're interested in? E.g initializing QCAR, rendering pipeline etc?

sequence diagram

November 12, 2012 - 4:36pm #3

can u post your sequence diagram?i'm so confused

sequence diagram

November 12, 2012 - 11:57am #2

Hi, personally I think ImageTargets.updateApplicationStatus(int) -method gives good idea on flow that ImageTargets application follows. Unless I'm mistaken cases in that method are in sequential order you can use as a basis for a sequence diagram. Then looking more deeper into methods called from there gives wider idea on how QCAR works.

Log in or register to post comments