 |
Bsoft
2.1.0
Bernard's software package
|
Go to the documentation of this file.
26 "Usage: bplane [options] in.star",
27 "-------------------------------",
28 "Generates and manipulates plane models.",
30 "Actions for creation:",
31 "-plane 386,125 Generate a plane with the given length and width.",
32 "-setviews Fit a plane to the model and set the component views.",
33 "-fit Use the input model as guide to generate a plane model.",
36 "-view 0.5,-0.2,0.3,35 View to orient plane: vector=normal, angle=in-plane rotation.",
37 "-guide poly.star Input guide model to adjust the plane to.",
40 "-verbose 7 Verbosity of output.",
41 "-separation 14.5 New component separation (default 10).",
42 "-sigma 150 Smoothness of the fit (default 100).",
43 "-componentradius 0.5 Component display radius.",
44 "-linkradius 0.5 Link display radius.",
47 "-map density.map Input map file.",
50 "-output newmod.star Output model file.",
55 int main(
int argc,
char **argv)
58 double length(0), width(0);
62 double separation(10);
75 for ( curropt = option; curropt; curropt = curropt->
next ) {
76 if ( curropt->
tag ==
"plane" )
78 cerr <<
"-plane: Both length and width must be specified!" << endl;
79 if ( curropt->
tag ==
"setviews" ) setviews = 1;
80 if ( curropt->
tag ==
"fit" ) fit = 1;
81 if ( curropt->
tag ==
"view" )
82 view = curropt->
view();
83 if ( curropt->
tag ==
"separation" )
84 if ( ( separation = curropt->
value.
real() ) < 0.01 )
85 cerr <<
"-separation: The component separation must be specified!" << endl;
86 if ( curropt->
tag ==
"sigma" )
87 if ( ( sigma = curropt->
value.
real() ) < 0.01 )
88 cerr <<
"-sigma: A distance must be specified!" << endl;
89 if ( curropt->
tag ==
"componentradius" )
90 if ( ( compradius = curropt->
value.
real() ) < 1 )
91 cerr <<
"-componentradius: The component display radius must be specified!" << endl;
92 if ( curropt->
tag ==
"linkradius" )
93 if ( ( linkradius = curropt->
value.
real() ) < 1 )
94 cerr <<
"-linkradius: The link display radius must be specified!" << endl;
95 if ( curropt->
tag ==
"guide" )
97 if ( curropt->
tag ==
"map" )
99 if ( curropt->
tag ==
"output" )
111 if (
length > 0 && width > 0 ) {
114 cerr <<
"Error: The model creation failed!" << endl;
120 while ( optind < argc )
string_add(&file_list, argv[optind++]);
127 if ( guidefile.
length() ) {
145 cerr <<
"Error: The model creation from a guide failed!" << endl;
A class for a command line input option.
int string_kill(Bstring *list)
Kills a string linked list.
Bmodel * model_generate_from_plane_guide(Bmodel *guide, double separation, double sigma)
Generates a plane model and fits a plane through it.
long model_set_link_radius(Bmodel *model, double linkrad)
Set the display radius for all links to a specific value.
int bexit(int value)
Exit function for cleanup and debugging.
Vector3< double > model_fit_plane(Bmodel *model)
Fits a plane through a model.
Boption * get_option_list(const char *use[], int argc, char *argv[], int &optind)
Parses command line arguments based on a template.
Bmodel * model_create_plane(double length, double width, double z, double distance)
Creates a plane with the given length, width, height, and component separation.
Header file for option handlers.
double length(vector< T > v)
Library routines used for model link processing.
long models_process(Bmodel *model, long(modfunc)(Bmodel *))
Process a list of models using the specified function.
long values(T1 &v1, T2 &v2)
Library routines used for model creation.
Library routines used for plane models.
int model_kill(Bmodel *model)
Deallocates all memory in the list.
long model_set_views(Bmodel *model, View view)
Sets views.
Utilities for timing functions.
int main(int argc, char **argv)
double timer_start()
Starts timer and prints the time.
Header file for general utilities.
int write_model(Bstring &filename, Bmodel *model)
Writes model parameters.
double timer_report(double lasttime)
Reports the time elapsed since a given time.
Library routines used for analysing model component views.
int option_kill(Boption *option)
Deallocates a linked list of option structures.
Library routines used for model processing.
Bmodel * read_model(Bstring &filename)
long model_set_component_radius(Bmodel *model, double comprad)
Set the display radius for all components to a specific value.
Bstring * string_add(Bstring **list, const char *string)
Adds a string to a linked list.