Structural Bioinformatics Library
Template C++ / Python API for developping structural bioinformatics applications.
T_Union_of_balls_surface_volume_3_module< ModuleTraits, OutputArchive > Class Template Reference

Module computing the surface area and the volume of the union of an input set of 3D balls. Module computing the surface area and the volume of the union of an input set of 3D balls. More...

#include "Union_of_balls_surface_volume_3_module.hpp"

Classes

class  Union_of_balls_surface_volume_3
 Contains pointers over two functors for computing the volumes and surfaces areas with different level of exactness. More...
 

Static Public Member Functions

static boost::program_options::options_description *& get_options (void)
 Access to the options' description of the module. More...
 

Traits Requirements

typedef ModuleTraits::Alpha_complex Alpha_complex
 $\alpha$-complex representing the input set of 3D balls. More...
 

Other Types

typedef CGAL::Exact_spherical_kernel_3 Spherical_kernel_3_exact
 Geometric kernel for computations over a 3D sphere with exact constructions and predicates. More...
 
typedef CGAL::Simple_cartesian< CGAL::Interval_nt< false > > Geometric_kernel_interval
 3D geometric kernel with interval arithmetics. More...
 
typedef CGAL::Algebraic_kernel_for_spheres_2_3< typename Geometric_kernel_interval::FT > Algebraic_kernel_interval
 Kernel for algebraic computations over a 3D sphere with interval arithmetics. More...
 
typedef CGAL::Spherical_kernel_3< Geometric_kernel_interval, Algebraic_kernel_intervalSpherical_kernel_3_interval
 Geometric kernel for computations over a 3D sphere with interval arithmetics. More...
 
typedef SBL::GT::T_Union_of_balls_surface_volume_3< Alpha_complex, Spherical_kernel_3_exactUnion_of_balls_surface_volume_3_SK_exact
 Computation of volume and surface area of the union of 3D balls as most exact as possible. More...
 
typedef SBL::GT::T_Union_of_balls_surface_volume_3< Alpha_complex, Spherical_kernel_3_intervalUnion_of_balls_surface_volume_3_SK_interval
 Computation of volume and surface area of the union of 3D balls using interval arithmetics. More...
 
typedef Union_of_balls_surface_volume_3_SK_exact::Union_of_balls_boundary_3 Union_of_balls_boundary_3
 Representation of the boundary of the union of balls. More...
 

Input Accessors

Alpha_complex *& get_alpha_complex (void)
 Reference to a pointer over the input $\alpha$-complex. More...
 
Union_of_balls_boundary_3 *& get_boundary (void)
 Reference to a pointer over the input boundary. More...
 

Output Accessors

const Union_of_balls_surface_volume_3get_surface_volume (void) const
 Const reference to the output surface area and volume computation. More...
 
Union_of_balls_surface_volume_3get_surface_volume (void)
 Reference to the output surface area and volume computation. More...
 

Mandatory Requirements

void run (unsigned verbose, std::ostream &out) override
 Runs the module following the input options. More...
 
bool is_runnable (void) const override
 Checks that all the input options were set. More...
 
void statistics (std::ostream &out) override
 Reports high-level statistics on the module. More...
 
std::string get_name (void) const override
 Returns the name of the package. More...
 

Optional Requirements

boost::program_options::options_description add_options (void) override
 Virtual method for adding options to the module. More...
 
bool check_options (std::string &message) const override
 Checks that the input options' values are coherent. More...
 
std::string get_output_prefix (void) const override
 Returns a prefix that concatains the input line options used when running the module. More...
 
void report (const std::string &prefix) override
 Reports the output and statistics in output files. More...
 

Modules Management

void set_module_instance_name (const std::string &module_instance_name)
 Sets a name for this instance of this module. In particular, it will be used in the prefix of output files generated by a collection of modules. More...
 
const std::string & get_module_instance_name (void) const
 Get the name of this instance of this module. More...
 
void set_report_mode (std::ios_base::openmode report_mode)
 Set a report mode, that is open or append modes. More...
 
void set_report_mode (std::ios_base::openmode &report_mode)
 Set a report mode, that is open or append modes. More...
 
const std::ios_base::openmode get_report_mode (void) const
 Get the report mode to be used when reporting. More...
 

Optional Requirements

void check_filesystem_directory_exists (const std::string &output_prefix)
 To avoid later crash: check filesystem / existence of directory / directory exists. More...
 

Others

template<class Self_ >
Self_ * clone (const Self_ *s) const
 Clones the object using the copy constructor. More...
 
virtual bool is_logical_module (void) const
 Checks that this module defines a logical operator. More...
 
virtual bool is_condition_module (void) const
 Checks that this module defines a condition operator. More...
 
