Fem1DPlyReaderDelegate.h
Go to the documentation of this file.
1 // This file is a part of the OpenSurgSim project.
2 // Copyright 2015, 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_PHYSICS_FEM1DPLYREADERDELEGATE_H
17 #define SURGSIM_PHYSICS_FEM1DPLYREADERDELEGATE_H
18 
19 #include <array>
20 #include <memory>
21 
24 #include "SurgSim/Physics/Fem1D.h"
26 
27 namespace SurgSim
28 {
29 namespace Physics
30 {
31 
33 {
34 public:
37 
40  explicit Fem1DPlyReaderDelegate(std::shared_ptr<Fem1D> mesh);
41 
42 protected:
43  std::string getElementName() const override;
44 
45  bool registerDelegate(PlyReader* reader) override;
46 
47  bool fileIsAcceptable(const PlyReader& reader) override;
48 
49  void endParseFile() override;
50 
51  void processVertex(const std::string& elementName) override;
52 
53  void processFemElement(const std::string& elementName) override;
54 
59  void* beginRadius(const std::string& elementName, size_t radiusCount);
60 
63  void endRadius(const std::string& elementName);
64 
65  void processBoundaryCondition(const std::string& elementName) override;
66 
67 private:
69  double m_radius;
72 
74  std::shared_ptr<Fem1D> m_mesh;
75 };
76 
77 
78 } // namespace Physics
79 } // namespace SurgSim
80 
81 #endif // SURGSIM_PHYSICS_FEM1DPLYREADERDELEGATE_H
SurgSim::Physics::Fem1DPlyReaderDelegate
Definition: Fem1DPlyReaderDelegate.h:32
SurgSim::Physics::Fem1DPlyReaderDelegate::m_mesh
std::shared_ptr< Fem1D > m_mesh
Fem1D mesh asset to contain the ply file information.
Definition: Fem1DPlyReaderDelegate.h:74
SurgSim::Physics::Fem1DPlyReaderDelegate::endParseFile
void endParseFile() override
Callback for end of PlyReader::parseFile.
Definition: Fem1DPlyReaderDelegate.cpp:66
SurgSim::Physics::Fem1DPlyReaderDelegate::processFemElement
void processFemElement(const std::string &elementName) override
Callback function to process one FemElement.
Definition: Fem1DPlyReaderDelegate.cpp:98
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
PlyReader.h
EmptyData.h
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
Fem1D.h
SurgSim::Physics::Fem1DPlyReaderDelegate::m_radius
double m_radius
Element's radius information.
Definition: Fem1DPlyReaderDelegate.h:69
SurgSim::Physics::Fem1DPlyReaderDelegate::Fem1DPlyReaderDelegate
Fem1DPlyReaderDelegate()
Default constructor.
Definition: Fem1DPlyReaderDelegate.cpp:26
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::processBoundaryCondition
void processBoundaryCondition(const std::string &elementName) override
Callback function to process one boundary condition.
Definition: Fem1DPlyReaderDelegate.cpp:127
SurgSim::Physics::Fem1DPlyReaderDelegate::m_enableShear
bool m_enableShear
Element's shear information.
Definition: Fem1DPlyReaderDelegate.h:71
SurgSim::Physics::Fem1DPlyReaderDelegate::registerDelegate
bool registerDelegate(PlyReader *reader) override
Registers the delegate with the reader.
Definition: Fem1DPlyReaderDelegate.cpp:43
SurgSim::Physics::Fem1DPlyReaderDelegate::processVertex
void processVertex(const std::string &elementName) override
Callback function to process one vertex.
Definition: Fem1DPlyReaderDelegate.cpp:82
SurgSim::Physics::Fem1DPlyReaderDelegate::endRadius
void endRadius(const std::string &elementName)
Callback function, end the processing of radius.
Definition: Fem1DPlyReaderDelegate.cpp:122
FemPlyReaderDelegate.h
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::FemPlyReaderDelegate
Common part of implementation of PlyReaderDelegate for FemRepresentations.
Definition: FemPlyReaderDelegate.h:33
SurgSim::Physics::Fem1DPlyReaderDelegate::getElementName
std::string getElementName() const override
Definition: Fem1DPlyReaderDelegate.cpp:38