OctreeRepresentation.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_OCTREEREPRESENTATION_H
#define SURGSIM_GRAPHICS_OCTREEREPRESENTATION_H
#include <string>
#include "SurgSim/Graphics/Representation.h"
#include "SurgSim/Math/MathConvert.h"
#include "SurgSim/Math/OctreeShape.h"
namespace SurgSim
{
namespace Graphics
{
class OctreeRepresentation : public virtual Representation
{
public:
explicit OctreeRepresentation(const std::string& name) : Representation(name)
{
SURGSIM_ADD_SERIALIZABLE_PROPERTY(OctreeRepresentation, std::shared_ptr<SurgSim::Math::Shape>, OctreeShape,
getOctreeShape, setOctreeShape);
}
virtual ~OctreeRepresentation()
{
}
virtual void setOctreeShape(const std::shared_ptr<SurgSim::Math::Shape>& shape) = 0;
virtual std::shared_ptr<SurgSim::Math::OctreeShape> getOctreeShape() const = 0;
virtual void setNodeVisible(const SurgSim::DataStructures::OctreePath& path, bool visibility) = 0;
};
}; // Graphics
}; // SurgSim
#endif // SURGSIM_GRAPHICS_OCTREEREPRESENTATION_H
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
SurgSim::Graphics::OctreeRepresentation::OctreeRepresentation
OctreeRepresentation(const std::string &name)
Constructor.
Definition: OctreeRepresentation.h:36
MathConvert.h
This contains a series of functions to encode and decode Eigen data structures to and from YAML nodes...
Representation.h
SurgSim::Graphics::OctreeRepresentation
Graphic representation of an Octree.
Definition: OctreeRepresentation.h:31
SurgSim::Graphics::OctreeRepresentation::setOctreeShape
virtual void setOctreeShape(const std::shared_ptr< SurgSim::Math::Shape > &shape)=0
Set the OctreeShape of this representation.
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::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.h).
SurgSim::Graphics::Representation
Base graphics representation class, which defines the interface that all graphics representations mus...
Definition: Representation.h:39
SurgSim::Graphics::OctreeRepresentation::getOctreeShape
virtual std::shared_ptr< SurgSim::Math::OctreeShape > getOctreeShape() const =0
OctreeShape.h
SurgSim::Graphics::OctreeRepresentation::~OctreeRepresentation
virtual ~OctreeRepresentation()
Destructor.
Definition: OctreeRepresentation.h:43