Jump to content
  • Advertisement
Sign in to follow this  
giugio

graph iterator and importers scene

This topic is 2753 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello.
I'm creating an importer from some formats (sketchup and collada for now).
CSketchupImporter is a class api that inherits from CReader and CColladaImporter is a class api that inherit also from CReader.
Next i have the CImport that set up the correct api from CSketchupImporter and CColladaImporter and call the api like

//CImport
CSketchupImporter pApi;
pApi->importVertex(float x, float y, float z);//with polimorphism

or:

//CImport
CColladaImporter pApi;
pApi->importVertex(float x, float y, float z);//with polimorphism

this is a system for a import framework from multiples formats.

Next the problem:
Each formats have a scenegraph that must be traversed for get all the data , in particular the matrix transform that must be multiplied from parent to child and the geometri and non object (meshes , lights ecc..) that requesting to be read from other section in generally of the document always from the specific api..

Now i must use the scenegraph like a director that set the current object in the api and the CImport gets from the api all the property of the object.

my question is :
Is possible create a custom iterator(like the gof book iterator pattern) that at each call of pApi->Scene()->Next() select the next current item (member vars of the cApi class) in the tree graph of the file and stop?
for ex:

call of pApi->Scene()->Reset()
read the property of the object1,
call of pApi->Scene()->Next()
read the property of the object2,

and so on?
thanks

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!