]> 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 b1165045869695a0bffebab9f5e91473aa227179..2f8648e2c14957aa997b4f5e5ea3b92274c232c9 100644 (file)
@@ -32,6 +32,19 @@ SG_USING_STD(set);
 #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
@@ -47,7 +60,8 @@ SG_USING_STD(set);
 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 );
 
 
 /**
@@ -76,6 +90,12 @@ 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
  */