13 #ifndef __OP_NodeParms_h__
14 #define __OP_NodeParms_h__
34 #include <initializer_list>
57 virtual int64 getMemoryUsage(
bool inclusive)
const;
82 : myCookEngine(cookengine)
103 {
if (myDepNode) myDepNode->addExplicitInput(inp, check_dup); }
105 { addExplicitInput(inp,
true); }
110 {
if (myError)
return myError->addMessage(type, code, formatError(msg), loc);
114 {
if (myError)
return myError->addWarning(type, code, formatError(msg), loc);
118 {
if (myError)
return myError->addError(type, code, formatError(msg), loc);
123 {
return addMessage(
"SOP", code, msg, loc); }
126 {
return addWarning(
"SOP", code, msg, loc); }
129 {
return addError(
"SOP", code, msg, loc); }
132 bool borrow_only =
false)
const
133 {
if (myError) myError->stealErrors(src,0, -1,
UT_ERROR_NONE, borrow_only); }
148 void loadFromOp(
const LoadParms &loadparms);
153 bool applyOptionsOverride(
const UT_Options *options);
189 { getNestParmValue( {idx}, {},
value ); }
191 { getNestParmValue( {idx}, {},
value ); }
193 { getNestParmValue( {idx}, {},
value ); }
195 { getNestParmValue( {idx}, {},
value ); }
197 { getNestParmValue( {idx}, {},
value ); }
199 { getNestParmValue( {idx}, {},
value ); }
201 { getNestParmValue( {idx}, {},
value ); }
203 { getNestParmValue( {idx}, {},
value ); }
205 { getNestParmValue( {idx}, {},
value ); }
207 { getNestParmValue( {idx}, {},
value ); }
209 { getNestParmValue( {idx}, {},
value ); }
212 { setNestParmValue( {idx}, {},
value ); }
214 { setNestParmValue( {idx}, {},
value ); }
216 { setNestParmValue( {idx}, {},
value ); }
218 { setNestParmValue( {idx}, {},
value ); }
220 { setNestParmValue( {idx}, {},
value ); }
222 { setNestParmValue( {idx}, {},
value ); }
224 { setNestParmValue( {idx}, {},
value ); }
226 { setNestParmValue( {idx}, {},
value ); }
228 { setNestParmValue( {idx}, {},
value ); }
230 { setNestParmValue( {idx}, {},
value ); }
232 { setNestParmValue( {idx}, {},
value ); }
243 myVec = &*list.begin();
246 mySize = list.size();
251 mySize = list.
size();
296 { _myBaseSignature = sig; }
299 {
return inclusive ?
sizeof(*this) : 0; }
302 virtual void loadFromOpSubclass(
const LoadParms &loadparms) = 0;
309 template <
typename T,
typename S>
312 UT_ASSERT(!
"Unimplemented OP_NodeParms::coerceValue() called!");
316 template <
typename T>
319 UT_ASSERT(!
"Unimplemented OP_NodeParms::clampMinValue() called!");
323 template <
typename T>
326 UT_ASSERT(!
"Unimplemented OP_NodeParms::clampMaxValue() called!");
404 {
return SYSmax(clamp, src); }
419 {
return SYSmax(
UT_Matrix3D(clamp, clamp, clamp, clamp, clamp, clamp, clamp, clamp, clamp), src); }
422 {
return SYSmax(
UT_Matrix4D(clamp, clamp, clamp, clamp, clamp, clamp, clamp, clamp, clamp, clamp, clamp, clamp, clamp, clamp, clamp, clamp), src); }
437 const int number_of_new_nodes_needed =
static_cast<int>(
clamp) - src->getNodeCount();
438 if (number_of_new_nodes_needed <= 0)
443 const fpreal spacing_between_new_nodes
444 = 0.5f /
static_cast<fpreal>(number_of_new_nodes_needed);
445 const auto *last_node = src->getClosestNode(1);
446 fpreal last_node_pos = last_node ? last_node->t : 0;
449 if (last_node_pos > 0.5
f)
451 fpreal scaler = 0.5f / last_node_pos;
452 for (
int i = 0,
n = src->getNodeCount(); i <
n; ++i)
454 src->moveNode(i, src->getNode(i)->t * scaler);
459 fpreal current_position = 0.5f + spacing_between_new_nodes;
460 for (
int i = 0; i < number_of_new_nodes_needed; ++i)
462 src->addNode(current_position);
463 current_position += spacing_between_new_nodes;
476 {
return SYSmin(clamp, src); }
491 {
return SYSmin(
UT_Matrix3D(clamp, clamp, clamp, clamp, clamp, clamp, clamp, clamp, clamp), src); }
494 {
return SYSmin(
UT_Matrix4D(clamp, clamp, clamp, clamp, clamp, clamp, clamp, clamp, clamp, clamp, clamp, clamp, clamp, clamp, clamp, clamp), src); }
UT_Vector2T< int64 > UT_Vector2I
virtual void setParmValue(exint idx, const UT_Vector4D &value)
virtual void setParmValue(exint idx, const UT_StringHolder &value)
TempIndex(const UT_ExintArray &list)
UT_Matrix4T< fpreal64 > UT_Matrix4D
virtual void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value)
virtual void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const
virtual void setParmValue(exint idx, const UT_Vector2D &value)
UT_ErrorManager * error() const
OP_NodeCache * cache() const
UT_ErrorSeverity sopAddWarning(int code, const char *msg=0, const UT_SourceLocation *loc=0) const
virtual void getParmValue(exint idx, UT_Matrix3D &value) const
virtual void getParmValue(exint idx, PRM_DataItemHandle &value) const
virtual void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const
UT_ErrorSeverity sopAddError(int code, const char *msg=0, const UT_SourceLocation *loc=0) const
T clampMaxValue(fpreal maxvalue, const T &src) const
virtual void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value)
virtual void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value)
virtual void setParmValue(exint idx, const exint &value)
UT_ErrorManager * myError
UT_Vector2T< fpreal64 > UT_Vector2D
GLsizei const GLfloat * value
virtual void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value)
virtual void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value)
const OP_Context & context() const
LoadParms(OP_CookEngine cookengine, const OP_GraphProxy *graph, exint nodeidx, const OP_Context &context, OP_NodeCache *cache, UT_ErrorManager *error, DEP_MicroNode *depnode)
UT_Vector4T< int64 > UT_Vector4I
**But if you need a result
exint operator[](const exint off) const
UT_Vector3T< int64 > UT_Vector3I
virtual ParmType getNestParmType(TempIndex idx) const
T clampMinValue(fpreal minvalue, const T &src) const
virtual void setParmValue(exint idx, const UT_Vector3D &value)
virtual void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const
virtual void setParmValue(exint idx, const PRM_DataItemHandle &value)
const OP_Context & myContext
UT_ErrorSeverity sopAddMessage(int code, const char *msg=0, const UT_SourceLocation *loc=0) const
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
virtual exint getNestNumParms(TempIndex idx) const
const exint * begin() const
GLint GLint GLsizei GLint GLenum GLenum type
const OP_GraphProxy * myGraph
UT_ErrorSeverity addMessage(const char *type, int code, const char *msg=0, const UT_SourceLocation *loc=0) const
Methods to add directly to any present error manager.
virtual void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value)
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
virtual ParmType getParmType(exint idx) const
const OP_GraphProxy * graph() const
virtual void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const
virtual void setParmValue(exint idx, const UT_Matrix4D &value)
virtual void baseSetSignature(const UT_StringHolder &sig)
virtual void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value)
void addExplicitInput(DEP_MicroNode &inp)
virtual void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const
virtual int64 getMemoryUsage(bool inclusive) const
virtual void getParmValue(exint idx, UT_Vector2D &value) const
virtual void setParmValue(exint idx, const UT_SharedPtr< UT_Ramp > &value)
UT_StringHolder _myBaseSignature
virtual void setParmValue(exint idx, const UT_Matrix3D &value)
UT_Vector3T< fpreal64 > UT_Vector3D
TempIndex(std::initializer_list< exint > list)
virtual void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value)
virtual void getParmValue(exint idx, UT_Matrix2D &value) const
virtual bool isParmColorRamp(exint idx) const
void addExplicitInput(DEP_MicroNode &inp, bool check_dup)
Methods to wire directly to the optional depnode.
UT_ErrorSeverity addWarning(const char *type, int code, const char *msg=0, const UT_SourceLocation *loc=0) const
UT_Matrix2T< fpreal64 > UT_Matrix2D
virtual void getParmValue(exint idx, exint &value) const
virtual void getParmValue(exint idx, UT_SharedPtr< UT_Ramp > &value) const
A map of string to various well defined value types.
virtual exint getNumParms() const
virtual void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const
virtual void copyFrom(const OP_NodeParms *src)
void coerceValue(T &result, const S &src) const
virtual const char * getParmName(exint idx) const
DEP_MicroNode * myDepNode
DEP_MicroNode * depnode() const
LeafData & operator=(const LeafData &)=delete
void stealErrors(UT_ErrorManager &src, bool borrow_only=false) const
virtual void getParmValue(exint idx, fpreal &value) const
virtual void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const
UT_ErrorSeverity addError(const char *type, int code, const char *msg=0, const UT_SourceLocation *loc=0) const
virtual void getParmValue(exint idx, UT_StringHolder &value) const
virtual UT_StringHolder baseGetSignature() const
A global error manager scope.
virtual void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const
virtual void getParmValue(exint idx, UT_Vector4D &value) const
virtual void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const
virtual void setParmValue(exint idx, const UT_Matrix2D &value)
virtual void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const
virtual void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const
virtual void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value)
virtual void setParmValue(exint idx, const fpreal &value)
virtual void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value)
UT_Vector4T< fpreal64 > UT_Vector4D
virtual const char * getNestParmName(TempIndex idx) const
UT_Matrix3T< fpreal64 > UT_Matrix3D
virtual void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value)
virtual void getParmValue(exint idx, UT_Vector3D &value) const
virtual void getParmValue(exint idx, UT_Matrix4D &value) const