]> git.mxchange.org Git - simgear.git/blobdiff - simgear/scene/model/animation.hxx
Merge branch 'timoore/aptsign' into next
[simgear.git] / simgear / scene / model / animation.hxx
index 61901e9bcfc0b5496c5358f6968861b1f546656b..4ea07fd271ca12cbd35b543e2c8e0728585c3cad 100644 (file)
 # error This library requires C++
 #endif
 
-#include <vector>
-#include <map>
-
-#include <osg/Vec3>
-#include <osg/Vec4>
-
 #include <osg/ref_ptr>
-#include <osg/AlphaFunc>
 #include <osg/Group>
-#include <osg/Material>
 #include <osg/Node>
-#include <osg/NodeCallback>
 #include <osg/NodeVisitor>
-#include <osg/StateSet>
 #include <osg/Texture2D>
-#include <osg/TexMat>
-
 #include <osgDB/ReaderWriter>
-#include <simgear/props/props.hxx>
-#include <simgear/misc/sg_path.hxx>
 
-#include <simgear/math/interpolater.hxx>
-#include <simgear/scene/model/persparam.hxx>
 #include <simgear/scene/util/SGNodeMasks.hxx>
-
-
-SG_USING_STD(vector);
-SG_USING_STD(map);
-
-// Don't pull in the headers, since we don't need them here.
-class SGInterpTable;
-class SGCondition;
+#include <simgear/props/props.hxx>
+#include <simgear/props/condition.hxx>
+#include <simgear/structure/SGExpression.hxx>
 
 // Has anyone done anything *really* stupid, like making min and max macros?
 #ifdef min
@@ -52,18 +31,9 @@ class SGCondition;
 #undef max
 #endif
 
-
-\f
-//////////////////////////////////////////////////////////////////////
-// Helper classes, FIXME: factor out
-//////////////////////////////////////////////////////////////////////
-
-class SGDoubleValue : public SGReferenced {
-public:
-  virtual ~SGDoubleValue() {}
-  virtual double getValue() const = 0;
-};
-
+SGExpressiond*
+read_value(const SGPropertyNode* configNode, SGPropertyNode* modelRoot,
+           const char* unit, double defMin, double defMax);
 \f
 //////////////////////////////////////////////////////////////////////
 // Base class for animation installers
@@ -150,7 +120,7 @@ public:
 private:
   class UpdateCallback;
   SGSharedPtr<const SGCondition> _condition;
-  SGSharedPtr<const SGDoubleValue> _animationValue;
+  SGSharedPtr<const SGExpressiond> _animationValue;
   SGVec3d _axis;
   double _initialValue;
 };
@@ -169,7 +139,7 @@ private:
   class UpdateCallback;
   class SpinUpdateCallback;
   SGSharedPtr<const SGCondition> _condition;
-  SGSharedPtr<const SGDoubleValue> _animationValue;
+  SGSharedPtr<const SGExpressiond> _animationValue;
   SGVec3d _axis;
   SGVec3d _center;
   double _initialValue;
@@ -189,7 +159,7 @@ public:
 private:
   class UpdateCallback;
   SGSharedPtr<const SGCondition> _condition;
-  SGSharedPtr<const SGDoubleValue> _animationValue[3];
+  SGSharedPtr<const SGExpressiond> _animationValue[3];
   SGVec3d _initialValue;
   SGVec3d _center;
 };
@@ -204,7 +174,6 @@ public:
   SGDistScaleAnimation(const SGPropertyNode* configNode,
                        SGPropertyNode* modelRoot);
   virtual osg::Group* createAnimationGroup(osg::Group& parent);
-private:
   class Transform;
 };
 
@@ -218,7 +187,7 @@ public:
   SGFlashAnimation(const SGPropertyNode* configNode,
                    SGPropertyNode* modelRoot);
   virtual osg::Group* createAnimationGroup(osg::Group& parent);
-private:
+public:
   class Transform;
 };
 
@@ -232,7 +201,6 @@ public:
   SGBillboardAnimation(const SGPropertyNode* configNode,
                        SGPropertyNode* modelRoot);
   virtual osg::Group* createAnimationGroup(osg::Group& parent);
-private:
   class Transform;
 };
 
@@ -249,8 +217,8 @@ public:
 private:
   class UpdateCallback;
   SGSharedPtr<const SGCondition> _condition;
-  SGSharedPtr<const SGDoubleValue> _minAnimationValue;
-  SGSharedPtr<const SGDoubleValue> _maxAnimationValue;
+  SGSharedPtr<const SGExpressiond> _minAnimationValue;
+  SGSharedPtr<const SGExpressiond> _maxAnimationValue;
   SGVec2d _initialValue;
 };
 
@@ -294,7 +262,7 @@ public:
 private:
   class BlendVisitor;
   class UpdateCallback;
-  SGSharedPtr<SGDoubleValue> _animationValue;
+  SGSharedPtr<SGExpressiond> _animationValue;
 };
 
 \f