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

Used to pass options and map offset values during saving. More...

#include <GA_SaveMap.h>

Public Member Functions

 GA_SaveMap (const GA_Detail &detail, const GA_SaveOptions *options)
 Generic save map used when saving geometry. More...
 
 ~GA_SaveMap ()
 Destructor. More...
 
const GA_SaveOptionsgetOptions () const
 
void setFileVersion (const char *v)
 During the loading process, the file version may be set. More...
 
const char * getFileVersion () const
 
const GA_DetailgetDetail () const
 Get the geometry being loaded. More...
 
const GA_RangegetPointRange () const
 Return the iterator for the points to be saved. More...
 
const GA_RangegetVertexRange () const
 Return the iterator for the vertices to be saved. More...
 
const GA_RangegetPrimitiveRange () const
 Return the iterator for the primitives to be saved. More...
 
const GA_RangegetGlobalRange () const
 Return the detail iterator. More...
 
const GA_RangegetRange (GA_AttributeOwner i) const
 Return an arbitrary iterator based on the owner type. More...
 
GA_Index getPointIndex (GA_Offset point_offset) const
 Take a point offset and returns its offset(index) in the save file. More...
 
GA_Index getVertexIndex (GA_Offset vertex_offset) const
 Take a vertex offset and returns its offset(index) in the save file. More...
 
GA_Index getPrimitiveIndex (GA_Offset primitive_offset) const
 Take a primitive offset and returns its offset(index) in the save file. More...
 
GA_Index getIndex (GA_Offset offset, GA_AttributeOwner o) const
 Return the save index associated with an element. More...
 
bool isTrivialMap (GA_AttributeOwner owner) const
 
bool getDefaultedBool (const char *name, bool defvalue) const
 Check the save options. Return defvalue if token isn't defined. More...
 
exint getDefaultedInt (const char *name, exint defvalue) const
 Check the save options. Return defvalue if token isn't defined. More...
 
const char * getDefaultedString (const char *name, UT_String &storage, const char *defvalue) const
 Check the save options. Return defvalue if the token isn't defined. More...
 
bool getSecondaryIndices (GA_Offset primary_offset, const GA_SecondaryLookupInfo &info, UT_Int64Array &secondary_prim_indices) const
 
bool optionSaveInfo () const
 "bool geo:saveinfo"
Whether to save info block More...
 
const char * optionArtistName (UT_String &s) const
 "string info:artist"
String containing the artist's name More...
 
const char * optionHostname (UT_String &s) const
 "string info:hostname"
String containing the host name More...
 
const char * optionDate (UT_String &s) const
 "string info:date"
Current date (default: Y-m-d T) More...
 
const char * optionSoftware (UT_String &s) const
 "string info:software"
Software (and version) More...
 
bool optionSaveBounds () const
 
bool optionSavePrimCount () const
 
bool optionSaveVolumeSummary () const
 
bool optionSaveAttributeSummary () const
 
bool optionSaveRenderAttributeRanges () const
 
bool optionSaveGroupSummary () const
 
bool optionSavePointGroups () const
 
bool optionSavePrimitiveGroups () const
 
bool optionSaveVertexGroups () const
 
bool optionSaveEdgeGroups () const
 
bool optionSaveBreakpointGroups () const
 
bool optionIgnoreAttributeScope () const
 
const char * optionAttributeSaveMask (UT_String &storage, const char *default_mask="*") const
 
const char * optionGroupSaveMask (UT_String &storage, const char *default_mask="*") const
 
bool hasSavedSharedData (const char *key) const
 
void setSavedSharedData (const char *key)
 Indicate the given data has been shared. More...
 

Detailed Description

Used to pass options and map offset values during saving.

This class is a container which stores iterators that iterate over the points/primitives/vertices to be saved. It also stores keyword arguments in the form of a UT_Options.

See Also
UT_JSONWriter
Examples:
packedshareddata/GU_PackedSharedData.C, packedshareddata/GU_PackedSharedData.h, packedsphere/GU_PackedSphere.C, packedsphere/GU_PackedSphere.h, tetprim/GEO_PrimTetra.C, and tetprim/GEO_PrimTetra.h.

Definition at line 48 of file GA_SaveMap.h.

Constructor & Destructor Documentation

GA_SaveMap::GA_SaveMap ( const GA_Detail detail,
const GA_SaveOptions options 
)

Generic save map used when saving geometry.

GA_SaveMap::~GA_SaveMap ( )

Destructor.

Member Function Documentation

bool GA_SaveMap::getDefaultedBool ( const char *  name,
bool  defvalue 
) const

