- rSGP.setColor (curve.m_iColor);
- if (curve.m_iLineStyle != SGP::LS_NOLINE) {
- rSGP.setLineStyle (curve.m_iLineStyle);
- rSGP.polylineAbs (curve.x, curve.y, curve.m_iPointCount);
- }
- if (curve.m_iSymbol > 0) {
- rSGP.setLineStyle (SGP::LS_SOLID);
- rSGP.moveAbs (curve.x[0], curve.y[0]);
- symbol (curve.m_iSymbol, symwidth, symheight);
- for (i = 1; i < curve.m_iPointCount; i++)
- if (i % curve.m_iSymbolFreq == 0 || i == curve.m_iPointCount - 1) {
- rSGP.moveAbs (curve.x[i], curve.y[i]);
- symbol (curve.m_iSymbol, symwidth, symheight);
- }
- }
- }
+ double clipRect[4];
+
+ clipRect[0] = xgn_min; clipRect[1] = ygn_min; clipRect[2] = xgn_max; clipRect[3] = ygn_max;
+
+
+
+ for (iCurve = 0; iCurve < m_vecCurves.size(); iCurve++) {
+ const EZPlotCurve* const pCurve = m_vecCurves [iCurve];
+
+
+ m_pSGP->setColor (getColor (iCurve));
+
+ int iSym = getSymbol (iCurve);
+
+ int iLS = getLinestyle (iCurve);
+
+
+
+ if (iLS != SGP::LS_NOLINE) {
+ m_pSGP->setLineStyle (iLS);
+ double x1 = convertWorldToNDC_X (pCurve->x[0]);
+ double y1 = convertWorldToNDC_Y (pCurve->y[0]);
+
+ for (int i = 1; i < pCurve->m_iPointCount; i++) {
+ double x2 = convertWorldToNDC_X (pCurve->x[i]);
+ double y2 = convertWorldToNDC_Y (pCurve->y[i]);
+
+ double x2Clip = x2;
+
+ double y2Clip = y2;
+
+ if (clip_rect (x1, y1, x2Clip, y2Clip, clipRect)) {
+
+ m_pSGP->moveAbs (x1, y1);
+
+ m_pSGP->lineAbs (x2Clip, y2Clip);
+
+ }
+
+ x1 = x2;
+
+ y1 = y2;
+
+ }
+ }
+ if (iSym > 0) {
+
+ int iSymFreq = getSymbolFreq (iCurve);
+ m_pSGP->setLineStyle (SGP::LS_SOLID);
+ double x = convertWorldToNDC_X (pCurve->x[0]);
+ double y = convertWorldToNDC_Y (pCurve->y[0]);
+ m_pSGP->moveAbs (x, y);
+ symbol (iSym, symwidth, symheight);
+ for (int i = 1; i < pCurve->m_iPointCount; i++)
+ if (i % iSymFreq == 0 || i == pCurve->m_iPointCount - 1) {
+ x = convertWorldToNDC_X (pCurve->x[i]);
+ y = convertWorldToNDC_Y (pCurve->y[i]);
+
+ if (y >= ygn_min && y <= ygn_max) {
+ m_pSGP->moveAbs (x, y);
+ symbol (iSym, symwidth, symheight);
+
+ }
+ }
+ }
+ }