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

Class which stores the default values for a GA_Attribute. More...

#include <GA_Defaults.h>

+ Inheritance diagram for GA_Defaults:

Classes

class  matrix3
 
class  matrix4
 

Public Types

typedef UT_Defaults Base
 

Public Member Functions

 GA_Defaults ()
 Default constructor – the default will be 0. More...
 
 GA_Defaults (const UT_Options *options)
 Construct by extracting data out of a UT_Options. More...
 
 GA_Defaults (GA_Storage storage, int count,...)
 
 GA_Defaults (const GA_Defaults &src)
 Copy constructor. More...
 
 ~GA_Defaults ()
 
GA_Defaultsoperator= (const GA_Defaults &src)
 
SYS_FORCE_INLINE void copy (const GA_Defaults &src)
 Copy values from another set of defaults. More...
 
void saveToOptions (UT_Options &options, bool always=true) const
 
void set (const int32 *values, int count)
 Set defaults to the list of integer values. More...
 
void set (const int64 *values, int count)
 Set defaults to the list of integer values. More...
 
void set (const fpreal32 *values, int count)
 Set defaults to the list of real values. More...
 
void set (const fpreal64 *values, int count)
 Set defaults to the list of real values. More...
 
void guessFromName (const UT_StringRef &name, int tuple_size)
 
SYS_FORCE_INLINE int size () const
 
bool jsonSave (UT_JSONWriter &w) const
 
bool jsonLoad (UT_JSONParser &p)
 Load data from a JSON stream. More...
 
 GA_Defaults (matrix3)
 
 GA_Defaults (matrix4)
 
 GA_Defaults (int64 value)
 
 GA_Defaults (int32 value)
 
 GA_Defaults (fpreal64 value)
 Construct by repeating the value. More...
 
 GA_Defaults (fpreal32 value)
 
 GA_Defaults (const int32 *values, int count)
 
 GA_Defaults (const int64 *values, int count)
 
 GA_Defaults (const fpreal32 *values, int count)
 
 GA_Defaults (const fpreal64 *values, int count)
 
void get (int index, int32 &v) const
 
void get (int index, int64 &v) const
 
void get (int index, fpreal32 &v) const
 
void get (int index, fpreal64 &v) const
 
- Public Member Functions inherited from UT_Defaults
SYS_FORCE_INLINE UT_Defaults ()
 
template<typename T >
SYS_FORCE_INLINE UT_Defaults (T value)
 
template<typename T >
 UT_Defaults (const T *values, exint tuplesize)
 
UT_Defaultsoperator= (const UT_Defaults &that)
 
SYS_FORCE_INLINE UT_Defaultsoperator= (UT_Defaults &&that)
 
SYS_FORCE_INLINE UT_Defaults (const UT_Defaults &that)
 
SYS_FORCE_INLINE UT_Defaults (UT_Defaults &&that)
 
bool operator== (const UT_Defaults &that) const
 
SYS_FORCE_INLINE bool operator!= (const UT_Defaults &that) const
 
SYS_FORCE_INLINE ~UT_Defaults ()
 
SYS_FORCE_INLINE void clear ()
 
int64 getMemoryUsage (bool inclusive) const
 
SYS_FORCE_INLINE bool isZero () const
 
SYS_FORCE_INLINE UT_Storage getStorage () const
 
SYS_FORCE_INLINE exint getTupleSize () const
 
fpreal64 getF (exint i=0) const
 
int64 getI (exint i=0) const
 

Additional Inherited Members

- Protected Member Functions inherited from UT_Defaults
SYS_FORCE_INLINE void initZero ()
 
template<typename T >
SYS_FORCE_INLINE void initValue (T value)
 
- Protected Attributes inherited from UT_Defaults
union {
   fpreal64 *   myFTuple
 
   int64 *   myITuple
 
   fpreal64   myF
 
   int64   myI
 
}; 
 
UT_TupleType<-1, voidmyType
 

Detailed Description

Class which stores the default values for a GA_Attribute.

This class stores a list of integer/real values which can be used to initialize attribute data.

Examples:
euclid/SOP_Euclid.C, SIM/SIM_SolverHair.C, SIM/SNOW_Solver.C, and SOP/SOP_IKSample.C.

Definition at line 35 of file GA_Defaults.h.

Member Typedef Documentation

Definition at line 41 of file GA_Defaults.h.

Constructor & Destructor Documentation

GA_Defaults::GA_Defaults ( )
inline

Default constructor – the default will be 0.

Definition at line 45 of file GA_Defaults.h.

GA_Defaults::GA_Defaults ( const UT_Options options)
explicit

Construct by extracting data out of a UT_Options.

GA_Defaults::GA_Defaults ( GA_Storage  storage,
int  count,
  ... 
)

Construct a set of defaults from variadic arguments. For example

GA_Defaults a(GA_STORE_INT32, 3, 0, 1, 2);

This style of construction is a little bit dangerous, so please ensure

  • All data arguments are the right type
  • You have the proper count of variadic arguments
  • You use only one of the supported types: INT32, INT64 or REAL64 All other types will either cause compiler errors or crashing Otherwise, core dumping may occur.
GA_Defaults::GA_Defaults ( matrix3  )

Construct by repeating the value

GA_Defaults::GA_Defaults ( matrix4  )

