本文整理汇总了C++中Attributes::setStdColorBar方法的典型用法代码示例。如果您正苦于以下问题:C++ Attributes::setStdColorBar方法的具体用法?C++ Attributes::setStdColorBar怎么用?C++ Attributes::setStdColorBar使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Attributes
的用法示例。
在下文中一共展示了Attributes::setStdColorBar方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setAttributes
void ObserverMap::setAttributes(QStringList &attribs, QStringList legKeys,
QStringList legAttribs)
{
connectTreeLayerSlot(false);
bool complexMap = false;
if (itemList.isEmpty())
{
itemList << attribs;
}
else
{
complexMap = true;
foreach(const QString & str, attribs)
{
if (!itemList.contains(str))
itemList.append(str);
}
}
for (int j = 0; (legKeys.size() > 0 && j < LEGEND_KEYS.size()); j++)
{
if (legKeys.indexOf(LEGEND_KEYS.at(j)) < 0)
{
qFatal("Error: Parameter legend \"%s\" not found. Please check it in the model.",
qPrintable(LEGEND_KEYS.at(j)));
}
}
int type = 0, mode = 0, slices = 0, precision = 0, stdDeviation = 0, max = 0;
int min = 0, colorBar = 0, font = 0, fontSize = 0, symbol = 0, width = 0;
QTreeWidgetItem *item = 0;
Attributes *attrib = 0;
for (int i = 0; i < itemList.size(); i++)
{
if ((!mapAttributes->contains(itemList.at(i)))
&& (itemList.at(i) != "x") && (itemList.at(i) != "y"))
{
obsAttrib.append(itemList.at(i));
attrib = new Attributes(itemList.at(i), width * height, newWidthCellSpace, newHeightCellSpace);
attrib->setVisible(true);
if (!legKeys.isEmpty())
{
type = legKeys.indexOf(TYPE);
mode = legKeys.indexOf(GROUP_MODE);
slices = legKeys.indexOf(SLICES);
precision = legKeys.indexOf(PRECISION);
stdDeviation = legKeys.indexOf(STD_DEV);
max = legKeys.indexOf(MAX);
min = legKeys.indexOf(MIN);
colorBar = legKeys.indexOf(COLOR_BAR);
font = legKeys.indexOf(FONT_FAMILY);
fontSize = legKeys.indexOf(FONT_SIZE);
symbol = legKeys.indexOf(SYMBOL);
width = legKeys.indexOf(WIDTH);
attrib->setDataType((TypesOfData) legAttribs.at(type).toInt());
attrib->setGroupMode((GroupingMode) legAttribs.at(mode).toInt());
attrib->setSlices(legAttribs.at(slices).toInt() - 1); // conta com o zero
attrib->setPrecisionNumber(legAttribs.at(precision).toInt() - 1); // conta com o zero
attrib->setStdDeviation((StdDev) legAttribs.at(stdDeviation).toInt());
attrib->setMaxValue(legAttribs.at(max).toDouble());
attrib->setMinValue(legAttribs.at(min).toDouble());
attrib->setFontFamily(legAttribs.at(font));
attrib->setFontSize(legAttribs.at(fontSize).toInt());
bool ok = false;
int asciiCode = legAttribs.at(symbol).toInt(&ok, 10);
if (ok)
attrib->setSymbol(QString(QChar(asciiCode)));
else
attrib->setSymbol(legAttribs.at(symbol));
attrib->setWidth(legAttribs.at(width).toDouble());
std::vector<ColorBar> colorBarVec;
std::vector<ColorBar> stdColorBarVec;
QStringList labelList, valueList;
createColorsBar(legAttribs.at(colorBar),
colorBarVec, stdColorBarVec, valueList, labelList);
attrib->setColorBar(colorBarVec);
attrib->setStdColorBar(stdColorBarVec);
attrib->setValueList(valueList);
attrib->setLabelList(labelList);
for (int j = 0; j < LEGEND_ITENS; j++)
{
legKeys.removeFirst();
legAttribs.removeFirst();
}
}
mapAttributes->insert(itemList.at(i), attrib);
attrib->makeBkp();
item = new QTreeWidgetItem(treeLayers);
//.........这里部分代码省略.........
示例2: setAttributes
void ObserverStateMachine::setAttributes(QStringList &attribs, QStringList legKeys,
QStringList legAttribs)
{
attribList = attribs;
#ifdef DEBUG_OBSERVER
qDebug() << "\nattribs:\n" << attribs;
qDebug() << "\nMapAttributes()->keys(): " << mapAttributes->keys() << "\n";
qDebug() << "LEGEND_ITENS: " << LEGEND_ITENS;
qDebug() << "num de legendas: " << (int) legKeys.size() / LEGEND_ITENS;
for (int j = 0; j < legKeys.size(); j++)
qDebug() << legKeys.at(j) << " = " << legAttrib.at(j);
#endif
for (int j = 0; (legKeys.size() > 0 && j < LEGEND_KEYS.size()); j++)
{
if (legKeys.indexOf(LEGEND_KEYS.at(j)) < 0)
{
qFatal("Error: Parameter legend \"%s\" not found. "
"Please check it in the model.", qPrintable( LEGEND_KEYS.at(j) ) );
}
}
int type = legKeys.indexOf(TYPE);
int mode = legKeys.indexOf(GROUP_MODE);
int slices = legKeys.indexOf(SLICES);
int precision = legKeys.indexOf(PRECISION);
int stdDeviation = legKeys.indexOf(STD_DEV);
int max = legKeys.indexOf(MAX);
int min = legKeys.indexOf(MIN);
int colorBar = legKeys.indexOf(COLOR_BAR);
int font = legKeys.indexOf(FONT_FAMILY);
int fontSize = legKeys.indexOf(FONT_SIZE);
int symbol = legKeys.indexOf(SYMBOL);
#ifdef DEBUG_OBSERVER
qDebug() << "\nattribs:\n" << attribs;
qDebug() << "\nlegKeys: \n" << legKeys;
qDebug() << "\nlegAttrib: \n" << legAttrib;
qDebug() << "\nMapAttributes()->keys(): " << mapAttributes->keys() << "\n";
#endif
QTreeWidgetItem *item = 0;
Attributes *attrib = 0;
for( int i = 0; i < attribs.size(); i++)
{
if ((! mapAttributes->contains(attribs.at(i)))
&& (attribs.at(i) != QString("x")) && (attribs.at(i) != QString("y")) )
{
obsAttrib.append(attribs.at(i));
attrib = new Attributes(attribs.at(i), 2, 0, 0); // states->size(), 0, 0);
//------- Recupera a legenda do arquivo e cria o objeto attrib
if (legKeys.size() > 0)
{
attrib->setDataType( (TypesOfData) legAttribs.at(type).toInt());
attrib->setGroupMode( (GroupingMode) legAttribs.at(mode ).toInt());
attrib->setSlices(legAttribs.at(slices).toInt() - 1); // conta com o zero
attrib->setPrecisionNumber(legAttribs.at(precision).toInt() - 1); // conta com o zero
attrib->setStdDeviation( (StdDev) legAttribs.at(stdDeviation ).toInt());
attrib->setMaxValue(legAttribs.at(max).toDouble());
attrib->setMinValue(legAttribs.at(min).toDouble());
//Fonte
attrib->setFontFamily(legAttribs.at(font));
attrib->setFontSize(legAttribs.at(fontSize).toInt());
//Converte o código ASCII do símbolo em caracter
bool ok = false;
int asciiCode = legAttribs.at(symbol).toInt(&ok, 10);
if (ok)
attrib->setSymbol( QString( QChar(asciiCode) ));
else
attrib->setSymbol(legAttribs.at(symbol));
std::vector<ColorBar> colorBarVec;
std::vector<ColorBar> stdColorBarVec;
QStringList labelList, valueList;
ObserverMap::createColorsBar(legAttribs.at(colorBar),
colorBarVec, stdColorBarVec, valueList, labelList);
attrib->setColorBar(colorBarVec);
attrib->setStdColorBar(stdColorBarVec);
attrib->setValueList(valueList);
attrib->setLabelList(labelList);
#ifdef DEBUG_OBSERVER
qDebug() << "valueList.size(): " << valueList.size();
qDebug() << valueList;
qDebug() << "\nlabelList.size(): " << labelList.size();
qDebug() << labelList;
qDebug() << "\nattrib->toString()\n" << attrib->toString();
#endif
}
mapAttributes->insert(attribs.at(i), attrib);
//.........这里部分代码省略.........