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

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

+ Inheritance diagram for Polygon:
+ Collaboration diagram for Polygon:

Public Member Functions

 Polygon ()
 
 ~Polygon ()
 
void init (int)
 
bool add_line (Line *, int)
 
int get_Nlines ()
 
Line ** get_lines ()
 
void print (ofstream &file, double *)
 
 Polygon ()
 
 ~Polygon ()
 
void init (int)
 
bool add_line (Line *, int)
 
int get_Nlines ()
 
Line ** get_lines ()
 
void print (ofstream &file, double *)
 
 Polygon ()
 
 ~Polygon ()
 
void init (int)
 
bool add_line (Line *, int)
 
int get_Nlines ()
 
Line ** get_lines ()
 
void print (ofstream &file, double *)
 
 Polygon ()
 
 ~Polygon ()
 
void init (int)
 
bool add_line (Line *, int)
 
int get_Nlines ()
 
Line ** get_lines ()
 
void print (ofstream &file, double *)
 
- 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

void calculate_centroid ()
 
void calculate_normal ()
 
void calculate_centroid ()
 
void calculate_normal ()
 
void calculate_centroid ()
 
void calculate_normal ()
 
void calculate_centroid ()
 
void calculate_normal ()
 

Private Attributes

Line ** lines
 
int Nlines
 
int x1
 
int x2
 
int x3
 
int const_i
 

Static Private Attributes

static const int MAX_LINES = 24
 
static const int POLYGON_DIM = 3
 

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 polygons given by Cornelius. Can calculate the centroid and normal of the polygon.

Definition at line 347 of file cornelius.cpp.

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

Constructor & Destructor Documentation

Polygon::Polygon ( )

Allocates memory for the list of pointers to the lines which form the polygon.

Definition at line 374 of file cornelius.cpp.

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

References test_fpe::lines.

Polygon::~Polygon ( )

Frees memory allocated at the constructor.

Definition at line 385 of file cornelius.cpp.

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

References test_fpe::lines.

Polygon::Polygon ( )
Polygon::~Polygon ( )
Polygon::Polygon ( )
Polygon::~Polygon ( )
Polygon::Polygon ( )
Polygon::~Polygon ( )

Member Function Documentation

bool Polygon::add_line ( Line ,
int   
)
bool Polygon::add_line ( Line ,
int   
)
bool Polygon::add_line ( Line l,
int  donotcheck 
)

Adds a line to the polygon. This can also check if the line is connected to the ones already in the polygon and the line is added only when the line is connected.

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

Definition at line 436 of file cornelius.cpp.

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

References Acts::UnitConstants::e, eps, Line::flip_start_end(), Line::get_end(), Line::get_start(), j, and test_fpe::lines.

+ Here is the call graph for this function:

bool Polygon::add_line ( Line ,
int   
)
void Polygon::calculate_centroid ( )
privatevirtual

Reimplemented from GeneralElement.

void Polygon::calculate_centroid ( )
privatevirtual

Reimplemented from GeneralElement.

void Polygon::calculate_centroid ( )
privatevirtual

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

Reimplemented from GeneralElement.

Definition at line 478 of file cornelius.cpp.

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

References KFPMath::a, KFPMath::b, double(), i, j, test_fpe::lines, and mean().

+ Here is the call graph for this function:

void Polygon::calculate_centroid ( )
privatevirtual

Reimplemented from GeneralElement.

void Polygon::calculate_normal ( )
privatevirtual

Reimplemented from GeneralElement.

void Polygon::calculate_normal ( )
privatevirtual

Reimplemented from GeneralElement.

void Polygon::calculate_normal ( )
privatevirtual

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

Reimplemented from GeneralElement.

Definition at line 559 of file cornelius.cpp.

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

References KFPMath::a, KFPMath::b, i, j, and test_fpe::lines.

void Polygon::calculate_normal ( )
privatevirtual

Reimplemented from GeneralElement.

Line** Polygon::get_lines ( )
Line** Polygon::get_lines ( )
Line** Polygon::get_lines ( )
Line ** Polygon::get_lines ( )

Returns an array of pointers of the lines in the polygon.

Returns
Array of pointer to the lines in polygon

Definition at line 638 of file cornelius.cpp.

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

References test_fpe::lines.

Referenced by Polyhedron::add_polygon().

+ Here is the caller graph for this function:

int Polygon::get_Nlines ( )
int Polygon::get_Nlines ( )
int Polygon::get_Nlines ( )
int Polygon::get_Nlines ( )

Return the number of lines in this polygon.

Returns
Number of lines in this polygon

Definition at line 626 of file cornelius.cpp.

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

Referenced by Polyhedron::add_polygon().

+ Here is the caller graph for this function:

void Polygon::init ( int  )
void Polygon::init ( int  )
void Polygon::init ( int  c)

This initializes the polygon. Can be used several times.

Parameters
[in]cIndex which is constant in this polygon

Definition at line 397 of file cornelius.cpp.

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

References Acts::PhysicalConstants::c, and i.

void Polygon::init ( int  )
void Polygon::print ( ofstream &  file,
double  
)
void Polygon::print ( ofstream &  file,
double  
)
void Polygon::print ( ofstream &  file,
double pos 
)

Prints the triangles formed from the polygon into a given file. Prints the absolute points, so this file can be used to plot the surface.

Parameters
[in]fileOutput stream where the points are printed.
[in]fileAbsolute position of the cube point (0,0,0)

Definition at line 652 of file cornelius.cpp.

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

References i, and test_fpe::lines.

Referenced by Cornelius::surface_3d().

+ Here is the caller graph for this function:

void Polygon::print ( ofstream &  file,
double  
)

Member Data Documentation

int Polygon::const_i
private

Definition at line 355 of file cornelius.cpp.

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

Line ** Polygon::lines
private

Definition at line 352 of file cornelius.cpp.

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

static const int Polygon::MAX_LINES = 24
staticprivate

Definition at line 350 of file cornelius.cpp.

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

int Polygon::Nlines
private

Definition at line 353 of file cornelius.cpp.

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

static const int Polygon::POLYGON_DIM = 3
staticprivate

Definition at line 351 of file cornelius.cpp.

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

int Polygon::x1
private

Definition at line 354 of file cornelius.cpp.

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

int Polygon::x2
private

Definition at line 354 of file cornelius.cpp.

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

int Polygon::x3
private

Definition at line 354 of file cornelius.cpp.

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


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