HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT Namespace Reference

Namespaces

 detail
 
 FA
 
 Format
 
 Literal
 

Classes

struct  DefaultClearer< FBX_SceneProxy::JointInfo >
 
struct  DefaultClearer
 
struct  DefaultClearer< FONT_Style >
 
struct  DefaultClearer< FONT_Weight >
 
struct  DefaultClearer< FS_IndexFile::ConversionFuncs >
 
struct  DefaultClearer< GA_EdgeT< T, DIRECTED > >
 For possible use with UT::ArraySet or UT::ArrayMap. More...
 
struct  DefaultClearer< GU_CopyToPointsCache::TargetAttribInfo >
 
struct  DefaultClearer< GA_OffsetList >
 
struct  DefaultClearer< GU_PackedFoldersRO::FileInfo >
 
struct  DefaultClearer< GU_PackedFolders::FileInfo >
 
struct  DefaultClearer< NET_HTTPUploadedFile >
 
struct  DefaultClearer< OP_ConnectorId >
 
struct  DefaultClearer< PDG_File >
 
struct  DefaultClearer< PDGT_Value >
 
struct  DefaultClearer< STY_Result >
 
struct  DefaultClearer< STY_ResultMap >
 
struct  DefaultClearer< STY_Styler >
 
class  Accumulator
 
class  Accumulator< UT_FixedVector< T, S > >
 
class  Accumulator< std::complex< T > >
 
struct  DefaultClearer< UT_Array< T > >
 
struct  MapKeyEqual
 
struct  MapKeyHash
 
struct  MapKeyClearer
 
class  ArrayMap
 
struct  DefaultClearer< ArrayMap< Key, T, MULTI, MAX_LOAD_FACTOR_256, Clearer, Hash, KeyEqual > >
 
struct  DefaultClearer< S * >
 
struct  NumericClearer
 
struct  DefaultClearer< int8_t >
 
struct  DefaultClearer< uint8_t >
 
struct  DefaultClearer< int16_t >
 
struct  DefaultClearer< uint16_t >
 
struct  DefaultClearer< int32_t >
 
struct  DefaultClearer< uint32_t >
 
struct  DefaultClearer< int64_t >
 
struct  DefaultClearer< uint64_t >
 
struct  DefaultClearer< float >
 
struct  DefaultClearer< double >
 
struct  DefaultClearer< long double >
 
struct  DefaultClearer< bool >
 
struct  DefaultClearer< std::pair< S0, S1 > >
 
class  ArraySet
 
struct  DefaultClearer< ArraySet< Key, MULTI, MAX_LOAD_FACTOR_256, Clearer, Hash, KeyEqual > >
 
struct  DefaultClearer< UT_ArrayStringMap< ITEM_T > >
 
struct  DefaultClearer< UT_ArrayStringSet >
 
struct  Box
 
class  BVH
 
struct  BVHOrderedStackEntry
 
struct  ZeroRadiiWrapper
 
struct  SingleRadiusWrapper
 
struct  BVHQueryPointWrapper
 
struct  ut_BoxCentre
 
struct  ut_BoxCentre< UT_FixedVector< T, NAXES > >
 
struct  ut_BoxCentre< UT_Vector2T< T > >
 
struct  ut_BoxCentre< UT_Vector3T< T > >
 
struct  ut_BoxCentre< UT_Vector4T< T > >
 
struct  BVHQueryPointWrapper< const UT_FixedVector< float, NAXES > >
 
struct  BVHQueryPointWrapper< UT_FixedVector< float, NAXES > >
 
struct  BVHQueryPointWrapper< const UT_Vector3 >
 
struct  BVHQueryPointWrapper< UT_Vector3 >
 
struct  BVHQueryPointWrapper< const UT_Vector2 >
 
struct  BVHQueryPointWrapper< UT_Vector2 >
 
struct  BVHQuerySegment
 
struct  BVHQueryInfLine
 
struct  BVHQueryCone
 
struct  BVHQueryPtUnitWrap
 
struct  BVHQueryTriangle
 
struct  BVHQueryTetrahedron
 
class  ut_BVHOrderedStackCompare
 
struct  DefaultClearer< UT_IntrusivePtr< T > >
 
class  RWNullLock
 
struct  DefaultClearer< UT_OptionsHolder >
 
struct  DefaultClearer< UT_Pair< S0, S1 > >
 
class  RTreeT
 
class  RTreeConfigurationT
 
class  RNodeT
 
struct  ItemIndexUnderlyingInteger
 
struct  ItemIndex_UnderlyingIntegerType
 
struct  FT_Least
 
struct  FT_Greatest
 
struct  AssignCopyFT3
 
struct  AssignCopyFT3< FT, true >
 
struct  AssignCopyFT3< FT, false >
 
struct  AssignCoordinatesFT3
 
struct  AssignCoordinatesFT3< FT, true >
 
struct  AssignCoordinatesFT3< FT, false >
 
struct  PartitionForSubtrees
 
struct  SubtreeForEachIntersectingItem
 
struct  DefaultClearer< UT_SharedPtr< T > >
 
struct  DefaultClearer< UT_SmallArray< T, BYTES > >
 
struct  DefaultClearer< UT_StringArray >
 
struct  DefaultClearer< UT_StringHolder >
 
struct  DefaultClearer< UT_UniquePtr< T > >
 
struct  DefaultClearer< UT_ValArray< T > >
 
class  source_is_compressed
 
