Log in or register to post comments

Retrieve list of target images programmatically

October 14, 2013 - 10:08am #1

Hello,

I'm working on the VideoPlayback sample code and I'm noticing that the association between targets and video files is hardcoded. I'm thinking to make the thing a bit more dynamical.The ideal solution would be to associate easily each target to a specific video filename and option (fullscreen, autoplay etc.). Ideally this should be defined in the database .xml but it looks like nothing like that can be generated with the Target Manager.

is there any way to programmatically retrieve the list of target images in the local Target Database? 

thanks

Retrieve list of target images programmatically

October 15, 2013 - 5:00am #6

Well, QCARControl.h (which is not part of the library) is included in EAGLView, and this contains thet dataset:

 

@interface QCARControl : NSObject {

@private

    // The current QCAR image tracker data set

    QCAR::DataSet* dataSet;

}

So, it should be easily accessible.

You could either make it public, or you could write an additional method on QCARControl.

N

 

Retrieve list of target images programmatically

October 15, 2013 - 4:34am #5

Basically, I'm in EAGLView and I need to access the dataset (in the VideoPlayback example the number of targets is hardcoded in a macro and I would like to move it to a member variable).  How can I obtain a pointer to the dataset after loading the .xml?

Retrieve list of target images programmatically

October 15, 2013 - 4:25am #4

The only problem is that it seems like the dataset is not exposed

er, not sure what the problem is?

The dataset is fully exposed, as you should be able to see from searching for it in XCode, as it is passed around as a parameter frequently.

There should be nothing stopping you from doing this:

 

        int numTrackables = dataSet->getNumTrackables();

 

N

Retrieve list of target images programmatically

October 15, 2013 - 4:11am #3

Hi

I think the dataset (and the relative methods you're naming) should be accessible through the class QCARutils). The only problem is that it seems like the dataset is not exposed and I would prefer to not modify any class in ARCommon because this could compromise future updates. Any idea for a workaround?

Retrieve list of target images programmatically

October 15, 2013 - 3:12am #2

You should be able to do this fairly easily by iterating through the dataset for each trackable, and then identifying each one by its name.

Look at Dataset.h which includes getNumTrackables() and getTrackable().

Also look at Trackable.h which includes getName().

 

It may also be easier if you drag the include/QCAR directory into the XCode navigator to make it more easily searchable.

 

N

Log in or register to post comments