本文整理汇总了C++中SListIterator::valid方法的典型用法代码示例。如果您正苦于以下问题:C++ SListIterator::valid方法的具体用法?C++ SListIterator::valid怎么用?C++ SListIterator::valid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SListIterator
的用法示例。
在下文中一共展示了SListIterator::valid方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: spqrproper
SList<node>& DynamicSPQRForest::findPathSPQR (node sH, node tH, node& rT) const
{
SList<node>& pT = *OGDF_NEW SList<node>;
node sT = spqrproper(sH->firstAdj()->theEdge());
node tT = spqrproper(tH->firstAdj()->theEdge());
node nT = findNCASPQR(sT,tT);
while (sT!=nT) {
edge eH = m_tNode_hRefEdge[sT];
node uH = eH->source();
node vH = eH->target();
if (uH!=sH && vH!=sH) pT.pushBack(sT);
if (uH==tH || vH==tH) { rT = sT; return pT; }
sT = spqrproper(m_hEdge_twinEdge[eH]);
}
SListIterator<node> iT = pT.rbegin();
while (tT!=nT) {
edge eH = m_tNode_hRefEdge[tT];
node uH = eH->source();
node vH = eH->target();
if (uH!=tH && vH!=tH) {
if (iT.valid()) pT.insertAfter(tT,iT);
else pT.pushFront(tT);
}
if (uH==sH || vH==sH) { rT = tT; return pT; }
tT = spqrproper(m_hEdge_twinEdge[eH]);
}
if (iT.valid()) pT.insertAfter(nT,iT);
else pT.pushFront(nT);
rT = nT; return pT;
}
示例2:
bool SDLEntity2D::LoadFrame ( std::string Name, std::string TexName, std::string MaskName, int FrameDelay, int x, int y, SGZ::RGBCOLOUR ColourKey )
{
/// Load up a Texture into an Animation
SListIterator<SGZAnimGroup2D*> AnimListITR = AnimList.getIterator();
for( AnimListITR.start(); AnimListITR.valid(); AnimListITR.forth() )
if((AnimListITR.item()->AnimName.compare(Name))==0)
{
SGZAnimFrame2D *Frame = new SGZAnimFrame2D;
Frame->TextureName = TexName;
Frame->MaskName = MaskName;
Frame->delay = FrameDelay;
Frame->u = x;
Frame->v = y;
Frame->colkey = ColourKey;
AnimListITR.item()->FrameList.append(Frame);
AnimListITR.item()->AnimNum++;
AnimListITR.item()->FrameITR = AnimListITR.item()->FrameList.getIterator();
if(!manTextures->checkExist(TexName))
SGZ::Logger.log( SGZLOG::Warning, "Texture " + TexName + " has not been loaded yet.. make sure it is before calling this frame!");
return true;
}
SGZ::Logger.log( SGZLOG::Warning, "Animation \"" + Name + "\" does not exist!\n");
return false;
}
示例3: checkExist
bool MTexture::checkExist ( const std::string &Name )
{
SListIterator<TextureObj*> TextureITR = mTextureList.getIterator();
for( TextureITR.start(); TextureITR.valid(); TextureITR.forth() )
if(TextureITR.item()->mName.compare(Name)==0)
return true;
return false;
}
示例4: Initialize
// Initializes a PQTree by a set of leaves that will korrespond to
// the set of Keys stored in leafKeys.
int PlanarPQTree::Initialize(SListPure<PlanarLeafKey<IndInfo*>*> &leafKeys)
{
SListIterator<PlanarLeafKey<IndInfo*>* > it;
SListPure<PQLeafKey<edge,IndInfo*,bool>*> castLeafKeys;
for (it = leafKeys.begin(); it.valid(); ++it)
castLeafKeys.pushBack((PQLeafKey<edge,IndInfo*,bool>*) *it);
return PQTree<edge,IndInfo*,bool>::Initialize(castLeafKeys);
}
示例5: setColourKey
bool MTexture::setColourKey ( const std::string &Name, const SGZ::RGBCOLOUR &key )
{
SListIterator<TextureObj*> TextureITR = mTextureList.getIterator();
for( TextureITR.start(); TextureITR.valid(); TextureITR.forth() )
if(TextureITR.item()->mName.compare(Name)==0)
TextureITR.item()->mData->setColourKey(key);
SGZ::Logger.log( SGZLOG::Warning, "Texture " + Name + " does not exist!\n");
return false;
}
示例6: Reduce
// Reduction reduced a set of leaves determined by their keys stored
// in leafKeys. Integer redNumber is for debugging only.
bool PlanarSubgraphPQTree::
Reduction(SListPure<PlanarLeafKey<whaInfo*>*> &leafKeys,
SList<PQLeafKey<edge,whaInfo*,bool>*> &eliminatedKeys,
int redNumber)
{
SListPure<PQLeafKey<edge,whaInfo*,bool>*> castLeafKeys;
SListIterator<PlanarLeafKey<whaInfo*>* > it;
for (it = leafKeys.begin(); it.valid(); ++it)
{
castLeafKeys.pushBack((PQLeafKey<edge,whaInfo*,bool>*) *it);
#ifdef OGDF_DEBUG
if (int(ogdf::debugLevel) >= int(dlHeavyChecks))
{
cout << (*it)->print() << endl;
}
#endif
}
determineMinRemoveSequence(castLeafKeys,eliminatedKeys);
removeEliminatedLeaves(eliminatedKeys);
SListIterator<PQLeafKey<edge,whaInfo*,bool>* > itn = castLeafKeys.begin();
SListIterator<PQLeafKey<edge,whaInfo*,bool>* > itp = itn++;
for (; itn.valid();)
{
if ((*itn)->nodePointer()->status()== WHA_DELETE)
{
itn++;
castLeafKeys.delSucc(itp);
}
else
itp = itn++;
}
if ((*castLeafKeys.begin())->nodePointer()->status() == WHA_DELETE)
castLeafKeys.popFront();
return Reduce(castLeafKeys,redNumber);
}
示例7: getTexture
void* MTexture::getTexture( const std::string &Name )
{
SListIterator<TextureObj*> TextureITR = mTextureList.getIterator();
for( TextureITR.start(); TextureITR.valid(); TextureITR.forth() )
if(TextureITR.item()->mName.compare(Name)==0)
{
return TextureITR.item()->mData->getTexture();
}
SGZ::Logger.log( SGZLOG::Warning, "Texture " + Name + " does not exist!\n");
return NULL;
}
示例8:
MTexture::~MTexture()
{
/** Destructor */
SListIterator<TextureObj*> TextureITR = mTextureList.getIterator();
TextureITR.start();
while (TextureITR.valid())
{
mTextureList.remove(TextureITR);
TextureITR.forth();
}
}
示例9: blitTexture
bool MTexture::blitTexture ( const std::string &Name, const SGZ::VECTOR3 &vector, const SGZ::SCALER u, const SGZ::SCALER v, const SGZ::SCALER w, const SGZ::SCALER h )
{
SListIterator<TextureObj*> TextureITR = mTextureList.getIterator();
for( TextureITR.start(); TextureITR.valid(); TextureITR.forth() )
if(TextureITR.item()->mName.compare(Name)==0)
{
TextureITR.item()->mData->blitTexture(vector,u,v,w,h);
return true;
}
SGZ::Logger.log( SGZLOG::Warning, "Texture " + Name + " does not exist!\n");
return false;
}
示例10: delTexture
bool MTexture::delTexture( const std::string &Name )
{
SListIterator<TextureObj*> TextureITR = mTextureList.getIterator();
for( TextureITR.start(); TextureITR.valid(); TextureITR.forth() )
if(TextureITR.item()->mName.compare(Name)==0)
{
mTextureList.remove(TextureITR);
return true;
}
SGZ::Logger.log( SGZLOG::Warning, "Texture " + Name + " does not exist!\n");
return false;
}
示例11: addTexMask
bool MTexture::addTexMask( const std::string &Name, const std::string &Maskname )
{
SListIterator<TextureObj*> TextureITR = mTextureList.getIterator();
for( TextureITR.start(); TextureITR.valid(); TextureITR.forth() )
if(TextureITR.item()->mName.compare(Name)==0)
{
TextureITR.item()->mData->loadTextureMask(Maskname);
return true;
}
SGZ::Logger.log( SGZLOG::Warning, "Texture " + Name + " does not exist!\n");
return false;
}
示例12: undoStars
void UMLGraph::undoStars()
{
SListIterator<node> it = m_centerNodes.begin();
while (it.valid())
{
undoStar(*it, false);
++it;
}//while
m_hiddenEdges->restore();
m_centerNodes.clear();
m_replacementEdge.init();
}//undostars
示例13: insert
void VarEdgeInserterDynCore::insert(edge eOrig, SList<adjEntry>& eip)
{
eip.clear();
node s = m_pr.copy(eOrig->source());
node t = m_pr.copy(eOrig->target());
// find path from s to t in BC-tree
// call of blockInsert() is done when we have found the path
// if no path is found, s and t are in different connected components
// and thus an empty edge insertion path is correct!
DynamicSPQRForest& dSPQRF = m_pBC->dynamicSPQRForest();
SList<node>& path = dSPQRF.findPath(s, t);
if (!path.empty()) {
SListIterator<node> it = path.begin();
node repS = dSPQRF.repVertex(s, *it);
for (SListIterator<node> jt = it; it.valid(); ++it) {
node repT = (++jt).valid() ? dSPQRF.cutVertex(*jt, *it) : dSPQRF.repVertex(t, *it);
// less than 3 nodes requires no crossings (cannot build SPQR-tree
// for a graph with less than 3 nodes!)
if (dSPQRF.numberOfNodes(*it) > 3) {
List<adjEntry> L;
blockInsert(repS, repT, L); // call biconnected case
// transform crossed edges to edges in G
for (adjEntry kt : L) {
edge e = kt->theEdge();
eip.pushBack(e->adjSource() == kt ? dSPQRF.original(e)->adjSource()
: dSPQRF.original(e)->adjTarget());
}
}
if (jt.valid()) repS = dSPQRF.cutVertex(*it, *jt);
}
}
delete &path;
}
示例14: if
// Function ReplaceFullRoot either replaces the full root
// or one full child of a partial root of a pertinent subtree
// by a single P-node with leaves corresponding the keys stored in leafKeys.
void PlanarSubgraphPQTree::
ReplaceFullRoot(SListPure<PlanarLeafKey<whaInfo*>*> &leafKeys)
{
PQLeaf<edge,whaInfo*,bool> *leafPtr = 0; // dummy
PQInternalNode<edge,whaInfo*,bool> *nodePtr = 0; // dummy
//PQNodeKey<edge,whaInfo*,bool> *nodeInfoPtr = 0; // dummy
PQNode<edge,whaInfo*,bool> *currentNode = 0; // dummy
SListIterator<PlanarLeafKey<whaInfo*>* > it;
if (!leafKeys.empty() && leafKeys.front() == leafKeys.back())
{
//ReplaceFullRoot: replace pertinent root by a single leaf
leafPtr = OGDF_NEW PQLeaf<edge,whaInfo*,bool>(m_identificationNumber++,
EMPTY,(PQLeafKey<edge,whaInfo*,bool>*)leafKeys.front());
exchangeNodes(m_pertinentRoot,(PQNode<edge,whaInfo*,bool>*) leafPtr);
if (m_pertinentRoot == m_root)
m_root = (PQNode<edge,whaInfo*,bool>*) leafPtr;
}
else if (!leafKeys.empty()) // at least two leaves
{
//replace pertinent root by a $P$-node
if ((m_pertinentRoot->type() == P_NODE) ||
(m_pertinentRoot->type() == Q_NODE))
{
nodePtr = (PQInternalNode<edge,whaInfo*,bool>*)m_pertinentRoot;
nodePtr->type(P_NODE);
nodePtr->status(PERTROOT);
nodePtr->childCount(0);
while (!fullChildren(m_pertinentRoot)->empty())
{
currentNode = fullChildren(m_pertinentRoot)->popFrontRet();
removeChildFromSiblings(currentNode);
}
}
else if (m_pertinentRoot->type() == LEAF)
{
nodePtr = OGDF_NEW PQInternalNode<edge,whaInfo*,bool>(m_identificationNumber++,
P_NODE,EMPTY);
exchangeNodes(m_pertinentRoot,nodePtr);
}
SListPure<PQLeafKey<edge,whaInfo*,bool>*> castLeafKeys;
for (it = leafKeys.begin(); it.valid(); ++it)
castLeafKeys.pushBack((PQLeafKey<edge,whaInfo*,bool>*) *it);
addNewLeavesToTree(nodePtr,castLeafKeys);
}
}
示例15:
void PlanarSubgraphPQTree::
removeEliminatedLeaves(SList<PQLeafKey<edge,whaInfo*,bool>*> &eliminatedKeys)
{
PQNode<edge,whaInfo*,bool>* nodePtr = 0;
PQNode<edge,whaInfo*,bool>* parent = 0;
PQNode<edge,whaInfo*,bool>* sibling = 0;
SListIterator<PQLeafKey<edge,whaInfo*,bool>*> it;
for (it = eliminatedKeys.begin(); it.valid(); it++)
{
nodePtr = (*it)->nodePointer();
parent = nodePtr->parent();
sibling = nodePtr->getNextSib(NULL);
removeNodeFromTree(parent,nodePtr);
checkIfOnlyChild(sibling,parent);
if (parent->status() == TO_BE_DELETED)
{
parent->status(WHA_DELETE);
}
nodePtr->status(WHA_DELETE);
}
}