22 #include "../dialogs/matchdialog.h"
78 double *px, *py=&Dummy, *pz;
82 int nn, nnn, m, x, y, d, dmin = INT_MAX;
96 n = (n % nnn) + (n / nnn) * nnn * pDy->
count;
105 for(nn=0; nn<nnn; nn++) {
110 pz += 2*(pD->
count-1);
112 x = int(
fCX+0.5) -
cx;
113 y = int(
fCY+0.5) -
cy;
120 if(isCross) m *= pD->
count;
128 VarPos = (
double*)malloc(nn);
160 if(Var.startsWith(
"S"))
209 for(i=pD->
count; i>1; i--) {
210 if(fabs(v-(*pp)) < fabs(v-(*(pp+1))))
break;
246 if(Var.startsWith(
"S"))
285 Text = QObject::tr(
"invalid");
296 QSize r = metrics.size(0,
Text);
309 if(!px)
return false;
310 for(n=0; n<pD->
count; n++) {
311 if(
VarPos[0] <= *px)
break;
314 if(n == pD->
count) px--;
317 if(px <= pD->Points)
return false;
321 if(px >= (pD->
Points + pD->
count - 1))
return false;
337 if(!pD)
return false;
343 if(!pD)
return false;
345 if(!px)
return false;
346 for(n=1; n<pD->
count; n++) {
347 if(fabs(
VarPos[i]-(*px)) < fabs(
VarPos[i]-(*(px+1))))
break;
365 if(!pD)
return false;
367 if(!px)
return false;
368 for(n=0; n<pD->
count; n++) {
369 if(fabs(
VarPos[i]-(*px)) < fabs(
VarPos[i]-(*(px+1))))
break;
373 }
while(px <= pD->Points);
396 p->
Painter->setWorldXForm(
true);
397 QMatrix wm = p->
Painter->worldMatrix();
398 p->
Painter->setWorldMatrix(QMatrix());
401 p->
Painter->setPen(QPen(Qt::black,1));
403 x2_ += int(6.0*p->
Scale);
404 y2_ += int(6.0*p->
Scale);
409 p->
Painter->setWorldMatrix(wm);
410 p->
Painter->setWorldXForm(
false);
415 p->
Painter->setPen(QPen(Qt::darkMagenta,0));
418 x2 = int(
float(x2_) / p->
Scale);
419 y2 = int(
float(y2_) / p->
Scale);
422 p->
map(x0+
x1, y0+
y1, x1_, y1_);
439 p->
Painter->setPen(QPen(Qt::darkGray,3));
454 p->drawLine(x0+
cx, y0-
cy, x0+
x1, y0+
y1);
500 s += QString::number(
VarPos[i])+
"/";
501 s.replace(s.length()-1,1,
' ');
504 s += QString::number(
x1) +
" "+ QString::number(
y1) +
" "
519 if(s.at(0) !=
'<')
return false;
520 if(s.at(s.length()-1) !=
'>')
return false;
521 s = s.mid(1, s.length()-2);
523 if(s.section(
' ',0,0) !=
"Mkr")
return false;
526 QString n = s.section(
' ',1,1);
529 j = (n.count(
'/') + 3) *
sizeof(
double);
533 VarPos = (
double*)malloc(j);
538 if(!ok)
return false;
542 n = s.section(
' ',2,2);
544 if(!ok)
return false;
546 n = s.section(
' ',3,3);
548 if(!ok)
return false;
550 n = s.section(
' ',4,4);
552 if(!ok)
return false;
554 n = s.section(
' ',5,5);
556 if(!ok)
return false;
558 n = s.section(
' ',6,6);
559 if(n.isEmpty())
return true;
571 if(x_ >=
x1)
if(x_ <=
x1+
x2)
if(y_ >=
y1)
if(y_ <=
y1+
y2)
585 int z = (
nVarPos+2) *
sizeof(
double);
589 pm->
VarPos = (
double*)malloc(z);
virtual bool insideDiagram(float, float)
void setCenter(int, int, bool)
void map(int, int, int &, int &)
tQucsSettings QucsSettings
void paint(ViewPainter *, int, int)
QString complexDeg(double real, double imag, int Precision)
void Bounding(int &_x1, int &_y1, int &_x2, int &_y2)
void getTextSize(const QFont &)
Definitions and declarations for the main application.
Marker * sameNewOne(Graph *)
QString complexRad(double real, double imag, int Precision)
virtual void calcCoordinate(double *&, double *&, double *&, float *, float *, Axis *)
int drawText(const QString &, int, int, int *Height=0)
void paintScheme(QPainter *)
QString complexRect(double real, double imag, int Precision)
void drawRoundRect(int, int, int, int)
static void r2z(double &, double &, double)
Marker(Diagram *Diag_, Graph *pg_=0, int _nn=0, int cx_=0, int cy_=0)
void drawRectD(int, int, int, int)
Q3PtrList< DataX > cPointsX
void eraseRect(int, int, int, int)
bool getSelected(int, int)
bool load(const QString &Line)