Skip to content

Object: hide fields from users - #6274

Draft
Fedr wants to merge 6 commits into
masterfrom
lean/Object
Draft

Object: hide fields from users#6274
Fedr wants to merge 6 commits into
masterfrom
lean/Object

Conversation

@Fedr

@Fedr Fedr commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@Fedr
Fedr marked this pull request as draft June 16, 2026 18:55
Fedr added 3 commits June 16, 2026 22:20
# Conflicts:
#	source/MRMesh/MRChangeValue.h
#	source/MRMesh/MRMeshFwd.h
The hand-written copy constructor only initialized ObjectChildrenHolder and
data_, so name_, tags_, visibilityMask_, locked_, parentLocked_, selected_,
ancillary_ and worldXfChangedSignal were default-initialized instead of copied:
clone() dropped the name, tags and visibility of every object. The move
constructor and move assignment likewise transferred only data_, which broke
swapBase_ (std::swap of *this and other) into swapping just the xf, and left
child parent_ pointers dangling.

Wrap the pimpl in DataPtr, a unique_ptr<Data> with value semantics, so all of
Object's copy and move operations go back to = default and keep copying every
base and member, as the ObjectChildrenHolder comment intends.
# Conflicts:
#	source/MRMesh/MRObject.cpp
#	source/MRMesh/MRObject.h
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant