Bsoft 2.1.4
Bernard's software package
model_links.h File Reference

Library routines used for model link processing. More...

#include "rwmodel.h"
#include "Bstring.h"

Functions

long model_setup_links (Bmodel *model)
 Set up the link list for each component. More...
 
long model_link_list_generate (Bmodel *model, double maxlength)
 Generates a link list for a model based on vertex separation. More...
 
long model_link_list_generate (Bmodel *model, double maxlength, Bstring &type1, Bstring &type2, int flag)
 Generates a link list for a model based on vertex separation between defined componet types. More...
 
long model_set_link_length (Bmodel *model, double linklength)
 Sets the reference link lengths. More...
 
long model_set_link_radius (Bmodel *model, double linkrad)
 Set the display radius for all links to a specific value. More...
 
long model_reduce_linked (Bmodel *model, Bstring &submodname, int flags)
 Reduces a model to one component per linked set of components. More...
 
long model_links_minimum_valency (Bmodel *model, long valency)
 Generates links such that each component has at least the given valency. More...
 

Detailed Description

Library routines used for model link processing.

Author
Bernard Heymann
Date
Created: 20060908
Modified: 20210830

Function Documentation

◆ model_link_list_generate() [1/2]

long model_link_list_generate ( Bmodel model,
double  maxlength 
)

Generates a link list for a model based on vertex separation.

Parameters
*modelmodel parameters.
maxlengthmaximum link length.
Returns
long number of links.
Only the first model is processed.

◆ model_link_list_generate() [2/2]

long model_link_list_generate ( Bmodel model,
double  maxlength,
Bstring type1,
Bstring type2,
int  flag 
)

Generates a link list for a model based on vertex separation between defined componet types.

Parameters
*modelmodel parameters.
maxlengthmaximum link length.
type1first component type.
type2second component type.
flag1=closest components.
Returns
long number of links.
Only the first model is processed.
A link is generated for the minimum distance if that is below the maximum length.
If the flag is set, a link is generated only for the closest second component to the first.

◆ model_links_minimum_valency()

long model_links_minimum_valency ( Bmodel model,
long  valency 
)

Generates links such that each component has at least the given valency.

Parameters
*modelmodel structure.
valencythe desired valency.
Returns
long number of links.
A distance matrix is calculated and a cutoff determined that ensures
that each column has at least the given valency number below it.
The links are then created based on the cutoff.
Only the first model in the linked list is used.

◆ model_reduce_linked()

long model_reduce_linked ( Bmodel model,
Bstring submodname,
int  flags 
)

Reduces a model to one component per linked set of components.

Parameters
*modelmodel structure to be modified.
&submodnamesub-model file name.
flags1=generate averaged types.
Returns
long number of new components.
A new reduced set of components is generated.
Each old set of linked components is saved as a sub-model and referenced as a type.
Optionally, the old sets of components are averaged and the 
averaged model saved as a type.

◆ model_set_link_length()

long model_set_link_length ( Bmodel model,
double  linklength 
)

Sets the reference link lengths.

Parameters
*modelmodel parameters.
linklengthreference link length.
Returns
long number of links.
Only the first model is processed.

◆ model_set_link_radius()

long model_set_link_radius ( Bmodel model,
double  linkrad 
)

Set the display radius for all links to a specific value.

Parameters
*modelmodel parameters.
linkradlink display radius.
Returns
long number of components selected.
Only the first model is processed.

◆ model_setup_links()

long model_setup_links ( Bmodel model)

Set up the link list for each component.

Parameters
*modelmodel parameters.
Returns
long total number of links.
Only the first model is processed.