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;
149 graph->
evalOpParm(myGroup, nodeidx,
"group", time, 0);
152 graph->
evalOpParm(myOperation, nodeidx,
"operation", time, 0);
155 graph->
evalOpParm(myDirtype, nodeidx,
"dirtype", time, 0);
157 if (
true && ( (
true&&!(((
int64(getDirtype())!=1))||((
int64(getDirtype())!=1)))) ) )
158 graph->
evalOpParm(myT, nodeidx,
"t", time, 0);
160 if (
true && ( (
true&&!(((
int64(getDirtype())!=1))||((
int64(getDirtype())!=1)))) ) )
161 graph->
evalOpParm(myR, nodeidx,
"r", time, 0);
163 if (
true && ( (
true&&!(((
int64(getDirtype())!=0))||((
int64(getDirtype())!=0)))) ) )
164 graph->
evalOpParm(myOrigin, nodeidx,
"origin", time, 0);
166 if (
true && ( (
true&&!(((
int64(getDirtype())!=0))||((
int64(getDirtype())!=0)))) ) )
167 graph->
evalOpParm(myDir, nodeidx,
"dir", time, 0);
170 graph->
evalOpParm(myDist, nodeidx,
"dist", time, 0);
173 graph->
evalOpParm(myReversenml, nodeidx,
"reversenml", time, 0);
174 myKeeporiginal =
true;
176 graph->
evalOpParm(myKeeporiginal, nodeidx,
"keepOriginal", time, 0);
177 myConsolidatepts =
true;
178 if (
true && ( (
true&&!(((getKeeporiginal()==0)&&(
int64(getOperation())!=1)))) ) )
179 graph->
evalOpParm(myConsolidatepts, nodeidx,
"consolidatepts", time, 0);
180 myConsolidatetol = 0.0001;
181 if (
true && ( (
true&&!(((getKeeporiginal()==0)&&(
int64(getOperation())!=1))||((getConsolidatepts()==0)))) ) )
182 graph->
evalOpParm(myConsolidatetol, nodeidx,
"consolidatetol", time, 0);
183 myConsolidateunshared =
true;
184 if (
true && ( (
true&&!(((getKeeporiginal()==0))||((getConsolidatepts()==0)))) ) )
185 graph->
evalOpParm(myConsolidateunshared, nodeidx,
"consolidateunshared", time, 0);
186 myCreateoutputgroup =
false;
188 graph->
evalOpParm(myCreateoutputgroup, nodeidx,
"createoutputgroup", time, 0);
189 myOutputgroup =
"mirror"_UTsh;
190 if (
true && ( (
true&&!(((getCreateoutputgroup()==0)))) ) )
191 graph->
evalOpParm(myOutputgroup, nodeidx,
"outputgroup", time, 0);
207 template <
typename T>
214 if (idx.
size() != instance.
size()+1)
219 coerceValue(value, myGroup);
222 coerceValue(value, myOperation);
225 coerceValue(value, myDirtype);
228 coerceValue(value, myT);
231 coerceValue(value, myR);
234 coerceValue(value, myOrigin);
237 coerceValue(value, myDir);
240 coerceValue(value, myDist);
243 coerceValue(value, myReversenml);
246 coerceValue(value, myKeeporiginal);
249 coerceValue(value, myConsolidatepts);
252 coerceValue(value, myConsolidatetol);
255 coerceValue(value, myConsolidateunshared);
258 coerceValue(value, myCreateoutputgroup);
261 coerceValue(value, myOutputgroup);
277 { doGetParmValue(idx, instance, value); }
279 { doGetParmValue(idx, instance, value); }
281 { doGetParmValue(idx, instance, value); }
283 { doGetParmValue(idx, instance, value); }
285 { doGetParmValue(idx, instance, value); }
287 { doGetParmValue(idx, instance, value); }
289 { doGetParmValue(idx, instance, value); }
291 { doGetParmValue(idx, instance, value); }
293 { doGetParmValue(idx, instance, value); }
295 { doGetParmValue(idx, instance, value); }
297 { doGetParmValue(idx, instance, value); }
299 template <
typename T>
306 if (idx.
size() != instance.
size()+1)
311 coerceValue(myGroup, ( ( value ) ));
314 coerceValue(myOperation, clampMinValue(0, clampMaxValue(1, value ) ));
317 coerceValue(myDirtype, clampMinValue(0, clampMaxValue(1, value ) ));
320 coerceValue(myT, ( ( value ) ));
323 coerceValue(myR, ( ( value ) ));
326 coerceValue(myOrigin, ( ( value ) ));
329 coerceValue(myDir, ( ( value ) ));
332 coerceValue(myDist, ( ( value ) ));
335 coerceValue(myReversenml, clampMinValue(0, clampMaxValue(3, value ) ));
338 coerceValue(myKeeporiginal, ( ( value ) ));
341 coerceValue(myConsolidatepts, ( ( value ) ));
344 coerceValue(myConsolidatetol, ( ( value ) ));
347 coerceValue(myConsolidateunshared, ( ( value ) ));
350 coerceValue(myCreateoutputgroup, ( ( value ) ));
353 coerceValue(myOutputgroup, ( ( value ) ));
360 { doSetParmValue(idx, instance, value); }
362 { doSetParmValue(idx, instance, value); }
364 { doSetParmValue(idx, instance, value); }
366 { doSetParmValue(idx, instance, value); }
368 { doSetParmValue(idx, instance, value); }
370 { doSetParmValue(idx, instance, value); }
372 { doSetParmValue(idx, instance, value); }
374 { doSetParmValue(idx, instance, value); }
376 { doSetParmValue(idx, instance, value); }
378 { doSetParmValue(idx, instance, value); }
380 { doSetParmValue(idx, instance, value); }
396 if (fieldnum.
size() < 1)
419 return "keepOriginal";
421 return "consolidatepts";
423 return "consolidatetol";
425 return "consolidateunshared";
427 return "createoutputgroup";
429 return "outputgroup";
437 if (fieldnum.
size() < 1)
438 return PARM_UNSUPPORTED;
473 return PARM_UNSUPPORTED;
509 loadData(is, rampdata);
527 int typelen = colon - data.
buffer();
541 {
int64 iv =
v; UTwrite(os, &iv); }
543 { UTwrite<fpreal64>(os, &
v); }
545 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
547 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
548 UTwrite<fpreal64>(os, &v.
z()); }
550 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
551 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
563 if (s) s->save(ostr);
565 saveData(os, result);
572 ostr << s->getDataTypeToken();
577 saveData(os, result);
581 void save(std::ostream &os)
const
585 saveData(os, myGroup);
586 saveData(os, myOperation);
587 saveData(os, myDirtype);
590 saveData(os, myOrigin);
592 saveData(os, myDist);
593 saveData(os, myReversenml);
594 saveData(os, myKeeporiginal);
595 saveData(os, myConsolidatepts);
596 saveData(os, myConsolidatetol);
597 saveData(os, myConsolidateunshared);
598 saveData(os, myCreateoutputgroup);
599 saveData(os, myOutputgroup);
612 loadData(is, myGroup);
613 loadData(is, myOperation);
614 loadData(is, myDirtype);
617 loadData(is, myOrigin);
619 loadData(is, myDist);
620 loadData(is, myReversenml);
621 loadData(is, myKeeporiginal);
622 loadData(is, myConsolidatepts);
623 loadData(is, myConsolidatetol);
624 loadData(is, myConsolidateunshared);
625 loadData(is, myCreateoutputgroup);
626 loadData(is, myOutputgroup);
636 if (!thissop)
return getGroup();
638 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
646 if (!thissop)
return getOperation();
648 OP_Utils::evalOpParm(result, thissop,
"operation", cookparms.
getCookTime(), 0);
656 if (!thissop)
return getDirtype();
658 OP_Utils::evalOpParm(result, thissop,
"dirtype", cookparms.
getCookTime(), 0);
666 if (!thissop)
return getT();
668 OP_Utils::evalOpParm(result, thissop,
"t", cookparms.
getCookTime(), 0);
676 if (!thissop)
return getR();
678 OP_Utils::evalOpParm(result, thissop,
"r", cookparms.
getCookTime(), 0);
686 if (!thissop)
return getOrigin();
688 OP_Utils::evalOpParm(result, thissop,
"origin", cookparms.
getCookTime(), 0);
696 if (!thissop)
return getDir();
698 OP_Utils::evalOpParm(result, thissop,
"dir", cookparms.
getCookTime(), 0);
706 if (!thissop)
return getDist();
708 OP_Utils::evalOpParm(result, thissop,
"dist", cookparms.
getCookTime(), 0);
716 if (!thissop)
return getReversenml();
718 OP_Utils::evalOpParm(result, thissop,
"reversenml", cookparms.
getCookTime(), 0);
726 if (!thissop)
return getKeeporiginal();
728 OP_Utils::evalOpParm(result, thissop,
"keepOriginal", cookparms.
getCookTime(), 0);
736 if (!thissop)
return getConsolidatepts();
738 OP_Utils::evalOpParm(result, thissop,
"consolidatepts", cookparms.
getCookTime(), 0);
746 if (!thissop)
return getConsolidatetol();
748 OP_Utils::evalOpParm(result, thissop,
"consolidatetol", cookparms.
getCookTime(), 0);
756 if (!thissop)
return getConsolidateunshared();
758 OP_Utils::evalOpParm(result, thissop,
"consolidateunshared", cookparms.
getCookTime(), 0);
766 if (!thissop)
return getCreateoutputgroup();
768 OP_Utils::evalOpParm(result, thissop,
"createoutputgroup", cookparms.
getCookTime(), 0);
776 if (!thissop)
return getOutputgroup();
778 OP_Utils::evalOpParm(result, thissop,
"outputgroup", cookparms.
getCookTime(), 0);
793 bool myConsolidatepts;
795 bool myConsolidateunshared;
796 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)
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)
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
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
Reversenml opReversenml(const SOP_NodeVerb::CookParms &cookparms) const
bool getConsolidateunshared() const
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
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