HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GU_PackedImpl.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: GU_PackedImpl.h (GU Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __GU_PackedImpl__
12 #define __GU_PackedImpl__
13 
14 #include "GU_API.h"
15 #include <GEO/GEO_PackedTypes.h>
16 #include <GA/GA_Types.h>
17 #include "GU_Detail.h"
18 #include "GU_DetailHandle.h"
19 
20 class UT_MemoryCounter;
21 class UT_Options;
22 class GU_PackedFactory;
23 class GU_PrimPacked;
24 class GA_LoadMap;
25 class GA_Primitive;
26 class GA_SaveMap;
27 class STY_Styler;
28 class STY_StylerGroup;
29 class GU_PackedContext;
30 
31 /// This class is used by the deferred load primitives to provide methods to
32 /// handle the deferred geometry.
33 ///
34 /// <b>Load/save of shared primitive data</b>
35 /// If multiple instances of the packed primitive share data, it's possible to
36 /// save this data just once (instead of per primitive).
37 ///
38 /// There are two parts to saving shared data. Saving the actual data, but
39 /// also saving a "key" used to resolve the shared data. The shared data
40 /// itself is saved using @c saveSharedData(). In addition, the "key"
41 /// associated with the shared data is saved per-primitive instance.
42 /// During loading, the "key" is used to resolve the shared data.
43 ///
44 /// When generating a key, the key must be unique within all shared data blocks
45 /// for a single geometry. A simple way to do this would be to use the address
46 /// of the shared data item. More complicated ways might include using a GUID,
47 /// etc. For example, with a @c UT_SharedPtr<GU_Detail>, you might have
48 /// generate a key using: @code
49 /// @code
50 /// UT_StringHolder makeKey(const UT_SharedPtr<GU_Detail> &detail) {
51 /// UT_WorkBuffer key;
52 /// key.sprintf("sharedgeo:%p", detail.get());
53 /// return UT_StringHolder(key);
54 /// }
55 /// @endcode
56 ///
57 /// The @c saveSharedData() method writes a single JSON object to the save
58 /// stream. During loading, the loader expects to load an array containing
59 /// four items. @code
60 /// [
61 /// "string Primitive_Name",
62 /// "string Shared_Data_Type",
63 /// "string Shared_Data_Identifier",
64 /// shared_data
65 /// ]
66 /// @endcode
67 /// The @c Primitive_Name ensures that shared data resolution is tied to the
68 /// specific primitive type. Kind of like a namespace.
69 ///
70 /// The @c Shared_Data_Type is an identifier to allow primitives to store
71 /// multiple types of shared data. For example, if you have a material
72 /// definition and a geometry definition, these can be stored as separate
73 /// shared blocks rather than creating separate shared blocks for each pair.
74 ///
75 /// The @c Shared_Data_Identifier is a unique identifier used to specify a
76 /// particular instance of a shared data block. This is the "key" that can be
77 /// used to resolve the data at load time. See the @c makeKey() example above.
78 ///
79 /// Example code might be something like @code
80 /// UT_StringHolder key = makeKey(mySharedObject);
81 /// if (save_map.hasSavedSharedData(key))
82 /// return true; // Another primitive has saved the shared data
83 /// map.setSavedSharedData(key);
84 /// json.jsonStringToken(getFactory()->name());
85 /// // Used for seeking (see section on loading)
86 /// geometryIndex->addEntry(key, json.getNumBytesWritten());
87 ///
88 /// json.beginArray();
89 /// json.jsonString("Shared_Data_Type");
90 /// json.jsonString(key);
91 /// json.jsonBeginMap();
92 /// ...
93 /// json.jsonEndMap();
94 ///
95 /// // Provide a seek point used for loading
96 /// UT_WorkBuffer endkey(key);
97 /// endkey.append(GA_SAVEMAP_END_TOKEN);
98 /// geometryIndex->addEntry(endkey.buffer(), w.getNumBytesWritten());
99 /// ok = ok && w.jsonEndArray();
100 /// @endcode
101 ///
102 /// The @c save() method needs to store the key so the shared data can be
103 /// resolved at load time. The identifier you use in the save method doesn't
104 /// have to be the @c "Shared_Data_Type" string, but it does have to match the
105 /// value in the load method. For example: @code
106 /// PrimClass::save(UT_Options &options, const GA_SaveMap &map) const {
107 /// options.setOptionS("shareddata", makeKey());
108 /// }
109 /// @endcode
110 ///
111 /// Shared data loading may be deferred until the shared data is actually
112 /// required. This is done using a "handle" to the shared data (@c
113 /// GA_SharedDataHandlePtr). During the load() method, you can ask for a
114 /// handle to any shared data. @code
115 /// bool load(const UT_Options &options, const GA_LoadMap &loadmap) {
116 /// UT_StringHolder key;
117 /// if (import(options, "shareddata", key)) {
118 /// mySharedHandle = loadmap.needSharedData(key,
119 /// getFactory()->name(), nullptr);
120 /// }
121 /// @endcode
122 ///
123 /// When loading primitives, the shared data is not actually available until
124 /// later in the loading process. The primitive itself needs to hold a
125 /// reference to the shared data handle so the shared data can be resolved at a
126 /// later time.
127 ///
128 /// Resolving the handle is done by asking the handle to resolve the shared
129 /// data, and then extracting information from a sub-class of a
130 /// @c GA_SharedLoadData object. If the shared data is never resolved, it's
131 /// possible the @c GA_SharedLoadData may never read the data from the file
132 /// (if the geometry format supports seeking, the loader may be able to use the
133 /// offsets stored in the @c geometryIndex during writing). The code to
134 /// resolve the data might look like: @code
135 /// if (mySharedHandle)
136 /// {
137 /// const GA_SharedLoadData *item;
138 /// const CustomSharedLoadData *data;
139 /// item = mySharedHandle->resolveSharedData(packed_context);
140 /// data = dynamic_cast<const CustomSharedLoadData *>(item);
141 /// if (!data)
142 /// return false; // This really shouldn't ever happen
143 /// copySharedData(data);
144 ///
145 /// /// Clear the reference to the @c GA_SharedDataHandlePtr. When all
146 /// /// references to the shared handle are cleared, the handle will be
147 /// /// deleted.
148 /// mySharedHandle.clear();
149 /// }
150 /// @endcode
151 ///
152 /// The last piece to loading, is the actual loading of the shared data block.
153 /// Since shared data blocks must be able to be loaded without a primitive
154 /// object, the loading is handled by the @c GU_PackedFactory subclass (the @c
155 /// loadSharedData()) method. This method should create the sub-class of the
156 /// @c GA_SharedLoadData object that's used when resolving shared data. For
157 /// example @code
158 /// class CustomFactory : public GU_PackedFactory
159 /// {
160 /// // The type matches the "Shared_Data_Type" described above
161 /// // The key matches the "Shared_Data_Identifier" described above
162 /// virtual GA_SharedLoadData *loadSharedData(UT_JSONParser &p,
163 /// const char *type,
164 /// const char *key,
165 /// bool is_delayed_load) const
166 /// {
167 /// CustomSharedLoadData *data = new CustomSharedLoadData();
168 ///
169 /// // This just load the data. For example the JSON Map saved in
170 /// // the example above (not the entire array of shared data).
171 /// if (!data->load(p))
172 /// {
173 /// delete data;
174 /// return nullptr; // Unable to load the shared data
175 /// }
176 /// return data;
177 /// }
178 /// };
179 /// @endcode
181 {
182 public:
183  /// @{
184  /// Typedefs for intrinsic evaluation
185  typedef fpreal (GU_PackedImpl::*FloatGetter)(const GU_PrimPacked *) const;
186  typedef void (GU_PackedImpl::*FloatSetter)(const GU_PrimPacked *, fpreal);
187  typedef GA_Size (GU_PackedImpl::*IntGetter)(const GU_PrimPacked *) const;
188  typedef void (GU_PackedImpl::*IntSetter)(GU_PrimPacked *, GA_Size);
189  typedef bool (GU_PackedImpl::*BoolGetter)(const GU_PrimPacked *) const;
190  typedef void (GU_PackedImpl::*BoolSetter)(GU_PrimPacked *, bool);
191  typedef const char *(GU_PackedImpl::*StringGetter)(const GU_PrimPacked *) const;
192  typedef void (GU_PackedImpl::*StringSetter)(GU_PrimPacked *, const char *);
193  typedef std::string (GU_PackedImpl::*StdStringGetter)(const GU_PrimPacked *) const;
194  typedef void (GU_PackedImpl::*StdStringSetter)(GU_PrimPacked *, const std::string &);
195  typedef UT_StringHolder (GU_PackedImpl::*StringHolderGetter)(const GU_PrimPacked *) const;
196  typedef void (GU_PackedImpl::*StringHolderSetter)(GU_PrimPacked *, const UT_StringHolder &);
197 
198  typedef fpreal (GU_PackedImpl::*FloatTupleGetter)(const GU_PrimPacked *, exint) const;
199  typedef void (GU_PackedImpl::*FloatTupleSetter)(GU_PrimPacked *, exint, fpreal);
200  typedef GA_Size (GU_PackedImpl::*IntTupleGetter)(const GU_PrimPacked *, exint) const;
201  typedef void (GU_PackedImpl::*IntTupleSetter)(GU_PrimPacked *, exint,GA_Size);
202  typedef bool (GU_PackedImpl::*BoolTupleGetter)(const GU_PrimPacked *, exint) const;
203  typedef void (GU_PackedImpl::*BoolTupleSetter)(GU_PrimPacked *, exint,bool);
204  typedef const char *(GU_PackedImpl::*StringTupleGetter)(const GU_PrimPacked *, exint) const;
205  typedef void (GU_PackedImpl::*StringTupleSetter)(GU_PrimPacked *, exint,const char *);
206  typedef std::string (GU_PackedImpl::*StdStringTupleGetter)(const GU_PrimPacked *, exint) const;
207  typedef void (GU_PackedImpl::*StdStringTupleSetter)(GU_PrimPacked *, exint,const std::string &);
208  typedef UT_StringHolder (GU_PackedImpl::*StringHolderTupleGetter)(const GU_PrimPacked *, exint) const;
209  typedef void (GU_PackedImpl::*StringHolderTupleSetter)(GU_PrimPacked *, exint,const UT_StringHolder &);
210 
211  typedef void (GU_PackedImpl::*F32VectorGetter)(const GU_PrimPacked *, fpreal32*, exint) const;
212  typedef void (GU_PackedImpl::*F32VectorSetter)(GU_PrimPacked *, const fpreal32*, exint);
213  typedef void (GU_PackedImpl::*F64VectorGetter)(const GU_PrimPacked *, fpreal64*, exint) const;
214  typedef void (GU_PackedImpl::*F64VectorSetter)(GU_PrimPacked *, const fpreal64*, exint);
215  typedef void (GU_PackedImpl::*I32VectorGetter)(const GU_PrimPacked *, int32 *, exint) const;
216  typedef void (GU_PackedImpl::*I32VectorSetter)(GU_PrimPacked *, const int32 *, exint);
217  typedef void (GU_PackedImpl::*I64VectorGetter)(const GU_PrimPacked *, int64 *, exint) const;
218  typedef void (GU_PackedImpl::*I64VectorSetter)(GU_PrimPacked *, const int64 *, exint);
219  typedef void (GU_PackedImpl::*BVectorGetter)(const GU_PrimPacked *, bool *, exint) const;
220  typedef void (GU_PackedImpl::*BVectorSetter)(GU_PrimPacked *, const bool *, exint);
221 
222  typedef void (GU_PackedImpl::*StringArrayGetter)(const GU_PrimPacked *, UT_StringArray &) const;
223  typedef void (GU_PackedImpl::*StringArraySetter)(GU_PrimPacked *, const UT_StringArray &);
224  /// @}
225 
226  GU_PackedImpl();
228  virtual ~GU_PackedImpl();
229 
230  /// Get the factory associated with this procedural
231  virtual GU_PackedFactory *getFactory() const = 0;
232 
233  /// Create a copy of this resolver
234  virtual GU_PackedImpl *copy() const = 0;
235 
236  /// Test whether the deferred load primitive data is valid
237  virtual bool isValid() const = 0;
238 
239  /// The clearData() method is called when the primitives are stashed during
240  /// the cook of a SOP. See GA_Primitive::stashed(). This gives the
241  /// primitive to optionally clear some data during the stashing process.
242  virtual void clearData() = 0;
243 
244  /// Give a UT_Options of load data, create resolver data for the primitive
245  virtual bool load(GU_PrimPacked *prim, const UT_Options &options,
246  const GA_LoadMap &map) = 0;
247 
248  /// Determines if we support loading from a JSONParser directly
249  /// rather than just from a UT_Options. Loading from JSON is typically
250  /// more efficient than loading from a UT_Options since the file loader
251  /// doesn't have to convert the JSON map to a UT_Options.
252  virtual bool supportsJSONLoad() const { return false; }
253 
254  /// The JSONValueMap represents a UT_Options. The options may be saved in
255  /// compact form, but also may be saved in expanded form. If in expanded
256  /// form, the value for each key's value is a UT_JSONValueMap storing the
257  /// value in the "value" key. It's highly suggested you just use the
258  /// protected import() convenience method which deals with this for you.
259  virtual bool loadFromJSON(
260  GU_PrimPacked *prim,
261  const UT_JSONValueMap &options,
262  const GA_LoadMap &map)
263  { UT_ASSERT(!"JSON direct loading not supported"); return false; }
264 
265  /// Depending on the update, the procedural should call one of:
266  /// - prim->transformDirty()
267  /// - prim->attributeDirty()
268  /// - prim->topologyDirty()
269  virtual void update(GU_PrimPacked *prim, const UT_Options &options) = 0;
270 
271  /// Save shared data objects to the JSON stream. This is called directly
272  /// from GA_Primitive::saveSharedLoadData(). Please see GU_PackedFactory
273  /// for the interface to create the shared data loader.
274  virtual bool saveSharedData(UT_JSONWriter &w,
275  GA_SaveMap &map,
276  GA_GeometryIndex *geometryIndex) const;
277 
278  /// This method is called to resolve the shared data on load. The @c
279  /// load_data_type given is the integer passed when you called
280  /// "GA_LoadMap::needSharedData()" -- which was done in load().
281  virtual bool loadSharedData(int load_data_type,
282  const GA_SharedLoadData *item);
283 
284  /// Copy the resolver data into the UT_Options for saving
285  virtual bool save(UT_Options &options,
286  const GA_SaveMap &map) const = 0;
287 
288  /// Handle unknown token/value pairs when loading the primitive. By
289  /// default, this adds a warning and skips the next object. Return false
290  /// if there was a critical error.
291  virtual bool loadUnknownToken(const char *token, UT_JSONParser &p,
292  const GA_LoadMap &map);
293 
294  /// Get the bounding box for the geometry (not including transforms)
295  virtual bool getBounds(UT_BoundingBox &box) const = 0;
296 
297  /// Get the rendering bounding box for the geometry (not including
298  /// transforms). For curve and point geometry, this needs to include any
299  /// "width" attributes.
300  virtual bool getRenderingBounds(UT_BoundingBox &box) const = 0;
301 
302  /// When rendering with velocity blur, the renderer needs to know the
303  /// bounds on velocity to accurately compute the bounding box.
304  virtual void getVelocityRange(UT_Vector3 &min,
305  UT_Vector3 &max) const = 0;
306 
307  /// When rendering points or curves, the renderer needs to know the bounds
308  /// on the width attribute to accurately compute the bounding box.
309  virtual void getWidthRange(fpreal &wmin, fpreal &wmax) const = 0;
310 
311  /// Return the primitive's "description". This should be a unique
312  /// identifier for the primitive and defaults to:
313  /// <tt>"%s.%d" % (getFactory()->name(), getPrim()->getNum()) </tt>
314  virtual void getPrimitiveName(const GU_PrimPacked *prim, UT_WorkBuffer &wbuf) const;
315 
316  /// @{
317  /// Intrinsic functions
318  int64 intrinsic3Tuple(const GU_PrimPacked *prim) const { return 3; }
319  int64 intrinsic6Tuple(const GU_PrimPacked *prim) const { return 6; }
320  int64 intrinsic9Tuple(const GU_PrimPacked *prim) const { return 9; }
321  int64 intrinsic16Tuple(const GU_PrimPacked *prim) const { return 16; }
322  std::string intrinsicPrimitiveName(const GU_PrimPacked *prim) const;
323  const char *intrinsicFactoryName(const GU_PrimPacked *prim) const;
324  const char *intrinsicFactoryLabel(const GU_PrimPacked *prim) const;
325  void intrinsicPackedBox(const GU_PrimPacked *prim, fpreal64 *vals, exint sz) const;
326  void intrinsicPackedRenderBox(const GU_PrimPacked *prim, fpreal64 *vals, exint sz) const;
327  void intrinsicPivot(const GU_PrimPacked *prim, fpreal64 *vals, exint sz) const;
328  void intrinsicSetPivot(GU_PrimPacked *prim, const fpreal64 *vals, exint sz);
329  void intrinsicPrimTransform(const GU_PrimPacked *prim, fpreal64 *vals, exint sz) const;
330  void intrinsicSetPrimTransform(GU_PrimPacked *prim, const fpreal64 *v, exint sz);
331  void intrinsicPackedTransform(const GU_PrimPacked *prim, fpreal64 *v, exint sz) const;
332  void intrinsicFullTransform(const GU_PrimPacked *prim, fpreal64 *v, exint sz) const;
333  const char *intrinsicViewportLOD(const GU_PrimPacked *prim) const;
334  void intrinsicSetViewportLOD(GU_PrimPacked *prim, const char *lod);
335  /// @}
336 
337  /// Some procedurals have an "intrinsic" transform. These are combined
338  /// with the local transform on the geometry primitive.
339  ///
340  /// The default method returns false and leaves the transform unchanged.
341  virtual bool getLocalTransform(UT_Matrix4D &m) const;
342 
343  /// Unpack the procedural into a GU_Detail. By default, this calls
344  /// getGTFull() and converts the GT geometry to a GU_Detail.
345  virtual bool unpackWithContext(GU_Detail &destgdp, GU_PackedContext &context) const
346  { return unpack(destgdp); }
347  virtual bool unpack(GU_Detail &destgdp) const = 0;
348  /// Unpack into a GU_Detail, and generate stylers for each primitive.
349  /// By default calls unpack, prunes the supplied styler for each generated
350  /// primitive, and adds the styles in the material_stylesheet attribute
351  /// for each primitive.
352  virtual bool unpackWithStyler(GU_Detail &destgdp,
353  STY_StylerGroup &prim_styler_group,
354  const STY_Styler &parent_styler) const;
355 
356  /// Forces a load of all shared data the primitive has access to
357  /// this should leave no data on disk
358  virtual void forceLoad() const {}
359 
360  /// Checks if this packed implementation has loaded its shared data
361  /// Default implementation returns true.
362  virtual bool isLoaded() const { return true; }
363 
364  /// Unpack the procedural into a GU_Detail using polygons instead of
365  /// polygon soups. The default method just unpacks, then converts polygon
366  /// soups to polygons.
367  virtual bool unpackUsingPolygons(GU_Detail &destgdp) const;
368 
369  /// Get a reference to a const GU_Detail for the packed geometry. Not all
370  /// implementations need to provide this. If this isn't implemented, the
371  /// method should return an empty detail handle. This is meant as a quick
372  /// short-cut instead of having to call unpack() which performs a full
373  /// merge.
374  virtual GU_ConstDetailHandle getPackedDetail(GU_PackedContext *context = 0) const;
375 
376  /// If @c pointInstanceTransform() returns false, @c getFullTransform4()
377  /// method will only use the point position as a translate. If true, @c
378  /// getFullTransform4() will perform the standard "houdini instancing"
379  /// (i.e. use the "N", "v", "rot" and other attributes to compute an
380  /// orientation and translation).
381  ///
382  /// The default method returns false, so only "P" is used to apply
383  /// translates.
385  { return myPointInstanceTransform; }
387  { return pointInstanceTransform(); }
388 
389  /// Set whether point instancing should be used.
390  void setPointInstanceTransform(GU_PrimPacked *prim, bool b);
391 
392  /// Indicate that topology and attributes are dirty
393  void topologyDirty();
394 
395  GU_PrimPacked *getPrim() { return myOwner; }
396  const GU_PrimPacked *getPrim() const { return myOwner; }
397 
398  /// Convenience method to compute the velocity bounds for a given geometry.
399  /// The geometry may be a NULL pointer.
400  static bool computeVelocityRange(const GU_Detail *gdp,
401  UT_Vector3 &vmin, UT_Vector3 &vmax);
402  static bool computeWidthRange(const GU_Detail *gdp,
403  fpreal &wmin, fpreal &wmax);
404 
405  /// Report memory usage (includes all shared memory)
406  virtual int64 getMemoryUsage(bool inclusive) const = 0;
407 
408  /// Count memory usage using a UT_MemoryCounter in order to count
409  /// shared memory correctly.
410  /// NOTE: There's nothing outside of sizeof(*this) to count in the
411  /// base class, so it can be pure virtual.
412  virtual void countMemory(UT_MemoryCounter &counter, bool inclusive) const = 0;
413 
414  /// Determines if we should save the bounding box to the metadata, this
415  /// makes sense for fully embedded primitives, but if the primitive
416  /// can be swapped out without the owner knowing, it should be
417  /// avoided.
418  virtual bool saveCachedBBox() const { return false; }
419 
420 protected:
421  /// For all the groups that this primitive belongs to, create groups on the
422  /// destination detail and place all primitives in the given range into the
423  /// groups. If the group already exists on the destination detail, then
424  /// nothing is done (unless @c force is set).
425  void copyPrimitiveGroups(GU_Detail &dest, bool force=false) const;
426 
427  /// Unpack the source detail into the destination detail. The source
428  /// detail *may* be modified (attributes may be promoted)
429  ///
430  /// The @c src detail is not deleted by unpackToDetail.
431  bool unpackToDetail(GU_Detail &destgdp,
432  GU_Detail *src,
433  bool do_transform = true) const;
434  /// Unpack the source detail into the destination detail. The source
435  /// detail is const and will not be modified. However, this may be more
436  /// expensive than the non-const version.
437  bool unpackToDetail(GU_Detail &destgdp,
438  const GU_Detail *src,
439  bool do_transform = true) const;
440  /// Unpack the source detail handle
441  bool unpackToDetail(GU_Detail &destgdp,
442  const GU_ConstDetailHandle &gdh,
443  bool do_transform = true) const
444  {
445  GU_DetailHandleAutoReadLock rlock(gdh);
446  return unpackToDetail(destgdp, rlock.getGdp(), do_transform);
447  }
448  /// Optional method to compute centroid (default uses bounding box)
449  virtual UT_Vector3 getBaryCenter() const;
450  /// Optional method to calculate volume (default uses bounding box)
451  virtual fpreal computeVolume(const UT_Vector3 &refpt) const;
452  /// Optional method to calculate surface area (default uses bounding box)
453  virtual fpreal computeArea() const;
454  /// Optional method to calculate perimeter (default uses bounding box)
455  virtual fpreal computePerimeter() const;
456 
457  /// Set the bounding box cache for the primitive
458  void setBoxCache(const UT_BoundingBox &box) const;
459 
460  /// @{
461  /// Import a value from a UT_JSONValueMap or a UT_Options. This handles
462  /// both the compact and expanded options and is valid for the same types
463  /// as UT_JSONValueMap::import()
464  ///
465  /// These import() methods can be used in the @c load() and @c
466  /// loadFromJSON() methods to simplify importing code. For example, you
467  /// should be able to implement a generic @c loadFrom() method, templated
468  /// on either @c UT_Options or @c UT_JSONValueMap. You can then just @code
469  /// virtual bool load(const UT_Options &options, const GA_LoadMap &map)
470  /// { return loadFrom<UT_Options>(options, map); }
471  /// virtual bool loadFromJSONValueMap(const UT_JSONValueMap &options,
472  /// const GA_LoadMap &map)
473  /// { return loadFrom<UT_Options>(options, map); }
474  /// @endcode
475  template <typename T>
476  static bool import(const UT_JSONValueMap &options,
477  const UT_StringRef &key,
478  T &value);
479  template <typename T>
480  static bool import(const UT_Options &options,
481  const UT_StringRef &key,
482  T &value);
483  /// @}
484 
485 private:
486  GU_PrimPacked *myOwner;
487  bool myPointInstanceTransform;
488 
489  friend class GU_PrimPacked;
490 };
491 
492 #endif
virtual bool saveCachedBBox() const
bool unpackToDetail(GU_Detail &destgdp, const GU_ConstDetailHandle &gdh, bool do_transform=true) const
Unpack the source detail handle.
UT_JSONValueMap stores a map/dictionary of UT_JSONValue objects.
Used to pass options and map offset values during saving.
Definition: GA_SaveMap.h:48
const hboost::disable_if_c< VecTraits< T >::IsVec, T >::type & min(const T &a, const T &b)
Definition: Composite.h:128
const GLdouble * v
Definition: glcorearb.h:836
GLsizei const GLchar *const * string
Definition: glcorearb.h:813
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
GU_PrimPacked * getPrim()
JSON reader class which handles parsing of JSON or bJSON files.
Definition: UT_JSONParser.h:72
Class which writes ASCII or binary JSON streams.
Definition: UT_JSONWriter.h:32
3D Vector class.
virtual bool loadFromJSON(GU_PrimPacked *prim, const UT_JSONValueMap &options, const GA_LoadMap &map)
exint GA_Size
Defines the bit width for index and offset types in GA.
Definition: GA_Types.h:211
const char *(GU_PackedImpl::* StringGetter)(const GU_PrimPacked *) const
const hboost::disable_if_c< VecTraits< T >::IsVec, T >::type & max(const T &a, const T &b)
Definition: Composite.h:132
virtual bool isLoaded() const
long long int64
Definition: SYS_Types.h:106
virtual bool unpackWithContext(GU_Detail &destgdp, GU_PackedContext &context) const
int64 intrinsic16Tuple(const GU_PrimPacked *prim) const
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:102
virtual void forceLoad() const
int64 exint
Definition: SYS_Types.h:115
double fpreal64
Definition: SYS_Types.h:191
bool intrinsicPointInstanceTransform(const GU_PrimPacked *prim) const
Options during loading.
Definition: GA_LoadMap.h:42
const char *(GU_PackedImpl::* StringTupleGetter)(const GU_PrimPacked *, exint) const
#define GU_API
Definition: GU_API.h:11
int int32
Definition: SYS_Types.h:34
GLboolean GLboolean GLboolean b
Definition: glcorearb.h:1221
int64 intrinsic9Tuple(const GU_PrimPacked *prim) const
GLsizei const GLfloat * value
Definition: glcorearb.h:823
double fpreal
Definition: SYS_Types.h:269
A map of string to various well defined value types.
Definition: UT_Options.h:42
bool pointInstanceTransform() const
GLubyte GLubyte GLubyte GLubyte w
Definition: glcorearb.h:856
int64 intrinsic6Tuple(const GU_PrimPacked *prim) const
int64 intrinsic3Tuple(const GU_PrimPacked *prim) const
virtual bool supportsJSONLoad() const
const GU_PrimPacked * getPrim() const
float fpreal32
Definition: SYS_Types.h:190
const GU_Detail * getGdp() const
GLint lod
Definition: glcorearb.h:2764
GLenum src
Definition: glcorearb.h:1792