Overture  Version 25
BoxMapping.h
Go to the documentation of this file.
1 #ifndef BOX_MAPPING
2 #define BOX_MAPPING
3 
4 #include "Mapping.h"
5 
6 class BoxMapping : public Mapping{
7 //-------------------------------------------------------------
8 // Here is a derived class to define a rectangular box in 3D
9 // Parameters:
10 // (xmin,xmax) : minimum and maximum values for x(xAxis)
11 // (ymin,ymax) : minimum and maximum values for x(yAxis)
12 // (zmin,zmax) : minimum and maximum values for x(zAxis)
13 //-------------------------------------------------------------
14  public:
15 
16  BoxMapping(const real xMin=0., const real xMax=1.,
17  const real yMin=0., const real yMax=1.,
18  const real zMin=0., const real zMax=1.);
19 
20 
21  // Copy constructor is deep by default
22  BoxMapping( const BoxMapping &, const CopyType copyType=DEEP );
23 
24  ~BoxMapping();
25 
26  BoxMapping & operator =( const BoxMapping & X );
27 
28  int rotate(const real angle,
29  const int axisOfRotation = 2 ,
30  const real x0 = 0.,
31  const real y0 = 0.,
32  const real z0 = 0. );
33 
34  int setVertices(const real & xMin=0., const real & xMax=1.,
35  const real & yMin=0., const real & yMax=1.,
36  const real & zMin=0., const real & zMax=1.);
37 
38  int getVertices(real & xMin, real & xMax, real & yMin, real & yMax, real & zMin, real & zMax ) const;
39 
40  virtual int get( const GenericDataBase & dir, const aString & name); // get from a database file
41  virtual int put( GenericDataBase & dir, const aString & name) const; // put to a database file
42 
44 
46 
49 
52 
53  virtual void mapS( const RealArray & r, RealArray & x, RealArray &xr = Overture::nullRealArray(),
55 
56  virtual void basicInverseS(const RealArray & x,
57  RealArray & r,
60 
61  int update( MappingInformation & mapInfo ) ;
62 
63  virtual RealArray getBoundingBox( const int & side=-1, const int & axis=-1 ) const;
64  virtual int getBoundingBox( const IntegerArray & indexRange, const IntegerArray & gridIndexRange,
65  RealArray & xBounds, bool local=false ) const;
66 
67  virtual int getBoundingBox( const RealArray & rBounds, RealArray & xBounds ) const;
68 
69  protected:
71  real xa[3],xb[3];
74 
75  private:
76 
77  //
78  // Virtual member functions used only through class ReferenceCounting:
79  //
81  { return operator=((BoxMapping &)x); }
82  virtual void reference( const ReferenceCounting& x)
83  { reference((BoxMapping &)x); } // *** Conversion to this class for the virtual = ****
84  virtual ReferenceCounting* virtualConstructor( const CopyType ct = DEEP ) const
85  { return ::new BoxMapping(*this, ct); }
86 };
87 
88 #endif