mirror of
https://github.com/Open-Cascade-SAS/OCCT.git
synced 2026-08-31 23:37:52 +08:00
0024788: Foundation Classes - remove Dico_Dictionary
Class Dico_Dictionary was replaced by NCollection_DataMap/NCollection_IndexedDataMap classes. Changed argument name in template class NCollection_Datamap to eliminate redefinitions of static members in dependent code.
This commit is contained in:
@@ -12,8 +12,6 @@
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
|
||||
#include <Dico_DictionaryOfInteger.hxx>
|
||||
#include <Dico_IteratorOfDictionaryOfInteger.hxx>
|
||||
#include <IFSelect_Activator.hxx>
|
||||
#include <IFSelect_SessionPilot.hxx>
|
||||
#include <Interface_Macros.hxx>
|
||||
@@ -22,10 +20,11 @@
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
#include <TColStd_SequenceOfInteger.hxx>
|
||||
#include <TColStd_SequenceOfTransient.hxx>
|
||||
#include <NCollection_DataMap.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(IFSelect_Activator,MMgt_TShared)
|
||||
|
||||
static Handle(Dico_DictionaryOfInteger) thedico; // = new Dico_DictionaryOfInteger;
|
||||
static NCollection_DataMap<TCollection_AsciiString, Standard_Integer> thedico;
|
||||
static TColStd_SequenceOfInteger thenums, themodes;
|
||||
static TColStd_SequenceOfTransient theacts;
|
||||
|
||||
@@ -36,16 +35,15 @@ static TColStd_SequenceOfTransient theacts;
|
||||
const Standard_CString command,
|
||||
const Standard_Integer mode)
|
||||
{
|
||||
Standard_Boolean deja;
|
||||
if (thedico.IsNull()) thedico = new Dico_DictionaryOfInteger;
|
||||
Standard_Integer& num = thedico->NewItem(command,deja,Standard_True);
|
||||
if (deja) {
|
||||
#ifdef OCCT_DEBUG
|
||||
cout<<"**** XSTEP commands, name conflict on "<<command<<" first defined remains ****"<<endl;
|
||||
if (thedico.IsBound(command)) {
|
||||
cout << "**** XSTEP commands, name conflict on " << command << " first defined remains ****" << endl;
|
||||
// Standard_DomainError::Raise("IFSelect_Activator : Add");
|
||||
#endif
|
||||
}
|
||||
num = thenums.Length() + 1;
|
||||
#endif
|
||||
|
||||
thedico.Bind(command, thenums.Length() + 1);
|
||||
|
||||
thenums.Append(number);
|
||||
theacts.Append(actor);
|
||||
themodes.Append(mode);
|
||||
@@ -60,14 +58,14 @@ static TColStd_SequenceOfTransient theacts;
|
||||
{ Adding (this,number,command,1); }
|
||||
|
||||
void IFSelect_Activator::Remove (const Standard_CString command)
|
||||
{ thedico->RemoveItem(command); }
|
||||
{ thedico.UnBind(command); }
|
||||
|
||||
Standard_Boolean IFSelect_Activator::Select
|
||||
(const Standard_CString command, Standard_Integer& number,
|
||||
Handle(IFSelect_Activator)& actor)
|
||||
{
|
||||
Standard_Integer num;
|
||||
if (!thedico->GetItem(command,num,Standard_False)) return Standard_False;
|
||||
if (!thedico.Find(command, num)) return Standard_False;
|
||||
number = thenums(num);
|
||||
actor = Handle(IFSelect_Activator)::DownCast(theacts(num));
|
||||
return Standard_True;
|
||||
@@ -77,7 +75,7 @@ static TColStd_SequenceOfTransient theacts;
|
||||
(const Standard_CString command)
|
||||
{
|
||||
Standard_Integer num;
|
||||
if (!thedico->GetItem(command,num,Standard_False)) return -1;
|
||||
if (!thedico.Find(command, num)) return -1;
|
||||
return themodes(num);
|
||||
}
|
||||
|
||||
@@ -86,18 +84,20 @@ static TColStd_SequenceOfTransient theacts;
|
||||
(const Standard_Integer mode, const Standard_CString command)
|
||||
{
|
||||
Standard_Integer num;
|
||||
Dico_IteratorOfDictionaryOfInteger iter (thedico,command);
|
||||
NCollection_DataMap<TCollection_AsciiString, Standard_Integer>::Iterator iter(thedico);
|
||||
Handle(TColStd_HSequenceOfAsciiString) list =
|
||||
new TColStd_HSequenceOfAsciiString();
|
||||
for (iter.Start(); iter.More(); iter.Next()) {
|
||||
for (; iter.More(); iter.Next()) {
|
||||
if (!iter.Key().StartsWith(command))
|
||||
continue;
|
||||
if (mode < 0) {
|
||||
DeclareAndCast(IFSelect_Activator,acti,theacts(iter.Value()));
|
||||
if (acti.IsNull()) continue;
|
||||
if (command[0] == '\0' || !strcmp(command,acti->Group()) )
|
||||
list->Append(iter.Name());
|
||||
list->Append(iter.Key());
|
||||
} else {
|
||||
num = iter.Value();
|
||||
if (themodes(num) == mode) list->Append(iter.Name());
|
||||
if (themodes(num) == mode) list->Append(iter.Key());
|
||||
}
|
||||
}
|
||||
return list;
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
|
||||
#include <Dico_DictionaryOfInteger.hxx>
|
||||
#include <IFSelect_EditForm.hxx>
|
||||
#include <IFSelect_Editor.hxx>
|
||||
#include <IFSelect_ListEditor.hxx>
|
||||
@@ -33,7 +32,7 @@ IFSelect_Editor::IFSelect_Editor (const Standard_Integer nbval)
|
||||
: thenbval (nbval) , themaxsh (0) , themaxco (0) , themaxla (0) ,
|
||||
thevalues (1,nbval) , theshorts (1,nbval) , themodes (1,nbval) ,
|
||||
thelists (1,nbval)
|
||||
{ thenames = new Dico_DictionaryOfInteger; thelists.Init(-1); }
|
||||
{ thelists.Init(-1); }
|
||||
|
||||
void IFSelect_Editor::SetNbValues (const Standard_Integer nbval)
|
||||
{
|
||||
@@ -48,14 +47,14 @@ IFSelect_Editor::IFSelect_Editor (const Standard_Integer nbval)
|
||||
if (num < 1 || num > thenbval) return;
|
||||
TCollection_AsciiString shn (shortname);
|
||||
Standard_Integer lng = shn.Length();
|
||||
if (lng > 0) thenames->SetItem (shortname,num);
|
||||
if (lng > 0) thenames.Bind (shortname,num);
|
||||
if (lng > themaxsh) themaxsh = lng;
|
||||
lng = (Standard_Integer) strlen (typval->Name());
|
||||
if (lng > themaxco) themaxco = lng;
|
||||
lng = (Standard_Integer) strlen (typval->Label());
|
||||
if (lng > themaxla) themaxla = lng;
|
||||
|
||||
thenames->SetItem (typval->Name(),num);
|
||||
thenames.Bind (typval->Name(),num);
|
||||
Standard_Integer edm = (Standard_Integer) editmode;
|
||||
thevalues.SetValue (num,typval);
|
||||
theshorts.SetValue (num,shn);
|
||||
@@ -187,7 +186,8 @@ Standard_Integer IFSelect_Editor::MaxList (const Standard_Integer num) const
|
||||
(const Standard_CString name) const
|
||||
{
|
||||
Standard_Integer res;
|
||||
if (thenames->GetItem(name,res,Standard_False)) return res;
|
||||
if (thenames.Find(name,res))
|
||||
return res;
|
||||
res = atoi (name); // si c est un entier, on tente le coup
|
||||
if (res < 1 || res > NbValues()) res = 0;
|
||||
return res;
|
||||
|
||||
@@ -29,11 +29,11 @@
|
||||
#include <IFSelect_EditValue.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <TColStd_HSequenceOfHAsciiString.hxx>
|
||||
class Dico_DictionaryOfInteger;
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
#include <NCollection_DataMap.hxx>
|
||||
class Standard_OutOfRange;
|
||||
class Interface_TypedValue;
|
||||
class Message_Messenger;
|
||||
class TCollection_AsciiString;
|
||||
class IFSelect_EditForm;
|
||||
class TCollection_HAsciiString;
|
||||
class IFSelect_ListEditor;
|
||||
@@ -182,7 +182,7 @@ private:
|
||||
Standard_Integer themaxsh;
|
||||
Standard_Integer themaxco;
|
||||
Standard_Integer themaxla;
|
||||
Handle(Dico_DictionaryOfInteger) thenames;
|
||||
NCollection_DataMap<TCollection_AsciiString, Standard_Integer> thenames;
|
||||
TColStd_Array1OfTransient thevalues;
|
||||
TColStd_Array1OfAsciiString theshorts;
|
||||
TColStd_Array1OfInteger themodes;
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
|
||||
#include <Dico_DictionaryOfInteger.hxx>
|
||||
#include <IFSelect_BasicDumper.hxx>
|
||||
#include <IFSelect_Dispatch.hxx>
|
||||
#include <IFSelect_GeneralModifier.hxx>
|
||||
@@ -183,7 +182,7 @@ static int deja = 0;
|
||||
char laligne[200];
|
||||
thedone = Standard_True;
|
||||
// ... Preparation Specifique
|
||||
thenames.Nullify();
|
||||
thenames.Clear();
|
||||
Standard_Integer nbidents = thesess->MaxIdent();
|
||||
thenums = new TColStd_HArray1OfInteger (0,nbidents); thenums->Init(0);
|
||||
Standard_Integer i; // svv Jan11 2000 : porting on DEC
|
||||
@@ -423,7 +422,7 @@ static int deja = 0;
|
||||
thedone = Standard_True;
|
||||
// ... Preparation Specifique
|
||||
thenums.Nullify();
|
||||
thenames = new Dico_DictionaryOfInteger;
|
||||
thenames.Clear();
|
||||
// .. Donnees generales, controle
|
||||
if (!ReadLine()) return 1;
|
||||
if (theline.Length() != 4) { sout<<"File Form Incorrect"<<endl; return 1; }
|
||||
@@ -751,7 +750,7 @@ static int deja = 0;
|
||||
}
|
||||
else sout<<"Lineno."<<thenl<<" -- Name : "<<name
|
||||
<<" : Item could not be defined" << endl;
|
||||
thenames->SetItem(name.ToCString(),id);
|
||||
thenames.Bind(name,id);
|
||||
}
|
||||
|
||||
Standard_Boolean IFSelect_SessionFile::IsDone () const
|
||||
@@ -875,7 +874,7 @@ static int deja = 0;
|
||||
TCollection_AsciiString name = theline.Value(nm);
|
||||
if (name.Value(1) == ':') name.Remove(1);
|
||||
if (name.IsEqual("$")) return res; // item non-defini justement
|
||||
if (!thenames->GetItem(name.ToCString(),id)) {
|
||||
if (!thenames.Find(name, id)) {
|
||||
sout << " -- Item Unknown in File : " << name
|
||||
<< " lineno " << thenl << " param." << nm << endl;
|
||||
id = 0;
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#ifndef _IFSelect_SessionFile_HeaderFile
|
||||
#define _IFSelect_SessionFile_HeaderFile
|
||||
|
||||
#include <NCollection_DataMap.hxx>
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
@@ -28,8 +29,8 @@
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
#include <Standard_CString.hxx>
|
||||
#include <Standard_Character.hxx>
|
||||
|
||||
class IFSelect_WorkSession;
|
||||
class Dico_DictionaryOfInteger;
|
||||
class TCollection_AsciiString;
|
||||
class Standard_Transient;
|
||||
|
||||
@@ -279,7 +280,7 @@ protected:
|
||||
|
||||
Handle(IFSelect_WorkSession) thesess;
|
||||
Handle(TColStd_HArray1OfInteger) thenums;
|
||||
Handle(Dico_DictionaryOfInteger) thenames;
|
||||
NCollection_DataMap<TCollection_AsciiString, Standard_Integer> thenames;
|
||||
Standard_Integer thenl;
|
||||
TColStd_SequenceOfAsciiString theline;
|
||||
|
||||
|
||||
@@ -12,10 +12,6 @@
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
|
||||
#include <Dico_DictionaryOfInteger.hxx>
|
||||
#include <Dico_DictionaryOfTransient.hxx>
|
||||
#include <Dico_IteratorOfDictionaryOfInteger.hxx>
|
||||
#include <Dico_IteratorOfDictionaryOfTransient.hxx>
|
||||
#include <IFSelect_SignatureList.hxx>
|
||||
#include <Interface_InterfaceModel.hxx>
|
||||
#include <Interface_Macros.hxx>
|
||||
@@ -35,8 +31,6 @@ IFSelect_SignatureList::IFSelect_SignatureList
|
||||
thesignonly = Standard_False;
|
||||
thelistat = withlist;
|
||||
thenbnuls = 0;
|
||||
thedicount = new Dico_DictionaryOfInteger;
|
||||
thediclist = new Dico_DictionaryOfTransient;
|
||||
SetName("...");
|
||||
}
|
||||
|
||||
@@ -51,8 +45,8 @@ IFSelect_SignatureList::IFSelect_SignatureList
|
||||
{
|
||||
thelastval.Clear();
|
||||
thenbnuls = 0;
|
||||
thedicount = new Dico_DictionaryOfInteger;
|
||||
thediclist = new Dico_DictionaryOfTransient;
|
||||
thedicount.Clear();
|
||||
thediclist.Clear();
|
||||
}
|
||||
|
||||
void IFSelect_SignatureList::Add
|
||||
@@ -66,15 +60,19 @@ IFSelect_SignatureList::IFSelect_SignatureList
|
||||
|
||||
if (sign[0] == '\0') { thenbnuls ++; return; }
|
||||
|
||||
Standard_Boolean deja;
|
||||
Standard_Integer& nb = thedicount->NewItem(sign,deja);
|
||||
if (!deja) nb = 0;
|
||||
nb ++;
|
||||
if (thedicount.Contains(sign))
|
||||
thedicount.ChangeFromKey(sign)++;
|
||||
else
|
||||
thedicount.Add(sign, 1);
|
||||
|
||||
if (thelistat) {
|
||||
Handle(Standard_Transient)& anitem = thediclist->NewItem(sign,deja);
|
||||
DeclareAndCast(TColStd_HSequenceOfTransient,alist,anitem);
|
||||
if (!deja) { alist = new TColStd_HSequenceOfTransient(); anitem = alist; }
|
||||
Handle(TColStd_HSequenceOfTransient) alist;
|
||||
if (thediclist.Contains(sign))
|
||||
alist = Handle(TColStd_HSequenceOfTransient)::DownCast(thediclist.FindFromKey(sign));
|
||||
else {
|
||||
alist = new TColStd_HSequenceOfTransient();
|
||||
thediclist.Add(sign, alist);
|
||||
}
|
||||
alist->Append(ent);
|
||||
}
|
||||
}
|
||||
@@ -84,8 +82,8 @@ IFSelect_SignatureList::IFSelect_SignatureList
|
||||
|
||||
void IFSelect_SignatureList::Init
|
||||
(const Standard_CString name,
|
||||
const Handle(Dico_DictionaryOfInteger)& theCount,
|
||||
const Handle(Dico_DictionaryOfTransient)& list,
|
||||
const NCollection_IndexedDataMap<TCollection_AsciiString, Standard_Integer>& theCount,
|
||||
const NCollection_IndexedDataMap<TCollection_AsciiString, Handle(Standard_Transient)>& list,
|
||||
const Standard_Integer nbnuls)
|
||||
{
|
||||
thelastval.Clear();
|
||||
@@ -93,7 +91,7 @@ IFSelect_SignatureList::IFSelect_SignatureList
|
||||
thedicount = theCount;
|
||||
thediclist = list;
|
||||
thenbnuls = nbnuls;
|
||||
if (thediclist.IsNull()) thelistat = Standard_False;
|
||||
if (thediclist.IsEmpty()) thelistat = Standard_False;
|
||||
}
|
||||
|
||||
|
||||
@@ -102,10 +100,12 @@ IFSelect_SignatureList::IFSelect_SignatureList
|
||||
{
|
||||
Handle(TColStd_HSequenceOfHAsciiString) list =
|
||||
new TColStd_HSequenceOfHAsciiString();
|
||||
Dico_IteratorOfDictionaryOfInteger iter(thedicount,root);
|
||||
NCollection_IndexedDataMap<TCollection_AsciiString, Standard_Integer>::Iterator iter(thedicount);
|
||||
for (; iter.More(); iter.Next()) {
|
||||
if (!iter.Key().StartsWith(root)) continue;
|
||||
|
||||
Handle(TCollection_HAsciiString) sign =
|
||||
new TCollection_HAsciiString (iter.Name());
|
||||
new TCollection_HAsciiString (iter.Key());
|
||||
list->Append(sign);
|
||||
}
|
||||
return list;
|
||||
@@ -121,18 +121,21 @@ IFSelect_SignatureList::IFSelect_SignatureList
|
||||
Standard_Integer IFSelect_SignatureList::NbTimes
|
||||
(const Standard_CString sign) const
|
||||
{
|
||||
Standard_Integer nb;
|
||||
if (thedicount->GetItem(sign,nb)) return nb;
|
||||
else return 0;
|
||||
Standard_Integer nb = 0;
|
||||
thedicount.FindFromKey(sign, nb);
|
||||
return nb;
|
||||
}
|
||||
|
||||
Handle(TColStd_HSequenceOfTransient) IFSelect_SignatureList::Entities
|
||||
(const Standard_CString sign) const
|
||||
{
|
||||
Handle(TColStd_HSequenceOfTransient) list;
|
||||
Handle(Standard_Transient) aTList;
|
||||
if (!thelistat) return list;
|
||||
if (thediclist->GetItem(sign,list)) return list;
|
||||
list = new TColStd_HSequenceOfTransient();
|
||||
if (thediclist.FindFromKey(sign, aTList))
|
||||
list = Handle(TColStd_HSequenceOfTransient)::DownCast(aTList);
|
||||
else
|
||||
list = new TColStd_HSequenceOfTransient();
|
||||
return list;
|
||||
}
|
||||
|
||||
@@ -147,11 +150,11 @@ IFSelect_SignatureList::IFSelect_SignatureList
|
||||
void IFSelect_SignatureList::PrintCount (const Handle(Message_Messenger)& S) const
|
||||
{
|
||||
Standard_Integer nbtot = 0, nbsign = 0;
|
||||
Dico_IteratorOfDictionaryOfInteger iter(thedicount,"");
|
||||
NCollection_IndexedDataMap<TCollection_AsciiString, Standard_Integer>::Iterator iter(thedicount);
|
||||
S << " Count "<<thename->ToCString()<<"\n ----- -----------"<<endl;
|
||||
for (; iter.More(); iter.Next()) {
|
||||
Standard_Integer val = iter.Value();
|
||||
S << Interface_MSG::Blanks(val,6) << val <<" "<<iter.Name()<<endl;
|
||||
S << Interface_MSG::Blanks(val,6) << val <<" "<<iter.Key()<<endl;
|
||||
nbtot += val;
|
||||
nbsign ++;
|
||||
}
|
||||
@@ -172,10 +175,10 @@ IFSelect_SignatureList::IFSelect_SignatureList
|
||||
return;
|
||||
}
|
||||
Standard_Integer nbtot = 0, nbsign = 0;
|
||||
Dico_IteratorOfDictionaryOfTransient iter(thediclist,"");
|
||||
NCollection_IndexedDataMap<TCollection_AsciiString, Handle(Standard_Transient)>::Iterator iter(thediclist);
|
||||
for (; iter.More(); iter.Next()) {
|
||||
DeclareAndCast(TColStd_HSequenceOfTransient,list,iter.Value());
|
||||
S<<Name()<<" : "<<iter.Name()<<endl;
|
||||
S<<Name()<<" : "<<iter.Key()<<endl;
|
||||
if (list.IsNull()) { S<<" - (empty list)"<<endl; continue; }
|
||||
Standard_Integer nb = list->Length();
|
||||
S<<" - Nb: "<<nb<<" : ";
|
||||
@@ -202,7 +205,7 @@ IFSelect_SignatureList::IFSelect_SignatureList
|
||||
|
||||
void IFSelect_SignatureList::PrintSum (const Handle(Message_Messenger)& S) const
|
||||
{
|
||||
Dico_IteratorOfDictionaryOfInteger iter(thedicount,"");
|
||||
NCollection_IndexedDataMap<TCollection_AsciiString, Standard_Integer>::Iterator iter(thedicount);
|
||||
S << " Summary "<<thename->ToCString()<<"\n ----- -----------"<<endl;
|
||||
Standard_Integer nbtot = 0, nbsign = 0, maxent = 0, nbval = 0, nbve = 0, minval = 0, maxval = 0, totval = 0;
|
||||
for (; iter.More(); iter.Next()) {
|
||||
@@ -210,7 +213,7 @@ IFSelect_SignatureList::IFSelect_SignatureList
|
||||
nbtot += nbent;
|
||||
nbsign ++;
|
||||
if (nbent > maxent) maxent = nbent;
|
||||
TCollection_AsciiString name = iter.Name();
|
||||
TCollection_AsciiString name = iter.Key();
|
||||
// if (!name.IsIntegerValue()) continue; pas bien fiable
|
||||
Standard_Integer ic, nc = name.Length();
|
||||
Standard_Boolean iaint = Standard_True;
|
||||
|
||||
@@ -28,10 +28,9 @@
|
||||
#include <TColStd_HSequenceOfHAsciiString.hxx>
|
||||
#include <TColStd_HSequenceOfTransient.hxx>
|
||||
#include <IFSelect_PrintCount.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
#include <NCollection_IndexedDataMap.hxx>
|
||||
class TCollection_HAsciiString;
|
||||
class Dico_DictionaryOfInteger;
|
||||
class Dico_DictionaryOfTransient;
|
||||
class Standard_Transient;
|
||||
class Message_Messenger;
|
||||
class Interface_InterfaceModel;
|
||||
|
||||
@@ -85,7 +84,7 @@ public:
|
||||
Standard_EXPORT Standard_CString LastValue() const;
|
||||
|
||||
//! Aknowledges the list in once. Name identifies the Signature
|
||||
Standard_EXPORT void Init (const Standard_CString name, const Handle(Dico_DictionaryOfInteger)& count, const Handle(Dico_DictionaryOfTransient)& list, const Standard_Integer nbnuls);
|
||||
Standard_EXPORT void Init (const Standard_CString name, const NCollection_IndexedDataMap<TCollection_AsciiString, Standard_Integer>& count, const NCollection_IndexedDataMap<TCollection_AsciiString, Handle(Standard_Transient)>& list, const Standard_Integer nbnuls);
|
||||
|
||||
//! Returns the list of signatures, as a sequence of strings
|
||||
//! (but without their respective counts). It is ordered.
|
||||
@@ -156,8 +155,8 @@ private:
|
||||
Standard_Integer thenbnuls;
|
||||
Handle(TCollection_HAsciiString) thename;
|
||||
TCollection_AsciiString thelastval;
|
||||
Handle(Dico_DictionaryOfInteger) thedicount;
|
||||
Handle(Dico_DictionaryOfTransient) thediclist;
|
||||
NCollection_IndexedDataMap<TCollection_AsciiString, Standard_Integer> thedicount;
|
||||
NCollection_IndexedDataMap<TCollection_AsciiString, Handle(Standard_Transient)> thediclist;
|
||||
|
||||
|
||||
};
|
||||
|
||||
@@ -14,9 +14,6 @@
|
||||
//#1 svv 10.01.00 : porting on DEC
|
||||
//smh#14 17.03.2000 : FRA62479 Clearing of gtool
|
||||
|
||||
#include <Dico_DictionaryOfTransient.hxx>
|
||||
#include <Dico_IteratorOfDictionaryOfInteger.hxx>
|
||||
#include <Dico_IteratorOfDictionaryOfTransient.hxx>
|
||||
#include <IFGraph_SubPartsIterator.hxx>
|
||||
#include <IFSelect_CheckCounter.hxx>
|
||||
#include <IFSelect_Dispatch.hxx>
|
||||
@@ -109,7 +106,6 @@ IFSelect_WorkSession::IFSelect_WorkSession ()
|
||||
{
|
||||
theshareout = new IFSelect_ShareOut;
|
||||
theerrhand = errhand = Standard_True;
|
||||
thenames = new Dico_DictionaryOfTransient;
|
||||
thecopier = new IFSelect_ModelCopier;
|
||||
thecopier->SetShareOut (theshareout);
|
||||
thecheckdone = Standard_False;
|
||||
@@ -150,8 +146,8 @@ void IFSelect_WorkSession::SetProtocol
|
||||
void IFSelect_WorkSession::SetSignType (const Handle(IFSelect_Signature)& signtype)
|
||||
{
|
||||
thegtool->SetSignType (signtype);
|
||||
if (signtype.IsNull()) thenames->RemoveItem ("xst-sign-type");
|
||||
else thenames->SetItem ("xst-sign-type",signtype);
|
||||
if (signtype.IsNull()) thenames.UnBind("xst-sign-type");
|
||||
else thenames.Bind("xst-sign-type",signtype);
|
||||
}
|
||||
|
||||
|
||||
@@ -678,7 +674,8 @@ Handle(Standard_Transient) IFSelect_WorkSession::NamedItem
|
||||
Standard_Integer id = atoi( &name[1] );
|
||||
return Item(id);
|
||||
}
|
||||
if (!thenames->GetItem(name,res)) res.Nullify();
|
||||
if (!thenames.Find(name,res))
|
||||
res.Nullify();
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -711,7 +708,8 @@ Standard_Integer IFSelect_WorkSession::NameIdent
|
||||
Standard_Integer id = atoi( &name[1] );
|
||||
return id;
|
||||
}
|
||||
if (!thenames->GetItem(name,res)) return 0;
|
||||
if (!thenames.Find(name,res))
|
||||
return 0;
|
||||
return ItemIdent(res);
|
||||
}
|
||||
|
||||
@@ -786,12 +784,9 @@ Standard_Integer IFSelect_WorkSession::AddNamedItem
|
||||
if (name[0] == '#' || name[0] == '!') return 0;
|
||||
// #nnn : pas un nom mais un numero. !... : reserve (interdit pour un nom)
|
||||
// nom deja pris : on ecrase l ancienne valeur
|
||||
if (name[0] != '\0') {
|
||||
Standard_Boolean deja;
|
||||
Handle(Standard_Transient)& newitem = thenames->NewItem(name,deja);
|
||||
// if (deja & item != newitem) return 0;
|
||||
newitem = item;
|
||||
}
|
||||
if (name[0] != '\0')
|
||||
thenames.Bind(name, item);
|
||||
|
||||
Standard_Integer id = theitems.FindIndex(item);
|
||||
if (id > 0) {
|
||||
Handle(Standard_Transient)& att = theitems.ChangeFromIndex(id);
|
||||
@@ -865,7 +860,7 @@ Standard_Boolean IFSelect_WorkSession::RemoveName
|
||||
Handle(Standard_Transient) item = NamedItem(name);
|
||||
if (item.IsNull()) return Standard_False;
|
||||
theitems.Add(item,item); // reste mais sans nom
|
||||
return thenames->RemoveItem(name);
|
||||
return thenames.UnBind(name);
|
||||
}
|
||||
|
||||
|
||||
@@ -888,7 +883,7 @@ Standard_Boolean IFSelect_WorkSession::RemoveItem
|
||||
|
||||
// Marquer "Removed" dans la Map (on ne peut pas la vider)
|
||||
if (att->IsKind(STANDARD_TYPE(TCollection_HAsciiString))) {
|
||||
if (!thenames->RemoveItem
|
||||
if (!thenames.UnBind
|
||||
(GetCasted(TCollection_HAsciiString,att)->ToCString()))
|
||||
return Standard_False;
|
||||
}
|
||||
@@ -905,7 +900,7 @@ Standard_Boolean IFSelect_WorkSession::RemoveItem
|
||||
|
||||
void IFSelect_WorkSession::ClearItems ()
|
||||
{
|
||||
thenames->Clear();
|
||||
thenames.Clear();
|
||||
theitems.Clear();
|
||||
theshareout->Clear(Standard_False);
|
||||
}
|
||||
@@ -1018,9 +1013,10 @@ Handle(TColStd_HSequenceOfHAsciiString) IFSelect_WorkSession::ItemNames
|
||||
{
|
||||
Handle(TColStd_HSequenceOfHAsciiString) list =
|
||||
new TColStd_HSequenceOfHAsciiString();
|
||||
for (Dico_IteratorOfDictionaryOfTransient IT(thenames); IT.More(); IT.Next()){
|
||||
NCollection_DataMap<TCollection_AsciiString, Handle(Standard_Transient)>::Iterator IT(thenames);
|
||||
for (; IT.More(); IT.Next()){
|
||||
if (IT.Value()->IsKind(type)) list->Append
|
||||
(new TCollection_HAsciiString(IT.Name().ToCString()));
|
||||
(new TCollection_HAsciiString(IT.Key()));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@@ -26,33 +26,34 @@
|
||||
#include <TColStd_IndexedDataMapOfTransientTransient.hxx>
|
||||
#include <MMgt_TShared.hxx>
|
||||
#include <NCollection_Vector.hxx>
|
||||
#include <NCollection_DataMap.hxx>
|
||||
#include <Standard_CString.hxx>
|
||||
#include <IFSelect_ReturnStatus.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <TColStd_HSequenceOfTransient.hxx>
|
||||
#include <TColStd_HSequenceOfInteger.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
#include <TColStd_HSequenceOfHAsciiString.hxx>
|
||||
#include <IFSelect_RemainMode.hxx>
|
||||
#include <TColStd_SequenceOfTransient.hxx>
|
||||
#include <TColStd_SequenceOfInteger.hxx>
|
||||
#include <IFSelect_PrintCount.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
class IFSelect_ShareOut;
|
||||
class IFSelect_WorkLibrary;
|
||||
class Interface_Protocol;
|
||||
class Interface_InterfaceModel;
|
||||
class Interface_HGraph;
|
||||
class Interface_GTool;
|
||||
class Dico_DictionaryOfTransient;
|
||||
|
||||
class IFSelect_ModelCopier;
|
||||
class Standard_DomainError;
|
||||
class IFSelect_Signature;
|
||||
class Standard_Transient;
|
||||
class TCollection_HAsciiString;
|
||||
class Interface_Graph;
|
||||
class Interface_CheckIterator;
|
||||
class IFSelect_IntParam;
|
||||
class TCollection_AsciiString;
|
||||
class IFSelect_Selection;
|
||||
class Interface_EntityIterator;
|
||||
class IFSelect_SelectionIterator;
|
||||
@@ -1094,7 +1095,7 @@ public:
|
||||
Handle(Interface_HGraph) thegraph;
|
||||
Interface_CheckIterator thecheckrun;
|
||||
TColStd_IndexedDataMapOfTransientTransient theitems;
|
||||
Handle(Dico_DictionaryOfTransient) thenames;
|
||||
NCollection_DataMap<TCollection_AsciiString, Handle(Standard_Transient)> thenames;
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user