Fade2.5D Documentation pages v2.15
Delaunay Features
IsoContours.h
Go to the documentation of this file.
1 // Copyright (C) Geom Software e.U, Bernhard Kornberger, Graz/Austria
2 //
3 // This file is part of the Fade2D library. The student license is free
4 // of charge and covers personal non-commercial research. Licensees
5 // holding a commercial license may use this file in accordance with
6 // the Commercial License Agreement.
7 //
8 // This software is provided AS IS with NO WARRANTY OF ANY KIND,
9 // INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS
10 // FOR A PARTICULAR PURPOSE.
11 //
12 // Please contact the author if any conditions of this licensing are
13 // not clear to you.
14 //
15 // Author: Bernhard Kornberger, bkorn (at) geom.at
16 // http://www.geom.at
17 
19 #pragma once
20 #if GEOM_PSEUDO3D==GEOM_TRUE
21 
22 #include "Segment2.h"
23 #include <map>
24 
25 #include "common.h"
26 #if GEOM_PSEUDO3D==GEOM_TRUE
27  namespace GEOM_FADE25D {
28 #elif GEOM_PSEUDO3D==GEOM_FALSE
29  namespace GEOM_FADE2D {
30 #else
31  #error GEOM_PSEUDO3D is not defined
32 #endif
33 
34 
35 struct TriNode; // FWD
36 class Triangle2; // FWD
37 class GeomTest; // FWD
38 class Segment2; // FWD
39 class Func_Rot3D; // FWD
40 
42 typedef std::multimap<Point2,Segment2*> MMPS;
44 typedef MMPS::iterator MMPSIt;
45 
52 {
53 
54 public:
55 
56  CLASS_DECLSPEC
57  explicit IsoContours(std::vector<Triangle2*>& vTriangles);
58 
67  CLASS_DECLSPEC
68  IsoContours(std::vector<Point2>& vCorners,const Vector2& dirVec);
69 
70  CLASS_DECLSPEC
71  ~IsoContours();
76  CLASS_DECLSPEC
77  double getMinHeight();
82  CLASS_DECLSPEC
83  double getMaxHeight();
99  CLASS_DECLSPEC
100  bool getContours(double height,std::vector<std::vector<Segment2> >& vvContours,bool bVerbose,bool bAutoPerturbate=true);
101 
109  CLASS_DECLSPEC
110  void getProfile(const Point2& p,std::vector<Segment2>& vSegmentsOut);
111 protected:
112  IsoContours(const IsoContours& other);
113  IsoContours& operator=(const IsoContours& other);
114 
116  void init();
118  CLASS_DECLSPEC
119  bool getIntersectionSegments(double height,std::vector<Segment2*>& vIntersectionSegments);
121  void createContours(MMPS& mmPS,std::vector<std::vector<Segment2> >& vvContours);
123  void getIntersection(Triangle2* pT,double height,int i,std::vector<Point2>& vIntersectionPoints);
125  TriNode* pTree;
126  std::vector<Triangle2*> vTriangles;
128  GeomTest* pGeomPredicates;
130  std::set<double> sForbiddenHeights;
132  Func_Rot3D* pFRot;
134  std::vector<Point2*> vVtx; // Rotation version
135 
136 private:
137 
138 };
139 
140 
141 } // NAMESPACE FADE2D
142 
143 
144 #endif
145 
146 
IsoContours uses a fast datastructure to compute intersections of horizontal planes with a given list...
Definition: IsoContours.h:52
void getProfile(const Point2 &p, std::vector< Segment2 > &vSegmentsOut)
IsoContours(std::vector< Point2 > &vCorners, const Vector2 &dirVec)
bool getContours(double height, std::vector< std::vector< Segment2 > > &vvContours, bool bVerbose, bool bAutoPerturbate=true)
Point.
Definition: Point2.h:53
Triangle.
Definition: Triangle2.h:60
Vector.
Definition: Vector2.h:42