HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GA_LoadMap Class Reference

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_DetailgetDetail () const
 Get the geometry being loaded. More...
 
const GA_LoadOptionsgetOptions () 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_IndexMapgetActivePointMap () const
 
const GA_IndexMapgetActiveVertexMap () const
 
const GA_IndexMapgetActivePrimitiveMap () const
 
const GA_IndexMapgetActiveIndexMap (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 *callerPrimitive) const
 
void resolveSharedData (GA_SharedLoadData *data)
 
bool forceLoadSharedData (UT_JSONParser &p, const GA_PrimitiveFactory &factory)
 
GA_PrimitivegetRandomPrimitive (const char *key)
 
void setFilename (const char *filename)
 Set's the filename to load shared data from. More...
 
bool loadIndex (UT_IStream *jsonInternalStream, const char *indexPosKey, bool shouldSwap)
 
GA_GeometryIndexgetIndex ()
 

Detailed Description

Member Typedef Documentation

Constructor & Destructor Documentation

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 ( )

Member Function Documentation

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

const GA_IndexMap* GA_LoadMap::getActiveIndexMap ( GA_AttributeOwner  owner) const
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.

const GA_IndexMap* GA_LoadMap::getActivePointMap ( ) const
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.

const GA_IndexMap* GA_LoadMap::getActivePrimitiveMap ( ) const
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.

const GA_IndexMap* GA_LoadMap::getActiveVertexMap ( ) const
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.

exint GA_LoadMap::getDefaultedInt ( const char *  name,
exint  defvalue 
) const

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.

GA_Detail& GA_LoadMap::getDetail ( ) const
inline

Get the geometry being loaded.

Definition at line 59 of file GA_LoadMap.h.

const char* GA_LoadMap::getFileVersion ( UT_String storage) const
inline

Definition at line 75 of file GA_LoadMap.h.

GA_GeometryIndex* GA_LoadMap::getIndex ( )
inline

Definition at line 277 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.

GA_Offset GA_LoadMap::getLoadOffset ( GA_AttributeOwner  owner) const
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.

GA_Offset GA_LoadMap::getOffset ( GA_Size  load_index,
GA_AttributeOwner  o 
) const
inline

Return the mapping of the load offset to the real offset.

Definition at line 122 of file GA_LoadMap.h.

const GA_LoadOptions& GA_LoadMap::getOptions ( ) const
inline

Read only version of options. Options which callers might set that the loading code can examine:

  • bool geo:readonly
    This indicates that the geometry will be loaded as read-only geometry and will never be modified (no new points, no new attributes, no modification of data). This can be used to perform things like on-demand/deferred loading of data.
  • string fileversion
    This is set to the "fileversion" tag in the JSON file.

Definition at line 70 of file GA_LoadMap.h.

GA_Offset GA_LoadMap::getPointOffset ( GA_Size  load_index) const
inline

Map the load_index to the actual point number in the detail.

Definition at line 125 of file GA_LoadMap.h.

GA_Offset GA_LoadMap::getPointOffset ( ) const
inline

Definition at line 171 of file GA_LoadMap.h.

GA_Offset GA_LoadMap::getPrimitiveOffset ( GA_Size  load_index) const
inline

Map the load_index to the actual primitive number in the detail.

Definition at line 143 of file GA_LoadMap.h.

GA_Offset GA_LoadMap::getPrimitiveOffset ( ) const
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.

GA_Offset GA_LoadMap::getVertexOffset ( GA_Size  load_index) const
inline

Map the load_index to the actual vertex number in the detail.

Examples:
tetprim/GEO_PrimTetra.C.

Definition at line 134 of file GA_LoadMap.h.

GA_Offset GA_LoadMap::getVertexOffset ( ) const
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 jsonInternalStream,
const char *  indexPosKey,
bool  shouldSwap 
)

Loads the index from given stream into this load map

Returns
true on sucsess false on failure
GA_SharedDataHandlePtr GA_LoadMap::needSharedData ( const UT_StringHolder key,
const UT_StringRef typekey,
GA_Primitive callerPrimitive 
) 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.

Examples:
packedshareddata/GU_PackedSharedData.C.
const char* GA_LoadMap::optionAttributeLoadMask ( UT_String storage,
const char *  default_mask = "*" 
) const
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.

const char* GA_LoadMap::optionGroupLoadMask ( UT_String storage,
const char *  default_mask = "*" 
) const
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.

bool GA_LoadMap::optionLoadPrimitives ( ) const
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.

bool GA_LoadMap::optionLoadPrimitiveSharedData ( ) const
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.

void GA_LoadMap::setFileVersion ( const char *  version)
inline

Set/get the file version.

Definition at line 73 of file GA_LoadMap.h.

void GA_LoadMap::setOptionF ( const char *  key,
fpreal  v 
)
inline

Set a real/float option.

Definition at line 87 of file GA_LoadMap.h.

void GA_LoadMap::setOptionI ( const char *  key,
int  v 
)
inline

Set an integer option.

Definition at line 84 of file GA_LoadMap.h.

void GA_LoadMap::setOptionS ( const char *  key,
const char *  value 
)
inline

Set a string option.

Definition at line 81 of file GA_LoadMap.h.


The documentation for this class was generated from the following file: