OpendTect-6_4  6.4
polygonsurface.h
Go to the documentation of this file.
1 #ifndef polygonsurface_h
2 #define polygonsurface_h
3 
4 /*+
5 ________________________________________________________________________
6 (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
7 Author: Y.C. Liu
8 Date: July 2008
9 RCS: $Id$
10 ________________________________________________________________________
11 
12 -*/
13 
14 #include "geometrymod.h"
15 #include "refcount.h"
16 #include "rowcolsurface.h"
17 
18 namespace Geometry
19 {
20 /*<!Simple geometry for polygonsurface, for polygon plane, only three
21  directions are defined, i.e. along XY, XZ or YZ planes. So normals are
22  given by Coord3(0,0,1), Coord3(0,1,0) and Coord3(1,0,0) respectively.
23  For Rcol variable rc, rc.r() represents polygonidx, rc.c() represents the
24  knots on the corresponding polygon. */
25 
27 {
28 public:
30  ~PolygonSurface();
31  bool isEmpty() const { return !polygons_.size(); }
32  Element* clone() const;
33  enum ChangeTag {PolygonChange=__mUndefIntVal+1,PolygonInsert,
34  PolygonRemove};
35 
36  bool insertPolygon(const Coord3& firstpos,
37  const Coord3& normal,int polygon=0,
38  int firstknot=0);
39  bool removePolygon(int polygon);
40 
41  bool insertKnot(const RowCol&,const Coord3&);
42  bool removeKnot(const RowCol&);
43 
44  int nrPolygons() const { return polygons_.size(); }
45  StepInterval<int> rowRange() const;
46  virtual StepInterval<int> colRange() const
47  { return RowColSurface::colRange(); }
48  StepInterval<int> colRange(int polygon) const;
49 
50  bool setKnot(const RowCol&,const Coord3&);
51  Coord3 getKnot(const RowCol&) const;
52  bool isKnotDefined(const RowCol&) const;
53 
54  void setBezierCurveSmoothness(int nrpoints_on_segment);
55  int getBezierCurveSmoothness() const {return beziernrpts_;}
56  void getCubicBezierCurve(int plg,TypeSet<Coord3>& pts,
57  const float zscale) const;
58  /*<The Bezier Curve smoothes the polygon, nrknotsinsert
59  on each edge will affect the smoothness. */
60  void getAllKnots(TypeSet<Coord3>&) const;
61  /*<Only get all the picked positions on the surface. */
62 
63  const Coord3& getPolygonNormal(int polygonnr) const;
64  const Coord3& getPolygonConcaveDir(int polygonnr) const;
65 
66  void getExceptionEdges(int plg,TypeSet<int>& edges) const;
67  void getPolygonConcaveTriangles(int plg,TypeSet<int>&) const;
68  /*<the TypeSet has all the triangles which are concave
69  relative to the polygon. ret v0, v1, v2 the 1st
70  triangle; v3, v4, v5 the 2nd. */
71 
72  void addUdfPolygon(int polygnr,int firstknotnr,int nrknots);
73  void addEditPlaneNormal(const Coord3& normal);
74 
75  char bodyDimension() const;
76  /*<Return dim==3, it is a real body, otherwise,
77  dim==2 a surface, dim==1 a line, dim==0 a point.*/
78 
79 protected:
80 
81  bool linesegmentsIntersecting(const Coord3& v0,
82  const Coord3& v1,const Coord3& p0,
83  const Coord3& p1) const;
84  bool includesEdge(const TypeSet<int> edges,
85  int v0,int v1) const;
89  /*<assume each polygon is made by connecting
90  the pts in order. */
94 };
95 
96 };
97 
98 #endif
#define mExpClass(module)
Definition: commondefs.h:160
ChangeTag
Definition: polygonsurface.h:33
int beziernrpts_
Definition: polygonsurface.h:93
virtual StepInterval< int > colRange() const
ObjectSet< TypeSet< Coord3 > > polygons_
Definition: polygonsurface.h:88
TypeSet< Coord3 > polygonnormals_
Definition: polygonsurface.h:91
int nrPolygons() const
Definition: polygonsurface.h:44
Set of pointers to objects.
Definition: commontypes.h:32
#define __mUndefIntVal
Almost MAXINT so unlikely, but not MAXINT to avoid that.
Definition: undefval.h:25
Definition: rowcolsurface.h:26
int firstpolygon_
Definition: polygonsurface.h:86
A cartesian coordinate in 3D space.
Definition: coord.h:72
Definition: geomelement.h:37
IdxPair used for its row() and col().
Definition: rowcol.h:25
Definition: polygonsurface.h:33
virtual StepInterval< int > colRange() const
Definition: polygonsurface.h:46
TypeSet< Coord3 > concavedirs_
Definition: polygonsurface.h:92
bool isEmpty() const
Definition: polygonsurface.h:31
Definition: polygonsurface.h:26
int getBezierCurveSmoothness() const
Definition: polygonsurface.h:55
Definition: arraytesselator.h:21
TypeSet< int > firstknots_
Definition: polygonsurface.h:87

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