OpenVDB: SOP_NodeVDB Class Reference

OpenVDB 10.0.1

Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
SOP_NodeVDB Class Reference

Base class from which to derive OpenVDB-related Houdini SOPs. More...

`#include <openvdb_houdini/SOP_NodeVDB.h>`

Inheritance diagram for SOP_NodeVDB:

## Public Member Functions
| SOP_NodeVDB (OP_Network *, const char *, OP_Operator *)
| ~SOP_NodeVDB () override=default
void | fillInfoTreeNodeSpecific (UT_InfoTree &, const OP_NodeInfoTreeParms &) override
void | getNodeSpecificInfoText (OP_Context &, OP_NodeInfoParms &) override
const SOP_NodeVerb * | cookVerb () const override
| Return this node's registered verb.
const GA_PrimitiveGroup * | matchGroup (GU_Detail &, const std::string &pattern)
| Retrieve a group from a geometry detail by parsing a pattern (typically, the value of a Group parameter belonging to this node).
const GA_PrimitiveGroup * | matchGroup (const GU_Detail &, const std::string &pattern)
| Retrieve a group from a geometry detail by parsing a pattern (typically, the value of a Group parameter belonging to this node).
Parameter evaluation
openvdb::Vec3f | evalVec3f (const char *name, fpreal time) const
| Evaluate a vector-valued parameter.
openvdb::Vec3R | evalVec3R (const char *name, fpreal time) const
| Evaluate a vector-valued parameter.
openvdb::Vec3i | evalVec3i (const char *name, fpreal time) const
| Evaluate a vector-valued parameter.
openvdb::Vec2R | evalVec2R (const char *name, fpreal time) const
| Evaluate a vector-valued parameter.
openvdb::Vec2i | evalVec2i (const char *name, fpreal time) const
| Evaluate a vector-valued parameter.
std::string | evalStdString (const char *name, fpreal time, int index=0) const
| Evaluate a string-valued parameter as an STL string.

## Protected Member Functions
OP_ERROR | cookMyGuide1 (OP_Context &) override
void | resolveRenamedParm (PRM_ParmList &obsoleteParms, const char *oldName, const char *newName)
| Transfer the value of an obsolete parameter that was renamed to the parameter with the new name.
OP_ERROR | cookMySop (OP_Context &) override final
| To facilitate compilable SOPs, cookMySop() is now final. Instead, either override SOP_NodeVDB::cookVDBSop() (for a non-compilable SOP) or override SOP_VDBCacheOptions::cookVDBSop() (for a compilable SOP).
virtual OP_ERROR | cookVDBSop (OP_Context &)
| To facilitate compilable SOPs, cookMySop() is now final. Instead, either override SOP_NodeVDB::cookVDBSop() (for a non-compilable SOP) or override SOP_VDBCacheOptions::cookVDBSop() (for a compilable SOP).
Input stealing
OP_ERROR | duplicateSourceStealable (const unsigned index, OP_Context &context, GU_Detail **pgdp, GU_DetailHandle &gdh, bool clean=true)
| Steal the geometry on the specified input if possible, instead of copying the data.
OP_ERROR | duplicateSourceStealable (const unsigned index, OP_Context &context)
| Steal the geometry on the specified input if possible, instead of copying the data.

## Detailed Description

Base class from which to derive OpenVDB-related Houdini SOPs.

## Constructor & Destructor Documentation

## ◆ SOP_NodeVDB()

SOP_NodeVDB | ( | OP_Network * | ,
|  | const char * | ,
|  | OP_Operator * |
| ) |  |

## ◆ ~SOP_NodeVDB()

~SOP_NodeVDB | ( |  | ) |
| overridedefault

## Member Function Documentation

## ◆ cookMyGuide1()

OP_ERROR cookMyGuide1 | ( | OP_Context & |  | ) |
| overrideprotected

## ◆ cookMySop()

OP_ERROR cookMySop | ( | OP_Context & |  | ) |
| finaloverrideprotected

To facilitate compilable SOPs, cookMySop() is now final. Instead, either override SOP_NodeVDB::cookVDBSop() (for a non-compilable SOP) or override SOP_VDBCacheOptions::cookVDBSop() (for a compilable SOP).

## ◆ cookVDBSop()

virtual OP_ERROR cookVDBSop | ( | OP_Context & |  | ) |
| inlineprotectedvirtual

To facilitate compilable SOPs, cookMySop() is now final. Instead, either override SOP_NodeVDB::cookVDBSop() (for a non-compilable SOP) or override SOP_VDBCacheOptions::cookVDBSop() (for a compilable SOP).

## ◆ cookVerb()

const SOP_NodeVerb * cookVerb | ( |  | ) | const
| override

Return this node's registered verb.

## ◆ duplicateSourceStealable() [1/2]

OP_ERROR duplicateSourceStealable | ( | const unsigned | index,
|  | OP_Context & | context
| ) |  |
| protected

Steal the geometry on the specified input if possible, instead of copying the data.

In certain cases where a node's input geometry isn't being shared with other nodes, it is safe for the node to directly modify the geometry. Normally, input geometry is shared with the upstream node's output cache, so for stealing to be possible, the "unload" flag must be set on the upstream node to inhibit caching. In addition, reference counting of GEO_PrimVDB shared pointers ensures we cannot steal data that is in use elsewhere. When stealing is not possible, this method falls back to copying the shared pointer, effectively performing a duplicateSource().

