载入中...
搜索中...
未找到
ProcgenPointSetApi.cpp
浏览该文件的文档.
36eve::Result<ProcgenPointSetHandleRef> Procgen::sampleGridHandle(int width, int depth, float spacing, uint32_t seed,
40 eve::DiagnosticCode::InvalidArgument, "sampleGrid requires positive dimensions and spacing", "pointSet", {},
46eve::Result<ProcgenPointSetHandleRef> Procgen::filterHeightHandle(ProcgenPointSetHandleRef input, float minHeight,
51 eve::Diagnostic::error(eve::DiagnosticCode::StaleHandle, "filterHeight input point-set handle is stale",
57eve::Result<ProcgenPointSetHandleRef> Procgen::filterDensityHandle(ProcgenPointSetHandleRef input, float minDensity,
62 eve::Diagnostic::error(eve::DiagnosticCode::StaleHandle, "filterDensity input point-set handle is stale",
68eve::Result<ProcgenPointSetHandleRef> Procgen::filterBoxHandle(ProcgenPointSetHandleRef input, float minX, float minY,
74 eve::Diagnostic::error(eve::DiagnosticCode::StaleHandle, "filterBox input point-set handle is stale",
80eve::Result<ProcgenPointSetHandleRef> Procgen::filterSlopeHandle(ProcgenPointSetHandleRef input, float minDegrees,
85 eve::Diagnostic::error(eve::DiagnosticCode::StaleHandle, "filterSlope input point-set handle is stale",
91eve::Result<ProcgenPointSetHandleRef> Procgen::filterPolygonHandle(ProcgenPointSetHandleRef input,
97 eve::DiagnosticCode::StaleHandle, "filterPolygon input handle is stale", "input", {}, "procgen.squirrel"));
102eve::Result<ProcgenPointSetHandleRef> Procgen::filterSplineDistanceHandle(ProcgenPointSetHandleRef input,
109 eve::Diagnostic::error(eve::DiagnosticCode::StaleHandle, "filterSplineDistance input handle is stale",
111 return ownProcgenObject(ownership_->points, std::make_unique<PointSet>(filterPointsBySplineDistance(
115eve::Result<ProcgenPointSetHandleRef> Procgen::excludeRadiusHandle(ProcgenPointSetHandleRef input, float x, float z,
120 eve::Diagnostic::error(eve::DiagnosticCode::StaleHandle, "excludeRadius input point-set handle is stale",
122 return ownProcgenObject(ownership_->points, std::make_unique<PointSet>(excludePointRadius(*view, x, z, radius)));
125eve::Result<ProcgenPointSetHandleRef> Procgen::jitterPointsHandle(ProcgenPointSetHandleRef input, uint32_t seed,
130 eve::Diagnostic::error(eve::DiagnosticCode::StaleHandle, "jitterPoints input point-set handle is stale",
136eve::Result<ProcgenPointSetHandleRef> Procgen::selfPruneHandle(ProcgenPointSetHandleRef input, float radius) {
140 eve::Diagnostic::error(eve::DiagnosticCode::StaleHandle, "selfPrune input point-set handle is stale",
142 return ownProcgenObject(ownership_->points, std::make_unique<PointSet>(selfPrunePoints(*view, radius)));
145eve::Result<ProcgenPointSetHandleRef> Procgen::projectToHeightmapHandle(ProcgenPointSetHandleRef input,
153 eve::Diagnostic::error(eve::DiagnosticCode::StaleHandle, "projectToHeightmap input handle is stale",
157 eve::Diagnostic::error(eve::DiagnosticCode::InvalidArgument, "projectToHeightmap cellSize must be positive",
159 return ownProcgenObject(ownership_->points, std::make_unique<PointSet>(projectPointsToHeightmap(
163eve::Result<ProcgenPointSetHandleRef> Procgen::sampleSplineHandle(ProcgenPointSetHandleRef controlPoints, float spacing,
168 eve::Diagnostic::error(eve::DiagnosticCode::StaleHandle, "sampleSpline control point-set handle is stale",
172 eve::Diagnostic::error(eve::DiagnosticCode::InvalidArgument, "sampleSpline spacing must be positive",
184 eve::DiagnosticCode::StaleHandle, "mergePoints input handle is stale", "points", {}, "procgen.squirrel"));
185 return ownProcgenObject(ownership_->points, std::make_unique<PointSet>(mergePointSets(*a, *b)));
194 eve::Diagnostic::error(eve::DiagnosticCode::StaleHandle, "unionPoints requires live point sets", "points",
196 return ownProcgenObject(ownership_->points, std::make_unique<PointSet>(unionPointSets(*a, *b)));
199eve::Result<ProcgenPointSetHandleRef> Procgen::intersectPointsHandle(ProcgenPointSetHandleRef first,
205 eve::Diagnostic::error(eve::DiagnosticCode::StaleHandle, "intersectPoints requires live point sets",
207 return ownProcgenObject(ownership_->points, std::make_unique<PointSet>(intersectPointSets(*a, *b)));
210eve::Result<ProcgenPointSetHandleRef> Procgen::differencePointsHandle(ProcgenPointSetHandleRef first,
216 eve::Diagnostic::error(eve::DiagnosticCode::StaleHandle, "differencePoints requires live point sets",
218 return ownProcgenObject(ownership_->points, std::make_unique<PointSet>(differencePointSets(*a, *b)));
221eve::Result<ProcgenPointSetHandleRef> Procgen::transformPointsHandle(ProcgenPointSetHandleRef input, float translateX,
228 eve::Diagnostic::error(eve::DiagnosticCode::StaleHandle, "transformPoints input handle is stale", "input",
235eve::Result<ProcgenPointSetHandleRef> Procgen::transformPoints3DHandle(ProcgenPointSetHandleRef input, float translateX,
243 eve::Diagnostic::error(eve::DiagnosticCode::StaleHandle, "transformPoints3D input handle is stale", "input",
257 eve::DiagnosticCode::StaleHandle, "copyPoints requires live point sets", "points", {}, "procgen.squirrel"));
262eve::Result<ProcgenPointSetHandleRef> Procgen::remapDensityHandle(ProcgenPointSetHandleRef input, float inputMin,
268 eve::Diagnostic::error(eve::DiagnosticCode::StaleHandle, "remapDensity point-set handle is stale", "points",
270 if (!std::isfinite(inputMin) || !std::isfinite(inputMax) || inputMin == inputMax || !std::isfinite(outputMin) ||
273 eve::DiagnosticCode::InvalidArgument, "remapDensity requires finite non-zero input range", "inputRange", {},
279eve::Result<ProcgenPointSetHandleRef> Procgen::mathFloatAttributeHandle(ProcgenPointSetHandleRef input,
287 eve::Diagnostic::error(eve::DiagnosticCode::StaleHandle, "mathFloatAttribute point-set handle is stale",
302eve::Result<ProcgenPointSetHandleRef> Procgen::filterFloatAttributeHandle(ProcgenPointSetHandleRef input,
309 "filterFloatAttribute requires a live input and attribute name", "input", {}, "procgen.squirrel"));
310 return ownProcgenObject(ownership_->points, std::make_unique<PointSet>(filterPointFloatAttribute(
314eve::Result<ProcgenPointSetHandleRef> Procgen::filterStringAttributeHandle(ProcgenPointSetHandleRef input,
327 ProcgenPointSetHandleRef input, ProcgenGridHandleRef mask, float originX, float originZ, float cellSize,
338 auto filtered = excludePointsByGridMask(*points, *grid, originX, originZ, cellSize, semantic, clearance,
341 return ownProcgenObject(ownership_->points, std::make_unique<PointSet>(std::move(filtered).takeValue()));
344eve::Result<ProcgenPointSetHandleRef> Procgen::densityCullHandle(ProcgenPointSetHandleRef input, uint32_t seed,
349 eve::DiagnosticCode::StaleHandle, "densityCull input handle is stale", "input", {}, "procgen.squirrel"));
350 return ownProcgenObject(ownership_->points, std::make_unique<PointSet>(densityCullPoints(*view, seed, multiplier)));
353eve::Result<ProcgenPointSetHandleRef> Procgen::projectToWorldHandle(ProcgenPointSetHandleRef input, float maxY,
359 eve::Diagnostic::error(eve::DiagnosticCode::StaleHandle, "projectToWorld point-set handle is stale",
363 eve::Diagnostic::error(eve::DiagnosticCode::InvalidArgument, "projectToWorld requires finite maxY >= minY",
368 eve::DiagnosticCode::Unsupported, "projectToWorld requires an IProcgenWorldQuery provider", "worldQuery",
378 eve::Diagnostic::error(eve::DiagnosticCode::Failed, "world-query provider failed to execute projection",
383 std::move(output.appendPointFrom(*points, sourceIndex)).expect("projectToWorld attribute schema");
394 std::move(output.appendPointFrom(*points, sourceIndex)).expect("projectToWorld attribute schema");
401eve::Result<ProcgenPointSetHandleRef> Procgen::poissonDiskHandle(int width, int depth, float radius, uint32_t seed,
The single Squirrel projection for common Result, Status and Value.
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.cpp:21
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:196
void reserve(std::size_t count)
Reserve point storage without changing point or attribute row counts.
Definition PointSet.cpp:61
eve::Result< ProcgenPointSetHandleRef > excludeRadiusHandle(ProcgenPointSetHandleRef input, float x, float z, float radius)
Exclude radius handle.
Definition ProcgenPointSetApi.cpp:115
eve::Result< ProcgenPointSetHandleRef > filterDensityHandle(ProcgenPointSetHandleRef input, float minDensity, float maxDensity)
Filter density handle.
Definition ProcgenPointSetApi.cpp:57
eve::Result< ProcgenPointSetHandleRef > poissonDiskHandle(int width, int depth, float radius, uint32_t seed, int maxPoints)
Poisson disk handle.
Definition ProcgenPointSetApi.cpp:401
eve::Result< ProcgenPointSetHandleRef > mergePointsHandle(ProcgenPointSetHandleRef first, ProcgenPointSetHandleRef second)
Merge points handle.
Definition ProcgenPointSetApi.cpp:178
static eve::script::Borrowed< Params > resolve(ProcgenParamsHandleRef reference) noexcept
Resolves parameters as a non-owning observation.
Definition ProcgenHandles.cpp:39
eve::Result< ProcgenPointSetHandleRef > filterHeightHandle(ProcgenPointSetHandleRef input, float minHeight, float maxHeight)
Filter height handle.
Definition ProcgenPointSetApi.cpp:46
eve::Result< ProcgenPointSetHandleRef > sampleGridHandle(int width, int depth, float spacing, uint32_t seed, float jitter)
Definition ProcgenPointSetApi.cpp:36
eve::Result< ProcgenPointSetHandleRef > filterStringAttributeHandle(ProcgenPointSetHandleRef input, const std::string &name, const std::string &value, bool invert)
Filter string attribute handle.
Definition ProcgenPointSetApi.cpp:314
eve::Result< ProcgenPointSetHandleRef > densityCullHandle(ProcgenPointSetHandleRef input, uint32_t seed, float multiplier)
Density cull handle.
Definition ProcgenPointSetApi.cpp:344
eve::Result< ProcgenPointSetHandleRef > selfPruneHandle(ProcgenPointSetHandleRef input, float radius)
Self prune handle.
Definition ProcgenPointSetApi.cpp:136
eve::Result< ProcgenPointSetHandleRef > filterSplineDistanceHandle(ProcgenPointSetHandleRef input, ProcgenPointSetHandleRef controlPoints, float minDistance, float maxDistance)
Filter spline distance handle.
Definition ProcgenPointSetApi.cpp:102
eve::Result< ProcgenPointSetHandleRef > sampleSplineHandle(ProcgenPointSetHandleRef controlPoints, float spacing, uint32_t seed, float lateralJitter)
Sample spline handle.
Definition ProcgenPointSetApi.cpp:163
eve::Result< ProcgenPointSetHandleRef > unionPointsHandle(ProcgenPointSetHandleRef first, ProcgenPointSetHandleRef second)
Union points handle.
Definition ProcgenPointSetApi.cpp:188
eve::Result< ProcgenPointSetHandleRef > filterSlopeHandle(ProcgenPointSetHandleRef input, float minDegrees, float maxDegrees)
Filter slope handle.
Definition ProcgenPointSetApi.cpp:80
eve::Result< ProcgenPointSetHandleRef > transformPointsHandle(ProcgenPointSetHandleRef input, float translateX, float translateY, float translateZ, float yawDegrees, float scaleX, float scaleY, float scaleZ)
Transform points handle.
Definition ProcgenPointSetApi.cpp:221
eve::Result< ProcgenPointSetHandleRef > filterPolygonHandle(ProcgenPointSetHandleRef input, ProcgenPointSetHandleRef polygon, bool invert=false)
Filter polygon handle.
Definition ProcgenPointSetApi.cpp:91
eve::Result< ProcgenPointSetHandleRef > copyPointsHandle(ProcgenPointSetHandleRef source, ProcgenPointSetHandleRef targets, bool inheritTargetAttributes)
Copies points handle.
Definition ProcgenPointSetApi.cpp:250
eve::script::Borrowed< PointSet > resolvePointSet(ProcgenPointSetHandleRef reference) noexcept
Resolves a point set as a borrowed view.
Definition ProcgenHandles.cpp:116
eve::Result< ProcgenPointSetHandleRef > excludeGridMaskHandle(ProcgenPointSetHandleRef input, ProcgenGridHandleRef mask, float originX, float originZ, float cellSize, int semantic, float clearance, int maximumChecks)
Filter owned points against an owned semantic grid mask with a bounded clearance search.
Definition ProcgenPointSetApi.cpp:326
eve::Result< ProcgenPointSetHandleRef > projectToWorldHandle(ProcgenPointSetHandleRef input, float maxY, float minY, std::uint64_t maskBits, bool keepUnmatched)
Project points through the optional world-query capability.
Definition ProcgenPointSetApi.cpp:353
eve::Result< ProcgenPointSetHandleRef > intersectPointsHandle(ProcgenPointSetHandleRef first, ProcgenPointSetHandleRef second)
Intersect points handle.
Definition ProcgenPointSetApi.cpp:199
eve::Result< ProcgenPointSetHandleRef > jitterPointsHandle(ProcgenPointSetHandleRef input, uint32_t seed, float amountX, float amountZ)
Jitter points handle.
Definition ProcgenPointSetApi.cpp:125
eve::script::Borrowed< Heightmap > resolveHeightmap(ProcgenHeightmapHandleRef) noexcept
Definition Procgen.cpp:1482
eve::Result< ProcgenPointSetHandleRef > differencePointsHandle(ProcgenPointSetHandleRef first, ProcgenPointSetHandleRef second)
Difference points handle.
Definition ProcgenPointSetApi.cpp:210
eve::Result< ProcgenPointSetHandleRef > remapDensityHandle(ProcgenPointSetHandleRef input, float inputMin, float inputMax, float outputMin, float outputMax, bool clampOutput)
Remap density handle.
Definition ProcgenPointSetApi.cpp:262
eve::Result< ProcgenPointSetHandleRef > transformPoints3DHandle(ProcgenPointSetHandleRef input, float translateX, float translateY, float translateZ, float pitchDegrees, float yawDegrees, float rollDegrees, float scaleX, float scaleY, float scaleZ)
Transform points 3 d handle.
Definition ProcgenPointSetApi.cpp:235
eve::Result< ProcgenPointSetHandleRef > projectToHeightmapHandle(ProcgenPointSetHandleRef input, ProcgenHeightmapHandleRef heightmap, float originX, float originZ, float cellSize, float heightScale)
Project to heightmap handle.
Definition ProcgenPointSetApi.cpp:145
eve::Result< ProcgenPointSetHandleRef > mathFloatAttributeHandle(ProcgenPointSetHandleRef input, const std::string &attribute, const std::string &outputAttribute, const std::string &operation, float operand, float defaultValue)
Math float attribute handle.
Definition ProcgenPointSetApi.cpp:279
eve::Result< ProcgenPointSetHandleRef > filterFloatAttributeHandle(ProcgenPointSetHandleRef input, const std::string &name, float minValue, float maxValue, bool invert)
Filter float attribute handle.
Definition ProcgenPointSetApi.cpp:302
eve::Result< ProcgenPointSetHandleRef > filterBoxHandle(ProcgenPointSetHandleRef input, float minX, float minY, float minZ, float maxX, float maxY, float maxZ, bool invert=false)
Filter box handle.
Definition ProcgenPointSetApi.cpp:68
Definition EvpackPointGraphLoader.h:12
PointSet samplePolylinePoints(const PointSet &controlPoints, float spacing, uint32_t seed, float lateralJitter)
Sample polyline points.
Definition PointSet.cpp:761
PointSet transformPointSet3D(const PointSet &input, float translateX, float translateY, float translateZ, float pitchDegrees, float yawDegrees, float rollDegrees, float scaleX, float scaleY, float scaleZ)
Apply translation, pitch/yaw/roll rotation and non-uniform scale.
Definition PointSet.cpp:895
PointSet filterPointStringAttribute(const PointSet &input, const std::string &name, const std::string &value, bool invert)
Select points whose named string attribute equals a value.
Definition PointSet.cpp:1051
PointSet unionPointSets(const PointSet &first, const PointSet &second)
Stable union by non-zero point id, with legacy position-and-seed fallback.
Definition PointSet.cpp:856
PointSet transformPointSet(const PointSet &input, float translateX, float translateY, float translateZ, float yawDegrees, float scaleX, float scaleY, float scaleZ)
Apply translation, yaw rotation and non-uniform scale to points and their transforms.
Definition PointSet.cpp:890
PointSet filterPointsByPolygon(const PointSet &input, const PointSet &polygon, bool invert)
Filter points by polygon.
Definition PointSet.cpp:642
PointSet filterPointBox(const PointSet &input, float minX, float minY, float minZ, float maxX, float maxY, float maxZ, bool invert)
Filter point box.
Definition PointSet.cpp:610
PointSet filterPointSlope(const PointSet &input, float minDegrees, float maxDegrees)
Filter point slope.
Definition PointSet.cpp:625
PointSet projectPointsToHeightmap(const PointSet &input, const Heightmap &heightmap, float originX, float originZ, float cellSize, float heightScale)
Project points to heightmap.
Definition PointSetHeightmapAdapter.cpp:8
PointSet mathPointFloatAttribute(const PointSet &input, const std::string &attribute, const std::string &outputAttribute, const std::string &operation, float operand, float defaultValue)
Apply one scalar operation to a float metadata attribute or $ selector.
Definition PointSetAttributeOps.cpp:275
PointSet poissonDiskPoints(int width, int depth, float radius, uint32_t seed, int maxPoints)
Bridson blue-noise (Poisson disk) samples in a width x depth area (XZ, y=0).
Definition PointSet.cpp:506
PointSet filterPointsBySplineDistance(const PointSet &input, const PointSet &controlPoints, float minDistance, float maxDistance)
Filter points by spline distance.
Definition PointSet.cpp:653
EVENGINE_API_DOMAINS PointSet filterPointFloatAttribute(const PointSet &input, const std::string &name, float minValue, float maxValue, bool invert)
Select points whose named float attribute or $ selector lies in an inclusive range.
Definition PointSetAttributeOps.cpp:300
PointSet excludePointRadius(const PointSet &input, float x, float z, float radius)
Exclude point radius.
Definition PointSet.cpp:674
PointSet intersectPointSets(const PointSet &first, const PointSet &second)
Keep first-set points whose stable or legacy identity occurs in the second set.
Definition PointSet.cpp:868
eve::Result< eve::script::RuntimeHandleRef< Tag > > ownProcgenObject(eve::script::RuntimeObjectRegistry< T, Tag > ®istry, eve::script::Owned< T > object)
Definition ProcgenScriptSupport.h:221
PointSet mergePointSets(const PointSet &first, const PointSet &second)
Concatenate two attributed point collections while preserving order.
Definition PointSet.cpp:799
PointSet copyPointsToTargets(const PointSet &source, const PointSet &targets, bool inheritTargetAttributes)
Instantiate source points relative to targets in stable target-major order.
Definition PointSet.cpp:930
PointSet filterPointDensity(const PointSet &input, float minDensity, float maxDensity)
Filter point density.
Definition PointSet.cpp:601
PointSet selfPrunePoints(const PointSet &input, float radius)
Self prune points.
Definition PointSet.cpp:741
PointSet filterPointHeight(const PointSet &input, float minHeight, float maxHeight)
Filter point height.
Definition PointSet.cpp:592
PointSet densityCullPoints(const PointSet &input, uint32_t seed, float multiplier)
Deterministically keep points according to density and a root seed.
Definition PointSet.cpp:1062
PointSet differencePointSets(const PointSet &first, const PointSet &second)
Remove first-set points whose stable or legacy identity occurs in the second set.
Definition PointSet.cpp:879
PointSet jitterPointPositions(const PointSet &input, uint32_t seed, float amountX, float amountZ)
Jitter point positions.
Definition PointSet.cpp:728
PointSet remapPointDensity(const PointSet &input, float inputMin, float inputMax, float outputMin, float outputMax, bool clampOutput)
Linearly remap point density between ranges with optional output clamping.
Definition PointSet.cpp:1037
PointSet sampleGridPoints(int width, int depth, float spacing, uint32_t seed, float jitter)
Sample grid points.
Definition PointSet.cpp:484
Result< PointSet > excludePointsByGridMask(const PointSet &input, const Grid2D &mask, float originX, float originZ, float cellSize, int semantic, float clearance, std::size_t maximumChecks)
Remove points covered by a semantic grid mask plus optional world-space clearance.
Definition PointSet.cpp:686
@ InvalidArgument
@ Unsupported
@ Failed
@ StaleHandle
One deterministic sample used by script-first procedural pipelines.
Definition PointSet.h:17
Handle plus owner-lifetime epoch for a non-ECS registry object.
Definition RuntimeBorrow.h:72