3 #include "ContourPolygon.h"
7 #include "../../enums.h"
8 #include "../../IProtoBuffable.h"
9 #include "../../ProtoBuf/featuresfile.pb.h"
10 #include "SymbolName.h"
11 #include "AttributeLookupTable.h"
14 namespace Odb::Lib::FileModel::Design
44 int apt_def_symbol_num;
45 float apt_def_resize_factor;
67 float orient_def_rotation;
69 ContourPolygon::Vector m_contourPolygons;
71 const ContourPolygon::Vector& GetContourPolygons()
const;
73 typedef std::vector<std::shared_ptr<FeatureRecord>> Vector;
76 std::unique_ptr<Odb::Lib::Protobuf::FeaturesFile::FeatureRecord> to_protobuf()
const override;
77 void from_protobuf(
const Odb::Lib::Protobuf::FeaturesFile::FeatureRecord& message)
override;
79 constexpr
inline static const char* LINE_TOKEN =
"L";
80 constexpr
inline static const char* PAD_TOKEN =
"P";
81 constexpr
inline static const char* TEXT_TOKEN =
"T";
82 constexpr
inline static const char* ARC_TOKEN =
"A";
83 constexpr
inline static const char* BARCODE_TOKEN =
"B";
84 constexpr
inline static const char* SURFACE_START_TOKEN =
"S";
85 constexpr
inline static const char* SURFACE_END_TOKEN =
"SE";
88 bool Parse(std::filesystem::path directory,
const std::string& alternateFilename =
"");
90 std::string GetUnits()
const;
91 std::filesystem::path GetPath();
92 std::filesystem::path GetDirectory();
93 int GetNumFeatures()
const;
94 unsigned int GetId()
const;
96 const SymbolName::StringMap& GetSymbolNamesByName()
const;
97 const FeatureRecord::Vector& GetFeatureRecords()
const;
100 std::unique_ptr<Odb::Lib::Protobuf::FeaturesFile> to_protobuf()
const override;
101 void from_protobuf(
const Odb::Lib::Protobuf::FeaturesFile& message)
override;
105 std::filesystem::path m_path;
106 std::filesystem::path m_directory;
110 FeatureRecord::Vector m_featureRecords;
111 SymbolName::StringMap m_symbolNamesByName;
113 std::vector<std::string> m_attributeNames;
114 std::vector<std::string> m_attributeTextValues;
116 constexpr
inline static const char* FEATURES_FILENAMES[] =
123 constexpr
inline static const char* UNITS_TOKEN =
"UNITS";
124 constexpr
inline static const char* ID_TOKEN =
"ID";
125 constexpr
inline static const char* ATTRIBUTE_NAME_TOKEN =
"@";
126 constexpr
inline static const char* ATTRIBUTE_VALUE_TOKEN =
"&";
127 constexpr
inline static const char* SYMBOL_NAME_TOKEN =
"$";
128 constexpr
inline static const char* COMMENT_TOKEN =
"#";
129 constexpr
inline static const char* NUM_FEATURES_TOKEN =
"F";