本文整理汇总了C++中ColorMap::setInterpolationSpec方法的典型用法代码示例。如果您正苦于以下问题:C++ ColorMap::setInterpolationSpec方法的具体用法?C++ ColorMap::setInterpolationSpec怎么用?C++ ColorMap::setInterpolationSpec使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ColorMap
的用法示例。
在下文中一共展示了ColorMap::setInterpolationSpec方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
DataLayer *ConfigurationParser::readLayer()
{
Q_ASSERT(isStartElement()
&& name() == "layer");
DataLayer *layer = new DataLayer();
ColorMap colorMap;
QColor c;
c.setHsv(240, 255, 189, 255);
colorMap.addColor(c);
c.setHsv(240, 255, 255, 255);
colorMap.addColor(c);
c.setHsv(224, 255, 255, 255);
colorMap.addColor(c);
c.setHsv(208, 255, 255, 255);
colorMap.addColor(c);
c.setHsv(195, 255, 255, 255);
colorMap.addColor(c);
c.setHsv(180, 255, 255, 255);
colorMap.addColor(c);
c.setHsv(159, 189, 255, 255);
colorMap.addColor(c);
c.setHsv(120, 123, 255, 255);
colorMap.addColor(c);
c.setHsv(80, 189, 255, 255);
colorMap.addColor(c);
c.setHsv(60, 255, 255, 255);
colorMap.addColor(c);
c.setHsv(44, 255, 255, 255);
colorMap.addColor(c);
c.setHsv(15, 255, 255, 255);
colorMap.addColor(c);
c.setHsv(0, 255, 255, 255);
colorMap.addColor(c);
c.setHsv(0, 255, 189, 255);
colorMap.addColor(c);
c.setHsv(0, 255, 132, 255);
colorMap.addColor(c);
colorMap.setInterpolationSpec(QColor::Hsv);
while(!atEnd()) {
readNext();
if(isEndElement())
break;
if(isStartElement()) {
if(name() == "file") {
QXmlStreamAttributes att = attributes();
QDateTime dateTime;
dateTime.setTime(QTime::fromString(att.value("time").toString(), Qt::ISODate));
dateTime.setDate(QDate::fromString(att.value("date").toString(), Qt::ISODate));
layer->setFileName(dateTime, readCharacters());
qDebug() << "Added file for time:" << dateTime;
}
else if(name() == "files") {
readFiles(layer);
}
else if(name() == "name") {
layer->setName(readCharacters());
qDebug() << "Name:" << layer->name();
}
else if(name() == "geometry") {
QString geometryName = readCharacters();
QHash<QString,MapGeometry>::iterator it = m_geometries.find(geometryName);
if(it != m_geometries.end()) {
layer->setGeometry(it.value());
}
else {
delete layer;
qDebug() << "Geometry not found.";
return 0;
}
}
else if(name() == "scaleMin") {
layer->setScaleMin(readCharacters().toDouble());
}
else if(name() == "scaleMax") {
layer->setScaleMax(readCharacters().toDouble());
}
else if(name() == "defaultColorMap") {
QString colorMapString = readCharacters();
if(m_colorMaps.contains(colorMapString)) {
colorMap = m_colorMaps.value(colorMapString);
}
}
else {
readUnknownElement();
}
}
}
layer->setDefaultColorMap(colorMap);
return layer;
}