23 namespace SOP_MirrorEnums
34 using namespace UT::Literal;
51 using namespace UT::Literal;
70 using namespace UT::Literal;
99 myKeeporiginal =
true;
100 myConsolidatepts =
true;
101 myConsolidatetol = 0.0001;
102 myConsolidateunshared =
true;
103 myCreateoutputgroup =
false;
104 myOutputgroup =
"mirror"_UTsh;
117 if (myGroup != src.myGroup)
return false;
118 if (myOperation != src.myOperation)
return false;
119 if (myDirtype != src.myDirtype)
return false;
120 if (myT != src.myT)
return false;
121 if (myR != src.myR)
return false;
122 if (myOrigin != src.myOrigin)
return false;
123 if (myDir != src.myDir)
return false;
124 if (myDist != src.myDist)
return false;
125 if (myReversenml != src.myReversenml)
return false;
126 if (myKeeporiginal != src.myKeeporiginal)
return false;
127 if (myConsolidatepts != src.myConsolidatepts)
return false;
128 if (myConsolidatetol != src.myConsolidatetol)
return false;
129 if (myConsolidateunshared != src.myConsolidateunshared)
return false;
130 if (myCreateoutputgroup != src.myCreateoutputgroup)
return false;
131 if (myOutputgroup != src.myOutputgroup)
return false;
152 graph->
evalOpParm(myGroup, nodeidx,
"group", time, graph->
isDirect()?
nullptr:depnode);
155 graph->
evalOpParm(myOperation, nodeidx,
"operation", time, graph->
isDirect()?
nullptr:depnode);
158 graph->
evalOpParm(myDirtype, nodeidx,
"dirtype", time, graph->
isDirect()?
nullptr:depnode);
160 if (
true && ( (
true&&!(((
int64(getDirtype())!=1))||((
int64(getDirtype())!=1)))) ) )
163 if (
true && ( (
true&&!(((
int64(getDirtype())!=1))||((
int64(getDirtype())!=1)))) ) )
166 if (
true && ( (
true&&!(((
int64(getDirtype())!=0))||((
int64(getDirtype())!=0)))) ) )
167 graph->
evalOpParm(myOrigin, nodeidx,
"origin", time, graph->
isDirect()?
nullptr:depnode);
169 if (
true && ( (
true&&!(((
int64(getDirtype())!=0))||((
int64(getDirtype())!=0)))) ) )
176 graph->
evalOpParm(myReversenml, nodeidx,
"reversenml", time, graph->
isDirect()?
nullptr:depnode);
177 myKeeporiginal =
true;
179 graph->
evalOpParm(myKeeporiginal, nodeidx,
"keepOriginal", time, graph->
isDirect()?
nullptr:depnode);
180 myConsolidatepts =
true;
181 if (
true && ( (
true&&!(((getKeeporiginal()==0)&&(
int64(getOperation())!=1)))) ) )
182 graph->
evalOpParm(myConsolidatepts, nodeidx,
"consolidatepts", time, graph->
isDirect()?
nullptr:depnode);
183 myConsolidatetol = 0.0001;
184 if (
true && ( (
true&&!(((getKeeporiginal()==0)&&(
int64(getOperation())!=1))||((getConsolidatepts()==0)))) ) )
185 graph->
evalOpParm(myConsolidatetol, nodeidx,
"consolidatetol", time, graph->
isDirect()?
nullptr:depnode);
186 myConsolidateunshared =
true;
187 if (
true && ( (
true&&!(((getKeeporiginal()==0))||((getConsolidatepts()==0)))) ) )
188 graph->
evalOpParm(myConsolidateunshared, nodeidx,
"consolidateunshared", time, graph->
isDirect()?
nullptr:depnode);
189 myCreateoutputgroup =
false;
191 graph->
evalOpParm(myCreateoutputgroup, nodeidx,
"createoutputgroup", time, graph->
isDirect()?
nullptr:depnode);
192 myOutputgroup =
"mirror"_UTsh;
193 if (
true && ( (
true&&!(((getCreateoutputgroup()==0)))) ) )
194 graph->
evalOpParm(myOutputgroup, nodeidx,
"outputgroup", time, graph->
isDirect()?
nullptr:depnode);
210 template <
typename T>
217 if (idx.
size() != instance.
size()+1)
222 coerceValue(value, myGroup);
225 coerceValue(value, myOperation);
228 coerceValue(value, myDirtype);
231 coerceValue(value, myT);
234 coerceValue(value, myR);
237 coerceValue(value, myOrigin);
240 coerceValue(value, myDir);
243 coerceValue(value, myDist);
246 coerceValue(value, myReversenml);
249 coerceValue(value, myKeeporiginal);
252 coerceValue(value, myConsolidatepts);
255 coerceValue(value, myConsolidatetol);
258 coerceValue(value, myConsolidateunshared);
261 coerceValue(value, myCreateoutputgroup);
264 coerceValue(value, myOutputgroup);
280 { doGetParmValue(idx, instance, value); }
282 { doGetParmValue(idx, instance, value); }
284 { doGetParmValue(idx, instance, value); }
286 { doGetParmValue(idx, instance, value); }
288 { doGetParmValue(idx, instance, value); }
290 { doGetParmValue(idx, instance, value); }
292 { doGetParmValue(idx, instance, value); }
294 { doGetParmValue(idx, instance, value); }
296 { doGetParmValue(idx, instance, value); }
298 { doGetParmValue(idx, instance, value); }
300 { doGetParmValue(idx, instance, value); }
302 template <
typename T>
309 if (idx.
size() != instance.
size()+1)
314 coerceValue(myGroup, ( ( value ) ));
317 coerceValue(myOperation, clampMinValue(0, clampMaxValue(1, value ) ));
320 coerceValue(myDirtype, clampMinValue(0, clampMaxValue(1, value ) ));
323 coerceValue(myT, ( ( value ) ));
326 coerceValue(myR, ( ( value ) ));
329 coerceValue(myOrigin, ( ( value ) ));
332 coerceValue(myDir, ( ( value ) ));
335 coerceValue(myDist, ( ( value ) ));
338 coerceValue(myReversenml, clampMinValue(0, clampMaxValue(3, value ) ));
341 coerceValue(myKeeporiginal, ( ( value ) ));
344 coerceValue(myConsolidatepts, ( ( value ) ));
347 coerceValue(myConsolidatetol, ( ( value ) ));
350 coerceValue(myConsolidateunshared, ( ( value ) ));
353 coerceValue(myCreateoutputgroup, ( ( value ) ));
356 coerceValue(myOutputgroup, ( ( value ) ));
363 { doSetParmValue(idx, instance, value); }
365 { doSetParmValue(idx, instance, value); }
367 { doSetParmValue(idx, instance, value); }
369 { doSetParmValue(idx, instance, value); }
371 { doSetParmValue(idx, instance, value); }
373 { doSetParmValue(idx, instance, value); }
375 { doSetParmValue(idx, instance, value); }
377 { doSetParmValue(idx, instance, value); }
379 { doSetParmValue(idx, instance, value); }
381 { doSetParmValue(idx, instance, value); }
383 { doSetParmValue(idx, instance, value); }
399 if (fieldnum.
size() < 1)
422 return "keepOriginal";
424 return "consolidatepts";
426 return "consolidatetol";
428 return "consolidateunshared";
430 return "createoutputgroup";
432 return "outputgroup";
440 if (fieldnum.
size() < 1)
441 return PARM_UNSUPPORTED;
476 return PARM_UNSUPPORTED;
512 loadData(is, rampdata);
530 int typelen = colon - data.
buffer();
544 {
int64 iv =
v; UTwrite(os, &iv); }
546 { UTwrite<fpreal64>(os, &
v); }
548 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
550 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
551 UTwrite<fpreal64>(os, &v.
z()); }
553 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
554 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
566 if (s) s->save(ostr);
568 saveData(os, result);
575 ostr << s->getDataTypeToken();
580 saveData(os, result);
584 void save(std::ostream &os)
const
588 saveData(os, myGroup);
589 saveData(os, myOperation);
590 saveData(os, myDirtype);
593 saveData(os, myOrigin);
595 saveData(os, myDist);
596 saveData(os, myReversenml);
597 saveData(os, myKeeporiginal);
598 saveData(os, myConsolidatepts);
599 saveData(os, myConsolidatetol);
600 saveData(os, myConsolidateunshared);
601 saveData(os, myCreateoutputgroup);
602 saveData(os, myOutputgroup);
615 loadData(is, myGroup);
616 loadData(is, myOperation);
617 loadData(is, myDirtype);
620 loadData(is, myOrigin);
622 loadData(is, myDist);
623 loadData(is, myReversenml);
624 loadData(is, myKeeporiginal);
625 loadData(is, myConsolidatepts);
626 loadData(is, myConsolidatetol);
627 loadData(is, myConsolidateunshared);
628 loadData(is, myCreateoutputgroup);
629 loadData(is, myOutputgroup);
639 if (!thissop)
return getGroup();
641 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
649 if (!thissop)
return getOperation();
651 OP_Utils::evalOpParm(result, thissop,
"operation", cookparms.
getCookTime(), 0);
659 if (!thissop)
return getDirtype();
661 OP_Utils::evalOpParm(result, thissop,
"dirtype", cookparms.
getCookTime(), 0);
669 if (!thissop)
return getT();
671 OP_Utils::evalOpParm(result, thissop,
"t", cookparms.
getCookTime(), 0);
679 if (!thissop)
return getR();
681 OP_Utils::evalOpParm(result, thissop,
"r", cookparms.
getCookTime(), 0);
689 if (!thissop)
return getOrigin();
691 OP_Utils::evalOpParm(result, thissop,
"origin", cookparms.
getCookTime(), 0);
699 if (!thissop)
return getDir();
701 OP_Utils::evalOpParm(result, thissop,
"dir", cookparms.
getCookTime(), 0);
709 if (!thissop)
return getDist();
711 OP_Utils::evalOpParm(result, thissop,
"dist", cookparms.
getCookTime(), 0);
719 if (!thissop)
return getReversenml();
721 OP_Utils::evalOpParm(result, thissop,
"reversenml", cookparms.
getCookTime(), 0);
729 if (!thissop)
return getKeeporiginal();
731 OP_Utils::evalOpParm(result, thissop,
"keepOriginal", cookparms.
getCookTime(), 0);
739 if (!thissop)
return getConsolidatepts();
741 OP_Utils::evalOpParm(result, thissop,
"consolidatepts", cookparms.
getCookTime(), 0);
749 if (!thissop)
return getConsolidatetol();
751 OP_Utils::evalOpParm(result, thissop,
"consolidatetol", cookparms.
getCookTime(), 0);
759 if (!thissop)
return getConsolidateunshared();
761 OP_Utils::evalOpParm(result, thissop,
"consolidateunshared", cookparms.
getCookTime(), 0);
769 if (!thissop)
return getCreateoutputgroup();
771 OP_Utils::evalOpParm(result, thissop,
"createoutputgroup", cookparms.
getCookTime(), 0);
779 if (!thissop)
return getOutputgroup();
781 OP_Utils::evalOpParm(result, thissop,
"outputgroup", cookparms.
getCookTime(), 0);
796 bool myConsolidatepts;
798 bool myConsolidateunshared;
799 bool myCreateoutputgroup;
void setR(UT_Vector3D val)
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
static void saveData(std::ostream &os, UT_Vector2D v)
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
static void loadData(UT_IStream &is, bool &v)
static void loadData(UT_IStream &is, UT_Vector2I &v)
void setOperation(Operation val)
SOP_Node * getNode() const
static void saveData(std::ostream &os, UT_Vector3D v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
void setReversenml(Reversenml val)
GLsizei const GLfloat * value
Dirtype opDirtype(const SOP_NodeVerb::CookParms &cookparms) const
bool load(UT_IStream &is)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
const OP_Context & context() const
static void saveData(std::ostream &os, UT_Matrix4D v)
constexpr SYS_FORCE_INLINE T & z() noexcept
bool opConsolidatepts(const SOP_NodeVerb::CookParms &cookparms) const
SYS_FORCE_INLINE const char * buffer() const
void setDist(fpreal64 val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
Operation getOperation() const
An output stream object that owns its own string buffer storage.
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
void setCreateoutputgroup(bool val)
static void loadData(UT_IStream &is, UT_StringHolder &v)
**But if you need a result
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
constexpr SYS_FORCE_INLINE T & x() noexcept
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
constexpr SYS_FORCE_INLINE T & x() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
fpreal64 opConsolidatetol(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector3D &v)
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
static void loadData(UT_IStream &is, UT_Vector3I &v)
static void loadData(UT_IStream &is, fpreal64 &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
bool isParmColorRamp(exint idx) const override
static void saveData(std::ostream &os, bool v)
UT_Vector3D opR(const SOP_NodeVerb::CookParms &cookparms) const
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
constexpr SYS_FORCE_INLINE T & z() noexcept
Operation opOperation(const SOP_NodeVerb::CookParms &cookparms) const
bool getConsolidatepts() const
void setConsolidateunshared(bool val)
void setT(UT_Vector3D val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
const OP_GraphProxy * graph() const
UT_StringHolder opOutputgroup(const SOP_NodeVerb::CookParms &cookparms) const
UT_Vector3D getOrigin() const
const UT_StringHolder & getGroup() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
bool opKeeporiginal(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, int64 v)
UT_Vector3T< fpreal64 > UT_Vector3D
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
static void loadData(UT_IStream &is, UT_Vector4I &v)
exint getNestNumParms(TempIndex idx) const override
static void loadData(UT_IStream &is, UT_Vector4D &v)
void setOutputgroup(const UT_StringHolder &val)
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
ParmType getNestParmType(TempIndex fieldnum) const override
void setConsolidatepts(bool val)
static void loadData(UT_IStream &is, UT_Matrix2D &v)
bool operator!=(const SOP_MirrorParms &src) const
void setOrigin(UT_Vector3D val)
void saveBinary(std::ostream &os) const
Save string to binary stream.
static void saveData(std::ostream &os, PRM_DataItemHandle s)
GT_API const UT_StringHolder version
static void saveData(std::ostream &os, UT_Vector4D v)
UT_Vector3D getDir() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
bool operator==(const SOP_MirrorParms &src) const
bool opConsolidateunshared(const SOP_NodeVerb::CookParms &cookparms) const
void setGroup(const UT_StringHolder &val)
UT_Vector3D opDir(const SOP_NodeVerb::CookParms &cookparms) const
const UT_StringHolder & getOutputgroup() const
static void saveData(std::ostream &os, UT_StringHolder s)
static void loadData(UT_IStream &is, UT_Matrix3D &v)
Reversenml getReversenml() const
fpreal64 opDist(const SOP_NodeVerb::CookParms &cookparms) const
const char * getNestParmName(TempIndex fieldnum) const override
DEP_MicroNode * depnode() const
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
constexpr SYS_FORCE_INLINE T & w() noexcept
void loadFromOpSubclass(const LoadParms &loadparms) override
static void saveData(std::ostream &os, UT_Matrix3D v)
UT_Vector3D opOrigin(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
virtual UT_StringHolder baseGetSignature() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
static void saveData(std::ostream &os, UT_Matrix2D v)
fpreal getCookTime() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
static void loadData(UT_IStream &is, int64 &v)
static void loadData(UT_IStream &is, UT_Matrix4D &v)
bool getCreateoutputgroup() const
const char * findChar(int c) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
void setDir(UT_Vector3D val)
Dirtype getDirtype() const
SYS_FORCE_INLINE UT_StringHolder getToken(Operation enum_value)
void setDirtype(Dirtype val)
void setConsolidatetol(fpreal64 val)
constexpr SYS_FORCE_INLINE T & y() noexcept
static void loadData(UT_IStream &is, UT_Vector2D &v)
bool getKeeporiginal() const
UT_Vector3D opT(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
Reversenml opReversenml(const SOP_NodeVerb::CookParms &cookparms) const
bool getConsolidateunshared() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
constexpr SYS_FORCE_INLINE T & y() noexcept
static void saveData(std::ostream &os, fpreal64 v)
void save(std::ostream &os) const
SYS_FORCE_INLINE bool isstring() const
fpreal64 getConsolidatetol() const
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
void setKeeporiginal(bool val)
bool opCreateoutputgroup(const SOP_NodeVerb::CookParms &cookparms) const
void copyFrom(const OP_NodeParms *src) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
constexpr SYS_FORCE_INLINE T & x() noexcept