| Bsoft 2.0.5 Bernard's software package

bmodel.cpp
Go to the documentation of this file.
1
9 #include "rwmodel.h"
10 #include "model_util.h"
11 #include "model_shell.h"
12 #include "model_transform.h"
13 #include "model_symmetry.h"
14 #include "model_select.h"
15 #include "model_views.h"
16 #include "model_links.h"
17 #include "utilities.h"
18 #include "options.h"
19 #include "timer.h"
20
21 // Declaration of global variables
22 extern int verbose; // Level of output to the screen
23
24 /* Usage assistance */
25 const char* use[] = {
26 " ",
27 "Usage: bmodel [options] in1.star [in2.star...]",
28 "----------------------------------------------",
29 "Manipulates models.",
30 " ",
31 "Actions for preparation:",
32 "-addnumber Add numbers to the model id's.",
33 "-merge Merge models in different files rather than concatenate.",
34 "-all Reset selection to all models and components before other selections.",
35 " ",
36 "Selections:",
37 "-select #232@14 Select models and components.",
38 "-number 24,36 Select models based on the number of components.",
39 "-closed order,3 Select models based on valency (valency,<n>) or polygon order (order,<n>).",
40 "-fullerene Select fullerene type models.",
41 "-fom 0.25 Select: FOM cutoff.",
42 " ",
43 "Actions:",
44 "-listmodels List model information in table form.",
45 "-listcomponents List component counts in table form.",
46 "-showmass Show model masses.",
47 "-axes Calculate principal axes.",
48 "-delete B Delete a component type.",
49 "-setfom 0.8 Set the FOM of selected components to a specific value.",
50 "-center Center before all other operations.",
51 "-average 4 Average sequential components and delete all but one in each set.",
52 "-histogram 0.2 FOM histogram with the given step size.",
53 "-id model1 Set model identifier.",
54 "-map image.pif,2 Map and image number associated with model.",
55 "-path ../map Path to map.",
56 "-views local Calculate views for components. Modes: origin: current origin,",
57 " com: center-of-mass origin, map: map origin, local: neigbor plane.",
58 "-invert Invert views for selected components.",
59 "-rdf 1.2 Calculate the radial distribution function with the given sampling (angstrom).",
60 "-curvature Calculate the curvature associated with each component.",
61 "-settype VER Set all component types.",
62 "-associate TRS,trs.pdb Associate a component type with a file name.",
63 "-mass TRS,288.7 Associate a component type with a mass.",
64 "-translate 12.3,95,-10.5 Shift along a vector (x,y,z).",
65 "-rotate 0.5,0,5.8,45 Rotate around a vector (x,y,z) by an angle.",
66 "-scale 1.5,0.8,1 Scale around the origin.",
67 "-reflect 0.4,-.22,0.5 Reflect through a mirror plane defined by the given normal.",
68 "-linklength 56.3 Generate links with this maximum length.",
69 "-setasu D8 Set components to within an asymmetric unit.",
70 "-apply C5 Apply point group symmetry.",
71 "-symmetrize C5 Symmetrize for a point group symmetry.",
72 " ",
73 "Actions for finishing:",
74 "-reset Reset selection to all components before other selections.",
75 " ",
76 "Parameters:",
77 "-verbose 7 Verbose output.",
78 "-componentradius 8.4 Set display radius for all components.",
79 "-linkradius 5.1 Set display radius for all links.",
80 "-origin 0,22.5,30 Set the origin for rotation and scaling.",
81 "-separate Each model is defined as a separate molecule group.",
82 "-reference 0,1.5,-0.2,35 Reference symmetry axis and rotation angle (default 0,0,1,0).",
83 " ",
84 "Input:",
85 "-parameters param.star Input parameter file.",
86 //"-reference file.pdb Reference coordinate file to set views.",
87 " ",
88 "Output:",
89 "-output file.star Output model parameter file.",
90 "-split 3 Split models into individual files:",
91 " Argument: 1-6: number of digits inserted before extension",
92 " Argument: \"id\": model ID's are used as file names.",
93 "-coordinates all.pdb Output coordinate files.",
94 " ",
95 NULL
96 };
97
98 int main(int argc, char **argv)
99 {
100 /* Initialize variables */
101 int num_id(0); // Flag to add numbers to model id's
102 int all(0); // Keep selection as read from file
103 int reset(0); // Keep selection as ouput
104 Bstring mod_select; // Model and component selection
105 int list_models(0); // List model information in table form
106 int list_comps(0); // List model information in table form
107 int show_mass(0); // Show model masses
108 int show_axes(0); // Calculate principal axes
109 int merge(0); // Flag to merge models rather than concatenate
110 long ncomp_min(0), ncomp_max(0); // Minimum and maximum number of components to select for
111 int closure_rule(0); // Closure rule: 1=valency, 2=order
112 int val_order(0); // Valency or order - depending on rule
113 int fullerene(0); // Flag to select fullerenes
114 Bstring comp_delete; // Component type selection for deletion
115 double setfom = -1; // Value to set FOM to
116 int center(0); // Flag to center the structure
117 long average(0); // Number of sequential components to average
118 double fom_cutoff(0); // No selection based on FOM
119 double fom_step(0); // Histogram step size
120 Bstring model_id; // Model identifier
121 Bstring map_name; // Density map reference
122 long img_num(0); // Image number in density map file
123 Bstring map_path; // Density map path
124 Bstring calc_views; // Mode to calculate component views
125 int inv_views(0); // Flag to invert views for selected components
126 double rdf_interval(0); // Calculate RDF at this sampling (0=not)
127 int curvature(0); // Flag to calculate curvature
128 Bstring associate_type; // Component type
129 Bstring associate_file; // Component type file name
130 double associate_mass(0); // Component type mass
131 Bstring set_type; // Component type to set
132 double comprad(0); // Component display radius
133 double linkrad(0); // Link display radius
134 double linklength(0); // Link length for generating links
135 Transform t; // Transformation details
136 Vector3<double> shift; // Translate
137 Vector3<double> scale; // Scale around origin
138 Vector3<double> reflect; // Mirror plane normal
139 View ref_view; // Reference view
140 Bstring asu_sym; // Set coordinates within the ASU
141 Bstring symmetry_apply_string; // Point group string
142 Bstring symmetrize_string; // Point group string
143 Bstring atom_select("all");
144 Bstring paramfile; // Input parameter file name
145 // Bstring reffile; // Reference file name
146 Bstring outfile; // Output parameter file name
147 Bstring coorfile; // Output coordinates file name
148 int split(0); // Sets output of multiple single-model files
149 Bstring astr;
150
151 int i, optind;
152 Boption* option = get_option_list(use, argc, argv, optind);
153 Boption* curropt;
154 for ( curropt = option; curropt; curropt = curropt->next ) {
155 if ( curropt->tag == "addnumber" ) num_id = 1;
156 if ( curropt->tag == "all" ) all = 1;
157 if ( curropt->tag == "merge" ) merge = 1;
158 if ( curropt->tag == "reset" ) reset = 1;
159 if ( curropt->tag == "select" )
160 mod_select = curropt->value;
161 if ( curropt->tag == "listmodels" ) list_models = 1;
162 if ( curropt->tag == "listcomponents" ) list_comps = 1;
163 if ( curropt->tag == "showmass" ) show_mass = 1;
164 if ( curropt->tag == "axes" ) show_axes = 1;
165 if ( curropt->tag == "number" )
166 if ( curropt->values(ncomp_min, ncomp_max) < 1 )
167 cerr << "-number: A number of components must be specified!" << endl;
168 if ( curropt->tag == "closed" ) {
169 if ( curropt->value[0] == 'v' ) closure_rule = 1;
170 if ( curropt->value[0] == 'o' ) closure_rule = 2;
171 if ( curropt->value.contains(",") )
172 val_order = curropt->value.post(',').integer();
173 }
174 if ( curropt->tag == "fullerene" ) fullerene = 1;
175 if ( curropt->tag == "delete" )
176 comp_delete = curropt->value;
177 if ( curropt->tag == "setfom" )
178 if ( ( setfom = curropt->value.real() ) < 0.001 )
179 cerr << "-setfom: A FOM value must be specified!" << endl;
180 if ( curropt->tag == "center" ) center = 1;
181 if ( curropt->tag == "average" )
182 if ( ( average = curropt->value.integer() ) < 1 )
183 cerr << "-average: A number of components must be specified!" << endl;
184 if ( curropt->tag == "fom" )
185 if ( ( fom_cutoff = curropt->value.real() ) < 0.001 )
186 cerr << "-fom: A FOM cutoff must be specified!" << endl;
187 if ( curropt->tag == "histogram" )
188 if ( ( fom_step = curropt->value.real() ) < 0.001 )
189 cerr << "-histogram: A FOM step size must be specified!" << endl;
190 if ( curropt->tag == "id" ) {
191 model_id = curropt->value;
192 if ( model_id.length() < 1 )
193 cerr << "-id: An identifier must be specified!" << endl;
194 }
195 if ( curropt->tag == "map" ) {
196 map_name = curropt->value;
197 img_num = (map_name.post(',')).integer();
198 map_name = map_name.pre(',');
199 if ( map_name.length() < 1 )
200 cerr << "-map: A file name must be specified!" << endl;
201 }
202 if ( curropt->tag == "path" ) map_path = curropt->value;
203 if ( curropt->tag == "views" ) calc_views = curropt->value.lower();
204 if ( curropt->tag == "invert" ) inv_views = 1;
205 if ( curropt->tag == "rdf" )
206 if ( ( rdf_interval = curropt->value.real() ) < 0.1 )
207 cerr << "-rdf: A sampling interval must be specified!" << endl;
208 if ( curropt->tag == "curvature" ) curvature = 1;
209 if ( curropt->tag == "associate" ) {
210 astr = curropt->value;
211 associate_type = astr.pre(',');
212 associate_file = astr.post(',');
213 astr = 0;
214 }
215 if ( curropt->tag == "mass" ) {
216 astr = curropt->value;
217 associate_type = astr.pre(',');
218 astr = astr.post(',');
219 associate_mass = get_option_mass(astr);
220 astr = 0;
221 }
222 if ( curropt->tag == "settype" )
223 set_type = curropt->value;
224 if ( curropt->tag == "origin" )
225 t.origin = curropt->origin();
226 if ( curropt->tag == "reference" )
227 ref_view = curropt->view();
228 if ( curropt->tag == "translate" ) {
229 shift = curropt->vector3();
230 if ( shift.length() < 0.1 )
231 cerr << "-translate: Three values must be specified!" << endl;
232 }
233 if ( curropt->tag == "rotate" ) {
234 vector<double> d = curropt->value.split_into_doubles(",");
235 if ( d.size() < 4 )
236 cerr << "-rotate: All three vector elements and an angle must be specified!" << endl;
237 else {
238 t.axis = Vector3<double>(d[0], d[1], d[2]);
239 t.angle = d[3] * M_PI/180.0;
240 }
241 }
242 if ( curropt->tag == "scale" ) {
243 scale = curropt->vector3();
244 for ( i=0; i<3 && scale[i]; i++ ) ;
245 if ( i < 1 )
246 cerr << "-scale: At least one scale value must be specified!" << endl;
247 else {
248 if ( i == 1 ) scale[2] = scale[1] = scale[0];
249 else if ( i == 2 ) scale[2] = 1;
250 }
251 }
252 if ( curropt->tag == "reflect" ) {
253 reflect = curropt->vector3();
254 if ( reflect.length() < 0 )
255 cerr << "-reflect: A mirror plane normal must be specified!" << endl;
256 }
257 if ( curropt->tag == "linklength" )
258 if ( ( linklength = curropt->value.real() ) < 1 )
259 cerr << "-linklength: A link length must be specified!" << endl;
260 if ( curropt->tag == "componentradius" )
261 if ( ( comprad = curropt->value.real() ) < 1 )
262 cerr << "-componentradius: A display radius must be specified!" << endl;
263 if ( curropt->tag == "linkradius" )
264 if ( ( linkrad = curropt->value.real() ) < 1 )
265 cerr << "-linkradius: A radius must be specified!" << endl;
266 if ( curropt->tag == "parameters" )
267 paramfile = curropt->filename();
268 if ( curropt->tag == "setasu" )
269 asu_sym = curropt->symmetry_string();
270 if ( curropt->tag == "apply" )
271 symmetry_apply_string = curropt->symmetry_string();
272 if ( curropt->tag == "symmetrize" )
273 symmetrize_string = curropt->symmetry_string();
274 if ( curropt->tag == "output" )
275 outfile = curropt->filename();
276 if ( curropt->tag == "split" ) {
277 if ( curropt->value.contains("id") || curropt->value.contains("ID") ) split = 9;
278 else if ( ( split = curropt->value.integer() ) < 1 )
279 cerr << "-split: An integer must be specified!" << endl;
280 else
281 if ( split > 6 ) split = 6;
282 }
283 if ( curropt->tag == "coordinates" )
284 coorfile = curropt->filename();
285 }
286 option_kill(option);
287
288 double ti = timer_start();
289
290 // Read all the parameter files
291 Bstring* file_list = NULL;
292 while ( optind < argc ) string_add(&file_list, argv[optind++]);
293 if ( !file_list ) {
294 cerr << "Error: No model files specified!" << endl;
295 bexit(-1);
296 }
297
298 Bmodel* model = read_model(file_list, paramfile);
299 string_kill(file_list);
300
301 if ( !model ) {
302 cerr << "Error: Input file not read!" << endl;
303 bexit(-1);
304 }
305
306 if ( num_id ) model_number_ids(model);
307
308 if ( all ) models_process(model, model_reset_selection);
309
310 if ( merge ) model_merge(model);
311
312 if ( mod_select.length() ) model_select(model, mod_select);
313
314 if ( list_models ) model_list(model);
315
316 if ( list_comps ) model_list_comp(model);
317
318 if ( model_id.length() ) model->id = model_id;
319
320 if ( map_name.length() ) {
321 model->fmap = map_name;
322 model->img_num = img_num;
323 model_check(model, map_path);
324 } else if ( map_path.length() ) {
325 model_check(model, map_path);
326 }
327
328 if ( set_type.length() ) model_set_type(model, set_type);
329
330 if ( associate_file.length() )
331 model_associate(model, associate_type, associate_file);
332
333 if ( associate_mass > 0 )
334 model_associate_mass(model, associate_type, associate_mass);
335
336 if ( ncomp_min ) model_select_number_of_components(model, ncomp_min, ncomp_max);
337
338 if ( closure_rule ) model_select_closed(model, closure_rule, val_order);
339
340 if ( fullerene ) model_select_fullerene(model);
341
342 if ( comp_delete.length() ) model_delete_comp_type(model, comp_delete);
343
344 if ( setfom >= 0 ) model_set_fom(model, setfom);
345
346 if ( linklength > 0 ) model_link_list_generate(model, linklength);
347
348 if ( comprad > 0 ) models_process(model, comprad, model_set_component_radius);
349
350 if ( linkrad > 0 ) models_process(model, linkrad, model_set_link_radius);
351
352 if ( center ) models_process(model, model_center);
353
354 if ( fom_cutoff > 0 ) model_fom_deselect(model, fom_cutoff);
355
356 if ( average > 0 ) model_average_components(model, average);
357
358 if ( shift.length() ) model_shift(model, shift);
359
360 if ( t.angle ) model_rotate(model, t);
361
362 if ( scale.volume() > 0 ) model_scale(model, scale, t.origin);
363
364 if ( reflect.length() > 0 ) model_reflect(model, reflect, t.origin);
365
366 if ( asu_sym.length() ) models_process(model, asu_sym, model_find_asymmetric_unit);
367
368 if ( symmetry_apply_string.length() > 0 )
369 model_apply_point_group(model, symmetry_apply_string, t.origin, ref_view);
370
371 if ( symmetrize_string.length() > 0 )
372 models_process(model, symmetrize_string, model_symmetrize);
373
374 if ( fom_step > 0 ) model_fom_histogram(model, fom_step);
375
376 if ( calc_views.length() ) model_calculate_views(model, calc_views);
377
378 if ( rdf_interval > 0 ) model_radial_distribution(model, rdf_interval);
379
380 if ( inv_views ) model_invert_views(model);
381
382 if ( curvature ) model_curvature(model);
383
384 if ( show_mass ) model_mass_all(model);
385
386 if ( show_axes ) model_principal_axes(model);
387
388 if ( reset ) models_process(model, model_reset_selection);
389
390 model_selection_stats(model);
391
392 // Write an output parameter format file if a name is given
393 if ( model && ( outfile.length() || split == 9 ) ) {
394 model->split = split;
395 model_update_comment(model, argc, argv);
396 write_model(outfile, model);
397 }
398
399 model_kill(model);
400
401 if ( verbose & VERB_TIME )
402 timer_report(ti);
403
404 bexit(0);
405 }
406
Bmodel::img_num
int img_num
Definition: rwmodel.h:127
Bstring::real
double real()
Definition: Bstring.cpp:545
model_set_component_radius
long model_set_component_radius(Bmodel *model, double comprad)
Set the display radius for all components to a specific value.
Definition: rwmodel.cpp:1264
string_add
Bstring * string_add(Bstring **list, const char *string)
Adds a string to a linked list.
Definition: Bstring.cpp:705
Bstring::post
Bstring post(char c)
Definition: Bstring.cpp:394
Bmodel::id
Bstring id
Definition: rwmodel.h:121
model_views.h
Library routines used for analysing model component views.
Vector3::length
double length()
Definition: Vector3.h:222
Boption::symmetry_string
Bstring symmetry_string()
Definition: options.h:245
model_fom_histogram
long model_fom_histogram(Bmodel *model, double fom_step)
Selects components based on the FOM.
Definition: model_select.cpp:1254
model_number_ids
long model_number_ids(Bmodel *model)
Add a number to each model id.
Definition: model_util.cpp:356
model_select_fullerene
long model_select_fullerene(Bmodel *model)
Selects fullerene type models.
Definition: model_select.cpp:448
utilities.h
Header file for general utilities.
model_select
long model_select(Bmodel *model, Bstring &comptype)
Selects models, components and component types.
Definition: model_select.cpp:36
model_util.h
Library routines used for model processing.
Boption::value
Bstring value
Definition: options.h:30
model_shell.h
Library routines used for shell model processing.
Boption::tag
Bstring tag
Definition: options.h:29
Transform::angle
double angle
Definition: Transform.h:29
Bmodel::split
int split
Definition: rwmodel.h:130
Bstring::length
long length() const
Definition: Bstring.cpp:263
model_symmetry.h
Library routines used for model symmetry operations.
main
int main(int argc, char **argv)
Definition: bmodel.cpp:98
model_curvature
int model_curvature(Bmodel *model)
Calculates the curvature associated with each link.
Definition: model_shell.cpp:279
model_links.h
Library routines used for model link processing.
get_option_list
Boption * get_option_list(const char *use[], int argc, char *argv[], int &optind)
Parses command line arguments based on a template.
Definition: options.cpp:40
Boption::filename
Bstring filename()
Definition: options.h:85
model_radial_distribution
long model_radial_distribution(Bmodel *model, double interval)
Calculates the radial distribution function of a model.
Definition: model_util.cpp:605
timer.h
Utilities for timing functions.
model_reflect
long model_reflect(Bmodel *model, Vector3< double > normal, Vector3< double > origin)
Reflects the model through a mirror plane.
Definition: model_transform.cpp:143
model_average_components
long model_average_components(Bmodel *model, int number)
Averages sequential components.
Definition: model_util.cpp:866
Bstring::contains
bool contains(const Bstring &s)
Definition: Bstring.cpp:584
Transform
Definition: Transform.h:24
M_PI
#define M_PI
Definition: utilities.h:59
model_set_fom
long model_set_fom(Bmodel *model, double fom)
Set the FOM of selected components to a specific value.
Definition: rwmodel.cpp:1306
model_kill
int model_kill(Bmodel *model)
Deallocates all memory in the list.
Definition: rwmodel.cpp:1124
use
const char * use[]
Definition: bmodel.cpp:25
model_set_link_radius
long model_set_link_radius(Bmodel *model, double linkrad)
Set the display radius for all links to a specific value.
Definition: model_links.cpp:139
Boption::view
View view()
Definition: options.h:259
model_shift
long model_shift(Bmodel *model, Vector3< double > shift)
Shifts a model.
Definition: model_transform.cpp:43
model_list_comp
long model_list_comp(Bmodel *model)
Lists models with component counts in table form.
Definition: model_util.cpp:158
Boption
A class for a command line input option.
Definition: options.h:26
model_select_closed
long model_select_closed(Bmodel *model, int closure_rule, int val_order)
Determines if a polyhedron is closed given a rule.
Definition: model_select.cpp:397
Bstring::pre
Bstring pre(char c)
Definition: Bstring.cpp:381
VERB_TIME
#define VERB_TIME
Definition: utilities.h:110
model_update_comment
int model_update_comment(Bmodel *model, int n, char **strings)
Puts a set of strings and time in the comment of a model.
Definition: rwmodel.cpp:1158
merge
int merge(Bimage *p, int padd)
Pads an image and shifts it to the middle.
Definition: sin_gal.cpp:270
model_fom_deselect
long model_fom_deselect(Bmodel *model, double fom_cutoff)
Deselects components based on the FOM.
Definition: model_select.cpp:1154
model_symmetrize
long model_symmetrize(Bmodel *model, Bstring &symmetry_string)
Symmetrize a model.
Definition: model_symmetry.cpp:282
Bstring::split_into_doubles
vector< double > split_into_doubles(const Bstring &delim)
Definition: Bstring.cpp:665
model_rotate
long model_rotate(Bmodel *model, Matrix3 mat)
Rotates the model.
Definition: model_transform.cpp:238
model_find_asymmetric_unit
long model_find_asymmetric_unit(Bmodel *model, Bstring &symmetry_string)
Set model component locations within the asymmetric unit.
Definition: model_symmetry.cpp:34
model_selection_stats
long model_selection_stats(Bmodel *model)
Calculates selection statistics.
Definition: model_select.cpp:870
model
Bmodel * model
Definition: bshow.cpp:32
read_model
Bmodel * read_model(Bstring &filename)
Definition: rwmodel.cpp:28
Transform::origin
Vector3< double > origin
Definition: Transform.h:27
write_model
int write_model(Bstring &filename, Bmodel *model)
Writes model parameters.
Definition: rwmodel.cpp:91
Boption::next
Boption * next
Definition: options.h:28
model_apply_point_group
long model_apply_point_group(Bmodel *model, Bstring &symmetry_string, Vector3< double > origin, View ref_view, int flags=0)
Applying symmetry to model components.
Definition: model_symmetry.cpp:71
Bstring
Definition: Bstring.h:29
model_reset_selection
long model_reset_selection(Bmodel *model)
Resets the selection to all components.
Definition: model_select.cpp:232
model_invert_views
long model_invert_views(Bmodel *model)
Invert views.
Definition: model_views.cpp:109
Bmodel::fmap
Bstring fmap
Definition: rwmodel.h:125
model_principal_axes
Vector3< double > model_principal_axes(Bmodel *model, Vector3< double > *eigenvec)
Calculates the principal axes of a model.
Definition: model_util.cpp:534
Boption::vector3
Vector3< double > vector3()
Definition: options.h:148
rwmodel.h
Header file for reading and writing atomic model files.
model_link_list_generate
long model_link_list_generate(Bmodel *model, double maxlength)
Generates a link list for a model based on vertex separation.
Definition: model_links.cpp:70
Vector3< double >
Boption::origin
Vector3< double > origin()
Definition: options.h:180
timer_report
double timer_report(double lasttime)
Reports the time elapsed since a given time.
Definition: timer.cpp:67
Bstring::lower
Bstring lower()
Definition: Bstring.cpp:308
View
Definition: View.h:26
model_center
long model_center(Bmodel *model)
Shifts one models to its center of mass.
Definition: model_transform.cpp:27
model_mass_all
long model_mass_all(Bmodel *model)
Calculates the masses of all the models in the list.
Definition: model_util.cpp:445
model_scale
long model_scale(Bmodel *model, Vector3< double > scale, Vector3< double > origin)
Scales a model.
Definition: model_transform.cpp:87
option_kill
int option_kill(Boption *option)
Deallocates a linked list of option structures.
Definition: options.cpp:109
Bstring::integer
long integer()
Definition: Bstring.cpp:539
Bmodel
Definition: rwmodel.h:119
model_associate
int model_associate(Bmodel *model, Bstring &associate_type, Bstring &associate_file)
Associates a model file with a component type.
Definition: rwmodel.cpp:1177
Transform::axis
Vector3< double > axis
Definition: Transform.h:28
options.h
Header file for option handlers.
model_merge
long model_merge(Bmodel *model)
Merges components from all models into one.
Definition: model_util.cpp:299
model_set_type
int model_set_type(Bmodel *model, Bstring &set_type)
Reset the component types.
Definition: rwmodel.cpp:516
models_process
long models_process(Bmodel *model, long(modfunc)(Bmodel *))
Process a list of models using the specified function.
Definition: model_util.cpp:36
model_calculate_views
long model_calculate_views(Bmodel *model, Bstring &mode)
Calculates the views associated with each component.
Definition: model_views.cpp:263
split
vector< string > split(const string &s)
Splits a string on whitespace.
Definition: string_util.cpp:92
Vector3::volume
double volume()
Definition: Vector3.h:235
model_select.h
Header file for reading and writing atomic model files.
model_select_number_of_components
long model_select_number_of_components(Bmodel *model, int ncomp_min, int ncomp_max)
Selects models within a range of the number of components.
Definition: model_select.cpp:359
model_list
long model_list(Bmodel *model)
Lists models in table form.
Definition: model_util.cpp:127
verbose
int verbose
model_transform.h
Library routines used for model transformation.
Boption::values
long values(T1 &v1, T2 &v2)
Definition: options.h:115
model_delete_comp_type
long model_delete_comp_type(Bmodel *model, Bstring &comptype)
Deletes components based on their types.
Definition: model_select.cpp:720
bexit
int bexit(int value)
Exit function for cleanup and debugging.
Definition: utilities.cpp:273
timer_start
double timer_start()
Starts timer and prints the time.
Definition: timer.cpp:52
get_option_mass
double get_option_mass(Bstring &optarg)
Returns the adjusted mass based on the added character.
Definition: options.cpp:175
string_kill
int string_kill(Bstring *list)
Kills a string linked list.
Definition: Bstring.cpp:760
model_check
int model_check(Bmodel *model, Bstring path)
Checks model properties.
Definition: rwmodel.cpp:592
model_associate_mass
int model_associate_mass(Bmodel *model, Bstring &associate_type, double mass)
Associates a mass with a component type.
Definition: rwmodel.cpp:1207