Qucs-GUI  0.0.19
Data Structures | Public Types | Public Member Functions | Data Fields | Private Member Functions | Private Attributes
Graph Class Reference

prepare data for plotting purposes in Diagram. More...

#include <graph.h>

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

Data Structures

class  ScrPt

Public Types

typedef std::vector< ScrPtcontainer
typedef container::iterator iterator
typedef container::const_iterator const_iterator

Public Member Functions

 Graph (const Diagram *, const QString &_Line="")
 ~Graph ()
int loadDatFile (const QString &filename)
 does not (yet) load a dat file.
int loadIndepVarData (const QString &, char *datfilecontent, DataX *where)
 Reads the data of an independent variable.
void paint (ViewPainter *, int, int)
void paintLines (ViewPainter *, int, int)
QString save ()
bool load (const QString &)
int getSelected (int, int)
 Checks if the coordinates x/y point to the graph.
GraphsameNewOne ()
unsigned numAxes () const
DataX const * axis (uint i) const
size_t count (uint i) const
QString axisName (unsigned i) const
bool isEmpty () const
QVector< DataX * > & mutable_axes ()
void clear ()
void resizeScrPoints (size_t s)
iterator begin ()
iterator end ()
const_iterator begin () const
const_iterator end () const
void createMarkerText () const
std::pair< double, double > findSample (std::vector< double > &) const
 find a sample point close to VarPos, snap to it, and return data at VarPos
Diagram const * parentDiagram () const

Data Fields

QDateTime lastLoaded
int yAxisNo
double * cPointsY
int countY
QString Var
QColor Color
int Thick
graphstyle_t Style
QList< Marker * > Markers
int Precision
int numMode

Private Member Functions

DataXmutable_axis (uint i)
void drawLines (int, int, ViewPainter *) const
 draw a (line) graph from screen coord pairs
void drawStarSymbols (int, int, ViewPainter *) const
void drawCircleSymbols (int, int, ViewPainter *) const
void drawArrowSymbols (int, int, ViewPainter *) const

Private Attributes

QVector< DataX * > cPointsX
std::vector< ScrPtScrPoints
Diagram const * diagram

Detailed Description

prepare data for plotting purposes in Diagram.

a Graph is a list of graphs (bug?!) iterating yields points (in screen coordinates) and control tokens.

also stores markers.

Definition at line 86 of file graph.h.


Member Typedef Documentation

typedef container::const_iterator Graph::const_iterator

Definition at line 123 of file graph.h.

typedef std::vector<ScrPt> Graph::container

Definition at line 121 of file graph.h.

typedef container::iterator Graph::iterator

Definition at line 122 of file graph.h.


Constructor & Destructor Documentation

Graph::Graph ( const Diagram d,
const QString &  _Line = "" 
)

Definition at line 27 of file graph.cpp.

Here is the caller graph for this function:

Definition at line 45 of file graph.cpp.


Member Function Documentation

DataX const* Graph::axis ( uint  i) const [inline]

Definition at line 139 of file graph.h.

Here is the caller graph for this function:

QString Graph::axisName ( unsigned  i) const [inline]

Definition at line 141 of file graph.h.

Here is the call graph for this function:

Here is the caller graph for this function:

iterator Graph::begin ( ) [inline]

Definition at line 147 of file graph.h.

Here is the caller graph for this function:

const_iterator Graph::begin ( ) const [inline]

Definition at line 149 of file graph.h.

void Graph::clear ( ) [inline]

Definition at line 145 of file graph.h.

Here is the caller graph for this function:

size_t Graph::count ( uint  i) const [inline]

Definition at line 140 of file graph.h.

Here is the call graph for this function:

Here is the caller graph for this function:

void Graph::createMarkerText ( ) const

Definition at line 52 of file graph.cpp.

Here is the caller graph for this function:

void Graph::drawArrowSymbols ( int  x0i,
int  y0i,
ViewPainter p 
) const [private]

