#include <CoreAPI.h>
public:
ffCube() {
RadiusVariation = 30;
}
float RadiusVariation;
SERIALIZE() {
FSLIDER(RadiusVariation, "%RadiusVariation", 1, 100, 30, false);
}
float random(float variation) {
return (1.0f + variation * comms::cMath::Rand(1, 100) / 100.0f);
}
void generate() {
auto volume = current.
Volume();
volume.toSurface();
for(int i = 0; i < N; i++){
VN.Normalize();
vec3 P1 = P + VN * random(RadiusVariation);
}
}
};
EXPORT
int main() {
ffCube fg;
fg.ReadFromFile("data/Temp/ffCube.json");
fg.WriteToFile("data/Temp/ffCube.json");
fg.generate();
};
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
int childCount() const
returns the child elements count
SceneElement addChild(const char *name) const
add the child element of the same nature
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:3732
dialog & params(BaseClass *params)
The important core feature. BaseClass allows to create the custom controls in the dialog....
dialog & ok()
add Ok button
dialog & cancel()
add Cancel button
int show()
Show the dialog. This is usually the last command in the chain.
dialog & caption(const char *id)
pass the caption of the dialog
prim & details(const float det_level)
set the detail level
void add(Volume &v)
add the prim into scene
static void toRoom(const char *name, bool Force=false)
switch to the room
The coat namespace used for most 3DCoat API calls except low-level internal structures.
Definition CoreAPI.h:43
comms::cVec3 vec3
3D - float vector, see the cVec3
Definition CoreAPI.h:50