struct  DefaultClearer< HDK_Sample::GU_CopyToPointsCache::TargetAttribInfo >
 

Typedefs

using BVHUnorderedStack = UT_Array< UT::BVH< 4 >::INT_TYPE >
 
using BVHUnorderedStackSmall = UT_SmallArray< UT::BVH< 4 >::INT_TYPE, 128 >
 
using BVHOrderedStack = UT_Array< BVHOrderedStackEntry >
 
using BVHOrderedStackSmall = UT_SmallArray< BVHOrderedStackEntry, 256 >
 
template<typename ITEM_INDEX >
using ItemIndex_UnderlyingIntegerType_t = typename ItemIndex_UnderlyingIntegerType< ITEM_INDEX >::type
 
using RTree16Int = RTreeT< int, 16 >
 
using RTree2Int = RTreeT< int, 2 >
 
using RTreeInt = RTreeT< int, 2 >
 
using RTree = RTreeT< exint, 2 >
 
using RTreeConfigurationF = RTreeConfigurationT< fpreal32 >
 
using RTreeConfigurationD = RTreeConfigurationT< fpreal64 >
 
using RTreeConfiguration = RTreeConfigurationT< fpreal64 >
 
using RTreeBoxF = UT_BoxT< fpreal32 >
 
using RTreeBoxD = UT_BoxT< fpreal64 >
 
using RTreeBox = UT_BoxT< fpreal64 >
 

Enumerations

enum  BVH_Heuristic {
  BVH_Heuristic::BOX_PERIMETER, BVH_Heuristic::BOX_AREA, BVH_Heuristic::BOX_VOLUME, BVH_Heuristic::BOX_RADIUS,
  BVH_Heuristic::BOX_RADIUS2, BVH_Heuristic::BOX_RADIUS3, BVH_Heuristic::MEDIAN_MAX_AXIS
}
 
enum  SqlError { SqlError::UT_SQL_OK = 0, SqlError::UT_SQL_HAS_STEPPED, SqlError::UT_SQL_OUT_OF_RANGE }
 Error codes to describe errors as a result of UT_SQL. More...
 

Functions

template<uint BVH_N, typename ITEM_BOX , typename NODE_BOX >
SYS_FORCE_INLINE void createBVHNodeBoxes (const UT::BVH< BVH_N > &bvh, const ITEM_BOX *item_boxes, NODE_BOX *node_boxes) noexcept
 
template<uint NAXES, typename T , uint BVH_N, typename ITEM_BOX , typename NODE_BOX >
SYS_FORCE_INLINE void createBVHInterleavedBoxes (const UT::BVH< BVH_N > &bvh, const ITEM_BOX *item_boxes, NODE_BOX *node_boxes, float expand_factor=0.0f) noexcept
 
template<uint NAXES, typename T , typename ITEM_BOX , typename NODE_BOX , typename INT_TYPE0 = uint>
SYS_FORCE_INLINE void createBVHInterleavedBoxes (const UT::BVH< 4 > &bvh, const ITEM_BOX *item_boxes, NODE_BOX *node_boxes, const v4uu *node_nitems, const INT_TYPE0 *indices_mapping=nullptr) noexcept
 
template<uint NAXES, typename INT_TYPE >
void getIntersectingBoxes (const UT::BVH< 4 > &bvh, const UT::Box< v4uf, NAXES > *node_boxes, const UT::Box< float, NAXES > &query_box, UT_Array< INT_TYPE > &box_indices, BVHUnorderedStack &stack) noexcept
 
template<uint NAXES, typename INT_TYPE >
void getIntersectingBoxesFromStack (const UT::BVH< 4 > &bvh, const UT::Box< v4uf, NAXES > *node_boxes, const UT::Box< float, NAXES > &query_box, UT_Array< INT_TYPE > &box_indices, BVHUnorderedStack &stack) noexcept
 
template<uint NAXES, typename INT_TYPE >
void getIntersectingNodes (const UT::BVH< 4 > &bvh, const UT::Box< v4uf, NAXES > *node_boxes, const UT::Box< float, NAXES > &query_box, UT_Array< INT_TYPE > &box_indices, BVHUnorderedStack &stack) noexcept
 
template<uint NAXES, typename INT_TYPE , int BATCH_SIZE>
void getIntersectingBoxesBatch (const UT::BVH< 4 > &bvh, const UT::Box< v4uf, NAXES > *node_boxes, const UT::Box< float, NAXES > *query_box, UT_Array< INT_TYPE > *box_indices, BVHUnorderedStack &stack) noexcept
 
void computeNodeNItems (const UT::BVH< 4 > &bvh, v4uu *node_nitems, exint nitems) noexcept
 Computes the number of items per node entry and fills in node_nitems. More...
 
template<typename T >
constexpr bool allRadiiZero (const T &array) noexcept
 
constexpr bool allRadiiZero (const ZeroRadiiWrapper &array) noexcept
 
template<typename T >
constexpr bool allRadiiZero (const T *const array) noexcept
 
template<bool farthest, bool reordered, bool use_max_points, uint NAXES, typename QUERY_POINT , typename INT_TYPE0 , typename POSITION_ARRAY , typename RADIUS_ARRAY >
void findClosestPoints (const UT::BVH< 4 > &bvh, const UT::Box< v4uf, NAXES > *node_boxes, const v4uu *node_nitems, const INT_TYPE0 *indices_mapping, const POSITION_ARRAY &positions, QUERY_POINT &query_point, BVHOrderedStack &stack, BVHOrderedStack &output_queue, const RADIUS_ARRAY &radii=ZeroRadiiWrapper(), exint max_points=std::numeric_limits< exint >::max(), float max_dist_squared=std::numeric_limits< float >::max()) noexcept
 
