本文整理汇总了C++中GraphicObject::getLineColor方法的典型用法代码示例。如果您正苦于以下问题:C++ GraphicObject::getLineColor方法的具体用法?C++ GraphicObject::getLineColor怎么用?C++ GraphicObject::getLineColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GraphicObject
的用法示例。
在下文中一共展示了GraphicObject::getLineColor方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: generatePolygonalLayer
void Kml::generatePolygonalLayer(const GraphicLayer* pGraphicLayer, bool visible, int order, const Layer* pGeoLayer)
{
VERIFYNRV(pGeoLayer != NULL);
if (pGraphicLayer == NULL)
{
return;
}
RasterElement* pGeoElement = dynamic_cast<RasterElement*>(pGeoLayer->getDataElement());
mXml.pushAddPoint(mXml.addElement("Folder"));
string name = pGraphicLayer->getDisplayName();
if (name.empty())
{
name = pGraphicLayer->getName();
}
mXml.addText(name, mXml.addElement("name"));
mXml.addText(pGraphicLayer->getDisplayText(), mXml.addElement("description"));
mXml.addText(visible ? "1" : "0", mXml.addElement("visibility"));
list<GraphicObject*> objects;
pGraphicLayer->getObjects(objects);
for (list<GraphicObject*>::const_iterator object = objects.begin(); object != objects.end(); ++object)
{
GraphicObject* pObject = *object;
if (pObject == NULL)
{
continue;
}
mXml.pushAddPoint(mXml.addElement("Placemark"));
mXml.addText(pObject->getName(), mXml.addElement("name"));
mXml.addText(pObject->isVisible() ? "1" : "0", mXml.addElement("visibility"));
mXml.pushAddPoint(mXml.addElement("Style"));
mXml.pushAddPoint(mXml.addElement("PolyStyle"));
ColorType c = pObject->getFillColor();
QChar fc('0');
mXml.addText(QString("%1%2%3%4").arg(c.mAlpha, 2, 16, fc).arg(c.mBlue, 2, 16, fc).arg(
c.mGreen, 2, 16, fc).arg(c.mRed, 2, 16, fc).toAscii().data(),
mXml.addElement("color"));
mXml.addText(pObject->getLineState() ? "1" : "0", mXml.addElement("outline"));
mXml.addText(pObject->getFillState() ? "1" : "0", mXml.addElement("fill"));
mXml.popAddPoint(); // PolyStyle
mXml.pushAddPoint(mXml.addElement("LineStyle"));
c = pObject->getLineColor();
mXml.addText(QString("%1%2%3%4").arg(c.mAlpha, 2, 16, fc).arg(c.mBlue, 2, 16, fc).arg(
c.mGreen, 2, 16, fc).arg(c.mRed, 2, 16, fc).toAscii().data(),
mXml.addElement("color"));
mXml.addText(StringUtilities::toXmlString(pObject->getLineWidth()), mXml.addElement("width"));
mXml.popAddPoint(); // LineStyle
mXml.popAddPoint(); // Style
switch (pObject->getGraphicObjectType())
{
case MULTIPOINT_OBJECT:
{
mXml.pushAddPoint(mXml.addElement("MultiGeometry"));
vector<LocationType> vertices = static_cast<MultipointObject*>(pObject)->getVertices();
for (vector<LocationType>::const_iterator vertex = vertices.begin(); vertex != vertices.end(); ++vertex)
{
mXml.pushAddPoint(mXml.addElement("Point"));
mXml.addText(QString::number(order).toAscii().data(), mXml.addElement("drawOrder"));
LocationType geo = pGeoElement->convertPixelToGeocoord(*vertex);
mXml.addText(QString("%1,%2").arg(geo.mY, 0, 'f', 10).arg(geo.mX, 0, 'f', 10).toAscii().data(),
mXml.addElement("coordinates"));
mXml.popAddPoint(); // Point
}
mXml.popAddPoint();
break;
}
case LINE_OBJECT:
case POLYLINE_OBJECT:
case HLINE_OBJECT:
case VLINE_OBJECT:
case ROW_OBJECT:
case COLUMN_OBJECT:
{
mXml.pushAddPoint(mXml.addElement("LineString"));
mXml.addText(QString::number(order).toAscii().data(), mXml.addElement("drawOrder"));
mXml.addText("1", mXml.addElement("tessellate"));
QStringList coords;
vector<LocationType> vertices;
if (pObject->getGraphicObjectType() == POLYLINE_OBJECT)
{
vertices = static_cast<PolylineObject*>(pObject)->getVertices();
}
else
{
LocationType ll = pObject->getLlCorner();
LocationType ur = pObject->getUrCorner();
vertices.push_back(ll);
vertices.push_back(ur);
}
for (vector<LocationType>::const_iterator vertex = vertices.begin(); vertex != vertices.end(); ++vertex)
{
LocationType geo = pGeoElement->convertPixelToGeocoord(*vertex);
coords << QString("%1,%2").arg(geo.mY, 0, 'f', 10).arg(geo.mX, 0, 'f', 10);
}
mXml.addText(coords.join(" ").toAscii().data(), mXml.addElement("coordinates"));
mXml.popAddPoint(); // LineString
break;
}
case RECTANGLE_OBJECT:
case TRIANGLE_OBJECT:
case POLYGON_OBJECT:
//.........这里部分代码省略.........