opensurgsim
RigidState.h
1 // This file is a part of the OpenSurgSim project.
2 // Copyright 2013, SimQuest Solutions Inc.
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 
16 #ifndef SURGSIM_PHYSICS_RIGIDSTATE_H
17 #define SURGSIM_PHYSICS_RIGIDSTATE_H
18 
19 #include "SurgSim/Framework/Accessible.h"
20 #include "SurgSim/Framework/Macros.h"
22 #include "SurgSim/Math/Vector.h"
23 
24 namespace SurgSim
25 {
26 
27 namespace Physics
28 {
29 
32 {
33 public:
35  RigidState();
36 
38  RigidState(const RigidState& rhs);
39 
43  RigidState& operator=(const RigidState& rhs);
44 
46  virtual ~RigidState();
47 
48  SURGSIM_CLASSNAME(SurgSim::Physics::RigidState);
49 
53  bool operator==(const RigidState& rhs) const;
54 
58  bool operator!=(const RigidState& rhs) const;
59 
65  void reset();
66 
70 
74 
78 
82 
85  void setPose(const SurgSim::Math::RigidTransform3d& pose);
86 
90 
91 private:
93  void addSerializableProperty();
94 
97 
100 
103 };
104 
105 }; // Physics
106 }; // SurgSim
107 
108 #endif // SURGSIM_PHYSICS_RIGIDSTATE_H
Wraps glewInit() to separate the glew opengl definitions from the osg opengl definitions only imgui n...
Definition: AddRandomSphereBehavior.cpp:36
void reset()
Reset the state to default values Vectors will be filled with 0 Rotations will be set to identity (qu...
Definition: RigidState.cpp:76
virtual ~RigidState()
Destructor.
Definition: RigidState.cpp:62
Eigen::Transform< double, 3, Eigen::Isometry > RigidTransform3d
A 3D rigid (isometric) transform, represented as doubles.
Definition: RigidTransform.h:46
const SurgSim::Math::Vector3d & getAngularVelocity() const
Get the angular velocity.
Definition: RigidState.cpp:88
RigidState()
Default constructor.
Definition: RigidState.cpp:25
bool operator==(const RigidState &rhs) const
Comparison operator.
Definition: RigidState.cpp:66
Eigen::Matrix< double, 3, 1 > Vector3d
A 3D vector of doubles.
Definition: Vector.h:57
void setAngularVelocity(const SurgSim::Math::Vector3d &w)
Set the angular velocity.
Definition: RigidState.cpp:98
const SurgSim::Math::RigidTransform3d & getPose() const
Get the rigid representation pose.
Definition: RigidState.cpp:108
The RigidState class describes a state (position and velocity information).
Definition: RigidState.h:31
Definitions of 2x2 and 3x3 rigid (isometric) transforms.
const SurgSim::Math::Vector3d & getLinearVelocity() const
Get the linear velocity.
Definition: RigidState.cpp:83
Definitions of small fixed-size vector types.
void setPose(const SurgSim::Math::RigidTransform3d &pose)
Set the rigid representation pose.
Definition: RigidState.cpp:103
Mixin class for enabling a property system on OSS classes, the instance still needs to initialize pro...
Definition: Accessible.h:37
bool operator!=(const RigidState &rhs) const
Comparison operator.
Definition: RigidState.cpp:71
void setLinearVelocity(const SurgSim::Math::Vector3d &v)
Set the linear velocity.
Definition: RigidState.cpp:93
RigidState & operator=(const RigidState &rhs)
Copy assignment.
Definition: RigidState.cpp:52