template<typename T , uint NAXES>
SYS_FORCE_INLINE bool utBoxExclude (const UT::Box< T, NAXES > &box) noexcept
 
template<uint NAXES>
SYS_FORCE_INLINE bool utBoxExclude (const UT::Box< fpreal32, NAXES > &box) noexcept
 
template<typename T , uint NAXES>
SYS_FORCE_INLINEutBoxCenter (const UT::Box< T, NAXES > &box, uint axis) noexcept
 
template<typename T , uint NAXES>
SYS_FORCE_INLINEutBoxExclude (const UT_FixedVector< T, NAXES > &position) noexcept
 
template<uint NAXES>
SYS_FORCE_INLINE bool utBoxExclude (const UT_FixedVector< fpreal32, NAXES > &position) noexcept
 
template<typename T , uint NAXES>
SYS_FORCE_INLINEutBoxCenter (const UT_FixedVector< T, NAXES > &position, uint axis) noexcept
 
template<typename T >
SYS_FORCE_INLINE bool utBoxExclude (const UT_Vector2T< T > &position) noexcept
 
template<typename T >
SYS_FORCE_INLINE bool utBoxExclude (const UT_Vector3T< T > &position) noexcept
 
template<typename T >
SYS_FORCE_INLINE bool utBoxExclude (const UT_Vector4T< T > &position) noexcept
 
template<>
SYS_FORCE_INLINE bool utBoxExclude (const UT_Vector2T< fpreal32 > &position) noexcept
 
template<>
SYS_FORCE_INLINE bool utBoxExclude (const UT_Vector3T< fpreal32 > &position) noexcept
 
template<>
SYS_FORCE_INLINE bool utBoxExclude (const UT_Vector4T< fpreal32 > &position) noexcept
 
template<typename T >
SYS_FORCE_INLINEutBoxCenter (const UT_Vector2T< T > &position, uint axis) noexcept
 
template<typename T >
SYS_FORCE_INLINEutBoxCenter (const UT_Vector3T< T > &position, uint axis) noexcept
 
template<typename T >
SYS_FORCE_INLINEutBoxCenter (const UT_Vector4T< T > &position, uint axis) noexcept
 
template<typename BOX_TYPE , typename SRC_INT_TYPE , typename INT_TYPE >
INT_TYPE utExcludeNaNInfBoxIndices (const BOX_TYPE *boxes, SRC_INT_TYPE *indices, INT_TYPE &nboxes) noexcept
 
template<typename T , uint NAXES, bool PARALLEL, typename INT_TYPE0 , typename DATA , typename INT_TYPE >
void utCreateBVHInterleavedBoxesHelper (INT_TYPE nodei, INT_TYPE next_node_id, const DATA &data, UT::Box< T, NAXES > *data_for_parent) noexcept
 
template<bool PARALLEL, typename DATA >
void utComputeNodeNItemsHelper (uint nodei, uint next_node_id, uint next_item_id, const DATA &data) noexcept
 
template<typename RADIUS_ARRAY >
SYS_FORCE_INLINE void utHandleRadiiLinearly (float &d2, const RADIUS_ARRAY &radii, uint index)
 
template<bool farthest, bool reordered, bool use_max_points, uint NAXES, typename QUERY_POINT , typename INT_TYPE0 , typename POSITION_ARRAY , typename RADIUS_ARRAY >
SYS_FORCE_INLINE void utHandleSingleClosePoint (const uint index, const INT_TYPE0 *indices_mapping, const POSITION_ARRAY &positions, QUERY_POINT &query_point, BVHOrderedStack &output_queue, const RADIUS_ARRAY &radii, exint max_points, float &max_dist_squared) noexcept
 
template<typename ITEM_INDEX , int MAX_ORDER, typename FT >
RTreeT< ITEM_INDEX, MAX_ORDER > constructRTree (const UT_BoxT< FT > item_box[], const ITEM_INDEX num_items)
 
template<typename ITEM_INDEX , int MAX_ORDER, typename FT >
RTreeT< ITEM_INDEX, MAX_ORDER > constructRTree (const UT_Array< UT_BoxT< FT > > &item_box)
 
template<typename ITEM_INDEX , int MAX_ORDER, typename FT >
RTreeConfigurationT< FT > constructRTreeConfiguration (const UT::RTreeT< ITEM_INDEX, MAX_ORDER > &tree, const UT_BoxT< FT > item_box[], const ITEM_INDEX num_items)
 
template<typename ITEM_INDEX , int MAX_ORDER, typename FT >
RTreeConfigurationT< FT > constructRTreeConfiguration (const RTreeT< ITEM_INDEX, MAX_ORDER > &tree, const UT_Array< UT_BoxT< FT > > &item_box)
 
template<typename ITEM_INDEX , int MAX_ORDER, typename FT , typename QUERY_SHAPE , typename ACCEPT_ITEM >
void forEachIntersecting (ACCEPT_ITEM &&accept_item, const RTreeT< ITEM_INDEX, MAX_ORDER > &tree, const RTreeConfigurationT< FT > &configuration, const QUERY_SHAPE &query_shape)
 
template<typename ITEM_INDEX , int MAX_ORDER, typename FT >
void updateConfiguration (RTreeConfigurationT< FT > &configuration, const RTreeT< ITEM_INDEX, MAX_ORDER > &tree, const UT_BoxT< FT > item_box[], const ITEM_INDEX num_items)
 
