Fade2.5D Documentation pages v2.12
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-6);
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 
127  bool go(bool bWithMessages=true);
128 
137  void show(Visualizer2* pVis) const;
138 
139 protected:
141  CutAndFillImpl* pCAFI;
142 private:
143  CutAndFill(const CutAndFill& ):pCAFI(NULL)
144  {
145  // Never reached
146  }
147  CutAndFill& operator=(const CutAndFill& )
148  {
149  pCAFI=NULL;
150  return *this;
151  }
152 };
153 
154 } // Namespace Fade25D only
155 
156 #elif GEOM_PSEUDO3D==GEOM_FALSE
157 #else
158  #error GEOM_PSEUDO3D is not defined
159 #endif
160 
161 
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.
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(bool bWithMessages=true)
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.
CutAndFill(Zone2 *pZoneBefore, Zone2 *pZoneAfter, double ignoreThreshold=1e-6)
Constructor.
MsgBase, a base class for message subscriber classes.
Definition: MsgBase.h:47
Point.
Definition: Point2.h:52
Visualizer2 is a general Postscript writer. It draws the objects Point2, Segment2,...
Definition: Visualizer2.h:57
Zone2 is a certain defined area of a triangulation.
Definition: Zone2.h:95