HDK
|
#include <GU_PackedImpl.h>
Public Types | |
typedef fpreal(GU_PackedImpl::* | FloatGetter )(const GU_PrimPacked *) const |
typedef void(GU_PackedImpl::* | FloatSetter )(const GU_PrimPacked *, fpreal) |
typedef GA_Size(GU_PackedImpl::* | IntGetter )(const GU_PrimPacked *) const |
typedef void(GU_PackedImpl::* | IntSetter )(GU_PrimPacked *, GA_Size) |
typedef bool(GU_PackedImpl::* | BoolGetter )(const GU_PrimPacked *) const |
typedef void(GU_PackedImpl::* | BoolSetter )(GU_PrimPacked *, bool) |
typedef const char *(GU_PackedImpl::* | StringGetter )(const GU_PrimPacked *) const |
typedef void(GU_PackedImpl::* | StringSetter )(GU_PrimPacked *, const char *) |
typedef UT_OptionsHolder(GU_PackedImpl::* | DictGetter )(const GU_PrimPacked *) const |
typedef void(GU_PackedImpl::* | DictSetter )(GU_PrimPacked *, const UT_OptionsHolder &) |
typedef std::string(GU_PackedImpl::* | StdStringGetter )(const GU_PrimPacked *) const |
typedef void(GU_PackedImpl::* | StdStringSetter )(GU_PrimPacked *, const std::string &) |
typedef UT_StringHolder(GU_PackedImpl::* | StringHolderGetter )(const GU_PrimPacked *) const |
typedef void(GU_PackedImpl::* | StringHolderSetter )(GU_PrimPacked *, const UT_StringHolder &) |
typedef fpreal(GU_PackedImpl::* | FloatTupleGetter )(const GU_PrimPacked *, exint) const |
typedef void(GU_PackedImpl::* | FloatTupleSetter )(GU_PrimPacked *, exint, fpreal) |
typedef GA_Size(GU_PackedImpl::* | IntTupleGetter )(const GU_PrimPacked *, exint) const |
typedef void(GU_PackedImpl::* | IntTupleSetter )(GU_PrimPacked *, exint, GA_Size) |
typedef bool(GU_PackedImpl::* | BoolTupleGetter )(const GU_PrimPacked *, exint) const |
typedef void(GU_PackedImpl::* | BoolTupleSetter )(GU_PrimPacked *, exint, bool) |
typedef const char *(GU_PackedImpl::* | StringTupleGetter )(const GU_PrimPacked *, exint) const |
typedef void(GU_PackedImpl::* | StringTupleSetter )(GU_PrimPacked *, exint, const char *) |
typedef UT_OptionsHolder(GU_PackedImpl::* | DictTupleGetter )(const GU_PrimPacked *, exint) const |
typedef void(GU_PackedImpl::* | DictTupleSetter )(GU_PrimPacked *, exint, const UT_OptionsHolder &) |
typedef const std::string &(GU_PackedImpl::* | StdStringTupleGetter )(const GU_PrimPacked *, exint) const |
typedef void(GU_PackedImpl::* | StdStringTupleSetter )(GU_PrimPacked *, exint, const std::string &) |
typedef const UT_StringHolder &(GU_PackedImpl::* | StringHolderTupleGetter )(const GU_PrimPacked *, exint) const |
typedef void(GU_PackedImpl::* | StringHolderTupleSetter )(GU_PrimPacked *, exint, const UT_StringHolder &) |
typedef void(GU_PackedImpl::* | F32VectorGetter )(const GU_PrimPacked *, fpreal32 *, exint) const |
typedef void(GU_PackedImpl::* | F32VectorSetter )(GU_PrimPacked *, const fpreal32 *, exint) |
typedef void(GU_PackedImpl::* | F64VectorGetter )(const GU_PrimPacked *, fpreal64 *, exint) const |
typedef void(GU_PackedImpl::* | F64VectorSetter )(GU_PrimPacked *, const fpreal64 *, exint) |
typedef void(GU_PackedImpl::* | I32VectorGetter )(const GU_PrimPacked *, int32 *, exint) const |
typedef void(GU_PackedImpl::* | I32VectorSetter )(GU_PrimPacked *, const int32 *, exint) |
typedef void(GU_PackedImpl::* | I64VectorGetter )(const GU_PrimPacked *, int64 *, exint) const |
typedef void(GU_PackedImpl::* | I64VectorSetter )(GU_PrimPacked *, const int64 *, exint) |
typedef void(GU_PackedImpl::* | BVectorGetter )(const GU_PrimPacked *, bool *, exint) const |
typedef void(GU_PackedImpl::* | BVectorSetter )(GU_PrimPacked *, const bool *, exint) |
typedef void(GU_PackedImpl::* | StringArrayGetter )(const GU_PrimPacked *, UT_StringArray &) const |
typedef void(GU_PackedImpl::* | StringArraySetter )(GU_PrimPacked *, const UT_StringArray &) |
typedef void(GU_PackedImpl::* | DictArrayGetter )(const GU_PrimPacked *, UT_Array< UT_OptionsHolder > &) const |
typedef void(GU_PackedImpl::* | DictArraySetter )(GU_PrimPacked *, const UT_Array< UT_OptionsHolder > &) |
Public Member Functions | |
GU_PackedImpl () | |
virtual | ~GU_PackedImpl () |
GU_PackedImpl (const GU_PackedImpl &src)=default | |
GU_PackedImpl & | operator= (const GU_PackedImpl &src)=default |
virtual GU_PackedFactory * | getFactory () const =0 |
Get the factory associated with this procedural. More... | |
virtual GU_PackedImpl * | copy () const =0 |
Create a copy of this resolver. More... | |
virtual bool | isValid () const =0 |
Test whether the deferred load primitive data is valid. More... | |
virtual void | clearData ()=0 |
virtual bool | load (GU_PrimPacked *prim, const UT_Options &options, const GA_LoadMap &map)=0 |
Give a UT_Options of load data, create resolver data for the primitive. More... | |
virtual bool | supportsJSONLoad () const |
virtual bool | loadFromJSON (GU_PrimPacked *prim, const UT_JSONValueMap &options, const GA_LoadMap &map) |
virtual void | update (GU_PrimPacked *prim, const UT_Options &options)=0 |
virtual bool | saveSharedData (UT_JSONWriter &w, GA_SaveMap &map, GA_GeometryIndex *geo_index) const |
virtual bool | loadSharedData (int load_data_type, const GA_SharedLoadData *item) |
virtual bool | save (UT_Options &options, const GA_SaveMap &map) const =0 |
Copy the resolver data into the UT_Options for saving. More... | |
virtual bool | loadUnknownToken (const char *token, UT_JSONParser &p, const GA_LoadMap &map) |
virtual bool | getBounds (UT_BoundingBox &box) const =0 |
Get the bounding box for the geometry (not including transforms) More... | |
bool | getBoundsCached (UT_BoundingBox &box) const |
virtual bool | getVisibleBounds (UT_BoundingBox &box) const |
bool | getVisibleBoundsCached (UT_BoundingBox &box) const |
virtual bool | getRenderingBounds (UT_BoundingBox &box) const =0 |
virtual void | getVelocityRange (UT_Vector3 &min, UT_Vector3 &max) const =0 |
virtual void | getWidthRange (fpreal &wmin, fpreal &wmax) const =0 |
virtual void | getPrimitiveName (const GU_PrimPacked *prim, UT_WorkBuffer &wbuf) const |
virtual bool | getLocalTransform (UT_Matrix4D &m) const |
virtual bool | unpackWithContext (GU_Detail &destgdp, GU_PackedContext &context, const GU_PrimPacked *prim) const |
bool | unpack (GU_Detail &destgdp, const GU_PrimPacked *prim) const |
virtual bool | unpack (GU_Detail &destgdp, const UT_Matrix4D *transform) const =0 |
virtual bool | unpackWithStyler (GU_Detail &destgdp, STY_StylerGroup &prim_styler_group, const STY_Styler &parent_styler, const GU_PrimPacked *prim) const |
virtual void | forceLoad () const |
virtual bool | isLoaded () const |
virtual bool | unpackUsingPolygons (GU_Detail &destgdp, const GU_PrimPacked *prim) const |
virtual GU_ConstDetailHandle | getPackedDetail (GU_PackedContext *context=0) const |
bool | pointInstanceTransform () const |
bool | intrinsicPointInstanceTransform (const GU_PrimPacked *prim) const |
void | setPointInstanceTransform (GU_PrimPacked *prim, bool b) |
Set whether point instancing should be used. More... | |
virtual int64 | getMemoryUsage (bool inclusive) const =0 |
Report memory usage (includes all shared memory) More... | |
virtual void | countMemory (UT_MemoryCounter &counter, bool inclusive) const =0 |
virtual bool | saveCachedBBox () const |
virtual void | setFacesetAttribute (const UT_StringHolder &s) |
virtual const UT_StringHolder & | facesetAttribute () const |
virtual void | setAttributeNameMap (const GEO_PackedNameMapPtr &m) |
virtual const GEO_PackedNameMapPtr & | attributeNameMap () const |
virtual void | setSharedNameMapData (GA_SharedDataHandlePtr s) |
SYS_FORCE_INLINE bool | isShared () const |
SYS_FORCE_INLINE GU_PackedImpl * | copyIfShared () |
int64 | intrinsic3Tuple (const GU_PrimPacked *prim) const |
int64 | intrinsic6Tuple (const GU_PrimPacked *prim) const |
int64 | intrinsic9Tuple (const GU_PrimPacked *prim) const |
int64 | intrinsic16Tuple (const GU_PrimPacked *prim) const |
std::string | intrinsicPrimitiveName (const GU_PrimPacked *prim) const |
const char * | intrinsicFactoryName (const GU_PrimPacked *prim) const |
const char * | intrinsicFactoryLabel (const GU_PrimPacked *prim) const |
void | intrinsicPackedBox (const GU_PrimPacked *prim, fpreal64 *vals, exint sz) const |
void | intrinsicPackedRenderBox (const GU_PrimPacked *prim, fpreal64 *vals, exint sz) const |
void | intrinsicPivot (const GU_PrimPacked *prim, fpreal64 *vals, exint sz) const |
void | intrinsicSetPivot (GU_PrimPacked *prim, const fpreal64 *vals, exint sz) |
void | intrinsicPrimTransform (const GU_PrimPacked *prim, fpreal64 *vals, exint sz) const |
void | intrinsicSetPrimTransform (GU_PrimPacked *prim, const fpreal64 *v, exint sz) |
void | intrinsicPackedTransform (const GU_PrimPacked *prim, fpreal64 *v, exint sz) const |
void | intrinsicFullTransform (const GU_PrimPacked *prim, fpreal64 *v, exint sz) const |
const char * | intrinsicViewportLOD (const GU_PrimPacked *prim) const |
void | intrinsicSetViewportLOD (GU_PrimPacked *prim, const char *lod) |
Public Member Functions inherited from UT_IntrusiveRefCounter< GU_PackedImpl > | |
SYS_FORCE_INLINE | UT_IntrusiveRefCounter () noexcept |
Default constructor: Sets counter to 0. More... | |
SYS_FORCE_INLINE | UT_IntrusiveRefCounter (const UT_IntrusiveRefCounter &) noexcept |
Copy constructor: Sets counter to 0. More... | |
UT_IntrusiveRefCounter & | operator= (const UT_IntrusiveRefCounter &) noexcept |
Assignment operator: Does not modify counter. More... | |
SYS_FORCE_INLINE uint32 | use_count () const noexcept |
Return current counter. More... | |
SYS_FORCE_INLINE bool | conditionalAddRef () noexcept |
Static Public Member Functions | |
static bool | computeVelocityRange (const GU_Detail *gdp, UT_Vector3 &vmin, UT_Vector3 &vmax) |
static bool | computeWidthRange (const GU_Detail *gdp, fpreal &wmin, fpreal &wmax) |
Protected Member Functions | |
virtual bool | unpackWithPrim (GU_Detail &destgdp, const UT_Matrix4D *transform, const GU_PrimPacked *prim) const |
const UT_BoundingBox & | boxCache () const |
void | setBoxCache (const UT_BoundingBox &b) |
template<typename T > | |
void | setBoxCache (const T b[6]) |
void | clearBoxCache () |
bool | unpackToDetail (GU_Detail &destgdp, GU_Detail *src, const UT_Matrix4D *transform) const |
bool | unpackToDetail (GU_Detail &destgdp, const GU_Detail *src, const UT_Matrix4D *transform) const |
bool | unpackToDetail (GU_Detail &destgdp, const GU_ConstDetailHandle &gdh, const UT_Matrix4D *transform) const |
Unpack the source detail handle. More... | |
virtual UT_Vector3 | getBaryCenter () const |
Optional method to compute centroid (default uses bounding box) More... | |
virtual fpreal | computeVolume (const UT_Vector3 &refpt) const |
Optional method to calculate volume (default uses bounding box) More... | |
virtual fpreal | computeArea () const |
Optional method to calculate surface area (default uses bounding box) More... | |
virtual fpreal | computePerimeter () const |
Optional method to calculate perimeter (default uses bounding box) More... | |
Protected Member Functions inherited from UT_IntrusiveRefCounter< GU_PackedImpl > | |
SYS_FORCE_INLINE | ~UT_IntrusiveRefCounter () |
Destructor: Only derived classes can destruct this. More... | |
Static Protected Member Functions | |
static void | copyPrimitiveGroups (GU_Detail &dest, const GU_Detail &src, GA_Offset src_offset, bool force=false) |
template<typename T > | |
static bool | import (const UT_JSONValueMap &options, const UT_StringRef &key, T &value) |
template<typename T > | |
static bool | import (const UT_Options &options, const UT_StringRef &key, T &value) |
Static Protected Attributes | |
static const GEO_PackedNameMapPtr | theNullPackedNameMapPtr |
Friends | |
class | GU_PrimPacked |
This class is used by the deferred load primitives to provide methods to handle the deferred geometry.
Load/save of shared primitive data If multiple instances of the packed primitive share data, it's possible to save this data just once (instead of per primitive).
There are two parts to saving shared data. Saving the actual data, but also saving a "key" used to resolve the shared data. The shared data itself is saved using saveSharedData()
. In addition, the "key" associated with the shared data is saved per-primitive instance. During loading, the "key" is used to resolve the shared data.
When generating a key, the key must be unique within all shared data blocks for a single geometry. A simple way to do this would be to use the address of the shared data item. More complicated ways might include using a GUID, etc. For example, with a UT_SharedPtr<GU_Detail>
, you might have generate a key using:
The saveSharedData()
method writes a single JSON object to the save stream. During loading, the loader expects to load an array containing four items.
The Primitive_Name
ensures that shared data resolution is tied to the specific primitive type. Kind of like a namespace.
The Shared_Data_Type
is an identifier to allow primitives to store multiple types of shared data. For example, if you have a material definition and a geometry definition, these can be stored as separate shared blocks rather than creating separate shared blocks for each pair.
The Shared_Data_Identifier
is a unique identifier used to specify a particular instance of a shared data block. This is the "key" that can be used to resolve the data at load time. See the makeKey()
example above.
Example code might be something like
The save()
method needs to store the key so the shared data can be resolved at load time. The identifier you use in the save method doesn't have to be the "Shared_Data_Type"
string, but it does have to match the value in the load method. For example:
Shared data loading may be deferred until the shared data is actually required. This is done using a "handle" to the shared data (GA_SharedDataHandlePtr
). During the load() method, you can ask for a handle to any shared data.
When loading primitives, the shared data is not actually available until later in the loading process. The primitive itself needs to hold a reference to the shared data handle so the shared data can be resolved at a later time.
Resolving the handle is done by asking the handle to resolve the shared data, and then extracting information from a sub-class of a GA_SharedLoadData
object. If the shared data is never resolved, it's possible the GA_SharedLoadData
may never read the data from the file (if the geometry format supports seeking, the loader may be able to use the offsets stored in the geo_index
during writing). The code to resolve the data might look like:
The last piece to loading, is the actual loading of the shared data block. Since shared data blocks must be able to be loaded without a primitive object, the loading is handled by the GU_PackedFactory
subclass (the loadSharedData()
) method. This method should create the sub-class of the GA_SharedLoadData
object that's used when resolving shared data. For example
Definition at line 185 of file GU_PackedImpl.h.
typedef bool(GU_PackedImpl::* GU_PackedImpl::BoolGetter)(const GU_PrimPacked *) const |
Typedefs for intrinsic evaluation
Definition at line 194 of file GU_PackedImpl.h.
typedef void(GU_PackedImpl::* GU_PackedImpl::BoolSetter)(GU_PrimPacked *, bool) |
Typedefs for intrinsic evaluation
Definition at line 195 of file GU_PackedImpl.h.
typedef bool(GU_PackedImpl::* GU_PackedImpl::BoolTupleGetter)(const GU_PrimPacked *, exint) const |
Typedefs for intrinsic evaluation
Definition at line 209 of file GU_PackedImpl.h.
typedef void(GU_PackedImpl::* GU_PackedImpl::BoolTupleSetter)(GU_PrimPacked *, exint, bool) |
Typedefs for intrinsic evaluation
Definition at line 210 of file GU_PackedImpl.h.
typedef void(GU_PackedImpl::* GU_PackedImpl::BVectorGetter)(const GU_PrimPacked *, bool *, exint) const |
Typedefs for intrinsic evaluation
Definition at line 228 of file GU_PackedImpl.h.
typedef void(GU_PackedImpl::* GU_PackedImpl::BVectorSetter)(GU_PrimPacked *, const bool *, exint) |
Typedefs for intrinsic evaluation
Definition at line 229 of file GU_PackedImpl.h.
typedef void(GU_PackedImpl::* GU_PackedImpl::DictArrayGetter)(const GU_PrimPacked *, UT_Array< UT_OptionsHolder > &) const |
Typedefs for intrinsic evaluation
Definition at line 233 of file GU_PackedImpl.h.
typedef void(GU_PackedImpl::* GU_PackedImpl::DictArraySetter)(GU_PrimPacked *, const UT_Array< UT_OptionsHolder > &) |
Typedefs for intrinsic evaluation
Definition at line 234 of file GU_PackedImpl.h.
typedef UT_OptionsHolder(GU_PackedImpl::* GU_PackedImpl::DictGetter)(const GU_PrimPacked *) const |
Typedefs for intrinsic evaluation
Definition at line 198 of file GU_PackedImpl.h.
typedef void(GU_PackedImpl::* GU_PackedImpl::DictSetter)(GU_PrimPacked *, const UT_OptionsHolder &) |
Typedefs for intrinsic evaluation
Definition at line 199 of file GU_PackedImpl.h.
typedef UT_OptionsHolder(GU_PackedImpl::* GU_PackedImpl::DictTupleGetter)(const GU_PrimPacked *, exint) const |
Typedefs for intrinsic evaluation
Definition at line 213 of file GU_PackedImpl.h.
typedef void(GU_PackedImpl::* GU_PackedImpl::DictTupleSetter)(GU_PrimPacked *, exint, const UT_OptionsHolder &) |
Typedefs for intrinsic evaluation
Definition at line 214 of file GU_PackedImpl.h.
typedef void(GU_PackedImpl::* GU_PackedImpl::F32VectorGetter)(const GU_PrimPacked *, fpreal32 *, exint) const |
Typedefs for intrinsic evaluation
Definition at line 220 of file GU_PackedImpl.h.
typedef void(GU_PackedImpl::* GU_PackedImpl::F32VectorSetter)(GU_PrimPacked *, const fpreal32 *, exint) |
Typedefs for intrinsic evaluation
Definition at line 221 of file GU_PackedImpl.h.
typedef void(GU_PackedImpl::* GU_PackedImpl::F64VectorGetter)(const GU_PrimPacked *, fpreal64 *, exint) const |
Typedefs for intrinsic evaluation
Definition at line 222 of file GU_PackedImpl.h.
typedef void(GU_PackedImpl::* GU_PackedImpl::F64VectorSetter)(GU_PrimPacked *, const fpreal64 *, exint) |
Typedefs for intrinsic evaluation
Definition at line 223 of file GU_PackedImpl.h.
typedef fpreal(GU_PackedImpl::* GU_PackedImpl::FloatGetter)(const GU_PrimPacked *) const |
Typedefs for intrinsic evaluation
Definition at line 190 of file GU_PackedImpl.h.
typedef void(GU_PackedImpl::* GU_PackedImpl::FloatSetter)(const GU_PrimPacked *, fpreal) |
Typedefs for intrinsic evaluation
Definition at line 191 of file GU_PackedImpl.h.
typedef fpreal(GU_PackedImpl::* GU_PackedImpl::FloatTupleGetter)(const GU_PrimPacked *, exint) const |
Typedefs for intrinsic evaluation
Definition at line 205 of file GU_PackedImpl.h.
typedef void(GU_PackedImpl::* GU_PackedImpl::FloatTupleSetter)(GU_PrimPacked *, exint, fpreal) |
Typedefs for intrinsic evaluation
Definition at line 206 of file GU_PackedImpl.h.
typedef void(GU_PackedImpl::* GU_PackedImpl::I32VectorGetter)(const GU_PrimPacked *, int32 *, exint) const |
Typedefs for intrinsic evaluation
Definition at line 224 of file GU_PackedImpl.h.
typedef void(GU_PackedImpl::* GU_PackedImpl::I32VectorSetter)(GU_PrimPacked *, const int32 *, exint) |
Typedefs for intrinsic evaluation
Definition at line 225 of file GU_PackedImpl.h.
typedef void(GU_PackedImpl::* GU_PackedImpl::I64VectorGetter)(const GU_PrimPacked *, int64 *, exint) const |
Typedefs for intrinsic evaluation
Definition at line 226 of file GU_PackedImpl.h.
typedef void(GU_PackedImpl::* GU_PackedImpl::I64VectorSetter)(GU_PrimPacked *, const int64 *, exint) |
Typedefs for intrinsic evaluation
Definition at line 227 of file GU_PackedImpl.h.
typedef GA_Size(GU_PackedImpl::* GU_PackedImpl::IntGetter)(const GU_PrimPacked *) const |
Typedefs for intrinsic evaluation
Definition at line 192 of file GU_PackedImpl.h.
typedef void(GU_PackedImpl::* GU_PackedImpl::IntSetter)(GU_PrimPacked *, GA_Size) |
Typedefs for intrinsic evaluation
Definition at line 193 of file GU_PackedImpl.h.
typedef GA_Size(GU_PackedImpl::* GU_PackedImpl::IntTupleGetter)(const GU_PrimPacked *, exint) const |
Typedefs for intrinsic evaluation
Definition at line 207 of file GU_PackedImpl.h.
typedef void(GU_PackedImpl::* GU_PackedImpl::IntTupleSetter)(GU_PrimPacked *, exint, GA_Size) |
Typedefs for intrinsic evaluation
Definition at line 208 of file GU_PackedImpl.h.
typedef std::string(GU_PackedImpl::* GU_PackedImpl::StdStringGetter)(const GU_PrimPacked *) const |
Typedefs for intrinsic evaluation
Definition at line 200 of file GU_PackedImpl.h.
typedef void(GU_PackedImpl::* GU_PackedImpl::StdStringSetter)(GU_PrimPacked *, const std::string &) |
Typedefs for intrinsic evaluation
Definition at line 201 of file GU_PackedImpl.h.
typedef const std::string&(GU_PackedImpl::* GU_PackedImpl::StdStringTupleGetter)(const GU_PrimPacked *, exint) const |
Typedefs for intrinsic evaluation
Definition at line 215 of file GU_PackedImpl.h.
typedef void(GU_PackedImpl::* GU_PackedImpl::StdStringTupleSetter)(GU_PrimPacked *, exint, const std::string &) |
Typedefs for intrinsic evaluation
Definition at line 216 of file GU_PackedImpl.h.
typedef void(GU_PackedImpl::* GU_PackedImpl::StringArrayGetter)(const GU_PrimPacked *, UT_StringArray &) const |
Typedefs for intrinsic evaluation
Definition at line 231 of file GU_PackedImpl.h.
typedef void(GU_PackedImpl::* GU_PackedImpl::StringArraySetter)(GU_PrimPacked *, const UT_StringArray &) |
Typedefs for intrinsic evaluation
Definition at line 232 of file GU_PackedImpl.h.
typedef const char*(GU_PackedImpl::* GU_PackedImpl::StringGetter)(const GU_PrimPacked *) const |
Typedefs for intrinsic evaluation
Definition at line 196 of file GU_PackedImpl.h.
typedef UT_StringHolder(GU_PackedImpl::* GU_PackedImpl::StringHolderGetter)(const GU_PrimPacked *) const |
Typedefs for intrinsic evaluation
Definition at line 202 of file GU_PackedImpl.h.
typedef void(GU_PackedImpl::* GU_PackedImpl::StringHolderSetter)(GU_PrimPacked *, const UT_StringHolder &) |
Typedefs for intrinsic evaluation
Definition at line 203 of file GU_PackedImpl.h.
typedef const UT_StringHolder&(GU_PackedImpl::* GU_PackedImpl::StringHolderTupleGetter)(const GU_PrimPacked *, exint) const |
Typedefs for intrinsic evaluation
Definition at line 217 of file GU_PackedImpl.h.
typedef void(GU_PackedImpl::* GU_PackedImpl::StringHolderTupleSetter)(GU_PrimPacked *, exint, const UT_StringHolder &) |
Typedefs for intrinsic evaluation
Definition at line 218 of file GU_PackedImpl.h.
typedef void(GU_PackedImpl::* GU_PackedImpl::StringSetter)(GU_PrimPacked *, const char *) |
Typedefs for intrinsic evaluation
Definition at line 197 of file GU_PackedImpl.h.
typedef const char*(GU_PackedImpl::* GU_PackedImpl::StringTupleGetter)(const GU_PrimPacked *, exint) const |
Typedefs for intrinsic evaluation
Definition at line 211 of file GU_PackedImpl.h.
typedef void(GU_PackedImpl::* GU_PackedImpl::StringTupleSetter)(GU_PrimPacked *, exint, const char *) |
Typedefs for intrinsic evaluation
Definition at line 212 of file GU_PackedImpl.h.
GU_PackedImpl::GU_PackedImpl | ( | ) |
|
virtual |
|
default |
|
inlinevirtual |
Default implementation just returns the default null name map.
Reimplemented in GABC_NAMESPACE::GABC_PackedImpl.
Definition at line 499 of file GU_PackedImpl.h.
|
inlineprotected |
The box cache can be used by the implementation to store the untransformed bounding box. It should not store the transformed box.
Definition at line 531 of file GU_PackedImpl.h.
|
inlineprotected |
Definition at line 544 of file GU_PackedImpl.h.
|
pure virtual |
The clearData() method is called when the primitives are stashed during the cook of a SOP. See GA_Primitive::stashed(). This gives the primitive to optionally clear some data during the stashing process.
Implemented in GusdGU_PackedUSD, GU_Agent, GU_PackedFragment, GABC_NAMESPACE::GABC_PackedImpl, GU_PackedGeometry, GU_PackedDisk, and GU_PackedDiskSequence.
|
protectedvirtual |
Optional method to calculate surface area (default uses bounding box)
|
protectedvirtual |
Optional method to calculate perimeter (default uses bounding box)
|
static |
Convenience method to compute the velocity bounds for a given geometry. The geometry may be a NULL pointer.
|
protectedvirtual |
Optional method to calculate volume (default uses bounding box)
|
static |
|
pure virtual |
Create a copy of this resolver.
Implemented in GusdGU_PackedUSD, GU_Agent, GU_PackedFragment, GABC_NAMESPACE::GABC_PackedImpl, GU_PackedGeometry, GU_PackedDisk, and GU_PackedDiskSequence.
|
inline |
Definition at line 518 of file GU_PackedImpl.h.
|
staticprotected |
For all the groups that this primitive belongs to, create groups on the destination detail and place all primitives in the given range into the groups. If the group already exists on the destination detail, then nothing is done (unless force
is set).
|
pure virtual |
Count memory usage using a UT_MemoryCounter in order to count shared memory correctly. NOTE: There's nothing outside of sizeof(*this) to count in the base class, so it can be pure virtual.
Implemented in GusdGU_PackedUSD, GU_Agent, GU_PackedFragment, GU_PackedGeometry, GU_PackedDisk, GABC_NAMESPACE::GABC_PackedImpl, and GU_PackedDiskSequence.
|
virtual |
Default implementation just returns the default value of GEO_PrimPacked::theDefaultFacesetAttribute
Reimplemented in GABC_NAMESPACE::GABC_PackedImpl.
|
inlinevirtual |
Forces a load of all shared data the primitive has access to this should leave no data on disk
Reimplemented in GU_PackedFragment, and GU_PackedGeometry.
Definition at line 419 of file GU_PackedImpl.h.
|
protectedvirtual |
Optional method to compute centroid (default uses bounding box)
|
pure virtual |
Get the bounding box for the geometry (not including transforms)
Implemented in GusdGU_PackedUSD, GU_PackedSequence, GU_Agent, GABC_NAMESPACE::GABC_PackedImpl, GU_PackedFragment, GU_PackedGeometry, and GU_PackedDisk.
bool GU_PackedImpl::getBoundsCached | ( | UT_BoundingBox & | box | ) | const |
Get the bounding box for the geometry (not including transforms), using myBoxCache if it's valid, and otherwise caching the result from getBounds(box) in myBoxCache. NOTE: If you just want to check the cached bounds, use boxCache(), instead.
|
pure virtual |
Get the factory associated with this procedural.
Implemented in GusdGU_PackedUSD, GU_Agent, GU_PackedFragment, GU_PackedGeometry, GABC_NAMESPACE::GABC_PackedImpl, GU_PackedDisk, and GU_PackedDiskSequence.
|
virtual |
Some procedurals have an "intrinsic" transform. These are combined with the local transform on the geometry primitive.
The default method returns false and leaves the transform unchanged.
Reimplemented in GusdGU_PackedUSD, and GABC_NAMESPACE::GABC_PackedImpl.
|
pure virtual |
Report memory usage (includes all shared memory)
Implemented in GusdGU_PackedUSD, GU_Agent, GU_PackedFragment, GU_PackedGeometry, GU_PackedDisk, GABC_NAMESPACE::GABC_PackedImpl, and GU_PackedDiskSequence.
|
virtual |
Get a reference to a const GU_Detail for the packed geometry. Not all implementations need to provide this. If this isn't implemented, the method should return an empty detail handle. This is meant as a quick short-cut instead of having to call unpack() which performs a full merge.
Reimplemented in GU_Agent, GU_PackedSequence, GU_PackedFragment, GU_PackedGeometry, and GU_PackedDisk.
|
virtual |
Return the primitive's "description". This should be a unique identifier for the primitive and defaults to: "%s.%d" % (getFactory()->name(), getPrim()->getNum())
Reimplemented in GABC_NAMESPACE::GABC_PackedImpl, and GU_PackedDisk.
|
pure virtual |
Get the rendering bounding box for the geometry (not including transforms). For curve and point geometry, this needs to include any "width" attributes.
Implemented in GusdGU_PackedUSD, GU_PackedSequence, GU_Agent, GABC_NAMESPACE::GABC_PackedImpl, GU_PackedFragment, GU_PackedGeometry, and GU_PackedDisk.
|
pure virtual |
When rendering with velocity blur, the renderer needs to know the bounds on velocity to accurately compute the bounding box.
Implemented in GusdGU_PackedUSD, GU_PackedSequence, GU_Agent, GABC_NAMESPACE::GABC_PackedImpl, GU_PackedFragment, GU_PackedGeometry, and GU_PackedDisk.
|
inlinevirtual |
Get the bounding box for the visible geometry (not including transforms) By default, merely calls getBounds()
Reimplemented in GU_PackedGeometry, and GU_PackedDisk.
Definition at line 320 of file GU_PackedImpl.h.
bool GU_PackedImpl::getVisibleBoundsCached | ( | UT_BoundingBox & | box | ) | const |
Get the visible bounding box for the geometry (not including transforms), using myVisibleBoxCache if it's valid, and otherwise caching the result from getVisibleBounds(box) in myVisibleBoxCache. NOTE: If you just want to check the cached bounds, use visibleBoxCache(), instead.
When rendering points or curves, the renderer needs to know the bounds on the width attribute to accurately compute the bounding box.
Implemented in GusdGU_PackedUSD, GU_PackedSequence, GU_Agent, GABC_NAMESPACE::GABC_PackedImpl, GU_PackedFragment, GU_PackedGeometry, and GU_PackedDisk.
|
staticprotected |
Import a value from a UT_JSONValueMap or a UT_Options. This handles both the compact and expanded options and is valid for the same types as UT_JSONValueMap::import()
These import() methods can be used in the load()
and loadFromJSON()
methods to simplify importing code. For example, you should be able to implement a generic loadFrom()
method, templated on either UT_Options
or UT_JSONValueMap
. You can then just
|
staticprotected |
Import a value from a UT_JSONValueMap or a UT_Options. This handles both the compact and expanded options and is valid for the same types as UT_JSONValueMap::import()
These import() methods can be used in the load()
and loadFromJSON()
methods to simplify importing code. For example, you should be able to implement a generic loadFrom()
method, templated on either UT_Options
or UT_JSONValueMap
. You can then just
|
inline |
Intrinsic functions
Definition at line 354 of file GU_PackedImpl.h.
|
inline |
Intrinsic functions
Definition at line 351 of file GU_PackedImpl.h.
|
inline |
Intrinsic functions
Definition at line 352 of file GU_PackedImpl.h.
|
inline |
Intrinsic functions
Definition at line 353 of file GU_PackedImpl.h.
const char* GU_PackedImpl::intrinsicFactoryLabel | ( | const GU_PrimPacked * | prim | ) | const |
Intrinsic functions
const char* GU_PackedImpl::intrinsicFactoryName | ( | const GU_PrimPacked * | prim | ) | const |
Intrinsic functions
void GU_PackedImpl::intrinsicFullTransform | ( | const GU_PrimPacked * | prim, |
fpreal64 * | v, | ||
exint | sz | ||
) | const |
Intrinsic functions
void GU_PackedImpl::intrinsicPackedBox | ( | const GU_PrimPacked * | prim, |
fpreal64 * | vals, | ||
exint | sz | ||
) | const |
Intrinsic functions
void GU_PackedImpl::intrinsicPackedRenderBox | ( | const GU_PrimPacked * | prim, |
fpreal64 * | vals, | ||
exint | sz | ||
) | const |
Intrinsic functions
void GU_PackedImpl::intrinsicPackedTransform | ( | const GU_PrimPacked * | prim, |
fpreal64 * | v, | ||
exint | sz | ||
) | const |
Intrinsic functions
void GU_PackedImpl::intrinsicPivot | ( | const GU_PrimPacked * | prim, |
fpreal64 * | vals, | ||
exint | sz | ||
) | const |
Intrinsic functions
|
inline |
Definition at line 449 of file GU_PackedImpl.h.
std::string GU_PackedImpl::intrinsicPrimitiveName | ( | const GU_PrimPacked * | prim | ) | const |
Intrinsic functions
void GU_PackedImpl::intrinsicPrimTransform | ( | const GU_PrimPacked * | prim, |
fpreal64 * | vals, | ||
exint | sz | ||
) | const |
Intrinsic functions
void GU_PackedImpl::intrinsicSetPivot | ( | GU_PrimPacked * | prim, |
const fpreal64 * | vals, | ||
exint | sz | ||
) |
Intrinsic functions
void GU_PackedImpl::intrinsicSetPrimTransform | ( | GU_PrimPacked * | prim, |
const fpreal64 * | v, | ||
exint | sz | ||
) |
Intrinsic functions
void GU_PackedImpl::intrinsicSetViewportLOD | ( | GU_PrimPacked * | prim, |
const char * | lod | ||
) |
Intrinsic functions
const char* GU_PackedImpl::intrinsicViewportLOD | ( | const GU_PrimPacked * | prim | ) | const |
Intrinsic functions
|
inlinevirtual |
Checks if this packed implementation has loaded its shared data Default implementation returns true.
Reimplemented in GU_PackedFragment, GU_PackedGeometry, GU_PackedDisk, and GU_PackedDiskSequence.
Definition at line 423 of file GU_PackedImpl.h.
|
inline |
Definition at line 512 of file GU_PackedImpl.h.
|
pure virtual |
Test whether the deferred load primitive data is valid.
Implemented in GusdGU_PackedUSD, GU_PackedSequence, GU_Agent, GU_PackedFragment, GABC_NAMESPACE::GABC_PackedImpl, GU_PackedGeometry, GU_PackedDisk, and GU_PackedDiskSequence.
|
pure virtual |
Give a UT_Options of load data, create resolver data for the primitive.
Implemented in GusdGU_PackedUSD, GU_Agent, GU_PackedFragment, GABC_NAMESPACE::GABC_PackedImpl, GU_PackedGeometry, GU_PackedDisk, and GU_PackedDiskSequence.
|
inlinevirtual |
The JSONValueMap represents a UT_Options. The options may be saved in compact form, but also may be saved in expanded form. If in expanded form, the value for each key's value is a UT_JSONValueMap storing the value in the "value" key. It's highly suggested you just use the protected import() convenience method which deals with this for you.
Reimplemented in GU_Agent, GU_PackedFragment, GABC_NAMESPACE::GABC_PackedImpl, GU_PackedGeometry, GU_PackedDisk, and GU_PackedDiskSequence.
Definition at line 274 of file GU_PackedImpl.h.
|
virtual |
This method is called to resolve the shared data on load. The load_data_type
given is the integer passed when you called "GA_LoadMap::needSharedData()" – which was done in load().
Reimplemented in GU_Agent, GU_PackedFragment, and GU_PackedGeometry.
|
virtual |
Handle unknown token/value pairs when loading the primitive. By default, this adds a warning and skips the next object. Return false if there was a critical error.
Reimplemented in GABC_NAMESPACE::GABC_PackedImpl.
|
default |
|
inline |
If pointInstanceTransform()
returns false, getFullTransform4()
method will only use the point position as a translate. If true, getFullTransform4()
will perform the standard "houdini instancing" (i.e. use the "N", "v", "rot" and other attributes to compute an orientation and translation).
The default method returns false, so only "P" is used to apply translates.
Definition at line 447 of file GU_PackedImpl.h.
|
pure virtual |
Copy the resolver data into the UT_Options for saving.
Implemented in GusdGU_PackedUSD, GU_Agent, GABC_NAMESPACE::GABC_PackedImpl, GU_PackedFragment, GU_PackedGeometry, GU_PackedDisk, and GU_PackedDiskSequence.
|
inlinevirtual |
Determines if we should save the bounding box to the metadata, this makes sense for fully embedded primitives, but if the primitive can be swapped out without the owner knowing, it should be avoided.
Reimplemented in GU_PackedFragment, and GU_PackedGeometry.
Definition at line 475 of file GU_PackedImpl.h.
|
virtual |
Save shared data objects to the JSON stream. This is called directly from GA_Primitive::saveSharedLoadData(). Please see GU_PackedFactory for the interface to create the shared data loader.
Reimplemented in GU_Agent, GU_PackedFragment, and GU_PackedGeometry.
|
inlinevirtual |
Default implementation does nothing and asserts, since only relevant subclasses (GABC_PackedImpl) should be getting an attribute name map.
Reimplemented in GABC_NAMESPACE::GABC_PackedImpl.
Definition at line 492 of file GU_PackedImpl.h.
|
inlineprotected |
Definition at line 533 of file GU_PackedImpl.h.
Definition at line 539 of file GU_PackedImpl.h.
|
inlinevirtual |
Default implementation does nothing and asserts, since only relevant subclasses (GABC_PackedImpl) should be getting a faceset attribute string.
Reimplemented in GABC_NAMESPACE::GABC_PackedImpl.
Definition at line 480 of file GU_PackedImpl.h.
void GU_PackedImpl::setPointInstanceTransform | ( | GU_PrimPacked * | prim, |
bool | b | ||
) |
Set whether point instancing should be used.
|
inlinevirtual |
Default implementation does nothing and asserts, since only relevant subclasses should be getting shared name map data.
Reimplemented in GABC_NAMESPACE::GABC_PackedImpl.
Definition at line 506 of file GU_PackedImpl.h.
|
inlinevirtual |
Determines if we support loading from a JSONParser directly rather than just from a UT_Options. Loading from JSON is typically more efficient than loading from a UT_Options since the file loader doesn't have to convert the JSON map to a UT_Options.
Reimplemented in GU_Agent, GU_PackedFragment, GABC_NAMESPACE::GABC_PackedImpl, GU_PackedGeometry, GU_PackedDisk, and GU_PackedDiskSequence.
Definition at line 267 of file GU_PackedImpl.h.
bool GU_PackedImpl::unpack | ( | GU_Detail & | destgdp, |
const GU_PrimPacked * | prim | ||
) | const |
Unpacks this into destgdp, transforming the new geometry by the transform of prim. If prim is nullptr, no transform will be applied.
|
pure virtual |
Unpacks this into destgdp, transforming the new geometry by the given transform. If transform is nullptr, no transform will be applied.
Implemented in GusdGU_PackedUSD, GU_PackedSequence, GU_Agent, GABC_NAMESPACE::GABC_PackedImpl, GU_PackedFragment, GU_PackedGeometry, and GU_PackedDisk.
|
protected |
Unpack the source detail into the destination detail. The source detail may be modified (attributes may be promoted)
The src
detail is not deleted by unpackToDetail.
|
protected |
Unpack the source detail into the destination detail. The source detail is const and will not be modified. However, this may be more expensive than the non-const version.
|
inlineprotected |
Unpack the source detail handle.
Definition at line 573 of file GU_PackedImpl.h.
|
virtual |
Unpack the procedural into a GU_Detail using polygons instead of polygon soups. The default method just unpacks, then converts polygon soups to polygons.
Reimplemented in GusdGU_PackedUSD, and GABC_NAMESPACE::GABC_PackedImpl.
|
inlinevirtual |
Unpack the procedural into a GU_Detail. By default, this calls getGTFull() and converts the GT geometry to a GU_Detail.
Reimplemented in GU_PackedGeometry.
Definition at line 378 of file GU_PackedImpl.h.
|
inlineprotectedvirtual |
Most implementations don't require the primitive once they have the transform, so the default implementation just calls the signature without the primitive. This function may be removed in the future, since it was only added because Alembic packed primitives copy primitive group membership from the original packed prim, which may not be advisable in all cases.
Reimplemented in GusdGU_PackedUSD, and GABC_NAMESPACE::GABC_PackedImpl.
Definition at line 398 of file GU_PackedImpl.h.
|
virtual |
|
pure virtual |
Depending on the update, the procedural should call one of:
Implemented in GusdGU_PackedUSD, GU_Agent, GABC_NAMESPACE::GABC_PackedImpl, GU_PackedFragment, GU_PackedGeometry, GU_PackedDisk, and GU_PackedDiskSequence.
|
friend |
Definition at line 619 of file GU_PackedImpl.h.
|
staticprotected |
Definition at line 526 of file GU_PackedImpl.h.