Overture  Version 25
NormalMapping.h
Go to the documentation of this file.
1 #ifndef NORMAL_MAPPING_H
2 #define NORMAL_MAPPING_H
3 
4 #include "Mapping.h"
5 
6 //-------------------------------------------------------------
7 // Define a Mapping by extending normals from another Mapping
8 //-------------------------------------------------------------
9 class NormalMapping : public Mapping
10 {
11 private:
12  aString className;
13  Mapping *surface; // here is the surface that we extend normals from
14  real normalDistance;
15 
16 public:
17 
18  NormalMapping();
19  NormalMapping(Mapping & surface, const real & normalDistance=.5 );
20 
21  // Copy constructor is deep by default
22  NormalMapping( const NormalMapping &, const CopyType copyType=DEEP );
23 
25 
27 
28  void setReferenceSurface( Mapping & surface );
29  void setNormalDistance( real distance );
30 
33 
34  void mapS( const RealArray & r, RealArray & x, RealArray &xr = Overture::nullRealArray(),
36 
37  virtual int get( const GenericDataBase & dir, const aString & name); // get from a database file
38  virtual int put( GenericDataBase & dir, const aString & name) const; // put to a database file
39 
41  aString getClassName() const { return NormalMapping::className; }
42 
43  int update( MappingInformation & mapInfo ) ;
44 
45  protected:
46 
47  void initialize();
48 
49  private:
50 
51  //
52  // Virtual member functions used only through class ReferenceCounting:
53  //
55  { return operator=((NormalMapping &)x); }
56  virtual void reference( const ReferenceCounting& x)
57  { reference((NormalMapping &)x); } // *** Conversion to this class for the virtual = ****
58  virtual ReferenceCounting* virtualConstructor( const CopyType ct = DEEP ) const
59  { return ::new NormalMapping(*this, ct); }
60 
61 };
62 
63 
64 #endif