# 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
#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
virtual ~SGAnimation();
static bool animate(osg::Node* node, const SGPropertyNode* configNode,
- SGPropertyNode* modelRoot);
+ SGPropertyNode* modelRoot,
+ const osgDB::ReaderWriter::Options* options);
protected:
void apply(osg::Node* node);
virtual osg::Group* createAnimationGroup(osg::Group& parent);
private:
class UpdateCallback;
- class Transform;
SGSharedPtr<const SGCondition> _condition;
- SGSharedPtr<const SGDoubleValue> _animationValue;
+ SGSharedPtr<const SGExpressiond> _animationValue;
SGVec3d _axis;
double _initialValue;
};
private:
class UpdateCallback;
class SpinUpdateCallback;
- class Transform;
SGSharedPtr<const SGCondition> _condition;
- SGSharedPtr<const SGDoubleValue> _animationValue;
+ SGSharedPtr<const SGExpressiond> _animationValue;
SGVec3d _axis;
SGVec3d _center;
double _initialValue;
virtual osg::Group* createAnimationGroup(osg::Group& parent);
private:
class UpdateCallback;
- class Transform;
SGSharedPtr<const SGCondition> _condition;
- SGSharedPtr<const SGDoubleValue> _animationValue[3];
+ SGSharedPtr<const SGExpressiond> _animationValue[3];
SGVec3d _initialValue;
SGVec3d _center;
};
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;
};
private:
class BlendVisitor;
class UpdateCallback;
- SGSharedPtr<SGDoubleValue> _animationValue;
+ SGSharedPtr<SGExpressiond> _animationValue;
};
\f
class SGShaderAnimation : public SGAnimation {
public:
SGShaderAnimation(const SGPropertyNode* configNode,
- SGPropertyNode* modelRoot);
+ SGPropertyNode* modelRoot,
+ const osgDB::ReaderWriter::Options* options);
virtual osg::Group* createAnimationGroup(osg::Group& parent);
private:
class UpdateCallback;