Geom Software - C++ Programming and Geometry Libraries
Fade2.5D Documentation pages v1.56
GEOM_FADE25D::CutAndFill Class Reference

Cut-And-Fill. More...

#include <CutAndFill.h>

Public Member Functions

 CutAndFill (Zone2 *pZoneBefore, Zone2 *pZoneAfter, double ignoreThreshold=1e-4)
 Constructor. More...
 
void getDiffZone (Zone2 *&pDiffZone, std::map< Point2 *, std::pair< double, double > > &mVtx2BeforeAfter)
 Get the difference zone. More...
 
void subscribe (MsgType msgType, MsgBase *pMsg)
 Register a progress bar object. More...
 
void unsubscribe (MsgType msgType, MsgBase *pMsg)
 Unregister a progress bar object. More...
 
size_t getNumberOfComponents () const
 Get the number of components. More...
 
CAF_ComponentgetComponent (size_t ith) const
 Get component ith. More...
 
void go ()
 Start the computation.
 
void show (Visualizer2 *pVis) const
 Draw a postscript visualization. More...
 

Protected Attributes

CutAndFillImpl * pCAFI
 

Detailed Description

cut_and_fill_surfaces.png
Overlapping input surfaces for Cut-And-Fill: RED=before, GREEN=after. The surfaces do not need to match exactly, the overlapping area is used
Given two overlapping surfaces with different elevations, CutAndFill partitions the surfaces into connected components and computes the volume that must be removed or added to turn one surface into the other.

See also
http://www.geom.at/cut-and-fill/

Constructor & Destructor Documentation

◆ CutAndFill()

GEOM_FADE25D::CutAndFill::CutAndFill ( Zone2 pZoneBefore,
Zone2 pZoneAfter,
double  ignoreThreshold = 1e-4 
)
Parameters
pZoneBeforerepresents the surface before the earthworks
pZoneAfteris the surface afterwards
ignoreThreshold(default: 1e-4) can be used to ignore insignificant height differences

Member Function Documentation

◆ getComponent()

CAF_Component* GEOM_FADE25D::CutAndFill::getComponent ( size_t  ith) const
Returns
the ith CAF_Component.

◆ getDiffZone()

void GEOM_FADE25D::CutAndFill::getDiffZone ( Zone2 *&  pDiffZone,
std::map< Point2 *, std::pair< double, double > > &  mVtx2BeforeAfter 
)

This method gives access to the internal data structures, namely to a Zone2 object whose vertices have z-values that correspond to the height differences between the two input meshes (SurfaceBefore minus SurfaceAfter). And a map is returned that contains for each vertex the height in the first and in the second input mesh.

◆ getNumberOfComponents()

size_t GEOM_FADE25D::CutAndFill::getNumberOfComponents ( ) const
Returns
the number of components.

A CAF_Component object represents a connected part of the surface such that

  • the first surface is below the second one (Type CT_FILL)
  • the first surface is above the second one (Type CT_CUT)
  • the first surface corresponds to the second one (Type CT_NULL)

◆ show()

void GEOM_FADE25D::CutAndFill::show ( Visualizer2 pVis) const

For a quick overview a postscript visualization can be created.

cut_and_fill_result.png
Cut&Fill-Result: YELLOW area: CUT, CYAN area: FILL

◆ subscribe()

void GEOM_FADE25D::CutAndFill::subscribe ( MsgType  msgType,
MsgBase pMsg 
)

A user defined message receiver object (for example your own progress-bar class) can be registered to get progress updates. This step is optional.

Parameters
msgTypeis the message type. For progress information the type is always MSG_PROGRESS
pMsgis a user defined progress bar which derives from Fade's MsgBase.

◆ unsubscribe()

void GEOM_FADE25D::CutAndFill::unsubscribe ( MsgType  msgType,
MsgBase pMsg 
)
Parameters
msgTypeis the message type. For progress information the type is always MSG_PROGRESS
pMsgis a user defined class which derives from Fade's MsgBase

The documentation for this class was generated from the following file: