Skip to content

Commit f95c460

Browse files
author
wonder
committed
Don't use QgsClipper for trimming features as it's not needed now.
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@5064 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 936b12c commit f95c460

File tree

1 file changed

+0
-74
lines changed

1 file changed

+0
-74
lines changed

src/gui/qgsvectorlayer.cpp

-74
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,6 @@
7878
#include "qgsattributetabledisplay.h"
7979
#include "qgsdistancearea.h"
8080
#include "qgsvectordataprovider.h"
81-
#ifdef Q_WS_X11
82-
#include "qgsclipper.h"
83-
#endif
8481
#include "qgssvgcache.h"
8582
#include "qgsspatialrefsys.h"
8683
#include "qgis.h" //for globals
@@ -463,22 +460,6 @@ unsigned char* QgsVectorLayer::drawLineString(unsigned char* feature,
463460

464461
transformPoints(x, y, z, mtp, projectionsEnabledFlag);
465462

466-
#if defined(Q_WS_X11)
467-
// Work around a +/- 32768 limitation on coordinates in X11
468-
469-
// Look through the x and y coordinates and see if there are any
470-
// that need trimming. If one is found, there's no need to look at
471-
// the rest of them so end the loop at that point.
472-
for (register unsigned int i = 0; i < nPoints; ++i)
473-
if (std::abs(x[i]) > QgsClipper::maxX ||
474-
std::abs(y[i]) > QgsClipper::maxY)
475-
{
476-
QgsClipper::trimFeature(x, y, true); // true = polyline
477-
nPoints = x.size(); // trimming may change nPoints.
478-
break;
479-
}
480-
#endif
481-
482463
// set up QPolygonF class with transformed points
483464
QPolygonF pa(nPoints);
484465
for (register unsigned int i = 0; i < nPoints; ++i)
@@ -583,33 +564,6 @@ std::cerr << jdx << ": "
583564

584565
transformPoints(ring->first, ring->second, zVector, mtp, projectionsEnabledFlag);
585566

586-
#if defined(Q_WS_X11)
587-
// Work around a +/- 32768 limitation on coordinates in X11
588-
589-
// Look through the x and y coordinates and see if there are any
590-
// that need trimming. If one is found, there's no need to look at
591-
// the rest of them so end the loop at that point.
592-
for (register unsigned int i = 0; i < nPoints; ++i)
593-
{
594-
if (std::abs(ring->first[i]) > QgsClipper::maxX ||
595-
std::abs(ring->second[i]) > QgsClipper::maxY)
596-
{
597-
QgsClipper::trimFeature(ring->first, ring->second, false);
598-
/*
599-
#ifdef QGISDEBUG
600-
std::cerr << "Trimmed points (" << ring->first.size() << ")\n";
601-
for (int i = 0; i < ring->first.size(); ++i)
602-
std::cerr << i << ": " << ring->first[i]
603-
<< ", " << ring->second[i] << '\n';
604-
#endif
605-
*/
606-
break;
607-
}
608-
//std::cout << "POLYGONTRANSFORM: " << ring->first[i] << ", " << ring->second[i] << std::endl;
609-
}
610-
611-
#endif
612-
613567
// Don't bother keeping the ring if it has been trimmed out of
614568
// existence.
615569
if (ring->first.size() == 0)
@@ -696,27 +650,6 @@ std::cerr << i << ": " << ring->first[i]
696650
<< ", " << outerRingPt.y() << '\n';
697651
#endif
698652

699-
/*
700-
// A bit of code to aid in working out what values of
701-
// QgsClipper::minX, etc cause the X11 zoom bug.
702-
int largestX = -std::numeric_limits<int>::max();
703-
int smallestX = std::numeric_limits<int>::max();
704-
int largestY = -std::numeric_limits<int>::max();
705-
int smallestY = std::numeric_limits<int>::max();
706-
707-
for (int i = 0; i < pa.size(); ++i)
708-
{
709-
largestX = std::max(largestX, pa.point(i).x());
710-
smallestX = std::min(smallestX, pa.point(i).x());
711-
largestY = std::max(largestY, pa.point(i).y());
712-
smallestY = std::min(smallestY, pa.point(i).y());
713-
}
714-
std::cerr << "Largest X coordinate was " << largestX << '\n';
715-
std::cerr << "Smallest X coordinate was " << smallestX << '\n';
716-
std::cerr << "Largest Y coordinate was " << largestY << '\n';
717-
std::cerr << "Smallest Y coordinate was " << smallestY << '\n';
718-
*/
719-
720653
//preserve a copy of the brush and pen before we start fiddling with it
721654
QBrush brush = p->brush(); //to be kept as original
722655
QPen pen = p->pen(); // to be kept original
@@ -3194,13 +3127,6 @@ void QgsVectorLayer::drawFeature(QPainter* p, QgsFeature* fet, QgsMapToPixel * t
31943127
transformPoint(x, y, theMapToPixelTransform, projectionsEnabledFlag);
31953128
QPointF pt(x - (marker->width()/2), y - (marker->height()/2));
31963129

3197-
#if defined(Q_WS_X11)
3198-
// Work around a +/- 32768 limitation on coordinates in X11
3199-
if (std::abs(x) > QgsClipper::maxX ||
3200-
std::abs(y) > QgsClipper::maxY)
3201-
needToTrim = true;
3202-
else
3203-
#endif
32043130
p->drawPixmap(pt, *marker);
32053131
}
32063132
p->restore();

0 commit comments

Comments
 (0)