Develop and Download Open Source Software

Browse Subversion Repository

Contents of /trunk/circuits/QCircuit.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (show annotations) (download) (as text)
Wed Aug 3 10:14:23 2011 UTC (12 years, 8 months ago) by kaityo
File MIME type: text/x-chdr
File size: 1886 byte(s)
First commit
1 //---------------------------------------------------------------------------
2 // Class for Circuits
3 //---------------------------------------------------------------------------
4 #ifndef QCircuitH
5 #define QCircuitH
6
7 //---------------------------------------------------------------------------
8 #include <vector>
9 #include <map>
10 #include <string>
11 #include "QBits.h"
12 #include "QDraw.h"
13 #include "QPSDraw.h"
14 //---------------------------------------------------------------------------
15
16 enum QC_TYPES{
17 QC_NULL = -1, // No circuit
18 QC_BITBOX = 0,
19 QC_WALSH = 1,
20 QC_CNOT = 2,
21 QC_CCNOT = 3,
22 QC_TEXTBOX = 4,
23 QC_MEASURE = 5,
24 QC_PAULIX = 6,
25 QC_PAULIY = 7,
26 QC_PAULIZ = 8,
27 QC_SWAP = 9,
28 QC_CROT = 10,
29 QC_NOT = 11,
30 QC_ROT = 12
31 };
32
33
34 class QCircuit {
35
36
37 private:
38
39 protected:
40 int X,Y;
41 string Name;
42
43 public:
44
45 QCircuit(int x, int y);
46 static QCircuit* Create(string TypeStr, int x, int y, string Param);
47
48 int GetX(void) { return X; }
49 int GetY(void) { return Y; }
50 void SetX(int x) { X = x; }
51 void SetY(int y) { Y = y; }
52
53 static int GetType(string Type);
54 static const char* GetTypeStr(int Type);
55
56 virtual int GetType(void) { return QC_NULL; }
57 virtual string GetTypeStr(void) { return ""; }
58
59 virtual void Draw(QDraw *qDraw) {}
60 virtual string GetCalcText(void) {return "";}
61 virtual void DrawPS(QPSDraw *psDraw) {}
62 virtual string GetSaveText(void);
63 virtual string GetParam(void) {return "";}
64 virtual void ShowParamForm(void) {}
65 virtual void Reverse(int y) {}
66 virtual TRect GetOccupiedRect() {TRect rc; return rc;}
67 virtual QCircuit *Clone() {QCircuit *qc = new QCircuit(X,Y); return qc;}
68 };
69
70 typedef vector<QCircuit *> QList;
71
72 //---------------------------------------------------------------------------
73 #endif //QCircuitH

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26