 |
Bsoft
2.1.0
Bernard's software package
|
Go to the documentation of this file.
24 "Usage: bmodcol [options] in.star",
25 "--------------------------------",
26 "Colors models based on selection.",
28 "Actions for preparation:",
29 "-all Reset selection to all components before other selections.",
32 "-select #232@14 Select models and components.",
33 "-valence 3 Select components with the indicated valence.",
34 "-polygons 6 Select polygonal components with the indicated order.",
37 "-color 0.1,0.5,0.2,1 Color selected components and links.",
38 "-spectrum Color a model from red to blue by component order.",
39 "-density Color a model from red to blue by component density.",
40 "-fom Color a model from red to blue by component FOM.",
41 "-curvature Color a model from red to blue by curvature.",
42 "-chiral Color chiral vertices red (-) and blue (+).",
44 "Actions for finishing:",
45 "-reset Reset selection to all components before other selections.",
48 "-verbose 7 Verbosity of output.",
49 "-componentradius 0.5 Component display radius.",
50 "-linkradius 0.5 Link display radius.",
53 "-parameters param.star Input parameter file.",
56 "-output color.star Color model file.",
61 int main(
int argc,
char **argv)
83 for ( curropt = option; curropt; curropt = curropt->
next ) {
84 if ( curropt->
tag ==
"all" ) all = 1;
85 if ( curropt->
tag ==
"reset" ) reset = 1;
86 if ( curropt->
tag ==
"select" )
87 mod_select = curropt->
value;
88 if ( curropt->
tag ==
"valence" )
90 cerr <<
"-valence: A valency must be specified!" << endl;
91 if ( curropt->
tag ==
"polygons" )
93 cerr <<
"-polygons: A polygon order must be specified!" << endl;
94 if ( curropt->
tag ==
"color" )
95 if ( curropt->
values(color[0], color[1], color[2], color[3]) < 3 )
96 cerr <<
"-color: At least three color values must be specified!" << endl;
97 if ( curropt->
tag ==
"spectrum" ) spectrum = 1;
98 if ( curropt->
tag ==
"density" ) density = 1;
99 if ( curropt->
tag ==
"fom" ) fom = 1;
100 if ( curropt->
tag ==
"curvature" ) curvature = 1;
101 if ( curropt->
tag ==
"chiral" ) chiral = 1;
102 if ( curropt->
tag ==
"componentradius" )
103 if ( ( compradius = curropt->
value.
real() ) < 1 )
104 cerr <<
"-componentradius: The component display radius must be specified!" << endl;
105 if ( curropt->
tag ==
"linkradius" )
106 if ( ( linkradius = curropt->
value.
real() ) < 1 )
107 cerr <<
"-linkradius: The link display radius must be specified!" << endl;
108 if ( curropt->
tag ==
"parameters" )
110 if ( curropt->
tag ==
"output" )
119 while ( optind < argc )
string_add(&file_list, argv[optind++]);
121 cerr <<
"Error: No model files specified!" << endl;
129 cerr <<
"Error: Input file not read!" << endl;
146 else if ( color[0] >= 0 && color[1] >= 0 && color[2] >= 0 )
A class for a command line input option.
long model_select_valence(Bmodel *model, int valence)
Selects fullerene type models.
int string_kill(Bstring *list)
Kills a string linked list.
Header file for reading and writing atomic model files.
int main(int argc, char **argv)
int model_color_selected(Bmodel *model, RGBA< float > color)
Colors selected model components.
int model_color_by_order(Bmodel *model)
Colors model components in order from red to blue.
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.
Boption * get_option_list(const char *use[], int argc, char *argv[], int &optind)
Parses command line arguments based on a template.
Header file for option handlers.
int model_color_by_density(Bmodel *model)
Colors model components by density.
Library routines used for model link processing.
long models_process(Bmodel *model, long(modfunc)(Bmodel *))
Process a list of models using the specified function.
int model_color_by_fom(Bmodel *model)
Colors model components by fom.
int model_color_curvature(Bmodel *model)
Colors model vertices and links as a function of curvature.
long values(T1 &v1, T2 &v2)
int model_kill(Bmodel *model)
Deallocates all memory in the list.
Header file for reading and writing atomic model files.
Utilities for timing functions.
long model_reset_selection(Bmodel *model)
Resets the selection to all components.
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.
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.
Functions to color models.
Bstring * string_add(Bstring **list, const char *string)
Adds a string to a linked list.
long model_select_polygons(Bmodel *model, int order)
Selects model polygons with a given order.
long model_select(Bmodel *model, Bstring &comptype)
Selects models, components and component types.
int model_color_chiral_vertices(Bmodel *model)
Colors model vertices as a function of chirality.