9 #ifndef OPENVDB_HOUDINI_SOP_VDBVERBUTILS_HAS_BEEN_INCLUDED 10 #define OPENVDB_HOUDINI_SOP_VDBVERBUTILS_HAS_BEEN_INCLUDED 12 #include <GOP/GOP_Manager.h> 13 #include <SOP/SOP_NodeParmsOptions.h> 30 return openvdb::Vec3f(static_cast<float>(evalFloat(name, 0, time)),
31 static_cast<float>(evalFloat(name, 1, time)),
32 static_cast<float>(evalFloat(name, 2, time)));
37 evalFloat(name, 1, time),
38 evalFloat(name, 2, time));
42 using IntT = openvdb::Vec3i::ValueType;
44 static_cast<IntT>(evalInt(name, 1, time)),
45 static_cast<IntT>(evalInt(name, 2, time)));
50 evalFloat(name, 1, time));
54 using IntT = openvdb::Vec2i::ValueType;
56 static_cast<IntT>(evalInt(name, 1, time)));
59 std::string
evalStdString(
const char* name, fpreal time,
int index = 0)
const 62 evalString(str, name, index, time);
63 return str.toStdString();
66 const GA_PrimitiveGroup *
matchGroup(
const GU_Detail &gdp,
const UT_StringRef &groupname)
68 const GA_PrimitiveGroup *group = 0;
69 if (groupname.isstring())
72 group =
gop.parseOrderedPrimitiveDetached(groupname, &gdp,
false, success);
75 UT_StringHolder error;
76 error =
"Invalid group (";
79 throw std::runtime_error(error.c_str());
85 const GA_PrimitiveGroup *
88 return gop.parsePrimitiveGroups(maskStr, maskGeo);
94 return gop.parsePrimitiveGroupsCopy(maskStr, maskGeo);
100 return gop.parsePointGroups(maskStr, maskGeo);
103 const GA_PointGroup *
110 OP_ERROR
cook(OP_Context &context)
override final 113 gop.destroyAdhocGroups();
124 #endif // OPENVDB_HOUDINI_SOP_VDBVERBUTILS_HAS_BEEN_INCLUDED const GA_PrimitiveGroup * parsePrimitiveGroups(const UT_StringRef &maskStr, const GroupCreator &maskGeo)
Definition: SOP_VDBVerbUtils.h:86
GA_PrimitiveGroup * parsePrimitiveGroupsCopy(const UT_StringRef &maskStr, const GroupCreator &maskGeo)
Definition: SOP_VDBVerbUtils.h:92
Vec3< int32_t > Vec3i
Definition: Vec3.h:665
std::string evalStdString(const char *name, fpreal time, int index=0) const
Definition: SOP_VDBVerbUtils.h:59
openvdb::Vec3i evalVec3i(const char *name, fpreal time) const
Definition: SOP_VDBVerbUtils.h:40
openvdb::Vec3R evalVec3R(const char *name, fpreal time) const
Definition: SOP_VDBVerbUtils.h:34
SOP_VDBCacheOptions()
Definition: SOP_VDBVerbUtils.h:25
const GA_PointGroup * parsePointGroups(const UT_StringRef &maskStr, const GU_Detail *gdp)
Definition: SOP_VDBVerbUtils.h:104
GOP_Manager gop
Definition: SOP_VDBVerbUtils.h:121
Vec2< int32_t > Vec2i
Definition: Vec2.h:534
math::Vec2< Real > Vec2R
Definition: Types.h:63
OP_ERROR cookMySop(OP_Context &context)
Definition: SOP_VDBVerbUtils.h:118
math::Vec3< Real > Vec3R
Definition: Types.h:72
openvdb::Vec2R evalVec2R(const char *name, fpreal time) const
Definition: SOP_VDBVerbUtils.h:47
virtual OP_ERROR cookVDBSop(OP_Context &)=0
const GA_PointGroup * parsePointGroups(const UT_StringRef &maskStr, const GroupCreator &maskGeo)
Definition: SOP_VDBVerbUtils.h:98
OP_ERROR cook(OP_Context &context) override final
Definition: SOP_VDBVerbUtils.h:110
const GA_PrimitiveGroup * matchGroup(const GU_Detail &gdp, const UT_StringRef &groupname)
Definition: SOP_VDBVerbUtils.h:66
openvdb::Vec3f evalVec3f(const char *name, fpreal time) const
Definition: SOP_VDBVerbUtils.h:28
openvdb::Vec2i evalVec2i(const char *name, fpreal time) const
Definition: SOP_VDBVerbUtils.h:52
~SOP_VDBCacheOptions() override
Definition: SOP_VDBVerbUtils.h:26
SOP_NodeCacheOptions subclass that adds methods specific to SOP_NodeVDB.
Definition: SOP_VDBVerbUtils.h:22