Iterate over the sculpt tree, show the basic stats - square, volume
#include <CoreAPI.h>
public:
OneLine() {
Square = Volume = 0;
}
Square = el.
Volume().getSquare();
Volume = el.Volume().getVolume();
}
float Square;
float Volume;
SERIALIZE() {
UI_LAYOUT("3");
READONLY REG_AUTO(name, "!name");
READONLY REG_AUTO(Square, "!Square");
READONLY REG_AUTO(Volume, "!Volume");
}
};
public:
Stats() {
}
void Calculate() {
r.iterateSubtree(
return false;
});
}
SERIALIZE() {
UI_LAYOUT("3");
TEXTMSG2("*Name");
TEXTMSG2("*Square");
TEXTMSG2("*Volume");
REG_AUTO(lines);
}
};
EXPORT
int main(){
{
Stats stats;
stats.Calculate();
}
return 0;
}
Use this class for build a class for UI or serialization. see class_reg.h for details about the class...
Definition BaseClass.h:91
The array of elements derived from the BaseClass. If you create ClassArray and register if with the R...
Definition classlist.h:340
The scene element, like sculpt object or curve.
Definition CoreAPI.h:1638
const char * name() const
get the element name
bool isSculptObject() const
Check if it is the sculpt object.
static SceneElement sculptRoot()
get the root of all sculpt objects
the rich dialog. You may customize it, show your custom parameters and custom buttons.
Definition CoreAPI.h:3821
dialog & params(BaseClass *params)
The important core feature. BaseClass allows to create the custom controls in the dialog....
dialog & ok()
add Ok button
int show()
Show the dialog. This is usually the last command in the chain.
comms::cStr str
the string that is compatible with the 3DCoat engine, see the cStr
Definition CoreAPI.h:67