Fade2.5D Documentation pages v1.86
Delaunay Features
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 
91  double getVolume() const;
92 
99  int getLabel() const;
100 
110  void getTriangles(std::vector<Triangle2*>& vTrianglesOut) const;
111 
112 
117  void getBorder(std::vector<Segment2>& vBorderSegments) const;
118 
119 private:
120  CAF_Component(const CAF_Component& e_);
121 protected:
122  void init(std::map<Point2*,std::pair<double,double> >& mVtx2BeforeAfter);
123  void showGeomview(const char* name,std::vector<Point2>* pvBeforeT, std::vector<Point2>* pvAfterT, std::vector<Point2>* pvWallT) const;
124 
125  std::vector<Triangle2*>* pVT;
126  void setVolume(std::vector<Point2>* pvBeforeT, std::vector<Point2>* pvAfterT, std::vector<Point2>* pvWallT);
127  CAFTYP caftype;
128  double volume;
129  int label;
130 
131 };
132 
133 
138 inline std::ostream &operator<<(std::ostream &stream, const CAF_Component& c)
139 {
140  stream<<"Component "<<c.getLabel();
141  switch(c.getCAFType())
142  {
143  case CT_NULL: stream<<", Type: NULL";break;
144  case CT_CUT: stream<<", Type: CUT ";break;
145  case CT_FILL: stream<<", Type: FILL";break;
146  }
147  stream<<", Volume: "<<c.getVolume();
148  return stream;
149 }
150 
151 
152 } // (namespace)
153 
154 
155 #elif GEOM_PSEUDO3D==GEOM_FALSE
156 #else
157  #error GEOM_PSEUDO3D is not defined
158 #endif
GEOM_FADE25D::CT_CUT
@ CT_CUT
the first surface is above the second one
Definition: CAF_Component.h:39
GEOM_FADE25D::CT_FILL
@ CT_FILL
the first surface is below the second one
Definition: CAF_Component.h:40
GEOM_FADE25D::CAF_Component
CAF_Component stands for CUT AND FILL COMPONENT. It represents a connected area of the surface.
Definition: CAF_Component.h:58
GEOM_FADE25D::CAFTYP
CAFTYP
Definition: CAF_Component.h:36
GEOM_FADE25D::CAF_Component::getVolume
double getVolume() const
Get the volume.
GEOM_FADE25D::Point2
Point.
Definition: Point2.h:40
GEOM_FADE25D::CAF_Component::getCAFType
CAFTYP getCAFType() const
Get Cut&Fill-Type.
GEOM_FADE25D::CAF_Component::getLabel
int getLabel() const
Get label.
GEOM_FADE25D::CT_NULL
@ CT_NULL
the first surface corresponds to the second one
Definition: CAF_Component.h:38