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"
12 #include "../IStreamSaveable.h"
13 #include "../../odbdesign_export.h"
16 namespace Odb::Lib::FileModel::Design
46 int apt_def_symbol_num;
47 double apt_def_resize_factor;
69 double orient_def_rotation;
71 ContourPolygon::Vector m_contourPolygons;
73 const ContourPolygon::Vector& GetContourPolygons()
const;
75 typedef std::vector<std::shared_ptr<FeatureRecord>> Vector;
78 std::unique_ptr<Odb::Lib::Protobuf::FeaturesFile::FeatureRecord> to_protobuf()
const override;
79 void from_protobuf(
const Odb::Lib::Protobuf::FeaturesFile::FeatureRecord& message)
override;
81 constexpr
inline static const char* LINE_TOKEN =
"L";
82 constexpr
inline static const char* PAD_TOKEN =
"P";
83 constexpr
inline static const char* TEXT_TOKEN =
"T";
84 constexpr
inline static const char* ARC_TOKEN =
"A";
85 constexpr
inline static const char* BARCODE_TOKEN =
"B";
86 constexpr
inline static const char* SURFACE_START_TOKEN =
"S";
87 constexpr
inline static const char* SURFACE_END_TOKEN =
"SE";
90 bool Parse(std::filesystem::path directory,
const std::string& alternateFilename =
"");
92 bool Save(std::ostream& os)
override;
94 std::string GetUnits()
const;
95 std::filesystem::path GetPath();
96 std::filesystem::path GetDirectory();
97 int GetNumFeatures()
const;
98 unsigned int GetId()
const;
100 const SymbolName::StringMap& GetSymbolNamesByName()
const;
101 const FeatureRecord::Vector& GetFeatureRecords()
const;
104 std::unique_ptr<Odb::Lib::Protobuf::FeaturesFile> to_protobuf()
const override;
105 void from_protobuf(
const Odb::Lib::Protobuf::FeaturesFile& message)
override;
109 std::filesystem::path m_path;
110 std::filesystem::path m_directory;
114 FeatureRecord::Vector m_featureRecords;
115 SymbolName::StringMap m_symbolNamesByName;
117 std::vector<std::string> m_attributeNames;
118 std::vector<std::string> m_attributeTextValues;
120 constexpr
inline static const char* FEATURES_FILENAMES[] =
127 constexpr
inline static const char* UNITS_TOKEN =
"UNITS";
128 constexpr
inline static const char* ID_TOKEN =
"ID";
129 constexpr
inline static const char* ATTRIBUTE_NAME_TOKEN =
"@";
130 constexpr
inline static const char* ATTRIBUTE_VALUE_TOKEN =
"&";
131 constexpr
inline static const char* SYMBOL_NAME_TOKEN =
"$";
132 constexpr
inline static const char* COMMENT_TOKEN =
"#";
133 constexpr
inline static const char* NUM_FEATURES_TOKEN =
"F";