opensurgsim
Fem3DPlyReaderDelegate.h
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_FEM3DPLYREADERDELEGATE_H
17 #define SURGSIM_PHYSICS_FEM3DPLYREADERDELEGATE_H
18 
19 #include <array>
20 #include <memory>
21 
22 #include "SurgSim/DataStructures/EmptyData.h"
23 #include "SurgSim/DataStructures/PlyReader.h"
24 #include "SurgSim/Physics/Fem3D.h"
25 #include "SurgSim/Physics/FemPlyReaderDelegate.h"
26 
27 namespace SurgSim
28 {
29 namespace Physics
30 {
31 
33 {
34 public:
37 
40  explicit Fem3DPlyReaderDelegate(std::shared_ptr<Fem3D> mesh);
41 
42 protected:
43  std::string getElementName() const override;
44 
45  bool fileIsAcceptable(const PlyReader& reader) override;
46 
47  void endParseFile() override;
48 
49  void processVertex(const std::string& elementName) override;
50 
51  void processFemElement(const std::string& elementName) override;
52 
53  void processBoundaryCondition(const std::string& elementName) override;
54 
56  void endFile();
57 
58 private:
60  std::shared_ptr<Fem3D> m_mesh;
61 };
62 
63 } // namespace Physics
64 } // namespace SurgSim
65 
66 #endif // SURGSIM_PHYSICS_FEM3DPLYREADERDELEGATE_H
Wraps glewInit() to separate the glew opengl definitions from the osg opengl definitions only imgui n...
Definition: AddRandomSphereBehavior.cpp:36
Common part of implementation of PlyReaderDelegate for FemRepresentations.
Definition: FemPlyReaderDelegate.h:33
Definition: Fem3DPlyReaderDelegate.h:32
void processVertex(const std::string &elementName) override
Callback function to process one vertex.
Definition: Fem3DPlyReaderDelegate.cpp:67
Wrapper for the C .ply file parser This class wraps the main functionality for the original C ...
Definition: PlyReader.h:85
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: Fem3DPlyReaderDelegate.cpp:42
void processFemElement(const std::string &elementName) override
Callback function to process one FemElement.
Definition: Fem3DPlyReaderDelegate.cpp:74
Fem3DPlyReaderDelegate()
Default constructor.
Definition: Fem3DPlyReaderDelegate.cpp:26
void processBoundaryCondition(const std::string &elementName) override
Callback function to process one boundary condition.
Definition: Fem3DPlyReaderDelegate.cpp:93
void endFile()
End file callback.
void endParseFile() override
Callback for end of PlyReader::parseFile.
Definition: Fem3DPlyReaderDelegate.cpp:52