camera_base.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008, Willow Garage, Inc.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  * * Redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution.
13  * * Neither the name of the Willow Garage, Inc. nor the names of its
14  * contributors may be used to endorse or promote products derived from
15  * this software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27  * POSSIBILITY OF SUCH DAMAGE.
28  */
29 
30 #ifndef OGRE_TOOLS_CAMERA_BASE_H_
31 #define OGRE_TOOLS_CAMERA_BASE_H_
32 
33 #include <OgreVector3.h>
34 #include <OgreQuaternion.h>
35 
36 namespace Ogre
37 {
38  class Camera;
39  class SceneNode;
40  class SceneManager;
41 }
42 
43 namespace rviz
44 {
45 
54 {
55 public:
60  CameraBase( Ogre::SceneManager* scene_manager );
61  virtual ~CameraBase();
62 
67  Ogre::Camera* getOgreCamera() { return camera_; }
68 
73  void setRelativeNode( Ogre::SceneNode* node );
77  virtual void relativeNodeChanged() {}
78 
79  virtual void update() = 0;
80 
84  virtual void setPosition( const Ogre::Vector3& position );
88  virtual void setOrientation( const Ogre::Quaternion& orientation );
89 
102  virtual void yaw( float angle ) = 0;
115  virtual void pitch( float angle ) = 0;
128  virtual void roll( float angle ) = 0;
129 
133  virtual void setOrientation( float x, float y, float z, float w ) = 0;
137  virtual void setPosition( float x, float y, float z ) = 0;
138 
144  virtual void setFrom( CameraBase* camera ) = 0;
145 
150  virtual Ogre::Vector3 getPosition() = 0;
155  virtual Ogre::Quaternion getOrientation() = 0;
156 
161  virtual void lookAt( const Ogre::Vector3& point ) = 0;
162 
170  virtual void move( float x, float y, float z ) = 0;
171 
172  virtual void mouseLeftDown( int x, int y ) {}
173  virtual void mouseMiddleDown( int x, int y ) {}
174  virtual void mouseRightDown( int x, int y ) {}
175  virtual void mouseLeftUp( int x, int y ) {}
176  virtual void mouseMiddleUp( int x, int y ) {}
177  virtual void mouseRightUp( int x, int y ) {}
178 
185  virtual void mouseLeftDrag( int diff_x, int diff_y, bool ctrl, bool alt, bool shift ) = 0;
192  virtual void mouseMiddleDrag( int diff_x, int diff_y, bool ctrl, bool alt, bool shift ) = 0;
199  virtual void mouseRightDrag( int diff_x, int diff_y, bool ctrl, bool alt, bool shift ) = 0;
206  virtual void scrollWheel( int diff, bool ctrl, bool alt, bool shift ) = 0;
207 
212  virtual void fromString(const std::string& str) = 0;
216  virtual std::string toString() = 0;
217 
218 protected:
219  Ogre::Camera* camera_;
220  Ogre::SceneManager* scene_manager_;
221 
222  Ogre::SceneNode* relative_node_;
223 };
224 
225 } // namespace rviz
226 
227 #endif /*OGRE_TOOLS_CAMERA_BASE_H_*/
virtual void mouseMiddleUp(int x, int y)
Definition: camera_base.h:176
virtual void mouseLeftDown(int x, int y)
Definition: camera_base.h:172
virtual void mouseMiddleDown(int x, int y)
Definition: camera_base.h:173
Generic interface for a camera.
Definition: camera_base.h:53
Ogre::Camera * getOgreCamera()
Get the Ogre camera associated with this camera object.
Definition: camera_base.h:67
TFSIMD_FORCE_INLINE const tfScalar & y() const
TFSIMD_FORCE_INLINE tfScalar angle(const Quaternion &q1, const Quaternion &q2)
void update(const std::string &key, const XmlRpc::XmlRpcValue &v)
Ogre::Camera * camera_
Ogre camera associated with this camera object.
Definition: camera_base.h:219
Ogre::SceneNode * relative_node_
Definition: camera_base.h:222
TFSIMD_FORCE_INLINE const tfScalar & x() const
TFSIMD_FORCE_INLINE const tfScalar & z() const
virtual void mouseRightDown(int x, int y)
Definition: camera_base.h:174
TFSIMD_FORCE_INLINE const tfScalar & w() const
virtual void relativeNodeChanged()
Called when the relative node changes.
Definition: camera_base.h:77
virtual void mouseRightUp(int x, int y)
Definition: camera_base.h:177
Ogre::SceneManager * scene_manager_
Scene manager this camera is part of.
Definition: camera_base.h:220
virtual void mouseLeftUp(int x, int y)
Definition: camera_base.h:175


rviz
Author(s): Dave Hershberger, David Gossow, Josh Faust
autogenerated on Wed Aug 28 2019 04:01:50