HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HDK_Sample::geo_PrimTetraJSON Class Reference
+ Inheritance diagram for HDK_Sample::geo_PrimTetraJSON:

Public Types

enum  { geo_TBJ_VERTEX, geo_TBJ_ENTRIES }
 

Public Member Functions

 geo_PrimTetraJSON ()
 
 ~geo_PrimTetraJSON () override
 
const GEO_PrimTetratet (const GA_Primitive *p) const
 
GEO_PrimTetratet (GA_Primitive *p) const
 
int getEntries () const override
 Return the number of data fields in the primitive private schema. More...
 
const UT_StringHoldergetKeyword (int i) const override
 
bool saveField (const GA_Primitive *pr, int i, UT_JSONWriter &w, const GA_SaveMap &map) const override
 
bool saveField (const GA_Primitive *pr, int i, UT_JSONValue &v, const GA_SaveMap &map) const override
 
bool loadField (GA_Primitive *pr, int i, UT_JSONParser &p, const GA_LoadMap &map) const override
 
bool loadField (GA_Primitive *pr, int i, UT_JSONParser &p, const UT_JSONValue &v, const GA_LoadMap &map) const override
 
bool isEqual (int i, const GA_Primitive *p0, const GA_Primitive *p1) const override
 
- Public Member Functions inherited from GA_PrimitiveJSON
 GA_PrimitiveJSON ()
 
virtual ~GA_PrimitiveJSON ()
 
virtual bool shouldSaveField (const GA_Primitive *prim, int i, const GA_SaveMap &save) const
 
virtual bool save (const GA_Primitive *prim, UT_JSONWriter &w, const GA_SaveMap &map) const
 
virtual bool save (const GA_Primitive *prim, UT_JSONValue &v, const GA_SaveMap &map) const
 Save a single primitive to a UT_JSONValue. More...
 
virtual bool load (GA_Primitive *prim, UT_JSONParser &p, const GA_LoadMap &map) const
 
virtual bool load (GA_Primitive *prim, UT_JSONParser &p, const UT_JSONValue &value, const GA_LoadMap &map) const
 Load a single primitive from a UT_JSONValue. More...
 

Additional Inherited Members

- Protected Member Functions inherited from GA_PrimitiveJSON
virtual bool getRunFields (const GA_Primitive **list, int list_size, const GA_SaveMap &save, UT_StringArray &varying, UT_JSONValue &uniform, uint &user_flags) const
 
virtual bool matchRun (const GA_Primitive *prim0, const GA_Primitive *prim1, const UT_StringArray &varying, const UT_JSONValue &uniform, uint user_flags) const
 
virtual bool saveRunFields (const GA_Primitive *prim, const GA_SaveMap &save, const UT_StringArray &varying, UT_JSONWriter &w, uint user_flags) const
 
virtual bool load (GA_Primitive *prim, UT_JSONParser &p, const GA_LoadMap &load, const UT_StringArray &varying, const GA_JSONUniformBlock &uniform) const
 
virtual bool loadUniform (GA_Primitive *prim, UT_JSONParser &p, const GA_LoadMap &map, const GA_JSONUniformBlock &uniform) const
 
virtual bool loadUnknownToken (GA_Primitive *prim, const char *token, UT_JSONParser &p, const GA_LoadMap &load) const
 
void init ()
 
- Protected Attributes inherited from GA_PrimitiveJSON
UT_FSAmyTokens
 
int myEntries
 

Detailed Description

Examples:
tetprim/GEO_PrimTetra.C.

Definition at line 286 of file GEO_PrimTetra.C.

Member Enumeration Documentation

anonymous enum
Enumerator
geo_TBJ_VERTEX 
geo_TBJ_ENTRIES 

Definition at line 294 of file GEO_PrimTetra.C.

Constructor & Destructor Documentation

HDK_Sample::geo_PrimTetraJSON::geo_PrimTetraJSON ( )
inline

Definition at line 289 of file GEO_PrimTetra.C.

HDK_Sample::geo_PrimTetraJSON::~geo_PrimTetraJSON ( )
inlineoverride

Definition at line 292 of file GEO_PrimTetra.C.

Member Function Documentation

int HDK_Sample::geo_PrimTetraJSON::getEntries ( ) const
inlineoverridevirtual

Return the number of data fields in the primitive private schema.

Implements GA_PrimitiveJSON.

Definition at line 305 of file GEO_PrimTetra.C.

const UT_StringHolder& HDK_Sample::geo_PrimTetraJSON::getKeyword ( int  i) const
inlineoverridevirtual

Return the keyword associated with the i'th entry of the schema. Keywords are case insensitive, but must be specified as lower case by this method.

Implements GA_PrimitiveJSON.

Definition at line 307 of file GEO_PrimTetra.C.

bool HDK_Sample::geo_PrimTetraJSON::isEqual ( int  i,
const GA_Primitive prim1,
const GA_Primitive prim2 
) const
inlineoverridevirtual

Determine if the i'th entry of a primitive's private schema is equal to the value in another primitive. This determines whether the data can be created as "uniform" data a run of sequential primitives.

Implements GA_PrimitiveJSON.

Definition at line 368 of file GEO_PrimTetra.C.

bool HDK_Sample::geo_PrimTetraJSON::loadField ( GA_Primitive prim,
int  i,
UT_JSONParser p,
const GA_LoadMap load 
) const
inlineoverridevirtual

Load the i'th entry of the primitive's private schema from a JSON stream.

Implements GA_PrimitiveJSON.

Definition at line 342 of file GEO_PrimTetra.C.

bool HDK_Sample::geo_PrimTetraJSON::loadField ( GA_Primitive prim,
int  i,
UT_JSONParser p,
const UT_JSONValue value,
const GA_LoadMap load 
) const
inlineoverridevirtual

Load the i'th entry of the primitive's private schema from a JSON value. The parser is passed in so that errors/warnings can be added.

The default implementation just calls:

UT_AutoJSONIStream is(p, value);
return loadField(prim, i, p, load);

Reimplemented from GA_PrimitiveJSON.

Definition at line 355 of file GEO_PrimTetra.C.

bool HDK_Sample::geo_PrimTetraJSON::saveField ( const GA_Primitive prim,
int  i,
UT_JSONWriter w,
const GA_SaveMap save 
) const
inlineoverridevirtual

Save the i'th entry of the primitive's schema to the JSON stream. You can assume that the GA_Primitive is the correct type (i.e. a static cast is ok).

Implements GA_PrimitiveJSON.

Definition at line 317 of file GEO_PrimTetra.C.

bool HDK_Sample::geo_PrimTetraJSON::saveField ( const GA_Primitive prim,
int  i,
UT_JSONValue value,
const GA_SaveMap save 
) const
inlineoverridevirtual

Save the i'th entry of the primitive's schema to a JSON Value. This method should only be called when saving uniform data, which only happens if the equality checking returned true for the i'th entry. If the comparison fails, then this method will never be called.

The default method just calls:

return saveField(prim, i, *w, save);

Reimplemented from GA_PrimitiveJSON.

Definition at line 329 of file GEO_PrimTetra.C.

const GEO_PrimTetra* HDK_Sample::geo_PrimTetraJSON::tet ( const GA_Primitive p) const
inline

Definition at line 300 of file GEO_PrimTetra.C.

GEO_PrimTetra* HDK_Sample::geo_PrimTetraJSON::tet ( GA_Primitive p) const
inline

Definition at line 302 of file GEO_PrimTetra.C.


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