8#include <unordered_map>
28 float ordinaryLineWidth = 3;
31 float hoveredLineWidth = 4;
34 float selectedLineWidth = 3;
48 MRVIEWER_API
void enable(
bool isEnabled );
67 MRVIEWER_API
bool selectHole( std::shared_ptr<MR::ObjectMeshHolder>
object,
int index );
73 MRVIEWER_API std::pair< std::shared_ptr<MR::ObjectMeshHolder>, EdgeId >
getSelectHole()
const;
82 float mouseAccuracy_{ 5.5f };
84 bool isSelectorActive_ =
false;
86 PerObjectHoles holes_;
87 PerObjectHolesPolylines holeLines_;
88 PerObjectMeshChangedSignals onMeshChangedSignals_;
90 MRVIEWER_API
bool onMouseDown_(
MouseButton button,
int modifier )
override;
91 MRVIEWER_API
bool onMouseMove_(
int mouse_x,
int mouse_y )
override;
94 AncillaryLines createAncillaryLines_( std::shared_ptr<ObjectMeshHolder>& obj, MR::EdgeId hole );
97 std::shared_ptr<MR::Polyline3> getHoleBorder_(
const std::shared_ptr<ObjectMeshHolder> obj, EdgeId initEdge );
101 std::pair<std::shared_ptr<MR::ObjectMeshHolder>,
HoleEdgePoint> getHoverdHole_();
104 bool selectHole_( std::shared_ptr<ObjectMeshHolder>
object,
int index,
bool writeHistory =
true );
107 bool updateHole_( std::shared_ptr<MR::ObjectMeshHolder>
object,
int index,
MR::Color color,
float lineWidth );
110 enum class ActionType {
116 bool actionByPick_( ActionType actionType );
119 BoundarySelectionWidgetCallBack onBoundarySelected_;
120 BoundarySelectionWidgetChecker isObjectValidToPick_;
123 std::shared_ptr<MR::ObjectMeshHolder> selectedHoleObject_;
124 int selectedHoleIndex_;
127 std::shared_ptr<MR::ObjectMeshHolder> hoveredHoleObject_;
128 int hoveredHoleIndex_;
131 bool isSelectedAndHoveredTheSame_();
134 bool hoverHole_( std::shared_ptr<MR::ObjectMeshHolder>
object,
int index );
137 void calculateHoles_();
149 [[nodiscard]] std::string
name()
const override {
return name_; }
158 std::shared_ptr<ObjectMeshHolder> prevSelectedHoleObject_;
159 std::shared_ptr<ObjectMeshHolder> nextSelectedHoleObject_;
160 int prevSelectedHoleIndex_;
161 int nextSelectedHoleIndex_;
Definition MRMeshBoundarySelectionWidget.h:143
void action(Type type) override
This function is called on history action (undo, redo, etc.)
std::string name() const override
Definition MRMeshBoundarySelectionWidget.h:149
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