diff --git a/src/CDF/CDF_StoreList.cdl b/src/CDF/CDF_StoreList.cdl index 914a123b10..bfd2203cdf 100644 --- a/src/CDF/CDF_StoreList.cdl +++ b/src/CDF/CDF_StoreList.cdl @@ -21,7 +21,7 @@ uses StackOfDocument from CDM, MapOfDocument from CDM, MapIteratorOfMapOfDocument from CDM, - StackIteratorOfStackOfDocument from CDM, + ListIteratorOfStackOfDocument from CDM, MetaData from CDM, ExtendedString from TCollection, StoreStatus from PCDM diff --git a/src/CDF/CDF_StoreList.cxx b/src/CDF/CDF_StoreList.cxx index 092618454c..c78c79a4bc 100644 --- a/src/CDF/CDF_StoreList.cxx +++ b/src/CDF/CDF_StoreList.cxx @@ -46,7 +46,7 @@ CDF_StoreList::CDF_StoreList(const Handle(CDM_Document)& aDocument) { void CDF_StoreList::Add(const Handle(CDM_Document)& aDocument) { if(!myItems.Contains(aDocument) && aDocument != myMainDocument) myItems.Add(aDocument); - myStack.Push(aDocument); + myStack.Prepend(aDocument); CDM_ReferenceIterator it(aDocument); for (;it.More();it.Next()) { @@ -83,9 +83,9 @@ PCDM_StoreStatus CDF_StoreList::Store (Handle(CDM_MetaData)& aMetaData, TCollect { try { OCC_CATCH_SIGNALS - for (; !myStack.IsEmpty(); myStack.Pop()) { + for (; !myStack.IsEmpty(); myStack.RemoveFirst()) { - Handle(CDM_Document) theDocument = myStack.Top(); + Handle(CDM_Document) theDocument = myStack.First(); if( theDocument == myMainDocument || theDocument->IsModified()) { if(!PCDM::FindStorageDriver(theDocument)){ diff --git a/src/CDM/CDM.cdl b/src/CDM/CDM.cdl index 406d9eb03e..e10854c0ea 100644 --- a/src/CDM/CDM.cdl +++ b/src/CDM/CDM.cdl @@ -64,6 +64,6 @@ is class DocumentHasher instantiates MapHasher from TCollection(Document from CDM); class MapOfDocument instantiates Map from TCollection(Document from CDM, DocumentHasher from CDM); class ListOfDocument instantiates List from TCollection(Document from CDM); - class StackOfDocument instantiates Stack from TCollection(Document from CDM); + class StackOfDocument instantiates List from TCollection(Document from CDM); end CDM; diff --git a/src/DDF/DDF.cdl b/src/DDF/DDF.cdl index cc58aeb0fd..f0b5ecf73d 100644 --- a/src/DDF/DDF.cdl +++ b/src/DDF/DDF.cdl @@ -49,7 +49,7 @@ is ---Purpose: Encapsulates a Transaction from TDF. class TransactionStack - instantiates Stack from TCollection (Transaction from DDF); + instantiates List from TCollection (Transaction from DDF); -- ---------------------------------------------------------------------- -- Package methods diff --git a/src/DDF/DDF_TransactionCommands.cxx b/src/DDF/DDF_TransactionCommands.cxx index dfdf27ffa8..281f0f295e 100644 --- a/src/DDF/DDF_TransactionCommands.cxx +++ b/src/DDF/DDF_TransactionCommands.cxx @@ -58,7 +58,7 @@ static Standard_Integer OpenTran (Draw_Interpretor& di, if (DDF::GetDF (a[1], DF)) { Handle(DDF_Transaction) tr = new DDF_Transaction(DF); di<<"Open transaction # "<Open()<<" # "<Transaction()<<"\n"; - DDF_TStack.Push(tr); + DDF_TStack.Prepend(tr); } return 0; } @@ -78,10 +78,10 @@ static Standard_Integer AbortTran (Draw_Interpretor& di, Handle(TDF_Data) DF; if (DDF::GetDF (a[1], DF)) { if (DF->Transaction () > 0) { - Handle(DDF_Transaction) tr = DDF_TStack.Top(); + Handle(DDF_Transaction) tr = DDF_TStack.First(); di<<"Abort transaction # "<Transaction()<<" # "<Transaction()<<"\n"; tr->Abort(); - DDF_TStack.Pop(); + DDF_TStack.RemoveFirst(); } else { di<<"DDF_BasicCommands::AbortTran - No more transaction to abort"<<"\n"; @@ -105,12 +105,12 @@ static Standard_Integer CommitTran (Draw_Interpretor& di, Handle(TDF_Data) DF; if (DDF::GetDF (a[1], DF)) { if (DF->Transaction () > 0) { - Handle(DDF_Transaction) tr = DDF_TStack.Top(); + Handle(DDF_Transaction) tr = DDF_TStack.First(); di<<"Commit transaction # "<Transaction()<<" # "<Transaction()<<"\n"; Standard_Boolean withDelta = Standard_False; if (n > 2) withDelta = (Draw::Atoi(a[2]) != 0); DDF_LastDelta = tr->Commit(withDelta); - DDF_TStack.Pop(); + DDF_TStack.RemoveFirst(); } else { di<<"DDF_BasicCommands::CommitTran - No more transaction to commit"<<"\n"; @@ -135,8 +135,8 @@ static Standard_Integer CurrentTran (Draw_Interpretor& di, if (DDF::GetDF (a[1], DF)) { di<<"# "<Transaction()<<"\n"; if (!DDF_TStack.IsEmpty()) - if (DF->Transaction() != DDF_TStack.Top()->Transaction()) - di<<"Transaction object said # "<Transaction()<<"\n"; + if (DF->Transaction() != DDF_TStack.First()->Transaction()) + di<<"Transaction object said # "<Transaction()<<"\n"; } return 0; diff --git a/src/ExprIntrp/ExprIntrp.cdl b/src/ExprIntrp/ExprIntrp.cdl index da09119198..65c1a6804f 100644 --- a/src/ExprIntrp/ExprIntrp.cdl +++ b/src/ExprIntrp/ExprIntrp.cdl @@ -43,17 +43,17 @@ is exception SyntaxError inherits Failure from Standard; private class StackOfGeneralExpression instantiates - Stack from TCollection (GeneralExpression from Expr); + List from TCollection (GeneralExpression from Expr); private class StackOfGeneralRelation instantiates - Stack from TCollection (GeneralRelation from Expr); + List from TCollection (GeneralRelation from Expr); private class StackOfGeneralFunction instantiates - Stack from TCollection (GeneralFunction from Expr); + List from TCollection (GeneralFunction from Expr); private class StackOfNames instantiates - Stack from TCollection (AsciiString from TCollection); + List from TCollection (AsciiString from TCollection); Parse(gen : Generator; str : AsciiString from TCollection) returns Boolean diff --git a/src/ExprIntrp/ExprIntrp_Analysis.cdl b/src/ExprIntrp/ExprIntrp_Analysis.cdl index 9a481229a9..ef71a30613 100644 --- a/src/ExprIntrp/ExprIntrp_Analysis.cdl +++ b/src/ExprIntrp/ExprIntrp_Analysis.cdl @@ -25,7 +25,7 @@ uses Generator from ExprIntrp, StackOfGeneralExpression from ExprIntrp, StackOfGeneralRelation from ExprIntrp, StackOfGeneralFunction from ExprIntrp, - StackOfInteger from TColStd, + ListOfInteger from TColStd, SequenceOfGeneralExpression from Expr, SequenceOfNamedFunction from ExprIntrp, SequenceOfNamedExpression from ExprIntrp, @@ -108,7 +108,7 @@ fields myGRStack : StackOfGeneralRelation; myGFStack : StackOfGeneralFunction; myNameStack : StackOfNames; - myValueStack : StackOfInteger; + myValueStack : ListOfInteger; myFunctions : SequenceOfNamedFunction; myNamed : SequenceOfNamedExpression; myMaster : Generator; diff --git a/src/ExprIntrp/ExprIntrp_Analysis.cxx b/src/ExprIntrp/ExprIntrp_Analysis.cxx index 3e43c1a841..edafb29494 100644 --- a/src/ExprIntrp/ExprIntrp_Analysis.cxx +++ b/src/ExprIntrp/ExprIntrp_Analysis.cxx @@ -24,35 +24,35 @@ ExprIntrp_Analysis::ExprIntrp_Analysis() {} void ExprIntrp_Analysis::Push(const Handle(Expr_GeneralExpression)& exp) { - myGEStack.Push(exp); + myGEStack.Prepend(exp); } void ExprIntrp_Analysis::PushRelation(const Handle(Expr_GeneralRelation)& rel) { - myGRStack.Push(rel); + myGRStack.Prepend(rel); } void ExprIntrp_Analysis::PushFunction(const Handle(Expr_GeneralFunction)& func) { - myGFStack.Push(func); + myGFStack.Prepend(func); } void ExprIntrp_Analysis::PushName(const TCollection_AsciiString& name) { - myNameStack.Push(name); + myNameStack.Prepend(name); } void ExprIntrp_Analysis::PushValue(const Standard_Integer val) { - myValueStack.Push(val); + myValueStack.Prepend(val); } Handle(Expr_GeneralExpression) ExprIntrp_Analysis::Pop() { Handle(Expr_GeneralExpression) res; if (!myGEStack.IsEmpty()) { - res = myGEStack.Top(); - myGEStack.Pop(); + res = myGEStack.First(); + myGEStack.RemoveFirst(); } return res; } @@ -61,8 +61,8 @@ Handle(Expr_GeneralRelation) ExprIntrp_Analysis::PopRelation() { Handle(Expr_GeneralRelation) res; if (!myGRStack.IsEmpty()) { - res = myGRStack.Top(); - myGRStack.Pop(); + res = myGRStack.First(); + myGRStack.RemoveFirst(); } return res; } @@ -71,8 +71,8 @@ Handle(Expr_GeneralFunction) ExprIntrp_Analysis::PopFunction() { Handle(Expr_GeneralFunction) res; if (!myGFStack.IsEmpty()) { - res = myGFStack.Top(); - myGFStack.Pop(); + res = myGFStack.First(); + myGFStack.RemoveFirst(); } return res; } @@ -81,8 +81,8 @@ TCollection_AsciiString ExprIntrp_Analysis::PopName() { TCollection_AsciiString res; if (!myNameStack.IsEmpty()) { - res = myNameStack.Top(); - myNameStack.Pop(); + res = myNameStack.First(); + myNameStack.RemoveFirst(); } return res; } @@ -91,8 +91,8 @@ Standard_Integer ExprIntrp_Analysis::PopValue() { Standard_Integer res =0; if (!myValueStack.IsEmpty()) { - res = myValueStack.Top(); - myValueStack.Pop(); + res = myValueStack.First(); + myValueStack.RemoveFirst(); } return res; } diff --git a/src/GraphTools/GraphTools_DFSIterator.gxx b/src/GraphTools/GraphTools_DFSIterator.gxx index 3356edaa98..a0f577becb 100644 --- a/src/GraphTools/GraphTools_DFSIterator.gxx +++ b/src/GraphTools/GraphTools_DFSIterator.gxx @@ -16,7 +16,7 @@ #include #include -#include +#include //======================================================================= //function : GraphTools_DFSIterator @@ -36,18 +36,18 @@ void GraphTools_DFSIterator::Perform { Standard_Integer index; myVisited.Clear(); - TColStd_StackOfInteger myReady; + TColStd_ListOfInteger myReady; index = myVisited.Add(V); - myReady.Push(index); + myReady.Prepend(index); while (!myReady.IsEmpty()) { - Vertex w1 = myVisited (myReady.Top()); - myReady.Pop(); + Vertex w1 = myVisited (myReady.First()); + myReady.RemoveFirst(); for (VIterator it(G,w1); it.More(); it.Next()) { Vertex w2 = it.Value(); if (!myVisited.Contains(w2)) { index = myVisited.Add(w2); - myReady.Push(index); + myReady.Prepend(index); } } } diff --git a/src/GraphTools/GraphTools_ReducedGraph.cdl b/src/GraphTools/GraphTools_ReducedGraph.cdl index 7d43c640a4..78fa936e05 100644 --- a/src/GraphTools/GraphTools_ReducedGraph.cdl +++ b/src/GraphTools/GraphTools_ReducedGraph.cdl @@ -69,7 +69,7 @@ generic class ReducedGraph from GraphTools uses SC from GraphTools, SCList from GraphTools, ListIteratorOfSCList from GraphTools, - StackOfInteger from TColStd + ListOfInteger from TColStd raises NoSuchObject from Standard, NoMoreObject from Standard, @@ -233,7 +233,7 @@ fields -- algorithm performed : Boolean from Standard; myNowIndex : Integer from Standard; - myStack : StackOfInteger from TColStd; + myStack : ListOfInteger from TColStd; -- result mySort : SCList from GraphTools; diff --git a/src/GraphTools/GraphTools_ReducedGraph.gxx b/src/GraphTools/GraphTools_ReducedGraph.gxx index 4529a22d77..4c58310cf0 100644 --- a/src/GraphTools/GraphTools_ReducedGraph.gxx +++ b/src/GraphTools/GraphTools_ReducedGraph.gxx @@ -220,7 +220,7 @@ Standard_Integer GraphTools_ReducedGraph::Visit myNowIndex++; myVertices(k).SetVisited(myNowIndex); MIN = myNowIndex; - myStack.Push(k); + myStack.Prepend(k); Standard_Integer currentVisited; currentVisited = myVertices(k).GetVisited(); Standard_Integer adjacentIndex; @@ -242,11 +242,11 @@ Standard_Integer GraphTools_ReducedGraph::Visit Handle(GraphTools_SC) SC = new GraphTools_SC(); Standard_Boolean more; do { - SC->AddVertex(myStack.Top()); - myVertices(myStack.Top()).SetVisited(IntegerLast()); - myVertices(myStack.Top()).SetSC(SC); - more = myStack.Top() != k; - myStack.Pop() ; + SC->AddVertex(myStack.First()); + myVertices(myStack.First()).SetVisited(IntegerLast()); + myVertices(myStack.First()).SetSC(SC); + more = myStack.First() != k; + myStack.RemoveFirst() ; } while (more); mySort.Prepend(SC); diff --git a/src/GraphTools/GraphTools_SortedStrgCmptsFromIterator.cdl b/src/GraphTools/GraphTools_SortedStrgCmptsFromIterator.cdl index a0c4330663..b91bd41fef 100644 --- a/src/GraphTools/GraphTools_SortedStrgCmptsFromIterator.cdl +++ b/src/GraphTools/GraphTools_SortedStrgCmptsFromIterator.cdl @@ -33,7 +33,7 @@ generic class SortedStrgCmptsFromIterator from GraphTools -- returned before an other which point to it. -uses StackOfInteger from TColStd, +uses ListOfInteger from TColStd, ListOfSequenceOfInteger from GraphTools, ListIteratorOfListOfSequenceOfInteger from GraphTools @@ -105,7 +105,7 @@ fields myVertices : SCMap from GraphTools; -- algorithm myNowIndex : Integer from Standard; - myStack : StackOfInteger from TColStd; + myStack : ListOfInteger from TColStd; -- result mySort : ListOfSequenceOfInteger from GraphTools; myIterator : ListIteratorOfListOfSequenceOfInteger from GraphTools; diff --git a/src/GraphTools/GraphTools_SortedStrgCmptsFromIterator.gxx b/src/GraphTools/GraphTools_SortedStrgCmptsFromIterator.gxx index ce63ae8997..7bda0e21c9 100644 --- a/src/GraphTools/GraphTools_SortedStrgCmptsFromIterator.gxx +++ b/src/GraphTools/GraphTools_SortedStrgCmptsFromIterator.gxx @@ -143,7 +143,7 @@ Standard_Integer GraphTools_SortedStrgCmptsFromIterator::Visit myNowIndex++; myVertices(k) = myNowIndex; MIN = myNowIndex; - myStack.Push(k); + myStack.Prepend(k); Standard_Integer currentVisited; currentVisited = myVertices.FindFromIndex (k); Standard_Integer adjacentIndex; @@ -165,10 +165,10 @@ Standard_Integer GraphTools_SortedStrgCmptsFromIterator::Visit TColStd_SequenceOfInteger& newSC = mySort.First(); Standard_Boolean more; do { - newSC.Append(myStack.Top()); - myVertices(myStack.Top()) = IntegerLast(); - more = myStack.Top() != k; - myStack.Pop() ; + newSC.Append(myStack.First()); + myVertices(myStack.First()) = IntegerLast(); + more = myStack.First() != k; + myStack.RemoveFirst() ; } while (more); } diff --git a/src/NCollection/FILES b/src/NCollection/FILES index a151b880a4..4fbfa6a3e7 100755 --- a/src/NCollection/FILES +++ b/src/NCollection/FILES @@ -27,7 +27,6 @@ NCollection_Array1.hxx NCollection_HArray1.hxx NCollection_Array2.hxx NCollection_HArray2.hxx -NCollection_Stack.hxx NCollection_List.hxx NCollection_Set.hxx NCollection_HSet.hxx @@ -54,7 +53,6 @@ NCollection_DefineSequence.hxx NCollection_DefineHSequence.hxx NCollection_DefineSet.hxx NCollection_DefineHSet.hxx -NCollection_DefineStack.hxx NCollection_BaseVector.hxx NCollection_BaseVector.cxx diff --git a/src/NCollection/NCollection_DefineStack.hxx b/src/NCollection/NCollection_DefineStack.hxx deleted file mode 100644 index b11791f5a6..0000000000 --- a/src/NCollection/NCollection_DefineStack.hxx +++ /dev/null @@ -1,35 +0,0 @@ -// Created on: 2002-04-17 -// Created by: Alexander Kartomin (akm) -// Copyright (c) 2002-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -// Automatically created from NCollection_Stack.hxx by GAWK -// Purpose: A stack is a structure where item can be added and -// removed from the top. Like a stack of plates in a -// kitchen. The last entered item will be be the -// first removed. This is called a LIFO (last In First Out). -// Inherits BaseList, adding the data item to each node. - - -#ifndef NCollection_DefineStack_HeaderFile -#define NCollection_DefineStack_HeaderFile - -#include -#include - -// **************************************** Template for Stack class ******** - -#define DEFINE_STACK(_ClassName_, _BaseCollection_, TheItemType) \ -typedef NCollection_Stack _ClassName_; - -#endif diff --git a/src/NCollection/NCollection_Stack.hxx b/src/NCollection/NCollection_Stack.hxx deleted file mode 100644 index 8a15a7046a..0000000000 --- a/src/NCollection/NCollection_Stack.hxx +++ /dev/null @@ -1,142 +0,0 @@ -// Created on: 2002-04-17 -// Created by: Alexander Kartomin (akm) -// Copyright (c) 2002-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef NCollection_Stack_HeaderFile -#define NCollection_Stack_HeaderFile - -#include -#include -#include -#include -#if !defined No_Exception && !defined No_Standard_NoSuchObject -#include -#endif - -/** - * Purpose: A stack is a structure where item can be added and - * removed from the top. Like a stack of plates in a - * kitchen. The last entered item will be be the - * first removed. This is called a LIFO (last In First Out). - * Inherits BaseList, adding the data item to each node. - */ -template class NCollection_Stack - : public NCollection_BaseCollection, - public NCollection_BaseList -{ - public: - typedef NCollection_TListNode StackNode; - typedef NCollection_TListIterator Iterator; - - public: - // ---------- PUBLIC METHODS ------------ - - //! Constructor - NCollection_Stack(const Handle(NCollection_BaseAllocator)& theAllocator=0L) : - NCollection_BaseCollection(theAllocator), - NCollection_BaseList() {} - - //! Copy constructor - NCollection_Stack (const NCollection_Stack& theOther) : - NCollection_BaseCollection(theOther.myAllocator), - NCollection_BaseList() - { *this = theOther; } - - //! Size - Number of items - virtual Standard_Integer Size (void) const - { return Extent(); } - - //! Depth - Number of items - Standard_Integer Depth (void) const - { return Extent(); } - - //! Replace this list by the items of theOther collection - virtual void Assign (const NCollection_BaseCollection& theOther) - { - if (this == &theOther) - return; - Clear(); - TYPENAME NCollection_BaseCollection::Iterator& anIter = - theOther.CreateIterator(); - for (; anIter.More(); anIter.Next()) - { - StackNode* pNew = new (this->myAllocator) StackNode(anIter.Value()); - PAppend(pNew); - } - } - - //! Replace this list by the items of theOther Stack - NCollection_Stack& operator= (const NCollection_Stack& theOther) - { - if (this == &theOther) - return *this; - Clear (); - StackNode * pCur = (StackNode *) theOther.PFirst(); - while (pCur) - { - StackNode* pNew = new (this->myAllocator) StackNode(pCur->Value()); - PAppend(pNew); - pCur = (StackNode *) pCur->Next(); - } - return *this; - } - - //! Clear this stack - void Clear (void) - { PClear (StackNode::delNode, this->myAllocator); } - - //! Top item - constant - const TheItemType& Top (void) const - { -#if !defined No_Exception && !defined No_Standard_NoSuchObject - if (IsEmpty()) Standard_NoSuchObject::Raise ("NCollection_Stack::Top"); -#endif - return ((StackNode *) PFirst())->Value(); - } - - //! Top item - variable - TheItemType& ChangeTop (void) - { -#if !defined No_Exception && !defined No_Standard_NoSuchObject - if (IsEmpty()) Standard_NoSuchObject::Raise("NCollection_Stack::ChangeTop"); -#endif - return ((StackNode *) PFirst())->ChangeValue(); - } - - //! Push one item - void Push (const TheItemType& theItem) - { - StackNode * pNew = new (this->myAllocator) StackNode(theItem); - PPrepend(pNew); - } - - //! Pop top item - void Pop (void) - { PRemoveFirst (StackNode::delNode, this->myAllocator); } - - //! Destructor - clears the List - ~NCollection_Stack (void) - { Clear(); } - - private: - // ----------- PRIVATE METHODS ----------- - - //! Creates Iterator for use on BaseCollection - virtual TYPENAME NCollection_BaseCollection::Iterator& - CreateIterator(void) const - { return *(new (this->IterAllocator()) Iterator(*this)); } - -}; - -#endif diff --git a/src/NLPlate/NLPlate.cdl b/src/NLPlate/NLPlate.cdl index 0e7c36699e..570af743b4 100644 --- a/src/NLPlate/NLPlate.cdl +++ b/src/NLPlate/NLPlate.cdl @@ -34,7 +34,7 @@ is -- -- utilities and internal Classes - class StackOfPlate instantiates Stack from TCollection + class StackOfPlate instantiates List from TCollection (Plate from Plate); class SequenceOfHGPPConstraint instantiates Sequence from TCollection (HGPPConstraint); diff --git a/src/NLPlate/NLPlate_NLPlate.cxx b/src/NLPlate/NLPlate_NLPlate.cxx index e97795fee2..3a6369006f 100644 --- a/src/NLPlate/NLPlate_NLPlate.cxx +++ b/src/NLPlate/NLPlate_NLPlate.cxx @@ -27,7 +27,7 @@ #include #include -#include +#include #include @@ -73,7 +73,7 @@ NLPlate_NLPlate::NLPlate_NLPlate(const Handle(Geom_Surface)& InitialSurface) : if(ordreDN(point2d.X(),point2d.Y(),iu,iv).XYZ(); - for(NLPlate_StackIteratorOfStackOfPlate SI(mySOP);SI.More();SI.Next()) + for(NLPlate_ListIteratorOfStackOfPlate SI(mySOP);SI.More();SI.Next()) { if(SI.Value().IsDone()) Value += SI.Value().EvaluateDerivative(point2d,iu,iv); @@ -168,7 +168,7 @@ NLPlate_NLPlate::NLPlate_NLPlate(const Handle(Geom_Surface)& InitialSurface) : { if(!(myInitialSurface->IsCNu(cont+1)&&myInitialSurface->IsCNv(cont+1)))break; } - for(NLPlate_StackIteratorOfStackOfPlate SI(mySOP);SI.More();SI.Next()) + for(NLPlate_ListIteratorOfStackOfPlate SI(mySOP);SI.More();SI.Next()) { if((SI.Value().IsDone())&&(cont > SI.Value().Continuity())) cont = SI.Value().Continuity(); } @@ -181,8 +181,8 @@ const Standard_Integer ResolutionOrder, const Standard_Real IncrementalLoading) { Plate_Plate EmptyPlate; - mySOP.Push(EmptyPlate); - Plate_Plate &TopP = mySOP.ChangeTop(); + mySOP.Prepend(EmptyPlate); + Plate_Plate &TopP = mySOP.First(); for(Standard_Integer index =1; index <= myHGPPConstraints.Length(); index++) { const Handle(NLPlate_HGPPConstraint) &HGPP = myHGPPConstraints(index); @@ -265,7 +265,7 @@ const Standard_Real IncrementalLoading) TopP.SolveTI(ResolutionOrder); if(!TopP.IsDone()) { - mySOP.Pop(); + mySOP.RemoveFirst(); return Standard_False; } else diff --git a/src/OpenGl/OpenGl_ShaderStates.cxx b/src/OpenGl/OpenGl_ShaderStates.cxx index d973809de7..41d2730ef4 100755 --- a/src/OpenGl/OpenGl_ShaderStates.cxx +++ b/src/OpenGl/OpenGl_ShaderStates.cxx @@ -43,7 +43,7 @@ Standard_Size OpenGl_StateInterface::Index() const // ======================================================================= void OpenGl_StateInterface::Update() { - myStateStack.Push (myIndex); + myStateStack.Prepend (myIndex); myIndex = myNextIndex; ++myNextIndex; } @@ -56,8 +56,8 @@ void OpenGl_StateInterface::Revert() { if (!myStateStack.IsEmpty()) { - myIndex = myStateStack.Top(); - myStateStack.Pop(); + myIndex = myStateStack.First(); + myStateStack.RemoveFirst(); } else { diff --git a/src/OpenGl/OpenGl_ShaderStates.hxx b/src/OpenGl/OpenGl_ShaderStates.hxx index 80126a93a0..c0adc8f55c 100755 --- a/src/OpenGl/OpenGl_ShaderStates.hxx +++ b/src/OpenGl/OpenGl_ShaderStates.hxx @@ -21,7 +21,7 @@ #include #include -#include +#include //! Defines interface for OpenGL state. class OpenGl_StateInterface @@ -44,7 +44,7 @@ protected: Standard_Size myIndex; //!< Current state index Standard_Size myNextIndex; //!< Next state index - NCollection_Stack myStateStack; //!< Stack of previous states. + NCollection_List myStateStack; //!< Stack of previous states. }; diff --git a/src/QADraw/QADraw.cxx b/src/QADraw/QADraw.cxx index e6517726b7..423d9451f7 100644 --- a/src/QADraw/QADraw.cxx +++ b/src/QADraw/QADraw.cxx @@ -22,7 +22,6 @@ #include #include #include -#include #include #include #include diff --git a/src/QANCollection/QANCollection.cdl b/src/QANCollection/QANCollection.cdl index 4fb1758094..29e7d329f0 100644 --- a/src/QANCollection/QANCollection.cdl +++ b/src/QANCollection/QANCollection.cdl @@ -23,7 +23,6 @@ uses is class ListOfPnt instantiates List from TCollection (Pnt from gp); - class StackOfPnt instantiates Stack from TCollection (Pnt from gp); class DataMapOfRealPnt instantiates DataMap from TCollection (Real from Standard, Pnt from gp, diff --git a/src/QANCollection/QANCollection2.cxx b/src/QANCollection/QANCollection2.cxx index b81907a9de..4aa6a0fadf 100644 --- a/src/QANCollection/QANCollection2.cxx +++ b/src/QANCollection/QANCollection2.cxx @@ -207,21 +207,6 @@ static Standard_Integer QANColTestList(Draw_Interpretor& di, Standard_Integer ar return 0; } -//======================================================================= -//function : QANColTestStack -//purpose : -//======================================================================= -static Standard_Integer QANColTestStack(Draw_Interpretor& di, Standard_Integer argc, const char ** argv) -{ - if ( argc != 1) { - di << "Usage : " << argv[0] << "\n"; - return 1; - } - QANCollection_StackFunc aStack; - TestStack(aStack); - return 0; -} - //======================================================================= //function : QANColTestSet //purpose : @@ -264,7 +249,6 @@ void QANCollection::Commands2(Draw_Interpretor& theCommands) { theCommands.Add("QANColTestIndexedMap", "QANColTestIndexedMap", __FILE__, QANColTestIndexedMap, group); theCommands.Add("QANColTestIndexedDataMap", "QANColTestIndexedDataMap", __FILE__, QANColTestIndexedDataMap, group); theCommands.Add("QANColTestList", "QANColTestList", __FILE__, QANColTestList, group); - theCommands.Add("QANColTestStack", "QANColTestStack", __FILE__, QANColTestStack, group); theCommands.Add("QANColTestSet", "QANColTestSet", __FILE__, QANColTestSet, group); theCommands.Add("QANColTestSequence", "QANColTestSequence", __FILE__, QANColTestSequence, group); diff --git a/src/QANCollection/QANCollection3.cxx b/src/QANCollection/QANCollection3.cxx index 6ec7cc72cf..de4e3ba316 100644 --- a/src/QANCollection/QANCollection3.cxx +++ b/src/QANCollection/QANCollection3.cxx @@ -97,20 +97,6 @@ static Standard_Integer QANColPerfList(Draw_Interpretor& di, Standard_Integer ar return 0; } -//======================================================================= -//function : QANColPerfStack -//purpose : -//======================================================================= -static Standard_Integer QANColPerfStack(Draw_Interpretor& di, Standard_Integer argc, const char ** argv) -{ - Standard_Integer Repeat, Size; - if ( CheckArguments(di, argc, argv, Repeat, Size) ) { - return 1; - } - CompStack(Repeat,Size); - return 0; -} - //======================================================================= //function : QANColPerfSet //purpose : @@ -230,7 +216,6 @@ void QANCollection::Commands3(Draw_Interpretor& theCommands) { theCommands.Add("QANColPerfArray1", "QANColPerfArray1 Repeat Size", __FILE__, QANColPerfArray1, group); theCommands.Add("QANColPerfArray2", "QANColPerfArray2 Repeat Size", __FILE__, QANColPerfArray2, group); theCommands.Add("QANColPerfList", "QANColPerfList Repeat Size", __FILE__, QANColPerfList, group); - theCommands.Add("QANColPerfStack", "QANColPerfStack Repeat Size", __FILE__, QANColPerfStack, group); theCommands.Add("QANColPerfSet", "QANColPerfSet Repeat Size", __FILE__, QANColPerfSet, group); theCommands.Add("QANColPerfSequence", "QANColPerfSequence Repeat Size", __FILE__, QANColPerfSequence, group); theCommands.Add("QANColPerfMap", "QANColPerfMap Repeat Size", __FILE__, QANColPerfMap, group); diff --git a/src/QANCollection/QANCollection_Common2.hxx b/src/QANCollection/QANCollection_Common2.hxx index a1d2fcf212..ca047a934a 100644 --- a/src/QANCollection/QANCollection_Common2.hxx +++ b/src/QANCollection/QANCollection_Common2.hxx @@ -67,15 +67,12 @@ DEFINE_INDEXEDMAP(QANCollection_IndexedMapFunc,QANCollection_Key1BaseColFunc,Key DEFINE_INDEXEDDATAMAP(QANCollection_IDMapFunc,QANCollection_BaseColFunc,Key1Type,ItemType) #include -#include #include #include ////////////////////////////////DEFINE_LIST(QANCollection_List,QANCollection_BaseCol,ItemType) -////////////////////////////////DEFINE_STACK(QANCollection_Stack,QANCollection_BaseCol,ItemType) ////////////////////////////////DEFINE_SET(QANCollection_Set,QANCollection_Key2BaseCol,Key2Type) ////////////////////////////////DEFINE_HSET(QANCollection_HSet,QANCollection_Set) DEFINE_LIST(QANCollection_ListFunc,QANCollection_BaseColFunc,ItemType) -DEFINE_STACK(QANCollection_StackFunc,QANCollection_BaseColFunc,ItemType) DEFINE_SET(QANCollection_SetFunc,QANCollection_Key2BaseColFunc,Key2Type) DEFINE_HSET(QANCollection_HSetFunc,QANCollection_SetFunc) diff --git a/src/QANCollection/QANCollection_Common3.hxx b/src/QANCollection/QANCollection_Common3.hxx index 6ba90b9f90..1fdf644bfd 100644 --- a/src/QANCollection/QANCollection_Common3.hxx +++ b/src/QANCollection/QANCollection_Common3.hxx @@ -67,15 +67,12 @@ DEFINE_INDEXEDMAP(QANCollection_IndexedMapPerf,QANCollection_Key1BaseColPerf,Key DEFINE_INDEXEDDATAMAP(QANCollection_IDMapPerf,QANCollection_BaseColPerf,Key1Type,ItemType) #include -#include #include #include ////////////////////////////////DEFINE_LIST(QANCollection_List,QANCollection_BaseCol,ItemType) -////////////////////////////////DEFINE_STACK(QANCollection_Stack,QANCollection_BaseCol,ItemType) ////////////////////////////////DEFINE_SET(QANCollection_Set,QANCollection_Key2BaseCol,Key2Type) ////////////////////////////////DEFINE_HSET(QANCollection_HSet,QANCollection_Set) DEFINE_LIST(QANCollection_ListPerf,QANCollection_BaseColPerf,ItemType) -DEFINE_STACK(QANCollection_StackPerf,QANCollection_BaseColPerf,ItemType) DEFINE_SET(QANCollection_SetPerf,QANCollection_Key2BaseColPerf,Key2Type) DEFINE_HSET(QANCollection_HSetPerf,QANCollection_SetPerf) diff --git a/src/QANCollection/QANCollection_FuncLists.hxx b/src/QANCollection/QANCollection_FuncLists.hxx index 189e9d2a81..150f78a940 100644 --- a/src/QANCollection/QANCollection_FuncLists.hxx +++ b/src/QANCollection/QANCollection_FuncLists.hxx @@ -70,40 +70,6 @@ void TestList (QANCollection_ListFunc& theL) aL.Clear(); } -// ===================== Test methods of Stack type =========================== -////////////////////////////////void TestStack (QANCollection_Stack& theS) -void TestStack (QANCollection_StackFunc& theS) -{ - // Depth - Standard_Integer iDep=theS.Depth(); - Standard_Integer i; - - printf ("Info: testing Stack(%d)\n", iDep); - // Push, Pop, Top, ChangeTop - ItemType anItem; - ////////////////////////////////QANCollection_Stack aS; - QANCollection_StackFunc aS; - for (i=0; i<4; i++) - { - Random (anItem); - aS.Push (anItem); - Random(aS.ChangeTop()); - Random (anItem); - aS.Push (anItem); - PrintItem(aS.Top()); - aS.Pop(); - } - // Copy constructor + operator= - ////////////////////////////////theS = QANCollection_Stack(aS); - theS = QANCollection_StackFunc(aS); - - // Assign - AssignCollection (theS, aS); - - // Clear - aS.Clear(); -} - // ===================== Test methods of Set type ============================= ////////////////////////////////void TestSet (QANCollection_Set& theS) void TestSet (QANCollection_SetFunc& theS) diff --git a/src/QANCollection/QANCollection_FuncTest.hxx b/src/QANCollection/QANCollection_FuncTest.hxx index caba78e9d7..a2db27fc36 100644 --- a/src/QANCollection/QANCollection_FuncTest.hxx +++ b/src/QANCollection/QANCollection_FuncTest.hxx @@ -34,7 +34,6 @@ // Standard_EXPORT void TestInDaMap (QANCollection_IDMap& theNM); #include // Standard_EXPORT void TestList (QANCollection_List& theLi); -// Standard_EXPORT void TestStack (QANCollection_Stack& theSt); // Standard_EXPORT void TestSet (QANCollection_Set& theSe); // Standard_EXPORT void TestSequence(QANCollection_Sequence& theSq); #include diff --git a/src/QANCollection/QANCollection_PerfLists.hxx b/src/QANCollection/QANCollection_PerfLists.hxx index 84b0547996..657bdf1882 100644 --- a/src/QANCollection/QANCollection_PerfLists.hxx +++ b/src/QANCollection/QANCollection_PerfLists.hxx @@ -17,7 +17,6 @@ #define QANCollection_PerfLists_HeaderFile #include -#include #include #include @@ -93,92 +92,6 @@ void CompList (const Standard_Integer theRep, } -// ===================== Test perform of Stack type ========================== -void CompStack (const Standard_Integer theRep, - const Standard_Integer theSize) -{ - Standard_Integer i,j; - - ////////////////////////////////Perf_Meter aNPush ("NCollection_Stack pushing",0); - ////////////////////////////////Perf_Meter aTPush ("TCollection_Stack pushing",0); - ////////////////////////////////Perf_Meter aNPopp ("NCollection_Stack popping",0); - ////////////////////////////////Perf_Meter aTPopp ("TCollection_Stack popping",0); - ////////////////////////////////Perf_Meter aNOper ("NCollection_Stack operator=",0); - ////////////////////////////////Perf_Meter aTOper ("TCollection_Stack operator=",0); - ////////////////////////////////Perf_Meter aNClea ("NCollection_Stack clearing",0); - ////////////////////////////////Perf_Meter aTClea ("TCollection_Stack clearing",0); - ////////////////////////////////Perf_Meter aNAssi ("NCollection_Stack Assign",0); - for (i=0; i. - --If this stack is not empty, it is automatically cleared before copying. - -- Note that this method is an alias of the assignment - -- operator operator =. - ---C++: alias operator = - ---C++: return const & - is static; - - IsEmpty(me) returns Boolean - ---Purpose: Returns True when the stack is empty. - -- i.e. Depth() == 0 - ---C++: inline - is static; - - Depth(me) returns Integer - ---Level: Public - ---Purpose: Returns the number of Items in the stack. - -- The depth of this stack is: - -- - incremented by Push, and - -- - decremented by Pop. - -- Example: - -- me = (A B C) - -- returns 3 - ---C++: inline - is static; - - Top(me) returns any Item - ---Level: Public - ---Purpose: Returns the Item at the top of the stack. - -- Example: - -- before - -- me = (A B C) - -- after - -- me = (A B C) - -- returns - -- A - -- Trigger: Raises an exception when is empty - ---C++: return const & - raises NoSuchObject from Standard - is static; - - Push(me : in out; I : Item) - ---Level: Public - ---Purpose: Adds at the top of the stack. Depth is - -- incremented. - -- Example: - -- before - -- me = (A B C) I = D - -- after - -- me = (D A B C) - is static; - - Pop(me : in out) - ---Level: Public - ---Purpose: Removes the Item at the top of the stack. Depth is - -- decremented. - -- Example: - -- before - -- me = (A B C) - -- after - -- me = (B C) - -- Trigger: Raises an exception when is empty - raises NoSuchObject from Standard - is static; - - Clear(me : in out) - ---Level: Public - ---Purpose: Removes all the items from the stack. - ---C++: alias ~ - is static; - - ChangeTop(me : in out) returns any Item - ---Level: Public - ---Purpose: Returns a modifiable reference of the top of the stack. - -- Example: - -- before - -- me = (A B C) - -- me.ChangeTop() = D - -- after - -- me = (D B C) - -- Trigger: Raises an exception when is empty - raises NoSuchObject from Standard - ---C++: return & - is static; - -fields - - myTop : Address from Standard; - myDepth : Integer from Standard; - -friends - class StackIterator from TCollection - -end Stack; diff --git a/src/TCollection/TCollection_Stack.gxx b/src/TCollection/TCollection_Stack.gxx deleted file mode 100644 index d5d1eaae8e..0000000000 --- a/src/TCollection/TCollection_Stack.gxx +++ /dev/null @@ -1,164 +0,0 @@ -// Created on: 1993-01-18 -// Created by: Remi LEQUETTE -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#include - -//======================================================================= -//function : TCollection_Stack -//purpose : -//======================================================================= - -TCollection_Stack::TCollection_Stack() : - myTop(NULL), - myDepth(0) -{ -} - -//======================================================================= -//function : TCollection_Stack -//purpose : -//======================================================================= - -TCollection_Stack::TCollection_Stack(const TCollection_Stack& Other) -{ - if (!Other.IsEmpty()) { - cout << "WARNING copy constructor of non empty stack !"<Value(),(TCollection_MapNode*)0L); - if (r) r->Next() = q; - else myTop = q; - r = q; - p = (TCollection_StackNode*)p->Next(); - } - myDepth = Other.myDepth; -} - -//======================================================================= -//function : Assign -//purpose : -//======================================================================= - -const TCollection_Stack& TCollection_Stack::Assign - (const TCollection_Stack& Other) -{ - if (this == &Other) return *this; - Clear(); - TCollection_StackNode* p = (TCollection_StackNode*) Other.myTop; - TCollection_StackNode* q; - TCollection_StackNode* r = NULL; - while (p) { - q = new TCollection_StackNode(p->Value(),(TCollection_MapNode*)0L); - if (r) r->Next() = q; - else myTop = q; - r = q; - p = (TCollection_StackNode*)p->Next(); - } - myDepth = Other.myDepth; - return *this; -} - - -//======================================================================= -//function : Top -//purpose : -//======================================================================= - -const Item& TCollection_Stack::Top() const -{ - Standard_NoSuchObject_Raise_if(IsEmpty(),"TCollection_Stack"); - return ((TCollection_StackNode*)myTop)->Value(); -} - -//======================================================================= -//function : Push -//purpose : -//======================================================================= - -void TCollection_Stack::Push(const Item& I) -{ - myTop = new TCollection_StackNode(I,(TCollection_StackNode*)myTop); - myDepth++; -} - -//======================================================================= -//function : Pop -//purpose : -//======================================================================= - -void TCollection_Stack::Pop() -{ - Standard_NoSuchObject_Raise_if(IsEmpty(),"TCollection_Stack"); - TCollection_StackNode* p = (TCollection_StackNode*) myTop; - myTop = p->Next(); - delete p; - myDepth--; -} - -//======================================================================= -//function : Clear -//purpose : -//======================================================================= - -void TCollection_Stack::Clear() -{ - TCollection_StackNode* p = (TCollection_StackNode*) myTop; - TCollection_StackNode* q; - while(p) { - q = (TCollection_StackNode*)p->Next(); - delete p; - p = q; - } - myDepth = 0; - myTop = NULL; -} - -//======================================================================= -//function : ChangeTop -//purpose : -//======================================================================= - -Item& TCollection_Stack::ChangeTop() -{ - Standard_NoSuchObject_Raise_if(IsEmpty(),"TCollection_Stack"); - return ((TCollection_StackNode*)myTop)->Value(); -} - -//======================================================================= -//function : Next -//purpose : -//======================================================================= - -void TCollection_StackIterator::Next() -{ - current = ((TCollection_StackNode*)current)->Next(); -} - -//======================================================================= -//function : Value -//purpose : -//======================================================================= - -const Item& TCollection_StackIterator::Value() const -{ - Standard_NoSuchObject_Raise_if(current == NULL, - "TCollection_StackIterator"); - return ((TCollection_StackNode*)current)->Value(); -} diff --git a/src/TCollection/TCollection_Stack.lxx b/src/TCollection/TCollection_Stack.lxx deleted file mode 100644 index e953b6e165..0000000000 --- a/src/TCollection/TCollection_Stack.lxx +++ /dev/null @@ -1,36 +0,0 @@ -// Created on: 1993-01-18 -// Created by: Remi LEQUETTE -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -//======================================================================= -//function : IsEmpty -//purpose : -//======================================================================= - -inline Standard_Boolean TCollection_Stack::IsEmpty() const -{ - return myDepth == 0; -} - - -//======================================================================= -//function : Depth -//purpose : -//======================================================================= - -inline Standard_Integer TCollection_Stack::Depth() const -{ - return myDepth; -} diff --git a/src/TCollection/TCollection_StackIterator.gxx b/src/TCollection/TCollection_StackIterator.gxx deleted file mode 100644 index 1c9ab21103..0000000000 --- a/src/TCollection/TCollection_StackIterator.gxx +++ /dev/null @@ -1,50 +0,0 @@ -// Created on: 1994-10-26 -// Created by: Mireille MERCIEN -// Copyright (c) 1994-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -// The methods of Iterator needing the Node class -// are defined in TCollection_Stack.gxx - - -//======================================================================= -//function : TCollection_StackIterator -//purpose : -//======================================================================= - -TCollection_StackIterator::TCollection_StackIterator() : current(NULL) - -{} - -//======================================================================= -//function : TCollection_StackIterator -//purpose : -//======================================================================= - -TCollection_StackIterator::TCollection_StackIterator(const TCollection_Stack& L) : - current(L.myTop) -{} - -//======================================================================= -//function : Initialize -//purpose : -//======================================================================= - -void TCollection_StackIterator::Initialize(const TCollection_Stack& L) -{ - current = L.myTop; -} - - - diff --git a/src/TCollection/TCollection_StackIterator.lxx b/src/TCollection/TCollection_StackIterator.lxx deleted file mode 100644 index 247b9e2667..0000000000 --- a/src/TCollection/TCollection_StackIterator.lxx +++ /dev/null @@ -1,26 +0,0 @@ -// Created on: 1994-10-26 -// Created by: Mireille MERCIEN -// Copyright (c) 1994-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -//======================================================================= -//function : More -//purpose : -//======================================================================= - -inline Standard_Boolean TCollection_StackIterator::More() const -{ - return current != 0L; -} - diff --git a/src/TCollection/TCollection_StackNode.gxx b/src/TCollection/TCollection_StackNode.gxx deleted file mode 100644 index df42f6159d..0000000000 --- a/src/TCollection/TCollection_StackNode.gxx +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) 1998-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. diff --git a/src/TCollection/TCollection_StackNode.lxx b/src/TCollection/TCollection_StackNode.lxx deleted file mode 100644 index 99cdfb8f1a..0000000000 --- a/src/TCollection/TCollection_StackNode.lxx +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) 1998-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -inline TCollection_StackNode::TCollection_StackNode(const Item& I,const TCollection_MapNodePtr& n) -: TCollection_MapNode(n) -{ - myValue = I; -} - -inline Item& TCollection_StackNode::Value() const -{ - return (Item&)myValue; -} - diff --git a/src/TDF/TDF_Data.cdl b/src/TDF/TDF_Data.cdl index e71f47e15d..1d25c4c732 100644 --- a/src/TDF/TDF_Data.cdl +++ b/src/TDF/TDF_Data.cdl @@ -41,7 +41,7 @@ uses LabelNodePtr from TDF, Delta from TDF, IDFilter from TDF, - StackOfInteger from TColStd, + ListOfInteger from TColStd, HAllocator from TDF raises @@ -226,7 +226,7 @@ fields myNbTouchedAtt : Integer from Standard; myNotUndoMode : Boolean from Standard; myTime : Integer from Standard; - myTimes : StackOfInteger from TColStd; + myTimes : ListOfInteger from TColStd; myLabelNodeAllocator: HAllocator from TDF; myAllowModification : Boolean from Standard; diff --git a/src/TDF/TDF_Data.cxx b/src/TDF/TDF_Data.cxx index c06de01bb4..4aefbf8ae5 100644 --- a/src/TDF/TDF_Data.cxx +++ b/src/TDF/TDF_Data.cxx @@ -118,7 +118,7 @@ void TDF_Data::Destroy() Standard_Integer TDF_Data::OpenTransaction() { - myTimes.Push(myTime); + myTimes.Prepend(myTime); return ++myTransaction; } @@ -148,7 +148,7 @@ Handle(TDF_Delta) TDF_Data::CommitTransaction --myTransaction; if (withDelta) { if (!delta->IsEmpty()) { - delta->Validity(myTimes.Top(),myTime); + delta->Validity(myTimes.First(),myTime); #ifdef DEB_DELTA if (myTransaction == 0) { cout<<"TDF_Data::Commit generated this delta in t=0:"<