本文整理汇总了C++中rootNode函数的典型用法代码示例。如果您正苦于以下问题:C++ rootNode函数的具体用法?C++ rootNode怎么用?C++ rootNode使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了rootNode函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: clientRect
void QFormulatorEditWidget::MovePG( int fUp, int fSel )
{
RectFde rcf = clientRect();
SizeFde ofs( 0, 0 );
CFmlDrawEngineQt::DPtoLPEx( rcf, scale(), scale() );
CFmlDrawEngineQt::DPtoLPEx( ofs, scale(), scale() );
if( rootNode()->MovePgUpDown( rcf, ofs, fUp, fSel ) == 0 )
updateFormulatorWidget();
}
示例2: SERIALIZER
osgDB::ReaderWriter::ReadResult
ReaderWriterDAE::readNode(const std::string& fname,
const osgDB::ReaderWriter::Options* options) const
{
SERIALIZER();
bool bOwnDAE = false;
DAE* pDAE = NULL;
if ( options )
pDAE = (DAE*) options->getPluginData("DAE");
std::string ext( osgDB::getLowerCaseFileExtension(fname) );
if( ! acceptsExtension(ext) ) return ReadResult::FILE_NOT_HANDLED;
std::string fileName( osgDB::findDataFile( fname, options ) );
if( fileName.empty() ) return ReadResult::FILE_NOT_FOUND;
osg::notify(osg::INFO) << "ReaderWriterDAE( \"" << fileName << "\" )" << std::endl;
if (NULL == pDAE)
{
bOwnDAE = true;
pDAE = new DAE;
}
osgdae::daeReader daeReader(pDAE) ;
// Convert file name to URI
std::string fileURI = ConvertFilePathToColladaCompatibleURI(fileName);
if ( ! daeReader.convert( fileURI ) )
{
osg::notify( osg::WARN ) << "Load failed in COLLADA DOM conversion" << std::endl;
return ReadResult::ERROR_IN_READING_FILE;
}
if ( options )
{
// Return the document URI
if (options->getPluginData("DAE-DocumentURI"))
*(std::string*)options->getPluginData("DAE-DocumentURI") = fileURI;
// Return some additional information about the document
if (options->getPluginData("DAE-AssetUnitName"))
*(std::string*)options->getPluginData("DAE-AssetUnitName") = daeReader.m_AssetUnitName;
if (options->getPluginData("DAE-AssetUnitMeter"))
*(float*)options->getPluginData("DAE-AssetUnitMeter") = daeReader.m_AssetUnitMeter;
if (options->getPluginData("DAE-AssetUp_axis"))
*(domUpAxisType*)options->getPluginData("DAE-AssetUp_axis") = daeReader.m_AssetUp_axis;
}
if (bOwnDAE)
delete pDAE;
osg::Node* rootNode( daeReader.getRootNode() );
return rootNode;
}
示例3: appendChildNode
void SatellitesItem::recreateList() {
QList<SatelliteGroup*> list = m_satComp->groups();
for(int i = 0; i < list.size(); ++i) {
SatelliteGroup *group = list.at(i);
for(int c = 0; c < group->size(); ++c) {
appendChildNode(new SatelliteNode(group->at(c), rootNode()));
}
}
}
示例4: rootNode
Element* FocusNavigationScope::owner() const
{
Node* root = rootNode();
if (root->isShadowRoot()) {
ShadowRoot* shadowRoot = toShadowRoot(root);
return shadowRoot->host();
}
return 0;
}
示例5: ptf
void QFormulatorEditWidget::dropEvent( QDropEvent *event )
{
if( event->mimeData() && (event->dropAction() == Qt::CopyAction || event->dropAction() == Qt::MoveAction) )
{
PointFde ptf( event->pos().x(), event->pos().y() );
RectFde rcf = clientRect();
CFmlDrawEngineQt::DPtoLPEx( ptf, scale(), scale() );
CFmlDrawEngineQt::DPtoLPEx( rcf, scale(), scale() );
if( rootNode()->DrInSelection() == 0 || rootNode()->PtInSelection( rcf, ptf ) == 0 )
{
setBlinkingCursorEnabled( true );
rootNode()->GetDrag().SetEmpty();
rootNode()->GetSelectInfo().SetEmpty();
rootNode()->MoveCaret( rcf, ptf, 0 );
updateFormulatorWidget();
}
else
{
if( event->dropAction() == Qt::MoveAction && isRemovedSelection() == 0 )
{
CFrameNode *pFrameNode = rootNode()->RemoveOrCopySelection( 1 );
if( pFrameNode )
{
delete pFrameNode;
setRemovedSelection();
}
}
else if( event->dropAction() == Qt::CopyAction )
{
rootNode()->GetSelectInfo().SetEmpty();
}
int iRet = document()->paste( event->mimeData(), false );
setBlinkingCursorEnabled( true );
rootNode()->GetDrag().SetEmpty();
updateViewDocument();
if( !hasFocus() ) setFocus();
if( iRet ) event->acceptProposedAction();
}
}
else
{
setBlinkingCursorEnabled( true );
rootNode()->GetDrag().SetEmpty();
updateFormulatorWidget();
}
}
示例6: rootNode
QString CFormulatorDoc::exportPureContentMathML( bool ignoreCache )
{
if( !ignoreCache )
{
if( isMmlChanged() )
{
QString sRet = rootNode()->to_mathml_pureContent();
::hstr_0a_to_0d0a( sRet );
::hstr_del_redundant_0d0a( sRet );
m_cmmlCache = sRet;
setMmlChanged( false );
}
return m_cmmlCache;
}
QString sRet = rootNode()->to_mathml_pureContent();
::hstr_0a_to_0d0a( sRet );
::hstr_del_redundant_0d0a( sRet );
return sRet;
}
示例7: rootNode
void NetworkView::updateAccountDependents() {
ZLBlockTreeNode::List rootChildren = rootNode().children();
ZLBlockTreeNode::List::iterator nodeIt = rootChildren.begin();
while (nodeIt != rootChildren.end() && (*nodeIt)->isInstanceOf(NetworkCatalogNode::TYPE_ID)) {
NetworkCatalogNode &node = (NetworkCatalogNode &) **nodeIt;
updateAccountDependents(node);
++nodeIt;
}
}
示例8: scrollingTreeNodeDidScroll
void ScrollingTreeIOS::scrollingTreeNodeDidScroll(ScrollingNodeID nodeID, const FloatPoint& scrollPosition, SetOrSyncScrollingLayerPosition scrollingLayerPositionAction)
{
if (!m_scrollingCoordinator)
return;
if (nodeID == rootNode()->scrollingNodeID())
setMainFrameScrollPosition(scrollPosition);
callOnMainThread(bind(&AsyncScrollingCoordinator::scheduleUpdateScrollPositionAfterAsyncScroll, m_scrollingCoordinator.get(), nodeID, scrollPosition, isHandlingProgrammaticScroll(), scrollingLayerPositionAction));
}
示例9: ASSERT
void TreeScope::setParentTreeScope(TreeScope& newParentScope)
{
// A document node cannot be re-parented.
ASSERT(!rootNode().isDocumentNode());
newParentScope.guardRef();
if (m_parentTreeScope)
m_parentTreeScope->guardDeref();
m_parentTreeScope = &newParentScope;
setDocument(newParentScope.document());
}
示例10: beginInsertRows
int DeviceExplorerModel::addDevice(const Device::Node& deviceNode)
{
int row = m_rootNode.childCount();
QModelIndex parent; //invalid
beginInsertRows(parent, row, row);
rootNode().push_back(deviceNode);
endInsertRows();
return row;
}
示例11: OGDF_ASSERT
//
// embed original graph according to embedding of skeletons
//
// The procedure also handles the case when some (real or virtual)
// edges are reversed (used in upward-planarity algorithms)
void PlanarSPQRTree::embed(Graph &G)
{
OGDF_ASSERT(&G == &originalGraph());
const Skeleton &S = skeleton(rootNode());
const Graph &M = S.getGraph();
for (node v : M.nodes)
{
node vOrig = S.original(v);
SListPure<adjEntry> adjEdges;
for (adjEntry adj : v->adjEdges) {
edge e = adj->theEdge();
edge eOrig = S.realEdge(e);
if (eOrig != nullptr) {
adjEntry adjOrig = (vOrig == eOrig->source()) ?
eOrig->adjSource() : eOrig->adjTarget();
OGDF_ASSERT(adjOrig->theNode() == S.original(v));
adjEdges.pushBack(adjOrig);
} else {
node wT = S.twinTreeNode(e);
edge eTwin = S.twinEdge(e);
expandVirtualEmbed(wT,
(vOrig == skeleton(wT).original(eTwin->source())) ?
eTwin->adjSource() : eTwin->adjTarget(),
adjEdges);
}
}
G.sort(vOrig,adjEdges);
}
edge e;
forall_adj_edges(e,rootNode()) {
node wT = e->target();
if (wT != rootNode())
createInnerVerticesEmbed(G, wT);
}
示例12: scrollingTreeNodeDidScroll
void ThreadedScrollingTree::scrollingTreeNodeDidScroll(ScrollingNodeID nodeID, const FloatPoint& scrollPosition, const std::optional<FloatPoint>& layoutViewportOrigin, ScrollingLayerPositionAction scrollingLayerPositionAction)
{
if (!m_scrollingCoordinator)
return;
if (nodeID == rootNode()->scrollingNodeID())
setMainFrameScrollPosition(scrollPosition);
RunLoop::main().dispatch([scrollingCoordinator = m_scrollingCoordinator, nodeID, scrollPosition, layoutViewportOrigin, localIsHandlingProgrammaticScroll = isHandlingProgrammaticScroll(), scrollingLayerPositionAction] {
scrollingCoordinator->scheduleUpdateScrollPositionAfterAsyncScroll(nodeID, scrollPosition, layoutViewportOrigin, localIsHandlingProgrammaticScroll, scrollingLayerPositionAction);
});
}
示例13: createNodeStack
Node *buildExpressionTree(char *expression) {
NodeStack *operands = createNodeStack();
NodeStack *result = createNodeStack();
char *start = expression;
char *end; // = expression;
char *beginning = expression;
Stack *target;
Node *node;
Node *operand1;
Node *operand2;
while((start - beginning) < strlen(expression)) {
if(start[0] - 0 == 39) {
end = strstr(start + 1, "'") + 1;
} else {
end = strstr(start, " ");
if(!end) {
end = start;
while(end[0] != '\0')
++end;
}
}
char *token = malloc((end - start) + 1);
strlcpy(token, start, (end - start) + 1);
start = end + 1;
node = createNode(token);
if(isBinaryOperator(token)) {
target = result;
} else if(isLogicalOperator(token)) {
target = operands;
} else {
pushNode(operands, node);
continue;
}
operand1 = popNode(target);
operand2 = popNode(target);
node->right = operand1;
node->left = operand2;
// add this to stack
pushNode(result, node);
}
// return the first node in the list (not the top)
return rootNode(result);
}
示例14: doc
void XmlParser::parseInputFile(const string& file) {
/* Open document */
ticpp::Document doc(file.c_str());
try {
/* Load document */
doc.LoadFile();
rootNode(doc.GetTiXmlPointer(),file);
} catch(ticpp::Exception& ex) {
throw(ParserError(ex.details.description + " at line " +
toString(ex.details.line) + " in column " + toString(ex.details.column)));
}
}
示例15: ar
int CFormulatorDoc::paste( const QMimeData *mimeData, bool deleteOldSelection )
{
int iRet = 0;
if( mimeData->hasFormat( FORMULATOR_MIME_FORMAT ) )
{
//QByteArray mmlBinaryData = mimeData->data( FORMULATOR_MIME_FORMAT );
QDataStream ar( mimeData->data( FORMULATOR_MIME_FORMAT ) );
CRootNode *pNode = new CRootNode( m_owner );
pNode->Load( ar );
if( deleteOldSelection && rootNode()->IsSelection() )
rootNode()->MoveDel( 0 );
iRet = (rootNode()->Insert( pNode ) == 0 ? 1 : 0);
delete pNode;
}
else if( mimeData->hasText() )
{
iRet = (rootNode()->InsertMathML( __FMLCORE_Product_Title, mimeData->text(), 1 ) == 0 ? 1 : 0);
}
//else if( mimeData->hasImage() )
// setPixmap(qvariant_cast<QPixmap>(mimeData->imageData()));
return iRet;
}