载入中...
搜索中...
未找到
eve::building::PlacementSession类 参考

EVENGINE_API_WORLD public API. 更多...

#include <PlacementSession.h>

Public 成员函数

 PlacementSession ()
 Placement session.
 
 ~PlacementSession ()=default
 Placement session.
 
 PlacementSession (const PlacementSession &)=delete
 
PlacementSession & operator= (const PlacementSession &)=delete
 
void destroy ()
 Destroys .
 
bool startPlacement (PlacementWorld *world, const std::string &buildingId)
 Starts placement.
 
void stopPlacement ()
 Stops placement.
 
bool isActive () const
 True when active.
 
PlacementWorld * getWorld () const
 Returns the world.
 
std::string getBuildingId () const
 Returns the building id.
 
Ghost * getGhost () const
 Returns the ghost.
 
void setMode (const std::string &mode)
 Sets the mode.
 
std::string getMode () const
 Returns the mode.
 
void setRotationDeg (float deg)
 Sets the rotation deg.
 
void rotateBy (float deltaDeg)
 Rotate by.
 
float getRotationDeg () const
 Returns the rotation deg.
 
bool updateFromWorld (PlacementWorld *world, float worldX, float worldY)
 Updates from world.
 
bool updateFromWorld3D (PlacementWorld *world, float worldX, float worldY, float worldZ)
 Updates from world 3 d.
 
bool updateFromSurface (PlacementWorld *world, const std::string &surface, float x, float y)
 Updates from surface.
 
EdgeUpdateStatus updateEdge (PlacementWorld *world, int cellX, int cellY, const std::string &direction)
 Refresh an edge-object ghost from a cell-relative cardinal edge.
 
CornerUpdateStatus updateCorner (PlacementWorld *world, int vertexX, int vertexY)
 Refresh a corner-object ghost at a canonical grid vertex.
 
FreeUpdateStatus updateFree (PlacementWorld *world, float worldX, float worldY, float elevation=0.f)
 Refresh a free-object ghost at an exact world-plane position.
 
bool isValid () const
 True when valid.
 
std::string getReason () const
 Returns the reason.
 
int execute ()
 Execute.
 
EdgeLineExecuteStatus executeEdgeLine (int startVertexX, int startVertexY, int endVertexX, int endVertexY)
 Atomically place an axis-aligned edge line between logical vertices.
 
EdgePathUpdateStatus beginEdgePath (int vertexX, int vertexY)
 Start a multi-segment edge path at one logical grid vertex.
 
EdgePathUpdateStatus appendEdgePathVertex (int vertexX, int vertexY)
 Append one orthogonally connected logical vertex to the current edge path.
 
EdgeLineExecuteStatus executeEdgePath ()
 Atomically commit the complete edge path.
 
int getEdgePathVertexCount () const
 Number of logical vertices in the current edge path.
 
EdgePathUpdateStatus beginEdgeCurve (float x, float y)
 Begin authoring four cubic Bezier controls in logical grid space.
 
EdgePathUpdateStatus appendEdgeCurveControlPoint (float x, float y)
 Append a cubic Bezier control point; exactly four controls are accepted.
 
EdgeLineExecuteStatus executeEdgeCurve (int subdivisions)
 Sample and atomically commit the authored cubic Bezier curve.
 
EdgeLineExecuteStatus executeEdgeCurveOnSurface (int subdivisions, const std::string &surfaceName)
 Sample a named custom surface and atomically commit the authored curve.
 
int getEdgeCurveControlPointCount () const
 Number of currently authored cubic Bezier control points.
 
const std::vector< PlacementSystem::EdgeCurvePoint > & edgeCurveControlPoints () const
 Borrow the authored controls for same-frame presentation adapters.
 
int getLastPlacedCount () const
 Number of ids committed by the last successful edge-line operation.
 
int getLastPlacedId (int index) const
 Instance id from the last successful edge-line operation, or zero.
 
PlacementEditExecuteStatus executeMove (int instanceId)
 Move an existing instance to the current domain-specific ghost pose atomically.
 
