Replaced tabs

This commit is contained in:
Robert Osfield
2008-11-21 11:09:11 +00:00
parent 54835570a0
commit 672a5d14fe
19 changed files with 130 additions and 130 deletions

View File

@@ -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;

View File

@@ -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;
};

View File

@@ -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;

View File

@@ -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; }

View File

@@ -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; }

View File

@@ -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; }

View File

@@ -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; }

View File

@@ -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;
};

View File

@@ -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); }

View File

@@ -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; }

View File

@@ -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; }

View File

@@ -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;
};

View File

@@ -67,8 +67,8 @@ TranslateInLineCommand::~TranslateInLineCommand()
bool TranslateInLineCommand::execute()
{
for (SelectionList::iterator iter = getSelectionList().begin();
iter != getSelectionList().end();
++iter)
iter != getSelectionList().end();
++iter)
{
(*iter)->receive(*this);
}
@@ -82,8 +82,8 @@ bool TranslateInLineCommand::unexecute()
inverse->setTranslation(-_translation);
for (SelectionList::iterator iter = getSelectionList().begin();
iter != getSelectionList().end();
++iter)
iter != getSelectionList().end();
++iter)
{
(*iter)->receive(*inverse);
}
@@ -115,8 +115,8 @@ TranslateInPlaneCommand::~TranslateInPlaneCommand()
bool TranslateInPlaneCommand::execute()
{
for (SelectionList::iterator iter = getSelectionList().begin();
iter != getSelectionList().end();
++iter)
iter != getSelectionList().end();
++iter)
{
(*iter)->receive(*this);
}
@@ -130,8 +130,8 @@ bool TranslateInPlaneCommand::unexecute()
inverse->setTranslation(-_translation);
for (SelectionList::iterator iter = getSelectionList().begin();
iter != getSelectionList().end();
++iter)
iter != getSelectionList().end();
++iter)
{
(*iter)->receive(*inverse);
}
@@ -159,8 +159,8 @@ Scale1DCommand::~Scale1DCommand()
bool Scale1DCommand::execute()
{
for (SelectionList::iterator iter = getSelectionList().begin();
iter != getSelectionList().end();
++iter)
iter != getSelectionList().end();
++iter)
{
(*iter)->receive(*this);
}
@@ -174,8 +174,8 @@ bool Scale1DCommand::unexecute()
if (_scale) inverse->setScale(1.0/_scale);
for (SelectionList::iterator iter = getSelectionList().begin();
iter != getSelectionList().end();
++iter)
iter != getSelectionList().end();
++iter)
{
(*iter)->receive(*inverse);
}
@@ -203,8 +203,8 @@ Scale2DCommand::~Scale2DCommand()
bool Scale2DCommand::execute()
{
for (SelectionList::iterator iter = getSelectionList().begin();
iter != getSelectionList().end();
++iter)
iter != getSelectionList().end();
++iter)
{
(*iter)->receive(*this);
}
@@ -219,8 +219,8 @@ bool Scale2DCommand::unexecute()
inverse->setScale(osg::Vec2(1.0/_scale[0],1.0/_scale[1]));
for (SelectionList::iterator iter = getSelectionList().begin();
iter != getSelectionList().end();
++iter)
iter != getSelectionList().end();
++iter)
{
(*iter)->receive(*inverse);
}
@@ -248,8 +248,8 @@ ScaleUniformCommand::~ScaleUniformCommand()
bool ScaleUniformCommand::execute()
{
for (SelectionList::iterator iter = getSelectionList().begin();
iter != getSelectionList().end();
++iter)
iter != getSelectionList().end();
++iter)
{
(*iter)->receive(*this);
}
@@ -263,8 +263,8 @@ bool ScaleUniformCommand::unexecute()
if (_scale) inverse->setScale(1.0/_scale);
for (SelectionList::iterator iter = getSelectionList().begin();
iter != getSelectionList().end();
++iter)
iter != getSelectionList().end();
++iter)
{
(*iter)->receive(*inverse);
}
@@ -292,8 +292,8 @@ Rotate3DCommand::~Rotate3DCommand()
bool Rotate3DCommand::execute()
{
for (SelectionList::iterator iter = getSelectionList().begin();
iter != getSelectionList().end();
++iter)
iter != getSelectionList().end();
++iter)
{
(*iter)->receive(*this);
}
@@ -307,8 +307,8 @@ bool Rotate3DCommand::unexecute()
inverse->setRotation(_rotation.inverse());
for (SelectionList::iterator iter = getSelectionList().begin();
iter != getSelectionList().end();
++iter)
iter != getSelectionList().end();
++iter)
{
(*iter)->receive(*inverse);
}

View File

