SegmentMeshShapePlyReaderDelegate.h
Go to the documentation of this file.
// This file is a part of the OpenSurgSim project.
// Copyright 2013-2016, 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_MATH_SEGMENTMESHSHAPEPLYREADERDELEGATE_H
#define SURGSIM_MATH_SEGMENTMESHSHAPEPLYREADERDELEGATE_H
#include "SurgSim/DataStructures/TriangleMeshPlyReaderDelegate.h"
#include "SurgSim/Math/SegmentMeshShape.h"
namespace SurgSim
{
namespace Math
{
class SegmentMeshShapePlyReaderDelegate : public DataStructures::TriangleMeshPlyReaderDelegate<SegmentMeshShape>
{
public:
SegmentMeshShapePlyReaderDelegate();
explicit SegmentMeshShapePlyReaderDelegate(const std::shared_ptr<Math::SegmentMeshShape>& shape);
~SegmentMeshShapePlyReaderDelegate();
void* beginRadius(const std::string& element, size_t value);
void processRadius(const std::string& element);
bool registerDelegate(DataStructures::PlyReader* reader) override;
bool fileIsAcceptable(const DataStructures::PlyReader& reader) override;
private:
bool m_hasRadius;
double m_radius;
std::shared_ptr<Math::SegmentMeshShape> m_shape;
};
}
}
#endif
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
SurgSim::Math::SegmentMeshShapePlyReaderDelegate::beginRadius
void * beginRadius(const std::string &element, size_t value)
Delegate function to begin radius processing.
Definition: SegmentMeshShapePlyReaderDelegate.cpp:45
SurgSim::Math::SegmentMeshShapePlyReaderDelegate::m_radius
double m_radius
Definition: SegmentMeshShapePlyReaderDelegate.h:57
SurgSim::DataStructures::PlyReader
Wrapper for the C .ply file parser This class wraps the main functionality for the original C ...
Definition: PlyReader.h:85
SurgSim::DataStructures::TriangleMeshPlyReaderDelegate
Implementation of PlyReaderDelegate for simple triangle meshes.
Definition: TriangleMeshPlyReaderDelegate.h:33
SurgSim::Math::SegmentMeshShapePlyReaderDelegate
Implementation of ply reader for segment meshes, enable to read the radius from the ply file...
Definition: SegmentMeshShapePlyReaderDelegate.h:30
SurgSim::Math::SegmentMeshShapePlyReaderDelegate::registerDelegate
bool registerDelegate(DataStructures::PlyReader *reader) override
Registers the delegate with the reader.
Definition: SegmentMeshShapePlyReaderDelegate.cpp:56
SurgSim::Math::SegmentMeshShapePlyReaderDelegate::processRadius
void processRadius(const std::string &element)
Callback function to process the radius.
Definition: SegmentMeshShapePlyReaderDelegate.cpp:51
SurgSim::Math::SegmentMeshShapePlyReaderDelegate::m_shape
std::shared_ptr< Math::SegmentMeshShape > m_shape
Definition: SegmentMeshShapePlyReaderDelegate.h:59
SurgSim::Math::SegmentMeshShapePlyReaderDelegate::m_hasRadius
bool m_hasRadius
Definition: SegmentMeshShapePlyReaderDelegate.h:56
SurgSim::Math::SegmentMeshShapePlyReaderDelegate::SegmentMeshShapePlyReaderDelegate
SegmentMeshShapePlyReaderDelegate()
Constructor.
Definition: SegmentMeshShapePlyReaderDelegate.cpp:24
TriangleMeshPlyReaderDelegate.h
SurgSim::Math::SegmentMeshShapePlyReaderDelegate::~SegmentMeshShapePlyReaderDelegate
~SegmentMeshShapePlyReaderDelegate()
Destructor.
Definition: SegmentMeshShapePlyReaderDelegate.cpp:40
SurgSim::Math::SegmentMeshShapePlyReaderDelegate::fileIsAcceptable
bool fileIsAcceptable(const DataStructures::PlyReader &reader) override
Check whether the file in the reader can be used with this delegate, this gives the delegate a chance...
Definition: SegmentMeshShapePlyReaderDelegate.cpp:74
SegmentMeshShape.h