载入中...
搜索中...
未找到
SplinePathGizmo.h
浏览该文件的文档.
1#pragma once
2
5
6#include <array>
7#include <string>
8
9namespace eve::procgen_editing {
10
13 double nodeSize = 0.13;
14 double handleSize = 0.10;
15 std::array<double, 4> lineColor{0.2, 0.85, 1.0, 1.0};
16 std::array<double, 4> textColor{1.0, 1.0, 1.0, 1.0};
17 bool showPointLabels = true;
18};
19
28
31public:
33 [[nodiscard]] editing::GizmoSnapshot build(const SplinePathDocument& document, int sampleCount = 64,
34 int maximumSamples = 4096, SplineGizmoStyle style = {}) const;
35};
36
43public:
45 explicit SplinePathDragSession(SplinePathDocument* document, int sampleCount = 64);
47 [[nodiscard]] Result<SplinePathDragPreview> beginDrag(double rayOriginX, double rayOriginY, double rayOriginZ,
48 double rayDirectionX, double rayDirectionY,
49 double rayDirectionZ);
51 [[nodiscard]] Result<SplinePathDragPreview> updateDrag(double rayOriginX, double rayOriginY,
52 double rayOriginZ, double rayDirectionX,
53 double rayDirectionY, double rayDirectionZ);
55 [[nodiscard]] Result<DomainOperation> finishDrag();
57 void cancelDrag();
59 [[nodiscard]] bool isDragging() const noexcept { return dragging_; }
61 [[nodiscard]] StableId activePoint() const { return activePoint_; }
63 [[nodiscard]] const std::string& activeHandle() const noexcept { return activeHandle_; }
64
65private:
66 [[nodiscard]] Result<SplinePathDragPreview> previewCurrent() const;
67 SplinePathDocument* document_ = nullptr;
68 int sampleCount_ = 64;
69 Revision baseRevision_ = 0;
70 StableId activePoint_;
71 std::string activeHandle_;
73 std::array<double, 3> dragPlanePoint_{0.0, 0.0, 0.0};
74 std::array<double, 3> dragPlaneNormal_{0.0, 0.0, 1.0};
75 bool dragging_ = false;
76};
77
78} // namespace eve::procgen_editing
#define EVENGINE_API_ORCHESTRATION
Definition Export.h:111
Move-only operation result carrying either a value or Status.
Definition Result.h:155
UUID-backed identifier adapter for legacy textual boundaries.
Definition Identity.h:314
Owning spline authoring document with transactional operations and schema-versioned snapshots.
UI-neutral ray picking and transient drag state for a spline document. @ownership Borrows the documen...
StableId activePoint() const
Return the active stable point id, or empty when idle.
bool isDragging() const noexcept
Report whether a drag owns transient state.
const std::string & activeHandle() const noexcept
Return anchor, in, or out for the active handle.
Builds sampled path, anchor and Bezier handle overlay primitives.
std::uint64_t Revision
StatusCode
Stable outcome category for an operation.
Definition Status.h:27
Immutable revision-tagged overlay snapshot consumed by any viewport renderer.
Renderer-neutral appearance settings for spline viewport overlays.
Stable authoring control point for a 3D spline path.
Immutable renderer-neutral spline drag preview.