CSGYCylinder creates an internal representation of a Constructive Solid Geometry (CSG) y-axis aligned cylinder, represented in the following form (x - x0)^2 + (z - z0)^2 = r^2. More...
#include <CSGYCylinder.h>
Public Types | |
| enum | Halfspace { Halfspace::POSITIVE, Halfspace::NEGATIVE } |
| Enum for the sign of the half-space being represented by a point and surface. More... | |
Public Member Functions | |
| CSGYCylinder (const std::string &name, const Real x0, const Real z0, const Real r) | |
| Construct a cylinder surface aligned with the y axis. More... | |
| virtual | ~CSGYCylinder ()=default |
| Destructor. More... | |
| virtual std::unordered_map< std::string, Real > | getCoeffs () const override |
| Get the coefficients (x0, z0, and r) that define the cylindrical surface with the equation: (x - x0)^2 + (z - z0)^2 = r^2. More... | |
| virtual Real | evaluateSurfaceEquationAtPoint (const Point &p) const override |
| given a point, determine its evaluation based on the equation of the cylinder More... | |
| const std::string & | getSurfaceType () const |
| Get the Surface Type. More... | |
| CSGSurface::Halfspace | getHalfspaceFromPoint (const Point &p) const |
| given a point, determine if it is in the positive or negative half-space for the surface More... | |
| const std::string & | getName () const |
| Get the name of surface. More... | |
| bool | operator== (const CSGSurface &other) const |
| Operator overload for checking if two CSGSurface objects are equal. More... | |
| bool | operator!= (const CSGSurface &other) const |
| Operator overload for checking if two CSGSurface objects are not equal. More... | |
| const std::vector< std::pair< TransformationType, std::tuple< Real, Real, Real > > > & | getTransformations () const |
| Get the list of transformations. More... | |
| std::vector< std::pair< std::string, std::tuple< Real, Real, Real > > > | getTransformationsAsStrings () const |
| Get the transformations of this object with string representations for types. More... | |
Static Public Member Functions | |
| static bool | isValidTransformationValue (TransformationType type, const std::tuple< Real, Real, Real > &values) |
| Check if the transformation value is valid for the given type. More... | |
| static std::string | getTransformationTypeString (TransformationType type) |
| Get the string representation of the transformation type. More... | |
Protected Member Functions | |
| virtual std::unique_ptr< CSGSurface > | clone () const override |
| create clone of CSGYCylinder object More... | |
| void | checkRadius () const |
| void | setName (const std::string &name) |
| void | addTransformation (TransformationType type, const std::tuple< Real, Real, Real > &values) |
| Add a transformation to the list of transformations. More... | |
| Point | applyReverseTransformsToPoint (Point p) const |
| update the value of point p by applying the inverse of the list of transformations to the point More... | |
| FRIEND_TEST (CSGSurfaceTest, testSetName) | |
| Friends for unit testing. More... | |
| FRIEND_TEST (CSGSurfaceTest, testSurfaceEquality) | |
| FRIEND_TEST (CSGSurfaceTest, testHalfspaceWithTransform) | |
| Friends for unit testing. More... | |
| FRIEND_TEST (CSGSurfaceTest, testHalfspaceWithNullTransform) | |
Protected Attributes | |
| Real | _x0 |
| Value of x0 in equation of an y-axis aligned cylinder. More... | |
| Real | _z0 |
| Value of z0 in equation of an y-axis aligned cylinder. More... | |
| Real | _r |
| Value of r in equation of an y-axis aligned cylinder. More... | |
| std::string | _name |
| Name of surface. More... | |
| const std::string | _surface_type |
| Type of surface that is being represented string is taken directly from the surface class name. More... | |
| std::vector< std::pair< TransformationType, std::tuple< Real, Real, Real > > > | _transformations |
| List of transformations applied to this object. More... | |
CSGYCylinder creates an internal representation of a Constructive Solid Geometry (CSG) y-axis aligned cylinder, represented in the following form (x - x0)^2 + (z - z0)^2 = r^2.
Definition at line 23 of file CSGYCylinder.h.
|
stronginherited |
Enum for the sign of the half-space being represented by a point and surface.
| Enumerator | |
|---|---|
| POSITIVE | |
| NEGATIVE | |
Definition at line 30 of file CSGSurface.h.
| CSG::CSGYCylinder::CSGYCylinder | ( | const std::string & | name, |
| const Real | x0, | ||
| const Real | z0, | ||
| const Real | r | ||
| ) |
Construct a cylinder surface aligned with the y axis.
| name | unique name of surface |
| x0 | x coordinate of center |
| z0 | z coordinate of center |
| r | radius |
Definition at line 15 of file CSGYCylinder.C.
|
virtualdefault |
Destructor.
|
protectedinherited |
Add a transformation to the list of transformations.
| type | The type of transformation |
| values | The values for the transformation |
Definition at line 16 of file CSGTransformationHelper.C.
|
protectedinherited |
update the value of point p by applying the inverse of the list of transformations to the point
| p | point to transform |
Definition at line 74 of file CSGTransformationHelper.C.
Referenced by CSG::CSGSurface::getHalfspaceFromPoint().
|
protected |
Definition at line 39 of file CSGYCylinder.C.
Referenced by CSGYCylinder().
|
inlineoverrideprotectedvirtual |
create clone of CSGYCylinder object
Implements CSG::CSGSurface.
Definition at line 63 of file CSGYCylinder.h.
|
overridevirtual |
given a point, determine its evaluation based on the equation of the cylinder
| p | point |
Implements CSG::CSGSurface.
Definition at line 29 of file CSGYCylinder.C.
|
protectedinherited |
Friends for unit testing.
|
protectedinherited |
|
protectedinherited |
Friends for unit testing.
|
protectedinherited |
|
overridevirtual |
Get the coefficients (x0, z0, and r) that define the cylindrical surface with the equation: (x - x0)^2 + (z - z0)^2 = r^2.
Implements CSG::CSGSurface.
Definition at line 22 of file CSGYCylinder.C.
|
inherited |
given a point, determine if it is in the positive or negative half-space for the surface
| p | point |
Definition at line 23 of file CSGSurface.C.
|
inlineinherited |
Get the name of surface.
Definition at line 95 of file CSGSurface.h.
Referenced by CSG::CSGSurfaceList::addSurface(), CSG::CSGBase::addTransformation(), CSG::CSGBase::checkSurfaceInBase(), CSG::CSGBase::deleteSurface(), CSG::CSGSurface::operator==(), and CSG::CSGSurfaceList::renameSurface().
|
inlineinherited |
Get the Surface Type.
Definition at line 61 of file CSGSurface.h.
Referenced by CSG::CSGSurface::operator==().
|
inlineinherited |
Get the list of transformations.
Definition at line 47 of file CSGTransformationHelper.h.
Referenced by CSG::CSGSurface::getHalfspaceFromPoint(), CSG::CSGUniverse::operator==(), CSG::CSGSurface::operator==(), CSG::CSGCell::operator==(), and CSG::CSGLattice::operator==().
|
inherited |
Get the transformations of this object with string representations for types.
Definition at line 65 of file CSGTransformationHelper.C.
|
staticinherited |
Get the string representation of the transformation type.
| type | The transformation type |
Definition at line 56 of file CSGTransformationHelper.C.
Referenced by CSG::CSGTransformationHelper::addTransformation(), and CSG::CSGTransformationHelper::getTransformationsAsStrings().
|
staticinherited |
Check if the transformation value is valid for the given type.
| type | The type of transformation |
| values | The values for the transformation |
Definition at line 26 of file CSGTransformationHelper.C.
Referenced by CSG::CSGTransformationHelper::addTransformation().
|
inherited |
Operator overload for checking if two CSGSurface objects are not equal.
Definition at line 54 of file CSGSurface.C.
|
inherited |
Operator overload for checking if two CSGSurface objects are equal.
Definition at line 45 of file CSGSurface.C.
|
inlineprotectedinherited |
Definition at line 113 of file CSGSurface.h.
|
protectedinherited |
Name of surface.
Definition at line 116 of file CSGSurface.h.
Referenced by CSG::CSGXCylinder::clone(), clone(), CSG::CSGZCylinder::clone(), CSG::CSGSphere::clone(), CSG::CSGPlane::clone(), CSG::CSGSurface::getHalfspaceFromPoint(), CSG::CSGSurface::getName(), and CSG::CSGSurface::setName().
|
protected |
Value of r in equation of an y-axis aligned cylinder.
Definition at line 78 of file CSGYCylinder.h.
Referenced by checkRadius(), clone(), evaluateSurfaceEquationAtPoint(), and getCoeffs().
|
protectedinherited |
Type of surface that is being represented string is taken directly from the surface class name.
Definition at line 120 of file CSGSurface.h.
Referenced by CSG::CSGSurface::getSurfaceType().
|
protectedinherited |
List of transformations applied to this object.
Definition at line 92 of file CSGTransformationHelper.h.
Referenced by CSG::CSGTransformationHelper::addTransformation(), CSG::CSGTransformationHelper::applyReverseTransformsToPoint(), CSG::CSGTransformationHelper::getTransformations(), and CSG::CSGTransformationHelper::getTransformationsAsStrings().
|
protected |
Value of x0 in equation of an y-axis aligned cylinder.
Definition at line 72 of file CSGYCylinder.h.
Referenced by clone(), evaluateSurfaceEquationAtPoint(), and getCoeffs().
|
protected |
Value of z0 in equation of an y-axis aligned cylinder.
Definition at line 75 of file CSGYCylinder.h.
Referenced by clone(), evaluateSurfaceEquationAtPoint(), and getCoeffs().
1.8.14