From db003c12c0bc1d6106503eef5fb073e84d5c18fa Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 25 May 2010 17:02:11 +0000 Subject: [PATCH] Fixed 3 space indenting in headers. --- include/osgGA/FirstPersonManipulator | 102 ++++++++++----------- include/osgGA/FlightManipulator | 57 ++++++------ include/osgGA/KeySwitchMatrixManipulator | 4 +- include/osgGA/MatrixManipulator | 10 +- include/osgGA/OrbitManipulator | 112 +++++++++++------------ include/osgGA/StandardManipulator | 6 +- include/osgGA/TrackballManipulator | 12 +-- 7 files changed, 152 insertions(+), 151 deletions(-) diff --git a/include/osgGA/FirstPersonManipulator b/include/osgGA/FirstPersonManipulator index 6e612969b..802028b8a 100644 --- a/include/osgGA/FirstPersonManipulator +++ b/include/osgGA/FirstPersonManipulator @@ -29,73 +29,73 @@ namespace osgGA { and orientation of camera, like walk, drive, and flight manipulators. */ class OSGGA_EXPORT FirstPersonManipulator : public StandardManipulator { - typedef StandardManipulator inherited; + typedef StandardManipulator inherited; -public: + public: - FirstPersonManipulator( int flags = DEFAULT_SETTINGS ); - FirstPersonManipulator( const FirstPersonManipulator& fpm, - const osg::CopyOp& copyOp = osg::CopyOp::SHALLOW_COPY ); + FirstPersonManipulator( int flags = DEFAULT_SETTINGS ); + FirstPersonManipulator( const FirstPersonManipulator& fpm, + const osg::CopyOp& copyOp = osg::CopyOp::SHALLOW_COPY ); - META_Object( osgGA, FirstPersonManipulator ); + META_Object( osgGA, FirstPersonManipulator ); - virtual void setByMatrix( const osg::Matrixd& matrix ); - virtual void setByInverseMatrix( const osg::Matrixd& matrix ); - virtual osg::Matrixd getMatrix() const; - virtual osg::Matrixd getInverseMatrix() const; + virtual void setByMatrix( const osg::Matrixd& matrix ); + virtual void setByInverseMatrix( const osg::Matrixd& matrix ); + virtual osg::Matrixd getMatrix() const; + virtual osg::Matrixd getInverseMatrix() const; - virtual void setTransformation( const osg::Vec3d& eye, const osg::Quat& rotation ); - virtual void setTransformation( const osg::Vec3d& center, const osg::Vec3d& eye, const osg::Vec3d& up ); - virtual void getTransformation( osg::Vec3d& eye, osg::Quat& rotation ) const; - virtual void getTransformation( osg::Vec3d& center, osg::Vec3d& eye, osg::Vec3d& up ) const; + virtual void setTransformation( const osg::Vec3d& eye, const osg::Quat& rotation ); + virtual void setTransformation( const osg::Vec3d& center, const osg::Vec3d& eye, const osg::Vec3d& up ); + virtual void getTransformation( osg::Vec3d& eye, osg::Quat& rotation ) const; + virtual void getTransformation( osg::Vec3d& center, osg::Vec3d& eye, osg::Vec3d& up ) const; - virtual void setVelocity( const double& velocity ); - inline double getVelocity() const; - virtual void setAcceleration( const double& acceleration, bool relativeToModelSize = false ); - double getAcceleration( bool *relativeToModelSize = NULL ) const; - virtual void setMaxVelocity( const double& maxVelocity, bool relativeToModelSize = false ); - double getMaxVelocity( bool *relativeToModelSize = NULL ) const; + virtual void setVelocity( const double& velocity ); + inline double getVelocity() const; + virtual void setAcceleration( const double& acceleration, bool relativeToModelSize = false ); + double getAcceleration( bool *relativeToModelSize = NULL ) const; + virtual void setMaxVelocity( const double& maxVelocity, bool relativeToModelSize = false ); + double getMaxVelocity( bool *relativeToModelSize = NULL ) const; - virtual void setWheelMovement( const double& wheelMovement, bool relativeToModelSize = false ); - double getWheelMovement( bool *relativeToModelSize = NULL ) const; + virtual void setWheelMovement( const double& wheelMovement, bool relativeToModelSize = false ); + double getWheelMovement( bool *relativeToModelSize = NULL ) const; - virtual void home( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us ); - virtual void home( double ); + virtual void home( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us ); + virtual void home( double ); - virtual void init( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us ); + virtual void init( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us ); -protected: + protected: - virtual bool handleMouseWheel( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us ); + virtual bool handleMouseWheel( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us ); - virtual bool performMovementLeftMouseButton( const double dt, const double dx, const double dy ); - virtual bool performMouseDeltaMovement( const float dx, const float dy ); - virtual void applyAnimationStep( const double currentProgress, const double prevProgress ); - virtual bool startAnimationByMousePointerIntersection( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us ); + virtual bool performMovementLeftMouseButton( const double dt, const double dx, const double dy ); + virtual bool performMouseDeltaMovement( const float dx, const float dy ); + virtual void applyAnimationStep( const double currentProgress, const double prevProgress ); + virtual bool startAnimationByMousePointerIntersection( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us ); - void moveForward( const double distance ); - void moveForward( const osg::Quat& rotation, const double distance ); - void moveRight( const double distance ); - void moveUp( const double distance ); + void moveForward( const double distance ); + void moveForward( const osg::Quat& rotation, const double distance ); + void moveRight( const double distance ); + void moveUp( const double distance ); - osg::Vec3d _eye; - osg::Quat _rotation; - double _velocity; + osg::Vec3d _eye; + osg::Quat _rotation; + double _velocity; - double _acceleration; - static int _accelerationFlagIndex; - double _maxVelocity; - static int _maxVelocityFlagIndex; - double _wheelMovement; - static int _wheelMovementFlagIndex; + double _acceleration; + static int _accelerationFlagIndex; + double _maxVelocity; + static int _maxVelocityFlagIndex; + double _wheelMovement; + static int _wheelMovementFlagIndex; - class FirstPersonAnimationData : public AnimationData { - public: - osg::Quat _startRot; - osg::Quat _targetRot; - void start( const osg::Quat& startRotation, const osg::Quat& targetRotation, const double startTime ); - }; - virtual void allocAnimationData() { _animationData = new FirstPersonAnimationData(); } + class FirstPersonAnimationData : public AnimationData { + public: + osg::Quat _startRot; + osg::Quat _targetRot; + void start( const osg::Quat& startRotation, const osg::Quat& targetRotation, const double startTime ); + }; + virtual void allocAnimationData() { _animationData = new FirstPersonAnimationData(); } }; diff --git a/include/osgGA/FlightManipulator b/include/osgGA/FlightManipulator index c50ac6473..2e2458bd9 100644 --- a/include/osgGA/FlightManipulator +++ b/include/osgGA/FlightManipulator @@ -27,44 +27,45 @@ namespace osgGA { */ class OSGGA_EXPORT FlightManipulator : public FirstPersonManipulator { - typedef FirstPersonManipulator inherited; + typedef FirstPersonManipulator inherited; -public: + public: - enum YawControlMode { - YAW_AUTOMATICALLY_WHEN_BANKED, - NO_AUTOMATIC_YAW - }; + enum YawControlMode + { + YAW_AUTOMATICALLY_WHEN_BANKED, + NO_AUTOMATIC_YAW + }; - FlightManipulator( int flags = UPDATE_MODEL_SIZE | COMPUTE_HOME_USING_BBOX ); - FlightManipulator( const FlightManipulator& fpm, - const osg::CopyOp& copyOp = osg::CopyOp::SHALLOW_COPY ); + FlightManipulator( int flags = UPDATE_MODEL_SIZE | COMPUTE_HOME_USING_BBOX ); + FlightManipulator( const FlightManipulator& fpm, + const osg::CopyOp& copyOp = osg::CopyOp::SHALLOW_COPY ); - META_Object( osgGA, FlightManipulator ); + META_Object( osgGA, FlightManipulator ); - virtual void setYawControlMode( YawControlMode ycm ); - inline YawControlMode getYawControlMode() const; + virtual void setYawControlMode( YawControlMode ycm ); + inline YawControlMode getYawControlMode() const; - virtual void home( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us ); - virtual void init( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us ); - virtual void getUsage( osg::ApplicationUsage& usage ) const; + virtual void home( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us ); + virtual void init( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us ); + virtual void getUsage( osg::ApplicationUsage& usage ) const; -protected: + protected: - virtual bool handleFrame( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us ); - virtual bool handleMouseMove( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us ); - virtual bool handleMouseDrag( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us ); - virtual bool handleMousePush( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us ); - virtual bool handleMouseRelease( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us ); - virtual bool handleKeyDown( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us ); - virtual bool flightHandleEvent( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us ); + virtual bool handleFrame( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us ); + virtual bool handleMouseMove( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us ); + virtual bool handleMouseDrag( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us ); + virtual bool handleMousePush( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us ); + virtual bool handleMouseRelease( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us ); + virtual bool handleKeyDown( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us ); + virtual bool flightHandleEvent( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us ); - virtual bool performMovement(); - virtual bool performMovementLeftMouseButton( const double dt, const double dx, const double dy ); - virtual bool performMovementMiddleMouseButton( const double dt, const double dx, const double dy ); - virtual bool performMovementRightMouseButton( const double dt, const double dx, const double dy ); + virtual bool performMovement(); + virtual bool performMovementLeftMouseButton( const double dt, const double dx, const double dy ); + virtual bool performMovementMiddleMouseButton( const double dt, const double dx, const double dy ); + virtual bool performMovementRightMouseButton( const double dt, const double dx, const double dy ); - YawControlMode _yawMode; + YawControlMode _yawMode; }; diff --git a/include/osgGA/KeySwitchMatrixManipulator b/include/osgGA/KeySwitchMatrixManipulator index a844912ad..cf43b6dd1 100644 --- a/include/osgGA/KeySwitchMatrixManipulator +++ b/include/osgGA/KeySwitchMatrixManipulator @@ -30,7 +30,7 @@ and the associated switch keys, can be configured. */ class OSGGA_EXPORT KeySwitchMatrixManipulator : public MatrixManipulator { -public: + public: typedef std::pair > NamedManipulator; typedef std::map KeyManipMap; @@ -124,7 +124,7 @@ public: /** Get the keyboard and mouse usage of this manipulator.*/ virtual void getUsage(osg::ApplicationUsage& usage) const; -private: + private: KeyManipMap _manips; diff --git a/include/osgGA/MatrixManipulator b/include/osgGA/MatrixManipulator index afd3b2047..d2808823d 100644 --- a/include/osgGA/MatrixManipulator +++ b/include/osgGA/MatrixManipulator @@ -36,11 +36,11 @@ amount of default functionality, for classes which wish to control OSG cameras in response to GUI events. */ -class OSGGA_EXPORT MatrixManipulator : public GUIEventHandler { +class OSGGA_EXPORT MatrixManipulator : public GUIEventHandler +{ + typedef GUIEventHandler inherited; - typedef GUIEventHandler inherited; - -public: + public: // We are not using META_Object as this is abstract class. // Use META_Object(osgGA,YourManipulator); in your descendant non-abstract classes. @@ -162,7 +162,7 @@ public: /** Handle events, return true if handled, false otherwise. */ virtual bool handle(const GUIEventAdapter& ea,GUIActionAdapter& us); -protected: + protected: MatrixManipulator(); MatrixManipulator(const MatrixManipulator& mm, const osg::CopyOp& copyOp = osg::CopyOp::SHALLOW_COPY); diff --git a/include/osgGA/OrbitManipulator b/include/osgGA/OrbitManipulator index 1df68488a..051477edd 100644 --- a/include/osgGA/OrbitManipulator +++ b/include/osgGA/OrbitManipulator @@ -25,79 +25,79 @@ namespace osgGA { This is the base class for trackball style manipulators.*/ class OSGGA_EXPORT OrbitManipulator : public StandardManipulator { - typedef StandardManipulator inherited; + typedef StandardManipulator inherited; -public: + public: - OrbitManipulator( int flags = DEFAULT_SETTINGS ); - OrbitManipulator( const OrbitManipulator& om, - const osg::CopyOp& copyOp = osg::CopyOp::SHALLOW_COPY ); + OrbitManipulator( int flags = DEFAULT_SETTINGS ); + OrbitManipulator( const OrbitManipulator& om, + const osg::CopyOp& copyOp = osg::CopyOp::SHALLOW_COPY ); - META_Object( osgGA, OrbitManipulator ); + META_Object( osgGA, OrbitManipulator ); - virtual void setByMatrix( const osg::Matrixd& matrix ); - virtual void setByInverseMatrix( const osg::Matrixd& matrix ); - virtual osg::Matrixd getMatrix() const; - virtual osg::Matrixd getInverseMatrix() const; + virtual void setByMatrix( const osg::Matrixd& matrix ); + virtual void setByInverseMatrix( const osg::Matrixd& matrix ); + virtual osg::Matrixd getMatrix() const; + virtual osg::Matrixd getInverseMatrix() const; - virtual void setTransformation( const osg::Vec3d& eye, const osg::Quat& rotation ); - virtual void setTransformation( const osg::Vec3d& center, const osg::Vec3d& eye, const osg::Vec3d& up ); - virtual void getTransformation( osg::Vec3d& eye, osg::Quat& rotation ) const; - virtual void getTransformation( osg::Vec3d& center, osg::Vec3d& eye, osg::Vec3d& up ) const; + virtual void setTransformation( const osg::Vec3d& eye, const osg::Quat& rotation ); + virtual void setTransformation( const osg::Vec3d& center, const osg::Vec3d& eye, const osg::Vec3d& up ); + virtual void getTransformation( osg::Vec3d& eye, osg::Quat& rotation ) const; + virtual void getTransformation( osg::Vec3d& center, osg::Vec3d& eye, osg::Vec3d& up ) const; - virtual void setCenter( const osg::Vec3d& center ); - const osg::Vec3d& getCenter() const; - virtual void setRotation( const osg::Quat& rotation ); - const osg::Quat& getRotation() const; - virtual void setDistance( double distance ); - double getDistance() const; + virtual void setCenter( const osg::Vec3d& center ); + const osg::Vec3d& getCenter() const; + virtual void setRotation( const osg::Quat& rotation ); + const osg::Quat& getRotation() const; + virtual void setDistance( double distance ); + double getDistance() const; - virtual void setTrackballSize( const double& size ); - inline double getTrackballSize() const; - virtual void setWheelZoomFactor( double wheelZoomFactor ); - inline double getWheelZoomFactor() const; + virtual void setTrackballSize( const double& size ); + inline double getTrackballSize() const; + virtual void setWheelZoomFactor( double wheelZoomFactor ); + inline double getWheelZoomFactor() const; - virtual void setMinimumDistance( const double& minimumDistance, bool relativeToModelSize = NULL ); - double getMinimumDistance( bool *relativeToModelSize = NULL ) const; + virtual void setMinimumDistance( const double& minimumDistance, bool relativeToModelSize = NULL ); + double getMinimumDistance( bool *relativeToModelSize = NULL ) const; - virtual osgUtil::SceneView::FusionDistanceMode getFusionDistanceMode() const; - virtual float getFusionDistanceValue() const; + virtual osgUtil::SceneView::FusionDistanceMode getFusionDistanceMode() const; + virtual float getFusionDistanceValue() const; -protected: + protected: - virtual bool handleMouseWheel( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us ); + virtual bool handleMouseWheel( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us ); - virtual bool performMovementLeftMouseButton( const double dt, const double dx, const double dy ); - virtual bool performMovementMiddleMouseButton( const double dt, const double dx, const double dy ); - virtual bool performMovementRightMouseButton( const double dt, const double dx, const double dy ); - virtual bool performMouseDeltaMovement( const float dx, const float dy ); - virtual void applyAnimationStep( const double currentProgress, const double prevProgress ); + virtual bool performMovementLeftMouseButton( const double dt, const double dx, const double dy ); + virtual bool performMovementMiddleMouseButton( const double dt, const double dx, const double dy ); + virtual bool performMovementRightMouseButton( const double dt, const double dx, const double dy ); + virtual bool performMouseDeltaMovement( const float dx, const float dy ); + virtual void applyAnimationStep( const double currentProgress, const double prevProgress ); - virtual void rotateTrackball( const float px0, const float py0, const float px1, const float py1 ); - virtual void rotateWithFixedVertical( const float dx, const float dy ); - virtual void rotateWithFixedVertical( const float dx, const float dy, const osg::Vec3f& up ); - virtual void panModel( const float dx, const float dy, const float dz = 0.f ); - virtual void zoomModel( const float dy, bool pushForwardIfNeeded = true ); - void trackball( osg::Vec3d& axis, float& angle, float p1x, float p1y, float p2x, float p2y ); - float tb_project_to_sphere( float r, float x, float y ); - virtual bool startAnimationByMousePointerIntersection( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us ); + virtual void rotateTrackball( const float px0, const float py0, const float px1, const float py1 ); + virtual void rotateWithFixedVertical( const float dx, const float dy ); + virtual void rotateWithFixedVertical( const float dx, const float dy, const osg::Vec3f& up ); + virtual void panModel( const float dx, const float dy, const float dz = 0.f ); + virtual void zoomModel( const float dy, bool pushForwardIfNeeded = true ); + void trackball( osg::Vec3d& axis, float& angle, float p1x, float p1y, float p2x, float p2y ); + float tb_project_to_sphere( float r, float x, float y ); + virtual bool startAnimationByMousePointerIntersection( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us ); - osg::Vec3d _center; - osg::Quat _rotation; - double _distance; + osg::Vec3d _center; + osg::Quat _rotation; + double _distance; - double _trackballSize; - double _wheelZoomFactor; + double _trackballSize; + double _wheelZoomFactor; - double _minimumDistance; - static int _minimumDistanceFlagIndex; + double _minimumDistance; + static int _minimumDistanceFlagIndex; - class OrbitAnimationData : public AnimationData { - public: - osg::Vec3d _movement; - void start( const osg::Vec3d& movement, const double startTime ); - }; - virtual void allocAnimationData() { _animationData = new OrbitAnimationData(); } + class OrbitAnimationData : public AnimationData { + public: + osg::Vec3d _movement; + void start( const osg::Vec3d& movement, const double startTime ); + }; + virtual void allocAnimationData() { _animationData = new OrbitAnimationData(); } }; diff --git a/include/osgGA/StandardManipulator b/include/osgGA/StandardManipulator index c67667af4..cb2d0b463 100644 --- a/include/osgGA/StandardManipulator +++ b/include/osgGA/StandardManipulator @@ -45,7 +45,7 @@ class OSGGA_EXPORT StandardManipulator : public MatrixManipulator StandardManipulator( int flags = DEFAULT_SETTINGS ); StandardManipulator( const StandardManipulator& m, - const osg::CopyOp& copyOp = osg::CopyOp::SHALLOW_COPY ); + const osg::CopyOp& copyOp = osg::CopyOp::SHALLOW_COPY ); // We are not using META_Object as this is abstract class. // Use META_Object(osgGA,YourManipulator); in your descendant non-abstract classes. @@ -165,7 +165,7 @@ class OSGGA_EXPORT StandardManipulator : public MatrixManipulator inline bool StandardManipulator::getRelativeFlag( int index ) const { - return ( _relativeFlags & (0x01 << index) ) != 0; + return ( _relativeFlags & (0x01 << index) ) != 0; } inline void StandardManipulator::setRelativeFlag( int index, bool value ) @@ -177,7 +177,7 @@ inline void StandardManipulator::setRelativeFlag( int index, bool value ) /// Returns whether manipulator preserves camera's "UP" vector. inline bool StandardManipulator::getVerticalAxisFixed() const { - return _verticalAxisFixed; + return _verticalAxisFixed; } diff --git a/include/osgGA/TrackballManipulator b/include/osgGA/TrackballManipulator index f27112e25..16321de69 100644 --- a/include/osgGA/TrackballManipulator +++ b/include/osgGA/TrackballManipulator @@ -22,15 +22,15 @@ namespace osgGA { class OSGGA_EXPORT TrackballManipulator : public OrbitManipulator { - typedef OrbitManipulator inherited; + typedef OrbitManipulator inherited; -public: + public: - TrackballManipulator( int flags = DEFAULT_SETTINGS ); - TrackballManipulator( const TrackballManipulator& tm, - const osg::CopyOp& copyOp = osg::CopyOp::SHALLOW_COPY ); + TrackballManipulator( int flags = DEFAULT_SETTINGS ); + TrackballManipulator( const TrackballManipulator& tm, + const osg::CopyOp& copyOp = osg::CopyOp::SHALLOW_COPY ); - META_Object( osgGA, TrackballManipulator ); + META_Object( osgGA, TrackballManipulator ); };