Note
  Prior to Houdini 13.0, this method peforms a duplicateSource() and unlocks the inputs to the SOP. From Houdini 13.0 on, this method will insert the existing data into the detail and update the detail handle in the SOP.

Parameters

  index | the index of the input from which to perform this operation
  context | the current SOP context is used for cook time for network traversal

Deprecated:
  verbification renders this redundant

## ◆ duplicateSourceStealable() [2/2]

OP_ERROR duplicateSourceStealable | ( | const unsigned | index,
|  | OP_Context & | context,
|  | GU_Detail ** | pgdp,
|  | GU_DetailHandle & | gdh,
|  | bool | clean = `true`
| ) |  |
| protected

Steal the geometry on the specified input if possible, instead of copying the data.

In certain cases where a node's input geometry isn't being shared with other nodes, it is safe for the node to directly modify the geometry. Normally, input geometry is shared with the upstream node's output cache, so for stealing to be possible, the "unload" flag must be set on the upstream node to inhibit caching. In addition, reference counting of GEO_PrimVDB shared pointers ensures we cannot steal data that is in use elsewhere. When stealing is not possible, this method falls back to copying the shared pointer, effectively performing a duplicateSource().

Parameters

  index | the index of the input from which to perform this operation
  context | the current SOP context is used for cook time for network traversal
  pgdp | pointer to the SOP's gdp
  gdh | handle to manage input locking
  clean | (forwarded to duplicateSource())

Note
  Prior to Houdini 13.0, this method peforms a duplicateSource() and unlocks the inputs to the SOP. From Houdini 13.0 on, this method will insert the existing data into the detail and update the detail handle in the SOP.

Warning
  No attempt to call duplicateSource() or inputGeo() should be made after calling this method, as there will be no data on the input stream if isSourceStealable() returns `true`.

Deprecated:
  verbification renders this redundant

## ◆ evalStdString()

std::string evalStdString | ( | const char * | name,
|  | fpreal | time,
|  | int | index = `0`
| ) |  | const

Evaluate a string-valued parameter as an STL string.

This method facilitates string parameter evaluation in expressions. For example,

matchGroup(*gdp, evalStdString("group", time));
openvdb_houdini::SOP_NodeVDB::evalStdString
std::string evalStdString(const char *name, fpreal time, int index=0) const
Evaluate a string-valued parameter as an STL string.
openvdb_houdini::SOP_NodeVDB::matchGroup
const GA_PrimitiveGroup * matchGroup(GU_Detail &, const std::string &pattern)
Retrieve a group from a geometry detail by parsing a pattern (typically, the value of a Group paramet...

## ◆ evalVec2i()

openvdb::Vec2i evalVec2i | ( | const char * | name,
|  | fpreal | time
| ) |  | const

Evaluate a vector-valued parameter.

## ◆ evalVec2R()

openvdb::Vec2R evalVec2R | ( | const char * | name,
|  | fpreal | time
| ) |  | const

Evaluate a vector-valued parameter.

## ◆ evalVec3f()

openvdb::Vec3f evalVec3f | ( | const char * | name,
|  | fpreal | time
| ) |  | const

Evaluate a vector-valued parameter.

## ◆ evalVec3i()

openvdb::Vec3i evalVec3i | ( | const char * | name,
|  | fpreal | time
| ) |  | const

Evaluate a vector-valued parameter.

## ◆ evalVec3R()

openvdb::Vec3R evalVec3R | ( | const char * | name,
|  | fpreal | time
| ) |  | const

Evaluate a vector-valued parameter.

## ◆ fillInfoTreeNodeSpecific()

void fillInfoTreeNodeSpecific | ( | UT_InfoTree & | ,
|  | const OP_NodeInfoTreeParms & |
| ) |  |
| override

## ◆ getNodeSpecificInfoText()

void getNodeSpecificInfoText | ( | OP_Context & | ,
|  | OP_NodeInfoParms & |
| ) |  |
| override

## ◆ matchGroup() [1/2]

const GA_PrimitiveGroup * matchGroup | ( | const GU_Detail & | ,
|  | const std::string & | pattern
| ) |  |

Retrieve a group from a geometry detail by parsing a pattern (typically, the value of a Group parameter belonging to this node).

Exceptions

  std::runtime_error | if the pattern is nonempty but doesn't match any group.

## ◆ matchGroup() [2/2]

const GA_PrimitiveGroup * matchGroup | ( | GU_Detail & | ,
|  | const std::string & | pattern
| ) |  |

Retrieve a group from a geometry detail by parsing a pattern (typically, the value of a Group parameter belonging to this node).

Exceptions

  std::runtime_error | if the pattern is nonempty but doesn't match any group.

## ◆ resolveRenamedParm()

void resolveRenamedParm | ( | PRM_ParmList & | obsoleteParms,
|  | const char * | oldName,
|  | const char * | newName
| ) |  |
| protected

Transfer the value of an obsolete parameter that was renamed to the parameter with the new name.

This convenience method is intended to be called from `resolveObsoleteParms()`, when that function is implemented.