CapsuleRepresentation.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_GRAPHICS_CAPSULEREPRESENTATION_H
17 #define SURGSIM_GRAPHICS_CAPSULEREPRESENTATION_H
18 
20 #include "SurgSim/Math/Vector.h"
21 
22 namespace SurgSim
23 {
24 
25 namespace Graphics
26 {
27 
30 class CapsuleRepresentation : public virtual Representation
31 {
32 public:
36  explicit CapsuleRepresentation(const std::string& name) : Representation(name)
37  {
40  }
41 
44  virtual void setRadius(double radius) = 0;
47  virtual double getRadius() const = 0;
48 
51  virtual void setHeight(double height) = 0;
54  virtual double getHeight() const = 0;
55 
59  virtual void setSize(double radius, double height) = 0;
63  virtual void getSize(double* radius, double* height) = 0;
64 
67  virtual void setSize(const SurgSim::Math::Vector2d& size) = 0;
70  virtual SurgSim::Math::Vector2d getSize() const = 0;
71 };
72 
73 }; // namespace Graphics
74 
75 }; // namespace SurgSim
76 
77 #endif // SURGSIM_GRAPHICS_CAPSULEREPRESENTATION_H
SurgSim::Graphics::CapsuleRepresentation::setSize
virtual void setSize(double radius, double height)=0
Sets the size of the capsule.
Vector.h
SurgSim::Graphics::CapsuleRepresentation::setRadius
virtual void setRadius(double radius)=0
Sets the radius of the capsule.
SurgSim::Graphics::CapsuleRepresentation::getHeight
virtual double getHeight() const =0
Returns the height of the capsule.
Representation.h
SURGSIM_ADD_SERIALIZABLE_PROPERTY
#define SURGSIM_ADD_SERIALIZABLE_PROPERTY(class, type, property, getter, setter)
A macro to register a serializable property, this needs to support reading, writing and all the conve...
Definition: Accessible.h:225
SurgSim::Graphics::CapsuleRepresentation
Base graphics capsule representation class, which defines the basic interface for a capsule that can ...
Definition: CapsuleRepresentation.h:30
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
SurgSim::Graphics::CapsuleRepresentation::getRadius
virtual double getRadius() const =0
Returns the radius of the capsule.
SurgSim::Graphics::CapsuleRepresentation::getSize
virtual SurgSim::Math::Vector2d getSize() const =0
Returns the radius of the capsule.
SurgSim::Math::Vector2d
Eigen::Matrix< double, 2, 1 > Vector2d
A 2D vector of doubles.
Definition: Vector.h:53
SurgSim::Graphics::CapsuleRepresentation::setHeight
virtual void setHeight(double height)=0
Sets the height of the capsulei.
SurgSim::Graphics::CapsuleRepresentation::CapsuleRepresentation
CapsuleRepresentation(const std::string &name)
Constructor.
Definition: CapsuleRepresentation.h:36
SurgSim::Graphics::Representation
Base graphics representation class, which defines the interface that all graphics representations mus...
Definition: Representation.h:39