#include <CoreAPI.h>
public:
SpheresPrim() {
BaseRadius = 100;
SubDivisions = 1;
Rings = 12;
Slices = 24;
}
float BaseRadius;
int SubDivisions;
int Rings;
int Slices;
SERIALIZE() {
Enumerator* E = ENUM.Get("DIVMODE");
if (E->GetAmount() == 0) {
E->Add("triangle");
E->Add("meridian");
E->Add("cube");
}
REG_DROPLIST(DivMode,"DivMode","DIVMODE");
FSLIDER(BaseRadius, "BaseRadius", 50, 200, 1, false);
SLIDER(Slices, "Slices", 8, 60);
SLIDER(Rings, "Rings", 6, 60);
}
SLIDER(SubDivisions, "SubDivisions", 2, 20);
}
else {
SLIDER(SubDivisions,"SubDivisions", 1, 10);
}
}
void build() {
auto volume = current.
Volume();
volume.toSurface();
}
};
EXPORT
int main() {
SpheresPrim spheres;
spheres.ReadFromFile("data/Temp/SpheresPrim.json");
spheres.WriteToFile("data/Temp/SpheresPrim.json");
spheres.build();
};
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:3811
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.
prim & translate(const vec3 &_pos)
Set the primitive translation.
void add(Volume &v)
add the prim into scene
The sphere.
Definition CorePrimAPI.h:620
sphere & sub_division(const int subdiv)
set the degree for subdivision in the mesh.
DivisionMode
division modes
Definition CorePrimAPI.h:625
@ DIV_TRIANGLE
triangle mode
Definition CorePrimAPI.h:627
@ DIV_CUBE
cube projection mode
Definition CorePrimAPI.h:631
@ DIV_MERIDIAN
meridian mode
Definition CorePrimAPI.h:629
sphere & radius(const float &r)
set the radius of the sphere.
sphere & slices(const int &_slices)
set the number of slices in the mesh.
sphere & sub_div_mode(const sphere::DivisionMode &divmode)
set the division mode for the mesh.
sphere & rings(const int &_rings)
set the number of rings in the mesh.
static void toRoom(const char *name, bool Force=false)
switch to the room
comms::cVec3 vec3
3D - float vector, see the cVec3
Definition CoreAPI.h:50