virtual bool operator() (void)
 Only for condition modules, for returning the predicate value. More...
 
virtual bool is_modules_collection (void) const
 Checks that this module defines a collection of modules. More...
 

Detailed Description

template<class ModuleTraits, class OutputArchive = boost::archive::xml_oarchive>
class SBL::Modules::T_Union_of_balls_surface_volume_3_module< ModuleTraits, OutputArchive >

Module computing the surface area and the volume of the union of an input set of 3D balls. Module computing the surface area and the volume of the union of an input set of 3D balls.

It computes the volumes and surface areas from the boundary data structure SBL::GT::T_Union_of_balls_boundary_3_data_structure, itself constructed from the $\alpha$-complex of an input set of 3D balls..

Remind that the restriction $R$ of a ball to its Voronoi region is the intersection of this ball to its Voronoi region.

Two computations are required for determining the volume of a restriction $R$:

  • computing the volume of a pyramid whose base is a spherical cap, and whose apex is the center of the ball of $R$,
  • computing the volume of a pyramid whose base is the restriction of a Voronoi face bounding $R$, and whose apex is the center of the ball of $R$.

Adding up the volumes of all pyramids partitioning $R$ yields the volume of $R$. Note that the computation of the volume of pyramids whose base is a spherical cap requires computing the surface area of this cap. In particular, the sum of all surface areas from a restriction defines the surface area of this restriction.

The package Union_of_balls_surface_volume_3 provides the class SBL::GT::T_Union_of_balls_surface_volume_3< AlphaComplex3 , SphericalKernel3 , UnionOfBallsBoundary3 > computing the volume of all the restrictions of an input set of balls. The first parameter is a model of the $\alpha$-complex of the input balls. Note that the number type used for representing the input data is derived from AlphaComplex3 . The second parameter is a kernel used to define objects and constructions related the computation over a sphere. It defines also the number type used for representing the intersection points between the spheres. The last template parameter is a representation of the boundary of the union of balls.

The input can be either:

The output is a structure having two public attributes:

  • exact : it is a pointer over a "as most as possible" exact calculation of the surfaces' areas and volumes.
  • inexact: it is a pointer over a more approximated, but faster calculation of the surfaces' areas and volumes.

Only one of these two computations is done when running the module, the other attribute being set to the NULL pointer. This structure is accessible with the method SBL::Modules::T_Union_of_balls_surface_volume_3_module::get_surface_volume

Template Parameters
ModuleTraitsTraits class defining the type SBL::Modules::T_Union_of_balls_surface_volume_3_module::Alpha_complex.
OutputArchiveArchive concept from the Boost library, allowing to switch between a full serialization of the output data with for example the class boost::archive::xml_oarchive, or a multiple archives serialization with the class SBL::IO::T_Multiple_archives_serialization_xml_oarchive.

Member Typedef Documentation

◆ Algebraic_kernel_interval

typedef CGAL::Algebraic_kernel_for_spheres_2_3<typename Geometric_kernel_interval::FT> Algebraic_kernel_interval

Kernel for algebraic computations over a 3D sphere with interval arithmetics.

◆ Alpha_complex

typedef ModuleTraits:: Alpha_complex Alpha_complex

$\alpha$-complex representing the input set of 3D balls.

◆ Geometric_kernel_interval

typedef CGAL::Simple_cartesian<CGAL::Interval_nt<false> > Geometric_kernel_interval

3D geometric kernel with interval arithmetics.

◆ Spherical_kernel_3_exact

typedef CGAL::Exact_spherical_kernel_3 Spherical_kernel_3_exact

Geometric kernel for computations over a 3D sphere with exact constructions and predicates.

◆ Spherical_kernel_3_interval

Geometric kernel for computations over a 3D sphere with interval arithmetics.

◆ Union_of_balls_boundary_3

typedef Union_of_balls_surface_volume_3_SK_exact:: Union_of_balls_boundary_3 Union_of_balls_boundary_3

Representation of the boundary of the union of balls.

Representation of the boundary of the union of balls.

Template Parameters
WeightedAlphaComplex3A Model of the 3D Weighted $\alpha$-complex of the CGAL Library.
IS_CCWTag allowing to orientate in CW or CCW the sense of the half-edges.
HalfedgeDSBaseBase data structure for the boundary of union of balls.

◆ Union_of_balls_surface_volume_3_SK_exact

Computation of volume and surface area of the union of 3D balls as most exact as possible.

Algorithm computing the surface area and the volume of the union of 3D balls

Template Parameters
AlphaComplex3Alpha-complex of the input spheres
SphericalKernel3Geometric kernel for computations over a sphere
UnionOfBallsBoundary3Representation of the boundary of a union of spheres

