HDK
|
#include "GEO_API.h"
#include <GA/GA_PolyCounts.h>
#include <GA/GA_Types.h>
#include <SYS/SYS_Types.h>
#include <utility>
Go to the source code of this file.
Macros | |
#define | __GEO_BuildPrimitives_h__ |
Functions | |
template<typename INT_T > | |
GEO_API GA_Offset | GEObuildPrimitives (GEO_Detail *detail, const std::pair< int, exint > *primtype_count_pairs, const GA_Offset init_startpt, const GA_Size npoints_per_copy, const GA_PolyCounts &vertexlistsizelist, const INT_T *vertexpointnumbers, const bool hassharedpoints, const exint *closed_span_lengths, const exint ncopies=1) |
#define __GEO_BuildPrimitives_h__ |
Definition at line 14 of file GEO_BuildPrimitives.h.
GEO_API GA_Offset GEObuildPrimitives | ( | GEO_Detail * | detail, |
const std::pair< int, exint > * | primtype_count_pairs, | ||
const GA_Offset | init_startpt, | ||
const GA_Size | npoints_per_copy, | ||
const GA_PolyCounts & | vertexlistsizelist, | ||
const INT_T * | vertexpointnumbers, | ||
const bool | hassharedpoints, | ||
const exint * | closed_span_lengths, | ||
const exint | ncopies = 1 |
||
) |
Function for building primitives in bulk, returning the first primitive offset. This sets up the primitive list, vertices, and topology attributes, parallelizing as much as possible. Any primitive content other than the contents of the GA_Primitive base class will be left at default values, so other data may still need to be initialized in other ways.
Instantiated for INT_T of int (int32) and exint (int64)
Despiate vertexlistsizelist being a GA_PolyCounts, (a run-length encoded array of vertex list sizes), this function works for any primitive types specified in the first component of each pair in primtype_count_pairs.
If ncopies > 1, startpt will have npoints_per_copy added to it between each copy.
Values in vertexpointnumbers are offsets, but relative to startpt, so if constructing from point offsets, be sure to subtract off startpt or specify startpt of GA_Offset(0).
vertexpointnumbers can optionally be nullptr, in which case, vertices will be wired to consecutive point offsets. (This implies that there are no shared points.) This is a fairly common case for separate curve primitives, packed primitives, or polygon soup primitives.
Even if vertexpointnumbers is non-null, hassharedpoints being false can save time (if it applies), because not having shared points avoids the need to ensure a deterministic order of the linked list topology attributes: vertex-to-next-vertex and vertex-to-previous-vertex.
First value of closed_span_lengths is the number with closed false. To start with closed true, have a value of 0 first, then the number with closed true. nullptr means closed false for all primitives.
Definition at line 62 of file GEO_BuildPrimitives.C.