MassSpringLocalization.h
Go to the documentation of this file.
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_MASSSPRINGLOCALIZATION_H
17 #define SURGSIM_PHYSICS_MASSSPRINGLOCALIZATION_H
18 
21 
22 namespace SurgSim
23 {
24 
25 namespace Physics
26 {
27 
40 {
41 public:
44 
47  explicit MassSpringLocalization(std::shared_ptr<Representation> representation);
48 
50  virtual ~MassSpringLocalization();
51 
54  void setLocalNode(size_t nodeID);
55 
58  const size_t& getLocalNode() const;
59 
63  bool isValidRepresentation(std::shared_ptr<Representation> representation) override;
64 
65 private:
71  SurgSim::Math::Vector3d doCalculatePosition(double time) const override;
72 
73  SurgSim::Math::Vector3d doCalculateVelocity(double time) const override;
74 
76  size_t m_nodeID;
77 };
78 
79 }; // namespace Physics
80 
81 }; // namespace SurgSim
82 
83 #endif // SURGSIM_PHYSICS_MASSSPRINGLOCALIZATION_H
SurgSim::Physics::MassSpringLocalization::~MassSpringLocalization
virtual ~MassSpringLocalization()
Destructor.
Definition: MassSpringLocalization.cpp:36
SurgSim::Physics::MassSpringLocalization::isValidRepresentation
bool isValidRepresentation(std::shared_ptr< Representation > representation) override
Queries whether Representation can be assigned to this class.
Definition: MassSpringLocalization.cpp:97
SurgSim::Physics::MassSpringLocalization::getLocalNode
const size_t & getLocalNode() const
Gets the local node.
Definition: MassSpringLocalization.cpp:46
SurgSim::Physics::Localization
This class localize a point on a representation (representation specific)
Definition: Localization.h:40
SurgSim::Math::Vector3d
Eigen::Matrix< double, 3, 1 > Vector3d
A 3D vector of doubles.
Definition: Vector.h:57
SurgSim
Definition: CompoundShapeToGraphics.cpp:30
SurgSim::Physics::MassSpringLocalization::doCalculatePosition
SurgSim::Math::Vector3d doCalculatePosition(double time) const override
Calculates the global position of this localization.
Definition: MassSpringLocalization.cpp:51
SurgSim::Physics::MassSpringLocalization::MassSpringLocalization
MassSpringLocalization()
Default constructor.
Definition: MassSpringLocalization.cpp:24
SurgSim::Physics::MassSpringLocalization::doCalculateVelocity
SurgSim::Math::Vector3d doCalculateVelocity(double time) const override
Calculates the global velocity of this localization.
Definition: MassSpringLocalization.cpp:74
Localization.h
SurgSim::Physics::MassSpringLocalization::setLocalNode
void setLocalNode(size_t nodeID)
Sets the local node.
Definition: MassSpringLocalization.cpp:41
MassSpringRepresentation.h
SurgSim::Physics::MassSpringLocalization::m_nodeID
size_t m_nodeID
Node defining the localization.
Definition: MassSpringLocalization.h:76
SurgSim::Physics::MassSpringLocalization
Implementation of Localization for MassSpringRepresentation.
Definition: MassSpringLocalization.h:40