Qucs-GUI  0.0.19
Public Member Functions | Data Fields | Protected Member Functions | Private Attributes
Diagram Class Reference

The Diagram class is a superclass for diagrams. More...

#include <diagram.h>

Inheritance diagram for Diagram:
Inheritance graph
[legend]
Collaboration diagram for Diagram:
Collaboration graph
[legend]

Public Member Functions

 Diagram (int _cx=0, int _cy=0)
virtual ~Diagram ()
virtual DiagramnewOne ()
virtual int calcDiagram ()
virtual void calcCoordinate (const double *, const double *, const double *, float *, float *, Axis const *) const
void calcCoordinateP (const double *x, const double *y, const double *z, Graph::iterator &p, Axis const *A) const
virtual void finishMarkerCoordinates (float &, float &) const
virtual void calcLimits ()
virtual QString extraMarkerText (Marker const *) const
virtual void paint (ViewPainter *)
 Paint function for most diagrams (cartesian, smith, polar, ...)
void setCenter (int, int, bool relative=false)
void getCenter (int &, int &)
void paintScheme (Schematic *)
void Bounding (int &, int &, int &, int &)
bool getSelected (int, int)
bool resizeTouched (float, float, float)
 Checks if the resize area was clicked.
QString save ()
bool load (const QString &, QTextStream *)
void getAxisLimits (Graph *)
void updateGraphData ()
void loadGraphData (const QString &)
void recalcGraphData ()
 Calculate diagram again without reading dataset from file.
bool sameDependencies (Graph const *, Graph const *) const
 Checks if the two graphs have the same independent variables.
int checkColumnWidth (const QString &, const QFontMetrics &, int, int, int)
virtual bool insideDiagram (float, float) const
bool insideDiagramP (Graph::iterator const &) const
MarkersetMarker (int x, int y)
 (try to) set a Marker to a diagram

Data Fields

QString Name
QPen GridPen
QList< Graph * > Graphs
QList< Arc * > Arcs
QList< Line * > Lines
QList< Text * > Texts
int x3
int y3
Axis xAxis
Axis yAxis
Axis zAxis
int State
bool hideLines
int rotX
int rotY
int rotZ

Protected Member Functions

void calcSmithAxisScale (Axis *, int &, int &)
void createSmithChart (Axis *, int Mode=7)
void calcPolarAxisScale (Axis *, double &, double &, double &)
void createPolarDiagram (Axis *, int Mode=3)
bool calcAxisScale (Axis *, double &, double &, double &, double &, double)
 Calculations for Cartesian diagrams (RectDiagram and Rect3DDiagram).
bool calcAxisLogScale (Axis *, int &, double &, double &, double &, int)
 Calculations for logarithmical Cartesian diagrams (RectDiagram and Rect3DDiagram).
bool calcYAxis (Axis *, int)
virtual void createAxisLabels ()
 Put axis labels into the text list.
int regionCode (float, float) const
virtual void clip (Graph::iterator &) const
 Clipping for round diagrams (smith, polar, ...)
void rectClip (Graph::iterator &) const
 Cohen-Sutherland clipping algorithm.
virtual void calcData (Graph *)

Private Attributes

int Bounding_x1
int Bounding_x2
int Bounding_y1
int Bounding_y2

Detailed Description

The Diagram class is a superclass for diagrams.

Todo:
Should probably use QFontMetrics::boundingRect(QString).width instead of QFontMetrics::width(QString), since only the first gives the actual width (see Qt docs)

Definition at line 59 of file diagram.h.


Constructor & Destructor Documentation

Diagram::Diagram ( int  _cx = 0,
int  _cy = 0 
)

Definition at line 53 of file diagram.cpp.

Here is the caller graph for this function:

Diagram::~Diagram ( ) [virtual]

Definition at line 85 of file diagram.cpp.


Member Function Documentation

void Diagram::Bounding ( int &  _x1,
int &  _y1,
int &  _x2,
int &  _y2 
)

Definition at line 572 of file diagram.cpp.

Here is the caller graph for this function:

bool Diagram::calcAxisLogScale ( Axis Axis,
int &  z,
double &  zD,
double &  zDstep,
double &  corr,
int  len 
) [protected]

Calculations for logarithmical Cartesian diagrams (RectDiagram and Rect3DDiagram).

