BoxRepresentation.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_BOXREPRESENTATION_H
17 #define SURGSIM_GRAPHICS_BOXREPRESENTATION_H
18 
21 #include "SurgSim/Math/Vector.h"
22 
23 namespace SurgSim
24 {
25 
26 namespace Graphics
27 {
28 
31 class BoxRepresentation : public virtual Representation
32 {
33 public:
37  explicit BoxRepresentation(const std::string& name) : Representation(name)
38  {
43  }
44 
47  virtual void setSizeX(double sizeX) = 0;
50  virtual double getSizeX() const = 0;
51 
54  virtual void setSizeY(double sizeY) = 0;
57  virtual double getSizeY() const = 0;
58 
61  virtual void setSizeZ(double sizeZ) = 0;
64  virtual double getSizeZ() const = 0;
65 
70  virtual void setSizeXYZ(double sizeX, double sizeY, double sizeZ) = 0;
75  virtual void getSizeXYZ(double* sizeX, double* sizeY, double* sizeZ) const = 0;
76 
79  virtual void setSize(const SurgSim::Math::Vector3d& size) = 0;
82  virtual SurgSim::Math::Vector3d getSize() const = 0;
83 };
84 
85 }; // namespace Graphics
86 
87 }; // namespace SurgSim
88 
89 #endif // SURGSIM_GRAPHICS_BOXREPRESENTATION_H
Definition: CompoundShapeToGraphics.cpp:29
virtual void setSizeXYZ(double sizeX, double sizeY, double sizeZ)=0
Sets the size of the box.
BoxRepresentation(const std::string &name)
Constructor.
Definition: BoxRepresentation.h:37
virtual double getSizeZ() const =0
Returns the size along Z-axis of the box.
This contains a series of functions to encode and decode Eigen data structures to and from YAML nodes...
virtual void setSizeX(double sizeX)=0
Sets the size along X-axis of the box.
virtual void getSizeXYZ(double *sizeX, double *sizeY, double *sizeZ) const =0
Gets the size of the box.
virtual void setSize(const SurgSim::Math::Vector3d &size)=0
Sets the size of the box.
#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
Base graphics box representation class, which defines the basic interface for a box that can be visua...
Definition: BoxRepresentation.h:31
Base graphics representation class, which defines the interface that all graphics representations mus...
Definition: Representation.h:39
virtual double getSizeX() const =0
Returns the size along X-axis of the box.
Definitions of small fixed-size vector types.
virtual void setSizeZ(double sizeZ)=0
Sets the size along Z-axis of the box.
virtual SurgSim::Math::Vector3d getSize() const =0
Returns the radius of the sphere.
virtual double getSizeY() const =0
Returns the size along Y-axis of the box.
Eigen::Matrix< double, 3, 1 > Vector3d
A 3D vector of doubles.
Definition: Vector.h:57
#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
virtual void setSizeY(double sizeY)=0
Sets the size along Y-axis of the box.