Bsoft  2.1.0
Bernard's software package
model_links.cpp File Reference

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

#include "model_links.h"
#include "model_transform.h"
#include "model_compare.h"
#include "model_util.h"
#include "matrix_util.h"
#include "linked_list.h"
#include "utilities.h"

Go to the source code of this file.

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_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...
 
Bcomponent * model_linked_submodel (Bcomponent *comp, Bmodel *model, int *n, Vector3< float > *avg_loc)
 
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...
 

Variables

int verbose
 

Detailed Description

Library routines used for model links processing.

Author
Bernard Heymann
Date
Created: 20060908
Modified: 20141029

Definition in file model_links.cpp.

Function Documentation

◆ model_link_list_generate()

long model_link_list_generate ( Bmodel *  model,
double  maxlength 
)

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

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

Definition at line 70 of file model_links.cpp.

◆ model_linked_submodel()

Bcomponent* model_linked_submodel ( Bcomponent *  comp,
Bmodel *  model,
int *  n,
Vector3< float > *  avg_loc 
)

Definition at line 154 of file model_links.cpp.

◆ 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.

Definition at line 294 of file model_links.cpp.

◆ 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.

Definition at line 194 of file model_links.cpp.

◆ model_set_link_length()

long model_set_link_length ( Bmodel *  model,
double  linklength 
)

Sets the reference link lengths.

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

Definition at line 112 of file model_links.cpp.

◆ model_set_link_radius()

long model_set_link_radius ( Bmodel *  model,
double  linkrad 
)

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

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

Definition at line 139 of file model_links.cpp.

◆ 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.

Definition at line 28 of file model_links.cpp.

Variable Documentation

◆ verbose

int verbose
extern