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

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