PlacementEditExecuteStatus executeReplace (int instanceId)
 Replace an existing instance with the selected definition atomically.
 
int getLastEditedId () const
 Instance id affected by the last successful move/replace, or zero.
 
AreaExecuteStatus previewRectangle (int minCellX, int minCellY, int maxCellX, int maxCellY)
 Cache a non-mutating inclusive rectangular preview for UI/BuildingFX.
 
AreaExecuteStatus previewBrush (int centerCellX, int centerCellY, int radius)
 Cache a non-mutating circular cell brush preview.
 
AreaExecuteStatus executeRectangle (int minCellX, int minCellY, int maxCellX, int maxCellY)
 Atomically place an inclusive rectangle using the selected definition.
 
AreaExecuteStatus executeBrush (int centerCellX, int centerCellY, int radius)
 Atomically place a circular brush using the selected definition.
 
int getAreaPreviewCount () const
 Number of cells in the last successful preview.
 
int getAreaPreviewCellX (int index) const
 Returns the area preview cell x.
 
int getAreaPreviewCellY (int index) const
 Returns the area preview cell y.
 
bool getAreaPreviewAccepted (int index) const
 Returns the area preview accepted.
 
std::string getAreaPreviewReason (int index) const
 Returns the area preview reason.
 
PatternUpdateStatus beginPattern (const std::string &kind)
 Start a renderer-neutral built-in pattern request.
 
PatternUpdateStatus appendPatternPoint (float x, float y)
 Append one logical grid point/control to the current pattern.
 
PatternUpdateStatus setPatternRadius (int radius)
 Configure the circle radius used by circle_brush.
 
PatternUpdateStatus setPatternSubdivisions (int subdivisions)
 Configure analytic segments used by edge_cubic_bezier.
 
PatternUpdateStatus setPatternSurface (const std::string &surfaceName)
 Configure an optional named surface for edge_cubic_bezier.
 
PatternUpdateStatus previewPattern ()
 Expand and cache the complete pattern without world mutation.
 
PatternExecuteStatus executePattern ()
 Atomically commit the complete cached pattern request.
 
std::string getPatternKind () const
 Stable name of the currently authored pattern, or empty.
 
int getPatternPointCount () const
 Number of authoring points in the current pattern.
 
int getPatternPreviewCount () const
 Number of concrete edge/cell anchors in the last pattern preview.
 
int getPatternPreviewX (int index) const
 Logical x coordinate for one concrete preview anchor, or zero.
 
int getPatternPreviewY (int index) const
 Logical y coordinate for one concrete preview anchor, or zero.
 
std::string getPatternPreviewAxis (int index) const
 Edge axis for an edge preview anchor, or empty for area anchors.
 
bool getPatternPreviewAccepted (int index) const
 Whether one concrete preview anchor passed validation.
 
std::string getPatternPreviewReason (int index) const
 Stable rejection reason for an area anchor, or empty.
 

详细描述

EVENGINE_API_WORLD public API.

在文件 PlacementSession.h 第 38 行定义.

构造及析构函数说明

◆ PlacementSession() [1/2]

eve::building::PlacementSession::PlacementSession ( )

Placement session.

在文件 PlacementSession.cpp 第 75 行定义.

◆ ~PlacementSession()

eve::building::PlacementSession::~PlacementSession ( )
default

Placement session.

◆ PlacementSession() [2/2]

eve::building::PlacementSession::PlacementSession ( const PlacementSession &  )
delete

成员函数说明

◆ appendEdgeCurveControlPoint()

EdgePathUpdateStatus eve::building::PlacementSession::appendEdgeCurveControlPoint ( float  x,
float  y 
)

Append a cubic Bezier control point; exactly four controls are accepted.

在文件 PlacementSession.cpp 第 291 行定义.

引用了 x , 以及 y.

◆ appendEdgePathVertex()

EdgePathUpdateStatus eve::building::PlacementSession::appendEdgePathVertex ( int  vertexX,
int  vertexY 
)

Append one orthogonally connected logical vertex to the current edge path.

在文件 PlacementSession.cpp 第 255 行定义.

