Simple question about effects/profiles

Ok. I finally decided to breakdown and ask this on the forums. I’m a lone Collada developer with nothing but the 1.4 DOM and docs at my side. Could someone please tell me… once I have an array of abstract profiles in a variable “profileArray” like so…

domEffect* thisEffect;
error = pInputDAE->getDatabase()->getElement((daeElement**)&thisEffect,currentEffect, NULL, “effect”);

domFx_profile_abstract_Array& profileArray = thisEffect->getFx_profile_abstract_array();

How do I continue iteration to determine the exact type of profiles I’m dealing with. I know for sure my simple database has just one profile of type profile_COMMON. I can verify that by printing the getCount method on the array and even print the type “profile_COMMON”. But at this point all I have is the array of abstract profiles and I want to get to a derived domProfile_COMMON class in order access other elements like diffuse, ambient, etc… I tried a simple cast such as…

domProfile_COMMON* pCommonProfile = (domProfile_COMMON*)&profileArray[0];

and while this compiles it crashes if I try to access methods from the pCommonProfile pointer. I’m missing something fundamental here dealing with DOM navigation and this class hierarchy.

Hope someone can help…I’m trying to understand the basic navigation of databases with the DOM and feel like I’ve already milked the samples. I’ve got geometry navigation down well.


Is that what you are looking for ?

Yes I believe it is. Didn’t realize there was a forum (albiet small) over there at sourceforge.


The COLLADA DOM project lives over at since it’s release last month. It’s small but growing. I encourage you to use the resources there for DOM related discussions and issue tracking.