Replaced tabs
This commit is contained in:
@@ -45,7 +45,7 @@ class OSGMANIPULATOR_EXPORT AntiSquish: public osg::MatrixTransform
|
||||
virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const AntiSquish *>(obj)!=NULL; }
|
||||
|
||||
void setPivot(const osg::Vec3& pvt)
|
||||
{
|
||||
{
|
||||
_pivot = pvt;
|
||||
_usePivot = true;
|
||||
_dirty = true;
|
||||
@@ -54,7 +54,7 @@ class OSGMANIPULATOR_EXPORT AntiSquish: public osg::MatrixTransform
|
||||
const osg::Vec3& getPivot() { return _pivot; }
|
||||
|
||||
void setPosition(const osg::Vec3& pos)
|
||||
{
|
||||
{
|
||||
_position = pos;
|
||||
_usePosition = true;
|
||||
_dirty = true;
|
||||
@@ -68,7 +68,7 @@ class OSGMANIPULATOR_EXPORT AntiSquish: public osg::MatrixTransform
|
||||
|
||||
protected:
|
||||
|
||||
osg::NodeCallback* _asqCallback;
|
||||
osg::NodeCallback* _asqCallback;
|
||||
|
||||
osg::Vec3 _pivot;
|
||||
bool _usePivot;
|
||||
|
||||
@@ -34,10 +34,10 @@ class OSGMANIPULATOR_EXPORT MotionCommand : public osg::Referenced
|
||||
public:
|
||||
|
||||
/**
|
||||
* Motion command are based on click-drag-release actions. So each
|
||||
* command needs to indicate which stage of the motion the command
|
||||
* represents.
|
||||
*/
|
||||
* Motion command are based on click-drag-release actions. So each
|
||||
* command needs to indicate which stage of the motion the command
|
||||
* represents.
|
||||
*/
|
||||
enum Stage
|
||||
{
|
||||
NONE,
|
||||
@@ -61,24 +61,24 @@ class OSGMANIPULATOR_EXPORT MotionCommand : public osg::Referenced
|
||||
virtual void applyConstraint(const Constraint*) = 0;
|
||||
|
||||
/**
|
||||
* Add Selection (receiver) to the command. The command will be
|
||||
* executed on all the selections.
|
||||
*/
|
||||
* Add Selection (receiver) to the command. The command will be
|
||||
* executed on all the selections.
|
||||
*/
|
||||
void addSelection(Selection*);
|
||||
|
||||
/** Remove Selection (receiver) from the command. */
|
||||
void removeSelection(Selection*);
|
||||
|
||||
/**
|
||||
* Gets the matrix for transforming the Selection. This matrix is in the
|
||||
* command's coordinate systems.
|
||||
*/
|
||||
* Gets the matrix for transforming the Selection. This matrix is in the
|
||||
* command's coordinate systems.
|
||||
*/
|
||||
virtual osg::Matrix getMotionMatrix() const = 0;
|
||||
|
||||
/**
|
||||
* Sets the matrix for transforming the command's local coordinate
|
||||
* system to the world/object coordinate system.
|
||||
*/
|
||||
* Sets the matrix for transforming the command's local coordinate
|
||||
* system to the world/object coordinate system.
|
||||
*/
|
||||
void setLocalToWorldAndWorldToLocal(const osg::Matrix& localToWorld, const osg::Matrix& worldToLocal)
|
||||
{
|
||||
_localToWorld = localToWorld;
|
||||
@@ -86,15 +86,15 @@ class OSGMANIPULATOR_EXPORT MotionCommand : public osg::Referenced
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the matrix for transforming the command's local coordinate
|
||||
* system to the world/object coordinate system.
|
||||
*/
|
||||
* Gets the matrix for transforming the command's local coordinate
|
||||
* system to the world/object coordinate system.
|
||||
*/
|
||||
inline const osg::Matrix& getLocalToWorld() const { return _localToWorld; }
|
||||
|
||||
/**
|
||||
* Gets the matrix for transforming the command's world/object
|
||||
* coordinate system to the command's local coordinate system.
|
||||
*/
|
||||
* Gets the matrix for transforming the command's world/object
|
||||
* coordinate system to the command's local coordinate system.
|
||||
*/
|
||||
inline const osg::Matrix& getWorldToLocal() const { return _worldToLocal; }
|
||||
|
||||
void setStage(const Stage s) { _stage = s; }
|
||||
@@ -114,7 +114,7 @@ class OSGMANIPULATOR_EXPORT MotionCommand : public osg::Referenced
|
||||
|
||||
Stage _stage;
|
||||
|
||||
SelectionList _selectionList;
|
||||
SelectionList _selectionList;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -35,9 +35,9 @@ class OSGMANIPULATOR_EXPORT Projector : public osg::Referenced
|
||||
|
||||
/**
|
||||
* Calculates the object/world coordinates (projectedPoint) of a window
|
||||
* coordinate (pointToProject) when projected onto some shape or
|
||||
* geometry (implemented in derived classes). SceneView in used for i
|
||||
* projecting window coordinates into object coordinates and vice versa.
|
||||
* coordinate (pointToProject) when projected onto some shape or
|
||||
* geometry (implemented in derived classes). SceneView in used for i
|
||||
* projecting window coordinates into object coordinates and vice versa.
|
||||
* Returns true on successful projection.
|
||||
*/
|
||||
virtual bool project(const PointerInfo& pi, osg::Vec3& projectedPoint) const = 0;
|
||||
@@ -104,7 +104,7 @@ class OSGMANIPULATOR_EXPORT LineProjector : public Projector
|
||||
|
||||
/**
|
||||
* Calculates the object coordinates (projectedPoint) of a window
|
||||
* coordinate (pointToProject) when projected onto the given line.
|
||||
* coordinate (pointToProject) when projected onto the given line.
|
||||
* Returns true on successful projection.
|
||||
*/
|
||||
virtual bool project(const PointerInfo& pi, osg::Vec3& projectedPoint) const;
|
||||
@@ -132,7 +132,7 @@ class OSGMANIPULATOR_EXPORT PlaneProjector : public Projector
|
||||
|
||||
/**
|
||||
* Calculates the object coordinates (projectedPoint) of a window
|
||||
* coordinate (pointToProject) when projected onto the given plane.
|
||||
* coordinate (pointToProject) when projected onto the given plane.
|
||||
* Returns true on successful projection.
|
||||
*/
|
||||
virtual bool project(const PointerInfo& pi, osg::Vec3& projectedPoint) const;
|
||||
@@ -160,15 +160,15 @@ class OSGMANIPULATOR_EXPORT SphereProjector : public Projector
|
||||
|
||||
/**
|
||||
* Calculates the object coordinates (projectedPoint) of a window
|
||||
* coordinate (pointToProject) when projected onto the given sphere.
|
||||
* coordinate (pointToProject) when projected onto the given sphere.
|
||||
* Returns true on successful projection.
|
||||
*/
|
||||
virtual bool project(const PointerInfo& pi, osg::Vec3& projectedPoint) const;
|
||||
|
||||
/**
|
||||
* Returns true is the point is in front of the cylinder given the eye
|
||||
* direction.
|
||||
*/
|
||||
* Returns true is the point is in front of the cylinder given the eye
|
||||
* direction.
|
||||
*/
|
||||
bool isPointInFront(const PointerInfo& pi, const osg::Matrix& localToWorld) const;
|
||||
|
||||
void setFront(bool front) { _front = front; }
|
||||
@@ -195,19 +195,19 @@ class OSGMANIPULATOR_EXPORT SpherePlaneProjector : public SphereProjector
|
||||
|
||||
/**
|
||||
* Calculates the object coordinates (projectedPoint) of a window
|
||||
* coordinate (pointToProject) when projected onto the given sphere.
|
||||
* coordinate (pointToProject) when projected onto the given sphere.
|
||||
* Returns true on successful projection.
|
||||
*/
|
||||
virtual bool project(const PointerInfo& pi, osg::Vec3& projectedPoint) const;
|
||||
|
||||
/**
|
||||
* Returns true if the previous projection was on the sphere and false
|
||||
* if the projection was on the plane.
|
||||
*/
|
||||
* Returns true if the previous projection was on the sphere and false
|
||||
* if the projection was on the plane.
|
||||
*/
|
||||
bool isProjectionOnSphere() const { return _onSphere; }
|
||||
|
||||
osg::Quat getRotation(const osg::Vec3& p1, bool p1OnSphere,
|
||||
const osg::Vec3& p2, bool p2OnSphere,
|
||||
const osg::Vec3& p2, bool p2OnSphere,
|
||||
float radialFactor = 0.0f) const;
|
||||
|
||||
protected:
|
||||
@@ -239,16 +239,16 @@ class OSGMANIPULATOR_EXPORT CylinderProjector : public Projector
|
||||
|
||||
/**
|
||||
* Calculates the object coordinates (projectedPoint) of a window
|
||||
* coordinate (pointToProject) when projected onto the given plane.
|
||||
* coordinate (pointToProject) when projected onto the given plane.
|
||||
* Returns true on successful projection.
|
||||
*/
|
||||
virtual bool project(const PointerInfo& pi, osg::Vec3& projectedPoint) const;
|
||||
|
||||
|
||||
/**
|
||||
* Returns true is the point is in front of the cylinder given the eye
|
||||
* direction.
|
||||
*/
|
||||
* Returns true is the point is in front of the cylinder given the eye
|
||||
* direction.
|
||||
*/
|
||||
bool isPointInFront(const PointerInfo& pi, const osg::Matrix& localToWorld) const;
|
||||
|
||||
void setFront(bool front) { _front = front; }
|
||||
@@ -275,15 +275,15 @@ class OSGMANIPULATOR_EXPORT CylinderPlaneProjector : public CylinderProjector
|
||||
|
||||
/**
|
||||
* Calculates the object coordinates (projectedPoint) of a window
|
||||
* coordinate (pointToProject) when projected onto the given plane.
|
||||
* coordinate (pointToProject) when projected onto the given plane.
|
||||
* Returns true on successful projection.
|
||||
*/
|
||||
virtual bool project(const PointerInfo& pi, osg::Vec3& projectedPoint) const;
|
||||
|
||||
/**
|
||||
* Returns true if the previous projection was on the cylinder and
|
||||
* false if the projection was on the plane.
|
||||
*/
|
||||
* Returns true if the previous projection was on the cylinder and
|
||||
* false if the projection was on the plane.
|
||||
*/
|
||||
bool isProjectionOnCylinder() const { return _onCylinder; }
|
||||
|
||||
osg::Quat getRotation(const osg::Vec3& p1, bool p1OnCyl, const osg::Vec3& p2, bool p2OnCyl) const;
|
||||
|
||||
@@ -30,8 +30,8 @@ class OSGMANIPULATOR_EXPORT RotateCylinderDragger : public Dragger
|
||||
RotateCylinderDragger();
|
||||
|
||||
/**
|
||||
* Handle pick events on dragger and generate TranslateInLine commands.
|
||||
*/
|
||||
* Handle pick events on dragger and generate TranslateInLine commands.
|
||||
*/
|
||||
virtual bool handle(const PointerInfo& pi, const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us);
|
||||
|
||||
/** Setup default geometry for dragger. */
|
||||
@@ -42,10 +42,10 @@ class OSGMANIPULATOR_EXPORT RotateCylinderDragger : public Dragger
|
||||
inline const osg::Vec4 getColor() const { return _color; }
|
||||
|
||||
/**
|
||||
* Set/Get pick color for dragger. Pick color is color of the dragger
|
||||
* when picked. It gives a visual feedback to show that the dragger has
|
||||
* been picked.
|
||||
*/
|
||||
* Set/Get pick color for dragger. Pick color is color of the dragger
|
||||
* when picked. It gives a visual feedback to show that the dragger has
|
||||
* been picked.
|
||||
*/
|
||||
inline void setPickColor(const osg::Vec4& color) { _pickColor = color; }
|
||||
inline const osg::Vec4 getPickColor() const { return _pickColor; }
|
||||
|
||||
|
||||
@@ -30,8 +30,8 @@ class OSGMANIPULATOR_EXPORT RotateSphereDragger : public Dragger
|
||||
RotateSphereDragger();
|
||||
|
||||
/**
|
||||
* Handle pick events on dragger and generate TranslateInLine commands.
|
||||
*/
|
||||
* Handle pick events on dragger and generate TranslateInLine commands.
|
||||
*/
|
||||
virtual bool handle(const PointerInfo&, const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us);
|
||||
|
||||
/** Setup default geometry for dragger. */
|
||||
@@ -42,10 +42,10 @@ class OSGMANIPULATOR_EXPORT RotateSphereDragger : public Dragger
|
||||
inline const osg::Vec4 getColor() const { return _color; }
|
||||
|
||||
/**
|
||||
* Set/Get pick color for dragger. Pick color is color of the dragger
|
||||
* when picked. It gives a visual feedback to show that the dragger has
|
||||
* been picked.
|
||||
*/
|
||||
* Set/Get pick color for dragger. Pick color is color of the dragger
|
||||
* when picked. It gives a visual feedback to show that the dragger has
|
||||
* been picked.
|
||||
*/
|
||||
inline void setPickColor(const osg::Vec4& color) { _pickColor = color; }
|
||||
inline const osg::Vec4 getPickColor() const { return _pickColor; }
|
||||
|
||||
|
||||
@@ -36,8 +36,8 @@ class OSGMANIPULATOR_EXPORT Scale1DDragger : public Dragger
|
||||
Scale1DDragger(ScaleMode scaleMode=SCALE_WITH_ORIGIN_AS_PIVOT);
|
||||
|
||||
/**
|
||||
* Handle pick events on dragger and generate TranslateInLine commands.
|
||||
*/
|
||||
* Handle pick events on dragger and generate TranslateInLine commands.
|
||||
*/
|
||||
virtual bool handle(const PointerInfo& pi, const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us);
|
||||
|
||||
/** Setup default geometry for dragger. */
|
||||
@@ -52,10 +52,10 @@ class OSGMANIPULATOR_EXPORT Scale1DDragger : public Dragger
|
||||
inline const osg::Vec4 getColor() const { return _color; }
|
||||
|
||||
/**
|
||||
* Set/Get pick color for dragger. Pick color is color of the dragger
|
||||
* when picked. It gives a visual feedback to show that the dragger has
|
||||
* been picked.
|
||||
*/
|
||||
* Set/Get pick color for dragger. Pick color is color of the dragger
|
||||
* when picked. It gives a visual feedback to show that the dragger has
|
||||
* been picked.
|
||||
*/
|
||||
inline void setPickColor(const osg::Vec4& color) { _pickColor = color; }
|
||||
inline const osg::Vec4 getPickColor() const { return _pickColor; }
|
||||
|
||||
|
||||
@@ -36,8 +36,8 @@ class OSGMANIPULATOR_EXPORT Scale2DDragger : public Dragger
|
||||
Scale2DDragger(ScaleMode scaleMode=SCALE_WITH_ORIGIN_AS_PIVOT);
|
||||
|
||||
/**
|
||||
* Handle pick events on dragger and generate TranslateInLine commands.
|
||||
*/
|
||||
* Handle pick events on dragger and generate TranslateInLine commands.
|
||||
*/
|
||||
virtual bool handle(const PointerInfo& pi, const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us);
|
||||
|
||||
/** Setup default geometry for dragger. */
|
||||
@@ -52,10 +52,10 @@ class OSGMANIPULATOR_EXPORT Scale2DDragger : public Dragger
|
||||
inline const osg::Vec4 getColor() const { return _color; }
|
||||
|
||||
/**
|
||||
* Set/Get pick color for dragger. Pick color is color of the dragger
|
||||
* when picked. It gives a visual feedback to show that the dragger has
|
||||
* been picked.
|
||||
*/
|
||||
* Set/Get pick color for dragger. Pick color is color of the dragger
|
||||
* when picked. It gives a visual feedback to show that the dragger has
|
||||
* been picked.
|
||||
*/
|
||||
inline void setPickColor(const osg::Vec4& color) { _pickColor = color; }
|
||||
inline const osg::Vec4 getPickColor() const { return _pickColor; }
|
||||
|
||||
|
||||
@@ -35,9 +35,9 @@ class OSGMANIPULATOR_EXPORT ScaleAxisDragger : public CompositeDragger
|
||||
|
||||
virtual ~ScaleAxisDragger();
|
||||
|
||||
osg::ref_ptr< Scale1DDragger > _xDragger;
|
||||
osg::ref_ptr< Scale1DDragger > _yDragger;
|
||||
osg::ref_ptr< Scale1DDragger > _zDragger;
|
||||
osg::ref_ptr< Scale1DDragger > _xDragger;
|
||||
osg::ref_ptr< Scale1DDragger > _yDragger;
|
||||
osg::ref_ptr< Scale1DDragger > _zDragger;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -41,9 +41,9 @@ class OSGMANIPULATOR_EXPORT Selection : public osg::MatrixTransform
|
||||
Selection();
|
||||
|
||||
/**
|
||||
* Receive motion commands and set the MatrixTransform accordingly to
|
||||
* transform selections. Returns true on success.
|
||||
*/
|
||||
* Receive motion commands and set the MatrixTransform accordingly to
|
||||
* transform selections. Returns true on success.
|
||||
*/
|
||||
virtual bool receive(const MotionCommand&);
|
||||
virtual bool receive(const TranslateInLineCommand& command) { return receive((MotionCommand&)command); }
|
||||
virtual bool receive(const TranslateInPlaneCommand& command) { return receive((MotionCommand&)command); }
|
||||
|
||||
@@ -43,7 +43,7 @@ class OSGMANIPULATOR_EXPORT Translate1DDragger : public Dragger
|
||||
inline const osg::Vec4 getColor() const { return _color; }
|
||||
|
||||
/** Set/Get pick color for dragger. Pick color is color of the dragger when picked.
|
||||
It gives a visual feedback to show that the dragger has been picked. */
|
||||
It gives a visual feedback to show that the dragger has been picked. */
|
||||
inline void setPickColor(const osg::Vec4& color) { _pickColor = color; }
|
||||
inline const osg::Vec4 getPickColor() const { return _pickColor; }
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ class OSGMANIPULATOR_EXPORT Translate2DDragger : public Dragger
|
||||
inline const osg::Vec4 getColor() const { return _color; }
|
||||
|
||||
/** Set/Get pick color for dragger. Pick color is color of the dragger when picked.
|
||||
It gives a visual feedback to show that the dragger has been picked. */
|
||||
It gives a visual feedback to show that the dragger has been picked. */
|
||||
inline void setPickColor(const osg::Vec4& color) { _pickColor = color; }
|
||||
inline const osg::Vec4 getPickColor() const { return _pickColor; }
|
||||
|
||||
|
||||
@@ -35,9 +35,9 @@ class OSGMANIPULATOR_EXPORT TranslateAxisDragger : public CompositeDragger
|
||||
|
||||
virtual ~TranslateAxisDragger();
|
||||
|
||||
osg::ref_ptr< Translate1DDragger > _xDragger;
|
||||
osg::ref_ptr< Translate1DDragger > _yDragger;
|
||||
osg::ref_ptr< Translate1DDragger > _zDragger;
|
||||
osg::ref_ptr< Translate1DDragger > _xDragger;
|
||||
osg::ref_ptr< Translate1DDragger > _yDragger;
|
||||
osg::ref_ptr< Translate1DDragger > _zDragger;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user