引用了 previous, eve::building::Rejected , 以及 eve::building::Updated.

◆ appendPatternPoint()

PatternUpdateStatus eve::building::PlacementSession::appendPatternPoint ( float  x,
float  y 
)

Append one logical grid point/control to the current pattern.

在文件 PlacementSession.cpp 第 471 行定义.

引用了 maximum, x , 以及 y.

◆ beginEdgeCurve()

EdgePathUpdateStatus eve::building::PlacementSession::beginEdgeCurve ( float  x,
float  y 
)

Begin authoring four cubic Bezier controls in logical grid space.

在文件 PlacementSession.cpp 第 280 行定义.

引用了 x , 以及 y.

◆ beginEdgePath()

EdgePathUpdateStatus eve::building::PlacementSession::beginEdgePath ( int  vertexX,
int  vertexY 
)

Start a multi-segment edge path at one logical grid vertex.

在文件 PlacementSession.cpp 第 245 行定义.

引用了 eve::building::BuildingRegistry::find(), eve::building::Ghost::getBuildingId(), eve::building::Rejected , 以及 eve::building::Updated.

◆ beginPattern()

PatternUpdateStatus eve::building::PlacementSession::beginPattern ( const std::string &  kind)

Start a renderer-neutral built-in pattern request.

参数
kindedge_line, edge_path, edge_cubic_bezier, rectangle_fill, rectangle_outline, or circle_brush.
返回
Updated when the kind is known and the session can author it.

在文件 PlacementSession.cpp 第 454 行定义.

引用了 kind.

◆ destroy()

void eve::building::PlacementSession::destroy ( )

Destroys .

在文件 PlacementSession.cpp 第 77 行定义.

引用了 eve::building::Ghost::destroy().

◆ edgeCurveControlPoints()

const std::vector< PlacementSystem::EdgeCurvePoint > & eve::building::PlacementSession::edgeCurveControlPoints ( ) const
inline

Borrow the authored controls for same-frame presentation adapters.

在文件 PlacementSession.h 第 138 行定义.

◆ execute()

◆ executeBrush()

AreaExecuteStatus eve::building::PlacementSession::executeBrush ( int  centerCellX,
int  centerCellY,
int  radius 
)

Atomically place a circular brush using the selected definition.

在文件 PlacementSession.cpp 第 424 行定义.

引用了 eve::building::PlacementSystem::PatternRequest::kind, radius , 以及 request.

◆ executeEdgeCurve()

EdgeLineExecuteStatus eve::building::PlacementSession::executeEdgeCurve ( int  subdivisions)

Sample and atomically commit the authored cubic Bezier curve.

在文件 PlacementSession.cpp 第 299 行定义.

引用了 eve::building::PlacementSystem::PatternRequest::kind , 以及 request.

◆ executeEdgeCurveOnSurface()

EdgeLineExecuteStatus eve::building::PlacementSession::executeEdgeCurveOnSurface ( int  subdivisions,
const std::string &  surfaceName 
)

Sample a named custom surface and atomically commit the authored curve.

参数
subdivisionsAnalytic curve segment count in the supported placement range.
surfaceNameRegistered surface provider sampled for every curve frame.
返回
Placed only after both edge occupancy and every surface sample validate. @thread Caller-thread only; the session and world are borrowed for the call.

在文件 PlacementSession.cpp 第 315 行定义.

引用了 eve::building::PlacementSystem::PatternRequest::kind , 以及 request.

◆ executeEdgeLine()

EdgeLineExecuteStatus eve::building::PlacementSession::executeEdgeLine ( int  startVertexX,
int  startVertexY,
int  endVertexX,
int  endVertexY 
)

◆ executeEdgePath()

EdgeLineExecuteStatus eve::building::PlacementSession::executeEdgePath ( )

◆ executeMove()

PlacementEditExecuteStatus eve::building::PlacementSession::executeMove ( int  instanceId)

Move an existing instance to the current domain-specific ghost pose atomically.

在文件 PlacementSession.cpp 第 338 行定义.

引用了 eve::Result< T >::ok().

◆ executePattern()

