GenGeo  1.1
BoxWithLines2D Class Reference

#include <BoxWithLines2D.h>

Inheritance diagram for BoxWithLines2D:
Collaboration diagram for BoxWithLines2D:

Public Member Functions

 BoxWithLines2D ()
 BoxWithLines2D (const Vector3 &, const Vector3 &)
virtual ~BoxWithLines2D ()
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
vector< Line2Dm_lines

Friends

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

Detailed Description

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

Constructor & Destructor Documentation

BoxWithLines2D::BoxWithLines2D ( )
BoxWithLines2D::BoxWithLines2D ( const Vector3 pmin,
const Vector3 pmax 
)

Construct box

Parameters
pminminimum point of bounding box
pmaxmaximum point of bounding box
virtual BoxWithLines2D::~BoxWithLines2D ( )
inlinevirtual

Member Function Documentation

void BoxWithLines2D::addLine ( const Line2D l)

add a line

Parameters
lthe line

References m_lines.

Referenced by exportBoxWithLines2D(), and main().

Vector3 BoxWithLines2D::getAPoint ( int  ) const
virtual

get point inside the box. The Argument is ignored

Implements AVolume.

Reimplemented in BoxWithLines2DSubVol.

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

Here is the call graph for this function:

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

get bounding box

Implements AVolume.

References m_pmax, and m_pmin.

Line2D BoxWithLines2D::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 * > BoxWithLines2D::getClosestPlanes ( const Vector3 p,
int  nmax 
) const
virtual

Implements AVolume2D.

References m_lines.

virtual bool BoxWithLines2D::hasPlane ( ) const
inlinevirtual

References m_lines.

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

check if point is inside

Parameters
pthe point

Implements AVolume.

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

Here is the call graph for this function:

bool BoxWithLines2D::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(), m_lines, m_pmax, m_pmin, Sphere::Radius(), Vector3::X(), and Vector3::Y().

Here is the call graph for this function:

double BoxWithLines2D::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 BoxWithLines2D L 
)
friend

Member Data Documentation

vector<Line2D> BoxWithLines2D::m_lines
protected
Vector3 BoxWithLines2D::m_pmax
protected
Vector3 BoxWithLines2D::m_pmin
protected

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