#ifndef PATTERNEXPORTER_HPP #define PATTERNEXPORTER_HPP #include #include #include #include #include #include // enum PatternLabel { // Valid = 0, // MultipleCC, // DanglingEdge, // IntersectingEdges, // ArticulationPoints //}; namespace PatternIO { using PatternName = int; struct Pattern { std::vector edges; PatternName name{-1}; bool operator==(const Pattern &p) const { return name == p.name; } }; struct PatternHashFunction { std::size_t operator()(const Pattern &p) const { return std::hash()(p.name); } }; /* * A set of planar patterns using the same nodes * */ struct PatternSet { std::vector nodes; std::vector patterns; }; void save(const std::string &filePath, const Pattern &pattern); void save(const std::string &filePath, const PatternSet &patterns); void load(const std::string &filePath, PatternSet &patternSet); void save(const std::string &filePath, const std::vector &vertices); void write(std::ofstream &fileStream, const Pattern &pattern); void write(std::ofstream &fileStream, const std::vector &vertices); void exportPLY(const std::string &patternSetFilePath, const std::string &outputDirectoryPath, const int &startIndex, const int &endIndex); void exportPLY(const std::string &outputDirectoryPath, const std::string &patternSetFilePath, const PatternName &patternToExport); void save(std::ofstream &fileStream, const Pattern &pattern); void load(const std::string &filepath, std::vector &vertices, std::vector &patterns, const int &startIndex, const int &endIndex); void exportPLY(const std::string &inputFilePath, const int &startIndex, const int &indexStep); } // namespace PatternIO #endif // PATTERNEXPORTER_HPP