Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
Classes | Typedefs | Functions
Olympe::NodeGraphShared Namespace Reference

Classes

class  BehaviorTreeAdapter
 
class  BlueprintAdapter
 
class  BTDebugAdapter
 Adapter for visualizing BehaviorTree runtime using unified renderer. More...
 
class  BTGraphDocumentConverter
 Converts a BehaviorTreeAsset into an Olympe::NodeGraph for display in the NodeGraphPanel (Blueprint Editor pipeline). More...
 
class  CommandAdapter
 

Typedefs

using json = nlohmann::json
 

Functions

static NodeType MapBTToEditor (BTNodeType t)
 
ImVec2 ComputePinCenterScreen (int nodeId, const BTNodeLayout *layout, bool isOutput, float pinOffset, float headerHeight, float zoom)
 Compute the screen-space center position of a pin.
 
void DrawPinCircle (ImDrawList *drawList, const ImVec2 &center, float radius, ImU32 fillColor, ImU32 outlineColor, float outlineThickness)
 
void RenderNodeHeader (int nodeId, const NodeStyle &style, const char *icon, const std::string &title, bool isCurrentNode, float pulseTimer)
 
NodeType MapBTRegistryNameToEditor (const std::string &registryName)
 
void RenderNodeVisual (int nodeId, const std::string &title, NodeType editorType, float posX, float posY, float width, float height, bool isCurrentNode, float currentZoom, float pulseTimer, float pinRadius, float pinOutline, float pinHeaderHeight, std::unordered_set< uint32_t > &positionedNodes)
 
void RenderBTNode (const BTNode *node, const BTNodeLayout *layout, bool isCurrentNode, float currentZoom, float pulseTimer, const BTConfig &config, std::unordered_set< uint32_t > &positionedNodes)
 
void RenderBTNodeConnections (const BehaviorTreeAsset *tree, uint32_t activeNodeId)
 
void DrawPinCircle (ImDrawList *drawList, const ImVec2 &center, float radius, uint32_t color, uint32_t outlineColor, float outlineThickness)
 Draw a pin circle with outline.
 
json SerializeBehaviorTreeToJson (const BehaviorTreeAsset &tree, const BTGraphLayoutEngine *layoutEngine)
 

Typedef Documentation

◆ json

Definition at line 12 of file Serializer.h.

Function Documentation

◆ ComputePinCenterScreen()

ImVec2 Olympe::NodeGraphShared::ComputePinCenterScreen ( int  nodeId,
const BTNodeLayout layout,
bool  isOutput,
float  pinOffset,
float  headerHeight,
float  zoom 
)
inline

Compute the screen-space center position of a pin.

Calculates where a pin should be rendered on screen, accounting for:

  • Node screen position and dimensions
  • Pin type (input/output)
  • Header offset
  • Zoom level
Parameters
nodeIdThe ImNodes node ID
layoutThe node's layout information (optional, used for validation)
isOutputTrue for output pin (right side), false for input pin (left side)
pinOffsetHorizontal offset from node edge (from ImNodes::GetStyle().PinOffset)
headerHeightHeight of the node header in pixels (pins are positioned below header)
zoomCurrent zoom level (affects spacing)
Returns
ImVec2 The screen-space center position of the pin

Definition at line 14 of file NodeGraphShared.h.

References GetComponentTypeID_Static().

Referenced by RenderNodeVisual().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DrawPinCircle() [1/2]

void Olympe::NodeGraphShared::DrawPinCircle ( ImDrawList drawList,
const ImVec2 center,
float  radius,
ImU32  fillColor,
ImU32  outlineColor,
float  outlineThickness 
)
inline

Definition at line 34 of file NodeGraphShared.h.

References GetComponentTypeID_Static().

Referenced by RenderNodeVisual().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DrawPinCircle() [2/2]

void Olympe::NodeGraphShared::DrawPinCircle ( ImDrawList drawList,
const ImVec2 center,
float  radius,
uint32_t  color,
uint32_t  outlineColor,
float  outlineThickness 
)

Draw a pin circle with outline.

Renders a circular pin with two layers:

  • Outer circle (outline) for contrast
  • Inner circle (main color)
Parameters
drawListImGui draw list to render to
centerCenter position of the pin in screen space
radiusInner radius of the pin
colorInner circle color (RGBA)
outlineColorOutline color (RGBA)
outlineThicknessThickness of the outline in pixels

Definition at line 45 of file RenderHelpers.cpp.

References GetComponentTypeID_Static().

+ Here is the call graph for this function:

◆ MapBTRegistryNameToEditor()

NodeType Olympe::NodeGraphShared::MapBTRegistryNameToEditor ( const std::string &  registryName)
inline

◆ MapBTToEditor()

NodeType Olympe::NodeGraphShared::MapBTToEditor ( BTNodeType  t)
inlinestatic

◆ RenderBTNode()

void Olympe::NodeGraphShared::RenderBTNode ( const BTNode node,
const BTNodeLayout layout,
bool  isCurrentNode,
float  currentZoom,
float  pulseTimer,
const BTConfig config,
std::unordered_set< uint32_t > &  positionedNodes 
)
inline

Definition at line 129 of file Renderer.h.

References GetComponentTypeID_Static(), MapBTToEditor(), and RenderNodeVisual().

+ Here is the call graph for this function:

◆ RenderBTNodeConnections()

void Olympe::NodeGraphShared::RenderBTNodeConnections ( const BehaviorTreeAsset tree,
uint32_t  activeNodeId 
)
inline

Definition at line 141 of file Renderer.h.

References GetComponentTypeID_Static(), Inverter, Repeater, Selector, and Sequence.

+ Here is the call graph for this function:

◆ RenderNodeHeader()

void Olympe::NodeGraphShared::RenderNodeHeader ( int  nodeId,
const NodeStyle style,
const char icon,
const std::string &  title,
bool  isCurrentNode,
float  pulseTimer 
)
inline

Definition at line 41 of file NodeGraphShared.h.

References GetComponentTypeID_Static(), Olympe::NodeStyle::headerColor, Olympe::NodeStyle::headerHoveredColor, and Olympe::NodeStyle::headerSelectedColor.

Referenced by RenderNodeVisual().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RenderNodeVisual()

void Olympe::NodeGraphShared::RenderNodeVisual ( int  nodeId,
const std::string &  title,
NodeType  editorType,
float  posX,
float  posY,
float  width,
float  height,
bool  isCurrentNode,
float  currentZoom,
float  pulseTimer,
float  pinRadius,
float  pinOutline,
float  pinHeaderHeight,
std::unordered_set< uint32_t > &  positionedNodes 
)
inline

Definition at line 69 of file Renderer.h.

References ComputePinCenterScreen(), DrawPinCircle(), Olympe::NodeStyleRegistry::Get(), GetComponentTypeID_Static(), Olympe::NodeStyleRegistry::GetStyle(), Olympe::NodeStyle::icon, Olympe::NodeTypeToString(), and RenderNodeHeader().

Referenced by RenderBTNode().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SerializeBehaviorTreeToJson()

json Olympe::NodeGraphShared::SerializeBehaviorTreeToJson ( const BehaviorTreeAsset tree,
const BTGraphLayoutEngine layoutEngine 
)
inline