]> git.mxchange.org Git - simgear.git/blobdiff - simgear/scene/material/matmodel.hxx
Memory leak fixes from Till Busch
[simgear.git] / simgear / scene / material / matmodel.hxx
index 8802ad2b69498e01d59bf5f4d1e42ebc0b25b308..f173f5c0a309ae9636659a63e1820f2c89a90899 100644 (file)
 
 #include STL_STRING      // Standard C++ string library
 
-#include <plib/sg.h>
-#include <plib/ssg.h>
+#include <osg/ref_ptr>
+#include <osg/Node>
+#include <osg/NodeVisitor>
+#include <osg/Billboard>
 
 #include <simgear/structure/SGReferenced.hxx>
 #include <simgear/structure/SGSharedPtr.hxx>
-#include <simgear/structure/ssgSharedPtr.hxx>
 #include <simgear/props/props.hxx>
 
 SG_USING_STD(string);
@@ -86,7 +87,7 @@ public:
      * @param index The index of the model.
      * @return The model.
      */
-    ssgEntity *get_model( int index,
+     osg::Node *get_model( int index,
                           SGModelLib *modellib,
                           const string &fg_root,
                           SGPropertyNode *prop_root,
@@ -98,7 +99,7 @@ public:
      *
      * @return A randomly select model from the variants.
      */
-    ssgEntity *get_random_model( SGModelLib *modellib,
+    osg::Node *get_random_model( SGModelLib *modellib,
                                  const string &fg_root,
                                  SGPropertyNode *prop_root,
                                  double sim_time_sec );
@@ -120,6 +121,7 @@ public:
     HeadingType get_heading_type () const;
 
     virtual ~SGMatModel ();
+    
 
 protected:
 
@@ -141,7 +143,7 @@ private:
                       double sim_time_sec );
 
     vector<string> _paths;
-    mutable vector<ssgSharedPtr<ssgEntity> > _models;
+    mutable vector<osg::ref_ptr<osg::Node> > _models;
     mutable bool _models_loaded;
     double _coverage_m2;
     double _range_m;
@@ -198,8 +200,6 @@ private:
 
     double _range_m;
     vector<SGSharedPtr<SGMatModel> > _objects;
-
 };
 
-
 #endif // _SG_MAT_MODEL_HXX