25class CSOMarchingSquares;
75 void set(
int topLeftVoxel[2],
float values[4],
float isoValue,
char cellConfig = 0);
82 static inline bool isIsoCell(
char cellConfig);
101 char config = (
static_cast<unsigned char>(values[0] >= isoValue) << 0) |
102 (
static_cast<unsigned char>(values[1] >= isoValue) << 1) |
103 (
static_cast<unsigned char>(values[2] >= isoValue) << 2) |
104 (
static_cast<unsigned char>(values[3] >= isoValue) << 3);
135 bool _isCorner()
const;
141 int _getDirectionOppositeOfEdge()
const;
144 std::array<float, 2> _voxelsInDirection(
int direction)
const;
151 static float interpolate(
float valueA,
float valueB,
float interpolationValue);
187 return (cellConfig != 0) && (cellConfig != 15);
#define MLCSO_EXPORT
Defines export symbols for classes, so they can be used in other DLLs.
void set(int topLeftVoxel[2], float values[4], float isoValue, char cellConfig=0)
friend class CSOMarchingSquares
To allow for an accessing of the CSOMarchingSquares class.
void reset()
Resets the state of the cell (i.e., no values are set).
int getToDirection(int fromDir) const
bool addPoints(bool bIinterpolate, int fromDir, vecPoint2D &points, float xyOffset)
CSOMarchingSquaresCell()
Constructor.
float _isoValue
The isovalue to check the values against.
static int oppositeDirection(int fromDir)
unsigned char _cellConfig
static char calculateCellConfig(float isoValue, float values[4])
Calculates the cell config.
vecPoint2D::iterator vecPoint2DIter
Defines an iterator to iterate through a 2D point vector.
Direction
Enumeration of directions (next to compute).
int _topLeftVoxel[2]
The position of the top left voxel in voxel coordinates.
bool _isBorderLeft
Flags to indicate that some voxels of this cell are outside the image.
std::vector< Vector2 > vecPoint2D
Defines a 2D point vector.
bool isIsoCell() const
Returns true if this cell is intersected by the isoline.
~CSOMarchingSquaresCell()
Destructor.