34#ifndef GBVOXELMATRIX3D_H
35#define GBVOXELMATRIX3D_H
138 const double &
x2b,
const double &
x3b)
override;
140 const double &
x2b,
const double &
x3b)
override;
142 const double &
x2b,
const double &
x3b)
override;
156 void addSurfaceTriangleSet(std::vector<UbTupleFloat3> &nodes, std::vector<UbTupleInt3> &triangles)
override;
161 const double &
rx2,
const double &
rx3)
override;
253 in.seekg(0, ios::end);
254 fstream::off_type length =
in.tellg();
255 in.seekg(0, ios::beg);
260 (
unsigned long long)
sizeof(
T);
261 if (
nofn != (
unsigned long long)length) {
273 for (
int x3 = 0; x3 <
nodesX3; x3++)
274 for (
int x2 = 0; x2 <
nodesX2; x2++)
275 for (
int x1 = 0; x1 <
nodesX1; x1++) {
277 in.read((
char *)&
val,
sizeof(
T));
298 <<
"/" <<
nodesX3 <<
") - start");
308 unsigned long int length =
ftell(file);
314 if (
nofn != length) {
332 for (
int x3 = 0; x3 <
nodesX3; x3++)
333 for (
int x2 = 0; x2 <
nodesX2; x2++)
334 for (
int x1 = 0; x1 <
nodesX1; x1++) {
347 <<
"/" <<
nodesX3 <<
") - end");
typename std::vector< value_type >::const_reference const_reference
typename IndexClass::size_type size_type
typename std::vector< value_type >::reference reference
This Class provides basic 3D line objects.
This Interface provides basic 3D geometry objects methods.
virtual void setCenterCoordinates(const double &, const double &, const double &)
This Class provides basic 3D point objects.
This Class provides basic 3D triangle objects.
void setVoxelMatrixMininum(double minX1, double minX2, double minX3)
CbArray3D< char > flagMatrix
GbLine3D * createClippedLine3D(GbPoint3D &, GbPoint3D &) override
double getX3Centroid() override
void objectChanged(UbObservable *) override
void objectWillBeDeleted(UbObservable *) override
void setAddSurfaceTriangleSetFlag(bool flag)
void setVoxelMatrixDelta(double deltaX1, double deltaX2, double deltaX3)
~GbVoxelMatrix3D() override=default
bool addSurfaceTriangleSetFlag
double getX1Minimum() override
Matrix3D::reference operator()(const Matrix3D::size_type &x1, const Matrix3D::size_type &x2, const Matrix3D::size_type &x3)
CbArray3D< float > Matrix3D
double getX2Centroid() override
double getX1Maximum() override
double getX3Maximum() override
bool hasRaytracing() override
void setThreshold(double lowerThreshold, double upperThreshold)
void setVoxelMatrixDeltaX3(double deltaX3)
std::vector< int > x2NbrTemp
double getX2Maximum() override
double getX2Minimum() override
double getX1Centroid() override
void setVoxelMatrixDeltaX1(double deltaX1)
void setVoxelMatrixMinX3(double minX3)
void setVoxelMatrixDeltaX2(double deltaX2)
void setTransferViaFilename(bool transferViaFilename, std::string filename)
std::vector< int > x1NbrTemp
std::vector< int > x3NbrTemp
void setVoxelMatrixMinX1(double minX1)
Matrix3D::const_reference operator()(const Matrix3D::size_type &x1, const Matrix3D::size_type &x2, const Matrix3D::size_type &x3) const
GbPoint3D * calculateInterSectionPoint3D(GbPoint3D &, GbPoint3D &)
void setVoxelMatrixMinX2(double minX2)
double getX3Minimum() override
std::shared_ptr< T > SPtr
void calculateNumberOfSolidAndFluid()
std::string toString() override
void addSurfaceTriangleSet(std::vector< UbTupleFloat3 > &nodes, std::vector< UbTupleInt3 > &triangles) override
void findFluidNeighbor(int cx1, int cx2, int cx3)
std::vector< GbTriangle3D * > getSurfaceTriangleSet() override
virtual bool isPointInGbObject3D(GbPoint3D *p)
bool isCellInsideGbObject3D(const double &x1a, const double &x2a, const double &x3a, const double &x1b, const double &x2b, const double &x3b) override
void rotateAroundY(double theta)
void readMatrixFromVtiASCIIFile(std::string filename)
Reads a VTI file in ASCII format and fills the voxel matrix applying the thresholds....
void setClosedVoidSpaceToSolid()
bool isCellInsideOrCuttingGbObject3D(const double &x1a, const double &x2a, const double &x3a, const double &x1b, const double &x2b, const double &x3b) override
void writeToLegacyVTKBinary(const std::string &fileName)
bool isPointInGbObject3D(const double &x1p, const double &x2p, const double &x3p, bool &pointIsOnBoundary) override
void translate(const double &tx1, const double &tx2, const double &tx3) override
double getIntersectionRaytraceFactor(const double &x1, const double &x2, const double &x3, const double &rx1, const double &rx2, const double &rx3) override
void readBufferedMatrixFromRawFile(std::string filename, GbVoxelMatrix3D::Endian endian)
void writeToVTKImageDataAppended(const std::string &fileName)
void writeToVTKImageDataASCII(const std::string &fileName)
void writeToLegacyVTKASCII(const std::string &fileName)
void readMatrixFromRawFile(std::string filename, GbVoxelMatrix3D::Endian endian)
bool isCellCuttingGbObject3D(const double &x1a, const double &x2a, const double &x3a, const double &x1b, const double &x2b, const double &x3b) override
void readMatrixFromVtiAppendedFile(std::string filename)
Reads a VTI file in appended binary format and fills the voxel matrix applying the thresholds....
void setCenterCoordinates(const double &x1, const double &x2, const double &x3) override
GbVoxelMatrix3D * clone() override
UbTypeOp< typenameUbDuoT< N, UbDuo< A, B > >::ResultT >::RefT val(UbDuo< A, B > &d)
#define UB_FUNCTION
UbException usage: UB_THROW( UbException("error message") ); UB_THROW( UbException(FILE,...
#define UBLOG(level, logtext)
std::string toString(const T &x, int precision=15)
void swapByteOrder(unsigned char *toSwap, int length)