Qucs-GUI  0.0.18
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
painting.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  painting.cpp - description
3  -------------------
4  begin : Sat Nov 22 2003
5  copyright : (C) 2003 by Michael Margraf
6  email : michael.margraf@alumni.tu-berlin.de
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 #include <QtGui>
18 #include "painting.h"
19 #include <iostream>
20 using namespace std;
21 
23 {
24  Type = isPainting;
25  State = 0;
26 }
27 
29 {
30  return new Painting();
31 }
32 
33 void Painting::Bounding(int& _x1, int& _y1, int& _x2, int& _y2)
34 {
35  _x1 = cx; _y1 = cy;
36  _x2 = cx+x2; _y2 = cy+y2;
37 }
38 
39 QString Painting::save()
40 {
41  return QString();
42 }
43 
45 {
46  return QString();
47 }
48 
50 {
51  return QString();
52 }
53 
54 QString Painting::toPenString (int pen) {
55  switch (pen) {
56  case Qt::NoPen: return "Qt::NoPen";
57  case Qt::SolidLine: return "Qt::SolidLine";
58  case Qt::DashLine: return "Qt::DashLine";
59  case Qt::DotLine: return "Qt::DotLine";
60  case Qt::DashDotLine: return "Qt::DashDotLine";
61  case Qt::DashDotDotLine: return "Qt::DashDotDotLine";
62  case Qt::MPenStyle: return "Qt::MPenStyle";
63  }
64  return "Qt::NoPen";
65 }
66 
67 QString Painting::toBrushString (int brush) {
68  switch (brush) {
69  case Qt::NoBrush: return "Qt::NoBrush";
70  case Qt::SolidPattern: return "Qt::SolidPattern";
71  case Qt::Dense1Pattern: return "Qt::Dense1Pattern";
72  case Qt::Dense2Pattern: return "Qt::Dense2Pattern";
73  case Qt::Dense3Pattern: return "Qt::Dense3Pattern";
74  case Qt::Dense4Pattern: return "Qt::Dense4Pattern";
75  case Qt::Dense5Pattern: return "Qt::Dense5Pattern";
76  case Qt::Dense6Pattern: return "Qt::Dense6Pattern";
77  case Qt::Dense7Pattern: return "Qt::Dense7Pattern";
78  case Qt::HorPattern: return "Qt::HorPattern";
79  case Qt::VerPattern: return "Qt::VerPattern";
80  case Qt::CrossPattern: return "Qt::CrossPattern";
81  case Qt::BDiagPattern: return "Qt::BDiagPattern";
82  case Qt::FDiagPattern: return "Qt::FDiagPattern";
83  case Qt::DiagCrossPattern: return "Qt::DiagCrossPattern";
84  case Qt::TexturePattern : return "Qt::CustomPattern ";
85  }
86  return "Qt::NoBrush";
87 }
virtual Painting * newOne()
Definition: painting.cpp:28
Painting()
Definition: painting.cpp:22
QString toPenString(int)
Definition: painting.cpp:54
virtual QString save()
Definition: painting.cpp:39
virtual QString saveJSON()
Definition: painting.cpp:49
#define isPainting
Definition: element.h:120
virtual QString saveCpp()
Definition: painting.cpp:44
QString toBrushString(int)
Definition: painting.cpp:67
virtual void Bounding(int &, int &, int &, int &)
Definition: painting.cpp:33