openEmbroider  0.1
an open source embroidery software
OE_editDisplay.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_EDITDISPLAY_H
23 #define OE_EDITDISPLAY_H
24 
25 #include "OE_utils.h"
26 #include <stdint.h>
27 #include <vector>
28 #include "OE_document.h"
29 #include "OE_display.h"
30 #include <GLFW/glfw3.h>
31 
32 class OE_editDisplay : public OE_display
33 {
34 public:
35 
36 
39  OE_editDisplay(OE_document document);
41  virtual ~OE_editDisplay();
42 
43  virtual void showAll();
44 
45  virtual void scroll(double xoffset, double yoffset);
46 
47  //void drawframe();
48 
49  bool draw();
50  //bool forceRefresh = true;
51 
52  protected:
53  private:
54 
55  bool changeDpi = true;
56 
58  bool controls = false;
59 
60  OE_curve* selectedCurve = nullptr;
61  OE_stitchs* selectedStitch = nullptr;
62 
64  static unsigned char lineColor[4] ;
65 
67  static unsigned char controlLineColor[4] ;
68 
70  static unsigned char controlPointColor[4] ;
71 
73  static unsigned char controlStartPointColor[4] ;
74 
76  static unsigned char stitchLineColor[4] ;
77 
79  static unsigned char stitchPointColor[4] ;
80 
82  static unsigned char stitchStartPointColor[4] ;
83 
84  bool refresh();
85 
86  void drawTriangle(vector_2d point1, vector_2d point2, float size);
87 
88  bool drawCurve(OE_curve * curve);
89  bool drawStitch(OE_stitchs * stitch);
90  bool drawCurveControl(OE_curve * curve);
91  bool drawStitchControl(OE_stitchs * stitch);
92 
93 };
94 
95 #endif // OE_EDITDISPLAY_H
virtual ~OE_editDisplay()
Definition: OE_editDisplay.cpp:55
bool draw()
draw the document on screen
Definition: OE_editDisplay.cpp:102
Definition: OE_display.h:34
OE_editDisplay()
Definition: OE_editDisplay.cpp:47
Definition: OE_stitchs.h:31
Definition: OE_curve.h:30
Definition: OE_document.h:32
virtual void showAll()
move and zoom to see the entire document
Definition: OE_editDisplay.cpp:77
Definition: OE_utils.h:28
Definition: OE_editDisplay.h:32