2#include <NDEVR/DesignObjectBase.h>
4#include <NDEVR/Model.h>
5#include <NDEVR/TimeSpan.h>
6#include <NDEVR/Geometry.h>
32#if NDEVR_SUPPORTS_THREADING
127#if NDEVR_SUPPORTS_THREADING
A thread that executes a user-provided callback function concurrently.
The equivelent of std::vector but with a bit more control.
A core class where all Design Objects including models, materials, and geometries are stored.
A hash-based key-value store, useful for quick associative lookups.
A core class within the model hierarchy containing vertex-based data (Usually 3D data) within a set c...
A light-weight base class for Log that allows processes to update, without the need for additional in...
A core class that represents a node on model hierarchy.
bool createGeoTree(const Geometry &geo, PrimitiveProperty primitive_property, VertexProperty vertex_property, uint04 tree_bucket_size, const void *lock)
Creates a spatial selection tree for a single geometry object.
bool sortVertices(const Geometry &geo, PrimitiveProperty primitive_property, VertexProperty vertex_property, const void *lock)
Sorts the vertices of a geometry spatially to improve cache coherence and selection performance.
InfoPipe * m_log
Optional logging pipe for diagnostic output.
Time m_last_modified_time
Timestamp of the most recent geometry modification observed.
Buffer< PrimitiveProperty > m_primitive_properties
Primitive property channels corresponding to entries in m_tree_geos.
uint04 m_point_bucket_size
Maximum elements per leaf node for point-based trees.
Buffer< Geometry > m_sort_geos
Geometries queued for vertex sorting.
void onSceneDeleted(UUID id)
Handles cleanup when an entire scene is deleted, removing all associated tree data.
bool m_requesting_delete
Whether a deletion cleanup pass has been requested.
TimeSpan m_loop_timespan
Interval between background loop iterations.
TimeSpan m_edit_timespan
Minimum time after a geometry edit before tree creation is allowed.
DesignObjectLookup * m_loop_lookup
Lookup reference used by the background loop.
bool canSort(const Geometry &geo)
Checks whether the given geometry is eligible for vertex sorting.
Set< UUID > m_active_models
Set of model UUIDs currently being processed or tracked.
void createTrees(const Model &model, const void *lock)
Creates selection trees for all geometry within the given model and its children.
Dictionary< UUID, Time > m_modified_time
Tracks the last modification time per geometry UUID.
Buffer< Geometry > m_tree_geos
Geometries queued for tree construction.
uint04 m_triangle_bucket_size
Maximum elements per leaf node for triangle-based trees.
void createTrees(DesignObjectLookup *lookup)
Creates selection trees for all geometry within the given lookup.
void createModelTree(const Buffer< Model > &models, const void *lock)
Creates a spatial tree that indexes child models for a parent model hierarchy.
void stopLoop()
Stops the background tree-rebuild loop and waits for the thread to finish.
void createTree(const Geometry &geo, PrimitiveProperty primitive_property, VertexProperty vertex_property, const void *lock)
Internal method that creates a selection tree for a single geometry using stored bucket sizes.
uint04 m_model_child_bucket_size
Maximum elements per leaf node for model child trees.
void startLoop(DesignObjectLookup *lookup, const TimeSpan &loop_time)
Starts a background thread that periodically rebuilds selection trees for modified geometry.
Buffer< VertexProperty > m_vertex_properties
Vertex property channels corresponding to entries in m_tree_geos.
SelectionTreeManager()
Constructs a SelectionTreeManager with default bucket sizes and timespan settings.
BasicThread * m_loop_thread
Background thread running the periodic tree-rebuild loop.
void onGeometryDeleted(UUID id)
Handles cleanup when a geometry object is deleted, removing its associated tree data.
void setEditTimespan(TimeSpan span)
Sets the time from a geometry edit before we create a tree.
uint04 m_line_bucket_size
Maximum elements per leaf node for line-based trees.
Container that stores unique elements in no particular order, and which allow for fast retrieval or i...
Stores a time span, or difference between two times, with an optional start time.
Represents a timestamp with utilities for manipulation and conversion.
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
The primary namespace for the NDEVR SDK.
VertexProperty
Per-vertex data channels that can be stored in the vertex table to be used by Geometry.
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
PrimitiveProperty
Describes which rendering property a primitive index buffer corresponds to.