#pragma once #include namespace db { class Via { public: int x; int y; ViaType* type; Via(ViaType* type, int x, int y) : x(x), y(y), type(type) {} }; class ViaRule { public: ~ViaRule() { botLayer = nullptr; cutLayer = nullptr; topLayer = nullptr; } bool hasViaRule = false; string name = ""; std::pair cutSize = {-1, -1}; // (X, Y) std::pair cutSpacing = {-1, -1}; // (X, Y) std::pair botEnclosure = {-1, -1}; // (X, Y) std::pair topEnclosure = {-1, -1}; // (X, Y) int numCutRows = -1; int numCutCols = -1; std::pair originOffset = {-1, -1}; // (X, Y) std::pair botOffset = {-1, -1}; // (X, Y) std::pair topOffset = {-1, -1}; // (X, Y) const Layer* botLayer = nullptr; // Route Layer const Layer* cutLayer = nullptr; // Cut Layer const Layer* topLayer = nullptr; // Route Layer }; class ViaType { private: bool isDef_ = false; public: string name = ""; set rects; ViaRule rule; ViaType(const string& name = "", const bool isDef = false) : isDef_(isDef), name(name) {} template void addRect(Args&&... args) { rects.emplace(args...); } void isDef(bool b) { isDef_ = b; } bool isDef() const { return isDef_; } }; } // namespace db