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));
40 openvdb::Vec3i
evalVec3i(
const char* name, fpreal time)
const
42 using IntT = openvdb::Vec3i::ValueType;
43 return openvdb::Vec3i(
static_cast<IntT
>(evalInt(name, 0, time)),
44 static_cast<IntT
>(evalInt(name, 1, time)),
45 static_cast<IntT
>(evalInt(name, 2, time)));
50 evalFloat(name, 1, time));
52 openvdb::Vec2i
evalVec2i(
const char* name, fpreal time)
const
54 using IntT = openvdb::Vec2i::ValueType;
55 return openvdb::Vec2i(
static_cast<IntT
>(evalInt(name, 0, time)),
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();
SOP_NodeCacheOptions subclass that adds methods specific to SOP_NodeVDB.
Definition SOP_VDBVerbUtils.h:23
std::string evalStdString(const char *name, fpreal time, int index=0) const
Definition SOP_VDBVerbUtils.h:59
~SOP_VDBCacheOptions() override
Definition SOP_VDBVerbUtils.h:26
OP_ERROR cook(OP_Context &context) override final
Definition SOP_VDBVerbUtils.h:110
const GA_PointGroup * parsePointGroups(const UT_StringRef &maskStr, const GroupCreator &maskGeo)
Definition SOP_VDBVerbUtils.h:98
openvdb::Vec3R evalVec3R(const char *name, fpreal time) const
Definition SOP_VDBVerbUtils.h:34
openvdb::Vec3f evalVec3f(const char *name, fpreal time) const
Definition SOP_VDBVerbUtils.h:28
GOP_Manager gop
Definition SOP_VDBVerbUtils.h:121
SOP_VDBCacheOptions()
Definition SOP_VDBVerbUtils.h:25
openvdb::Vec2R evalVec2R(const char *name, fpreal time) const
Definition SOP_VDBVerbUtils.h:47
const GA_PrimitiveGroup * parsePrimitiveGroups(const UT_StringRef &maskStr, const GroupCreator &maskGeo)
Definition SOP_VDBVerbUtils.h:86
openvdb::Vec2i evalVec2i(const char *name, fpreal time) const
Definition SOP_VDBVerbUtils.h:52
OP_ERROR cookMySop(OP_Context &context)
Definition SOP_VDBVerbUtils.h:118
GA_PrimitiveGroup * parsePrimitiveGroupsCopy(const UT_StringRef &maskStr, const GroupCreator &maskGeo)
Definition SOP_VDBVerbUtils.h:92
const GA_PointGroup * parsePointGroups(const UT_StringRef &maskStr, const GU_Detail *gdp)
Definition SOP_VDBVerbUtils.h:104
openvdb::Vec3i evalVec3i(const char *name, fpreal time) const
Definition SOP_VDBVerbUtils.h:40
virtual OP_ERROR cookVDBSop(OP_Context &)=0
const GA_PrimitiveGroup * matchGroup(const GU_Detail &gdp, const UT_StringRef &groupname)
Definition SOP_VDBVerbUtils.h:66
math::Vec2< Real > Vec2R
Definition Types.h:63
math::Vec3< float > Vec3f
Definition Types.h:74
math::Vec3< Real > Vec3R
Definition Types.h:72