]> git.mxchange.org Git - simgear.git/blobdiff - simgear/scene/model/model.hxx
- better error message when submodel loading failed
[simgear.git] / simgear / scene / model / model.hxx
index 564c4d416cb938c923fab324a6ae85b94110a2d4..2f8648e2c14957aa997b4f5e5ea3b92274c232c9 100644 (file)
 #endif
 
 #include <vector>
+#include <set>
 
 SG_USING_STD(vector);
+SG_USING_STD(set);
 
 #include <plib/sg.h>
 #include <plib/ssg.h>
 
+#include <simgear/misc/sg_path.hxx>
 #include <simgear/props/props.hxx>
 
 
@@ -29,6 +32,19 @@ SG_USING_STD(vector);
 #endif
 
 
+/**
+ * Abstract class for adding data to the scene graph.  modelLoaded() is
+ * called by sgLoad3DModel() after the model was loaded, and the destructor
+ * when the branch is removed from the graph.
+ */
+class SGModelData : public ssgBase {
+public:
+    virtual ~SGModelData() {}
+    virtual void modelLoaded( const string& path, SGPropertyNode *prop,
+                              ssgBranch *branch) {}
+};
+
+
 /**
  * Load a 3D model with or without XML wrapper.  Note, this version
  * Does not know about or load the panel/cockpit information.  Use the
@@ -44,7 +60,8 @@ SG_USING_STD(vector);
 ssgBranch *
 sgLoad3DModel( const string& fg_root, const string &path,
                           SGPropertyNode *prop_root, double sim_time_sec,
-                          ssgEntity *(*load_panel)(SGPropertyNode *) = 0 );
+                          ssgEntity *(*load_panel)(SGPropertyNode *) = 0,
+                          SGModelData *data = 0 );
 
 
 /**
@@ -63,7 +80,9 @@ sgMakeAnimation( ssgBranch * model,
                  vector<SGPropertyNode_ptr> &name_nodes,
                  SGPropertyNode *prop_root,
                  SGPropertyNode_ptr node,
-                 double sim_time_sec );
+                 double sim_time_sec,
+                 SGPath &texture_path,
+                 set<ssgBranch *> &ignore_branches );
 
 /**
  * Set the filter state on models
@@ -71,4 +90,15 @@ sgMakeAnimation( ssgBranch * model,
 bool
 sgSetModelFilter( bool filter );
 
+/**
+ * Check if the ssg node contains an animation
+ */
+bool 
+sgCheckAnimationBranch (ssgEntity * entity);
+
+/**
+ * Enable or disable Display list usage
+ */
+extern bool sgUseDisplayList;
+
 #endif // __MODEL_HXX