Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SofaKernel] Set read-only all data defined by the file loaded #1660

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 17 additions & 0 deletions SofaKernel/modules/SofaCore/src/sofa/core/loader/MeshLoader.cpp
Expand Up @@ -112,6 +112,23 @@ MeshLoader::MeshLoader() : BaseLoader()
d_pentahedraGroups.setGroup("Groups");
d_tetrahedraGroups.setGroup("Groups");

d_positions.setReadOnly(true);
d_polylines.setReadOnly(true);
d_edges.setReadOnly(true);
d_triangles.setReadOnly(true);
d_quads.setReadOnly(true);
d_polygons.setReadOnly(true);
d_highOrderEdgePositions.setReadOnly(true);
d_highOrderTrianglePositions.setReadOnly(true);
d_highOrderQuadPositions.setReadOnly(true);
d_tetrahedra.setReadOnly(true);
d_hexahedra.setReadOnly(true);
d_pentahedra.setReadOnly(true);
d_highOrderTetrahedronPositions.setReadOnly(true);
d_highOrderHexahedronPositions.setReadOnly(true);
d_pyramids.setReadOnly(true);
d_normals.setReadOnly(true);

/// name filename => component state update + change of all data field...but not visible ?
addUpdateCallback("filename", {&m_filename}, [this](const core::DataTracker& t)
{
Expand Down