HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GU_PackedDiskSequence.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_PackedDiskSequence.h (GU Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __GU_PackedDiskSequence__
12 #define __GU_PackedDiskSequence__
13 
14 #include "GU_PackedSequence.h"
15 #include "GU_PackedDisk.h"
16 #include <UT/UT_StringHolder.h>
17 #include <UT/UT_StringArray.h>
18 
20 class UT_MemoryCounter;
21 
22 /// Geometry file procedural
24 {
25 public:
28 
31  ~GU_PackedDiskSequence() override;
32 
33  /// Convenience method to create a packed primitive in the destination
34  /// detail.
35  ///
36  /// Returns a NULL pointer if the process fails.
37  static GU_PrimPacked *packedDiskSequence(GU_Detail &dest,
38  const UT_StringArray &filenames,
39  fpreal index,
40  WrapMode wrap);
41 
42  /// Install the procedural
43  static void install(GA_PrimitiveFactory *prim);
44 
45  /// Get the type ID for the GU_PackedDiskSequence primitive type.
46  static GA_PrimitiveTypeId typeId() { return theTypeId; }
47 
48  /// @{
49  /// Implementation of GU_PackedImpl interface
50  GU_PackedFactory *getFactory() const override;
51  GU_PackedImpl *copy() const override;
52  void clearData() override;
53 
54  bool isValid() const override;
55  bool load(GU_PrimPacked *prim, const UT_Options &options,
56  const GA_LoadMap &map) override
57  {
58  return loadFrom(prim, options, map);
59  }
60  bool supportsJSONLoad() const override { return true; }
62  GU_PrimPacked *prim,
63  const UT_JSONValueMap &options,
64  const GA_LoadMap &map) override
65  {
66  return loadFrom(prim, options, map);
67  }
68  void update(GU_PrimPacked *prim, const UT_Options &options) override;
69  bool save(UT_Options &options, const GA_SaveMap &map) const override;
70  bool isLoaded() const override;
71 
72  /// Report memory usage (includes all shared memory)
73  int64 getMemoryUsage(bool inclusive) const override;
74 
75  /// Count memory usage using a UT_MemoryCounter in order to count
76  /// shared memory correctly.
77  void countMemory(UT_MemoryCounter &counter,
78  bool inclusive) const override;
79  /// @}
80 
81  /// @{
82  /// Member data accessors for intrinsics
83  void filenames(UT_StringArray &files) const;
84  void intrinsicFilenames(const GU_PrimPacked *prim, UT_StringArray &files) const
85  { filenames(files); }
86  void setFilenames(GU_PrimPacked *prim, const UT_StringArray &files);
87  /// @}
88 
90 
92 
93  GU_ConstDetailHandle getPointCloud() const;
94 
95  InstanceKey getInstanceKey(exint quanize_steps) const override;
96 
97  GU_ConstDetailHandle getClosestGeometry(fpreal t) const;
98 
99 protected:
100  template <typename T>
101  bool loadFrom(GU_PrimPacked *prim, const T &options, const GA_LoadMap &map);
102 
103  exint sequenceSize() const override;
104  bool sequenceBounds(exint index, UT_BoundingBox &box) const override;
106  exint index,
107  UT_BoundingBox &box) const override;
109  exint index,
110  UT_Vector3 &min,
111  UT_Vector3 &max) const override;
112  void sequenceWidthRange(
113  exint index,
114  fpreal &min,
115  fpreal &max) const override;
116 
119 
121 
122 private:
123  static GA_PrimitiveTypeId theTypeId;
124 };
125 
126 #endif
virtual void sequenceVelocityRange(exint index, UT_Vector3 &min, UT_Vector3 &max) const =0
The base class for a sequence of packed geometry.
GT_API const UT_StringHolder filename
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
virtual bool sequenceVisibleBounds(exint index, UT_BoundingBox &box) const =0
static GA_PrimitiveTypeId typeId()
Get the type ID for the GU_PackedDiskSequence primitive type.
int64 exint
Definition: SYS_Types.h:125
virtual InstanceKey getInstanceKey(exint quantize_steps) const
ImageBuf OIIO_API min(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
virtual bool isLoaded() const
UT_Array< CacheItem > myCache
friend class CacheItem
virtual void clearData()=0
virtual int64 getMemoryUsage(bool inclusive) const =0
Report memory usage (includes all shared memory)
virtual void countMemory(UT_MemoryCounter &counter, bool inclusive) const =0
virtual GU_PackedFactory * getFactory() const =0
Get the factory associated with this procedural.
long long int64
Definition: SYS_Types.h:116
Options during loading.
Definition: GA_LoadMap.h:42
#define GU_API
Definition: GU_API.h:14
bool isValid() const override
virtual GU_ConstDetailHandle sequenceGeometry(exint index) const =0
Subclass to return the geometry for the n'th item.
virtual bool sequenceBounds(exint index, UT_BoundingBox &box) const =0
GLdouble t
Definition: glad.h:2397
virtual void update(GU_PrimPacked *prim, const UT_Options &options)=0
virtual exint sequenceSize() const =0
Subclass returns the number of pieces of geometry in the sequence.
A map of string to various well defined value types.
Definition: UT_Options.h:84
virtual GU_PackedImpl * copy() const =0
Create a copy of this resolver.
fpreal64 fpreal
Definition: SYS_Types.h:277
Geometry file procedural.
GLuint index
Definition: glcorearb.h:786
ImageBuf OIIO_API max(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
bool supportsJSONLoad() const override
bool load(GU_PrimPacked *prim, const UT_Options &options, const GA_LoadMap &map) override
virtual void sequenceWidthRange(exint index, fpreal &min, fpreal &max) const =0
void intrinsicFilenames(const GU_PrimPacked *prim, UT_StringArray &files) const
virtual bool save(UT_Options &options, const GA_SaveMap &map) const =0
Copy the resolver data into the UT_Options for saving.
virtual GU_ConstDetailHandle sequencePointCloud(exint index) const =0
Subclass method to get point geometry for the n'th item.
bool loadFromJSON(GU_PrimPacked *prim, const UT_JSONValueMap &options, const GA_LoadMap &map) override
GLenum src
Definition: glcorearb.h:1793