23 namespace SOP_VolumeResizeEnums
42 myExtracttile =
false;
53 myUseclipplane =
false;
71 if (myGroup != src.myGroup)
return false;
72 if (myExtracttile != src.myExtracttile)
return false;
73 if (myTilecount != src.myTilecount)
return false;
74 if (myTilenum != src.myTilenum)
return false;
75 if (myCombine != src.myCombine)
return false;
76 if (mySize != src.mySize)
return false;
77 if (myT != src.myT)
return false;
78 if (myTileminpad != src.myTileminpad)
return false;
79 if (myTilemaxpad != src.myTilemaxpad)
return false;
80 if (myVoxelpad != src.myVoxelpad)
return false;
81 if (myUsepoints != src.myUsepoints)
return false;
82 if (myKeepdata != src.myKeepdata)
return false;
83 if (myUseclipplane != src.myUseclipplane)
return false;
84 if (myClipcenter != src.myClipcenter)
return false;
85 if (myClipdir != src.myClipdir)
return false;
86 if (myUsemaxres != src.myUsemaxres)
return false;
87 if (myMaxres != src.myMaxres)
return false;
88 if (myDetect2d != src.myDetect2d)
return false;
104 graph->
evalOpParm(myGroup, nodeidx,
"group", time, 0);
105 myExtracttile =
false;
107 graph->
evalOpParm(myExtracttile, nodeidx,
"extracttile", time, 0);
109 if (
true && ( (
true&&!(((getExtracttile()==0)))) ) )
110 graph->
evalOpParm(myTilecount, nodeidx,
"tilecount", time, 0);
112 if (
true && ( (
true&&!(((getExtracttile()==0)))) ) )
113 graph->
evalOpParm(myTilenum, nodeidx,
"tilenum", time, 0);
115 if (
true && ( (
true&&!(((getExtracttile()==1)))) ) )
116 graph->
evalOpParm(myCombine, nodeidx,
"combine", time, 0);
118 if (
true && ( (
true&&!((((graph->
getInput(nodeidx,1)>=0)==1))||((getExtracttile()==1)))) ) )
119 graph->
evalOpParm(mySize, nodeidx,
"size", time, 0);
121 if (
true && ( (
true&&!((((graph->
getInput(nodeidx,1)>=0)==1))||((getExtracttile()==1)))) ) )
122 graph->
evalOpParm(myT, nodeidx,
"t", time, 0);
124 if (
true && ( (
true&&!(((getExtracttile()==0)))) ) )
125 graph->
evalOpParm(myTileminpad, nodeidx,
"tileminpad", time, 0);
127 if (
true && ( (
true&&!(((getExtracttile()==0)))) ) )
128 graph->
evalOpParm(myTilemaxpad, nodeidx,
"tilemaxpad", time, 0);
131 graph->
evalOpParm(myVoxelpad, nodeidx,
"voxelpad", time, 0);
133 if (
true && ( (
true&&!((((graph->
getInput(nodeidx,1)>=0)==0))||((getExtracttile()==1)))) ) )
134 graph->
evalOpParm(myUsepoints, nodeidx,
"usepoints", time, 0);
137 graph->
evalOpParm(myKeepdata, nodeidx,
"keepdata", time, 0);
138 myUseclipplane =
false;
139 if (
true && ( (
true&&!(((getExtracttile()==1)))) ) )
140 graph->
evalOpParm(myUseclipplane, nodeidx,
"useclipplane", time, 0);
142 if (
true && ( (
true&&!(((getUseclipplane()==0))||((getExtracttile()==1)))) ) )
143 graph->
evalOpParm(myClipcenter, nodeidx,
"clipcenter", time, 0);
145 if (
true && ( (
true&&!(((getUseclipplane()==0))||((getExtracttile()==1)))) ) )
146 graph->
evalOpParm(myClipdir, nodeidx,
"clipdir", time, 0);
148 if (
true && ( (
true&&!(((getExtracttile()==1)))) ) )
149 graph->
evalOpParm(myUsemaxres, nodeidx,
"usemaxres", time, 0);
151 if (
true && ( (
true&&!(((getUsemaxres()==0))||((getExtracttile()==1)))) ) )
152 graph->
evalOpParm(myMaxres, nodeidx,
"maxres", time, 0);
155 graph->
evalOpParm(myDetect2d, nodeidx,
"detect2d", time, 0);
171 template <
typename T>
178 if (idx.
size() != instance.
size()+1)
250 { doGetParmValue(idx, instance, value); }
252 { doGetParmValue(idx, instance, value); }
254 { doGetParmValue(idx, instance, value); }
256 { doGetParmValue(idx, instance, value); }
258 { doGetParmValue(idx, instance, value); }
260 { doGetParmValue(idx, instance, value); }
262 { doGetParmValue(idx, instance, value); }
264 { doGetParmValue(idx, instance, value); }
266 { doGetParmValue(idx, instance, value); }
268 { doGetParmValue(idx, instance, value); }
270 { doGetParmValue(idx, instance, value); }
272 template <
typename T>
279 if (idx.
size() != instance.
size()+1)
342 { doSetParmValue(idx, instance, value); }
344 { doSetParmValue(idx, instance, value); }
346 { doSetParmValue(idx, instance, value); }
348 { doSetParmValue(idx, instance, value); }
350 { doSetParmValue(idx, instance, value); }
352 { doSetParmValue(idx, instance, value); }
354 { doSetParmValue(idx, instance, value); }
356 { doSetParmValue(idx, instance, value); }
358 { doSetParmValue(idx, instance, value); }
360 { doSetParmValue(idx, instance, value); }
362 { doSetParmValue(idx, instance, value); }
378 if (fieldnum.
size() < 1)
385 return "extracttile";
407 return "useclipplane";
425 if (fieldnum.
size() < 1)
426 return PARM_UNSUPPORTED;
486 {
for (
int r = 0;
r < 2;
r++)
for (
int c = 0; c < 2; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
488 {
for (
int r = 0;
r < 3;
r++)
for (
int c = 0; c < 3; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
490 {
for (
int r = 0;
r < 4;
r++)
for (
int c = 0; c < 4; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
503 loadData(is, rampdata);
521 int typelen = colon - data.
buffer();
535 {
int64 iv =
v; UTwrite(os, &iv); }
537 { UTwrite<fpreal64>(os, &
v); }
539 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
541 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
542 UTwrite<fpreal64>(os, &v.
z()); }
544 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
545 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
557 if (s) s->save(ostr);
559 saveData(os, result);
566 ostr << s->getDataTypeToken();
571 saveData(os, result);
575 void save(std::ostream &os)
const
579 saveData(os, myGroup);
580 saveData(os, myExtracttile);
581 saveData(os, myTilecount);
582 saveData(os, myTilenum);
583 saveData(os, myCombine);
584 saveData(os, mySize);
586 saveData(os, myTileminpad);
587 saveData(os, myTilemaxpad);
588 saveData(os, myVoxelpad);
589 saveData(os, myUsepoints);
590 saveData(os, myKeepdata);
591 saveData(os, myUseclipplane);
592 saveData(os, myClipcenter);
593 saveData(os, myClipdir);
594 saveData(os, myUsemaxres);
595 saveData(os, myMaxres);
596 saveData(os, myDetect2d);
609 loadData(is, myGroup);
610 loadData(is, myExtracttile);
611 loadData(is, myTilecount);
612 loadData(is, myTilenum);
613 loadData(is, myCombine);
614 loadData(is, mySize);
616 loadData(is, myTileminpad);
617 loadData(is, myTilemaxpad);
618 loadData(is, myVoxelpad);
619 loadData(is, myUsepoints);
620 loadData(is, myKeepdata);
621 loadData(is, myUseclipplane);
622 loadData(is, myClipcenter);
623 loadData(is, myClipdir);
624 loadData(is, myUsemaxres);
625 loadData(is, myMaxres);
626 loadData(is, myDetect2d);
636 if (!thissop)
return getGroup();
638 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
646 if (!thissop)
return getExtracttile();
648 OP_Utils::evalOpParm(result, thissop,
"extracttile", cookparms.
getCookTime(), 0);
656 if (!thissop)
return getTilecount();
658 OP_Utils::evalOpParm(result, thissop,
"tilecount", cookparms.
getCookTime(), 0);
666 if (!thissop)
return getTilenum();
668 OP_Utils::evalOpParm(result, thissop,
"tilenum", cookparms.
getCookTime(), 0);
676 if (!thissop)
return getCombine();
678 OP_Utils::evalOpParm(result, thissop,
"combine", cookparms.
getCookTime(), 0);
686 if (!thissop)
return getSize();
688 OP_Utils::evalOpParm(result, thissop,
"size", cookparms.
getCookTime(), 0);
696 if (!thissop)
return getT();
698 OP_Utils::evalOpParm(result, thissop,
"t", cookparms.
getCookTime(), 0);
706 if (!thissop)
return getTileminpad();
708 OP_Utils::evalOpParm(result, thissop,
"tileminpad", cookparms.
getCookTime(), 0);
716 if (!thissop)
return getTilemaxpad();
718 OP_Utils::evalOpParm(result, thissop,
"tilemaxpad", cookparms.
getCookTime(), 0);
726 if (!thissop)
return getVoxelpad();
728 OP_Utils::evalOpParm(result, thissop,
"voxelpad", cookparms.
getCookTime(), 0);
736 if (!thissop)
return getUsepoints();
738 OP_Utils::evalOpParm(result, thissop,
"usepoints", cookparms.
getCookTime(), 0);
746 if (!thissop)
return getKeepdata();
748 OP_Utils::evalOpParm(result, thissop,
"keepdata", cookparms.
getCookTime(), 0);
756 if (!thissop)
return getUseclipplane();
758 OP_Utils::evalOpParm(result, thissop,
"useclipplane", cookparms.
getCookTime(), 0);
766 if (!thissop)
return getClipcenter();
768 OP_Utils::evalOpParm(result, thissop,
"clipcenter", cookparms.
getCookTime(), 0);
776 if (!thissop)
return getClipdir();
778 OP_Utils::evalOpParm(result, thissop,
"clipdir", cookparms.
getCookTime(), 0);
786 if (!thissop)
return getUsemaxres();
788 OP_Utils::evalOpParm(result, thissop,
"usemaxres", cookparms.
getCookTime(), 0);
796 if (!thissop)
return getMaxres();
798 OP_Utils::evalOpParm(result, thissop,
"maxres", cookparms.
getCookTime(), 0);
806 if (!thissop)
return getDetect2d();
808 OP_Utils::evalOpParm(result, thissop,
"detect2d", cookparms.
getCookTime(), 0);
bool getUsemaxres() const
UT_Vector3D opVoxelpad(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
SOP_Node * getNode() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
void setUsepoints(bool val)
void setVoxelpad(UT_Vector3D val)
Combine opCombine(const SOP_NodeVerb::CookParms &cookparms) const
bool opExtracttile(const SOP_NodeVerb::CookParms &cookparms) const
int64 opTilenum(const SOP_NodeVerb::CookParms &cookparms) const
T clampMaxValue(fpreal maxvalue, const T &src) const
static void saveData(std::ostream &os, UT_Vector2D v)
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
void setExtracttile(bool val)
exint getNestNumParms(TempIndex idx) const override
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
static void loadData(UT_IStream &is, UT_Vector4D &v)
static void loadData(UT_IStream &is, UT_Vector3D &v)
static void loadData(UT_IStream &is, int64 &v)
ParmType getNestParmType(TempIndex fieldnum) const override
const OP_Context & context() const
void setMaxres(UT_Vector3I val)
constexpr SYS_FORCE_INLINE T & z() noexcept
const UT_StringHolder & getGroup() const
static void loadData(UT_IStream &is, UT_Vector3I &v)
SYS_FORCE_INLINE const char * buffer() const
bool opKeepdata(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_StringHolder &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
An output stream object that owns its own string buffer storage.
static void loadData(UT_IStream &is, bool &v)
bool operator==(const SOP_VolumeResizeParms &src) const
static void loadData(UT_IStream &is, fpreal64 &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
bool getUseclipplane() const
**But if you need a result
UT_Vector3T< int64 > UT_Vector3I
T clampMinValue(fpreal minvalue, const T &src) const
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
static void saveData(std::ostream &os, fpreal64 v)
static void loadData(UT_IStream &is, UT_Matrix4D &v)
void loadFromOpSubclass(const LoadParms &loadparms) override
virtual NodeIdx getInput(NodeIdx idx, int input, bool markused=false) const =0
constexpr SYS_FORCE_INLINE T & x() noexcept
UT_Vector3D opClipcenter(const SOP_NodeVerb::CookParms &cookparms) const
UT_Vector3I opTilemaxpad(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_StringHolder s)
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
static void saveData(std::ostream &os, UT_Vector4D v)
constexpr SYS_FORCE_INLINE T & x() noexcept
bool getUsepoints() const
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
UT_Vector3D opClipdir(const SOP_NodeVerb::CookParms &cookparms) const
void setSize(UT_Vector3D val)
bool getExtracttile() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
Combine getCombine() const
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
UT_Vector3I getTilemaxpad() 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
void setUsemaxres(bool val)
static void saveData(std::ostream &os, UT_Matrix4D v)
const OP_GraphProxy * graph() const
void setTilecount(UT_Vector3I val)
static void loadData(UT_IStream &is, UT_Matrix3D &v)
bool load(UT_IStream &is)
static void saveData(std::ostream &os, UT_Matrix2D v)
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
static void loadData(UT_IStream &is, UT_Matrix2D &v)
UT_Vector3D getSize() const
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
void setClipcenter(UT_Vector3D val)
UT_Vector3D opSize(const SOP_NodeVerb::CookParms &cookparms) const
UT_Vector3T< fpreal64 > UT_Vector3D
void setTilenum(int64 val)
void setDetect2d(bool val)
void copyFrom(const OP_NodeParms *src) override
const char * getNestParmName(TempIndex fieldnum) const override
void save(std::ostream &os) const
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
static void loadData(UT_IStream &is, UT_Vector2I &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
void saveBinary(std::ostream &os) const
Save string to binary stream.
UT_Vector3I opMaxres(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Vector3D v)
GT_API const UT_StringHolder version
UT_Vector3D getVoxelpad() const
UT_Vector3I opTilecount(const SOP_NodeVerb::CookParms &cookparms) const
bool opDetect2d(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
void setTileminpad(UT_Vector3I val)
UT_Vector3I getTilecount() const
static void saveData(std::ostream &os, PRM_DataItemHandle s)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
void coerceValue(T &result, const S &src) const
UT_Vector3D getClipdir() const
bool isParmColorRamp(exint idx) const override
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
DEP_MicroNode * depnode() const
static void loadData(UT_IStream &is, UT_Vector2D &v)
void setKeepdata(bool val)
Utility class for containing a color ramp.
static void loadData(UT_IStream &is, UT_Vector4I &v)
void setClipdir(UT_Vector3D val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
constexpr SYS_FORCE_INLINE T & w() noexcept
UT_Vector3I getMaxres() const
void setUseclipplane(bool val)
bool opUsemaxres(const SOP_NodeVerb::CookParms &cookparms) const
fpreal getCookTime() const
void setGroup(const UT_StringHolder &val)
const char * findChar(int c) const
static void saveData(std::ostream &os, UT_Matrix3D v)
bool opUseclipplane(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
bool operator!=(const SOP_VolumeResizeParms &src) const
UT_Vector3I opTileminpad(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
constexpr SYS_FORCE_INLINE T & y() noexcept
static void saveData(std::ostream &os, bool v)
UT_Vector3D opT(const SOP_NodeVerb::CookParms &cookparms) const
UT_Vector3I getTileminpad() const
UT_Vector3D getClipcenter() const
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
void setTilemaxpad(UT_Vector3I val)
constexpr SYS_FORCE_INLINE T & y() noexcept
SYS_FORCE_INLINE bool isstring() const
bool opUsepoints(const SOP_NodeVerb::CookParms &cookparms) const
OP_NodeParms & operator=(const OP_NodeParms &)=default
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
void setCombine(Combine val)
constexpr SYS_FORCE_INLINE T & x() noexcept
void setT(UT_Vector3D val)
static void saveData(std::ostream &os, int64 v)