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

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