CutAndFill computes the volume(s) between two overlapping surfaces.
More...
#include <CutAndFill.h>
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
- https://www.geom.at/cut-and-fill/
◆ CutAndFill()
GEOM_FADE25D::CutAndFill::CutAndFill |
( |
Zone2 * |
pZoneBefore, |
|
|
Zone2 * |
pZoneAfter, |
|
|
double |
ignoreThreshold = 1e-6 |
|
) |
| |
- Parameters
-
pZoneBefore | represents the surface before the earthworks |
pZoneAfter | is the surface afterwards |
ignoreThreshold | (default: 1e-6) can be used to ignore insignificant height differences |
◆ getComponent()
CAF_Component* GEOM_FADE25D::CutAndFill::getComponent |
( |
size_t |
ith | ) |
const |
◆ getDiffZone()
bool 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.
- Returns
- true in case of success, false otherwise.
- Note
- This method may set pDiffZone=NULL and return false when the two input surfaces do not share a common area. In this case the previous call to CutAndFill::go() has already returned false.
◆ 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)
◆ go()
bool GEOM_FADE25D::CutAndFill::go |
( |
bool |
bWithMessages = true | ) |
|
- Parameters
-
bWithMessages | is used to allow or suppress any warnings. |
- Returns
- true in case of success, false otherwise.
- Note
- When an input zone is empty or when the two input zones do not overlap then there is no common area on which the algorithm could operate. In this case the present method returns false.
◆ show()
void GEOM_FADE25D::CutAndFill::show |
( |
Visualizer2 * |
pVis | ) |
const |
For a quick overview a postscript visualization can be created.
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
-
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. |
◆ unsubscribe()
void GEOM_FADE25D::CutAndFill::unsubscribe |
( |
MsgType |
msgType, |
|
|
MsgBase * |
pMsg |
|
) |
| |
- Parameters
-
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 |
The documentation for this class was generated from the following file: