Overture  Version 25
RevolutionMapping.h
Go to the documentation of this file.
1 #ifndef REVOLUTION_MAPPING_H
2 #define REVOLUTION_MAPPING_H
3 
4 #include "Mapping.h"
5 
6 //-------------------------------------------------------------
7 // Define a Mapping by revolving another mapping about a line
8 //-------------------------------------------------------------
9 class RevolutionMapping : public Mapping
10 {
11 
12 public:
13 
15  //
16  // This constructor takes a mapping to revolve plus option parameters
17  //
18  RevolutionMapping(Mapping & revolutionary,
19  const real startAngle=0.,
20  const real endAngle=1.,
21  const RealArray & lineOrigin=Overture::nullRealArray(),
22  const RealArray & lineTangent=Overture::nullRealArray()
23  );
24 
25  // Copy constructor is deep by default
26  RevolutionMapping( const RevolutionMapping &, const CopyType copyType=DEEP );
27 
29 
33 
36 
37  virtual void mapS( const RealArray & r, RealArray & x, RealArray &xr = Overture::nullRealArray(),
39 
40  virtual void basicInverseS(const RealArray & x,
41  RealArray & r,
44 
45  virtual int get( const GenericDataBase & dir, const aString & name); // get from a database file
46  virtual int put( GenericDataBase & dir, const aString & name) const; // put to a database file
47 
48  int setLineOfRevolution(const RealArray & lineOrigin,
49  const RealArray & lineTangent );
50  int setParameterAxes( const int & revAxis1, const int & revAxis2, const int & revAxis3 );
51  int setRevolutionary(Mapping & revolutionary );
52  int setRevolutionAngle( const real startAngle=0., const real endAngle=1. );
53  int getRevolutionAngle( real & startAngle_, real & endAngle_ );
54 
55  void setBounds();
56 
58  aString getClassName() const { return RevolutionMapping::className; }
59 
60  int update( MappingInformation & mapInfo ) ;
61 
62 private:
63  aString className;
64  Mapping *revolutionary; // here is the mapping that we revolve
65  real startAngle,endAngle; // revolve between these angles
66  RealArray lineOrigin; // revolve about a line that passes through this point
67  RealArray lineTangent; // revolve about a line with this as tangent
68  real signForTangent;
69  int revAxis1,revAxis2,revAxis3; // axes used, a permutation of (0,1,2)
70  bool uninitialized;
71 
72  void initialize();
73 
74  private:
75 
76  //
77  // Virtual member functions used only through class ReferenceCounting:
78  //
80  { return operator=((RevolutionMapping &)x); }
81  virtual void reference( const ReferenceCounting& x)
82  { reference((RevolutionMapping &)x); } // *** Conversion to this class for the virtual = ****
83  virtual ReferenceCounting* virtualConstructor( const CopyType copyType = DEEP ) const
84  { return ::new RevolutionMapping(*this, copyType); }
85 
86 };
87 
88 
89 #endif