GenGeo  1.1
PolygonWithLines2D Class Reference

#include <PolygonWithLines2D.h>

Inheritance diagram for PolygonWithLines2D:
Collaboration diagram for PolygonWithLines2D:

Public Member Functions

 PolygonWithLines2D ()
 PolygonWithLines2D (const Vector3 &, double, int, bool)
 PolygonWithLines2D (boost::python::list)
virtual ~PolygonWithLines2D ()
void addLine (const Line2D &)
virtual pair< Vector3, Vector3getBoundingBox ()
virtual Vector3 getAPoint (int) const
virtual bool hasPlane () const
virtual Line2D getClosestPlane (const Vector3 &)
virtual const map< double,
const Line2D * > 
getClosestPlanes (const Vector3 &, int) const
virtual bool isIn (const Vector3 &) const
virtual bool isIn (const Sphere &)
- Public Member Functions inherited from AVolume2D
virtual ~AVolume2D ()
virtual const map< double,
const AGeometricObject * > 
getClosestObjects (const Vector3 &, int) const
- Public Member Functions inherited from AVolume
virtual ~AVolume ()
virtual int getNumberSubVolumes () const

Protected Member Functions

double m_random (double, double) const

Protected Attributes

Vector3 m_pmin
Vector3 m_pmax
Vector3 m_centre
double m_radius
int m_nsides
Vector3 m_vertices [MAX_VERTICES]
vector< Line2Dm_lines

Friends

ostream & operator<< (ostream &, const PolygonWithLines2D &)

Detailed Description

A class for the generation of random particles inside a 2D polygon. An arbitrary number of lines can be added to which the particles are fitted.

Constructor & Destructor Documentation

PolygonWithLines2D::PolygonWithLines2D ( )
PolygonWithLines2D::PolygonWithLines2D ( const Vector3 centre,
double  rad,
int  nsides,
bool  add_bounding_lines 
)

Construct regular n-sided polygon

Parameters
centrethe center postition of the polygon
radthe distance of the corners fron the center, i.e. the radius of the circle into which the polygon is incribed
nsidesnr. of sides
add_bounding_linesadd fitting lines to sides of polygon (yes/no)

References addLine(), m_centre, m_nsides, m_pmax, m_pmin, m_radius, and m_vertices.

Here is the call graph for this function:

PolygonWithLines2D::PolygonWithLines2D ( boost::python::list  corners)

Construct polygon from list of corner points

Parameters
cornersthe list of corner points as Vector3

References comp_max(), comp_min(), m_centre, m_nsides, m_pmax, m_pmin, and m_vertices.

Here is the call graph for this function:

virtual PolygonWithLines2D::~PolygonWithLines2D ( )
inlinevirtual

Member Function Documentation

void PolygonWithLines2D::addLine ( const Line2D l)

add a line

Parameters
lthe line

References m_lines.

Referenced by exportPolygonWithLines2D(), and PolygonWithLines2D().

Vector3 PolygonWithLines2D::getAPoint ( int  ) const
virtual

get point inside the box. The Argument is ignored

Implements AVolume.

References isIn(), m_pmax, m_pmin, m_random(), Vector3::x(), and Vector3::y().

Here is the call graph for this function:

pair< Vector3, Vector3 > PolygonWithLines2D::getBoundingBox ( )
virtual

get bounding box

Implements AVolume.

References m_pmax, and m_pmin.

Line2D PolygonWithLines2D::getClosestPlane ( const Vector3 p)
virtual

Return closest plane to a given point. Assumes that the list of Planes/Lines is not empty.

Parameters
pthe point
Warning
check non-empty list of lines (via hasPlane()) before invoking

Implements AVolume2D.

References m_lines.

const map< double, const Line2D * > PolygonWithLines2D::getClosestPlanes ( const Vector3 p,
int  nmax 
) const
virtual

Implements AVolume2D.

References m_lines.

virtual bool PolygonWithLines2D::hasPlane ( ) const
inlinevirtual

References m_lines.

bool PolygonWithLines2D::isIn ( const Vector3 p) const
virtual

check if point is inside

Parameters
pthe point

Implements AVolume.

References cross(), m_centre, m_nsides, m_pmax, m_pmin, m_vertices, Vector3::x(), Vector3::y(), and Vector3::z().

Referenced by getAPoint(), and isIn().

Here is the call graph for this function:

bool PolygonWithLines2D::isIn ( const Sphere S)
virtual

check if a Sphere is inside and doesn't intersect any lines

Parameters
Sthe Sphere

Implements AVolume.

References Sphere::Center(), isIn(), m_lines, and Sphere::Radius().

Here is the call graph for this function:

double PolygonWithLines2D::m_random ( double  imin,
double  imax 
) const
protected

helper function, return random value between min & max

Referenced by getAPoint().

Friends And Related Function Documentation

ostream& operator<< ( ostream &  ost,
const PolygonWithLines2D L 
)
friend

Member Data Documentation

Vector3 PolygonWithLines2D::m_centre
protected
vector<Line2D> PolygonWithLines2D::m_lines
protected
int PolygonWithLines2D::m_nsides
protected
Vector3 PolygonWithLines2D::m_pmax
protected
Vector3 PolygonWithLines2D::m_pmin
protected
double PolygonWithLines2D::m_radius
protected

Referenced by operator<<(), and PolygonWithLines2D().

Vector3 PolygonWithLines2D::m_vertices[MAX_VERTICES]
protected

Referenced by isIn(), and PolygonWithLines2D().


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