本文整理汇总了C++中VisualNode::getIndex方法的典型用法代码示例。如果您正苦于以下问题:C++ VisualNode::getIndex方法的具体用法?C++ VisualNode::getIndex怎么用?C++ VisualNode::getIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VisualNode
的用法示例。
在下文中一共展示了VisualNode::getIndex方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: compressLevelChanged
void IcicleTreeCanvas::compressLevelChanged(int value) {
auto& na = node_tree.getNA();
int leafIndex;
compressLevel = value;
compressInit(*na[0], 0, 0);
VisualNode* lftLeaf = findLeftLeaf();
leafIndex = lftLeaf->getIndex(na);
int xoff = statistic[lftLeaf->getIndex(na)].absX * icicle_image_.pixel_height();
sa_.horizontalScrollBar()->setValue(xoff);
redrawAll();
leafIndex = findLeftLeaf()->getIndex(na);
sa_.horizontalScrollBar()->setValue(xoff);
qDebug() << "compressionChanged to: " << compressLevel;
}
示例2: getColorByType
QRgb IcicleTreeCanvas::getColorByType(const VisualNode& node) {
if (selectedNode == &node) { return QColor::fromHsv(0, 150, 150).rgba();}
QRgb color;
auto& na = node_tree.getNA();
auto& data = tc_.getExecution()->getData();
auto gid = node.getIndex(na);
auto* entry = data.getEntry(gid);
auto domain_red = entry == nullptr ? 0 : entry->domain;
domain_red_sum += domain_red;
switch (IcicleTreeCanvas::color_mapping_type) {
case ColorMappingType::DEFAULT: {
NodeStatus ns = statistic[gid].ns;
color = getColor(ns);
} break;
case ColorMappingType::DOMAIN_REDUCTION: {
/// the smaller the value, the darker the color
int color_value = 255 * static_cast<float>(domain_red);
if (color_value < 0) color_value = 0;
color = QColor::fromHsv(0, 0, color_value).rgba();
} break;
case ColorMappingType::NODE_TIME: {
auto node_time = entry == nullptr ? 0 : entry->node_time;
/// TODO(maxim): need to normalize the node time
int color_value = static_cast<float>(node_time);
color = QColor::fromHsv(0, 0, color_value).rgba();
}
}
return color;
}