Implement manual deep copy for C3DData instead of relying on ezc3d's shallow copy constructor#277
Implement manual deep copy for C3DData instead of relying on ezc3d's shallow copy constructor#277
Conversation
Cpp-Linter Report
|
Co-authored-by: petersteneteg <3638222+petersteneteg@users.noreply.github.com>
Replace #include <ezc3d/ezc3d.h> in c3ddata.h with a forward declaration of ezc3d::c3d, following the DICOM module pattern. Move DataTraits info() implementation to c3ddatatraits.cpp to keep the external library confined to .cpp files only. Co-authored-by: petersteneteg <3638222+petersteneteg@users.noreply.github.com>
…rame extraction Co-authored-by: petersteneteg <3638222+petersteneteg@users.noreply.github.com>
Co-authored-by: petersteneteg <3638222+petersteneteg@users.noreply.github.com>
9aa36b1 to
6e92b97
Compare
Co-authored-by: petersteneteg <3638222+petersteneteg@users.noreply.github.com> Agent-Logs-Url: https://github.com/inviwo/modules/sessions/802536ca-88dd-4e2a-939e-942170ddc40e
…py() Co-authored-by: petersteneteg <3638222+petersteneteg@users.noreply.github.com> Agent-Logs-Url: https://github.com/inviwo/modules/sessions/bf174c8c-18ac-496c-ba0d-bf3876b29763
ezc3d::c3dstoresHeader,Parameters, andDataasshared_ptrinternally, andFramesimilarly storesPoints,Analogs,Rotationsasshared_ptr. The copy constructor only copies the pointers, so the previousdeepCopy()viastd::make_shared<ezc3d::c3d>(*data_)produced a shallow copy where mutations to the copy would affect the original.Replaced with a manual recursive reconstruction:
c3d::point(name)andc3d::analog(name)to initialize the POINT/ANALOG configuration consistently in the new objectRotation::set()c3d::parameter(); POINT/ANALOG groups are skipped since they're already initialized by the registration step💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.