CylinderRepresentation.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_GRAPHICS_CYLINDERREPRESENTATION_H
#define SURGSIM_GRAPHICS_CYLINDERREPRESENTATION_H
#include "SurgSim/Graphics/Representation.h"
#include "SurgSim/Math/Vector.h"
namespace SurgSim
{
namespace Graphics
{
class CylinderRepresentation : public virtual Representation
{
public:
explicit CylinderRepresentation(const std::string& name) : Representation(name)
{
SURGSIM_ADD_SERIALIZABLE_PROPERTY(CylinderRepresentation, double, Radius, getRadius, setRadius);
SURGSIM_ADD_SERIALIZABLE_PROPERTY(CylinderRepresentation, double, Height, getHeight, setHeight);
}
virtual void setRadius(double radius) = 0;
virtual double getRadius() const = 0;
virtual void setHeight(double height) = 0;
virtual double getHeight() const = 0;
virtual void setSize(double radius, double height) = 0;
virtual void getSize(double* radius, double* height) = 0;
virtual void setSize(const SurgSim::Math::Vector2d& size) = 0;
virtual SurgSim::Math::Vector2d getSize() const = 0;
};
}; // namespace Graphics
}; // namespace SurgSim
#endif // SURGSIM_GRAPHICS_CYLINDERREPRESENTATION_H
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
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::CylinderRepresentation::setRadius
virtual void setRadius(double radius)=0
Sets the radius of the cylinder.
SurgSim::Graphics::CylinderRepresentation::setSize
virtual void setSize(double radius, double height)=0
Sets 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
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::getSize
virtual SurgSim::Math::Vector2d getSize() const =0
Returns the size of the cylinder.
SurgSim::Math::Vector2d
Eigen::Matrix< double, 2, 1 > Vector2d
A 2D vector of doubles.
Definition: Vector.h:53
Vector.h
Definitions of small fixed-size vector types.
SurgSim::Graphics::CylinderRepresentation::CylinderRepresentation
CylinderRepresentation(const std::string &name)
Constructor.
Definition: CylinderRepresentation.h:37
SurgSim::Graphics::CylinderRepresentation::setHeight
virtual void setHeight(double height)=0
Sets the height of the cylinder.
SurgSim::Graphics::CylinderRepresentation::getHeight
virtual double getHeight() const =0
Returns the height of the cylinder.
SurgSim::Graphics::CylinderRepresentation::getRadius
virtual double getRadius() const =0
Returns the radius of the cylinder.