TTK
Loading...
Searching...
No Matches
Macros | Functions
ExplicitTriangulation.cpp File Reference
#include <ExplicitTriangulation.h>
#include <OneSkeleton.h>
#include <ThreeSkeleton.h>
#include <TwoSkeleton.h>
#include <ZeroSkeleton.h>
#include <cstring>
#include <numeric>

Go to the source code of this file.

Macros

#define WRITE_FIXED(ARRAY)
 
#define WRITE_GUARD(ARRAY)
 
#define WRITE_ASCII(ARRAY)
 
#define WRITE_BOOL(ARRAY)
 
#define READ_FIXED(ARRAY, N_ITEMS)
 

Functions

template<typename T >
void writeBin (std::ofstream &stream, const T var)
 
template<typename T >
void writeBinArray (std::ofstream &stream, const T *const buff, const size_t size)
 
template<typename T >
void readBin (std::ifstream &stream, T &res)
 
template<typename T >
void readBinArray (std::ifstream &stream, T *const res, const size_t size)
 

Macro Definition Documentation

◆ READ_FIXED

#define READ_FIXED (   ARRAY,
  N_ITEMS 
)
Value:
if(!read_guard()) { \
ARRAY.resize(N_ITEMS); \
readBinArray(stream, ARRAY.data(), N_ITEMS); \
}

◆ WRITE_ASCII

#define WRITE_ASCII (   ARRAY)
Value:
stream << #ARRAY << '\n'; \
for(const auto &slice : ARRAY) { \
for(size_t i = 0; i < slice.size(); ++i) { \
if(i > 0) { \
stream << ' '; \
} \
stream << slice[i]; \
} \
stream << '\n'; \
}

◆ WRITE_BOOL

#define WRITE_BOOL (   ARRAY)
Value:
stream << #ARRAY << '\n'; \
for(const auto el : ARRAY) { \
stream << el << '\n'; \
}

◆ WRITE_FIXED

#define WRITE_FIXED (   ARRAY)
Value:
if(ARRAY.empty()) { \
writeBin(stream, char{0}); \
} else { \
writeBin(stream, char{1}); \
writeBinArray(stream, ARRAY.data(), ARRAY.size()); \
}

◆ WRITE_GUARD

#define WRITE_GUARD (   ARRAY)
Value:
if(ARRAY.empty()) { \
writeBin(stream, char{0}); \
return; \
} else { \
writeBin(stream, char{1}); \
}

Function Documentation

◆ readBin()

template<typename T >
void readBin ( std::ifstream &  stream,
T &  res 
)

Definition at line 1746 of file ExplicitTriangulation.cpp.

◆ readBinArray()

template<typename T >
void readBinArray ( std::ifstream &  stream,
T *const  res,
const size_t  size 
)

Definition at line 1751 of file ExplicitTriangulation.cpp.

◆ writeBin()

template<typename T >
void writeBin ( std::ofstream &  stream,
const T  var 
)

Definition at line 1518 of file ExplicitTriangulation.cpp.

◆ writeBinArray()

template<typename T >
void writeBinArray ( std::ofstream &  stream,
const T *const  buff,
const size_t  size 
)

Definition at line 1523 of file ExplicitTriangulation.cpp.