OpendTect-6_4  6.4
cubicbeziersurface.h
Go to the documentation of this file.
1 #ifndef cubicbeziersurface_h
2 #define cubicbeziersurface_h
3 
4 /*+
5 ________________________________________________________________________
6 (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
7 Author: K. Tingdahl
8 Date: December 2004
9 RCS: $Id$
10 ________________________________________________________________________
11 
12 -*/
13 
14 #include "geometrymod.h"
15 #include "parametricsurface.h"
16 
17 class Line3;
18 template <class T> class Array2D;
19 
20 namespace Geometry
21 {
22 
24 { mODTextTranslationClass(CubicBezierSurfacePatch);
25 public:
26  CubicBezierSurfacePatch(
27  const Coord3& p00, const Coord3& p01,
28  const Coord3& p02, const Coord3& p03,
29  const Coord3& p10, const Coord3& p11,
30  const Coord3& p12, const Coord3& p13,
31  const Coord3& p20, const Coord3& p21,
32  const Coord3& p22, const Coord3& p23,
33  const Coord3& p30, const Coord3& p31,
34  const Coord3& p32, const Coord3& p33 );
35 
36  CubicBezierSurfacePatch* clone() const;
37 
38  Coord3 computePos(float u,float v) const;
39  Coord3 computeNormal(float u, float v) const;
40  Coord3 computeUTangent(float u, float v) const;
41  Coord3 computeVTangent(float u, float v) const;
42 
43  bool intersectWithLine( const Line3& line,
44  float& u, float& v, float eps ) const;
45 
46  IntervalND<float> computeBoundingBox() const;
47 
48  Coord3 pos[16];
49  static int nrPos() { return 16; }
50 };
51 
52 
53 
56 public:
57  CubicBezierSurface( const RowCol& step=RowCol(1,1));
60 
61  CubicBezierSurface* clone() const;
62  bool isEmpty() const { return !positions; }
63 
64  IntervalND<float> boundingBox(bool approx) const;
65 
66  Coord3 computePosition(const Coord&) const;
67  Coord3 computeNormal(const Coord&) const;
68 
69  bool intersectWithLine(const Line3&,Coord&) const;
70 
71  Coord3 getBezierVertex(const RowCol& knot,const RowCol& relpos) const;
72 
73  bool insertRow(int row,int nrnew=1);
74  bool insertCol(int col,int nrnew=1);
75  bool removeRow(int row,int stoprow=-1);
76  bool removeCol(int col,int stopcol=-1);
77  virtual Coord3 getKnot( const RowCol& rc ) const
78  { return getKnot(rc,false); }
79  Coord3 getKnot(const RowCol&,bool estimateifundef) const;
80 
81  Coord3 getRowDirection(const RowCol&,bool computeifudf) const;
82  Coord3 getColDirection(const RowCol&,bool computeifudf) const;
83  float directionInfluence() const;
84  void setDirectionInfluence(float);
85 
86  const CubicBezierSurfacePatch* getPatch(const RowCol&) const;
87  ParametricCurve* createRowCurve( float row,
88  const Interval<int>* colrange=0 ) const;
89  ParametricCurve* createColCurve(float col,
90  const Interval<int>* rowrange=0 ) const;
91 
92 protected:
93 
94  bool checkSelfIntersection( const RowCol& ) const;
95 
96  IntervalND<float> boundingBox(const RowCol&, bool ownvertices ) const;
97 
98  Coord3 computeRowDirection(const RowCol&) const;
99  Coord3 computeColDirection(const RowCol&) const;
100 
101  void _setKnot( int idx, const Coord3& );
102 
103  int nrRows() const;
104  int nrCols() const;
105 
109 
111 };
112 
113 };
114 
115 #endif
#define mExpClass(module)
Definition: commondefs.h:160
Definition: cubicbeziersurface.h:54
A curve that is defined by regularly sampled positions.
Definition: parametriccurve.h:32
#define mODTextTranslationClass(clss)
Definition: uistring.h:38
Array2D< Coord3 > * coldirections
Definition: cubicbeziersurface.h:107
Definition: parametricsurface.h:23
A cartesian coordinate in 2D space.
Definition: coord.h:25
A Line3 is a line in space, with the following equations:
Definition: trigonometry.h:441
bool isEmpty() const
Definition: cubicbeziersurface.h:62
Array2D< Coord3 > * positions
Definition: cubicbeziersurface.h:108
Array2D ( Subclass of ArrayND ) is a two dimensional array.
Definition: arraynd.h:131
Class to store ranges in N dimensions.
Definition: ranges.h:209
virtual Coord3 getKnot(const RowCol &rc) const
Definition: cubicbeziersurface.h:77
A cartesian coordinate in 3D space.
Definition: coord.h:72
IdxPair used for its row() and col().
Definition: rowcol.h:25
Array2D< Coord3 > * rowdirections
Definition: cubicbeziersurface.h:106
float directioninfluence
Definition: cubicbeziersurface.h:110
Definition: arraytesselator.h:21
Definition: cubicbeziersurface.h:23
static int nrPos()
Definition: cubicbeziersurface.h:49

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2019