@@ -128,7 +128,7 @@ bool RotateCylinderDragger::handle(const PointerInfo& pointer, const osgGA::GUIE
cmd->setStage(MotionCommand::FINISH);
cmd->setLocalToWorldAndWorldToLocal(_startLocalToWorld,_startWorldToLocal);
// Dispatch command.
if (_commandManager)
{
@@ -138,7 +138,7 @@ bool RotateCylinderDragger::handle(const PointerInfo& pointer, const osgGA::GUIE
// Reset color.
setMaterialColor(_color,*this);
aa.requestRedraw();
return true;

View File

@@ -130,7 +130,7 @@ bool RotateSphereDragger::handle(const PointerInfo& pointer, const osgGA::GUIEve
cmd->setStage(MotionCommand::FINISH);
cmd->setLocalToWorldAndWorldToLocal(_startLocalToWorld,_startWorldToLocal);
// Dispatch command.
if (_commandManager)
{
@@ -140,7 +140,7 @@ bool RotateSphereDragger::handle(const PointerInfo& pointer, const osgGA::GUIEve
// Reset color.
setMaterialColor(_color,*this);
aa.requestRedraw();
return true;

View File

@@ -141,7 +141,7 @@ bool Scale1DDragger::handle(const PointerInfo& pointer, const osgGA::GUIEventAda
cmd->setStage(MotionCommand::FINISH);
cmd->setLocalToWorldAndWorldToLocal(_projector->getLocalToWorld(),_projector->getWorldToLocal());
// Dispatch command.
if (_commandManager)
{
@@ -151,7 +151,7 @@ bool Scale1DDragger::handle(const PointerInfo& pointer, const osgGA::GUIEventAda
// Reset color.
setMaterialColor(_color,*this);
aa.requestRedraw();
return true;

View File

@@ -164,7 +164,7 @@ bool Scale2DDragger::handle(const PointerInfo& pointer, const osgGA::GUIEventAda
cmd->setStage(MotionCommand::FINISH);
cmd->setReferencePoint(_referencePoint);
cmd->setLocalToWorldAndWorldToLocal(_projector->getLocalToWorld(),_projector->getWorldToLocal());
// Dispatch command.
if (_commandManager)
{
@@ -174,7 +174,7 @@ bool Scale2DDragger::handle(const PointerInfo& pointer, const osgGA::GUIEventAda
// Reset color.
setMaterialColor(_color,*this);
aa.requestRedraw();
return true;

View File

@@ -117,7 +117,7 @@ void createCornerScaleDraggerGeometry(Scale2DDragger* cornerScaleDragger, osg::N
}
void createEdgeScaleDraggerGeometry(Scale1DDragger* horzEdgeScaleDragger, Scale1DDragger* vertEdgeScaleDragger,
osg::Node* handleNode, float handleScaleFactor)
osg::Node* handleNode, float handleScaleFactor)
{
// Create a left box.
{

View File

@@ -50,7 +50,7 @@ bool Translate2DDragger::handle(const PointerInfo& pointer, const osgGA::GUIEven
switch (ea.getEventType())
{
// Pick start.
// Pick start.
case (osgGA::GUIEventAdapter::PUSH):
{
// Get the LocalToWorld matrix for this node and set it for the projector.
@@ -81,10 +81,10 @@ bool Translate2DDragger::handle(const PointerInfo& pointer, const osgGA::GUIEven
aa.requestRedraw();
}
return true;
return true;
}
// Pick move.
// Pick move.
case (osgGA::GUIEventAdapter::DRAG):
{
osg::Vec3 projectedPoint;
@@ -107,32 +107,32 @@ bool Translate2DDragger::handle(const PointerInfo& pointer, const osgGA::GUIEven
aa.requestRedraw();
}
return true;
return true;
}
// Pick finish.
// Pick finish.
case (osgGA::GUIEventAdapter::RELEASE):
{
osg::ref_ptr<TranslateInPlaneCommand> cmd = new TranslateInPlaneCommand(_projector->getPlane());
osg::ref_ptr<TranslateInPlaneCommand> cmd = new TranslateInPlaneCommand(_projector->getPlane());
cmd->setStage(MotionCommand::FINISH);
cmd->setStage(MotionCommand::FINISH);
cmd->setReferencePoint(_startProjectedPoint);
cmd->setLocalToWorldAndWorldToLocal(_projector->getLocalToWorld(),_projector->getWorldToLocal());
// Dispatch command.
if (_commandManager)
{
// Dispatch command.
if (_commandManager)
{
_commandManager->addSelectionsToCommand(*cmd, *getParentDragger());
_commandManager->dispatch(*cmd);
}
_commandManager->dispatch(*cmd);
}
// Reset color.
setMaterialColor(_color,*this);
// Reset color.
setMaterialColor(_color,*this);
getOrCreateStateSet()->removeAttribute(_polygonOffset.get());
aa.requestRedraw();
return true;
return true;
}
default:
return false;