ShapeCollisionRepresentation.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_COLLISION_SHAPECOLLISIONREPRESENTATION_H
17 #define SURGSIM_COLLISION_SHAPECOLLISIONREPRESENTATION_H
18 
22 
23 namespace SurgSim
24 {
25 namespace Math
26 {
27 class Shape;
28 }
29 
30 namespace Collision
31 {
32 SURGSIM_STATIC_REGISTRATION(ShapeCollisionRepresentation);
33 
37 {
38 public:
40  explicit ShapeCollisionRepresentation(const std::string& name);
41 
44 
46 
47  int getShapeType() const override;
48 
49  void setLocalPose(const SurgSim::Math::RigidTransform3d& pose) override;
50 
51  // Set the shape to be used in this representation
52  // \param shape Shape to be used in this representation.
53  void setShape(const std::shared_ptr<SurgSim::Math::Shape>& shape);
54 
55  const std::shared_ptr<SurgSim::Math::Shape> getShape() const override;
56 
57 protected:
58  bool doInitialize() override;
59 
60 private:
61  // Shape used by this representation
62  std::shared_ptr<SurgSim::Math::Shape> m_shape;
63 };
64 
65 }; // namespace Collision
66 }; // namespace SurgSim
67 
68 #endif // SURGSIM_COLLISION_SHAPECOLLISIONREPRESENTATION_H
Definition: CompoundShapeToGraphics.cpp:29
#define SURGSIM_CLASSNAME(ClassName)
Declare the class name of a class with the appropriate function header, do not use quotes...
Definition: Macros.h:21
std::shared_ptr< SurgSim::Math::Shape > m_shape
Definition: ShapeCollisionRepresentation.h:62
Eigen::Transform< double, 3, Eigen::Isometry > RigidTransform3d
A 3D rigid (isometric) transform, represented as doubles.
Definition: RigidTransform.h:46
The type of collision detection.
Definition: Representation.h:60
Use a Shape as a Collision Representation, any SurgSim::Physics::Representation can be used as a back...
Definition: ShapeCollisionRepresentation.h:36