/* file:	include/osgVRPN/AnalogTransform.h
 * author:	Mike Weiblen mew@mew.cx 2003-12-28
 * copyright:	(C) 2003 Michael Weiblen
 * license:	OpenSceneGraph Public License (OSGPL)
 *
 * references:	http://www.openscenegraph.org/
 *		http://www.vrpn.org/
 *		http://www.mew.cx/osg/
 *
 * depends:	OSG 0.9.6-2, VRPN 06.04
*/

#ifndef OSG_ANALOGTRANSFORM
#define OSG_ANALOGTRANSFORM 1

#include <osg/MatrixTransform>

#include <osgVRPN/Export>
#include <osgVRPN/Analog.h>

namespace osgVRPN {

/** osgVRPN::AnalogTransform is a Transform node that can be controlled by a osgVRPN::Analog.
It can be used to control the position of objects in the scene.
*/

class OSGVRPN_EXPORT AnalogTransform : public osg::MatrixTransform
{
public :
    AnalogTransform( osg::ref_ptr<Analog> analog = 0 );
    AnalogTransform( const char* analogName );

    AnalogTransform( const AnalogTransform& xform,
	    const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY ) :
		MatrixTransform( xform, copyop ),
		_analog( xform._analog )
    {}

    META_Node( osgVRPN, AnalogTransform );


    /** Set the Analog that controls this transform, 0==none */
    void setAnalog( osg::ref_ptr<Analog> analog ) { _analog = analog; }

    /** Query the Analog that controls this transform. */
    osg::ref_ptr<Analog> getAnalog() const { return _analog; }


protected:	// methods
    virtual ~AnalogTransform() {}

protected:	// data
    osg::ref_ptr<Analog> _analog;
};

}

#endif
