From David Callu, "osgManipulator Object have not META_Object macro call in class definition.

> I add META_OSGMANIPULATOR_Object macro which define className, libraryName,
> isSameKindAs methods.
> Clone method is not appropriate for osgManipulator Object."
This commit is contained in:
Robert Osfield 2009-03-11 11:29:00 +00:00
parent c58ff9b656
commit 31608b2559
15 changed files with 71 additions and 32 deletions

View File

@ -143,6 +143,8 @@ class OSGMANIPULATOR_EXPORT Dragger : public Selection
{
public:
META_OSGMANIPULATOR_Object(osgManipulator,Dragger)
/** Set/Get the CommandManager. Draggers use CommandManager to dispatch commands. */
virtual void setCommandManager(CommandManager* cm) { _commandManager = cm; }
CommandManager* getCommandManager() { return _commandManager; }
@ -186,6 +188,8 @@ class OSGMANIPULATOR_EXPORT CompositeDragger : public Dragger
{
public:
META_OSGMANIPULATOR_Object(osgManipulator,CompositeDragger)
typedef std::vector< osg::ref_ptr<Dragger> > DraggerList;
virtual const CompositeDragger* getComposite() const { return this; }

View File

@ -29,6 +29,8 @@ class OSGMANIPULATOR_EXPORT RotateCylinderDragger : public Dragger
RotateCylinderDragger();
META_OSGMANIPULATOR_Object(osgManipulator,RotateCylinderDragger)
/**
* Handle pick events on dragger and generate TranslateInLine commands.
*/

View File

@ -29,6 +29,8 @@ class OSGMANIPULATOR_EXPORT RotateSphereDragger : public Dragger
RotateSphereDragger();
META_OSGMANIPULATOR_Object(osgManipulator,RotateSphereDragger)
/**
* Handle pick events on dragger and generate TranslateInLine commands.
*/

View File

@ -35,6 +35,8 @@ class OSGMANIPULATOR_EXPORT Scale1DDragger : public Dragger
Scale1DDragger(ScaleMode scaleMode=SCALE_WITH_ORIGIN_AS_PIVOT);
META_OSGMANIPULATOR_Object(osgManipulator,Scale1DDragger)
/**
* Handle pick events on dragger and generate TranslateInLine commands.
*/

View File

@ -35,6 +35,8 @@ class OSGMANIPULATOR_EXPORT Scale2DDragger : public Dragger
Scale2DDragger(ScaleMode scaleMode=SCALE_WITH_ORIGIN_AS_PIVOT);
META_OSGMANIPULATOR_Object(osgManipulator,Scale2DDragger)
/**
* Handle pick events on dragger and generate TranslateInLine commands.
*/

View File

@ -28,6 +28,8 @@ class OSGMANIPULATOR_EXPORT ScaleAxisDragger : public CompositeDragger
ScaleAxisDragger();
META_OSGMANIPULATOR_Object(osgManipulator,ScaleAxisDragger)
/** Setup default geometry for dragger. */
void setupDefaultGeometry();

View File

@ -31,6 +31,13 @@ class Rotate3DCommand;
/** Computes the nodepath from the given node all the way upto the root. */
extern OSGMANIPULATOR_EXPORT void computeNodePathToRoot(osg::Node& node, osg::NodePath& np);
#define META_OSGMANIPULATOR_Object(library,name) \
virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const name *>(obj)!=NULL; } \
virtual const char* libraryName() const { return #library; }\
virtual const char* className() const { return #name; }
/**
* Selection listens to motion commands generated by draggers.
*/
@ -40,6 +47,8 @@ class OSGMANIPULATOR_EXPORT Selection : public osg::MatrixTransform
Selection();
META_OSGMANIPULATOR_Object(osgManipulator,Selection)
/**
* Receive motion commands and set the MatrixTransform accordingly to
* transform selections. Returns true on success.

View File

@ -29,6 +29,8 @@ class OSGMANIPULATOR_EXPORT TabBoxDragger : public CompositeDragger
TabBoxDragger();
META_OSGMANIPULATOR_Object(osgManipulator,TabBoxDragger)
/** Setup default geometry for dragger. */
void setupDefaultGeometry();

View File

@ -31,6 +31,8 @@ class OSGMANIPULATOR_EXPORT TabPlaneDragger : public CompositeDragger
TabPlaneDragger();
META_OSGMANIPULATOR_Object(osgManipulator,TabPlaneDragger)
virtual bool handle(const PointerInfo& pi, const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us);
/** Setup default geometry for dragger. */

View File

@ -29,6 +29,8 @@ class OSGMANIPULATOR_EXPORT TabPlaneTrackballDragger : public CompositeDragger
TabPlaneTrackballDragger();
META_OSGMANIPULATOR_Object(osgManipulator,TabPlaneTrackballDragger)
/** Setup default geometry for dragger. */
void setupDefaultGeometry();

View File

@ -29,6 +29,8 @@ class OSGMANIPULATOR_EXPORT TrackballDragger : public CompositeDragger
TrackballDragger(bool useAutoTransform=false);
META_OSGMANIPULATOR_Object(osgManipulator,TrackballDragger)
/** Setup default geometry for dragger. */
void setupDefaultGeometry();

View File

@ -30,6 +30,8 @@ class OSGMANIPULATOR_EXPORT Translate1DDragger : public Dragger
Translate1DDragger();
META_OSGMANIPULATOR_Object(osgManipulator,Translate1DDragger)
Translate1DDragger(const osg::Vec3d& s, const osg::Vec3d& e);
/** Handle pick events on dragger and generate TranslateInLine commands. */

View File

@ -33,6 +33,8 @@ class OSGMANIPULATOR_EXPORT Translate2DDragger : public Dragger
Translate2DDragger(const osg::Plane& plane);
META_OSGMANIPULATOR_Object(osgManipulator,Translate2DDragger)
/** Handle pick events on dragger and generate TranslateInLine commands. */
virtual bool handle(const PointerInfo& pi, const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us);

View File

@ -28,6 +28,8 @@ class OSGMANIPULATOR_EXPORT TranslateAxisDragger : public CompositeDragger
TranslateAxisDragger();
META_OSGMANIPULATOR_Object(osgManipulator,TranslateAxisDragger)
/** Setup default geometry for dragger. */
void setupDefaultGeometry();

View File

@ -30,6 +30,8 @@ class OSGMANIPULATOR_EXPORT TranslatePlaneDragger : public CompositeDragger
TranslatePlaneDragger();
META_OSGMANIPULATOR_Object(osgManipulator,TranslatePlaneDragger)
virtual bool handle(const PointerInfo& pi, const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us);
/** Setup default geometry for dragger. */