Localization.h
Go to the documentation of this file.
// This file is a part of the OpenSurgSim project.
// Copyright 2013, SimQuest Solutions Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef SURGSIM_PHYSICS_LOCALIZATION_H
#define SURGSIM_PHYSICS_LOCALIZATION_H
#include <memory>
#include "SurgSim/Math/Vector.h"
#include "SurgSim/Math/RigidTransform.h"
#include "SurgSim/Framework/Assert.h"
namespace SurgSim
{
namespace DataStructures
{
struct Location;
}
namespace Physics
{
class Representation;
class Localization
{
public:
Localization();
explicit Localization(std::shared_ptr<Representation> representation);
virtual ~Localization();
void setRepresentation(std::shared_ptr<Representation> representation);
std::shared_ptr<Representation> getRepresentation() const;
SurgSim::Math::Vector3d calculatePosition(double time = 1.0) const;
SurgSim::Math::Vector3d calculateVelocity(double time = 1.0) const;
virtual bool isValidRepresentation(std::shared_ptr<Representation> representation);
virtual Math::RigidTransform3d getElementPose();
virtual bool moveClosestTo(const Math::Vector3d& point, bool *hasReachedEnd);
private:
virtual SurgSim::Math::Vector3d doCalculatePosition(double time) const = 0;
virtual SurgSim::Math::Vector3d doCalculateVelocity(double time) const = 0;
std::shared_ptr<Representation> m_representation;
};
} // namespace Physics
} // namespace SurgSim
#endif // SURGSIM_PHYSICS_LOCALIZATION_H
SurgSim::Physics::Localization::m_representation
std::shared_ptr< Representation > m_representation
The representation on which the localization is defined.
Definition: Localization.h:101
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
RigidTransform.h
Definitions of 2x2 and 3x3 rigid (isometric) transforms.
SurgSim::Math::RigidTransform3d
Eigen::Transform< double, 3, Eigen::Isometry > RigidTransform3d
A 3D rigid (isometric) transform, represented as doubles.
Definition: RigidTransform.h:46
Assert.h
The header that provides the assertion API.
Vector.h
Definitions of small fixed-size vector types.
SurgSim::Physics::Localization
This class localize a point on a representation (representation specific)
Definition: Localization.h:39
SurgSim::Math::Vector3d
Eigen::Matrix< double, 3, 1 > Vector3d
A 3D vector of doubles.
Definition: Vector.h:57