Geom Software - C++ Programming and Geometry Libraries
Fade2.5D Documentation pages v1.58
CAF_Component.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 
20 #pragma once
21 #include <map>
22 #include "common.h"
23 #include "Segment2.h"
24 
25 
26 
27 // Only defined for 2.5D
28 #if GEOM_PSEUDO3D==GEOM_TRUE
29 namespace GEOM_FADE25D {
30 
31 
36 enum CAFTYP
37 {
41 };
42 
43 class Triangle2;
44 class Point2;
45 class Zone2;
46 
47 
48 
58 class CLASS_DECLSPEC CAF_Component
59 {
60 public:
62  std::vector<Triangle2*>& vT_,
63  std::map<Point2*,std::pair<double,double> >& mVtx2BeforeAfter_,
64  int label_
65  );
66 
78  CAFTYP getCAFType() const;
79 
80 // void showGeomview(const std::string& name) const;
81 
82 
83 
84 
85 
96  double getVolume() const;
97 
104  int getLabel() const;
105 
115  void getTriangles(std::vector<Triangle2*>& vTrianglesOut) const;
116 
117 
122  void getBorder(std::vector<Segment2>& vBorderSegments) const;
123 
124 private:
125  CAF_Component(const CAF_Component& e_);
126 protected:
127  void init(std::map<Point2*,std::pair<double,double> >& mVtx2BeforeAfter);
128  void showGeomview(const std::string& name,std::vector<Point2>* pvBeforeT, std::vector<Point2>* pvAfterT, std::vector<Point2>* pvWallT) const;
129 
130  std::vector<Triangle2*>* pVT;
131  void setVolume(std::vector<Point2>* pvBeforeT, std::vector<Point2>* pvAfterT, std::vector<Point2>* pvWallT);
132  CAFTYP caftype;
133  double volume;
134  int label;
135 
136 };
137 
138 
143 inline std::ostream &operator<<(std::ostream &stream, const CAF_Component& c)
144 {
145  stream<<"Component "<<c.getLabel();
146  switch(c.getCAFType())
147  {
148  case CT_NULL: stream<<", Type: NULL";break;
149  case CT_CUT: stream<<", Type: CUT ";break;
150  case CT_FILL: stream<<", Type: FILL";break;
151  }
152  stream<<", Volume: "<<c.getVolume();
153  return stream;
154 }
155 
156 
157 } // (namespace)
158 
159 
160 #elif GEOM_PSEUDO3D==GEOM_FALSE
161 #else
162  #error GEOM_PSEUDO3D is not defined
163 #endif
CAFTYP
Definition: CAF_Component.h:36
Zone2 is an exactly defined area of a triangulation.
Definition: Zone2.h:48
the first surface is below the second one
Definition: CAF_Component.h:40
double getVolume() const
Get the volume.
Triangle.
Definition: Triangle2.h:48
int getLabel() const
Get label.
Definition: Bbox2.h:23
the first surface is above the second one
Definition: CAF_Component.h:39
CAFTYP getCAFType() const
Get Cut&Fill-Type.
the first surface corresponds to the second one
Definition: CAF_Component.h:38
Point.
Definition: Point2.h:39
CAF_Component stands for CUT AND FILL COMPONENT. It represents a connected area of the surface...
Definition: CAF_Component.h:58