9#include <unordered_map>
29 float ordinaryLineWidth = 3;
32 float hoveredLineWidth = 4;
35 float selectedLineWidth = 3;
49 MRVIEWER_API
void enable(
bool isEnabled );
68 MRVIEWER_API
bool selectHole( std::shared_ptr<MR::ObjectMeshHolder>
object,
int index );
83 float mouseAccuracy_{ 5.5f };
85 bool isSelectorActive_ =
false;
87 PerObjectHoles holes_;
88 PerObjectHolesPolylines holeLines_;
89 PerObjectMeshChangedSignals onMeshChangedSignals_;
92 MRVIEWER_API
bool onMouseMove_(
int mouse_x,
int mouse_y )
override;
95 AncillaryLines createAncillaryLines_( std::shared_ptr<ObjectMeshHolder>& obj, MR::EdgeId hole );
98 std::shared_ptr<MR::Polyline3> getHoleBorder_(
const std::shared_ptr<ObjectMeshHolder> obj,
EdgeId initEdge );
102 std::pair<std::shared_ptr<MR::ObjectMeshHolder>,
HoleEdgePoint> getHoverdHole_();
105 bool selectHole_( std::shared_ptr<ObjectMeshHolder>
object,
int index,
bool writeHistory =
true );
108 bool updateHole_( std::shared_ptr<MR::ObjectMeshHolder>
object,
int index,
MR::Color color,
float lineWidth );
111 enum class ActionType {
117 bool actionByPick_( ActionType actionType );
120 BoundarySelectionWidgetCallBack onBoundarySelected_;
121 BoundarySelectionWidgetChecker isObjectValidToPick_;
124 std::shared_ptr<MR::ObjectMeshHolder> selectedHoleObject_;
125 int selectedHoleIndex_;
128 std::shared_ptr<MR::ObjectMeshHolder> hoveredHoleObject_;
129 int hoveredHoleIndex_;
132 bool isSelectedAndHoveredTheSame_();
135 bool hoverHole_( std::shared_ptr<MR::ObjectMeshHolder>
object,
int index );
138 void calculateHoles_();
150 [[nodiscard]] std::string
name()
const override {
return name_; }
159 std::shared_ptr<ObjectMeshHolder> prevSelectedHoleObject_;
160 std::shared_ptr<ObjectMeshHolder> nextSelectedHoleObject_;
161 int prevSelectedHoleIndex_;
162 int nextSelectedHoleIndex_;
int EdgeId
Definition MRDotNet/MRMeshFwd.h:52
Definition MRMeshBoundarySelectionWidget.h:144
void action(Type type) override
This function is called on history action (undo, redo, etc.)
std::string name() const override
Definition MRMeshBoundarySelectionWidget.h:150
ChangeBoundarySelectionHistoryAction(std::string name, BoundarySelectionWidget &widget, std::shared_ptr< ObjectMeshHolder > object, int index)
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 MRCameraOrientationPlugin.h:8
MouseButton
Definition MRMouse.h:9
Helper class to manage ancillary visual lines used by plugins.
Definition MRAncillaryLines.h:13
static constexpr Color green() noexcept
Definition MRColor.h:31
static constexpr Color purple() noexcept
Definition MRColor.h:35
static constexpr Color gray() noexcept
Definition MRColor.h:29
Definition MRPickHoleBorderElement.h:11
Definition MRViewerEventsListener.h:29