16 #ifndef SURGSIM_BLOCKS_TRANSFERPHYSICSTOGRAPHICSMESHBEHAVIOR_H 17 #define SURGSIM_BLOCKS_TRANSFERPHYSICSTOGRAPHICSMESHBEHAVIOR_H 19 #include "SurgSim/DataStructures/TriangleMesh.h" 20 #include "SurgSim/Framework/Behavior.h" 21 #include "SurgSim/Framework/Macros.h" 34 class MeshRepresentation;
39 class DeformableRepresentation;
44 SURGSIM_STATIC_REGISTRATION(TransferPhysicsToGraphicsMeshBehavior);
62 void setSource(
const std::shared_ptr<Framework::Component>& source);
66 void setTarget(
const std::shared_ptr<Framework::Component>& target);
70 std::shared_ptr<Physics::DeformableRepresentation> getSource()
const;
74 std::shared_ptr<Graphics::MeshRepresentation> getTarget()
const;
81 const std::shared_ptr<DataStructures::TriangleMeshPlain>& source,
82 const std::shared_ptr<DataStructures::TriangleMeshPlain>& target);
88 void setIndexMap(
const std::string& sourceFile,
const std::string& targetFile);
93 void setIndexMap(
const std::vector<std::pair<size_t, size_t>>& indexMap);
96 const std::vector<std::pair<size_t, size_t>> getIndexMap()
const;
98 void update(
double dt)
override;
101 bool doInitialize()
override;
102 bool doWakeUp()
override;
105 void setIndexMap(
const std::pair<std::string, std::string>& fileName);
107 void setIndexMap(
const std::pair<std::shared_ptr<Framework::Asset>, std::shared_ptr<Framework::Asset>>& meshes);
110 std::shared_ptr<Physics::DeformableRepresentation> m_source;
113 std::shared_ptr<Graphics::MeshRepresentation> m_target;
116 std::vector<std::pair<size_t, size_t>> m_indexMap;
124 std::vector<std::pair<size_t, size_t>> generateIndexMap(
125 const std::shared_ptr<DataStructures::TriangleMeshPlain>& source,
126 const std::shared_ptr<DataStructures::TriangleMeshPlain>& target);
131 #endif // SURGSIM_BLOCKS_TRANSFERPHYSICSTOGRAPHICSMESHBEHAVIOR_H Wraps glewInit() to separate the glew opengl definitions from the osg opengl definitions only imgui n...
Definition: AddRandomSphereBehavior.cpp:36
Behaviors perform actions.
Definition: Behavior.h:40
Behavior to copy positions of a PhysicsRepresentation to a GraphicsMesh.
Definition: TransferPhysicsToGraphicsMeshBehavior.h:51