HDK
|
Options during loading. More...
#include <GA_LoadMap.h>
Classes | |
class | nontrivialmap |
Public Types | |
typedef UT_StringMap < GA_SharedDataHandlePtr > | SharedDataHandleMapType |
typedef UT_StringMap < GA_Primitive * > | PrimitiveStorageMapType |
Public Member Functions | |
GA_LoadMap (GA_Detail &gdp, const GA_LoadOptions *options, GA_Offset vtxoff, GA_Offset ptoff, GA_Offset primoff) | |
GA_LoadMap (GA_Detail &gdp, const GA_LoadOptions *options, nontrivialmap) | |
~GA_LoadMap () | |
GA_Detail & | getDetail () const |
Get the geometry being loaded. More... | |
const GA_LoadOptions & | getOptions () const |
void | setFileVersion (const char *version) |
Set/get the file version. More... | |
const char * | getFileVersion (UT_String &storage) const |
bool | isFileAtLeastVersion (const char *version) const |
Test to see whether the file version is at least the given version. More... | |
void | setOptionS (const char *key, const char *value) |
Set a string option. More... | |
void | setOptionI (const char *key, int v) |
Set an integer option. More... | |
void | setOptionF (const char *key, fpreal v) |
Set a real/float option. More... | |
const GA_IndexMap * | getActivePointMap () const |
const GA_IndexMap * | getActiveVertexMap () const |
const GA_IndexMap * | getActivePrimitiveMap () const |
const GA_IndexMap * | getActiveIndexMap (GA_AttributeOwner owner) const |
GA_Offset | getOffset (GA_Size load_index, GA_AttributeOwner o) const |
Return the mapping of the load offset to the real offset. More... | |
GA_Offset | getPointOffset (GA_Size load_index) const |
Map the load_index to the actual point number in the detail. More... | |
GA_Offset | getVertexOffset (GA_Size load_index) const |
Map the load_index to the actual vertex number in the detail. More... | |
GA_Offset | getPrimitiveOffset (GA_Size load_index) const |
Map the load_index to the actual primitive number in the detail. More... | |
GA_Offset | getLoadOffset (GA_AttributeOwner owner) const |
GA_Offset | getPointOffset () const |
GA_Offset | getVertexOffset () const |
GA_Offset | getPrimitiveOffset () const |
GA_Size | getLoadCount (GA_AttributeOwner owner) const |
This method returns the number of elements being loaded of each type. More... | |
void | badPrimitive (UT_JSONParser &p, const char *type) |
Warn about unknown primitive types in the load process. More... | |
bool | addBadPrimitive (const char *type) |
bool | getSecondaryOffsets (GA_Offset primary_offset, const UT_Int64Array &secondary_detail_indices, const UT_Int64Array &secondary_prim_indices, UT_Int64Array &secondary_prim_offsets) const |
Convert the given secondary primitive indices into data offsets. More... | |
bool | getDefaultedBool (const char *name, bool defvalue) const |
Check the load options. Return defvalue if token isn't defined. More... | |
exint | getDefaultedInt (const char *name, exint defvalue) const |
Check the load options. Return defvalue if token isn't defined. More... | |
const char * | getDefaultedString (const char *name, UT_String &storage, const char *defvalue) const |
Check the load options. Return defvalue if the token isn't defined. More... | |
const char * | optionAttributeLoadMask (UT_String &storage, const char *default_mask="*") const |
const char * | optionGroupLoadMask (UT_String &storage, const char *default_mask="*") const |
bool | optionLoadPrimitives () const |
bool | optionLoadPrimitiveSharedData () const |
GA_SharedDataHandlePtr | needSharedData (const UT_StringHolder &key, const UT_StringRef &typekey, GA_Primitive *caller_prim) const |
void | resolveSharedData (GA_SharedLoadData *data) |
bool | forceLoadSharedData (UT_JSONParser &p, const GA_PrimitiveFactory &factory) |
GA_Primitive * | getRandomPrimitive (const char *key) |
void | setFilename (const char *filename) |
Set's the filename to load shared data from. More... | |
bool | loadIndex (UT_IStream *json_istream, const char *index_pos_key, bool should_swap) |
GA_GeometryIndex * | getIndex () |
Options during loading.
Definition at line 42 of file GA_LoadMap.h.
Definition at line 47 of file GA_LoadMap.h.
Definition at line 46 of file GA_LoadMap.h.
GA_LoadMap::GA_LoadMap | ( | GA_Detail & | gdp, |
const GA_LoadOptions * | options, | ||
GA_Offset | vtxoff, | ||
GA_Offset | ptoff, | ||
GA_Offset | primoff | ||
) |
GA_LoadMap::GA_LoadMap | ( | GA_Detail & | gdp, |
const GA_LoadOptions * | options, | ||
nontrivialmap | |||
) |
GA_LoadMap::~GA_LoadMap | ( | ) |
bool GA_LoadMap::addBadPrimitive | ( | const char * | type | ) |
Returns true if this is the time this type of primitive was added to bad primitive table.
void GA_LoadMap::badPrimitive | ( | UT_JSONParser & | p, |
const char * | type | ||
) |
Warn about unknown primitive types in the load process.
bool GA_LoadMap::forceLoadSharedData | ( | UT_JSONParser & | p, |
const GA_PrimitiveFactory & | factory | ||
) |
Called by the loader to parse the shared load data. Not used when the geomentry has an index
|
inline |
Return the index map used to map the load offset to the real offset, if any. An active map is present when loading a fragmented block.
Definition at line 104 of file GA_LoadMap.h.
|
inline |
Return the index map used to map the load offset to the real offset, if any. An active map is present when loading a fragmented block.
Definition at line 92 of file GA_LoadMap.h.
|
inline |
Return the index map used to map the load offset to the real offset, if any. An active map is present when loading a fragmented block.
Definition at line 100 of file GA_LoadMap.h.
|
inline |
Return the index map used to map the load offset to the real offset, if any. An active map is present when loading a fragmented block.
Definition at line 96 of file GA_LoadMap.h.
bool GA_LoadMap::getDefaultedBool | ( | const char * | name, |
bool | defvalue | ||
) | const |
Check the load options. Return defvalue
if token isn't defined.
Check the load options. Return defvalue
if token isn't defined.
const char* GA_LoadMap::getDefaultedString | ( | const char * | name, |
UT_String & | storage, | ||
const char * | defvalue | ||
) | const |
Check the load options. Return defvalue
if the token isn't defined.
|
inline |
Get the geometry being loaded.
Definition at line 59 of file GA_LoadMap.h.
|
inline |
Definition at line 75 of file GA_LoadMap.h.
|
inline |
Definition at line 278 of file GA_LoadMap.h.
GA_Size GA_LoadMap::getLoadCount | ( | GA_AttributeOwner | owner | ) | const |
This method returns the number of elements being loaded of each type.
|
inline |
Elements are loaded at a fixed offset (usually 0) in the index maps. This method returns the load offset for a particular owner type.
Definition at line 154 of file GA_LoadMap.h.
|
inline |
Return the mapping of the load offset to the real offset.
Definition at line 122 of file GA_LoadMap.h.
|
inline |
Read only version of options. Options which callers might set that the loading code can examine:
Definition at line 70 of file GA_LoadMap.h.
Map the load_index to the actual point number in the detail.
Definition at line 125 of file GA_LoadMap.h.
|
inline |
Definition at line 171 of file GA_LoadMap.h.
Map the load_index to the actual primitive number in the detail.
Definition at line 143 of file GA_LoadMap.h.
|
inline |
Definition at line 175 of file GA_LoadMap.h.
GA_Primitive* GA_LoadMap::getRandomPrimitive | ( | const char * | key | ) |
Retrieves a random primitive that needs the shared data with the given key.
bool GA_LoadMap::getSecondaryOffsets | ( | GA_Offset | primary_offset, |
const UT_Int64Array & | secondary_detail_indices, | ||
const UT_Int64Array & | secondary_prim_indices, | ||
UT_Int64Array & | secondary_prim_offsets | ||
) | const |
Convert the given secondary primitive indices into data offsets.
Map the load_index to the actual vertex number in the detail.
Definition at line 134 of file GA_LoadMap.h.
|
inline |
Definition at line 173 of file GA_LoadMap.h.
bool GA_LoadMap::isFileAtLeastVersion | ( | const char * | version | ) | const |
Test to see whether the file version is at least the given version.
bool GA_LoadMap::loadIndex | ( | UT_IStream * | json_istream, |
const char * | index_pos_key, | ||
bool | should_swap | ||
) |
Loads the index from given stream into this load map
GA_SharedDataHandlePtr GA_LoadMap::needSharedData | ( | const UT_StringHolder & | key, |
const UT_StringRef & | typekey, | ||
GA_Primitive * | caller_prim | ||
) | const |
When a primitive is being loaded, and it has a reference to shared data, it needs to call this method to retrieve a handle to the shared data so it can be loaded upon request.
|
inline |
"string geo:attributeloadmask"
Specify the "mask" for attributes which should be loaded. This mask is in the form used by UT_String::multiMatch().
Definition at line 209 of file GA_LoadMap.h.
|
inline |
"string geo:grouploadmask"
Specify the "mask" for groups which should be loaded. This mask is in the form used by UT_String::multiMatch()
Definition at line 219 of file GA_LoadMap.h.
|
inline |
"bool geo:loadprimitives"
Load vertex & primitive data.
Turning this off will perform early termination when loading JSON files (which may affect reading from streamed data).
Definition at line 231 of file GA_LoadMap.h.
|
inline |
"bool geo:loadprimitiveshared"
Load primitive shared data. This is data which can be shared between multiple primitives and is optionally loaded.
Turning this off will perform early termination when loading JSON files (which may affect reading from streamed data).
Definition at line 241 of file GA_LoadMap.h.
void GA_LoadMap::resolveSharedData | ( | GA_SharedLoadData * | data | ) |
This method is called internally to resolve shared data when there is no index.
void GA_LoadMap::setFilename | ( | const char * | filename | ) |
Set's the filename to load shared data from.
|
inline |
Set/get the file version.
Definition at line 73 of file GA_LoadMap.h.
Set a real/float option.
Definition at line 87 of file GA_LoadMap.h.
Set an integer option.
Definition at line 84 of file GA_LoadMap.h.
|
inline |
Set a string option.
Definition at line 81 of file GA_LoadMap.h.