BoxRepresentation.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_BOXREPRESENTATION_H
#define SURGSIM_GRAPHICS_BOXREPRESENTATION_H
#include "SurgSim/Graphics/Representation.h"
#include "SurgSim/Math/MathConvert.h"
#include "SurgSim/Math/Vector.h"
namespace SurgSim
{
namespace Graphics
{
class BoxRepresentation : public virtual Representation
{
public:
explicit BoxRepresentation(const std::string& name) : Representation(name)
{
SURGSIM_ADD_SERIALIZABLE_PROPERTY(BoxRepresentation, SurgSim::Math::Vector3d, Size, getSize, setSize);
SURGSIM_ADD_RW_PROPERTY(BoxRepresentation, double, SizeX, getSizeX, setSizeX);
SURGSIM_ADD_RW_PROPERTY(BoxRepresentation, double, SizeY, getSizeY, setSizeY);
SURGSIM_ADD_RW_PROPERTY(BoxRepresentation, double, SizeZ, getSizeZ, setSizeZ);
}
virtual void setSizeX(double sizeX) = 0;
virtual double getSizeX() const = 0;
virtual void setSizeY(double sizeY) = 0;
virtual double getSizeY() const = 0;
virtual void setSizeZ(double sizeZ) = 0;
virtual double getSizeZ() const = 0;
virtual void setSizeXYZ(double sizeX, double sizeY, double sizeZ) = 0;
virtual void getSizeXYZ(double* sizeX, double* sizeY, double* sizeZ) const = 0;
virtual void setSize(const SurgSim::Math::Vector3d& size) = 0;
virtual SurgSim::Math::Vector3d getSize() const = 0;
};
}; // namespace Graphics
}; // namespace SurgSim
#endif // SURGSIM_GRAPHICS_BOXREPRESENTATION_H
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
SurgSim::Graphics::BoxRepresentation::setSizeXYZ
virtual void setSizeXYZ(double sizeX, double sizeY, double sizeZ)=0
Sets the size of the box.
SurgSim::Graphics::BoxRepresentation::BoxRepresentation
BoxRepresentation(const std::string &name)
Constructor.
Definition: BoxRepresentation.h:37
SurgSim::Graphics::BoxRepresentation::getSizeZ
virtual double getSizeZ() const =0
Returns the size along Z-axis of the box.
MathConvert.h
This contains a series of functions to encode and decode Eigen data structures to and from YAML nodes...
Representation.h
SurgSim::Graphics::BoxRepresentation::setSizeX
virtual void setSizeX(double sizeX)=0
Sets the size along X-axis of the box.
SurgSim::Graphics::BoxRepresentation::getSizeXYZ
virtual void getSizeXYZ(double *sizeX, double *sizeY, double *sizeZ) const =0
Gets the size of the box.
SurgSim::Graphics::BoxRepresentation::setSize
virtual void setSize(const SurgSim::Math::Vector3d &size)=0
Sets the size of the box.
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::BoxRepresentation
Base graphics box representation class, which defines the basic interface for a box that can be visua...
Definition: BoxRepresentation.h:31
SurgSim::Graphics::Representation
Base graphics representation class, which defines the interface that all graphics representations mus...
Definition: Representation.h:39
SurgSim::Graphics::BoxRepresentation::getSizeX
virtual double getSizeX() const =0
Returns the size along X-axis of the box.
Vector.h
Definitions of small fixed-size vector types.
SurgSim::Graphics::BoxRepresentation::setSizeZ
virtual void setSizeZ(double sizeZ)=0
Sets the size along Z-axis of the box.
SurgSim::Graphics::BoxRepresentation::getSize
virtual SurgSim::Math::Vector3d getSize() const =0
Returns the radius of the sphere.
SurgSim::Graphics::BoxRepresentation::getSizeY
virtual double getSizeY() const =0
Returns the size along Y-axis of the box.
SurgSim::Math::Vector3d
Eigen::Matrix< double, 3, 1 > Vector3d
A 3D vector of doubles.
Definition: Vector.h:57
SURGSIM_ADD_RW_PROPERTY
#define SURGSIM_ADD_RW_PROPERTY(class, type, property, getter, setter)
A macro to register getter and setter for a property that is readable and writeable, order of getter and setter agrees with &#39;RW&#39;.
Definition: Accessible.h:213
SurgSim::Graphics::BoxRepresentation::setSizeY
virtual void setSizeY(double sizeY)=0
Sets the size along Y-axis of the box.