Nix (Dev) 3.5.10
dev - 3.5.10 - 1af9301
Loading...
Searching...
No Matches
CadMimicEditorUseCases.hpp
Go to the documentation of this file.
1#ifndef IV_SRC_UI_CAD_CADMIMICEDITORUSECASES_HPP_
2#define IV_SRC_UI_CAD_CADMIMICEDITORUSECASES_HPP_
3
8
9#include <cstdint>
10#include <memory>
11#include <set>
12
13namespace iv::cad
14{
15
17{
18public:
19 static std::optional<std::shared_ptr<AbstractBuilderMimicElement>> selectMimicElementBuilder(CEventMotion *evt);
20
21 static bool
22 createMimicElement(CDialog *dlgFather, const CPanelMimicsEditor *panelRef, const iv::math::geometry::Point2d &point,
23 const std::shared_ptr<AbstractBuilderMimicElement> &mimicElementBuilder,
24 const std::optional<std::function<void(std::shared_ptr<iv::mimics::AbstractMimicElement>)>>
25 &setDefaultProperties = std::nullopt);
26 static bool createMimicElement(CEventMotion *evt, CPanelMimicsEditor *panelRef,
27 const std::shared_ptr<AbstractBuilderMimicElement> &mimicElementBuilder);
29 const iv::math::geometry::Point2d &firstPoint,
30 const std::shared_ptr<AbstractBuilderMimicElement> &mimicElementBuilder);
31 static bool
33 std::vector<iv::math::geometry::Point2d> points,
34 const std::shared_ptr<AbstractBuilderMimicElement> &mimicElementBuilder);
35
36 static std::optional<std::set<uint64_t>> selectMimicElementsIndicesInArea(
37 CEventMotion *evt, const std::optional<iv::math::geometry::Point2d> &firstPoint,
38 const std::shared_ptr<std::vector<std::shared_ptr<AbstractObjCapture>>> &objsCatchable);
39
40 static bool editMimicElementProperties(CEventMotion *evt, const std::shared_ptr<AbstractObjCapture> &objCatchable);
41
42 static bool
44 const std::shared_ptr<std::vector<std::shared_ptr<AbstractObjCapture>>> &objsCatchable,
45 const std::optional<std::set<uint64_t>> &elementsIndices);
46
47 static bool
49 const std::shared_ptr<std::vector<std::shared_ptr<AbstractObjCapture>>> &objsCatchable,
50 const std::optional<std::set<uint64_t>> &elementsIndicesOut,
51 std::optional<iv::types::coord> &pastingPositionOffsetOut);
52
53 static bool
54 moveMimicElements(CEventMotion *evt, const std::optional<iv::math::geometry::Point2d> &startPointDrag,
55 const std::shared_ptr<std::vector<std::shared_ptr<AbstractObjCapture>>> &objsCatchable,
56 const std::optional<std::set<uint64_t>> &elementsIndices);
57
58 static bool
60 const std::shared_ptr<std::vector<std::shared_ptr<AbstractObjCapture>>> &objsCatchable,
61 const std::optional<std::set<uint64_t>> &elementsIndices);
62
63 static bool
65 const std::shared_ptr<std::vector<std::shared_ptr<AbstractObjCapture>>> &objsCatchable,
66 const std::optional<std::set<uint64_t>> &elementsIndices);
67
69 CEventMotion *evt, const std::shared_ptr<std::vector<std::shared_ptr<AbstractObjCapture>>> &objsCatchable,
70 const std::optional<std::set<uint64_t>> &elementsIndices);
71
72 static bool
74 const std::shared_ptr<std::vector<std::shared_ptr<AbstractObjCapture>>> &objsCatchable,
75 const std::optional<std::set<uint64_t>> &elementsIndices);
76
77 static bool
79 const std::shared_ptr<std::vector<std::shared_ptr<AbstractObjCapture>>> &objsCatchable,
80 const std::optional<std::set<uint64_t>> &elementsIndices);
81
82 static bool centerMimicElements(
83 CEventMotion *evt, const std::shared_ptr<std::vector<std::shared_ptr<AbstractObjCapture>>> &objsCatchable,
84 const std::optional<std::set<uint64_t>> &elementsIndices, const CPanelMimicsEditor *panelMimicsEditor);
85
86 static void addBackgroundDxf(CEventMotion *evt, const CPanelMimicsEditor *panelMimicsEditor);
87 static void removeBackgroundDxf(CEventMotion *evt, const CPanelMimicsEditor *panelMimicsEditor);
88 static void changeScreenResolution(CEventMotion *evt, CPanelMimicsEditor *panelMimicsEditor);
89
90 static void undoChanges(CEventMotion *evt, const CPanelMimicsEditor *panelMimicsEditor);
91 static void redoChanges(CEventMotion *evt, const CPanelMimicsEditor *panelMimicsEditor);
92
93 static void startMimicSnapshots(const CPanelMimicsEditor *panelMimicsEditor);
94 static void addSnapshotState(const CPanelMimicsEditor *panelMimicsEditor);
95
96 static void displayMimicEditorShortcuts(CDialog *dialogFather);
97
98private:
99 struct Constants
100 {
101 static constexpr uint64_t copyOffset {20};
102 };
103};
104
105}// namespace iv::cad
106
107#endif//IV_SRC_UI_CAD_CADMIMICEDITORUSECASES_HPP_
Definition CDialog.hpp:21
Definition CEventMotion.hpp:15
Definition CPanelMimicsEditor.hpp:51
Definition CadMimicEditorUseCases.hpp:17
static void changeScreenResolution(CEventMotion *evt, CPanelMimicsEditor *panelMimicsEditor)
Definition CadMimicEditorUseCases.cpp:1356
static void startMimicSnapshots(const CPanelMimicsEditor *panelMimicsEditor)
Definition CadMimicEditorUseCases.cpp:1436
static void addBackgroundDxf(CEventMotion *evt, const CPanelMimicsEditor *panelMimicsEditor)
Definition CadMimicEditorUseCases.cpp:1321
static bool alignmentMimicElements(CEventMotion *evt, const std::shared_ptr< std::vector< std::shared_ptr< AbstractObjCapture > > > &objsCatchable, const std::optional< std::set< uint64_t > > &elementsIndices)
Definition CadMimicEditorUseCases.cpp:915
static std::optional< std::set< uint64_t > > selectMimicElementsIndicesInArea(CEventMotion *evt, const std::optional< iv::math::geometry::Point2d > &firstPoint, const std::shared_ptr< std::vector< std::shared_ptr< AbstractObjCapture > > > &objsCatchable)
Definition CadMimicEditorUseCases.cpp:421
static void undoChanges(CEventMotion *evt, const CPanelMimicsEditor *panelMimicsEditor)
Definition CadMimicEditorUseCases.cpp:1390
static void displayMimicEditorShortcuts(CDialog *dialogFather)
Definition CadMimicEditorUseCases.cpp:1467
static std::optional< std::shared_ptr< AbstractBuilderMimicElement > > selectMimicElementBuilder(CEventMotion *evt)
Definition CadMimicEditorUseCases.cpp:309
static bool centerMimicElements(CEventMotion *evt, const std::shared_ptr< std::vector< std::shared_ptr< AbstractObjCapture > > > &objsCatchable, const std::optional< std::set< uint64_t > > &elementsIndices, const CPanelMimicsEditor *panelMimicsEditor)
Definition CadMimicEditorUseCases.cpp:1286
static bool findAndReplaceInMimicElements(CEventMotion *evt, const std::shared_ptr< std::vector< std::shared_ptr< AbstractObjCapture > > > &objsCatchable, const std::optional< std::set< uint64_t > > &elementsIndices)
Definition CadMimicEditorUseCases.cpp:608
static void addSnapshotState(const CPanelMimicsEditor *panelMimicsEditor)
Definition CadMimicEditorUseCases.cpp:1452
static void redoChanges(CEventMotion *evt, const CPanelMimicsEditor *panelMimicsEditor)
Definition CadMimicEditorUseCases.cpp:1413
static bool createMimicElementTwoPoints(CEventMotion *evt, CPanelMimicsEditor *panelRef, const iv::math::geometry::Point2d &firstPoint, const std::shared_ptr< AbstractBuilderMimicElement > &mimicElementBuilder)
Definition CadMimicEditorUseCases.cpp:371
static bool createMimicElement(CDialog *dlgFather, const CPanelMimicsEditor *panelRef, const iv::math::geometry::Point2d &point, const std::shared_ptr< AbstractBuilderMimicElement > &mimicElementBuilder, const std::optional< std::function< void(std::shared_ptr< iv::mimics::AbstractMimicElement >)> > &setDefaultProperties=std::nullopt)
Definition CadMimicEditorUseCases.cpp:323
static bool moveMimicElements(CEventMotion *evt, const std::optional< iv::math::geometry::Point2d > &startPointDrag, const std::shared_ptr< std::vector< std::shared_ptr< AbstractObjCapture > > > &objsCatchable, const std::optional< std::set< uint64_t > > &elementsIndices)
Definition CadMimicEditorUseCases.cpp:526
static bool equidistanceMimicElements(CEventMotion *evt, const std::shared_ptr< std::vector< std::shared_ptr< AbstractObjCapture > > > &objsCatchable, const std::optional< std::set< uint64_t > > &elementsIndices)
Definition CadMimicEditorUseCases.cpp:1202
static bool createMimicElementMultiplePoints(CEventMotion *evt, CPanelMimicsEditor *panelRef, std::vector< iv::math::geometry::Point2d > points, const std::shared_ptr< AbstractBuilderMimicElement > &mimicElementBuilder)
Definition CadMimicEditorUseCases.cpp:395
static bool editMimicElementProperties(CEventMotion *evt, const std::shared_ptr< AbstractObjCapture > &objCatchable)
Definition CadMimicEditorUseCases.cpp:443
static bool deleteMimicElements(CEventMotion *evt, CPanelMimicsEditor *panelRef, const std::shared_ptr< std::vector< std::shared_ptr< AbstractObjCapture > > > &objsCatchable, const std::optional< std::set< uint64_t > > &elementsIndices)
Definition CadMimicEditorUseCases.cpp:468
static void removeBackgroundDxf(CEventMotion *evt, const CPanelMimicsEditor *panelMimicsEditor)
Definition CadMimicEditorUseCases.cpp:1349
static bool rotateMimicElements(CEventMotion *evt, const std::shared_ptr< std::vector< std::shared_ptr< AbstractObjCapture > > > &objsCatchable, const std::optional< std::set< uint64_t > > &elementsIndices)
Definition CadMimicEditorUseCases.cpp:572
static bool copyMimicElements(CEventMotion *evt, CPanelMimicsEditor *panelRef, const std::shared_ptr< std::vector< std::shared_ptr< AbstractObjCapture > > > &objsCatchable, const std::optional< std::set< uint64_t > > &elementsIndicesOut, std::optional< iv::types::coord > &pastingPositionOffsetOut)
Definition CadMimicEditorUseCases.cpp:495
Definition CadMimicEditorUseCases.cpp:21
double coord
Definition types.hpp:13
Definition CadMimicEditorUseCases.hpp:100
static constexpr uint64_t copyOffset
Definition CadMimicEditorUseCases.hpp:101
Definition structs.hpp:16