template<typename FT >
exint heapMemoryUsage (const RTreeConfigurationT< FT > &configuration)
 
template<typename ITEM_INDEX , int MAX_ORDER, typename FT >
void updateConfiguration (RTreeConfigurationT< FT > &configuration, const RTreeT< ITEM_INDEX, MAX_ORDER > &tree, const UT_Array< UT_BoxT< FT > > &item_box)
 
template<typename QUERY_SHAPE , typename ITEM_INDEX , int MAX_ORDER, typename FT >
void getIntersecting (UT_Array< ITEM_INDEX > &results, const RTreeT< ITEM_INDEX, MAX_ORDER > &tree, const RTreeConfigurationT< FT > &configuration, const QUERY_SHAPE &query_shape)
 
template<typename QUERY_SHAPE , typename ITEM_INDEX , int MAX_ORDER, typename FT >
ITEM_INDEX * getIntersectingRaw (const RTreeT< ITEM_INDEX, MAX_ORDER > &tree, const RTreeConfigurationT< FT > &configuration, const QUERY_SHAPE &query_shape, ITEM_INDEX *const items_begin)
 
size_t subtreeDetermineNumNodes (const int MAX_ORDER, const size_t size)
 
template<typename BOX , typename ITEM_INDEX_REP , int MAX_ORDER>
RNodeT< ITEM_INDEX_REP,
MAX_ORDER > * 
subtreeCreate (BOX &bounding_box, BOX shared_boxes[], UT_BoxedItemT< BOX, ITEM_INDEX_REP > *const begin, UT_BoxedItemT< BOX, ITEM_INDEX_REP > *const end, RNodeT< ITEM_INDEX_REP, MAX_ORDER > shared_nodes[], RNodeT< ITEM_INDEX_REP, MAX_ORDER > *&shared_nodes_end)
 
template<typename ITEM_INDEX_REP , int MAX_ORDER, typename ITEM_BOX , typename FT >
void subtreeAssignItemBoxArray (UT_BoxT< FT > &bounding_box, UT_BoxT< FT > shared_boxes[], const RNodeT< ITEM_INDEX_REP, MAX_ORDER > shared_nodes[], const RNodeT< ITEM_INDEX_REP, MAX_ORDER > *const node, ITEM_BOX &&item_box)
 
template<typename ITEM_INDEX_REP , int MAX_ORDER>
exint subtreeComputeMaxDepth (const RNodeT< ITEM_INDEX_REP, MAX_ORDER > shared_nodes[], const RNodeT< ITEM_INDEX_REP, MAX_ORDER > *const node)
 
UT_API const UT_ErrorCategoryGetSqliteErrorCategory ()
 
UT_API const UT_ErrorCategoryGetSqlErrorCategory ()
 
UT_ErrorCode make_error_code (UT::SqlError e)
 

Detailed Description

