Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Polyhedron Class Reference

#include <JETSCAPE/blob/main/external_packages/cornelius.h>

+ Inheritance diagram for Polyhedron:
+ Collaboration diagram for Polyhedron:

Public Member Functions

 Polyhedron ()
 
 ~Polyhedron ()
 
void init ()
 
bool add_polygon (Polygon *, int)
 
 Polyhedron ()
 
 ~Polyhedron ()
 
void init ()
 
bool add_polygon (Polygon *, int)
 
 Polyhedron ()
 
 ~Polyhedron ()
 
void init ()
 
bool add_polygon (Polygon *, int)
 
 Polyhedron ()
 
 ~Polyhedron ()
 
void init ()
 
bool add_polygon (Polygon *, int)
 
- Public Member Functions inherited from GeneralElement
 GeneralElement ()
 
 ~GeneralElement ()
 
doubleget_centroid ()
 
doubleget_normal ()
 
 GeneralElement ()
 
 ~GeneralElement ()
 
doubleget_centroid ()
 
doubleget_normal ()
 
 GeneralElement ()
 
 ~GeneralElement ()
 
doubleget_centroid ()
 
doubleget_normal ()
 
 GeneralElement ()
 
 ~GeneralElement ()
 
doubleget_centroid ()
 
doubleget_normal ()
 

Private Member Functions

bool lines_equal (Line *, Line *)
 
void tetravolume (double *, double *, double *, double *)
 
void calculate_centroid ()
 
void calculate_normal ()
 
bool lines_equal (Line *, Line *)
 
void tetravolume (double *, double *, double *, double *)
 
void calculate_centroid ()
 
void calculate_normal ()
 
bool lines_equal (Line *, Line *)
 
void tetravolume (double *, double *, double *, double *)
 
void calculate_centroid ()
 
void calculate_normal ()
 
bool lines_equal (Line *, Line *)
 
void tetravolume (double *, double *, double *, double *)
 
void calculate_centroid ()
 
void calculate_normal ()
 

Private Attributes

Polygon ** polygons
 
int Npolygons
 
int Ntetrahedra
 
int x1
 
int x2
 
int x3
 
int x4
 

Static Private Attributes

static const int MAX_POLYGONS = 24
 

Additional Inherited Members

- Protected Member Functions inherited from GeneralElement
void check_normal_direction (double *normal, double *out)
 
void check_normal_direction (double *normal, double *out)
 
void check_normal_direction (double *normal, double *out)
 
void check_normal_direction (double *normal, double *out)
 
- Protected Attributes inherited from GeneralElement
doublecentroid
 
doublenormal
 
int normal_calculated
 
int centroid_calculated
 
- Static Protected Attributes inherited from GeneralElement
static const int DIM = 4
 

Detailed Description

A class for storing polyhedrons given by Cornelius. Can calculate the normal and centroid of the polyhedron.

Definition at line 669 of file cornelius.cpp.

View newest version in sPHENIX GitHub at line 669 of file cornelius.cpp

Constructor & Destructor Documentation

Polyhedron::Polyhedron ( )

Allocates memory for a list pointers to the polygons which form the polyhedron.

Definition at line 694 of file cornelius.cpp.

View newest version in sPHENIX GitHub at line 694 of file cornelius.cpp

Polyhedron::~Polyhedron ( )

Frees memory allocated at the constructor.

Definition at line 705 of file cornelius.cpp.

View newest version in sPHENIX GitHub at line 705 of file cornelius.cpp

Polyhedron::Polyhedron ( )
Polyhedron::~Polyhedron ( )
Polyhedron::Polyhedron ( )
Polyhedron::~Polyhedron ( )
Polyhedron::Polyhedron ( )
Polyhedron::~Polyhedron ( )

Member Function Documentation

bool Polyhedron::add_polygon ( Polygon ,
int   
)
bool Polyhedron::add_polygon ( Polygon ,
int   
)
bool Polyhedron::add_polygon ( Polygon ,
int   
)
bool Polyhedron::add_polygon ( Polygon p,
int  donocheck 
)

Adds a polygon to the polyhedron. Also possible to check if the new polygon is connected with previous polygons and only make the addition if this is the case.

Parameters
[in]pPolygon which is tried to add to polyhedron
[in]donotcheck1 if no check is needed, 0 otherwise
Returns
True if polygon was added, false if not added

Definition at line 743 of file cornelius.cpp.

View newest version in sPHENIX GitHub at line 743 of file cornelius.cpp

References Polygon::get_lines(), Polygon::get_Nlines(), i, j, k, and merge_hashes::p.

+ Here is the call graph for this function:

void Polyhedron::calculate_centroid ( )
privatevirtual

Reimplemented from GeneralElement.

