Commit c32418fb authored by Anne-Marie Mahfouf's avatar Anne-Marie Mahfouf

more de -> en and doxy comments fixes

svn path=/trunk/kdeedu/kmplot/; revision=302279
parent f3012923
/*
* KmPlot - a math. function plotter for the KDE-Desktop
*
* Copyright (C) 1998, 1999 Klaus-Dieter Möller
* 2000, 2002 kd.moeller@t-online.de
*
* This file is part of the KDE Project.
* KmPlot is part of the KDE-EDU Project.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
#include "View.h"
#include "View.moc"
......@@ -54,7 +79,7 @@ void View::draw(QPaintDevice *dev, int form)
lx=(int)((xmax-xmin)*100.*drskalx/tlgx);
ly=(int)((ymax-ymin)*100.*drskaly/tlgy);
dgr.Create(ref, lx, ly, xmin, xmax, ymin, ymax, mode);
DC.translate(-dgr.GetRahmen().left(), -dgr.GetRahmen().top());
DC.translate(-dgr.GetFrame().left(), -dgr.GetFrame().top());
s=1.;
}
else if(form==3) // bmp, png
......@@ -64,10 +89,10 @@ void View::draw(QPaintDevice *dev, int form)
ly=(int)((ymax-ymin)*100.*drskaly/tlgy);
dgr.Create(ref, lx, ly, xmin, xmax, ymin, ymax, mode);
DC.end();
((QPixmap *)dev)->resize((int)(dgr.GetRahmen().width()*sf), (int)(dgr.GetRahmen().height()*sf));
((QPixmap *)dev)->resize((int)(dgr.GetFrame().width()*sf), (int)(dgr.GetFrame().height()*sf));
((QPixmap *)dev)->fill();
DC.begin(dev);
DC.translate(-dgr.GetRahmen().left()*sf, -dgr.GetRahmen().top()*sf);
DC.translate(-dgr.GetFrame().left()*sf, -dgr.GetFrame().top()*sf);
DC.scale(sf, sf);
s=1.;
}
......@@ -89,7 +114,8 @@ void View::draw(QPaintDevice *dev, int form)
sw=rsw*(xmax-xmin)/area.width();
for(ix=0; ix<ps.ufanz; ++ix)
{ if(ps.chkfix(ix)==-1) continue;
{
if(ps.chkfix(ix)==-1) continue;
plotfkt(ix, &DC);
}
......@@ -100,7 +126,8 @@ void View::draw(QPaintDevice *dev, int form)
void View::plotfkt(int ix, QPainter *pDC)
{ char fktmode, p_mode;
{
char fktmode, p_mode;
int iy, k, ke, mflg;
double dx, x, y, dmin, dmax;
QString fname, fstr;
......@@ -115,12 +142,14 @@ void View::plotfkt(int ix, QPainter *pDC)
fktmode=ps.fktext[ix].extstr[0].latin1();
if(fktmode!='y')
{ dmin=ps.fktext[ix].dmin;
{
dmin=ps.fktext[ix].dmin;
dmax=ps.fktext[ix].dmax;
}
if(dmin==dmax)
{ if(fktmode=='r')
{
if(fktmode=='r')
{ dmin=0.;
dmax=2*M_PI;
}
......@@ -132,7 +161,8 @@ void View::plotfkt(int ix, QPainter *pDC)
if(fktmode=='r') dx=rsw*0.05/(dmax-dmin);
else if(fktmode=='x')
{ ps.getfkt(ix, fname, fstr);
{
ps.getfkt(ix, fname, fstr);
fname[0]='y';
iy=ps.getfix(fname);
if(iy==-1) return ;
......@@ -142,13 +172,16 @@ void View::plotfkt(int ix, QPainter *pDC)
p_mode=0;
pDC->setPen(pen);
while(1)
{ k=0;
{
k=0;
ke=ps.fktext[ix].k_anz;
do
{ ps.setparameter(ix, ps.fktext[ix].k_liste[k]);
{
ps.setparameter(ix, ps.fktext[ix].k_liste[k]);
mflg=2;
for(x=dmin; x<dmax; x+=dx)
{ errno=0;
{
errno=0;
switch(p_mode)
{ case 0: y=ps.fkt(ix, x);
......@@ -162,30 +195,37 @@ void View::plotfkt(int ix, QPainter *pDC)
if(errno!=0) continue;
if(fktmode=='r')
{ p2.setX(dgr.Transx(y*cos(x)));
{
p2.setX(dgr.Transx(y*cos(x)));
p2.setY(dgr.Transy(y*sin(x)));
}
else if(fktmode=='x')
{ p2.setX(dgr.Transx(y));
{
p2.setX(dgr.Transx(y));
p2.setY(dgr.Transy(ps.fkt(iy, x)));
}
else
{ p2.setX(dgr.Transx(x));
{
p2.setX(dgr.Transx(x));
p2.setY(dgr.Transy(y));
}
if(dgr.xclipflg || dgr.yclipflg)
{ if(mflg>=1) p1=p2;
{
if(mflg>=1) p1=p2;
else
{ pDC->drawLine(p1, p2); p1=p2;
{
pDC->drawLine(p1, p2); p1=p2;
mflg=1;
}
}
else
{ if(mflg>1) p1=p2;
{
if(mflg>1) p1=p2;
else
{ pDC->drawLine(p1, p2); p1=p2;
{
pDC->drawLine(p1, p2); p1=p2;
}
mflg=0;
}
......@@ -250,7 +290,8 @@ void View::tabelle(QPainter *pDC)
pDC->drawText(0, 300, i18n("Functions:"));
pDC->Lineh(0, 320, 700);
for(ix=0, ypos=380; ix<ps.ufanz; ++ix)
{ if(ps.chkfix(ix)==-1) continue;
{
if(ps.chkfix(ix)==-1) continue;
pDC->drawText(100, ypos, ps.fktext[ix].extstr);
ypos+=60;
......
/*
* KmPlot - a math. function plotter for the KDE-Desktop
*
* Copyright (C) 1998, 1999 Klaus-Dieter Möller
* 2000, 2002 kd.moeller@t-online.de
*
* This file is part of the KDE Project.
* KmPlot is part of the KDE-EDU Project.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
#ifndef View_included
#define View_included
......
......@@ -39,7 +39,8 @@ int isinf(double x) { return !finite(x) && x==x; }
CDiagr::CDiagr()
{ RahmenFarbe=qRgb(0, 0, 0);
{
RahmenFarbe=qRgb(0, 0, 0);
axesColor=qRgb(0, 0, 0);
gridColor=qRgb(192, 192, 192);
borderThickness=2;
......@@ -61,7 +62,7 @@ void CDiagr::Create(QPoint Ref, // Bezugspunkt links unten
int lx, int ly, // Achsenl�gen
double xmin, double xmax, // x-Wertebereich
double ymin, double ymax, // y-Wertebereich
char mode) // Modus (Achsen, Pfeile, Rahmen)
char mode) // Modus (Achsen, ARROWS, FRAME)
{ int x, y, h, w;
CDiagr::xmin=xmin; // globale Variablen setzen
......@@ -78,7 +79,7 @@ void CDiagr::Create(QPoint Ref, // Bezugspunkt links unten
ox=Ref.x()-skx*xmin+0.5; // Ursprungskoordinaten berechnen
oy=Ref.y()+sky*ymax+0.5;
PlotArea.setRect(x=Ref.x(), y=Ref.y(), w=lx, h=ly);
if(mode&EXTRAHMEN)
if(mode&EXTFRAME)
{ x-=20;
y-=20;
w+=40;
......@@ -99,7 +100,8 @@ void CDiagr::Create(QPoint Ref, // Bezugspunkt links unten
void CDiagr::Skal(double ex, double ey, char g_mode)
{ CDiagr::ex=ex;
{
CDiagr::ex=ex;
CDiagr::ey=ey;
CDiagr::g_mode=g_mode;
tsx=ceil(xmin/ex)*ex;
......@@ -108,13 +110,16 @@ void CDiagr::Skal(double ex, double ey, char g_mode)
void CDiagr::Plot(QPainter* pDC)
{ QPen pen(RahmenFarbe, borderThickness);
{
QPen pen(RahmenFarbe, borderThickness);
if(g_mode) Raster(pDC); // Raster zeichnen
Achsen(pDC); // Achsen zeichnen
if(mode&LABEL) Beschriftung(pDC); // Achsen beschriften
if(mode&(RAHMEN|EXTRAHMEN)) // Rahmen zeichnen
{ pDC->setPen(pen);
if(mode&LABEL)
Beschriftung(pDC); // Achsen beschriften
if(mode&(FRAME|EXTFRAME)) // FRAME zeichnen
{
pDC->setPen(pen);
pDC->drawRect(Rahmen);
}
}
......@@ -179,7 +184,7 @@ void CDiagr::Achsen(QPainter* pDC) // Achsen zeichnen
pDC->setPen(QPen(axesColor, axesThickness));
pDC->Lineh(PlotArea.left(), b=Transy(0.), a=PlotArea.right()); // x-Achse
if(mode&PFEILE && !(mode&RAHMEN) && xmax>0.) // Pfeile
if(mode&ARROWS && !(mode&FRAME) && xmax>0.) // ARROWS
{ dx=40;
dy=15;
pDC->Line(a, b, a-dx, b+dy);
......@@ -187,7 +192,7 @@ void CDiagr::Achsen(QPainter* pDC) // Achsen zeichnen
}
pDC->Linev(a=Transx(0.), PlotArea.bottom(), b=PlotArea.top()); // y-Achse
if(mode&PFEILE && !(mode&RAHMEN) && ymax> 0.) // Pfeile
if(mode&ARROWS && !(mode&FRAME) && ymax> 0.) // ARROWS
{ dx=15;
dy=40;
pDC->Line(a, b, a-dx, b+dy);
......@@ -199,7 +204,7 @@ void CDiagr::Achsen(QPainter* pDC) // Achsen zeichnen
if(mode&AXES)
{ da=oy-gradLength;
db=oy+gradLength;
tl=(mode&RAHMEN)? 0: gradLength;
tl=(mode&FRAME)? 0: gradLength;
d=tsx;
if(da<(double)PlotArea.top())
{ a=PlotArea.top()-tl;
......@@ -240,7 +245,7 @@ void CDiagr::Achsen(QPainter* pDC) // Achsen zeichnen
d+=ey;
}
}
else if(mode&RAHMEN)
else if(mode&FRAME)
{ a=PlotArea.bottom()+gradLength;
b=PlotArea.top()-gradLength;
d=tsx;
......
......@@ -40,9 +40,9 @@
#define Linev(x, y1, y2) drawLine(x, y1, x, y2)
#define AXES 1 /**< visible axes */
#define PFEILE 2 /**< axes with arrows */
#define RAHMEN 4 /**< visible frame */
#define EXTRAHMEN 8 /**< bigger frame */
#define ARROWS 2 /**< axes with arrows */
#define FRAME 4 /**< visible frame */
#define EXTFRAME 8 /**< bigger frame */
#define LABEL 16 /**< visible labels */
#define LINIENRASTER 1 /**< line grid */
......@@ -66,7 +66,7 @@ public:
void Skal(double ex, double ey, char g_mode);
void Plot(QPainter* pDC);
QRect GetPlotArea() {return PlotArea;}
QRect GetRahmen() {return Rahmen;}
QRect GetFrame() {return Rahmen;}
int Transx(double),
Transy(double);
......
/*
* KmPlot - a math. function plotter for the KDE-Desktop
*
* Copyright (C) 1998, 1999 Klaus-Dieter Mler
* Copyright (C) 1998, 1999 Klaus-Dieter Möller
* 2000, 2002 kd.moeller@t-online.de
*
* This file is part of the KDE Project.
......@@ -45,9 +45,6 @@ KEditFunction::KEditFunction( XParser* parser, QWidget* parent, const char* name
m_parser = parser;
}
/**
* Fill the dialog's widgets with the properties of the parser function number index.
*/
void KEditFunction::initDialog( int index )
{
m_index = index;
......@@ -55,9 +52,6 @@ void KEditFunction::initDialog( int index )
else setWidgets();
}
/**
* Clear alls widgets values
*/
void KEditFunction::clearWidgets()
{
kLineEditYFunction->clear();
......@@ -73,9 +67,6 @@ void KEditFunction::clearWidgets()
kColorButtonColor->setColor( m_parser->fktext[ m_parser->getNextIndex() ].color );
}
/**
* Fill the dialog's widgets with values from the parser
*/
void KEditFunction::setWidgets()
{
kLineEditYFunction->setText( m_parser->fktext[ m_index ].extstr );
......@@ -96,9 +87,6 @@ void KEditFunction::setWidgets()
kColorButtonColor->setColor( m_parser->fktext[ m_index ].color );
}
/**
* Overwrites the dialog's accept() method to make sure, that the user's input is valid.
*/
void KEditFunction::accept()
{
// if we are editing an existing function, first delete the old one
......@@ -155,9 +143,6 @@ void KEditFunction::accept()
QEditFunction::accept();
}
/**
* return the well formed function equation for the listbox in FktDlg
*/
const QString KEditFunction::functionItem()
{
return kLineEditYFunction->text();
......
/*
* KmPlot - a math. function plotter for the KDE-Desktop
*
* Copyright (C) 1998, 1999 Klaus-Dieter Mler
* Copyright (C) 1998, 1999 Klaus-Dieter Möller
* 2000, 2002 kd.moeller@t-online.de
*
* This file is part of the KDE Project.
......@@ -36,17 +36,31 @@ class KEditFunction : public QEditFunction
public:
KEditFunction( XParser* parser, QWidget* parent = NULL, const char* name = NULL );
virtual ~KEditFunction() {};
/**
* Fill the dialog's widgets with the properties of the parser function number index.
*/
void initDialog( int index = -1 );
/**
* return the well formed function equation for the listbox in FktDlg
*/
const QString functionItem();
private:
/**
* Clear alls widgets values
*/
void clearWidgets();
/**
* Fill the dialog's widgets with values from the parser
*/
void setWidgets();
XParser* m_parser;
int m_index;
protected slots:
/**
* Overwrites the dialog's accept() method to make sure, that the user's input is valid.
*/
virtual void accept();
void slotHelp();
};
......
/*
* KmPlot - a math. function plotter for the KDE-Desktop
*
* Copyright (C) 1998, 1999 Klaus-Dieter Mler
* Copyright (C) 1998, 1999 Klaus-Dieter Möller
* 2000, 2002 kd.moeller@t-online.de
*
* This file is part of the KDE Project.
......@@ -46,9 +46,6 @@ KEditParametric::KEditParametric( XParser* parser, QWidget* parent, const char*
m_parser = parser;
}
/**
* Fill the dialog's widgets with the properties of the parser function number index.
*/
void KEditParametric::initDialog( int x_index, int y_index )
{
m_x_index = x_index;
......@@ -57,9 +54,6 @@ void KEditParametric::initDialog( int x_index, int y_index )
else setWidgets();
}
/**
* Clear alls widgets values
*/
void KEditParametric::clearWidgets()
{
kLineEditName->clear();
......@@ -73,9 +67,6 @@ void KEditParametric::clearWidgets()
kColorButtonColor->setColor( m_parser->fktext[ m_parser->getNextIndex() ].color );
}
/**
* Fill the dialog's widgets with values from the parser
*/
void KEditParametric::setWidgets()
{
QString name, expression;
......@@ -92,9 +83,6 @@ void KEditParametric::setWidgets()
kColorButtonColor->setColor( m_parser->fktext[ m_x_index ].color );
}
/**
* Overwrites the dialog's accept() method to make sure, that the user's input is valid.
*/
void KEditParametric::accept()
{
// if we are editing an existing function, first delete the old one
......@@ -173,17 +161,11 @@ QString KEditParametric::newName()
return name.arg( i );
}
/**
* return the well formed function equation
*/
QString KEditParametric::xFunction()
{
return "x" + kLineEditName->text() + "(t)=" + kLineEditXFunction->text();
}
/**
* extract function name and expression from a given expression
*/
void KEditParametric::splitEquation( const QString equation, QString &name, QString &expression )
{
int start = 0;
......@@ -194,9 +176,6 @@ void KEditParametric::splitEquation( const QString equation, QString &name, QStr
expression = equation.section( '=', 1, 1 );
}
/**
* return the well formed function equation
*/
QString KEditParametric::yFunction()
{
return "y" + kLineEditName->text() + "(t)=" + kLineEditYFunction->text();
......
/*
* KmPlot - a math. function plotter for the KDE-Desktop
*
* Copyright (C) 1998, 1999 Klaus-Dieter Möller
* Copyright (C) 1998, 1999 Klaus-Dieter Möller
* 2000, 2002 kd.moeller@t-online.de
*
* This file is part of the KDE Project.
......@@ -37,20 +37,41 @@ class KEditParametric : public QEditParametric
KEditParametric( XParser* parser, QWidget* parent = NULL, const char* name = NULL );
virtual ~KEditParametric() {};
/**
* Fill the dialog's widgets with the properties of the parser function number index.
*/
void initDialog( int index = -1, int y_index = -1 );
const QString functionItem();
private:
/**
* Clear alls widgets values
*/
void clearWidgets();
/**
* Fill the dialog's widgets with values from the parser
*/
void setWidgets();
/**
* return the well formed function equation
*/
QString xFunction();
/**
* return the well formed function equation
*/
QString yFunction();
QString newName();
QString newName();
/**
* extract function name and expression from a given expression
*/
void splitEquation( const QString equation, QString &name, QString &expression );
XParser* m_parser;
int m_x_index, m_y_index;
protected slots:
/**
* Overwrites the dialog's accept() method to make sure, that the user's input is valid.
*/
virtual void accept();
void slotHelp();
};
......
/*
* KmPlot - a math. function plotter for the KDE-Desktop
*
* Copyright (C) 1998, 1999 Klaus-Dieter Mler
* Copyright (C) 1998, 1999 Klaus-Dieter Möller
* 2000, 2002 kd.moeller@t-online.de
*
* This file is part of the KDE Project.
......
/*
* KmPlot - a math. function plotter for the KDE-Desktop
*
* Copyright (C) 1998, 1999 Klaus-Dieter Mler
* Copyright (C) 1998, 1999 Klaus-Dieter Möller
* 2000, 2002 kd.moeller@t-online.de
*
* This file is part of the KDE Project.
......@@ -38,7 +38,7 @@ class KEditPolar : public QEditPolar
virtual ~KEditPolar() {};
/**
* Fill the dialog's widgets with the properties of the parser function number index.
* Fill the dialog widgets with the properties of the parser function number index.
*/
void initDialog( int index = -1 );
// void setFunction( int index );
......
/*
* KmPlot - a math. function plotter for the KDE-Desktop
*
* Copyright (C) 1998, 1999 Klaus-Dieter Mler
* Copyright (C) 1998, 1999 Klaus-Dieter Möller
* 2000, 2002 kd.moeller@t-online.de
*
* This file is part of the KDE Project.
......
/*
* KmPlot - a math. function plotter for the KDE-Desktop
*
* Copyright (C) 1998, 1999 Klaus-Dieter Möller
* 2000, 2002 kd.moeller@t-online.de
*
* This file is part of the KDE Project.
* KmPlot is part of the KDE-EDU Project.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
// KDE includes
#include <kmessagebox.h>
#include <kurl.h>
......@@ -52,7 +76,7 @@ bool printtable; // header table printing option
void getSettings()
{
mode = AXES | PFEILE | EXTRAHMEN;
mode = AXES | ARROWS | EXTFRAME;
rsw = 1.;
// axes settings
......
/*
* KmPlot - a math. function plotter for the KDE-Desktop
*
* Copyright (C) 1998, 1999 Klaus-Dieter Mler
* Copyright (C) 1998, 1999 Klaus-Dieter Möller
* 2000, 2002 kd.moeller@t-online.de
*
* This file is part of the KDE Project.
......@@ -106,7 +106,7 @@ extern QString xminstr,
//@}
extern double sw, /**< Precision for the functions. */
rsw, /**< Pricision for the grid. */
rsw, /**< Precision for the grid. */
/** @name Axes Division
*
......@@ -128,7 +128,7 @@ extern double sw, /**< Precision for the functions. */
//@}
/** Current filename */
extern QString datei,
extern QString //dataFile,
/**
* Axes tic step - string representation.