Definition at line 231 of file viewpainter.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void Graph::drawCircleSymbols ( int  x0i,
int  y0i,
ViewPainter p 
) const [private]

Definition at line 206 of file viewpainter.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void Graph::drawLines ( int  x0,
int  y0,
ViewPainter p 
) const [private]

draw a (line) graph from screen coord pairs

Definition at line 104 of file viewpainter.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void Graph::drawStarSymbols ( int  x0i,
int  y0i,
ViewPainter p 
) const [private]

Definition at line 173 of file viewpainter.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

iterator Graph::end ( ) [inline]

Definition at line 148 of file graph.h.

Here is the caller graph for this function:

const_iterator Graph::end ( ) const [inline]

Definition at line 150 of file graph.h.

std::pair< double, double > Graph::findSample ( std::vector< double > &  VarPos) const

find a sample point close to VarPos, snap to it, and return data at VarPos

Definition at line 269 of file graph.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

int Graph::getSelected ( int  x,
int  y 
)

Checks if the coordinates x/y point to the graph.

returns the number of the branch of the graph, -1 upon a miss.

x/y are relative to diagram cx/cy. 5 is the precision the user must point onto the graph.

FIXME: should return reference to hit sample point or some context.

Definition at line 164 of file graph.cpp.

Here is the caller graph for this function:

bool Graph::isEmpty ( ) const [inline]

Definition at line 142 of file graph.h.

Here is the caller graph for this function:

bool Graph::load ( const QString &  _s)

Definition at line 112 of file graph.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

int Graph::loadDatFile ( const QString &  fileName)

does not (yet) load a dat file.

only part of it. this way, it would belong to graph.cpp. but it's too obsolete, lets see..

FIXME: must invalidate markers.

Definition at line 783 of file diagram.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

int Graph::loadIndepVarData ( const QString &  Variable,
char *  FileString,
DataX pD 
)

Reads the data of an independent variable.

Returns the number of points.

Definition at line 1024 of file diagram.cpp.

Here is the caller graph for this function:

QVector<DataX*>& Graph::mutable_axes ( ) [inline]

Definition at line 143 of file graph.h.

Here is the caller graph for this function:

DataX* Graph::mutable_axis ( uint  i) [inline, private]

Definition at line 136 of file graph.h.

Here is the caller graph for this function:

unsigned Graph::numAxes ( ) const [inline]

Definition at line 138 of file graph.h.

Here is the caller graph for this function:

void Graph::paint ( ViewPainter p,
int  x0,
int  y0 
)

Definition at line 60 of file graph.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void Graph::paintLines ( ViewPainter p,
int  x0,
int  y0 
)

Definition at line 80 of file graph.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Diagram const* Graph::parentDiagram ( ) const [inline]

Definition at line 174 of file graph.h.

Here is the caller graph for this function:

void Graph::resizeScrPoints ( size_t  s) [inline]

Definition at line 146 of file graph.h.

Here is the caller graph for this function:

Definition at line 248 of file graph.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

QString Graph::save ( )

Definition at line 98 of file graph.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:


Field Documentation

QColor Graph::Color

Definition at line 157 of file graph.h.

Definition at line 155 of file graph.h.

QVector<DataX*> Graph::cPointsX [private]

Definition at line 176 of file graph.h.

double* Graph::cPointsY

Definition at line 154 of file graph.h.

Diagram const* Graph::diagram [private]

Definition at line 178 of file graph.h.

QDateTime Graph::lastLoaded

Definition at line 152 of file graph.h.

Definition at line 160 of file graph.h.

Definition at line 164 of file graph.h.

Definition at line 163 of file graph.h.

std::vector<ScrPt> Graph::ScrPoints [private]

Definition at line 177 of file graph.h.

Definition at line 159 of file graph.h.

Definition at line 158 of file graph.h.

QString Graph::Var

Definition at line 156 of file graph.h.

Definition at line 153 of file graph.h.


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