Fade2.5D Documentation pages v2.16.3
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 #include "VtkWriter.h"
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;
147  void showVtk(VtkWriter* pVtkWriter,VtkColor cutColor,VtkColor fillColor,VtkColor nullColor) const;
148 protected:
150  CutAndFillImpl* pCAFI;
151 private:
152  CutAndFill(const CutAndFill& ):pCAFI(NULL)
153  {
154  // Never reached
155  }
156  CutAndFill& operator=(const CutAndFill& )
157  {
158  pCAFI=NULL;
159  return *this;
160  }
161 };
162 
163 } // Namespace Fade25D only
164 
165 #elif GEOM_PSEUDO3D==GEOM_FALSE
166 #else
167  #error GEOM_PSEUDO3D is not defined
168 #endif
169 
170 
VtkColor
Enumeration of colors used by the VTKWriter.
Definition: VtkWriter.h:39
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 showVtk(VtkWriter *pVtkWriter, VtkColor cutColor, VtkColor fillColor, VtkColor nullColor) const
Visualize using a VTKWriter.
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:53
Visualizer2 is a PDF- and Postscript writer.
Definition: Visualizer2.h:55
A writer for the VTK file format.
Definition: VtkWriter.h:62
‍**
Definition: Zone2.h:99