ViennaLS
Loading...
Searching...
No Matches
viennals::CompareArea< T, D > Class Template Reference

Computes an estimate of the area where two level sets differ. The area is calculated by iterating through the bounding box of the two level sets and comparing the cell values. The grid delta is used as the unit of area. Custom increment values can be set for specific x and y ranges, allowing to count certain areas multiple times or skip them. Optionally, a passed mesh can be filled with the area information, allowing for visualization of the differences. The code is currently itended for 2D level sets only. More...

#include <lsCompareArea.hpp>

Public Member Functions

 CompareArea ()
 
 CompareArea (SmartPointer< Domain< T, D > > passedLevelSetTarget, SmartPointer< Domain< T, D > > passedLevelSetSample)
 
void setLevelSetTarget (SmartPointer< Domain< T, D > > passedLevelSet)
 Sets the target level set.
 
void setLevelSetSample (SmartPointer< Domain< T, D > > passedLevelSet)
 Sets the sample level set.
 
void setDefaultIncrement (unsigned short int increment)
 Set default increment value.
 
void setXRangeAndIncrement (hrleIndexType minXRange, hrleIndexType maxXRange, unsigned short int Xincrement)
 Sets the x-range and custom increment value.
 
void setYRangeAndIncrement (hrleIndexType minYRange, hrleIndexType maxYRange, unsigned short int Yincrement)
 Sets the y-range and custom increment value.
 
void setOutputMesh (SmartPointer< Mesh< T > > passedMesh)
 Set the output mesh where difference areas will be stored for visualization. Each cell in the mesh will have a cell data: 0: Areas where both level sets are inside 1: Areas where only one level set is inside (mismatched areas)
 
double getAreaMismatch () const
 Returns the computed area mismatch.
 
double getCustomAreaMismatch () const
 Returns the computed area mismatch, with custom increments applied.
 
unsigned long int getCellCount () const
 Returns the number of cells where the level sets differ.
 
unsigned long int getCustomCellCount () const
 Returns the number of cells where the level sets differ, with custom increments applied.
 
void apply ()
 Computes the area difference between the two level sets.
 

Detailed Description

template<class T, int D = 2>
class viennals::CompareArea< T, D >

Computes an estimate of the area where two level sets differ. The area is calculated by iterating through the bounding box of the two level sets and comparing the cell values. The grid delta is used as the unit of area. Custom increment values can be set for specific x and y ranges, allowing to count certain areas multiple times or skip them. Optionally, a passed mesh can be filled with the area information, allowing for visualization of the differences. The code is currently itended for 2D level sets only.

Constructor & Destructor Documentation

◆ CompareArea() [1/2]

template<class T, int D = 2>
viennals::CompareArea< T, D >::CompareArea ( )
inline

◆ CompareArea() [2/2]

template<class T, int D = 2>
viennals::CompareArea< T, D >::CompareArea ( SmartPointer< Domain< T, D > > passedLevelSetTarget,
SmartPointer< Domain< T, D > > passedLevelSetSample )
inline

Member Function Documentation

◆ apply()

template<class T, int D = 2>
void viennals::CompareArea< T, D >::apply ( )
inline

Computes the area difference between the two level sets.

◆ getAreaMismatch()

template<class T, int D = 2>
double viennals::CompareArea< T, D >::getAreaMismatch ( ) const
inline

Returns the computed area mismatch.

◆ getCellCount()

template<class T, int D = 2>
unsigned long int viennals::CompareArea< T, D >::getCellCount ( ) const
inline

Returns the number of cells where the level sets differ.

◆ getCustomAreaMismatch()

template<class T, int D = 2>
double viennals::CompareArea< T, D >::getCustomAreaMismatch ( ) const
inline

Returns the computed area mismatch, with custom increments applied.

◆ getCustomCellCount()

template<class T, int D = 2>
unsigned long int viennals::CompareArea< T, D >::getCustomCellCount ( ) const
inline

Returns the number of cells where the level sets differ, with custom increments applied.

◆ setDefaultIncrement()

template<class T, int D = 2>
void viennals::CompareArea< T, D >::setDefaultIncrement ( unsigned short int increment)
inline

Set default increment value.

◆ setLevelSetSample()

template<class T, int D = 2>
void viennals::CompareArea< T, D >::setLevelSetSample ( SmartPointer< Domain< T, D > > passedLevelSet)
inline

Sets the sample level set.

◆ setLevelSetTarget()

template<class T, int D = 2>
void viennals::CompareArea< T, D >::setLevelSetTarget ( SmartPointer< Domain< T, D > > passedLevelSet)
inline

Sets the target level set.

◆ setOutputMesh()

template<class T, int D = 2>
void viennals::CompareArea< T, D >::setOutputMesh ( SmartPointer< Mesh< T > > passedMesh)
inline

Set the output mesh where difference areas will be stored for visualization. Each cell in the mesh will have a cell data: 0: Areas where both level sets are inside 1: Areas where only one level set is inside (mismatched areas)

◆ setXRangeAndIncrement()

template<class T, int D = 2>
void viennals::CompareArea< T, D >::setXRangeAndIncrement ( hrleIndexType minXRange,
hrleIndexType maxXRange,
unsigned short int Xincrement )
inline

Sets the x-range and custom increment value.

◆ setYRangeAndIncrement()

template<class T, int D = 2>
void viennals::CompareArea< T, D >::setYRangeAndIncrement ( hrleIndexType minYRange,
hrleIndexType maxYRange,
unsigned short int Yincrement )
inline

Sets the y-range and custom increment value.


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