HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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  virtual ~GU_PackedDiskSequence();
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  virtual GU_PackedFactory *getFactory() const;
51  virtual GU_PackedImpl *copy() const;
52  virtual void clearData();
53 
54  virtual bool isValid() const;
55  virtual bool load(GU_PrimPacked *prim, const UT_Options &options, const GA_LoadMap &map)
56  { return loadFrom(prim, options, map); }
57  virtual bool supportsJSONLoad() const { return true; }
58  virtual bool loadFromJSON(GU_PrimPacked *prim, const UT_JSONValueMap &options,
59  const GA_LoadMap &map)
60  { return loadFrom(prim, options, map); }
61  virtual void update(GU_PrimPacked *prim, const UT_Options &options);
62  virtual bool save(UT_Options &options, const GA_SaveMap &map) const;
63  virtual bool isLoaded() const;
64 
65  /// Report memory usage (includes all shared memory)
66  virtual int64 getMemoryUsage(bool inclusive) const;
67 
68  /// Count memory usage using a UT_MemoryCounter in order to count
69  /// shared memory correctly.
70  virtual void countMemory(UT_MemoryCounter &counter, bool inclusive) const;
71  /// @}
72 
73  /// @{
74  /// Member data accessors for intrinsics
75  void filenames(UT_StringArray &files) const;
76  void intrinsicFilenames(const GU_PrimPacked *prim, UT_StringArray &files) const
77  { filenames(files); }
78  void setFilenames(GU_PrimPacked *prim, const UT_StringArray &files);
79  /// @}
80 
81  UT_StringHolder filename(exint index) const;
82 
84 
85  GU_ConstDetailHandle getPointCloud() const;
86 
87  virtual InstanceKey getInstanceKey(exint quanize_steps) const;
88 
89  GU_ConstDetailHandle getClosestGeometry(fpreal t) const;
90 
91 protected:
92  template <typename T>
93  bool loadFrom(GU_PrimPacked *prim, const T &options, const GA_LoadMap &map);
94 
95  virtual exint sequenceSize() const;
96  virtual bool sequenceBounds(exint index,
97  UT_BoundingBox &box) const;
98  virtual void sequenceVelocityRange(exint index,
99  UT_Vector3 &min, UT_Vector3 &max) const;
100  virtual void sequenceWidthRange(exint index,
101  fpreal &min, fpreal &max) const;
102 
105 
107 
108 private:
109  static GA_PrimitiveTypeId theTypeId;
110 };
111 
112 #endif
virtual void sequenceVelocityRange(exint index, UT_Vector3 &min, UT_Vector3 &max) const =0
The base class for a sequence of packed geometry.
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
static GA_PrimitiveTypeId typeId()
Get the type ID for the GU_PackedDiskSequence primitive type.
virtual InstanceKey getInstanceKey(exint quantize_steps) 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
UT_Array< CacheItem > myCache
virtual bool load(GU_PrimPacked *prim, const UT_Options &options, const GA_LoadMap &map)
friend class CacheItem
int64 exint
Definition: SYS_Types.h:115
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.
Options during loading.
Definition: GA_LoadMap.h:42
#define GU_API
Definition: GU_API.h:11
virtual bool isValid() const
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
virtual bool supportsJSONLoad() const
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.
double fpreal
Definition: SYS_Types.h:269
A map of string to various well defined value types.
Definition: UT_Options.h:42
virtual GU_PackedImpl * copy() const =0
Create a copy of this resolver.
Geometry file procedural.
virtual bool loadFromJSON(GU_PrimPacked *prim, const UT_JSONValueMap &options, const GA_LoadMap &map)
GLuint index
Definition: glcorearb.h:785
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.
GLenum src
Definition: glcorearb.h:1792