Geom Software - C++ Programming and Geometry Libraries
Fade2.5D Documentation pages v1.63
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 
65  CLASS_DECLSPEC
66  IsoContours(std::vector<Point2>& vCorners,const Vector2& dirVec);
67 
68  CLASS_DECLSPEC
69  ~IsoContours();
74  CLASS_DECLSPEC
75  double getMinHeight();
80  CLASS_DECLSPEC
81  double getMaxHeight();
87  CLASS_DECLSPEC
88  bool getContours(double height,std::vector<std::vector<Segment2> >& vvContours,bool bVerbose);
94  CLASS_DECLSPEC
95  void getProfile(const Point2& p,std::vector<Segment2>& vSegmentsOut);
96 protected:
98  void init();
100  CLASS_DECLSPEC
101  bool getIntersectionSegments(double height,std::vector<Segment2*>& vIntersectionSegments);
103  void createContours(MMPS& mmPS,std::vector<std::vector<Segment2> >& vvContours);
105  void getIntersection(Triangle2* pT,double height,int i,std::vector<Point2>& vIntersectionPoints);
107  TriNode* pTree;
108  std::vector<Triangle2*> vTriangles;
110  GeomTest* pGeomPredicates;
112  std::set<double> sForbiddenHeights;
114  Func_Rot3D* pFRot;
116  std::vector<Point2*> vVtx; // Rotation version
117 
118 private:
119 
120 };
121 
122 
123 } // NAMESPACE FADE2D
124 
125 
126 #endif
127 
128 
Vector.
Definition: Vector2.h:37
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