Fade2.5D Documentation pages v2.16.8
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 // unclear to you.
14 //
15 // Support: https://www.geom.at/contact/
16 // Project: https://www.geom.at/fade2d/html/
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 
64 {
65 
66 public:
76  CLASS_DECLSPEC
77  explicit IsoContours(std::vector<Triangle2*>& vTriangles);
91  CLASS_DECLSPEC
92  IsoContours(std::vector<Point2>& vCorners,const Vector2& dirVec);
94  CLASS_DECLSPEC
96 
102  CLASS_DECLSPEC
103  double getMinHeight();
109  CLASS_DECLSPEC
110  double getMaxHeight();
111 
112 
132  CLASS_DECLSPEC
133  bool getContours(double height,std::vector<std::vector<Segment2> >& vvContours,bool bVerbose,bool bAutoPerturbate=true);
134 
143  CLASS_DECLSPEC
144  void getProfile(const Point2& p,std::vector<Segment2>& vSegmentsOut);
145 
146 protected:
147  IsoContours(const IsoContours& other);
148  IsoContours& operator=(const IsoContours& other);
149 
151  void init();
153  CLASS_DECLSPEC
154  bool getIntersectionSegments(double height,std::vector<Segment2*>& vIntersectionSegments);
156  void createContours(MMPS& mmPS,std::vector<std::vector<Segment2> >& vvContours);
158  void getIntersection(Triangle2* pT,double height,int i,std::vector<Point2>& vIntersectionPoints);
160  TriNode* pTree;
161  std::vector<Triangle2*> vTriangles;
163  GeomTest* pGeomPredicates;
165  std::set<double> sForbiddenHeights;
167  Func_Rot3D* pFRot;
169  std::vector<Point2*> vVtx; // Rotation version
170 };
171 
172 
173 } // NAMESPACE FADE2D
174 
175 
176 #endif
177 
178 
The IsoContours class computes intersections of planes with a set of triangles, generating iso-contou...
Definition: IsoContours.h:64
CLASS_DECLSPEC IsoContours(std::vector< Point2 > &vCorners, const Vector2 &dirVec)
Constructor to initialize IsoContours with a set of triangle corners and slice direction.
CLASS_DECLSPEC ~IsoContours()
Destructor.
CLASS_DECLSPEC void getProfile(const Point2 &p, std::vector< Segment2 > &vSegmentsOut)
Get the profile at a specified point.
CLASS_DECLSPEC bool getContours(double height, std::vector< std::vector< Segment2 > > &vvContours, bool bVerbose, bool bAutoPerturbate=true)
Get the contours at a specified height.
CLASS_DECLSPEC double getMinHeight()
Get the minimum height (smallest z-coordinate).
CLASS_DECLSPEC IsoContours(std::vector< Triangle2 * > &vTriangles)
Constructor.
CLASS_DECLSPEC double getMaxHeight()
Get the maximum height (largest z-coordinate).
Represents a 2.5D point.
Definition: Point2.h:76
Represents a triangle in a triangulation.
Definition: Triangle2.h:59
Vector.
Definition: Vector2.h:47