openEmbroider  0.1
an open source embroidery software
OE_document.h
1 /*
2  * Copyright (c) 2015 Tricoire Sebastien 3dsman@free.fr
3  *
4  * This software is provided 'as-is', without any express or implied
5  * warranty. In no event will the authors be held liable for any damages
6  * arising from the use of this software.
7  *
8  * Permission is granted to anyone to use this software for any purpose,
9  * including commercial applications, and to alter it and redistribute it
10  * freely, subject to the following restrictions:
11  *
12  * 1. The origin of this software must not be misrepresented; you must not
13  * claim that you wrote the original software. If you use this software
14  * in a product, an acknowledgment in the product documentation would be
15  * appreciated but is not required.
16  * 2. Altered source versions must be plainly marked as such, and must not be
17  * misrepresented as being the original software.
18  * 3. This notice may not be removed or altered from any source distribution.
19  *
20  */
21 
22 #ifndef OE_DOCUMENT_H
23 #define OE_DOCUMENT_H
24 
25 #include <string>
26 //#include "xml/tinyxml.h"
27 #include "stitchs/OE_stitchs.h"
28 #include "curves/OE_pointcurve.h"
29 #include "instructions/OE_instruction.h"
30 #include "OE_thread.h"
31 
33 {
34  public:
36  OE_document();
37  // OE_document(std::string filename);
39  virtual ~OE_document();
40 
42  std::list<OE_stitchs*> stitchs;
43 
45  std::list<OE_curve*> curves;
46 
48  std::list<OE_thread*> threads;
49 
51  std::list<OE_stitchs*> selectedStitchs;
52 
54  std::list<OE_curve*> selectedCurves;
55 
57  std::vector<vector_2d> instPoints;
58 
60  std::vector<OE_instruction*> instCommand;
61 
63  unsigned int curPoint = 0;
64 
65  void getBound(float* xMin, float* yMin, float* xMax, float* yMax);
66 
67  vector_2d getHoopSize();
68  unsigned int getPulseByMm();
69  vector_2d getZeroPoint();
70  void setHoopSize(vector_2d hoopSize);
71  void setPulseByMm(unsigned int pbm);
72  void setZeroPoint(vector_2d zeroPoint);
73 
74  bool addCurve(OE_curve * curve);
75  bool addStitch(OE_stitchs * stitch);
76  bool addThread(OE_thread * thread);
77 
78  bool refresh();
79 
80 protected:
81 
82  private:
84  float width;
85 
87  float height;
88 
89  unsigned int pulseByMm = 5;
90 
91  float scale = 0.50f;
92 
93  vector_2d hoopSize = vector_2d(150,160) ;
94 
95  vector_2d zeroPoint = vector_2d(0,0) ;
96 };
97 
98 #endif // OE_DOCUMENT_H
std::list< OE_stitchs * > stitchs
the list of stitchs
Definition: OE_document.h:42
std::list< OE_thread * > threads
the list of threads
Definition: OE_document.h:48
std::list< OE_stitchs * > selectedStitchs
the list of selected stitchs
Definition: OE_document.h:51
std::vector< OE_instruction * > instCommand
the array of commands to send to the embroideress
Definition: OE_document.h:60
std::vector< vector_2d > instPoints
the array of points to send to the embroideress
Definition: OE_document.h:57
virtual ~OE_document()
Definition: OE_document.cpp:35
Definition: OE_thread.h:26
std::list< OE_curve * > selectedCurves
the list of selected curves
Definition: OE_document.h:54
std::list< OE_curve * > curves
the list of curves
Definition: OE_document.h:45
Definition: OE_stitchs.h:31
Definition: OE_curve.h:30
Definition: OE_document.h:32
unsigned int curPoint
the current points stitched by the embroideress
Definition: OE_document.h:63
Definition: OE_utils.h:28
OE_document()
Definition: OE_document.cpp:28