◆ Union_of_balls_surface_volume_3_SK_interval

Computation of volume and surface area of the union of 3D balls using interval arithmetics.

Algorithm computing the surface area and the volume of the union of 3D balls

Template Parameters
AlphaComplex3Alpha-complex of the input spheres
SphericalKernel3Geometric kernel for computations over a sphere
UnionOfBallsBoundary3Representation of the boundary of a union of spheres

Member Function Documentation

◆ add_options()

boost::program_options::options_description add_options ( void  )
inlineoverridevirtual

Virtual method for adding options to the module.

Reimplemented from T_Module_option_description< Dummy >.

◆ check_filesystem_directory_exists()

void check_filesystem_directory_exists ( const std::string &  output_prefix)
inlineinherited

To avoid later crash: check filesystem / existence of directory / directory exists.

◆ check_options()

bool check_options ( std::string &  message) const
inlineoverridevirtual

Checks that the input options' values are coherent.

Reimplemented from T_Module_option_description< Dummy >.

◆ clone()

Self_* clone ( const Self_ *  s) const
inlineinherited

Clones the object using the copy constructor.

◆ get_alpha_complex()

T_Union_of_balls_surface_volume_3_module< ModuleTraits, OutputArchive >::Alpha_complex *& get_alpha_complex ( void  )
inline

Reference to a pointer over the input $\alpha$-complex.

◆ get_boundary()

T_Union_of_balls_surface_volume_3_module< ModuleTraits, OutputArchive >::Union_of_balls_boundary_3 *& get_boundary ( void  )
inline

Reference to a pointer over the input boundary.

◆ get_module_instance_name()

const std::string& get_module_instance_name ( void  ) const
inlineinherited

Get the name of this instance of this module.

◆ get_name()

std::string get_name ( void  ) const
inlineoverridevirtual

Returns the name of the package.

Reimplemented from Module_base.

◆ get_options()

static boost::program_options::options_description*& get_options ( void  )
inlinestaticinherited

Access to the options' description of the module.

◆ get_output_prefix()

std::string get_output_prefix ( void  ) const
inlineoverridevirtual

Returns a prefix that concatains the input line options used when running the module.

Reimplemented from T_Module_option_description< Dummy >.

◆ get_report_mode()

const std::ios_base::openmode get_report_mode ( void  ) const
inlineinherited

Get the report mode to be used when reporting.

◆ get_surface_volume() [1/2]

T_Union_of_balls_surface_volume_3_module< ModuleTraits, OutputArchive >::Union_of_balls_surface_volume_3 & get_surface_volume ( void  )
inline

Reference to the output surface area and volume computation.

◆ get_surface_volume() [2/2]

const T_Union_of_balls_surface_volume_3_module< ModuleTraits, OutputArchive >::Union_of_balls_surface_volume_3 & get_surface_volume ( void  ) const
inline

Const reference to the output surface area and volume computation.

◆ is_condition_module()

virtual bool is_condition_module ( void  ) const
inlineprotectedvirtualinherited

Checks that this module defines a condition operator.

◆ is_logical_module()

virtual bool is_logical_module ( void  ) const
inlineprotectedvirtualinherited

Checks that this module defines a logical operator.

◆ is_modules_collection()

virtual bool is_modules_collection ( void  ) const
inlineprotectedvirtualinherited

Checks that this module defines a collection of modules.

◆ is_runnable()

bool is_runnable ( void  ) const
inlineoverridevirtual

Checks that all the input options were set.

Reimplemented from Module_base.

◆ operator()()

virtual bool operator() ( void  )
inlineprotectedvirtualinherited

Only for condition modules, for returning the predicate value.

◆ report()

void report ( const std::string &  prefix)
inlineoverridevirtual

Reports the output and statistics in output files.

Reimplemented from Module_base.

◆ run()

void run ( unsigned  verbose,
std::ostream &  out 
)
inlineoverridevirtual

Runs the module following the input options.

Implements Module_base.

◆ set_module_instance_name()

void set_module_instance_name ( const std::string &  module_instance_name)
inlineinherited

Sets a name for this instance of this module. In particular, it will be used in the prefix of output files generated by a collection of modules.

◆ set_report_mode() [1/2]

void set_report_mode ( std::ios_base::openmode &  report_mode)
inlineinherited

Set a report mode, that is open or append modes.

◆ set_report_mode() [2/2]

void set_report_mode ( std::ios_base::openmode  report_mode)
inlineinherited

Set a report mode, that is open or append modes.

◆ statistics()

void statistics ( std::ostream &  out)
inlineoverridevirtual

Reports high-level statistics on the module.

Reimplemented from Module_base.