PatternExecuteStatus eve::building::PlacementSession::executePattern ( )

Atomically commit the complete cached pattern request.

在文件 PlacementSession.cpp 第 526 行定义.

引用了 placed.

◆ executeRectangle()

AreaExecuteStatus eve::building::PlacementSession::executeRectangle ( int  minCellX,
int  minCellY,
int  maxCellX,
int  maxCellY 
)

Atomically place an inclusive rectangle using the selected definition.

在文件 PlacementSession.cpp 第 407 行定义.

引用了 eve::building::PlacementSystem::PatternRequest::kind , 以及 request.

◆ executeReplace()

PlacementEditExecuteStatus eve::building::PlacementSession::executeReplace ( int  instanceId)

Replace an existing instance with the selected definition atomically.

在文件 PlacementSession.cpp 第 365 行定义.

◆ getAreaPreviewAccepted()

bool eve::building::PlacementSession::getAreaPreviewAccepted ( int  index) const

Returns the area preview accepted.

在文件 PlacementSession.cpp 第 446 行定义.

引用了 index.

◆ getAreaPreviewCellX()

int eve::building::PlacementSession::getAreaPreviewCellX ( int  index) const

Returns the area preview cell x.

在文件 PlacementSession.cpp 第 440 行定义.

引用了 index.

◆ getAreaPreviewCellY()

int eve::building::PlacementSession::getAreaPreviewCellY ( int  index) const

Returns the area preview cell y.

在文件 PlacementSession.cpp 第 443 行定义.

引用了 index.

◆ getAreaPreviewCount()

int eve::building::PlacementSession::getAreaPreviewCount ( ) const
inline

Number of cells in the last successful preview.

在文件 PlacementSession.h 第 160 行定义.

◆ getAreaPreviewReason()

std::string eve::building::PlacementSession::getAreaPreviewReason ( int  index) const

Returns the area preview reason.

在文件 PlacementSession.cpp 第 449 行定义.

引用了 index.

◆ getBuildingId()

std::string eve::building::PlacementSession::getBuildingId ( ) const

Returns the building id.

在文件 PlacementSession.cpp 第 110 行定义.

引用了 eve::building::Ghost::getBuildingId().

◆ getEdgeCurveControlPointCount()

int eve::building::PlacementSession::getEdgeCurveControlPointCount ( ) const
inline

Number of currently authored cubic Bezier control points.

在文件 PlacementSession.h 第 134 行定义.

◆ getEdgePathVertexCount()

int eve::building::PlacementSession::getEdgePathVertexCount ( ) const
inline

Number of logical vertices in the current edge path.

在文件 PlacementSession.h 第 117 行定义.

◆ getGhost()

Ghost * eve::building::PlacementSession::getGhost ( ) const
inline

Returns the ghost.

在文件 PlacementSession.h 第 62 行定义.

◆ getLastEditedId()

int eve::building::PlacementSession::getLastEditedId ( ) const
inline

Instance id affected by the last successful move/replace, or zero.

在文件 PlacementSession.h 第 150 行定义.

◆ getLastPlacedCount()

int eve::building::PlacementSession::getLastPlacedCount ( ) const
inline

Number of ids committed by the last successful edge-line operation.

在文件 PlacementSession.h 第 142 行定义.

◆ getLastPlacedId()

int eve::building::PlacementSession::getLastPlacedId ( int  index) const

Instance id from the last successful edge-line operation, or zero.

在文件 PlacementSession.cpp 第 333 行定义.

引用了 index.

◆ getMode()

std::string eve::building::PlacementSession::getMode ( ) const
inline

Returns the mode.

在文件 PlacementSession.h 第 68 行定义.

◆ getPatternKind()

std::string eve::building::PlacementSession::getPatternKind ( ) const

Stable name of the currently authored pattern, or empty.

在文件 PlacementSession.cpp 第 541 行定义.

◆ getPatternPointCount()

int eve::building::PlacementSession::getPatternPointCount ( ) const
inline

Number of authoring points in the current pattern.

在文件 PlacementSession.h 第 192 行定义.

◆ getPatternPreviewAccepted()

