|
Bsoft
2.1.0
Bernard's software package
|
Library routines to read and write atomic model parameters. More...
#include "rwmodel.h"#include "rwmodel_star.h"#include "rwmodel_xml.h"#include "rwmodel_cmm.h"#include "rwmodel_bild.h"#include "rwmodel_mol.h"#include "rwmodel_vega.h"#include "model_links.h"#include "file_util.h"#include "linked_list.h"#include "Color.h"#include "utilities.h"Go to the source code of this file.
Functions | |
| Bmodel * | read_model (Bstring &filename) |
| Bmodel * | read_model (Bstring *file_list) |
| Bmodel * | read_model (Bstring &filename, Bstring ¶mfile) |
| Bmodel * | read_model (Bstring *file_list, Bstring ¶mfile) |
| Reads model parameters. More... | |
| int | write_model (Bstring &filename, Bmodel *model) |
| Writes model parameters. More... | |
| Bmodel * | model_init (Bstring &id) |
| Initializes a model structure. More... | |
| Bmodel * | model_init (const char *cid) |
| Bmodel * | model_add (Bmodel **model, Bstring &id) |
| Adds a model to a linked list. More... | |
| Bmodel * | model_add (Bmodel **model, const char *cid) |
| Bmodel * | model_add (Bmodel **model, Bmodel *model_nu) |
| Bcomptype * | component_type_add (Bcomptype **type, Bstring &id) |
| Adds a component type to a linked list. More... | |
| Bcomponent * | component_add (Bcomponent **comp, Bstring &id) |
| Adds a component to a linked list. More... | |
| Bcomponent * | component_add (Bcomponent **comp, unsigned long number) |
| Blink * | link_add (Blink **link, Bcomponent *comp1, Bcomponent *comp2, double length, double radius) |
| Adds a component link to a linked list. More... | |
| Blink * | link_add (Blink **link, Bcomponent *comp1, Bcomponent *comp2) |
| int | link_index (Bcomponent *comp, Bcomponent *comp2) |
| Returns the index of a linked component. More... | |
| int | model_set_map_filenames (Bmodel *model, Bstring &mapfile) |
| Sets all the map file names of selected models. More... | |
| Bcomptype * | model_add_type_by_id (Bmodel *model, Bstring &id) |
| Add a type to a model if the identifier does not exist already. More... | |
| Bcomptype * | model_add_type_by_filename (Bmodel *model, Bstring &filename, int num) |
| Add a type to a model if the type with the given file name does not exist already. More... | |
| Bcomptype * | model_add_type_by_id_and_filename (Bmodel *model, Bstring &id, Bstring &filename, int num) |
| Add a type to a model if the type with the given id and file name does not exist already. More... | |
| Bcomptype * | model_get_type (Bmodel *model, Bstring &id) |
| Return the type corresponding to an identifier. More... | |
| int | model_set_type (Bmodel *model, Bstring &set_type) |
| Reset the component types. More... | |
| int | model_change_type (Bmodel *model, Bstring &change_type) |
| Change a component type name. More... | |
| int | model_count_component_types (Bmodel *model) |
| Counts the number of components for each type. More... | |
| int | model_check (Bmodel *model, Bstring path) |
| Checks model properties. More... | |
| int | model_component_count (Bmodel *model) |
| Counts the total number of components. More... | |
| Bmodel * | model_list_copy (Bmodel *model) |
| Copies a model. More... | |
| Bmodel * | model_copy (Bmodel *model) |
| Copies a model. More... | |
| int | component_type_copy (Bcomptype *fromct, Bcomptype *toct) |
| Copies all elements from one component to another. More... | |
| int | component_copy (Bcomponent *fromcomp, Bcomponent *tocomp) |
| Copies all elements from one component to another. More... | |
| long | component_count (Bcomponent *comp) |
| Counts the total number of components. More... | |
| Bcomponent * | component_find (Bcomponent *comp, Bstring &id) |
| Finds a component in a component list. More... | |
| int | link_copy (Blink *fromlink, Blink *tolink) |
| Copies all elements from one link to another. More... | |
| Blink * | link_find (Blink *link, Bcomponent *comp1, Bcomponent *comp2) |
| Finds a link in a link list. More... | |
| int | component_kill (Bcomponent *comp) |
| Deallocates memory for one component. More... | |
| int | component_list_kill (Bcomponent *comp) |
| Deallocates memory for a list of components. More... | |
| int | comp_type_kill (Bcomptype *type) |
| Deallocates memory for one component type. More... | |
| int | comp_type_list_kill (Bcomptype *type) |
| Deallocates memory for a list of component types. More... | |
| int | model_link_list_kill (Bmodel *model) |
| Deallocates memory for a list of component links. More... | |
| int | link_kill (Blink **link_list, Bcomponent *comp, int i) |
| Deletes a link. More... | |
| int | link_kill (Blink **link_list, Bcomponent *comp, Bcomponent *comp2) |
| Deletes a link. More... | |
| int | poly_list_kill (Bpolygon *poly) |
| Deallocates memory for a list of polygons. More... | |
| int | comp_associated_links_kill (Bcomponent *comp, Blink **link) |
| Deallocates memory for links associated with a component. More... | |
| int | model_kill (Bmodel *model) |
| Deallocates all memory in the list. More... | |
| int | model_associate (Bmodel *model, Bstring &associate_type, Bstring &associate_file) |
| Associates a model file with a component type. More... | |
| int | model_associate_mass (Bmodel *model, Bstring &associate_type, double mass) |
| Associates a mass with a component type. More... | |
| int | model_set_comptype_filenames (Bmodel *model, Bstring &filename) |
| Sets the filenames of all selected component types to the given string. More... | |
| long | model_set_component_radius (Bmodel *model, double comprad) |
| Set the display radius for all components to a specific value. More... | |
| long | model_set_density (Bmodel *model, double density) |
| Set the density of selected components to a specific value. More... | |
| long | model_set_fom (Bmodel *model, double fom) |
| Set the FOM of selected components to a specific value. More... | |
Variables | |
| int | verbose |
| string | command |
Library routines to read and write atomic model parameters.
Definition in file rwmodel.cpp.
| int comp_associated_links_kill | ( | Bcomponent * | comp, |
| Blink ** | link | ||
| ) |
Deallocates memory for links associated with a component.
| *comp | associated componet. |
| **link | pointer to component link list. |
Definition at line 1095 of file rwmodel.cpp.
| int comp_type_kill | ( | Bcomptype * | type | ) |
Deallocates memory for one component type.
| *type | component type. |
Definition at line 915 of file rwmodel.cpp.
| int comp_type_list_kill | ( | Bcomptype * | type | ) |
Deallocates memory for a list of component types.
| *type | component type list. |
Definition at line 929 of file rwmodel.cpp.
| Bcomponent* component_add | ( | Bcomponent ** | comp, |
| Bstring & | id | ||
| ) |
Adds a component to a linked list.
The function allocates memory for a new component structure. If the content of the pointer is null, the new structure is the first in the list. Otherwise, the end of the list is found and the new structure added to it.
| **comp | component list. |
| &id | component identifier. |
Definition at line 270 of file rwmodel.cpp.
| Bcomponent* component_add | ( | Bcomponent ** | comp, |
| unsigned long | number | ||
| ) |
Definition at line 297 of file rwmodel.cpp.
| int component_copy | ( | Bcomponent * | fromcomp, |
| Bcomponent * | tocomp | ||
| ) |
Copies all elements from one component to another.
| *fromcomp | source component. |
| *tocomp | destination component. |
Definition at line 786 of file rwmodel.cpp.
| long component_count | ( | Bcomponent * | comp | ) |
Counts the total number of components.
| *comp | component list. |
Definition at line 808 of file rwmodel.cpp.
| Bcomponent* component_find | ( | Bcomponent * | comp, |
| Bstring & | id | ||
| ) |
Finds a component in a component list.
| *comp | starting component. |
| &id | component identifier. |
Definition at line 825 of file rwmodel.cpp.
| int component_kill | ( | Bcomponent * | comp | ) |
Deallocates memory for one component.
| *comp | component. |
Definition at line 880 of file rwmodel.cpp.
| int component_list_kill | ( | Bcomponent * | comp | ) |
Deallocates memory for a list of components.
| *comp | component list. |
Definition at line 894 of file rwmodel.cpp.
Adds a component type to a linked list.
| **type | component type list. |
| &id | component type identifier. |
The function allocates memory for a new component type structure. If the content of the pointer is null, the new structure is the first in the list. Otherwise, the end of the list is found and the new structure added to it.
Definition at line 233 of file rwmodel.cpp.
Copies all elements from one component to another.
| *fromct | source component. |
| *toct | destination component. |
Definition at line 766 of file rwmodel.cpp.
| Blink* link_add | ( | Blink ** | link, |
| Bcomponent * | comp1, | ||
| Bcomponent * | comp2 | ||
| ) |
Definition at line 366 of file rwmodel.cpp.
| Blink* link_add | ( | Blink ** | link, |
| Bcomponent * | comp1, | ||
| Bcomponent * | comp2, | ||
| double | length, | ||
| double | radius | ||
| ) |
Adds a component link to a linked list.
The function allocates memory for a new link structure. If the content of the pointer is null, the new structure is the first in the list. Otherwise, the end of the list is found and the new structure added to it.
| **link | component link list. |
| *comp1 | first component. |
| *comp2 | second component. |
| length | length of link. |
| radius | display radius. |
Definition at line 318 of file rwmodel.cpp.
Copies all elements from one link to another.
| *fromlink | source link. |
| *tolink | destination link. |
Definition at line 839 of file rwmodel.cpp.
| Blink* link_find | ( | Blink * | link, |
| Bcomponent * | comp1, | ||
| Bcomponent * | comp2 | ||
| ) |
Finds a link in a link list.
| *link | starting link. |
| *comp1 | one component. |
| *comp2 | other component. |
Definition at line 860 of file rwmodel.cpp.
| int link_index | ( | Bcomponent * | comp, |
| Bcomponent * | comp2 | ||
| ) |
Returns the index of a linked component.
| *comp | component with list of linked components to be searched. |
| *comp2 | component to search for. |
If the second component is not found in the list of linked components, a -1 is returned.
Definition at line 381 of file rwmodel.cpp.
| int link_kill | ( | Blink ** | link_list, |
| Bcomponent * | comp, | ||
| Bcomponent * | comp2 | ||
| ) |
Deletes a link.
The link in the model link list is removed. The associated references to the link in the component link arrays are removed and the link arrays reorganized.
| **link_list | pointer to list of links. |
| *comp | one component in the link. |
| *comp2 | second component in the link. |
Definition at line 1054 of file rwmodel.cpp.
| int link_kill | ( | Blink ** | link_list, |
| Bcomponent * | comp, | ||
| int | i | ||
| ) |
Deletes a link.
The link in the model link list is removed. The associated references to the link in the component link arrays are removed and the link arrays reorganized.
| **link_list | pointer to list of links. |
| *comp | one component in the link. |
| i | index for second component in link array of first component. |
Definition at line 991 of file rwmodel.cpp.
Definition at line 208 of file rwmodel.cpp.
Adds a model to a linked list.
| **model | model list. |
| &id | model identifier. |
The function allocates memory for a new model structure. If the content of the pointer is null, the new structure is the first in the list. Otherwise, the end of the list is found and the new structure added to it.
Definition at line 181 of file rwmodel.cpp.
Definition at line 199 of file rwmodel.cpp.
Add a type to a model if the type with the given file name does not exist already.
| *model | model parameters. |
| &filename | model file to check for and add. |
| num | model number within file. |
Definition at line 437 of file rwmodel.cpp.
Add a type to a model if the identifier does not exist already.
| *model | model parameters. |
| &id | component type identifier to check for and add. |
Definition at line 414 of file rwmodel.cpp.
| Bcomptype* model_add_type_by_id_and_filename | ( | Bmodel * | model, |
| Bstring & | id, | ||
| Bstring & | filename, | ||
| int | num | ||
| ) |
Add a type to a model if the type with the given id and file name does not exist already.
| *model | model parameters. |
| &id | component type identifier to check for and add. |
| &filename | model file to check for and add. |
| num | model number within file. |
Definition at line 468 of file rwmodel.cpp.
Associates a model file with a component type.
| *model | the model. |
| &associate_type | component type. |
| &associate_file | component file name. |
Model files can be coordinates or maps.
Definition at line 1160 of file rwmodel.cpp.
Associates a mass with a component type.
| *model | model list. |
| &associate_type | component type. |
| mass | component type mass. |
Definition at line 1190 of file rwmodel.cpp.
Change a component type name.
| *model | model. |
| &change_type | component type. |
Sets all the component types to the given string.
Definition at line 548 of file rwmodel.cpp.
Checks model properties.
| *model | model. |
| path | search path to find map files. |
Definition at line 595 of file rwmodel.cpp.
| int model_component_count | ( | Bmodel * | model | ) |
Counts the total number of components.
| *model | model parameters. |
Definition at line 638 of file rwmodel.cpp.
Copies a model.
| *model | model parameters. |
Copies only the first model in the list.
Definition at line 688 of file rwmodel.cpp.
| int model_count_component_types | ( | Bmodel * | model | ) |
Counts the number of components for each type.
| *model | model. |
Definition at line 571 of file rwmodel.cpp.
Return the type corresponding to an identifier.
| *model | model parameters. |
| &id | component identifier to check for and add. |
Definition at line 494 of file rwmodel.cpp.
Initializes a model structure.
| &id | model identifier. |
Definition at line 147 of file rwmodel.cpp.
| Bmodel* model_init | ( | const char * | cid | ) |
Definition at line 160 of file rwmodel.cpp.
| int model_kill | ( | Bmodel * | model | ) |
Deallocates all memory in the list.
| *model | model parameters. |
Definition at line 1127 of file rwmodel.cpp.
| int model_link_list_kill | ( | Bmodel * | model | ) |
Deallocates memory for a list of component links.
Only the first model in the list is processed.
| *model | model. |
Definition at line 953 of file rwmodel.cpp.
Copies a model.
Copies all the models in a list.
| *model | model parameters. |
Definition at line 660 of file rwmodel.cpp.
| long model_set_component_radius | ( | Bmodel * | model, |
| double | comprad | ||
| ) |
Set the display radius for all components to a specific value.
| *model | model parameters. |
| comprad | component display radius. |
Definition at line 1247 of file rwmodel.cpp.
Sets the filenames of all selected component types to the given string.
| *model | model parameters. |
| &filename | component file name. |
The image numbers are sequentially set as well.
Definition at line 1222 of file rwmodel.cpp.
| long model_set_density | ( | Bmodel * | model, |
| double | density | ||
| ) |
Set the density of selected components to a specific value.
| *model | model parameters. |
| density | new density value. |
Definition at line 1268 of file rwmodel.cpp.
| long model_set_fom | ( | Bmodel * | model, |
| double | fom | ||
| ) |
Set the FOM of selected components to a specific value.
| *model | model parameters. |
| fom | new FOM value. |
Definition at line 1289 of file rwmodel.cpp.
Sets all the map file names of selected models.
| *model | model parameters. |
| &mapfile | map file name. |
Definition at line 398 of file rwmodel.cpp.
Reset the component types.
| *model | model. |
| &set_type | component type. |
Sets all the component types to the given string.
Definition at line 519 of file rwmodel.cpp.
| int poly_list_kill | ( | Bpolygon * | poly | ) |
Deallocates memory for a list of polygons.
| *poly | polygon list. |
Definition at line 1073 of file rwmodel.cpp.
Definition at line 29 of file rwmodel.cpp.
Definition at line 40 of file rwmodel.cpp.
Definition at line 34 of file rwmodel.cpp.
Reads model parameters.
| *file_list | list of model parameter file names. |
| ¶mfile | parameter file. |
Definition at line 51 of file rwmodel.cpp.
Writes model parameters.
| &filename | model parameter file name. |
| *model | model parameters. |
Definition at line 92 of file rwmodel.cpp.
|
extern |
Definition at line 20 of file utilities.cpp.
|
extern |