Skip to content

Commit

Permalink
Formatting changes only for draw polygon routine
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@8746 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Jul 9, 2008
1 parent f36385b commit c5fb9f5
Showing 1 changed file with 34 additions and 34 deletions.
68 changes: 34 additions & 34 deletions src/core/qgsvectorlayer.cpp
Expand Up @@ -482,9 +482,9 @@ unsigned char* QgsVectorLayer::drawPolygon(unsigned char* feature,
return feature + 9;

unsigned int wkbType = *((int*)(feature+1));

bool hasZValue = (wkbType == QGis::WKBPolygon25D);

int total_points = 0;

// A vector containing a pointer to a pair of double vectors.The
Expand Down Expand Up @@ -519,10 +519,10 @@ std::cerr << "Points for ring " << idx << " ("
ptr += sizeof(double);
ring->second[jdx] = *((double *) ptr);
ptr += sizeof(double);

if (hasZValue)
ptr += sizeof(double);

/*
#ifdef QGISDEBUG
std::cerr << jdx << ": "
Expand Down Expand Up @@ -585,7 +585,7 @@ std::cerr << i << ": " << ring->first[i]
// this means that adding inner rings to the path creates
// holes in outer ring
QPainterPath path; // OddEven fill rule by default

// Only try to draw polygons if there is something to draw
if (total_points > 0)
{
Expand Down Expand Up @@ -619,18 +619,18 @@ std::cerr << i << ": " << ring->first[i]
// needed :)
QgsDebugMsg("Pixel points are:");
for (int i = 0; i < pa.size(); ++i)
{
QgsDebugMsgLevel("i" + QString::number(i), 2);
QgsDebugMsgLevel("pa[i].x()" + QString::number(pa[i].x()), 2);
QgsDebugMsgLevel("pa[i].y()" + QString::number(pa[i].y()), 2);
}
{
QgsDebugMsgLevel("i" + QString::number(i), 2);
QgsDebugMsgLevel("pa[i].x()" + QString::number(pa[i].x()), 2);
QgsDebugMsgLevel("pa[i].y()" + QString::number(pa[i].y()), 2);
}
std::cerr << "Ring positions are:\n";
QgsDebugMsg("Ring positions are:");
for (int i = 0; i < ringDetails.size(); ++i)
{
QgsDebugMsgLevel("ringDetails[i].first" + QString::number(ringDetails[i].first), 2);
QgsDebugMsgLevel("ringDetails[i].second" + QString::number(ringDetails[i].second), 2);
}
{
QgsDebugMsgLevel("ringDetails[i].first" + QString::number(ringDetails[i].first), 2);
QgsDebugMsgLevel("ringDetails[i].second" + QString::number(ringDetails[i].second), 2);
}
QgsDebugMsg("Outer ring point is " + QString::number(outerRingPt.x()) + ", " + QString::number(outerRingPt.y()));
#endif

Expand Down Expand Up @@ -664,58 +664,58 @@ std::cerr << i << ": " << ring->first[i]
//
QBrush myTransparentBrush = p->brush();
QColor myColor = brush.color();

//only set transparency from layer level if renderer does not provide
//transparency on class level
if(!mRenderer->usesTransparency())
{
myColor.setAlpha(mTransparencyLevel);
}
{
myColor.setAlpha(mTransparencyLevel);
}
myTransparentBrush.setColor(myColor);
QPen myTransparentPen = p->pen(); // store current pen
myColor = myTransparentPen.color();

//only set transparency from layer level if renderer does not provide
//transparency on class level
if(!mRenderer->usesTransparency())
{
myColor.setAlpha(mTransparencyLevel);
}
{
myColor.setAlpha(mTransparencyLevel);
}
myTransparentPen.setColor(myColor);

p->setBrush(myTransparentBrush);
p->setPen (myTransparentPen);

//
// draw the polygon
//
p->drawPath(path);


// draw vertex markers if in editing mode, but only to the main canvas
if (
(mEditable) &&
(drawingToEditingCanvas)
)
{
{

QgsVectorLayer::VertexMarkerType markerType = currentVertexMarkerType();
QgsVectorLayer::VertexMarkerType markerType = currentVertexMarkerType();

for(int i = 0; i < path.elementCount(); ++i)
{
const QPainterPath::Element & e = path.elementAt(i);
drawVertexMarker((int)e.x, (int)e.y, *p, markerType);
}
for(int i = 0; i < path.elementCount(); ++i)
{
const QPainterPath::Element & e = path.elementAt(i);
drawVertexMarker((int)e.x, (int)e.y, *p, markerType);
}
}

//
//restore brush and pen to original
//
p->setBrush ( brush );
p->setPen ( pen );

} // totalPoints > 0

return ptr;
}

Expand Down

0 comments on commit c5fb9f5

Please sign in to comment.