16 #ifndef SURGSIM_PHYSICS_FEM_INL_H 17 #define SURGSIM_PHYSICS_FEM_INL_H 19 #include "SurgSim/DataStructures/PlyReader.h" 29 template <
class VertexData,
class Element>
34 template <
class VertexData,
class Element>
37 m_elements.push_back(element);
38 return m_elements.size() - 1;
41 template <
class VertexData,
class Element>
44 return m_elements.size();
47 template <
class VertexData,
class Element>
48 const std::vector<std::shared_ptr<Element>>&
54 template <
class VertexData,
class Element>
60 template <
class VertexData,
class Element>
63 return m_elements[id];
66 template <
class VertexData,
class Element>
69 m_boundaryConditions.push_back(boundaryCondition);
70 return m_boundaryConditions.size() - 1;
73 template <
class VertexData,
class Element>
76 return m_boundaryConditions;
79 template <
class VertexData,
class Element>
82 return m_boundaryConditions;
85 template <
class VertexData,
class Element>
88 return m_boundaryConditions[id];
90 template <
class VertexData,
class Element>
template <
class PlyType,
class FemType>
97 <<
"'" << filename <<
"' is an invalid .ply file.";
101 auto delegate = std::make_shared<PlyType>(
102 std::dynamic_pointer_cast<FemType>(this->shared_from_this()));
106 <<
"The input file '" << filename <<
"' does not have the property required by FEM element mesh.";
116 #endif // SURGSIM_PHYSICS_FEM_INL_H size_t getBoundaryCondition(size_t id) const
Retrieves a specific boundary condition.
Definition: Fem-inl.h:86
Wraps glewInit() to separate the glew opengl definitions from the osg opengl definitions only imgui n...
Definition: AddRandomSphereBehavior.cpp:36
const std::vector< size_t > & getBoundaryConditions() const
Gets entire vector of boundary conditions.
Definition: Fem-inl.h:74
std::shared_ptr< Element > getElement(size_t id) const
Retrieve a specific element from the mesh.
Definition: Fem-inl.h:61
The convenience header that provides the entirety of the logging API.
size_t addElement(std::shared_ptr< Element > element)
Adds FEM element to mesh of Element template type.
Definition: Fem-inl.h:35
Wrapper for the C .ply file parser This class wraps the main functionality for the original C ...
Definition: PlyReader.h:85
const std::vector< std::shared_ptr< Element > > & getElements() const
Gets entire FEM element vector.
Definition: Fem-inl.h:49
bool loadFemFile(const std::string &filename)
Shared loading method for all 3 dimensions.
Definition: Fem-inl.h:91
size_t addBoundaryCondition(size_t boundaryCondition)
Add boundary condition to mesh.
Definition: Fem-inl.h:67
Fem()
Default constructor.
Definition: Fem-inl.h:30
bool isValid() const
Query if this object is valid.
Definition: PlyReader.cpp:92
static std::shared_ptr< Logger > getDefaultLogger()
Get default logger.
Definition: Logger.h:116
size_t getNumElements() const
Gets number of FEM elements in the mesh.
Definition: Fem-inl.h:42
bool parseWithDelegate(std::shared_ptr< PlyReaderDelegate > delegate)
Sets a delegate for parsing and then parse the file.
Definition: PlyReader.cpp:336
#define SURGSIM_LOG_SEVERE(logger)
Logs a message to the specified logger at the SEVERE level.
Definition: LogMacros.h:106