Check the save options. Return defvalue if token isn't defined.

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

Check the save options. Return defvalue if token isn't defined.

const char* GA_SaveMap::getDefaultedString ( const char *  name,
UT_String storage,
const char *  defvalue 
) const

Check the save options. Return defvalue if the token isn't defined.

const GA_Detail& GA_SaveMap::getDetail ( ) const
inline

Get the geometry being loaded.

Definition at line 84 of file GA_SaveMap.h.

const char* GA_SaveMap::getFileVersion ( ) const
inline

Definition at line 81 of file GA_SaveMap.h.

const GA_Range& GA_SaveMap::getGlobalRange ( ) const
inline

Return the detail iterator.

Definition at line 100 of file GA_SaveMap.h.

GA_Index GA_SaveMap::getIndex ( GA_Offset  offset,
GA_AttributeOwner  o 
) const
inline

Return the save index associated with an element.

Definition at line 118 of file GA_SaveMap.h.

const GA_SaveOptions& GA_SaveMap::getOptions ( ) const
inline

The options in the save map are used to control behaviour during saving/loading of the geometry. The user can pass any arbitrary key/value pairs. Common options (used in the baseline GA library) are:

  • bool geo:primrun – Enable primitive run compression
  • int geo:primrunqueue – Size of primitives run queue [4]
  • bool geo:savepointgroups – Save point groups [true]
  • bool geo:saveprimitivegroups – Save primitive groups [true]
  • bool geo:savevertexgroups – Save vertex groups [true]
  • bool geo:saveedgegroups – Save edge groups [true]
  • bool geo:savegroups – Save all groups [true]
  • bool geo:saveinternal – Saving of internal groups [false]
  • bool geo:houdini10format – Save in Houdini10 format [false]
  • bool geo:rlebits – Run length encoding of bit arrays [true]
  • bool geo:ignoreattribscope – Save private attribs by default Additional options for controlling the JSON stream can be found in UT_JSONWriter::setOptions() (i.e. json:precision).
    See Also
    UT_JSONWriter

Definition at line 77 of file GA_SaveMap.h.

GA_Index GA_SaveMap::getPointIndex ( GA_Offset  point_offset) const

Take a point offset and returns its offset(index) in the save file.

const GA_Range& GA_SaveMap::getPointRange ( ) const
inline

Return the iterator for the points to be saved.

Definition at line 87 of file GA_SaveMap.h.

GA_Index GA_SaveMap::getPrimitiveIndex ( GA_Offset  primitive_offset) const

Take a primitive offset and returns its offset(index) in the save file.

const GA_Range& GA_SaveMap::getPrimitiveRange ( ) const
inline

Return the iterator for the primitives to be saved.

Definition at line 97 of file GA_SaveMap.h.

const GA_Range& GA_SaveMap::getRange ( GA_AttributeOwner  i) const
inline

Return an arbitrary iterator based on the owner type.

Definition at line 103 of file GA_SaveMap.h.

bool GA_SaveMap::getSecondaryIndices ( GA_Offset  primary_offset,
const GA_SecondaryLookupInfo info,
UT_Int64Array secondary_prim_indices 
) const

Convert the secondary primitives offsets in the given lookup object into indices.

GA_Index GA_SaveMap::getVertexIndex ( GA_Offset  vertex_offset) const

Take a vertex offset and returns its offset(index) in the save file.

const GA_Range& GA_SaveMap::getVertexRange ( ) const
inline

Return the iterator for the vertices to be saved.

Definition at line 90 of file GA_SaveMap.h.

bool GA_SaveMap::hasSavedSharedData ( const char *  key) const

Test if the data associated with the unique key has been saved The key specified should be something which is guaranteed to be unique for the given data. However, it should be the same key for each shared instance. For example, given a shared pointer to data, you might consider:

sprintf(key, "%s:%s:%p",
getTypeName(), // Primitive type name
"data_type",
shared_ptr.get());
Examples:
packedshareddata/GU_PackedSharedData.C.
bool GA_SaveMap::isTrivialMap ( GA_AttributeOwner  owner) const
const char* GA_SaveMap::optionArtistName ( UT_String s) const
inline

"string info:artist"
String containing the artist's name

Definition at line 164 of file GA_SaveMap.h.

const char* GA_SaveMap::optionAttributeSaveMask ( UT_String storage,
const char *  default_mask = "*" 
) const
inline

"string geo:attributesavemask"
Specify the "mask" for attributes which should be saved. This mask is in the form used by UT_String::multiMatch().

