Jump to content
  • Advertisement
Sign in to follow this  

graph iterator and importers scene

This topic is 2845 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

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

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


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?

Share this post

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

  • Advertisement

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!