Overture  Version 25
SmoothedPolygon.h
Go to the documentation of this file.
1 #ifndef SMOOTHEDPOLYGON_H
2 #define SMOOTHEDPOLYGON_H "SmoothedPolygon.h"
3 
4 #include "MappingRC.h"
5 
6 //-------------------------------------------------------------
7 // Here is a derived class to define a SmoothedPolygon in 2D
8 //-------------------------------------------------------------
9 
10 class SmoothedPolygon : public Mapping
11 {
12 
13 public:
14 
16 
17 // Copy constructor is deep by default
18 SmoothedPolygon( const SmoothedPolygon &, const CopyType copyType=DEEP );
19 
21 
22 int update( MappingInformation & mapInfo );
23 
25 
28 
29 virtual void mapS( const RealArray & r, RealArray & x, RealArray &xr = Overture::nullRealArray(),
31 
32 virtual int get( const GenericDataBase & dir, const aString & name); // get from a database file
33 virtual int put( GenericDataBase & dir, const aString & name) const; // put to a database file
34 
36 aString getClassName() const { return SmoothedPolygon::className; }
37 
38 // Define the verticies and other properties of the smooth polygon
39 int setPolygon( const RealArray & xv,
40  const RealArray & sharpness = Overture::nullRealArray(),
41  const real normalDist = 0. ,
42  const RealArray & variableNormalDist = Overture::nullRealArray(),
43  const RealArray & tStretch = Overture::nullRealArray(),
44  const RealArray & rStretch = Overture::nullRealArray(),
45  const bool correctForCorners = false );
46 
47 protected:
48 
49 void setDefaultValues();
50 void initialize();
51 void assignAdoptions();
52 
54 
55 private:
56 
57  //
58  // Virtual member functions used only through class ReferenceCounting:
59  //
61  { return operator=((SmoothedPolygon &)x); }
62  virtual void reference( const ReferenceCounting& x)
63  { reference((SmoothedPolygon &)x); } // *** Conversion to this class for the virtual = ****
64  virtual ReferenceCounting* virtualConstructor( const CopyType ct = DEEP ) const
65  { return ::new SmoothedPolygon(*this, ct); }
66 
67 aString className;
68 bool mappingIsDefined;
69 
70 // *** we should clean up all the extra arrays in this class ***
71 
72 int numberOfVertices;
73 RealArray vertex,arclength;
74 int NumberOfRStretch;
75 int userStretchedInT,correctCorners;
76 RealArray bv,sab,r12b,sr,corner;
77 int numberOfRStretch;
78 real normalDistance;
79 real zLevel;
80 real splineResolutionFactor; // default 5. : numberOfSplinePoints=splineResolutionFactor*numberOfGridsPoints
81 
82 int ndiwk,ndrwk;
83 IntegerArray iwk;
84 RealArray rwk;
85 
86 // no need to save the following:
87 IntegerArray iw;
88 RealArray w;
89 int ndi;
90 int ndr;
91 int nsm1;
92 RealArray bx, by, ccor;
93 
94 };
95 
96 
97 #endif // SMOOTHEDPOLYGON_H