#include <CoreAPI.h>
public:
SpiralPrim() {
Radius = 50;
ProfileRadius = 10;
Step = 40;
Turns = 8;
height = 10;
width = 10;
}
float Radius;
float ProfileRadius;
float Step;
float height;
float width;
int Turns;
SERIALIZE() {
Enumerator* E = ENUM.Get("PROFILETYPE");
if (E->GetAmount() == 0) {
E->Add("circle");
E->Add("rectangle");
}
REG_DROPLIST(ProfileType,"ProfileType","PROFILETYPE");
FSLIDER(Radius, "%Radius", 10, 100, 20, false);
FSLIDER(Step, "%Step", 5, 40, 8, false);
SLIDER(Turns, "%Turns", 1, 10);
DELIMITER;
FSLIDER(width, "%Profile Width", 5, 30, 10, false);
FSLIDER(height, "%Profile Height", 5, 30, 10, false);
} else {
FSLIDER(ProfileRadius, "%ProfileRadius", 2, 40, 20, false);
}
}
void build() {
auto volume = current.
Volume();
volume.toSurface();
}
};
EXPORT
int main() {
SpiralPrim spiralPrim;
spiralPrim.ReadFromFile("data/Temp/spiral.json");
spiralPrim.WriteToFile("data/Temp/spiral.json");
spiralPrim.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.
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
The spiral.
Definition CorePrimAPI.h:1441
spiral & turns(const int nturns)
set the number of turns.
spiral & profile_rect(const float width, const float height)
set the dimensions for the rectangle profile.
spiral & radius(const float &r)
set the outer radius of the spiral.
spiral & profile_radius(const float &r)
set the profile radius.
spiral & profile_type(const SpiralProfile type)
set the type of profile (circle or rectangle).
spiral & step(const float &vstep)
set the spiral step.
static void toRoom(const char *name, bool Force=false)
switch to the room
SpiralProfile
The profile type of the spiral.
Definition CorePrimAPI.h:1431