28 #include <QMessageBox>
54 float *px,
float *py,
Axis *pa)
61 if(x <= 0.0) *px = -1e5;
67 yr = sqrt(yr*yr + yi*yi);
68 if(yr <= 0.0) *py = -1e5;
69 else *py = float(log10(yr/fabs(pa->
low)) /
70 log10(pa->
up/pa->
low) *
double(
y2));
74 yr = sqrt(yr*yr + yi*yi);
75 *py = float((yr-pa->
low)/(pa->
up-pa->
low)*
double(
y2));
78 if(!isfinite(*px)) *px = 0.0;
79 if(!isfinite(*py)) *py = 0.0;
126 double GridStep, corr, zD, zDstep, GridNum;
160 while((z <=
x2) && (z >= 0)) {
164 if((zD < 1.5*zDstep) || (z == 0) || (z ==
x2)) {
166 if(
xAxis.
up < 0.0) tmp =
'-'+tmp;
167 w = metrics.width(tmp);
169 Texts.append(
new Text(z-(w>>1), -y1, tmp));
170 Lines.append(
new Line(z, 5, z, -5, QPen(Qt::black,0)));
174 if(zD > 9.5*zDstep) zDstep *= 10.0;
176 z = int(corr*log10(zD / fabs(
xAxis.
up)) + 0.5);
180 z = int(corr*log10(zD / fabs(
xAxis.
low)) + 0.5);
188 else Expo = log10(fabs(
xAxis.
up));
192 while((z <=
x2) && (z >= 0)) {
193 if(fabs(GridNum) < 0.01*pow(10.0, Expo)) GridNum = 0.0;
195 w = metrics.width(tmp);
196 Texts.append(
new Text(z-(w>>1), -y1, tmp));
201 Lines.append(
new Line(z, 5, z, -5, QPen(Qt::black,0)));
217 Lines.append(
new Line(0, 0,
x2, 0, QPen(Qt::black,0)));
218 Lines.append(
new Line(0,
y2, 0, 0, QPen(Qt::black,0)));
243 Name = QObject::tr(
"Cartesian");
244 BitmapFile = (
char *)
"rect";
RectDiagram(int _cx=0, int _cy=0)
int regionCode(float, float)
static Element * info(QString &, char *&, bool getNewOne=false)
bool insideDiagram(float, float)
tQucsSettings QucsSettings
Definitions and declarations for the main application.
QString StringNiceNum(double num)
Q3PtrList< struct Arc > Arcs
bool calcAxisLogScale(Axis *, int &, double &, double &, double &, int)
Superclass of all schematic drawing elements.
bool calcAxisScale(Axis *, double &, double &, double &, double &, double)
void calcCoordinate(double *&, double *&, double *&, float *, float *, Axis *)
bool calcYAxis(Axis *, int)