5
/**************************************************************************/
6
/* File: polyhedra.hh */
7
/* Author: Joachim Schoeberl */
8
/* Date: 19. Mar. 2000 */
9
/**************************************************************************/
17
class Polyhedra : public Primitive
26
Vec<3> v1, v2; // edges
27
Vec<3> w1, w2; // pseudo-inverse
28
Vec<3> n; // normal to face
29
Vec<3> nn; // normed normal
32
Face (int pi1, int pi2, int pi3, const ARRAY<Point<3> > & points);
35
ARRAY<Point<3> > points;
41
virtual ~Polyhedra ();
42
static Primitive * CreateDefault ();
44
virtual INSOLID_TYPE BoxInSolid (const BoxSphere<3> & box) const;
45
virtual INSOLID_TYPE PointInSolid (const Point<3> & p,
47
virtual INSOLID_TYPE VecInSolid (const Point<3> & p,
51
// checks if lim s->0 lim t->0 p + t(v1 + s v2) in solid
52
virtual INSOLID_TYPE VecInSolid2 (const Point<3> & p,
57
virtual int GetNSurfaces() const
58
{ return planes.Size(); }
59
virtual Surface & GetSurface (int i)
60
{ return *planes[i]; }
61
virtual const Surface & GetSurface (int i) const
62
{ return *planes[i]; }
64
virtual void GetPrimitiveData (char *& classname, ARRAY<double> & coeffs) const;
65
virtual void SetPrimitiveData (ARRAY<double> & coeffs);
67
virtual void Reduce (const BoxSphere<3> & box);
68
virtual void UnReduce ();
70
int AddPoint (const Point<3> & p);
71
int AddFace (int pi1, int pi2, int pi3);
74
int FaceBoxIntersection (int fnr, const BoxSphere<3> & box) const;