5 #include <DetailedVoxel.h> 9 #include <HeliosException.h> 67 std::string
const & path,
68 size_t numHeaderLines=2,
69 bool const exactFormat =
true,
70 std::string
const separator =
" " 80 std::string
const & path,
81 size_t numHeaderLines=2,
82 bool const exactFormat =
true,
83 std::string
const separator =
" " 94 void loadFile(std::vector<std::string> &lines, std::string
const & path);
108 std::vector<std::string> &lines,
109 size_t const numHeaderLines,
110 bool &minCornerXFound,
112 bool &minCornerYFound,
114 bool &minCornerZFound,
116 bool &maxCornerXFound,
118 bool &maxCornerYFound,
120 bool &maxCornerZFound,
154 std::string
const &line,
155 bool &minCornerXFound,
157 bool &minCornerYFound,
159 bool &minCornerZFound,
161 bool &maxCornerXFound,
163 bool &maxCornerYFound,
165 bool &maxCornerZFound,
232 std::string
const &line,
233 bool &minCornerXFound,
235 bool &minCornerYFound,
237 bool &minCornerZFound,
239 bool &maxCornerXFound,
241 bool &maxCornerYFound,
243 bool &maxCornerZFound,
270 std::vector<std::string> &lines,
271 size_t numHeaderLines
279 bool minCornerXFound,
280 bool minCornerYFound,
281 bool minCornerZFound,
282 bool maxCornerXFound,
283 bool maxCornerYFound,
284 bool maxCornerZFound,
302 std::string
const separator,
303 bool const exactFormat,
314 double voxelHalfSize,
void cleanLine(std::string &line)
Remove unnecessary stuff from received line.
Definition: VoxelFileParser.cpp:343
void removeHeaderLines(std::vector< std::string > &lines, size_t numHeaderLines)
Remove header lines.
Definition: VoxelFileParser.cpp:385
void cleanLines(std::vector< std::string > &lines, size_t const numHeaderLines, bool &minCornerXFound, double &minCornerX, bool &minCornerYFound, double &minCornerY, bool &minCornerZFound, double &minCornerZ, bool &maxCornerXFound, double &maxCornerX, bool &maxCornerYFound, double &maxCornerY, bool &maxCornerZFound, double &maxCornerZ, bool &splitXFound, size_t &splitX, bool &splitYFound, size_t &splitY, bool &splitZFound, size_t &splitZ, double &voxelSize, double &maxPad)
Clean unnecessary lines.
Definition: VoxelFileParser.cpp:114
Class for parsing voxel files.
Definition: VoxelFileParser.h:19
static char const BLANK_CHARACTERS[N_BLANK_CHARACTERS]
Characters considered "blank".
Definition: VoxelFileParser.h:30
bool handleSpecLine(std::string const &line, bool &minCornerXFound, double &minCornerX, bool &minCornerYFound, double &minCornerY, bool &minCornerZFound, double &minCornerZ, bool &maxCornerXFound, double &maxCornerX, bool &maxCornerYFound, double &maxCornerY, bool &maxCornerZFound, double &maxCornerZ, bool &splitXFound, size_t &splitX, bool &splitYFound, size_t &splitY, bool &splitZFound, size_t &splitZ, double &voxelSize, double &maxPad)
Handle line if it is an spec line. Do nothing otherwise.
Definition: VoxelFileParser.cpp:188
Class which extends Voxel to support AMAPVox format with extra features.
Definition: DetailedVoxel.h:12
DetailedVoxel * parseDetailedVoxelLine(std::string &line, std::string const separator, bool const exactFormat, char const *format1, char const *format2, char const *format3, double minCornerX, double minCornerY, double minCornerZ, double maxCornerX, double maxCornerY, double maxCornerZ, double voxelSize, double voxelHalfSize, double maxPad)
Parse the DetailedVoxel specified in given line.
Definition: VoxelFileParser.cpp:450
static size_t constexpr N_BLANK_CHARACTERS
Nummber of blank characters.
Definition: VoxelFileParser.h:26
static char constexpr SPEC_CHARACTER
Character which starts spec lines.
Definition: VoxelFileParser.h:34
void loadFile(std::vector< std::string > &lines, std::string const &path)
Loads the file at given path.
Definition: VoxelFileParser.cpp:93
void handleSpec(std::string const &line, bool &minCornerXFound, double &minCornerX, bool &minCornerYFound, double &minCornerY, bool &minCornerZFound, double &minCornerZ, bool &maxCornerXFound, double &maxCornerX, bool &maxCornerYFound, double &maxCornerY, bool &maxCornerZFound, double &maxCornerZ, bool &splitXFound, size_t &splitX, bool &splitYFound, size_t &splitY, bool &splitZFound, size_t &splitZ, double &voxelSize, double &maxPad)
Assuming received line is a spec line, handle it.
Definition: VoxelFileParser.cpp:245
bool isBlankLine(std::string const &line)
Check if the line is a blank line.
Definition: VoxelFileParser.cpp:172
std::vector< DetailedVoxel * > bruteParseDetailed(std::string const &path, size_t numHeaderLines=2, bool const exactFormat=true, std::string const separator=" ")
Like parseDetailed but returns a vector a normla pointers instead of shared pointers.
Definition: VoxelFileParser.cpp:22
std::vector< std::shared_ptr< DetailedVoxel > > parseDetailed(std::string const &path, size_t numHeaderLines=2, bool const exactFormat=true, std::string const separator=" ")
Parse detailed voxels specified at file located at given path.
Definition: VoxelFileParser.cpp:7
VoxelFileParser()
Build a VoxelFileParser.
Definition: VoxelFileParser.h:42
void validateDetailed(bool minCornerXFound, bool minCornerYFound, bool minCornerZFound, bool maxCornerXFound, bool maxCornerYFound, bool maxCornerZFound, bool splitXFound, bool splitYFound, bool splitZFound)
Check if flags are valid.
Definition: VoxelFileParser.cpp:392