Overture  Version 25
DepthMapping.h
Go to the documentation of this file.
1 #ifndef DEPTH_MAPPING_H
2 #define DEPTH_MAPPING_H
3 
4 #include "Mapping.h"
5 
6 //-------------------------------------------------------------
7 // Define a 3D Mapping from 2D Mapping by extending in
8 // the z-direction by a variable amount
9 //-------------------------------------------------------------
10 class DepthMapping : public Mapping
11 {
12 
13 public:
14 
16  {
20  };
21 
22  DepthMapping();
23  // Copy constructor is deep by default
24  DepthMapping( const DepthMapping &, const CopyType copyType=DEEP );
25 
26  ~DepthMapping();
27 
28  DepthMapping & operator =( const DepthMapping & X0 );
29 
31  int setDepthFunctionParameters( real a0, real b0, real a1, real b1 );
32  int setSurface( Mapping & surface );
33  int setQuadraticParameters(const real & a00,
34  const real & a10,
35  const real & a01,
36  const real & a20,
37  const real & a11,
38  const real & a02);
39 
42 
43  virtual int get( const GenericDataBase & dir, const aString & name); // get from a database file
44  virtual int put( GenericDataBase & dir, const aString & name) const; // put to a database file
45 
48 
49  int update( MappingInformation & mapInfo ) ;
50 
51  protected:
53  Mapping *surface; // this is a 2D grid for the surface
54  Mapping *depth; // This mapping may define a depth, z=depth(x,y)
55 
57 
58  real zSurface; // z level for the surface
59  real zDepth; // depth (if constant)
60  real a00,a10,a01,a20,a11,a02; // quadratic depth parameters
61  real depthPar[4]; // scale factors from x to r for the depthFunction
62 
63  int initialize();
64 
65  private:
66 
67  //
68  // Virtual member functions used only through class ReferenceCounting:
69  //
71  { return operator=((DepthMapping &)x); }
72  virtual void reference( const ReferenceCounting& x)
73  { reference((DepthMapping &)x); } // *** Conversion to this class for the virtual = ****
74  virtual ReferenceCounting* virtualConstructor( const CopyType ct = DEEP ) const
75  { return ::new DepthMapping(*this, ct); }
76 
77 };
78 
79 
80 #endif