| 1 |
///////////////////////////////////////////////////////////// |
| 2 |
// // |
| 3 |
// Copyright (c) 2007-2017 by The University of Queensland // |
| 4 |
// Centre for Geoscience Computing // |
| 5 |
// http://earth.uq.edu.au/centre-geoscience-computing // |
| 6 |
// // |
| 7 |
// Primary Business: Brisbane, Queensland, Australia // |
| 8 |
// Licensed under the Open Software License version 3.0 // |
| 9 |
// http://www.apache.org/licenses/LICENSE-2.0 // |
| 10 |
// // |
| 11 |
///////////////////////////////////////////////////////////// |
| 12 |
|
| 13 |
#ifndef __CLIPPED_CIRCLE_VOL_H |
| 14 |
#define __CLIPPED_CIRCLE_VOL_H |
| 15 |
|
| 16 |
// --- Project includes --- |
| 17 |
#include "CircleVol.h" |
| 18 |
#include "geometry/Line2D.h" |
| 19 |
|
| 20 |
// --- STL includes --- |
| 21 |
#include <map> |
| 22 |
#include <utility> |
| 23 |
|
| 24 |
using std::map; |
| 25 |
using std::pair; |
| 26 |
|
| 27 |
/*! |
| 28 |
A clipped circle volume. |
| 29 |
|
| 30 |
The volume is bounded by a circle and by the lines added to the |
| 31 |
volume using the addLine function. The in/out decision does depend |
| 32 |
on the line normals, i.e. particles on the side of a line where the |
| 33 |
normal is positive are considered inside, those on the negative side |
| 34 |
outside. |
| 35 |
*/ |
| 36 |
class ClippedCircleVol : public CircleVol |
| 37 |
{ |
| 38 |
protected: |
| 39 |
vector<pair<Line2D,bool> > m_lines; |
| 40 |
|
| 41 |
public: |
| 42 |
ClippedCircleVol(); |
| 43 |
ClippedCircleVol(const Vector3&,double); |
| 44 |
virtual ~ClippedCircleVol(){}; |
| 45 |
|
| 46 |
void addLine(const Line2D&,bool); |
| 47 |
virtual Vector3 getAPoint(int) const; |
| 48 |
virtual const map<double,const AGeometricObject*> getClosestObjects(const Vector3&,int) const; |
| 49 |
virtual bool isIn(const Vector3&) const; |
| 50 |
virtual bool isIn(const Sphere&); |
| 51 |
}; |
| 52 |
|
| 53 |
#endif // __CLIPPED_CIRCLE_VOL_H |