载入中...
搜索中...
未找到
EditorVolumeTarget.h
浏览该文件的文档.
1#pragma once
4
5#include <memory>
6#include <string>
7#include <vector>
8
9namespace eve::editor {
10
13
15class IntVolumeEditCommand final : public IEditCommand {
16public:
20 bool record(int x, int y, int z, int after);
22 const std::string& name() const override { return name_; }
24 EditRegion dirtyRegion() const override { return dirty_.xzRegion(); }
26 bool apply() override;
28 void revert() override;
30 [[nodiscard]] std::unique_ptr<IEditCommand> clone() const override;
32 bool mergeWith(const IEditCommand& later) override;
33
34private:
35 struct Change {
36 int x = 0;
37 int y = 0;
38 int z = 0;
39 int before = 0;
40 int after = 0;
41 };
42 std::string name_;
43 IEditableTarget* target_ = nullptr;
44 EditVolume dirty_;
45 std::vector<Change> changes_;
46};
47
48} // namespace eve::editor
LogicalId target
float y
Definition AnimClip.cpp:738
float x
Definition AnimClip.cpp:738
float z
Definition AnimClip.cpp:738
IEditableTarget public API.
Stable capability for sparse integer volumes.
Reversible unit accepted by the editor transaction manager.
Definition EditCommand.h:14
Reversible integer-volume command shared by voxel and custom volume targets.
EditRegion dirtyRegion() const override
Dirty region.
std::unique_ptr< IEditCommand > clone() const override
Deep copy. @ownership Caller deletes.
bool record(int x, int y, int z, int after)
Record a desired value without applying it.
const std::string & name() const override
Name.
bool mergeWith(const IEditCommand &later) override
Merge with.
eve::editing::EditVolume EditVolume
eve::editing::IEditableTarget IEditableTarget
Definition EditorTarget.h:6
EditRegion public API.
Integer axis-aligned volume invalidated by a 3D edit.
EditRegion xzRegion() const
Xz region.