Parameters:
Axis- pointer to the axis to scale
len- length of axis in pixel on the screen
Returns:
value: "true" if axis runs from largest to smallest value
Parameters:
[out]z- screen coordinate where the first grid is placed
[out]zD- number where the first grid is placed
[out]zDstep- number increment from one grid to the next
[out]coor- scale factor for calculate screen coordinate
Todo:
use this as example to document other methods

Definition at line 1774 of file diagram.cpp.

Here is the caller graph for this function:

bool Diagram::calcAxisScale ( Axis Axis,
double &  GridNum,
double &  zD,
double &  zDstep,
double &  GridStep,
double  Dist 
) [protected]

Calculations for Cartesian diagrams (RectDiagram and Rect3DDiagram).

Parameters:
Axis- pointer to the axis to scale
Dist- length of axis in pixel on the screen
Returns:
value: "true" if axis runs from largest to smallest value
Parameters:
[out]GridNum- number where the first numbered grid is placed
[out]GridStep- distance from one grid to the next
[out]zD- screen coordinate where the first grid is placed
[out]zDstep- distance on screen from one grid to the next

Definition at line 1652 of file diagram.cpp.

Here is the caller graph for this function:

virtual void Diagram::calcCoordinate ( const double *  ,
const double *  ,
const double *  ,
float *  ,
float *  ,
Axis const *   
) const [inline, virtual]

Reimplemented in Rect3DDiagram, PSDiagram, SmithDiagram, CurveDiagram, PolarDiagram, and RectDiagram.

Definition at line 67 of file diagram.h.

Here is the caller graph for this function:

void Diagram::calcCoordinateP ( const double *  x,
const double *  y,
const double *  z,
Graph::iterator p,
Axis const *  A 
) const

Definition at line 1954 of file diagram.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void Diagram::calcData ( Graph g) [protected, virtual]

Reimplemented in Rect3DDiagram, and TabDiagram.

Definition at line 482 of file diagram.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

virtual int Diagram::calcDiagram ( ) [inline, virtual]

Reimplemented in Rect3DDiagram, PSDiagram, SmithDiagram, CurveDiagram, PolarDiagram, RectDiagram, TabDiagram, TimingDiagram, and TruthDiagram.

Definition at line 65 of file diagram.h.

Here is the caller graph for this function:

virtual void Diagram::calcLimits ( ) [inline, virtual]

Reimplemented in Rect3DDiagram, PSDiagram, SmithDiagram, CurveDiagram, PolarDiagram, and RectDiagram.

Definition at line 70 of file diagram.h.

Here is the caller graph for this function:

void Diagram::calcPolarAxisScale ( Axis Axis,
double &  numGrids,
double &  GridStep,
double &  zD 
) [protected]

Definition at line 1537 of file diagram.cpp.

Here is the caller graph for this function:

void Diagram::calcSmithAxisScale ( Axis Axis,
int &  GridX,
int &  GridY 
) [protected]

Definition at line 1380 of file diagram.cpp.

Here is the caller graph for this function:

bool Diagram::calcYAxis ( Axis Axis,
int  x0 
) [protected]

Definition at line 1865 of file diagram.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

int Diagram::checkColumnWidth ( const QString &  Str,
const QFontMetrics &  metrics,
int  colWidth,
int  x,
int  y 
)

Definition at line 1129 of file diagram.cpp.

Here is the caller graph for this function:

void Diagram::clip ( Graph::iterator p) const [protected, virtual]

Clipping for round diagrams (smith, polar, ...)

Reimplemented in CurveDiagram, and RectDiagram.

Definition at line 418 of file diagram.cpp.

Here is the caller graph for this function:

void Diagram::createAxisLabels ( ) [protected, virtual]

Put axis labels into the text list.

Reimplemented in Rect3DDiagram, and TabDiagram.

Definition at line 162 of file diagram.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void Diagram::createPolarDiagram ( Axis Axis,
int  Mode = 3 
) [protected]

Definition at line 1574 of file diagram.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void Diagram::createSmithChart ( Axis Axis,
int  Mode = 7 
) [protected]

Definition at line 1400 of file diagram.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

virtual QString Diagram::extraMarkerText ( Marker const *  ) const [inline, virtual]

Reimplemented in SmithDiagram.

Definition at line 71 of file diagram.h.

Here is the caller graph for this function:

void Diagram::finishMarkerCoordinates ( float &  fCX,
float &  fCY 
) const [virtual]

