25 name_{ std::move(
name ) }
29 storedIso_ = obj->getIsoValue();
33 virtual std::string
name()
const override
43 float newIso = objVoxels_->getIsoValue();
44 objVoxels_->setIsoValue( storedIso_, {}, false );
52 [[nodiscard]]
virtual size_t heapBytes()
const override
54 return name_.capacity();
58 std::shared_ptr<ObjectVoxels> objVoxels_;
59 float storedIso_{ 0.0f };
72 name_{ std::move(
name ) }
76 storedDual_ = obj->getDualMarchingCubes();
83 storedDual_( storeDual ),
84 name_{ std::move(
name ) }
88 virtual std::string
name()
const override
98 auto newDual = objVoxels_->getDualMarchingCubes();
99 objVoxels_->setDualMarchingCubes( storedDual_,
false );
100 storedDual_ = newDual;
109 return name_.capacity();
113 std::shared_ptr<ObjectVoxels> objVoxels_;
114 bool storedDual_{
true };
127 name_{ std::move(
name ) }
131 activeBox_ = obj->getActiveBounds();
135 virtual std::string
name()
const override
145 auto box = objVoxels_->getActiveBounds();
146 objVoxels_->setActiveBounds( activeBox_, {}, false );
156 return name_.capacity();
160 std::shared_ptr<ObjectVoxels> objVoxels_;
174 name_{ std::move(
name ) }
178 if (
auto m = obj->mesh() )
179 cloneSurface_ = std::make_shared<Mesh>( *m );
183 virtual std::string
name()
const override
193 cloneSurface_ = objVoxels_->updateIsoSurface( cloneSurface_ );
208 std::shared_ptr<ObjectVoxels> objVoxels_;
209 std::shared_ptr<Mesh> cloneSurface_;
222 changeIsoAction_(
name, obj ),
223 changeSurfaceAction_(
name, obj),
224 name_{ std::move(
name ) }
228 vdbVolume_ = obj->vdbVolume();
229 histogram_ = obj->histogram();
233 virtual std::string
name()
const override
243 vdbVolume_ = objVoxels_->updateVdbVolume( std::move( vdbVolume_ ) );
244 histogram_ = objVoxels_->updateHistogram( std::move( histogram_ ) );
245 changeIsoAction_.
action( obj );
246 changeSurfaceAction_.
action( obj );
261 std::shared_ptr<ObjectVoxels> objVoxels_;
262 VdbVolume vdbVolume_;
Definition MRChangeVoxelsAction.h:121
virtual std::string name() const override
Definition MRChangeVoxelsAction.h:135
ChangeActiveBoxAction(std::string name, const std::shared_ptr< ObjectVoxels > &obj)
use this constructor to remember object's active box before making any changes in it
Definition MRChangeVoxelsAction.h:125
virtual size_t heapBytes() const override
returns the amount of memory this object occupies on heap
Definition MRChangeVoxelsAction.h:154
virtual void action(HistoryAction::Type) override
This function is called on history action (undo, redo, etc.)
Definition MRChangeVoxelsAction.h:140
static void setObjectDirty(const std::shared_ptr< Obj > &)
Definition MRChangeVoxelsAction.h:150
Undo action for ObjectVoxels dual/standard marching cubes change.
Definition MRChangeVoxelsAction.h:66
virtual std::string name() const override
Definition MRChangeVoxelsAction.h:88
virtual size_t heapBytes() const override
returns the amount of memory this object occupies on heap
Definition MRChangeVoxelsAction.h:107
ChangeDualMarchingCubesAction(std::string name, const std::shared_ptr< ObjectVoxels > &obj, bool storeDual)
use this constructor to remember given dual-value (and not the current value in the object)
Definition MRChangeVoxelsAction.h:81
virtual void action(HistoryAction::Type) override
This function is called on history action (undo, redo, etc.)
Definition MRChangeVoxelsAction.h:93
static void setObjectDirty(const std::shared_ptr< Obj > &)
Definition MRChangeVoxelsAction.h:103
ChangeDualMarchingCubesAction(std::string name, const std::shared_ptr< ObjectVoxels > &obj)
use this constructor to remember object's dual-value before making any changes in it
Definition MRChangeVoxelsAction.h:70
Definition MRChangeVoxelsAction.h:216
virtual void action(HistoryAction::Type obj) override
This function is called on history action (undo, redo, etc.)
Definition MRChangeVoxelsAction.h:238
ChangeGridAction(std::string name, const std::shared_ptr< ObjectVoxels > &obj)
use this constructor to remember object's data before making any changes in it
Definition MRChangeVoxelsAction.h:220
static void setObjectDirty(const std::shared_ptr< Obj > &obj)
Definition MRChangeVoxelsAction.h:249
virtual std::string name() const override
Definition MRChangeVoxelsAction.h:233
virtual size_t heapBytes() const override
returns the amount of memory this object occupies on heap
Definition MRChangeVoxelsAction.h:255
Undo action for ObjectVoxels iso-value change.
Definition MRChangeVoxelsAction.h:19
virtual std::string name() const override
Definition MRChangeVoxelsAction.h:33
static void setObjectDirty(const std::shared_ptr< Obj > &)
Definition MRChangeVoxelsAction.h:48
ChangeIsoAction(std::string name, const std::shared_ptr< ObjectVoxels > &obj)
use this constructor to remember object's iso before making any changes in it
Definition MRChangeVoxelsAction.h:23
virtual void action(HistoryAction::Type) override
This function is called on history action (undo, redo, etc.)
Definition MRChangeVoxelsAction.h:38
virtual size_t heapBytes() const override
returns the amount of memory this object occupies on heap
Definition MRChangeVoxelsAction.h:52
Definition MRChangeVoxelsAction.h:168
virtual std::string name() const override
Definition MRChangeVoxelsAction.h:183
ChangeSurfaceAction(std::string name, const std::shared_ptr< ObjectVoxels > &obj)
use this constructor to remember object's surface before making any changes in it
Definition MRChangeVoxelsAction.h:172
virtual size_t heapBytes() const override
returns the amount of memory this object occupies on heap
Definition MRChangeVoxelsAction.h:202
static void setObjectDirty(const std::shared_ptr< Obj > &obj)
Definition MRChangeVoxelsAction.h:196
virtual void action(HistoryAction::Type) override
This function is called on history action (undo, redo, etc.)
Definition MRChangeVoxelsAction.h:188
Definition MRHistogram.h:10
size_t heapBytes() const
returns the amount of memory this object occupies on heap
Definition MRHistogram.h:36
Definition MRHistoryAction.h:12
Type
Definition MRHistoryAction.h:19
Definition MRObjectVoxels.h:17
size_t heapBytes(const std::vector< T > &vec)
returns the amount of memory given vector occupies on heap
Definition MRHeapBytes.h:15
@ DIRTY_ALL
Definition MRVisualObject.h:109
Definition MRCameraOrientationPlugin.h:8