bool eve::building::PlacementSession::getPatternPreviewAccepted ( int  index) const

Whether one concrete preview anchor passed validation.

在文件 PlacementSession.cpp 第 569 行定义.

引用了 index.

◆ getPatternPreviewAxis()

std::string eve::building::PlacementSession::getPatternPreviewAxis ( int  index) const

Edge axis for an edge preview anchor, or empty for area anchors.

在文件 PlacementSession.cpp 第 559 行定义.

引用了 index.

◆ getPatternPreviewCount()

int eve::building::PlacementSession::getPatternPreviewCount ( ) const
inline

Number of concrete edge/cell anchors in the last pattern preview.

在文件 PlacementSession.h 第 196 行定义.

◆ getPatternPreviewReason()

std::string eve::building::PlacementSession::getPatternPreviewReason ( int  index) const

Stable rejection reason for an area anchor, or empty.

在文件 PlacementSession.cpp 第 575 行定义.

引用了 index.

◆ getPatternPreviewX()

int eve::building::PlacementSession::getPatternPreviewX ( int  index) const

Logical x coordinate for one concrete preview anchor, or zero.

在文件 PlacementSession.cpp 第 545 行定义.

引用了 index , 以及 x.

◆ getPatternPreviewY()

int eve::building::PlacementSession::getPatternPreviewY ( int  index) const

Logical y coordinate for one concrete preview anchor, or zero.

在文件 PlacementSession.cpp 第 552 行定义.

引用了 index , 以及 y.

◆ getReason()

std::string eve::building::PlacementSession::getReason ( ) const

Returns the reason.

在文件 PlacementSession.cpp 第 195 行定义.

引用了 eve::building::Ghost::getReason().

◆ getRotationDeg()

float eve::building::PlacementSession::getRotationDeg ( ) const

Returns the rotation deg.

在文件 PlacementSession.cpp 第 130 行定义.

引用了 eve::building::Ghost::getRotationDeg().

◆ getWorld()

PlacementWorld * eve::building::PlacementSession::getWorld ( ) const
inline

Returns the world.

在文件 PlacementSession.h 第 58 行定义.

◆ isActive()

bool eve::building::PlacementSession::isActive ( ) const
inline

True when active.

在文件 PlacementSession.h 第 56 行定义.

◆ isValid()

bool eve::building::PlacementSession::isValid ( ) const

True when valid.

在文件 PlacementSession.cpp 第 193 行定义.

引用了 eve::building::Ghost::isValid().

◆ operator=()

PlacementSession & eve::building::PlacementSession::operator= ( const PlacementSession &  )
delete

◆ previewBrush()

AreaExecuteStatus eve::building::PlacementSession::previewBrush ( int  centerCellX,
int  centerCellY,
int  radius 
)

Cache a non-mutating circular cell brush preview.

在文件 PlacementSession.cpp 第 392 行定义.

引用了 eve::building::PlacementSystem::PatternRequest::kind, radius , 以及 request.

◆ previewPattern()

PatternUpdateStatus eve::building::PlacementSession::previewPattern ( )

Expand and cache the complete pattern without world mutation.

在文件 PlacementSession.cpp 第 510 行定义.

◆ previewRectangle()

AreaExecuteStatus eve::building::PlacementSession::previewRectangle ( int  minCellX,
int  minCellY,
int  maxCellX,
int  maxCellY 
)

Cache a non-mutating inclusive rectangular preview for UI/BuildingFX.

在文件 PlacementSession.cpp 第 376 行定义.

引用了 eve::building::PlacementSystem::PatternRequest::kind , 以及 request.

◆ rotateBy()

void eve::building::PlacementSession::rotateBy ( float  deltaDeg)

Rotate by.

在文件 PlacementSession.cpp 第 126 行定义.

引用了 eve::building::Ghost::rotateBy().

◆ setMode()

void eve::building::PlacementSession::setMode ( const std::string &  mode)

Sets the mode.

交互模式:"place" 放置 / "remove" 拆除(默认 place)。

在文件 PlacementSession.cpp 第 114 行定义.

