19 #include <UT/UT_Version.h> 26 #if !defined(SESI_OPENVDB) && !defined(SESI_OPENVDB_PRIM) 28 #include <GU/GU_PrimVDB.h> 34 #else // SESI_OPENVDB || SESI_OPENVDB_PRIM 36 #ifndef __HDK_GU_PrimVDB__ 37 #define __HDK_GU_PrimVDB__ 39 #include <GA/GA_PrimitiveDefinition.h> 41 #include <GU/GU_Detail.h> 42 #include <UT/UT_Matrix4.h> 43 #include <UT/UT_VoxelArray.h> 50 class UT_MemoryCounter;
51 class GEO_ConvertParms;
52 typedef GEO_ConvertParms GU_ConvertParms;
60 ~GU_PrimVDB()
override {}
64 GU_PrimVDB(GU_Detail *gdp, GA_Offset offset=GA_INVALID_OFFSET)
65 : GEO_PrimVDB(gdp, offset)
69 int64 getMemoryUsage()
const override;
74 void countMemory(UT_MemoryCounter &counter)
const override;
78 static GA_PrimitiveTypeId theTypeId() {
return theDefinition->getId(); }
82 static void registerMyself(GA_PrimitiveFactory *factory);
85 const GA_PrimitiveDefinition &getTypeDef()
const override 87 UT_ASSERT(theDefinition);
88 return *theDefinition;
93 GEO_Primitive *convert(GU_ConvertParms &parms,
94 GA_PointGroup *usedpts = 0)
override;
95 GEO_Primitive *convertNew(GU_ConvertParms &parms)
override;
100 static void convertVolumesToVDBs(
102 const GU_Detail &src_geo,
103 GU_ConvertParms &parms,
108 bool activate_inside =
true);
114 static void convertVDBs(
116 const GU_Detail &src_geo,
117 GU_ConvertParms &parms,
120 static void convertVDBs(
122 const GU_Detail &src_geo,
123 GU_ConvertParms &parms,
126 bool split_disjoint_volumes);
135 static GU_PrimVDB * build(GU_Detail *gdp,
bool append_points =
true);
144 static SYS_FORCE_INLINE
146 const GEO_PrimVDB* src = NULL,
const char* name = NULL)
148 return GU_PrimVDB::buildFromGridAdapter(gdp, &grid, src, name);
152 static GU_PrimVDB * buildFromPrimVolume(
154 const GEO_PrimVolume &vol,
156 const bool flood_sdf =
false,
157 const bool prune =
false,
158 const float tolerance = 0.0,
159 const bool activate_inside_sdf =
true);
164 static void convertPrimVolumeToPolySoup(
166 const GEO_PrimVolume &src_vol);
168 void normal(NormalComp &output)
const override;
172 void syncAttrsFromMetadata();
179 static SYS_FORCE_INLINE
180 void createGridAttrsFromMetadata(
181 const GEO_PrimVDB& prim,
185 GU_PrimVDB::createGridAttrsFromMetadataAdapter(prim, &grid, gdp);
194 static SYS_FORCE_INLINE
195 void createAttrsFromMetadata(
196 GA_AttributeOwner owner,
201 GU_PrimVDB::createAttrsFromMetadataAdapter(owner, element, &meta_map, gdp);
208 static SYS_FORCE_INLINE
209 void createMetadataFromGridAttrs(
211 const GEO_PrimVDB& prim,
212 const GEO_Detail& gdp)
214 GU_PrimVDB::createMetadataFromGridAttrsAdapter(&grid, prim, gdp);
222 static SYS_FORCE_INLINE
223 void createMetadataFromAttrs(
225 GA_AttributeOwner owner,
227 const GEO_Detail& geo)
229 GU_PrimVDB::createMetadataFromAttrsAdapter(&meta_map, owner, element, geo);
239 void expandBorderFromPrimVolume(
240 const GEO_PrimVolume &vol,
243 GEO_Primitive * convertToNewPrim(
245 GU_ConvertParms &parms,
247 bool split_disjoint_volumes,
248 bool &success)
const;
249 GEO_Primitive * convertToPrimVolume(
251 GU_ConvertParms &parms,
252 bool split_disjoint_volumes)
const;
253 GEO_Primitive * convertToPoly(
255 GU_ConvertParms &parms,
258 bool &success)
const;
260 static GU_PrimVDB* buildFromGridAdapter(
265 static void createGridAttrsFromMetadataAdapter(
266 const GEO_PrimVDB& prim,
269 static void createMetadataFromGridAttrsAdapter(
274 static void createAttrsFromMetadataAdapter(
275 GA_AttributeOwner owner,
277 const void* meta_map_ptr,
280 static void createMetadataFromAttrsAdapter(
282 GA_AttributeOwner owner,
284 const GEO_Detail& geo);
288 static GA_PrimitiveDefinition *theDefinition;
289 friend class GU_PrimitiveFactory;
290 SYS_DEPRECATED_PUSH_DISABLE()
292 SYS_DEPRECATED_POP_DISABLE()
301 #endif // __HDK_GU_PrimVDB__ 303 #endif // SESI_OPENVDB || SESI_OPENVDB_PRIM
Abstract base class for typed grids.
Definition: Grid.h:77
SharedPtr< GridBase > Ptr
Definition: Grid.h:80
Definition: AttributeTransferUtil.h:34