Fade2.5D Documentation pages v1.97
Delaunay Features
CutAndFill.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
18 
19 #pragma once
20 #include "common.h"
21 #include "MsgBase.h"
22 
23 #include "CAF_Component.h"
24 
25 #if GEOM_PSEUDO3D==GEOM_TRUE
26  namespace GEOM_FADE25D {
27 
28 class Zone2; // FWD;
29 class CutAndFillImpl; // FWD
30 class Visualizer2; // FWD
31 class Fade_2D; // FWD
43 class CLASS_DECLSPEC CutAndFill
44 {
45 public:
54  CutAndFill(Zone2* pZoneBefore,Zone2* pZoneAfter,double ignoreThreshold=1e-3);
55  CutAndFill();
56  ~CutAndFill();
57 
72  bool getDiffZone( Zone2*& pDiffZone,
73  std::map<Point2*,std::pair<double,double> >& mVtx2BeforeAfter);
74 
88  void subscribe(MsgType msgType,MsgBase* pMsg);
89 
96  void unsubscribe(MsgType msgType,MsgBase* pMsg);
97 
109  size_t getNumberOfComponents() const;
110 
115  CAF_Component* getComponent(size_t ith) const;
116 
126  bool go();
127 
136  void show(Visualizer2* pVis) const;
137 
138 protected:
140  CutAndFillImpl* pCAFI;
141 private:
142  CutAndFill(const CutAndFill& ):pCAFI(NULL)
143  {
144  // Never reached
145  }
146  CutAndFill& operator=(const CutAndFill& )
147  {
148  pCAFI=NULL;
149  return *this;
150  }
151 };
152 
153 } // Namespace Fade25D only
154 
155 #elif GEOM_PSEUDO3D==GEOM_FALSE
156 #else
157  #error GEOM_PSEUDO3D is not defined
158 #endif
159 
160 
CAF_Component stands for CUT AND FILL COMPONENT. It represents a connected area of the surface.
Definition: CAF_Component.h:59
CutAndFill computes the volume(s) between two overlapping surfaces.
Definition: CutAndFill.h:44
void subscribe(MsgType msgType, MsgBase *pMsg)
Register a progress bar object.
CutAndFill(Zone2 *pZoneBefore, Zone2 *pZoneAfter, double ignoreThreshold=1e-3)
Constructor.
CAF_Component * getComponent(size_t ith) const
Get component ith.
bool getDiffZone(Zone2 *&pDiffZone, std::map< Point2 *, std::pair< double, double > > &mVtx2BeforeAfter)
Get the difference zone.
bool go()
Start the computation.
void show(Visualizer2 *pVis) const
Draw a postscript visualization.
void unsubscribe(MsgType msgType, MsgBase *pMsg)
Unregister a progress bar object.
size_t getNumberOfComponents() const
Get the number of components.
MsgBase, a base class for message subscriber classes.
Definition: MsgBase.h:47
Point.
Definition: Point2.h:43
Visualizer2 is a general Postscript writer. It draws the objects Point2, Segment2,...
Definition: Visualizer2.h:56
Zone2 is a certain defined area of a triangulation.
Definition: Zone2.h:92