void Polyhedron::calculate_centroid ( )
privatevirtual

Reimplemented from GeneralElement.

void Polyhedron::calculate_centroid ( )
privatevirtual

This determines the centroid (center of mass) of the polyhedron.

Reimplemented from GeneralElement.

Definition at line 842 of file cornelius.cpp.

View newest version in sPHENIX GitHub at line 842 of file cornelius.cpp

References KFPMath::a, KFPMath::b, Acts::PhysicalConstants::c, double(), Line::get_end(), Line::get_start(), i, j, k, test_fpe::lines, mean(), and n.

+ Here is the call graph for this function:

void Polyhedron::calculate_centroid ( )
privatevirtual

Reimplemented from GeneralElement.

void Polyhedron::calculate_normal ( )
privatevirtual

Reimplemented from GeneralElement.

void Polyhedron::calculate_normal ( )
privatevirtual

Reimplemented from GeneralElement.

void Polyhedron::calculate_normal ( )
privatevirtual

Reimplemented from GeneralElement.

void Polyhedron::calculate_normal ( )
privatevirtual

Determines the normal vector for polygon. Makes sure that it points in the outward direction.

Reimplemented from GeneralElement.

Definition at line 928 of file cornelius.cpp.

View newest version in sPHENIX GitHub at line 928 of file cornelius.cpp

References KFPMath::a, KFPMath::b, Acts::PhysicalConstants::c, Line::get_end(), Line::get_out(), Line::get_start(), i, j, k, and test_fpe::lines.

+ Here is the call graph for this function:

void Polyhedron::init ( )
void Polyhedron::init ( )
void Polyhedron::init ( )
void Polyhedron::init ( void  )

This initializes the polygon. Can be used several times.

Definition at line 715 of file cornelius.cpp.

View newest version in sPHENIX GitHub at line 715 of file cornelius.cpp

bool Polyhedron::lines_equal ( Line ,
Line  
)
private
bool Polyhedron::lines_equal ( Line ,
Line  
)
private
bool Polyhedron::lines_equal ( Line ,
Line  
)
private
bool Polyhedron::lines_equal ( Line l1,
Line l2 
)
private

Checks if two lines are connected.

Parameters
[in]l1Line 1
[in]l2Line 2
Returns
true if lines are connected, false if not

Definition at line 786 of file cornelius.cpp.

View newest version in sPHENIX GitHub at line 786 of file cornelius.cpp

References Acts::UnitConstants::e, eps, Line::get_end(), Line::get_start(), and i.

+ Here is the call graph for this function:

void Polyhedron::tetravolume ( double ,
double ,
double ,
double  
)
private
void Polyhedron::tetravolume ( double ,
double ,
double ,
double  
)
private
void Polyhedron::tetravolume ( double a,
double b,
double c,
double n 
)
private

Calculates the normal vector for tetrahedra, which also tells the volume of the tetrahedra.

Parameters
[in]aVector that spans the tetrahedra
[in]bVector that spans the tetrahedra
[in]cVector that spans the tetrahedra
[out]nNormal vector for tetrahedra

Definition at line 815 of file cornelius.cpp.

View newest version in sPHENIX GitHub at line 815 of file cornelius.cpp

void Polyhedron::tetravolume ( double ,
double ,
double ,
double  
)
private

Member Data Documentation

static const int Polyhedron::MAX_POLYGONS = 24
staticprivate

Definition at line 672 of file cornelius.cpp.

View newest version in sPHENIX GitHub at line 672 of file cornelius.cpp

int Polyhedron::Npolygons
private

Definition at line 674 of file cornelius.cpp.

View newest version in sPHENIX GitHub at line 674 of file cornelius.cpp

int Polyhedron::Ntetrahedra
private

Definition at line 675 of file cornelius.cpp.

View newest version in sPHENIX GitHub at line 675 of file cornelius.cpp

Polygon ** Polyhedron::polygons
private

Definition at line 673 of file cornelius.cpp.

View newest version in sPHENIX GitHub at line 673 of file cornelius.cpp

int Polyhedron::x1
private

Definition at line 676 of file cornelius.cpp.

View newest version in sPHENIX GitHub at line 676 of file cornelius.cpp

int Polyhedron::x2
private

Definition at line 676 of file cornelius.cpp.

View newest version in sPHENIX GitHub at line 676 of file cornelius.cpp

int Polyhedron::x3
private

Definition at line 676 of file cornelius.cpp.

View newest version in sPHENIX GitHub at line 676 of file cornelius.cpp

int Polyhedron::x4
private

Definition at line 676 of file cornelius.cpp.

View newest version in sPHENIX GitHub at line 676 of file cornelius.cpp


The documentation for this class was generated from the following files: