Fem1DPlyReaderDelegate.h
Go to the documentation of this file.
// This file is a part of the OpenSurgSim project.
// Copyright 2015, 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_PHYSICS_FEM1DPLYREADERDELEGATE_H
#define SURGSIM_PHYSICS_FEM1DPLYREADERDELEGATE_H
#include <array>
#include <memory>
#include "SurgSim/DataStructures/EmptyData.h"
#include "SurgSim/DataStructures/PlyReader.h"
#include "SurgSim/Physics/Fem1D.h"
#include "SurgSim/Physics/FemPlyReaderDelegate.h"
namespace SurgSim
{
namespace Physics
{
class Fem1DPlyReaderDelegate : public FemPlyReaderDelegate
{
public:
Fem1DPlyReaderDelegate();
explicit Fem1DPlyReaderDelegate(std::shared_ptr<Fem1D> mesh);
protected:
std::string getElementName() const override;
bool registerDelegate(PlyReader* reader) override;
bool fileIsAcceptable(const PlyReader& reader) override;
void endParseFile() override;
void processVertex(const std::string& elementName) override;
void processFemElement(const std::string& elementName) override;
void* beginRadius(const std::string& elementName, size_t radiusCount);
void endRadius(const std::string& elementName);
void processBoundaryCondition(const std::string& elementName) override;
private:
double m_radius;
bool m_enableShear;
std::shared_ptr<Fem1D> m_mesh;
};
} // namespace Physics
} // namespace SurgSim
#endif // SURGSIM_PHYSICS_FEM1DPLYREADERDELEGATE_H
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
SurgSim::Physics::Fem1DPlyReaderDelegate::registerDelegate
bool registerDelegate(PlyReader *reader) override
Registers the delegate with the reader.
Definition: Fem1DPlyReaderDelegate.cpp:43
SurgSim::Physics::Fem1DPlyReaderDelegate::m_enableShear
bool m_enableShear
Element&#39;s shear information.
Definition: Fem1DPlyReaderDelegate.h:71
FemPlyReaderDelegate.h
SurgSim::Physics::Fem1DPlyReaderDelegate::processFemElement
void processFemElement(const std::string &elementName) override
Callback function to process one FemElement.
Definition: Fem1DPlyReaderDelegate.cpp:98
SurgSim::Physics::FemPlyReaderDelegate
Common part of implementation of PlyReaderDelegate for FemRepresentations.
Definition: FemPlyReaderDelegate.h:33
SurgSim::Physics::Fem1DPlyReaderDelegate::fileIsAcceptable
bool fileIsAcceptable(const PlyReader &reader) override
Check whether the file in the reader can be used with this delegate, this gives the delegate a chance...
Definition: Fem1DPlyReaderDelegate.cpp:58
SurgSim::Physics::Fem1DPlyReaderDelegate::endParseFile
void endParseFile() override
Callback for end of PlyReader::parseFile.
Definition: Fem1DPlyReaderDelegate.cpp:66
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::Physics::Fem1DPlyReaderDelegate::Fem1DPlyReaderDelegate
Fem1DPlyReaderDelegate()
Default constructor.
Definition: Fem1DPlyReaderDelegate.cpp:26
Fem1D.h
SurgSim::Physics::Fem1DPlyReaderDelegate
Definition: Fem1DPlyReaderDelegate.h:32
SurgSim::Physics::Fem1DPlyReaderDelegate::processBoundaryCondition
void processBoundaryCondition(const std::string &elementName) override
Callback function to process one boundary condition.
Definition: Fem1DPlyReaderDelegate.cpp:127
SurgSim::Physics::Fem1DPlyReaderDelegate::endRadius
void endRadius(const std::string &elementName)
Callback function, end the processing of radius.
Definition: Fem1DPlyReaderDelegate.cpp:122
SurgSim::Physics::Fem1DPlyReaderDelegate::m_radius
double m_radius
Element&#39;s radius information.
Definition: Fem1DPlyReaderDelegate.h:69
SurgSim::Physics::Fem1DPlyReaderDelegate::m_mesh
std::shared_ptr< Fem1D > m_mesh
Fem1D mesh asset to contain the ply file information.
Definition: Fem1DPlyReaderDelegate.h:74
PlyReader.h
SurgSim::Physics::Fem1DPlyReaderDelegate::getElementName
std::string getElementName() const override
Definition: Fem1DPlyReaderDelegate.cpp:38
SurgSim::Physics::Fem1DPlyReaderDelegate::beginRadius
void * beginRadius(const std::string &elementName, size_t radiusCount)
Callback function, begin the processing of radius.
Definition: Fem1DPlyReaderDelegate.cpp:117
SurgSim::Physics::Fem1DPlyReaderDelegate::processVertex
void processVertex(const std::string &elementName) override
Callback function to process one vertex.
Definition: Fem1DPlyReaderDelegate.cpp:82
EmptyData.h