~ubuntu-branches/debian/squeeze/gmsh/squeeze

« back to all changes in this revision

Viewing changes to contrib/Netgen/libsrc/csg/brick.hpp

  • Committer: Bazaar Package Importer
  • Author(s): Christophe Prud'homme
  • Date: 2009-01-07 16:02:08 UTC
  • mfrom: (5.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20090107160208-vklhtj69br5yw5bh
Tags: 2.2.6.dfsg-2
* debian/control: fixed lintian warning "debhelper-but-no-misc-depends"
* debian/watch: fixed lintian warning
  "debian-watch-file-should-mangle-version"

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#ifndef FILE_BRICK
2
 
#define FILE_BRICK
3
 
 
4
 
 
5
 
/**************************************************************************/
6
 
/* File:   brick.hh                                                       */
7
 
/* Author: Joachim Schoeberl                                              */
8
 
/* Date:   11. Mar. 98                                                    */
9
 
/**************************************************************************/
10
 
 
11
 
/*
12
 
 
13
 
  brick geometry, has several surfaces
14
 
  
15
 
*/
16
 
 
17
 
 
18
 
 
19
 
class Parallelogram3d : public Surface
20
 
{
21
 
  Point<3> p1, p2, p3, p4;
22
 
  Vec<3> v12, v13;
23
 
  Vec<3> n;
24
 
 
25
 
public:
26
 
  Parallelogram3d (Point<3> ap1, Point<3> ap2, Point<3> ap3);
27
 
  virtual ~Parallelogram3d ();
28
 
  void SetPoints (Point<3> ap1, Point<3> ap2, Point<3> ap3);
29
 
 
30
 
  virtual int IsIdentic (const Surface & s2, int & inv, double eps) const; 
31
 
 
32
 
  virtual double CalcFunctionValue (const Point<3> & point) const;
33
 
  virtual void CalcGradient (const Point<3> & point, Vec<3> & grad) const;
34
 
  virtual void CalcHesse (const Point<3> & point, Mat<3> & hesse) const;
35
 
  virtual double HesseNorm () const;
36
 
 
37
 
  virtual Point<3> GetSurfacePoint () const;
38
 
  virtual void Print (ostream & str) const;
39
 
  
40
 
  virtual void GetTriangleApproximation (TriangleApproximation & tas, 
41
 
                                         const Box<3> & boundingbox, 
42
 
                                         double facets) const;
43
 
 
44
 
protected:
45
 
  void CalcData();
46
 
};
47
 
 
48
 
 
49
 
class Brick : public Primitive
50
 
{
51
 
  Point<3> p1, p2, p3, p4;
52
 
  Vec<3> v12, v13, v14;
53
 
  ARRAY<OneSurfacePrimitive*> faces;
54
 
 
55
 
public:
56
 
  Brick (Point<3> ap1, Point<3> ap2, Point<3> ap3, Point<3> ap4);
57
 
  virtual ~Brick ();
58
 
  static Primitive * CreateDefault ();
59
 
 
60
 
 
61
 
  virtual INSOLID_TYPE BoxInSolid (const BoxSphere<3> & box) const;
62
 
  virtual INSOLID_TYPE PointInSolid (const Point<3> & p,
63
 
                                     double eps) const;
64
 
  virtual INSOLID_TYPE VecInSolid (const Point<3> & p,
65
 
                                   const Vec<3> & v,
66
 
                                   double eps) const;
67
 
 
68
 
  virtual int GetNSurfaces() const 
69
 
    { return 6; }
70
 
  virtual Surface & GetSurface (int i) 
71
 
    { return *faces[i]; }
72
 
  virtual const Surface & GetSurface (int i) const
73
 
    { return *faces[i]; }
74
 
 
75
 
 
76
 
  virtual void GetPrimitiveData (char *& classname, ARRAY<double> & coeffs) const;
77
 
  virtual void SetPrimitiveData (ARRAY<double> & coeffs);
78
 
 
79
 
  virtual void Reduce (const BoxSphere<3> & box);
80
 
  virtual void UnReduce ();
81
 
 
82
 
protected:
83
 
  void CalcData();
84
 
};
85
 
 
86
 
 
87
 
class OrthoBrick : public Brick 
88
 
{
89
 
protected:
90
 
  Point<3> pmin, pmax;
91
 
public:
92
 
  OrthoBrick (const Point<3> & ap1, const Point<3> & ap2);
93
 
  
94
 
  virtual INSOLID_TYPE BoxInSolid (const BoxSphere<3> & box) const;
95
 
  virtual void Reduce (const BoxSphere<3> & box);
96
 
};
97
 
 
98
 
#endif