OctreeRepresentation.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_OCTREEREPRESENTATION_H
17 #define SURGSIM_GRAPHICS_OCTREEREPRESENTATION_H
18 
19 #include <string>
20 
24 
25 namespace SurgSim
26 {
27 namespace Graphics
28 {
29 
31 class OctreeRepresentation : public virtual Representation
32 {
33 public:
36  explicit OctreeRepresentation(const std::string& name) : Representation(name)
37  {
38  SURGSIM_ADD_SERIALIZABLE_PROPERTY(OctreeRepresentation, std::shared_ptr<SurgSim::Math::Shape>, OctreeShape,
40  }
41 
44  {
45  }
46 
49  virtual void setOctreeShape(const std::shared_ptr<SurgSim::Math::Shape>& shape) = 0;
50 
52  virtual std::shared_ptr<SurgSim::Math::OctreeShape> getOctreeShape() const = 0;
53 
57  virtual void setNodeVisible(const SurgSim::DataStructures::OctreePath& path, bool visibility) = 0;
58 };
59 
60 }; // Graphics
61 }; // SurgSim
62 
63 #endif // SURGSIM_GRAPHICS_OCTREEREPRESENTATION_H
SurgSim::Graphics::OctreeRepresentation
Graphic representation of an Octree.
Definition: OctreeRepresentation.h:31
SurgSim::Graphics::OctreeRepresentation::OctreeRepresentation
OctreeRepresentation(const std::string &name)
Constructor.
Definition: OctreeRepresentation.h:36
SurgSim::Graphics::OctreeRepresentation::~OctreeRepresentation
virtual ~OctreeRepresentation()
Destructor.
Definition: OctreeRepresentation.h:43
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::OctreeRepresentation::setOctreeShape
virtual void setOctreeShape(const std::shared_ptr< SurgSim::Math::Shape > &shape)=0
Set the OctreeShape of this representation.
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
SurgSim::DataStructures::OctreePath
std::vector< size_t > OctreePath
Typedef of octree path The path is a vector of children indexes (each within 0 to 7) that lead to the...
Definition: OctreeNode.h:43
MathConvert.h
SurgSim::Graphics::OctreeRepresentation::getOctreeShape
virtual std::shared_ptr< SurgSim::Math::OctreeShape > getOctreeShape() const =0
OctreeShape.h
SurgSim::Graphics::OctreeRepresentation::setNodeVisible
virtual void setNodeVisible(const SurgSim::DataStructures::OctreePath &path, bool visibility)=0
Mark the OctreeNode visible/invisible in the given a OctreePath (typedef-ed in OctreeNode....
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