Overture  Version 25
IntersectionMapping.h
Go to the documentation of this file.
1 #ifndef INTERSECTION_MAPPING_H
2 #define INTERSECTION_MAPPING_H
3 
4 #include "Mapping.h"
6 
8 
9 //-------------------------------------------------------------
10 // Define a Mapping by the intersection of two other mappings
11 //-------------------------------------------------------------
13 {
14 private:
15  aString className;
16 
17  Mapping *map1,*map2; // pointers to Mapping's that are intersected
18 
19 
20 public:
21 
22  Mapping *rCurve1, *rCurve2, *curve; // intersection curve, three representations
23 
24 
26 
28  Mapping & map2 );
29 
30  // IntersectionMapping(Mapping & surface, const real & TFIDistance=0. );
31 
32  // Copy constructor is deep by default
33  IntersectionMapping( const IntersectionMapping &, const CopyType copyType=DEEP );
34 
36 
38 
39  int intersect(Mapping & map1,
40  Mapping & map2,
43 
46 
47  virtual int project( realArray & x, // project points onto the curve of intersection
48  int & iStart,
49  int & iEnd,
50  periodicType period);
51  virtual int project( realArray & x,
52  MappingProjectionParameters & mpParams ){ return Mapping::project(x,mpParams); }
53 
54  virtual int reparameterize(const real & arcLengthWeight=1., // reparameterize by arc-length and curvature
55  const real & curvatureWeight=.5 );
56 
57  // intersect two curves in 2D
58  int intersectCurves(Mapping & map1, Mapping & map2,
59  int & numberOfIntersectionPoints,
60  realArray & r1,
61  realArray & r2,
62  realArray & x );
63 
64  virtual int get( const GenericDataBase & dir, const aString & name); // get from a database file
65  virtual int put( GenericDataBase & dir, const aString & name) const; // put to a database file
66 
68  aString getClassName() const { return IntersectionMapping::className; }
69 
70  int update( MappingInformation & mapInfo ) ;
71 
72  protected:
75 
76  int newtonIntersection(realArray & x, realArray & r1, realArray & r2, const realArray & n );
77 
78  BoundingBox* createBoundingBox( BoundingBox & child1, BoundingBox & child2 ) ;
79  void destroyBoundingBox( BoundingBox & box );
80  void reOrder(realArray & x, int & iStart, int & iEnd, periodicType & periodic,
81  periodicType curveIsPeriodic[2], real epsX);
82  void reduce(realArray & x, int & iStart, int & iEnd);
83 
87 
88  private:
89 
90 
91  //
92  // Virtual member functions used only through class ReferenceCounting:
93  //
95  { return operator=((IntersectionMapping &)x); }
96  virtual void reference( const ReferenceCounting& x)
97  { reference((IntersectionMapping &)x); } // *** Conversion to this class for the virtual = ****
98  virtual ReferenceCounting* virtualConstructor( const CopyType ct = DEEP ) const
99  { return ::new IntersectionMapping(*this, ct); }
100 
101 };
102 
103 
104 #endif