Definition at line 262 of file GA_SaveMap.h.

const char* GA_SaveMap::optionDate ( UT_String s) const
inline

"string info:date"
Current date (default: Y-m-d T)

Definition at line 170 of file GA_SaveMap.h.

const char* GA_SaveMap::optionGroupSaveMask ( UT_String storage,
const char *  default_mask = "*" 
) const
inline

"string geo:groupsavemask"
Specify the "mask" for groups which should be saved. This mask is in the form used by UT_String::multiMatch()

Definition at line 272 of file GA_SaveMap.h.

const char* GA_SaveMap::optionHostname ( UT_String s) const
inline

"string info:hostname"
String containing the host name

Definition at line 167 of file GA_SaveMap.h.

bool GA_SaveMap::optionIgnoreAttributeScope ( ) const
inline

"bool geo:ignoreattribscope"
When saving, private attributes are not typically saved. If this option is set, the scope of attributes should be ignored The GA_OPTION_EXPORT_ON_SAVE should override this option.

Definition at line 255 of file GA_SaveMap.h.

bool GA_SaveMap::optionSaveAttributeSummary ( ) const
inline

"bool info:saveattributesummary"
Whether to save a summary of attributes in the info block.

Definition at line 193 of file GA_SaveMap.h.

bool GA_SaveMap::optionSaveBounds ( ) const
inline

"bool info:savebounds"
Whether to compute and save bounding box in the info block.

Definition at line 178 of file GA_SaveMap.h.

bool GA_SaveMap::optionSaveBreakpointGroups ( ) const
inline

"bool geo:savebreakpointgroups"
Whether to save breakpoint groups

Note
This will returns the intersection with "bool geo:savegroups"

Definition at line 245 of file GA_SaveMap.h.

bool GA_SaveMap::optionSaveEdgeGroups ( ) const
inline

"bool geo:saveedgegroups"
Whether to save edge groups

Note
This will returns the intersection with "bool geo:savegroups"

Definition at line 238 of file GA_SaveMap.h.

bool GA_SaveMap::optionSaveGroupSummary ( ) const
inline

"bool info:savegroupsummary"
Whether to save a summary of groups in the info block.

Definition at line 212 of file GA_SaveMap.h.

bool GA_SaveMap::optionSaveInfo ( ) const
inline

"bool geo:saveinfo"
Whether to save info block

Definition at line 160 of file GA_SaveMap.h.

bool GA_SaveMap::optionSavePointGroups ( ) const
inline

"bool geo:savepointgroups"
Whether to save point groups

Note
This will returns the intersection with "bool geo:savegroups"

Definition at line 217 of file GA_SaveMap.h.

bool GA_SaveMap::optionSavePrimCount ( ) const
inline

"bool info:saveprimcounts"
Whether to compute and save the counts of each primitive type into the info block.

Definition at line 183 of file GA_SaveMap.h.

bool GA_SaveMap::optionSavePrimitiveGroups ( ) const
inline

"bool geo:saveprimitivegroups"
Whether to save primitive groups

Note
This will returns the intersection with "bool geo:savegroups"

Definition at line 224 of file GA_SaveMap.h.

bool GA_SaveMap::optionSaveRenderAttributeRanges ( ) const
inline

"bool info:saverenderattributeranges"
Will save the ranges for velocity attributes ("v" as point/primitive) and the "width" attribute (point, primitive, detail) if they exist. These can be used by rendering procedurals to adjust the bounds to include velocity and width attributes.

This is included in the attribute summary, so for this option to work, you need to have info:saveattributesummary enabled.

Definition at line 204 of file GA_SaveMap.h.

bool GA_SaveMap::optionSaveVertexGroups ( ) const
inline

"bool geo:savevertexgroups"
Whether to save vertex groups

Note
This will returns the intersection with "bool geo:savegroups"

Definition at line 231 of file GA_SaveMap.h.

bool GA_SaveMap::optionSaveVolumeSummary ( ) const
inline

"bool info:savevolumesummary"
Whether to compute and save the volume info into the info block.

Definition at line 188 of file GA_SaveMap.h.

const char* GA_SaveMap::optionSoftware ( UT_String s) const
inline

"string info:software"
Software (and version)

Definition at line 173 of file GA_SaveMap.h.

void GA_SaveMap::setFileVersion ( const char *  v)
inline

During the loading process, the file version may be set.

Definition at line 80 of file GA_SaveMap.h.

void GA_SaveMap::setSavedSharedData ( const char *  key)

Indicate the given data has been shared.

Examples:
packedshareddata/GU_PackedSharedData.C.

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