13class ChangeMeshFaceSelectionAction :
public HistoryAction
16 using Obj = ObjectMesh;
25 selection_ = objMesh_->getSelectedFaces();
35 selection_ = objMesh_->getSelectedFaces();
36 objMesh_->selectFaces( std::move( newSelection ) );
39 virtual std::string
name()
const override {
return name_; }
41 virtual void action( Type )
override
45 auto tmp = objMesh_->getSelectedFaces();
46 objMesh_->selectFaces( std::move( selection_ ) );
47 selection_ = std::move( tmp );
50 const FaceBitSet & selection()
const {
return selection_; }
53 static void setObjectDirty(
const std::shared_ptr<ObjectMesh>& ) {}
55 [[nodiscard]]
virtual size_t heapBytes()
const override
57 return name_.capacity() + selection_.heapBytes();
62 std::shared_ptr<ObjectMesh> objMesh_;
63 FaceBitSet selection_;
67class ChangeMeshEdgeSelectionAction :
public HistoryAction
70 using Obj = ObjectMesh;
79 selection_ = objMesh_->getSelectedEdges();
89 selection_ = objMesh_->getSelectedEdges();
90 objMesh_->selectEdges( std::move( newSelection ) );
93 virtual std::string
name()
const override {
return name_; }
95 virtual void action( Type )
override
99 auto tmp = objMesh_->getSelectedEdges();
100 objMesh_->selectEdges( std::move( selection_ ) );
101 selection_ = std::move( tmp );
104 const UndirectedEdgeBitSet & selection()
const {
return selection_; }
107 static void setObjectDirty(
const std::shared_ptr<ObjectMesh>& ) {}
109 [[nodiscard]]
virtual size_t heapBytes()
const override
111 return name_.capacity() + selection_.heapBytes();
116 std::shared_ptr<ObjectMesh> objMesh_;
117 UndirectedEdgeBitSet selection_;
121class ChangeMeshCreasesAction :
public HistoryAction
124 using Obj = ObjectMesh;
133 creases_ = objMesh_->creases();
137 ChangeMeshCreasesAction(
const std::string& name,
const std::shared_ptr<ObjectMesh>& objMesh, UndirectedEdgeBitSet&& newCreases ) :
143 creases_ = objMesh_->creases();
144 objMesh_->setCreases( std::move( newCreases ) );
147 virtual std::string
name()
const override {
return name_; }
149 virtual void action( Type )
override
153 auto tmp = objMesh_->creases();
154 objMesh_->setCreases( std::move( creases_ ) );
155 creases_ = std::move( tmp );
158 const UndirectedEdgeBitSet & creases()
const {
return creases_; }
161 static void setObjectDirty(
const std::shared_ptr<ObjectMesh>& ) {}
163 [[nodiscard]]
virtual size_t heapBytes()
const override
165 return name_.capacity() + creases_.heapBytes();
170 std::shared_ptr<ObjectMesh> objMesh_;
171 UndirectedEdgeBitSet creases_;
175class ChangePointPointSelectionAction :
public HistoryAction
178 using Obj = ObjectPoints;
183 objPoints_{ objPoints }
187 selection_ = objPoints_->getSelectedPoints();
190 virtual std::string
name()
const override {
return name_; }
192 virtual void action( Type )
override
196 auto tmp = objPoints_->getSelectedPoints();
197 objPoints_->selectPoints( std::move( selection_ ) );
198 selection_ = std::move( tmp );
201 const VertBitSet& selection()
const {
return selection_; }
204 static void setObjectDirty(
const std::shared_ptr<ObjectPoints>& )
207 [[nodiscard]]
virtual size_t heapBytes()
const override
209 return name_.capacity() + selection_.heapBytes();
214 std::shared_ptr<ObjectPoints> objPoints_;
215 VertBitSet selection_;
unsafe void action(MR.HistoryAction.Type _1)
unsafe ChangeMeshCreasesAction(MR._ByValue_ChangeMeshCreasesAction _other)
unsafe ChangeMeshEdgeSelectionAction(MR._ByValue_ChangeMeshEdgeSelectionAction _other)
unsafe void action(MR.HistoryAction.Type _1)
unsafe void action(MR.HistoryAction.Type _1)
unsafe ChangeMeshFaceSelectionAction(MR._ByValue_ChangeMeshFaceSelectionAction _other)
unsafe void action(MR.HistoryAction.Type _1)
unsafe ChangePointPointSelectionAction(MR._ByValue_ChangePointPointSelectionAction _other)
std::string name(const T &primitive)
Definition MRFeatures.h:309
Definition MRCameraOrientationPlugin.h:8