numbers, this only applies to the integer portion of the float.

  • <width> specifies the minimum width of the field. Arguments wider than this value will still be printed out in full. Preceding the width field with 0 will automatically set the alignment to number alignment, and the fill value to 0.
  • <precision> sets the precision for floating point numbers. For other types it specifies the maximum width of the field.
  • <type> is a single character code that specifies how the type should be interpreted. If an argument type is not valid for the formatting type, the formatting type is ignored. The supported types are:
    • b: Output integers as binary numbers.
    • B: Output integers as binary numbers with an upper-case prefix (if using the # option.
    • c: Output integers interpreted as a Unicode code point.
    • d: Output integers as decimal numbers. This is the default for integers.
    • e: Use the exponent notation for floating point numbers.
    • E: Same as e, except the exponent separator is upper-cased.
    • f: Use the fixed point notation for floating point numbers.
    • F: Same as f.
    • g: Format a floating point number as either fixed point or scientific, depending on its magnitude, which mostly results in the shortest form being used. This is the default for floats.
    • G: Same as g, except the exponent separator is upper-cased.
    • o: Output integers as octals.
    • x: Output integers and floats as hexadecimal. For floats this uses the special hexadecimal float output.
    • X: The same as x, except all alphabetic digits and prefix are output in upper-case.
    • %: Takes a floating point number, multiplies it by 100 and outputs it with a percentage sign appended, using fixed point notation. The default precision in this mode is 2.

Example:

UTformat("Number: {}\n", 1);
UTformat("String: {}\n", "foobar");
UTformat("Field : {:=^20}\n", 1);
UTformat("Index : {3} {0} {2} {1}\n", 'A', 'B', 'C', 'D');
UTformat("Perc : {:.1%}\n", 0.1234);

Result:

String: foobar
Field : =========1==========
Index : D A C B
Perc : 12.3%

Printf Grammar

The UTprintf and UT_Format::printf functions use formatting code very similar to the POSIX specification for printf. The code begins with a single % character, followed by zero or more modifiers, ending with the type specifier. Where this implementation of the printf formatting code differs, is that there is no need to add length modifiers. Any length modifers will simply be ignored.

Custom Formatting

Custom types are supported through custom formatting functions. To define a custom formatting function for a specific type, the following function specialization needs to be implemented:

size_t format(char *buffer, size_t buffer_size, const CustomType &val);

Where:

  • buffer is a byte buffer to write the result into. If buffer is a nullptr, then the function should return the number of bytes required to store the final result.
  • buffer_size is the size of the byte buffer passed in via buffer. This should be ignored if buffer is nullptr.
  • is value to custom format. The function should return the number of bytes written out, or, if buffer is nullptr, the amount of bytes needed to write out the entire custom type representation.

A user-defined string literal to construct UT_StringHolder objects. E.g:

auto lit = "This is my UT_StringHolder literal"_sh;

Typedef Documentation

Definition at line 741 of file UT_BVH.h.

Definition at line 742 of file UT_BVH.h.

using UT::BVHUnorderedStack = typedef UT_Array<UT::BVH<4>::INT_TYPE>

Definition at line 659 of file UT_BVH.h.

using UT::BVHUnorderedStackSmall = typedef UT_SmallArray<UT::BVH<4>::INT_TYPE,128>

Definition at line 660 of file UT_BVH.h.

template<typename ITEM_INDEX >
using UT::ItemIndex_UnderlyingIntegerType_t = typedef typename ItemIndex_UnderlyingIntegerType< ITEM_INDEX >::type

Definition at line 116 of file UT_RTree.h.

using UT::RTree = typedef RTreeT< exint, 2 >

Definition at line 296 of file UT_RTree.h.

using UT::RTree16Int = typedef RTreeT< int, 16 >

Definition at line 290 of file UT_RTree.h.

using UT::RTree2Int = typedef RTreeT< int, 2 >

Definition at line 291 of file UT_RTree.h.

using UT::RTreeBox = typedef UT_BoxT< fpreal64 >

Definition at line 306 of file UT_RTree.h.

using UT::RTreeBoxD = typedef UT_BoxT< fpreal64 >

Definition at line 305 of file UT_RTree.h.

using UT::RTreeBoxF = typedef UT_BoxT< fpreal32 >

Definition at line 304 of file UT_RTree.h.

Definition at line 301 of file UT_RTree.h.

Definition at line 300 of file UT_RTree.h.

Definition at line 299 of file UT_RTree.h.

using UT::RTreeInt = typedef RTreeT< int, 2 >

Definition at line 292 of file UT_RTree.h.

Enumeration Type Documentation

enum UT::BVH_Heuristic
strong

Used by BVH::init to specify the heuristic to use for choosing between different box splits. I tried putting this inside the BVH class, but I had difficulty getting it to compile.

Enumerator
BOX_PERIMETER 

Tries to minimize the sum of axis lengths of the boxes. This is useful for applications where the probability of a box being applicable to a query is proportional to the "length", e.g. the probability of a random infinite plane intersecting the box.

BOX_AREA 

Tries to minimize the "surface area" of the boxes. In 3D, uses the surface area; in 2D, uses the perimeter; in 1D, uses the axis length. This is what most applications, e.g. ray tracing, should use, particularly when the probability of a box being applicable to a query is proportional to the surface "area", e.g. the probability of a random ray hitting the box.

NOTE: USE THIS ONE IF YOU ARE UNSURE!

BOX_VOLUME 

Tries to minimize the "volume" of the boxes. Uses the product of all axis lengths as a heuristic, (volume in 3D, area in 2D, length in 1D). This is useful for applications where the probability of a box being applicable to a query is proportional to the "volume", e.g. the probability of a random point being inside the box.

BOX_RADIUS 

Tries to minimize the "radii" of the boxes (i.e. the distance from the centre to a corner). This is useful for applications where the probability of a box being applicable to a query is proportional to the distance to the box centre, e.g. the probability of a random infinite plane being within the "radius" of the centre.

BOX_RADIUS2 

Tries to minimize the squared "radii" of the boxes (i.e. the squared distance from the centre to a corner). This is useful for applications where the probability of a box being applicable to a query is proportional to the squared distance to the box centre, e.g. the probability of a random ray passing within the "radius" of the centre.

BOX_RADIUS3 

Tries to minimize the cubed "radii" of the boxes (i.e. the cubed distance from the centre to a corner). This is useful for applications where the probability of a box being applicable to a query is proportional to the cubed distance to the box centre, e.g. the probability of a random point being within the "radius" of the centre.

MEDIAN_MAX_AXIS 

Tries to minimize the depth of the tree by primarily splitting at the median of the max axis. It may fall back to minimizing the area, but the tree depth should be unaffected.

FIXME: This is not fully implemented yet.

Definition at line 353 of file UT_BVH.h.

enum UT::SqlError
strong

Error codes to describe errors as a result of UT_SQL.

Enumerator
UT_SQL_OK 
UT_SQL_HAS_STEPPED 
UT_SQL_OUT_OF_RANGE 

Definition at line 41 of file UT_SQL.h.

Function Documentation

template<typename T >
constexpr bool UT::allRadiiZero ( const T &  array)
noexcept

Definition at line 765 of file UT_BVH.h.

constexpr bool UT::allRadiiZero ( const ZeroRadiiWrapper &  array)
noexcept

Definition at line 767 of file UT_BVH.h.

template<typename T >
constexpr bool UT::allRadiiZero ( const T *const  array)
noexcept

Definition at line 770 of file UT_BVH.h.

void UT::computeNodeNItems ( const UT::BVH< 4 > &  bvh,
v4uu node_nitems,
exint  nitems 
)
inlinenoexcept

Computes the number of items per node entry and fills in node_nitems.

Definition at line 3011 of file UT_BVHImpl.h.

template<typename ITEM_INDEX , int MAX_ORDER, typename FT >
RTreeT< ITEM_INDEX, MAX_ORDER > UT::constructRTree ( const UT_BoxT< FT >  item_box[],
const ITEM_INDEX  num_items 
)
template<typename ITEM_INDEX , int MAX_ORDER, typename FT >
RTreeT< ITEM_INDEX, MAX_ORDER > UT::constructRTree ( const UT_Array< UT_BoxT< FT > > &  item_box)
template<typename ITEM_INDEX , int MAX_ORDER, typename FT >
RTreeConfigurationT< FT > UT::constructRTreeConfiguration ( const UT::RTreeT< ITEM_INDEX, MAX_ORDER > &  tree,
const UT_BoxT< FT >  item_box[],
const ITEM_INDEX  num_items 
)
template<typename ITEM_INDEX , int MAX_ORDER, typename FT >
RTreeConfigurationT< FT > UT::constructRTreeConfiguration ( const RTreeT< ITEM_INDEX, MAX_ORDER > &  tree,
const UT_Array< UT_BoxT< FT > > &  item_box 
)
template<uint NAXES, typename T , uint BVH_N, typename ITEM_BOX , typename NODE_BOX >
SYS_FORCE_INLINE void UT::createBVHInterleavedBoxes ( const UT::BVH< BVH_N > &  bvh,
const ITEM_BOX *  item_boxes,
NODE_BOX *  node_boxes,
float  expand_factor = 0.0f 
)
noexcept

Fills in node_boxes as interleaved child boxes, possibly in parallel if there are enough nodes. ITEM_BOX should act like UT::Box<T,NAXES>, and the length should be the number of items. NODE_BOX should act like UT::Box<v4uf,NAXES> or UT::Box<UT_FixedVector<T,BVH_N>,NAXES>, and the length should be bvh.getNumNodes().

Definition at line 2139 of file UT_BVHImpl.h.

template<uint NAXES, typename T , typename ITEM_BOX , typename NODE_BOX , typename INT_TYPE0 = uint>
SYS_FORCE_INLINE void UT::createBVHInterleavedBoxes ( const UT::BVH< 4 > &  bvh,
const ITEM_BOX *  item_boxes,
NODE_BOX *  node_boxes,
const v4uu node_nitems,
const INT_TYPE0 *  indices_mapping = nullptr 
)
noexcept

Fills in node_boxes as interleaved child boxes, possibly in parallel if there are enough nodes. ITEM_BOX should act like UT::Box<T,NAXES> or UT_FixedVector<T,NAXES>, and the length should be the number of items. NODE_BOX should act like UT::Box<v4uf,NAXES> or UT::Box<UT_FixedVector<T,4>,NAXES>, and the length should be bvh.getNumNodes().

Definition at line 2410 of file UT_BVHImpl.h.

template<uint BVH_N, typename ITEM_BOX , typename NODE_BOX >
SYS_FORCE_INLINE void UT::createBVHNodeBoxes ( const UT::BVH< BVH_N > &  bvh,
const ITEM_BOX *  item_boxes,
NODE_BOX *  node_boxes 
)
noexcept

Fills in node_boxes, possibly in parallel if there are enough nodes. ITEM_BOX should act like UT::Box<T,NAXES>, and the length should be the number of items. NODE_BOX should act like UT::Box<T,NAXES>, and the length should be bvh.getNumNodes().

Definition at line 2094 of file UT_BVHImpl.h.

template<bool farthest, bool reordered, bool use_max_points, uint NAXES, typename QUERY_POINT , typename INT_TYPE0 , typename POSITION_ARRAY , typename RADIUS_ARRAY >
void UT::findClosestPoints ( const UT::BVH< 4 > &  bvh,
const UT::Box< v4uf, NAXES > *  node_boxes,
const v4uu node_nitems,
const INT_TYPE0 *  indices_mapping,
const POSITION_ARRAY &  positions,
QUERY_POINT &  query_point,
BVHOrderedStack &  stack,
BVHOrderedStack &  output_queue,
const RADIUS_ARRAY &  radii = ZeroRadiiWrapper(),
exint  max_points = std::numeric_limits<exint>::max(),
float  max_dist_squared = std::numeric_limits<float>::max() 
)
noexcept

NOTE: If farthest is true, max_dist_squared is actually min_dist_squared. NOTE: If indices_mapping is non-null, it maps from BVH item indices to indices into positions and radii. NOTE: If reordered is true, item indices in bvh must be monotone strictly increasing, but may not be contiguous, so that multiple points can be in the same leaf. This is independent of whether indices_mapping is valid, but no mapping means that positions and radii would have to be reordered too.

Definition at line 4039 of file UT_BVHImpl.h.

template<typename ITEM_INDEX , int MAX_ORDER, typename FT , typename QUERY_SHAPE , typename ACCEPT_ITEM >
void UT::forEachIntersecting ( ACCEPT_ITEM &&  accept_item,
const RTreeT< ITEM_INDEX, MAX_ORDER > &  tree,
const RTreeConfigurationT< FT > &  configuration,
const QUERY_SHAPE &  query_shape 
)
inline

For each item i for which item_box[i] intersects query_box, call accept_item( i ). There must exist a free-standing 'intersects' function that takes a QUERY_SHAPE and a UT_BoxT< FT >.

Definition at line 913 of file UT_RTreeImpl.h.

template<typename QUERY_SHAPE , typename ITEM_INDEX , int MAX_ORDER, typename FT >
void UT::getIntersecting ( UT_Array< ITEM_INDEX > &  results,
const RTreeT< ITEM_INDEX, MAX_ORDER > &  tree,
const RTreeConfigurationT< FT > &  configuration,
const QUERY_SHAPE &  query_shape 
)
inline

Definition at line 892 of file UT_RTreeImpl.h.

template<uint NAXES, typename INT_TYPE >
void UT::getIntersectingBoxes ( const UT::BVH< 4 > &  bvh,
const UT::Box< v4uf, NAXES > *  node_boxes,
const UT::Box< float, NAXES > &  query_box,
UT_Array< INT_TYPE > &  box_indices,
BVHUnorderedStack &  stack 
)
noexcept

Fills box_indices array with the indices of all boxes intersecting query_box. NOTE: This does not clear out previous contents of indices, so that you can easily query intersection with multiple boxes. WARNING: DO NOT depend on the order of box_indices. If you need a consistent order, sort it.

Definition at line 2444 of file UT_BVHImpl.h.

template<uint NAXES, typename INT_TYPE , int BATCH_SIZE>
void UT::getIntersectingBoxesBatch ( const UT::BVH< 4 > &  bvh,
const UT::Box< v4uf, NAXES > *  node_boxes,
const UT::Box< float, NAXES > *  query_box,
UT_Array< INT_TYPE > *  box_indices,
BVHUnorderedStack &  stack 
)
noexcept

Definition at line 2756 of file UT_BVHImpl.h.

template<uint NAXES, typename INT_TYPE >
void UT::getIntersectingBoxesFromStack ( const UT::BVH< 4 > &  bvh,
const UT::Box< v4uf, NAXES > *  node_boxes,
const UT::Box< float, NAXES > &  query_box,
UT_Array< INT_TYPE > &  box_indices,
BVHUnorderedStack &  stack 
)
noexcept

Definition at line 2467 of file UT_BVHImpl.h.

template<uint NAXES, typename INT_TYPE >
void UT::getIntersectingNodes ( const UT::BVH< 4 > &  bvh,
const UT::Box< v4uf, NAXES > *  node_boxes,
const UT::Box< float, NAXES > &  query_box,
UT_Array< INT_TYPE > &  box_indices,
BVHUnorderedStack &  stack 
)
noexcept

Definition at line 2609 of file UT_BVHImpl.h.

template<typename QUERY_SHAPE , typename ITEM_INDEX , int MAX_ORDER, typename FT >
ITEM_INDEX * UT::getIntersectingRaw ( const RTreeT< ITEM_INDEX, MAX_ORDER > &  tree,
const RTreeConfigurationT< FT > &  configuration,
const QUERY_SHAPE &  query_shape,
ITEM_INDEX *const  items_begin 
)
inline

Definition at line 947 of file UT_RTreeImpl.h.

UT_API const UT_ErrorCategory& UT::GetSqlErrorCategory ( )
UT_API const UT_ErrorCategory& UT::GetSqliteErrorCategory ( )
template<typename FT >
exint UT::heapMemoryUsage ( const RTreeConfigurationT< FT > &  configuration)
inline

Definition at line 838 of file UT_RTreeImpl.h.

UT_ErrorCode UT::make_error_code ( UT::SqlError  e)
inline

Definition at line 52 of file UT_SQL.h.

template<typename ITEM_INDEX_REP , int MAX_ORDER, typename ITEM_BOX , typename FT >
void UT::subtreeAssignItemBoxArray ( UT_BoxT< FT > &  bounding_box,
UT_BoxT< FT >  shared_boxes[],
const RNodeT< ITEM_INDEX_REP, MAX_ORDER >  shared_nodes[],
const RNodeT< ITEM_INDEX_REP, MAX_ORDER > *const  node,
ITEM_BOX &&  item_box 
)
inline

Definition at line 477 of file UT_RTreeImpl.h.

template<typename ITEM_INDEX_REP , int MAX_ORDER>
exint UT::subtreeComputeMaxDepth ( const RNodeT< ITEM_INDEX_REP, MAX_ORDER >  shared_nodes[],
const RNodeT< ITEM_INDEX_REP, MAX_ORDER > *const  node 
)
inline

Definition at line 606 of file UT_RTreeImpl.h.

template<typename BOX , typename ITEM_INDEX_REP , int MAX_ORDER>
RNodeT< ITEM_INDEX_REP, MAX_ORDER >* UT::subtreeCreate ( BOX &  bounding_box,
BOX  shared_boxes[],
UT_BoxedItemT< BOX, ITEM_INDEX_REP > *const  begin,
UT_BoxedItemT< BOX, ITEM_INDEX_REP > *const  end,
RNodeT< ITEM_INDEX_REP, MAX_ORDER >  shared_nodes[],
RNodeT< ITEM_INDEX_REP, MAX_ORDER > *&  shared_nodes_end 
)
inline

Definition at line 319 of file UT_RTreeImpl.h.

size_t UT::subtreeDetermineNumNodes ( const int  MAX_ORDER,
const size_t  size 
)
inline

Definition at line 228 of file UT_RTreeImpl.h.

template<typename ITEM_INDEX , int MAX_ORDER, typename FT >
void UT::updateConfiguration ( RTreeConfigurationT< FT > &  configuration,
const RTreeT< ITEM_INDEX, MAX_ORDER > &  tree,
const UT_BoxT< FT >  item_box[],
const ITEM_INDEX  num_items 
)
inline

Definition at line 846 of file UT_RTreeImpl.h.

template<typename ITEM_INDEX , int MAX_ORDER, typename FT >
void UT::updateConfiguration ( RTreeConfigurationT< FT > &  configuration,
const RTreeT< ITEM_INDEX, MAX_ORDER > &  tree,
const UT_Array< UT_BoxT< FT > > &  item_box 
)
inline

Definition at line 882 of file UT_RTreeImpl.h.

template<typename T , uint NAXES>
SYS_FORCE_INLINE T UT::utBoxCenter ( const UT::Box< T, NAXES > &  box,
uint  axis 
)
noexcept

Definition at line 58 of file UT_BVHImpl.h.

template<typename T , uint NAXES>
SYS_FORCE_INLINE T UT::utBoxCenter ( const UT_FixedVector< T, NAXES > &  position,
uint  axis 
)
noexcept

Definition at line 83 of file UT_BVHImpl.h.

template<typename T >
SYS_FORCE_INLINE T UT::utBoxCenter ( const UT_Vector2T< T > &  position,
uint  axis 
)
noexcept

Definition at line 130 of file UT_BVHImpl.h.

template<typename T >
SYS_FORCE_INLINE T UT::utBoxCenter ( const UT_Vector3T< T > &  position,
uint  axis 
)
noexcept

Definition at line 134 of file UT_BVHImpl.h.

template<typename T >
SYS_FORCE_INLINE T UT::utBoxCenter ( const UT_Vector4T< T > &  position,
uint  axis 
)
noexcept

Definition at line 138 of file UT_BVHImpl.h.

template<typename T , uint NAXES>
SYS_FORCE_INLINE bool UT::utBoxExclude ( const UT::Box< T, NAXES > &  box)
noexcept

Definition at line 34 of file UT_BVHImpl.h.

template<uint NAXES>
SYS_FORCE_INLINE bool UT::utBoxExclude ( const UT::Box< fpreal32, NAXES > &  box)
noexcept

Definition at line 45 of file UT_BVHImpl.h.

template<typename T , uint NAXES>
SYS_FORCE_INLINE T UT::utBoxExclude ( const UT_FixedVector< T, NAXES > &  position)
noexcept

Definition at line 67 of file UT_BVHImpl.h.

template<uint NAXES>
SYS_FORCE_INLINE bool UT::utBoxExclude ( const UT_FixedVector< fpreal32, NAXES > &  position)
noexcept

Definition at line 74 of file UT_BVHImpl.h.

template<typename T >
SYS_FORCE_INLINE bool UT::utBoxExclude ( const UT_Vector2T< T > &  position)
noexcept

Definition at line 91 of file UT_BVHImpl.h.

template<typename T >
SYS_FORCE_INLINE bool UT::utBoxExclude ( const UT_Vector3T< T > &  position)
noexcept

Definition at line 95 of file UT_BVHImpl.h.

template<typename T >
SYS_FORCE_INLINE bool UT::utBoxExclude ( const UT_Vector4T< T > &  position)
noexcept

Definition at line 99 of file UT_BVHImpl.h.

template<>
SYS_FORCE_INLINE bool UT::utBoxExclude ( const UT_Vector2T< fpreal32 > &  position)
noexcept

Definition at line 103 of file UT_BVHImpl.h.

template<>
SYS_FORCE_INLINE bool UT::utBoxExclude ( const UT_Vector3T< fpreal32 > &  position)
noexcept

Definition at line 111 of file UT_BVHImpl.h.

template<>
SYS_FORCE_INLINE bool UT::utBoxExclude ( const UT_Vector4T< fpreal32 > &  position)
noexcept

Definition at line 120 of file UT_BVHImpl.h.

template<bool PARALLEL, typename DATA >
void UT::utComputeNodeNItemsHelper ( uint  nodei,
uint  next_node_id,
uint  next_item_id,
const DATA &  data 
)
noexcept

Definition at line 2885 of file UT_BVHImpl.h.

template<typename T , uint NAXES, bool PARALLEL, typename INT_TYPE0 , typename DATA , typename INT_TYPE >
void UT::utCreateBVHInterleavedBoxesHelper ( INT_TYPE  nodei,
INT_TYPE  next_node_id,
const DATA &  data,
UT::Box< T, NAXES > *  data_for_parent 
)
noexcept

Definition at line 2238 of file UT_BVHImpl.h.

template<typename BOX_TYPE , typename SRC_INT_TYPE , typename INT_TYPE >
INT_TYPE UT::utExcludeNaNInfBoxIndices ( const BOX_TYPE *  boxes,
SRC_INT_TYPE *  indices,
INT_TYPE &  nboxes 
)
noexcept

Definition at line 155 of file UT_BVHImpl.h.

template<typename RADIUS_ARRAY >
SYS_FORCE_INLINE void UT::utHandleRadiiLinearly ( float d2,
const RADIUS_ARRAY &  radii,
uint  index 
)

Definition at line 3077 of file UT_BVHImpl.h.

template<bool farthest, bool reordered, bool use_max_points, uint NAXES, typename QUERY_POINT , typename INT_TYPE0 , typename POSITION_ARRAY , typename RADIUS_ARRAY >
SYS_FORCE_INLINE void UT::utHandleSingleClosePoint ( const uint  index,
const INT_TYPE0 *  indices_mapping,
const POSITION_ARRAY &  positions,
QUERY_POINT &  query_point,
BVHOrderedStack &  output_queue,
const RADIUS_ARRAY &  radii,
exint  max_points,
float max_dist_squared 
)
noexcept

Definition at line 3908 of file UT_BVHImpl.h.