本文整理汇总了C++中QSGNode::nextSibling方法的典型用法代码示例。如果您正苦于以下问题:C++ QSGNode::nextSibling方法的具体用法?C++ QSGNode::nextSibling怎么用?C++ QSGNode::nextSibling使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QSGNode
的用法示例。
在下文中一共展示了QSGNode::nextSibling方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: update
void SatellitesItem::update() {
if( ! m_satComp->selected() ) {
hide();
return;
}
QSGNode *n = firstChild();
while(n != 0) {
SatelliteNode *satNode = static_cast<SatelliteNode *>(n);
Satellite *sat = satNode->sat();
if ( sat->selected() ) {
if ( Options::showVisibleSatellites() ) {
if ( sat->isVisible() ) {
satNode->update();
} else {
satNode->hide();
}
} else {
satNode->update();
}
} else {
satNode->hide();
}
n = n->nextSibling();
}
}
示例2: removeNodesToPreprocess
void QSGRenderer::removeNodesToPreprocess(QSGNode *node)
{
for (QSGNode *c = node->firstChild(); c; c = c->nextSibling())
removeNodesToPreprocess(c);
if (node->flags() & QSGNode::UsePreprocess)
m_nodes_to_preprocess.remove(node);
}
示例3: populateFromNode
void QuickSceneGraphModel::populateFromNode(QSGNode *node, bool emitSignals)
{
if (!node) {
return;
}
QVector<QSGNode*> &childList = m_parentChildMap[node];
QVector<QSGNode*> newChildList;
newChildList.reserve(node->childCount());
for (QSGNode *childNode = node->firstChild(); childNode; childNode = childNode->nextSibling()) {
newChildList.append(childNode);
}
QModelIndex myIndex; // don't call indexForNode(node) here yet, in the common case of few changes we waste a lot of time here
bool hasMyIndex = false;
std::sort(newChildList.begin(), newChildList.end());
QVector<QSGNode*>::iterator i = childList.begin();
QVector<QSGNode*>::const_iterator j = newChildList.constBegin();
while (i != childList.end() && j != newChildList.constEnd()) {
if (*i < *j) { // handle deleted node
emit nodeDeleted(*i);
GET_INDEX
if (emitSignals) {
const auto idx = std::distance(childList.begin(), i);
beginRemoveRows(myIndex, idx, idx);
}
pruneSubTree(*i);
i = childList.erase(i);
if (emitSignals)
endRemoveRows();
} else if (*i > *j) { // handle added node
示例4: deleteContent
void deleteContent()
{
QSGNode *subnode = firstChild();
while (subnode) {
// We can't delete the node now as it might be in the preprocess list
// It will be deleted in the next preprocess
m_nodes_to_delete.append(subnode);
subnode = subnode->nextSibling();
}
removeAllChildNodes();
}
示例5: visitChildren
void QSGNodeVisitorEx::visitChildren(QSGNode *node)
{
for (QSGNode *child = node->firstChild(); child; child = child->nextSibling()) {
switch (child->type()) {
case QSGNode::ClipNodeType: {
QSGClipNode *c = static_cast<QSGClipNode*>(child);
if (visit(c))
visitChildren(c);
endVisit(c);
break;
}
case QSGNode::TransformNodeType: {
QSGTransformNode *c = static_cast<QSGTransformNode*>(child);
if (visit(c))
visitChildren(c);
endVisit(c);
break;
}
case QSGNode::OpacityNodeType: {
QSGOpacityNode *c = static_cast<QSGOpacityNode*>(child);
if (visit(c))
visitChildren(c);
endVisit(c);
break;
}
case QSGNode::GeometryNodeType: {
if (child->flags() & QSGNode::IsVisitableNode) {
QSGVisitableNode *v = static_cast<QSGVisitableNode*>(child);
v->accept(this);
} else {
QSGGeometryNode *c = static_cast<QSGGeometryNode*>(child);
if (visit(c))
visitChildren(c);
endVisit(c);
}
break;
}
case QSGNode::RootNodeType: {
QSGRootNode *root = static_cast<QSGRootNode*>(child);
if (visit(root))
visitChildren(root);
endVisit(root);
break;
}
case QSGNode::BasicNodeType: {
visitChildren(child);
break;
}
default:
Q_UNREACHABLE();
break;
}
}
}
示例6: updateExpandedRowHeights
void TimelineRenderState::updateExpandedRowHeights(const TimelineModel *model, int defaultRowHeight,
int defaultRowOffset)
{
Q_D(TimelineRenderState);
int row = 0;
qreal offset = 0;
for (QSGNode *rowNode = d->expandedRowRoot->firstChild(); rowNode != 0;
rowNode = rowNode->nextSibling()) {
qreal rowHeight = model->expandedRowHeight(row++);
QMatrix4x4 matrix;
matrix.translate(0, offset, 0);
matrix.scale(1, rowHeight / defaultRowHeight, 1);
offset += defaultRowOffset * rowHeight / defaultRowHeight;
static_cast<QSGTransformNode *>(rowNode)->setMatrix(matrix);
}
}
示例7: update
void SupernovaeItem::update() {
if( ! m_snovaComp->selected() ) {
hide();
return;
}
show();
QSGNode *n = firstChild();
while(n != 0) {
SupernovaNode *sNode = static_cast<SupernovaNode *>(n);
sNode->update();
n = n->nextSibling();
}
}
示例8: setColor
void QQuickTextNode::setColor(const QColor &color)
{
if (m_usePixmapCache) {
setUpdateFlag(UpdateNodes);
} else {
for (QSGNode *childNode = firstChild(); childNode; childNode = childNode->nextSibling()) {
if (childNode->subType() == GlyphNodeSubType) {
QSGGlyphNode *glyphNode = static_cast<QSGGlyphNode *>(childNode);
if (glyphNode->color() == m_color)
glyphNode->setColor(color);
} else if (childNode->subType() == SolidRectNodeSubType) {
QSGSimpleRectNode *solidRectNode = static_cast<QSGSimpleRectNode *>(childNode);
if (solidRectNode->color() == m_color)
solidRectNode->setColor(color);
}
}
}
m_color = color;
}
示例9: visitChildren
void QSGNodeVisitor::visitChildren(QSGNode *n)
{
for (QSGNode *c = n->firstChild(); c; c = c->nextSibling())
visitNode(c);
}
示例10: buildLists
void QSGDefaultRenderer::buildLists(QSGNode *node)
{
if (node->isSubtreeBlocked())
return;
if (node->type() == QSGNode::GeometryNodeType) {
QSGGeometryNode *geomNode = static_cast<QSGGeometryNode *>(node);
qreal opacity = geomNode->inheritedOpacity();
QSGMaterial *m = geomNode->activeMaterial();
#ifdef FORCE_NO_REORDER
if (true) {
#else
if ((m->flags() & QSGMaterial::Blending) || opacity < 1) {
#endif
geomNode->setRenderOrder(m_currentRenderOrder - 1);
m_transparentNodes.add(geomNode);
} else {
geomNode->setRenderOrder(m_currentRenderOrder);
m_opaqueNodes.add(geomNode);
m_currentRenderOrder += 2;
}
}
if (!node->firstChild())
return;
#ifdef FORCE_NO_REORDER
static bool reorder = false;
#else
static bool reorder = !qApp->arguments().contains(QLatin1String("--no-reorder"));
#endif
if (reorder && node->firstChild() != node->lastChild() && (node->flags() & QSGNode::ChildrenDoNotOverlap)) {
QVarLengthArray<int, 16> beginIndices;
QVarLengthArray<int, 16> endIndices;
int baseCount = m_transparentNodes.size();
int count = 0;
for (QSGNode *c = node->firstChild(); c; c = c->nextSibling()) {
beginIndices.append(m_transparentNodes.size());
buildLists(c);
endIndices.append(m_transparentNodes.size());
++count;
}
int childNodeCount = m_transparentNodes.size() - baseCount;
if (childNodeCount) {
m_tempNodes.reset();
m_tempNodes.reserve(childNodeCount);
while (childNodeCount) {
for (int i = 0; i < count; ++i) {
if (beginIndices[i] != endIndices[i])
m_heap.insert(IndexGeometryNodePair(i, m_transparentNodes.at(beginIndices[i]++)));
}
while (!m_heap.isEmpty()) {
IndexGeometryNodePair pair = m_heap.pop();
m_tempNodes.add(pair.second);
--childNodeCount;
int i = pair.first;
if (beginIndices[i] != endIndices[i] && !nodeLessThan(m_transparentNodes.at(beginIndices[i]), pair.second))
m_heap.insert(IndexGeometryNodePair(i, m_transparentNodes.at(beginIndices[i]++)));
}
}
Q_ASSERT(m_tempNodes.size() == m_transparentNodes.size() - baseCount);
qMemCopy(&m_transparentNodes.at(baseCount), &m_tempNodes.at(0), m_tempNodes.size() * sizeof(QSGGeometryNode *));
}
} else {
for (QSGNode *c = node->firstChild(); c; c = c->nextSibling())
buildLists(c);
}
}
void QSGDefaultRenderer::renderNodes(const QDataBuffer<QSGGeometryNode *> &list)
{
const float scale = 1.0f / m_currentRenderOrder;
int count = list.size();
int currentRenderOrder = 0x80000000;
m_current_projection_matrix.setColumn(2, scale * projectionMatrix().column(2));
//int clipChangeCount = 0;
//int programChangeCount = 0;
//int materialChangeCount = 0;
for (int i = 0; i < count; ++i) {
QSGGeometryNode *geomNode = list.at(i);
QSGMaterialShader::RenderState::DirtyStates updates;
#if defined (QML_RUNTIME_TESTING)
static bool dumpTree = qApp->arguments().contains(QLatin1String("--dump-tree"));
if (dumpTree)
qDebug() << geomNode;
#endif
bool changeMatrix = m_currentMatrix != geomNode->matrix();
if (changeMatrix) {
m_currentMatrix = geomNode->matrix();
if (m_currentMatrix)
//.........这里部分代码省略.........