Qucs-GUI  0.0.18
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
rect3ddiagram.h
Go to the documentation of this file.
1 /***************************************************************************
2  rect3ddiagram.h
3  -----------------
4  begin : Sat Mar 5 2005
5  copyright : (C) 2005 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 
18 #ifndef RECT3DDIAGRAM_H
19 #define RECT3DDIAGRAM_H
20 
21 #include "diagram.h"
22 
23 
24 struct tPoint3D {
25  int x, y;
26  int No, done;
27 };
28 
29 struct tPointZ {
30  float z;
31  int No, NoCross;
32 };
33 
34 struct tBound {
35  int min, max;
36 };
37 
38 
39 class Rect3DDiagram : public Diagram {
40 public:
41  Rect3DDiagram(int _cx=0, int _cy=0);
43 
44 
45  Diagram* newOne();
46  static Element* info(QString&, char* &, bool getNewOne=false);
47  int calcDiagram();
48  void calcLimits();
49  void calcCoordinate(double* &, double* &, double* &, float*, float*, Axis*);
50 
51  void createAxisLabels();
52  bool insideDiagram(float, float);
53 
54  tPoint3D *Mem; // memory for all points during hidden line algorithm
55  tPoint3D *pMem; // current position in "Mem"
56 
57 
58 protected:
59  void calcData(Graph*);
60 
61 private:
62  int calcAxis(Axis*, int, int, double, double, bool);
63  void createAxis(Axis*, bool, int, int, int, int);
64 
65  void calcCoefficients();
66  int calcCross(int*, int*);
67  double calcX_2D(double, double, double);
68  double calcY_2D(double, double, double);
69  double calcZ_2D(double, double, double);
70 
71  static int comparePoint3D(const void*, const void*);
72  static int comparePointZ(const void*, const void*);
73  bool isHidden(int, int, tBound*, char*);
75  void calcLine(tPoint3D* &, tPoint3D* &, tBound*, char*);
76  void calcCoordinate3D(double, double, double, double, tPoint3D*, tPointZ*);
77  void removeHiddenLines(char*, tBound*);
78  void removeHiddenCross(int, int, int, int, char*, tBound*);
79 
80  float xorig, yorig; // where is the 3D origin with respect to cx/cy
81  double cxx, cxy, cxz, cyx, cyy, cyz, czx, czy, czz; // coefficients 3D -> 2D
82  double scaleX, scaleY;
83 };
84 
85 #endif
float z
Definition: rect3ddiagram.h:30
Definition: graph.h:57
static Element * info(QString &, char *&, bool getNewOne=false)
Rect3DDiagram(int _cx=0, int _cy=0)
Diagram * newOne()
double calcX_2D(double, double, double)
tPoint3D * pMem
Definition: rect3ddiagram.h:55
double calcZ_2D(double, double, double)
void removeHiddenLines(char *, tBound *)
static int comparePointZ(const void *, const void *)
bool insideDiagram(float, float)
void calcCoefficients()
void removeHiddenCross(int, int, int, int, char *, tBound *)
void calcCoordinate3D(double, double, double, double, tPoint3D *, tPointZ *)
void calcLine(tPoint3D *&, tPoint3D *&, tBound *, char *)
Definition: diagram.h:47
bool isHidden(int, int, tBound *, char *)
void enlargeMemoryBlock(tPoint3D *&)
Superclass of all schematic drawing elements.
Definition: element.h:142
double calcY_2D(double, double, double)
int calcCross(int *, int *)
tPoint3D * Mem
Definition: rect3ddiagram.h:54
void createAxis(Axis *, bool, int, int, int, int)
void calcData(Graph *)
int NoCross
Definition: rect3ddiagram.h:31
static int comparePoint3D(const void *, const void *)
int calcAxis(Axis *, int, int, double, double, bool)
void calcCoordinate(double *&, double *&, double *&, float *, float *, Axis *)