Reimplemented in Rect3DDiagram, CurveDiagram, and RectDiagram.

Definition at line 1172 of file diagram.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void Diagram::getAxisLimits ( Graph pg)

Definition at line 612 of file diagram.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void Diagram::getCenter ( int &  x,
int &  y 
) [virtual]

Reimplemented from Element.

Definition at line 1159 of file diagram.cpp.

bool Diagram::getSelected ( int  x_,
int  y_ 
)

Definition at line 581 of file diagram.cpp.

Here is the caller graph for this function:

bool Diagram::insideDiagram ( float  x,
float  y 
) const [virtual]

Reimplemented in Rect3DDiagram, CurveDiagram, and RectDiagram.

Definition at line 310 of file diagram.cpp.

Here is the caller graph for this function:

bool Diagram::insideDiagramP ( Graph::iterator const &  p) const

Definition at line 1948 of file diagram.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool Diagram::load ( const QString &  Line,
QTextStream *  stream 
)

Definition at line 1227 of file diagram.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void Diagram::loadGraphData ( const QString &  defaultDataSet)

Definition at line 677 of file diagram.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Diagram * Diagram::newOne ( ) [virtual]

Reimplemented in Rect3DDiagram, PSDiagram, CurveDiagram, PolarDiagram, RectDiagram, SmithDiagram, TabDiagram, TimingDiagram, and TruthDiagram.

Definition at line 1166 of file diagram.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void Diagram::paint ( ViewPainter p) [virtual]

Paint function for most diagrams (cartesian, smith, polar, ...)

Reimplemented in TabDiagram, and TimingDiagram.

Definition at line 92 of file diagram.cpp.

Here is the call graph for this function:

void Diagram::paintScheme ( Schematic p) [virtual]

Reimplemented from Element.

Definition at line 154 of file diagram.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Calculate diagram again without reading dataset from file.

Definition at line 722 of file diagram.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void Diagram::rectClip ( Graph::iterator p) const [protected]

Cohen-Sutherland clipping algorithm.

Definition at line 341 of file diagram.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

int Diagram::regionCode ( float  x,
float  y 
) const [protected]

Definition at line 292 of file diagram.cpp.

Here is the caller graph for this function:

bool Diagram::resizeTouched ( float  fX,
float  fY,
float  len 
)

Checks if the resize area was clicked.

If so return "true" and sets x1/y1 and x2/y2 to the border coordinates to draw a rectangle.

Definition at line 593 of file diagram.cpp.

bool Diagram::sameDependencies ( Graph const *  g1,
Graph const *  g2 
) const

Checks if the two graphs have the same independent variables.

Definition at line 1114 of file diagram.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

QString Diagram::save ( )

Definition at line 1181 of file diagram.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void Diagram::setCenter ( int  x,
int  y,
bool  relative = false 
) [virtual]

Reimplemented from Element.

Definition at line 1148 of file diagram.cpp.

Marker * Diagram::setMarker ( int  x,
int  y 
)

(try to) set a Marker to a diagram

Definition at line 321 of file diagram.cpp.

Here is the call graph for this function:

Definition at line 753 of file diagram.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:


Field Documentation

QList<Arc *> Diagram::Arcs

Definition at line 98 of file diagram.h.

int Diagram::Bounding_x1 [private]

Definition at line 127 of file diagram.h.

int Diagram::Bounding_x2 [private]

Definition at line 127 of file diagram.h.

int Diagram::Bounding_y1 [private]

Definition at line 127 of file diagram.h.

int Diagram::Bounding_y2 [private]

Definition at line 127 of file diagram.h.

Definition at line 97 of file diagram.h.

Definition at line 95 of file diagram.h.

Definition at line 106 of file diagram.h.

QList<Line *> Diagram::Lines

Definition at line 99 of file diagram.h.

QString Diagram::Name

Definition at line 94 of file diagram.h.

Definition at line 107 of file diagram.h.

Definition at line 107 of file diagram.h.

Definition at line 107 of file diagram.h.

Definition at line 104 of file diagram.h.

QList<Text *> Diagram::Texts

Definition at line 100 of file diagram.h.

Definition at line 102 of file diagram.h.

Definition at line 103 of file diagram.h.

Definition at line 102 of file diagram.h.

Definition at line 103 of file diagram.h.

Definition at line 103 of file diagram.h.


The documentation for this class was generated from the following files:
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines