Overture  Version 25
SphereMapping.h
Go to the documentation of this file.
1 #ifndef SPHERE_MAPPING_H
2 #define SPHERE_MAPPING_H
3 
4 #include "Mapping.h"
5 
6 //-------------------------------------------------------------
7 // Define a sphere in polar coordinates
8 //
9 // map (r1,r2,r3) = (phi/Pi, theta/twoPi, r ) -> (x,y,z)
10 //-------------------------------------------------------------
11 class SphereMapping : public Mapping
12 {
13 private:
14  aString className;
15  real x0,y0,z0,innerRadius,outerRadius,startTheta,endTheta,startPhi,endPhi;
16 
17 public:
18 
19 SphereMapping(const real & innerRadius=.5,
20  const real & outerRadius=1.,
21  const real & x0=0.,
22  const real & y0=0.,
23  const real & z0=0.,
24  const real & startTheta=0., // initial value for "theta", in [0,1]
25  const real & endTheta=1., // final value for "theta", in [0,1]
26  const real & startPhi=0., // initial value for "phi", in [0,1]
27  const real & endPhi=1. // final value for "phi", in [0,1]
28  );
29 
30 
31  // Copy constructor is deep by default
32  SphereMapping( const SphereMapping &, const CopyType copyType=DEEP );
33 
35 
37 
38  int setOrigin(const real & x0_ =.0,
39  const real & y0_ =.0,
40  const real & z0_ =.0);
41  int setPhi(const real & startPhi_ =.0,
42  const real & endPhi_ = 1.);
43 
44  int setRadii(const real & innerRadius_ =.5,
45  const real & outerRadius_ =1.);
46 
47  int setTheta( const real & startTheta_ =.0,
48  const real & endTheta_ =1. );
49 
52 
55 
56  virtual void mapS( const RealArray & r, RealArray & x, RealArray &xr = Overture::nullRealArray(),
58 
59  virtual void basicInverseS(const RealArray & x,
60  RealArray & r,
63 
64  int outside( const realArray & x ); // false means no or don't no
65 
66  virtual int get( const GenericDataBase & dir, const aString & name); // get from a database file
67  virtual int put( GenericDataBase & dir, const aString & name) const; // put to a database file
68 
70  aString getClassName() const { return SphereMapping::className; }
71 
72  int update( MappingInformation & mapInfo );
73 
74  private:
75 
76  //
77  // Virtual member functions used only through class ReferenceCounting:
78  //
80  { return operator=((SphereMapping &)x); }
81  virtual void reference( const ReferenceCounting& x)
82  { reference((SphereMapping &)x); } // *** Conversion to this class for the virtual = ****
83  virtual ReferenceCounting* virtualConstructor( const CopyType ct = DEEP ) const
84  { return ::new SphereMapping(*this, ct); }
85 };
86 
87 
88 #endif // SPHERE_H