◆ setPatternRadius()

PatternUpdateStatus eve::building::PlacementSession::setPatternRadius ( int  radius)

Configure the circle radius used by circle_brush.

在文件 PlacementSession.cpp 第 490 行定义.

引用了 radius.

◆ setPatternSubdivisions()

PatternUpdateStatus eve::building::PlacementSession::setPatternSubdivisions ( int  subdivisions)

Configure analytic segments used by edge_cubic_bezier.

在文件 PlacementSession.cpp 第 496 行定义.

◆ setPatternSurface()

PatternUpdateStatus eve::building::PlacementSession::setPatternSurface ( const std::string &  surfaceName)

Configure an optional named surface for edge_cubic_bezier.

在文件 PlacementSession.cpp 第 502 行定义.

◆ setRotationDeg()

void eve::building::PlacementSession::setRotationDeg ( float  deg)

Sets the rotation deg.

在文件 PlacementSession.cpp 第 122 行定义.

引用了 eve::building::Ghost::setRotationDeg().

◆ startPlacement()

bool eve::building::PlacementSession::startPlacement ( PlacementWorld *  world,
const std::string &  buildingId 
)

Starts placement.

在文件 PlacementSession.cpp 第 83 行定义.

引用了 eve::building::Ghost::setBuildingId() , 以及 world.

◆ stopPlacement()

void eve::building::PlacementSession::stopPlacement ( )

Stops placement.

在文件 PlacementSession.cpp 第 100 行定义.

◆ updateCorner()

CornerUpdateStatus eve::building::PlacementSession::updateCorner ( PlacementWorld *  world,
int  vertexX,
int  vertexY 
)

Refresh a corner-object ghost at a canonical grid vertex.

在文件 PlacementSession.cpp 第 173 行定义.

引用了 eve::building::Ghost::isValid(), eve::building::Rejected, eve::building::Ghost::setCorner(), eve::building::Updated , 以及 world.

◆ updateEdge()

EdgeUpdateStatus eve::building::PlacementSession::updateEdge ( PlacementWorld *  world,
int  cellX,
int  cellY,
const std::string &  direction 
)

Refresh an edge-object ghost from a cell-relative cardinal edge.

在文件 PlacementSession.cpp 第 163 行定义.

引用了 direction, eve::building::Ghost::isValid(), eve::building::Rejected, eve::building::Ghost::setEdge(), eve::building::Updated , 以及 world.

◆ updateFree()

FreeUpdateStatus eve::building::PlacementSession::updateFree ( PlacementWorld *  world,
float  worldX,
float  worldY,
float  elevation = 0.f 
)

Refresh a free-object ghost at an exact world-plane position.

在文件 PlacementSession.cpp 第 183 行定义.

引用了 elevation, eve::building::Ghost::isValid(), eve::building::Rejected, eve::building::Ghost::setFree(), eve::building::Updated , 以及 world.

◆ updateFromSurface()

bool eve::building::PlacementSession::updateFromSurface ( PlacementWorld *  world,
const std::string &  surface,
float  x,
float  y 
)

Updates from surface.

通过注册表面(如 "plane")刷新鬼影并校验。

在文件 PlacementSession.cpp 第 153 行定义.

引用了 eve::building::Ghost::setFromSurface(), world, x , 以及 y.

◆ updateFromWorld()

bool eve::building::PlacementSession::updateFromWorld ( PlacementWorld *  world,
float  worldX,
float  worldY 
)

Updates from world.

2D:世界坐标刷新鬼影并校验。

在文件 PlacementSession.cpp 第 134 行定义.

引用了 eve::building::Ghost::setFromWorld() , 以及 world.

◆ updateFromWorld3D()

bool eve::building::PlacementSession::updateFromWorld3D ( PlacementWorld *  world,
float  worldX,
float  worldY,
float  worldZ 
)

Updates from world 3 d.

3D:真实世界坐标刷新鬼影并校验。

在文件 PlacementSession.cpp 第 143 行定义.

引用了 eve::building::Ghost::setFromWorld3D() , 以及 world.


该类的文档由以下文件生成: