Skip to content

added callback on change object in pick point manager#4766

Merged
Fedr merged 3 commits intomasterfrom
pick-point-obj-change-callback
Jun 27, 2025
Merged

added callback on change object in pick point manager#4766
Fedr merged 3 commits intomasterfrom
pick-point-obj-change-callback

Conversation

@kulikovss
Copy link
Contributor

added callback for handling pick points on objects with changed topology

@kulikovss kulikovss requested a review from Grantim June 27, 2025 12:13
PickerPointCallBack onPointRemove;

/// This callback is invoked when object was changed and needed update of points
/// Return true if update was processed
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please specify what it means? (true means that widget will skip internal updates?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

public:
using PickerPointCallBack = std::function<void( std::shared_ptr<VisualObject> obj, int index )>;
using AllowCallBack = std::function<bool( const std::shared_ptr<VisualObject>& obj, int index )>;
using ChangeObjectCallBack = std::function<bool( std::shared_ptr<VisualObject>& obj )>;
Copy link
Contributor

@Fedr Fedr Jun 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better get shared_ptr by const reference

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


/// This callback is invoked when an object was changed and needed update of points
/// Return true and widget will skip internal updates
ChangeObjectCallBack onChangeObject;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Current name is confusing. Better name it e.g. onUpdatePoints and skip updating on false

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@Fedr Fedr merged commit 7abfb81 into master Jun 27, 2025
33 of 35 checks passed
@Fedr Fedr deleted the pick-point-obj-change-callback branch June 27, 2025 20:54
MaxRayskiy pushed a commit that referenced this pull request Sep 27, 2025
* added callback on change object in pick point manager

* comments added

* fixes after review
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.

3 participants