CutAndFill computes the volume(s) between two overlapping surfaces. More...
#include <CutAndFill.h>
Public Member Functions | |
CutAndFill (Zone2 *pZoneBefore, Zone2 *pZoneAfter, double ignoreThreshold=1e-6) | |
Constructor. More... | |
CAF_Component * | getComponent (size_t ith) const |
Get component ith . More... | |
bool | getDiffZone (Zone2 *&pDiffZone, std::map< Point2 *, std::pair< double, double > > &mVtx2BeforeAfter) |
Get the difference zone. More... | |
size_t | getNumberOfComponents () const |
Get the number of components. More... | |
bool | go (bool bWithMessages=true) |
Start the computation. More... | |
void | show (Visualizer2 *pVis) const |
Draw a postscript visualization. More... | |
void | showVtk (VtkWriter *pVtkWriter, VtkColor cutColor, VtkColor fillColor, VtkColor nullColor) const |
Visualize using a VTKWriter. 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... | |
CutAndFill computes the volume(s) between two overlapping surfaces.
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.
GEOM_FADE25D::CutAndFill::CutAndFill | ( | Zone2 * | pZoneBefore, |
Zone2 * | pZoneAfter, | ||
double | ignoreThreshold = 1e-6 |
||
) |
Constructor.
pZoneBefore | represents the surface before the earthworks |
pZoneAfter | is the surface afterwards |
ignoreThreshold | (default: 1e-6) can be used to ignore insignificant height differences |
CAF_Component* GEOM_FADE25D::CutAndFill::getComponent | ( | size_t | ith | ) | const |
Get component ith
.
ith
CAF_Component. bool GEOM_FADE25D::CutAndFill::getDiffZone | ( | Zone2 *& | pDiffZone, |
std::map< Point2 *, std::pair< double, double > > & | mVtx2BeforeAfter | ||
) |
Get the difference zone.
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.
size_t GEOM_FADE25D::CutAndFill::getNumberOfComponents | ( | ) | const |
Get the number of components.
A CAF_Component object represents a connected part of the surface such that
bool GEOM_FADE25D::CutAndFill::go | ( | bool | bWithMessages = true | ) |
Start the computation.
bWithMessages | is used to allow or suppress any warnings. |
void GEOM_FADE25D::CutAndFill::show | ( | Visualizer2 * | pVis | ) | const |
Draw a postscript visualization.
For a quick overview a postscript visualization can be created.
void GEOM_FADE25D::CutAndFill::subscribe | ( | MsgType | msgType, |
MsgBase * | pMsg | ||
) |
Register a progress bar object.
A user defined message receiver object (for example your own progress-bar class) can be registered to get progress updates. This step is optional.
msgType | is the message type. For progress information the type is always MSG_PROGRESS |
pMsg | is a user defined progress bar which derives from Fade's MsgBase. |
void GEOM_FADE25D::CutAndFill::unsubscribe | ( | MsgType | msgType, |
MsgBase * | pMsg | ||
) |
Unregister a progress bar object.
msgType | is the message type. For progress information the type is always MSG_PROGRESS |
pMsg | is a user defined class which derives from Fade's MsgBase |