CylinderRepresentation.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_CYLINDERREPRESENTATION_H
17 #define SURGSIM_GRAPHICS_CYLINDERREPRESENTATION_H
18 
20 #include "SurgSim/Math/Vector.h"
21 
22 namespace SurgSim
23 {
24 
25 namespace Graphics
26 {
27 
31 class CylinderRepresentation : public virtual Representation
32 {
33 public:
37  explicit CylinderRepresentation(const std::string& name) : Representation(name)
38  {
41  }
42 
45  virtual void setRadius(double radius) = 0;
48  virtual double getRadius() const = 0;
49 
52  virtual void setHeight(double height) = 0;
55  virtual double getHeight() const = 0;
56 
60  virtual void setSize(double radius, double height) = 0;
64  virtual void getSize(double* radius, double* height) = 0;
65 
68  virtual void setSize(const SurgSim::Math::Vector2d& size) = 0;
71  virtual SurgSim::Math::Vector2d getSize() const = 0;
72 };
73 
74 }; // namespace Graphics
75 
76 }; // namespace SurgSim
77 
78 #endif // SURGSIM_GRAPHICS_CYLINDERREPRESENTATION_H
Vector.h
SurgSim::Graphics::CylinderRepresentation::setRadius
virtual void setRadius(double radius)=0
Sets the radius of the cylinder.
SurgSim::Graphics::CylinderRepresentation::getRadius
virtual double getRadius() const =0
Returns the radius of the cylinder.
SurgSim::Graphics::CylinderRepresentation::CylinderRepresentation
CylinderRepresentation(const std::string &name)
Constructor.
Definition: CylinderRepresentation.h:37
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
Definition: CompoundShapeToGraphics.cpp:29
SurgSim::Graphics::CylinderRepresentation::getHeight
virtual double getHeight() const =0
Returns the height of the cylinder.
SurgSim::Math::Vector2d
Eigen::Matrix< double, 2, 1 > Vector2d
A 2D vector of doubles.
Definition: Vector.h:53
SurgSim::Graphics::CylinderRepresentation
Base graphics cylinder representation class, which defines the basic interface for a cylinder that ca...
Definition: CylinderRepresentation.h:31
SurgSim::Graphics::CylinderRepresentation::setSize
virtual void setSize(double radius, double height)=0
Sets the size of the cylinder.
SurgSim::Graphics::CylinderRepresentation::getSize
virtual SurgSim::Math::Vector2d getSize() const =0
Returns the size of the cylinder.
SurgSim::Graphics::Representation
Base graphics representation class, which defines the interface that all graphics representations mus...
Definition: Representation.h:39
string
string(TOUPPER ${DEVICE} DEVICE_UPPER_CASE) option(BUILD_DEVICE_$
Definition: CMakeLists.txt:38
SurgSim::Graphics::CylinderRepresentation::setHeight
virtual void setHeight(double height)=0
Sets the height of the cylinder.