12#include <unordered_map>
13#include <unordered_set>
26 int widgetContourCloseMod = GLFW_MOD_CONTROL;
29 int widgetDeletePointMod = GLFW_MOD_SHIFT;
32 bool writeHistory =
true;
35 std::string historySpecification =
"surface contours widget";
38 bool filterHistoryonReset =
true;
54 MR::Color closeContourPointColor = Color::transparent();
67 MRVIEWER_API
void enable(
bool isEnabled );
94 return pickedPoints_[obj];
100 return pickedPoints_;
112 MRVIEWER_API std::pair <std::shared_ptr<MR::VisualObject>,
int >
getActivePoint()
const;
113 MRVIEWER_API
void setActivePoint( std::shared_ptr<MR::VisualObject> obj,
int index );
124 MRVIEWER_API
bool removePoint(
const std::shared_ptr<VisualObject>& obj,
int pickedIndex );
129 MRVIEWER_API
bool closeContour(
const std::shared_ptr<VisualObject>& objectToCloseCoutour );
136 MRVIEWER_API
bool onMouseMove_(
int mouse_x,
int mouse_y )
override;
139 [[nodiscard]] std::shared_ptr<SurfacePointWidget> createPickWidget_(
const std::shared_ptr<MR::VisualObject>& obj,
const PickedPoint& pt );
142 bool moveClosedPoint_ =
false;
143 bool activeChange_ =
false;
144 bool isPickerActive_ =
false;
147 int activeIndex_{ 0 };
148 std::shared_ptr<MR::VisualObject> activeObject_ =
nullptr;
151 SurfaceContours pickedPoints_;
154 std::unordered_set<const VisualObject*> surfacePointWidgetCache_;
157 struct SurfaceConnectionHolder
159 boost::signals2::scoped_connection onMeshChanged;
160 boost::signals2::scoped_connection onPointsChanged;
162 std::unordered_map<std::shared_ptr<VisualObject>, SurfaceConnectionHolder> surfaceConnectionHolders_;
165 PickerPointCallBack onPointAdd_;
166 PickerPointCallBack onPointMove_;
167 PickerPointCallBack onPointMoveFinish_;
168 PickerPointCallBack onPointRemove_;
169 PickerPointObjectChecker isObjectValidToPick_;
188 virtual std::string
name()
const override;
190 [[nodiscard]]
virtual size_t heapBytes()
const override;
193 const std::shared_ptr<MR::VisualObject> obj_;
207 virtual std::string
name()
const override;
209 [[nodiscard]]
virtual size_t heapBytes()
const override;
212 const std::shared_ptr<MR::VisualObject> obj_;
227 virtual std::string
name()
const override;
229 [[nodiscard]]
virtual size_t heapBytes()
const override;
232 const std::shared_ptr<MR::VisualObject> obj_;
244 [[nodiscard]] std::string
name()
const override {
return name_; }
256 std::weak_ptr<VisualObject> objPtr;
257 std::vector<PickedPoint> pickedPoints;
259 std::vector<ObjectState> states_;
260 std::weak_ptr<VisualObject> activeObject_;
Definition MRSurfaceContoursWidget.h:180
virtual void action(Type actionType) override
This function is called on history action (undo, redo, etc.)
virtual size_t heapBytes() const override
returns the amount of memory this object occupies on heap
virtual std::string name() const override
AddPointActionPickerPoint(SurfaceContoursWidget &widget, const std::shared_ptr< MR::VisualObject > &obj, const PickedPoint &point)
Definition MRSurfaceContoursWidget.h:182
Definition MRSurfaceContoursWidget.h:218
ChangePointActionPickerPoint(SurfaceContoursWidget &widget, const std::shared_ptr< MR::VisualObject > &obj, const PickedPoint &point, int index)
Definition MRSurfaceContoursWidget.h:220
virtual std::string name() const override
virtual void action(Type) override
This function is called on history action (undo, redo, etc.)
virtual size_t heapBytes() const override
returns the amount of memory this object occupies on heap
Definition MRHistoryAction.h:12
Type
Definition MRHistoryAction.h:19
Definition MRSurfaceContoursWidget.h:198
RemovePointActionPickerPoint(SurfaceContoursWidget &widget, const std::shared_ptr< MR::VisualObject > &obj, const PickedPoint &point, int index)
Definition MRSurfaceContoursWidget.h:200
virtual std::string name() const override
virtual void action(Type actionType) override
This function is called on history action (undo, redo, etc.)
virtual size_t heapBytes() const override
returns the amount of memory this object occupies on heap
std::function< bool(const VisualObject *, ViewportMask)> PickRenderObjectPredicate
Definition MRViewport.h:151
Definition MRCameraOrientationPlugin.h:7
MouseButton
Definition MRMouse.h:9
std::variant< MeshTriPoint, EdgePoint, VertId, int > PickedPoint
Definition MRPointOnObject.h:40
Definition MRViewerEventsListener.h:29