11 #ifndef __GU_PackedDisk__
12 #define __GU_PackedDisk__
42 static exint clearDiskCache();
62 {
return loadFrom(prim, options, map); }
69 {
return loadFrom(prim, options, map); }
82 fpreal &wmax)
const override;
100 bool inclusive)
const override;
123 {
return expandFrame(); }
133 myExpandFilename =
b;
138 return treatAsFolder();
146 static exint getCacheVersion();
160 : myFilename(filename)
165 : myFilename(src.myFilename)
180 setFilename(src.myFilename);
190 releaseFromCache(myFilename);
196 bool isDifferentFile(
const char *filename)
const;
201 if (filename != myFilename)
211 return GU_PackedDisk::loadFromCache(myFilename, myResolved, impl);
217 return GU_PackedDisk::loadPointCloudFromCache(myFilename,
228 return GU_PackedDisk::loadVelocityRangeFromCache(myFilename,
229 myResolved, vmin, vmax);
234 return GU_PackedDisk::loadWidthRangeFromCache(myFilename,
235 myResolved, wmin, wmax);
239 bool isLoaded()
const {
return GU_PackedDisk::checkIsLoaded(myFilename, myResolved); }
247 mutable bool myResolved;
250 template <
typename T>
286 template <
bool VISIBLE_ONLY>
287 static bool loadBoxFromCache(
const UT_StringRef &filename,
294 static bool loadVelocityRangeFromCache(
const UT_StringRef &filename,
302 static bool loadWidthRangeFromCache(
const UT_StringRef &filename,
308 static void releaseFromCache(
const UT_StringRef &filename);
311 static bool checkIsLoaded(
const UT_StringRef &filename,
bool& resolved);
virtual void getVelocityRange(UT_Vector3 &min, UT_Vector3 &max) const =0
Geometry File procedural.
GT_API const UT_StringHolder filename
UT_JSONValueMap stores a map/dictionary of UT_JSONValue objects.
void setExpandFilename(GU_PrimPacked *prim, bool b)
void setUnexpanded(GU_PrimPacked *prim, const UT_StringHolder &f)
Used to pass options and map offset values during saving.
bool intrinsicTreatAsFolder(const GU_PrimPacked *prim) const
bool load(GU_PrimPacked *prim, const UT_Options &options, const GA_LoadMap &map) override
static GA_PrimitiveTypeId typeId()
Get the type ID for the GU_PackedDisk primitive type.
fpreal expandFrame() const
bool intrinsicExpandFilename(const GU_PrimPacked *prim) const
fpreal intrinsicExpandFrame(const GU_PrimPacked *prim) const
ImageBuf OIIO_API min(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
bool getWidthRange(fpreal &wmin, fpreal &wmax) const
Get width range.
virtual bool getBounds(UT_BoundingBox &box) const =0
Get the bounding box for the geometry (not including transforms)
#define GA_INVALID_OFFSET
virtual bool getRenderingBounds(UT_BoundingBox &box) const =0
virtual bool isLoaded() const
void setFilename(const UT_StringHolder &filename)
Change the filename. Returns true if the filename changed.
void clear()
Clear the item (possibly releasing from the cache)
virtual bool getVisibleBounds(UT_BoundingBox &box) const
void setExpandFrame(GU_PrimPacked *prim, fpreal f)
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
bool treatAsFolder() const
virtual GU_PackedFactory * getFactory() const =0
Get the factory associated with this procedural.
virtual GU_ConstDetailHandle getPackedDetail(GU_PackedContext *context=0) const
GU_ConstDetailHandle getPointCloud(const GU_PackedImpl &impl) const
Get point cloud for file.
GLboolean GLboolean GLboolean b
GA_API const UT_StringHolder transform
virtual bool isValid() const =0
Test whether the deferred load primitive data is valid.
bool loadFromJSON(GU_PrimPacked *prim, const UT_JSONValueMap &options, const GA_LoadMap &map) override
virtual void update(GU_PrimPacked *prim, const UT_Options &options)=0
const UT_StringHolder & filename() const
Accessors.
UT_StringHolder unexpanded() const
virtual void getPrimitiveName(const GU_PrimPacked *prim, UT_WorkBuffer &wbuf) const
bool supportsJSONLoad() const override
A map of string to various well defined value types.
bool getVelocityRange(UT_Vector3 &vmin, UT_Vector3 &vmax) const
Get velocity range.
UT_StringHolder intrinsicUnexpanded(const GU_PrimPacked *prim) const
virtual GU_PackedImpl * copy() const =0
Create a copy of this resolver.
void intrinsicSetTreatAsFolder(GU_PrimPacked *prim, bool b)
bool unpack(GU_Detail &destgdp, const GU_PrimPacked *prim) const
UT_StringHolder intrinsicFilename(const GU_PrimPacked *prim) const
ImageBuf OIIO_API max(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
CacheItem(const CacheItem &src)
UT_StringHolder filename() const
bool expandFilename() const
bool isLoaded() const
Check if cache has been loaded from disk.
UT_StringHolder myUnexpanded
void setTreatAsFolder(bool b)
virtual bool save(UT_Options &options, const GA_SaveMap &map) const =0
Copy the resolver data into the UT_Options for saving.
CacheItem & operator=(const CacheItem &src)
Assignment operator.
CacheItem(const UT_StringHolder &filename)
virtual void getWidthRange(fpreal &wmin, fpreal &wmax) const =0