Construct by repeating the value

GA_Defaults::GA_Defaults ( int64  value)
inlineexplicit

Construct by repeating the value

Definition at line 77 of file GA_Defaults.h.

GA_Defaults::GA_Defaults ( int32  value)
inlineexplicit

Construct by repeating the value

Definition at line 89 of file GA_Defaults.h.

GA_Defaults::GA_Defaults ( fpreal64  value)
inlineexplicit

Construct by repeating the value.

Definition at line 102 of file GA_Defaults.h.

GA_Defaults::GA_Defaults ( fpreal32  value)
inlineexplicit

Construct by repeating the value

Definition at line 114 of file GA_Defaults.h.

GA_Defaults::GA_Defaults ( const int32 values,
int  count 
)
inline

Construct by passing a vector of scalar values Note that the defaults will copy the data out of the values passed in (so the array doesn't have to be persistent).

Definition at line 133 of file GA_Defaults.h.

GA_Defaults::GA_Defaults ( const int64 values,
int  count 
)
inline

Construct by passing a vector of scalar values Note that the defaults will copy the data out of the values passed in (so the array doesn't have to be persistent).

Definition at line 134 of file GA_Defaults.h.

GA_Defaults::GA_Defaults ( const fpreal32 values,
int  count 
)
inline

Construct by passing a vector of scalar values Note that the defaults will copy the data out of the values passed in (so the array doesn't have to be persistent).

Definition at line 135 of file GA_Defaults.h.

GA_Defaults::GA_Defaults ( const fpreal64 values,
int  count 
)
inline

Construct by passing a vector of scalar values Note that the defaults will copy the data out of the values passed in (so the array doesn't have to be persistent).

Definition at line 136 of file GA_Defaults.h.

GA_Defaults::GA_Defaults ( const GA_Defaults src)
inline

Copy constructor.

Definition at line 147 of file GA_Defaults.h.

GA_Defaults::~GA_Defaults ( )
inline

Definition at line 148 of file GA_Defaults.h.

Member Function Documentation

SYS_FORCE_INLINE void GA_Defaults::copy ( const GA_Defaults src)
inline

Copy values from another set of defaults.

Definition at line 167 of file GA_Defaults.h.

void GA_Defaults::get ( int  index,
int32 v 
) const
inline

Get a value out of the defaults.

  • Automatically casts defaults into appropriate return type
  • Clamps index to tuple size
  • If there is no default data, then, the result will be 0

Definition at line 226 of file GA_Defaults.h.

void GA_Defaults::get ( int  index,
int64 v 
) const
inline

Get a value out of the defaults.

  • Automatically casts defaults into appropriate return type
  • Clamps index to tuple size
  • If there is no default data, then, the result will be 0

Definition at line 228 of file GA_Defaults.h.

void GA_Defaults::get ( int  index,
fpreal32 v 
) const
inline

Get a value out of the defaults.

  • Automatically casts defaults into appropriate return type
  • Clamps index to tuple size
  • If there is no default data, then, the result will be 0

Definition at line 230 of file GA_Defaults.h.

void GA_Defaults::get ( int  index,
fpreal64 v 
) const
inline

Get a value out of the defaults.

  • Automatically casts defaults into appropriate return type
  • Clamps index to tuple size
  • If there is no default data, then, the result will be 0

Definition at line 232 of file GA_Defaults.h.

void GA_Defaults::guessFromName ( const UT_StringRef name,
int  tuple_size 
)

Set this to a reasonable guess based on the specified name, e.g. Cd -> 1.0; id -> -1; orient -> (0,0,0,1)

bool GA_Defaults::jsonLoad ( UT_JSONParser p)

Load data from a JSON stream.

bool GA_Defaults::jsonSave ( UT_JSONWriter w) const

Save data to a JSON stream.

JSON Schema: GA_Defaults

{
"name" : "GA_Defaults",
"description" : "An array of numbers used for attribute defaults",
"type" : "orderedmap",
"properties": {
"size": {
"type" : "integer",
"description" : "Number of values",
},
"storage": {
"type" : "string",
"enum" : ["fpreal64", "int64"],
"description" : "The type data",
},
"values": {
"type" : "array",
"items" : "number",
"description" : "The default values",
},
},
}
See Also
JSON_FileFormat
GA_Defaults& GA_Defaults::operator= ( const GA_Defaults src)
inline

Definition at line 150 of file GA_Defaults.h.

void GA_Defaults::saveToOptions ( UT_Options options,
bool  always = true 
) const

Set the GA_OPTION_DEFAULTS option in the options If always is false and there are no defaults (i.e. getSize() == 0), then the options will not be written.

void GA_Defaults::set ( const int32 values,
int  count 
)

Set defaults to the list of integer values.

void GA_Defaults::set ( const int64 values,
int  count 
)

Set defaults to the list of integer values.

void GA_Defaults::set ( const fpreal32 values,
int  count 
)

Set defaults to the list of real values.

void GA_Defaults::set ( const fpreal64 values,
int  count 
)

Set defaults to the list of real values.

SYS_FORCE_INLINE int GA_Defaults::size ( void  ) const
inline

Get the size of the defaults. You can have an attribute tuple size that's larger than its GA_Defaults size; the GA_Defaults will repeat its last element.

Definition at line 254 of file GA_Defaults.h.


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