Geom Software - C++ Programming and Geometry Libraries
Fade2.5D Documentation pages v1.74
IsoContours.h
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 
18 
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 
41 typedef std::multimap<Point2,Segment2*> MMPS;
42 typedef MMPS::iterator MMPSIt;
43 
50 {
51 
52 public:
53 
54  CLASS_DECLSPEC
55  explicit IsoContours(std::vector<Triangle2*>& vTriangles);
56 
66  CLASS_DECLSPEC
67  IsoContours(std::vector<Point2>& vCorners,const Vector2& dirVec);
68 
69  CLASS_DECLSPEC
70  ~IsoContours();
75  CLASS_DECLSPEC
76  double getMinHeight();
81  CLASS_DECLSPEC
82  double getMaxHeight();
98  CLASS_DECLSPEC
99  bool getContours(double height,std::vector<std::vector<Segment2> >& vvContours,bool bVerbose,bool bAutoPerturbate=true);
100 
108  CLASS_DECLSPEC
109  void getProfile(const Point2& p,std::vector<Segment2>& vSegmentsOut);
110 protected:
112  void init();
114  CLASS_DECLSPEC
115  bool getIntersectionSegments(double height,std::vector<Segment2*>& vIntersectionSegments);
117  void createContours(MMPS& mmPS,std::vector<std::vector<Segment2> >& vvContours);
119  void getIntersection(Triangle2* pT,double height,int i,std::vector<Point2>& vIntersectionPoints);
121  TriNode* pTree;
122  std::vector<Triangle2*> vTriangles;
124  GeomTest* pGeomPredicates;
126  std::set<double> sForbiddenHeights;
128  Func_Rot3D* pFRot;
130  std::vector<Point2*> vVtx; // Rotation version
131 
132 private:
133 
134 };
135 
136 
137 } // NAMESPACE FADE2D
138 
139 
140 #endif
141 
142 
Vector.
Definition: Vector2.h:34
IsoContours uses a fast datastructure to compute intersections of horizontal planes with a given list...
Definition: IsoContours.h:49
Triangle.
Definition: Triangle2.h:48
Definition: Bbox2.h:23
Point.
Definition: Point2.h:39