OdbDesignLib
OdbDesign ODB++ Parsing Library
StepHdrFile.h
1 #pragma once
2 
3 #include "../../odbdesign_export.h"
4 #include <string>
5 #include <vector>
6 #include <map>
7 #include <memory>
8 #include "../../IProtoBuffable.h"
9 #include "../../ProtoBuf/stephdrfile.pb.h"
10 #include "../OdbFile.h"
11 
12 namespace Odb::Lib::FileModel::Design
13 {
14  class ODBDESIGN_EXPORT StepHdrFile : public OdbFile, public IProtoBuffable<Odb::Lib::Protobuf::StepHdrFile>
15  {
16  public:
17  virtual ~StepHdrFile();
18 
19  struct StepRepeatRecord : public IProtoBuffable<Odb::Lib::Protobuf::StepHdrFile::StepRepeatRecord>
20  {
21  std::string name;
22  float x;
23  float y;
24  float dx;
25  float dy;
26  int nx;
27  int ny;
28  float angle;
29  bool flip;
30  bool mirror;
31 
32  typedef std::vector<std::shared_ptr<StepRepeatRecord>> Vector;
33 
34  constexpr static const char* ARRAY_HEADER_TOKEN = "STEP-REPEAT";
35 
36  // Inherited via IProtoBuffable
37  std::unique_ptr<Odb::Lib::Protobuf::StepHdrFile::StepRepeatRecord> to_protobuf() const override;
38  void from_protobuf(const Odb::Lib::Protobuf::StepHdrFile::StepRepeatRecord& message) override;
39  };
40 
41  bool Parse(std::filesystem::path path) override;
42 
43  // Inherited via IProtoBuffable
44  std::unique_ptr<Odb::Lib::Protobuf::StepHdrFile> to_protobuf() const override;
45  void from_protobuf(const Odb::Lib::Protobuf::StepHdrFile& message) override;
46 
47  private:
48  std::string m_units;
49  float xDatum;
50  float yDatum;
51  unsigned id;
52  float xOrigin;
53  float yOrigin;
54  float topActive;
55  float bottomActive;
56  float rightActive;
57  float leftActive;
58  std::string affectingBom;
59  bool affectingBomChanged;
60  std::map<std::string, std::string> m_onlineValues;
61 
62  StepRepeatRecord::Vector m_stepRepeatRecords;
63 
64  };
65 }