Overture  Version 25
ReparameterizationTransform.h
Go to the documentation of this file.
1 #ifndef REPARAMETERIZATION_TRANSFORM
2 #define REPARAMETERIZATION_TRANSFORM
3 
4 #include "ComposeMapping.h"
5 
7 
9 {
10 //----------------------------------------------------------------
11 // Reparameterize a Mapping in various ways
12 // ----------------------------------------
13 //
14 //----------------------------------------------------------------
15  public:
16 
18  {
24  };
25 
26 
27  public:
28 
30  //
31  // Constructor, supply a Mapping to reparameterize
32  // It will replace multiple reparams with just one reparam if map is actually of this class
35 
36  // Copy constructor is deep by default
38 
39  // Copy like constructor that makes a deep copy of all but the transformed grid which is replaced
41 
43 
45 
46  // set equidistribution parameterization parameters
48  const real & curvatureWeight=0.,
49  const int & numberOfSmooths = 3 );
50 
53 
56 
59 
60  void mapS( const RealArray & r, RealArray & x, RealArray &xr = Overture::nullRealArray(),
62 
63  void inverseMapS( const RealArray & x, RealArray & r, RealArray & rx = Overture::nullRealArray(),
65 
66  void basicInverseS(const RealArray & x,
67  RealArray & r,
70 
71 
72  virtual int get( const GenericDataBase & dir, const aString & name); // get from a database file
73  virtual int put( GenericDataBase & dir, const aString & name) const; // put to a database file
74 
76 
78 
80 
81  int update( MappingInformation & mapInfo ) ;
82 
83  // scale the current bounds for a restriction mapping
84  int scaleBounds(const real ra=0.,
85  const real rb=1.,
86  const real sa=0.,
87  const real sb=1.,
88  const real ta=0.,
89  const real tb=1. );
90  // set absolute bounds for a restriction mapping
91  int setBounds(const real ra=0.,
92  const real rb=1.,
93  const real sa=0.,
94  const real sb=1.,
95  const real ta=0.,
96  const real tb=1. );
97 
98  int getBounds(real & ra, real & rb, real & sa, real & sb, real & ta, real & tb ) const;
99 
100  int getBoundsForMultipleReparameterizations(real & ra, real & rb, real & sa, real & sb, real & ta, real & tb ) const;
101 
102  int getBoundsForMultipleReparameterizations( real mrBounds[6] ) const;
104 
105  virtual RealArray getBoundingBox( const int & side=-1, const int & axis=-1 ) const;
106  virtual int getBoundingBox( const IntegerArray & indexRange, const IntegerArray & gridIndexRange,
107  RealArray & xBounds, bool local=false ) const;
108  virtual int getBoundingBox( const RealArray & rBounds, RealArray & xBounds ) const;
109 
110  enum
111  {
113  };
114 
115 
116 
117 protected:
118  void constructor(Mapping & map, const ReparameterizationTypes type);
120  void setMappingProperties(Mapping *mapPointer);
121 
122  int initializeEquidistribution(const bool & useOriginalMapping = TRUE);
123 
124 protected:
126  Mapping *reparameterize; // points to either orthographic or restriction or Reorient
127 public:
128  // needed so we can invert in a different coordinate system:
129  // (make public so we can delete in initStaticMappingVariables)
131 protected:
138  real mr[6]; // for multiple compositions of restriction mappings -- keep scaling to original
139 
140 private:
141 
142  //
143  // Virtual member functions used only through class ReferenceCounting:
144  //
146  { return operator=((ReparameterizationTransform &)x); }
147  virtual void reference( const ReferenceCounting& x)
148  { reference((ReparameterizationTransform &)x); }
149  virtual ReferenceCounting* virtualConstructor( const CopyType ct = DEEP ) const
150  { return ::new ReparameterizationTransform(*this, ct); }
151  };
152 
153 
154 #endif