- Updated French comments to English for better accessibility and understanding.
- Enhanced clarity of comments to better describe the functionality and purpose of the code.
- Ensured consistency in terminology and phrasing throughout the codebase.
- Made minor adjustments to comment formatting for improved readability.
#include <Interface_Graph.hxx>
#include <Standard_Transient.hxx>
-// AllConnected prend toutes les Entites connectees a une Entite donnee
-// c-a-d toutes les "Shared" + toutes les "Sharings" et on recommence
-// Autrement dit le contenu du "Composant Connexe" du graphe d'ensemble
-// qui contient cette entite
-// Le calcul est effectue par GetFromEntity (Evaluate n'a rien a faire)
+// AllConnected takes all Entities connected to a given Entity
+// i.e. all "Shared" + all "Sharings" and we restart
+// In other words the content of the "Connected Component" of the overall graph
+// which contains this entity
+// The calculation is performed by GetFromEntity (Evaluate has nothing to do)
IFGraph_AllConnected::IFGraph_AllConnected(const Interface_Graph& agraph)
: thegraph(agraph)
{
void IFGraph_AllConnected::Evaluate()
{
GetFromGraph(thegraph);
-} // GetFromEntity a tout fait
+} // GetFromEntity did everything
void IFGraph_AllShared::GetFromEntity(const Handle(Standard_Transient)& ent)
{
thegraph.GetFromEntity(ent, Standard_True);
-} // le fait pour nous
+} // does it for us
void IFGraph_AllShared::GetFromIter(const Interface_EntityIterator& iter)
{
#include <Interface_InterfaceModel.hxx>
#include <Standard_Transient.hxx>
-// Points d'Articulation d'un Graphe : ce sont les "passages obliges" du graphe
-// Algorithme tire du Sedgewick, p 392
+// Articulation Points of a Graph: these are the "required passages" of the graph
+// Algorithm taken from Sedgewick, p 392
IFGraph_Articulations::IFGraph_Articulations(const Interface_Graph& agraph,
const Standard_Boolean whole)
: thegraph(agraph)
void IFGraph_Articulations::Evaluate()
{
- // Algorithme, cf Sedgewick "Algorithms", p 392
+ // Algorithm, see Sedgewick "Algorithms", p 392
thelist = new TColStd_HSequenceOfInteger();
- // Utilisation de Visit
+ // Use of Visit
Standard_Integer nb = thegraph.Size();
for (Standard_Integer i = 1; i <= nb; i++)
{
if (thegraph.IsPresent(i))
Visit(i);
}
- // Resultat dans thelist
+ // Result in thelist
Reset();
Standard_Integer nbres = thelist->Length();
for (Standard_Integer ires = 1; ires <= nbres; ires++)
thegraph.GetFromEntity(ent, Standard_False);
nument = thegraph.EntityNumber(ent);
}
- Standard_Integer statent = thegraph.Status(nument); // pas reevalue
+ Standard_Integer statent = thegraph.Status(nument); // not reevaluated
if (statent == 0)
{
Standard_Integer mm = Visit(nument);
if (mm < min)
min = mm;
if (mm > thegraph.Status(num))
- thelist->Append(num); // ON EN A UN : num
+ thelist->Append(num); // WE HAVE ONE: num
}
else if (statent < min)
min = statent;
#include <Interface_Graph.hxx>
#include <Standard_Transient.hxx>
-// Comparateur de deux sous-ensembles d un Modele
-// Au premier sous-ensemble, est attribue le Status 1
-// Au deuxieme sous-ensemble, est attribue le Status 2
-// La partie commune se voit attribuer le Status 3
+// Comparator of two subsets of a Model
+// To the first subset, Status 1 is assigned
+// To the second subset, Status 2 is assigned
+// The common part is assigned Status 3
IFGraph_Compare::IFGraph_Compare(const Interface_Graph& agraph)
: thegraph(agraph)
{
void IFGraph_Compare::Evaluate()
{
Reset();
- GetFromGraph(thegraph); // Evaluation deja faite par le graphe
+ GetFromGraph(thegraph); // Evaluation already done by the graph
}
Interface_EntityIterator IFGraph_Compare::Common() const
#include <Interface_Graph.hxx>
#include <Standard_Transient.hxx>
-// Pour travailler, ConnectedComponants exploite AllConnected :
-// On prend un 1er Vertex, on determine ses AllConnected -> voila un 1er
+// To work, ConnectedComponants exploits AllConnected:
+// Take a 1st Vertex, determine its AllConnected -> here is a 1st
// Connected Component
-// On recommence jusqu'a ce qu'il n'y ait plus de Vertex libre
-// Honnetement, si ca ne marche pas, cf classe ConnectedVerticesIterator
-// de GraphTools qui fait en principe la meme chose
+// Restart until there are no more free Vertices
+// Honestly, if it doesn't work, see ConnectedVerticesIterator class
+// from GraphTools which does basically the same thing
IFGraph_ConnectedComponants::IFGraph_ConnectedComponants(const Interface_Graph& agraph,
const Standard_Boolean whole)
: IFGraph_SubPartsIterator(agraph, whole)
void IFGraph_ConnectedComponants::Evaluate()
{
- // On part des "loaded"
- // Pour chacun : s il est note dans le graphe, on passe
- // Sinon, on ajoute les AllConnected en tant que sub-part
+ // Start from "loaded"
+ // For each: if it is noted in the graph, we pass
+ // Otherwise, add the AllConnected as sub-part
Interface_EntityIterator loaded = Loaded();
Reset();
for (loaded.Start(); loaded.More(); loaded.Next())
#include <Interface_InterfaceModel.hxx>
#include <Standard_Transient.hxx>
-// Calcul de cumul
-// Tres simple, on note les entites demandees, et a la fin
-// on a le cumul lui-meme, et comme infos derivees, les doubles et les oublis
-// Chaque recouvrement correspond a une augmentation de UN du status
-// Les status demarrent a 2, ainsi a l ajout d une entite, on distingue bien
-// entre les entites nouvelles, liees a cet appel (statut temporaire 1) et les
-// autres (statut superieur ou egal a 2)
+// Cumulation calculation
+// Very simple, we note the requested entities, and at the end
+// we have the cumulation itself, and as derived info, the duplicates and omissions
+// Each overlap corresponds to an increase of ONE in the status
+// Status starts at 2, thus when adding an entity, we distinguish well
+// between new entities, linked to this call (temporary status 1) and the
+// others (status greater than or equal to 2)
IFGraph_Cumulate::IFGraph_Cumulate(const Interface_Graph& agraph)
: thegraph(agraph)
{
void IFGraph_Cumulate::GetFromIter(const Interface_EntityIterator& iter)
{
thegraph.GetFromIter(iter, 1, 1, Standard_True);
- thegraph.ChangeStatus(1, 2); // une fois le calcul fait
+ thegraph.ChangeStatus(1, 2); // once the calculation is done
}
void IFGraph_Cumulate::Evaluate()
{
Reset();
- GetFromGraph(thegraph); // evaluation deja faite dans le graphe
+ GetFromGraph(thegraph); // evaluation already done in the graph
}
Interface_EntityIterator IFGraph_Cumulate::Overlapped() const
#include <Interface_Graph.hxx>
#include <Interface_GraphContent.hxx>
-// Cycles utilise les services de StrongComponants :
-// Il retient les Strong Componants qui ne sont pas Single
+// Cycles uses the services of StrongComponants :
+// It retains the Strong Componants which are not Single
IFGraph_Cycles::IFGraph_Cycles(const Interface_Graph& agraph, const Standard_Boolean whole)
: IFGraph_SubPartsIterator(agraph, whole)
{
#include <Interface_Graph.hxx>
#include <Standard_Transient.hxx>
-// ExternalSources exploite les resultats stockes dans le Graphe sur Sharings
-// Soit les "Sharings" des entites notees par GetFromEntity et GetFromIter
-// Celles des "Sharings" qui n etaient pas deja notees sont ExternalSources
-// Les status :
-// - Les entites de depart sont au Status 0
-// - Les entites Sharing NOUVELLES (ExternalSources) sont au Status 1
+// ExternalSources exploits the results stored in the Graph on Sharings
+// Either the "Sharings" of entities noted by GetFromEntity and GetFromIter
+// Those of the "Sharings" that were not already noted are ExternalSources
+// The status:
+// - The starting entities are at Status 0
+// - The NEW Sharing entities (ExternalSources) are at Status 1
IFGraph_ExternalSources::IFGraph_ExternalSources(const Interface_Graph& agraph)
: thegraph(agraph)
{
{
}
-// StrongComponants racines d un ensemble donne
-// On ne tient pas compte du reste eventuel (c est un autre probleme)
-// On part du fait que StrongComponants donne les Composants dans l ordre de
-// dependance, le premier ne dependant de rien (les autres, on ne sait pas ...)
+// Root StrongComponants of a given set
+// We don't consider the possible remainder (it's another problem)
+// We start from the fact that StrongComponants gives Components in the order of
+// dependence, the first depending on nothing (the others, we don't know ...)
void IFGraph_SCRoots::Evaluate()
{
Handle(Standard_Transient) ent = complist.FirstEntity();
Standard_Integer num = G.EntityNumber(ent);
#ifdef OCCT_DEBUG
- std::cout << " Iteration,num=" << num << (G.IsPresent(num) ? " Pris" : " A prendre")
+ std::cout << " Iteration,num=" << num << (G.IsPresent(num) ? " Taken" : " To take")
<< std::endl;
#endif
if (!G.IsPresent(num))
- { // enregistrer pour suivants
+ { // register for following
G.GetFromEntity(ent, Standard_True);
Interface_EntityIterator list = complist.Entities();
AddPart();
}
}
-/* ce qui suit, c etait autre chose : les SC qui n ont pas d ExternalSource
+/* what follows, it was something else: the SC that have no ExternalSource
Interface_EntityIterator list = complist.Entities();
IFGraph_ExternalSources eval (Model());
eval.GetFromIter(list);
#include <Standard_Transient.hxx>
#include <TColStd_Array1OfInteger.hxx>
-// SubPartsIterator permet de regrouper les entites en plusieurs sous-parties
-// A chaque sous-partie est attache un Status : la 1re a 1, la 2e a 2, etc...
-// (consequence, les sous-parties sont necessairement disjointes)
+// SubPartsIterator allows grouping entities into several sub-parts
+// To each sub-part is attached a Status : the 1st has 1, the 2nd has 2, etc...
+// (consequence, the sub-parts are necessarily disjoint)
IFGraph_SubPartsIterator::IFGraph_SubPartsIterator(const Interface_Graph& agraph,
const Standard_Boolean whole)
: thegraph(agraph)
if (thegraph.Status(i) == thepart)
nbent++;
}
- theparts->Append(nbent); // compte vide
+ theparts->Append(nbent); // empty count
}
thepart = 0;
thecurr = 1;
{
if (Model() != other.Model())
throw Interface_InterfaceError("SubPartsIterator : GetParts");
- // On AJOUTE les Parts de other, sans perdre les siennes propres
- // (meme principe que le constructeur ci-dessus)
+ // We ADD the Parts from other, without losing our own
+ // (same principle as the constructor above)
Standard_Integer nb = thegraph.Size();
thepart = theparts->Length();
for (other.Start(); other.More(); other.Next())
if (thegraph.Status(i) == thepart)
nbent++;
}
- theparts->Append(nbent); // compte vide
+ theparts->Append(nbent); // empty count
}
}
return thegraph;
}
-// .... Gestion Interne (remplissage, etc...) .... //
+// .... Internal Management (filling, etc...) .... //
Handle(Interface_InterfaceModel) IFGraph_SubPartsIterator::Model() const
{
thecurr = 0;
}
-// .... Resultat (Evaluation, Iterations) .... //
+// .... Result (Evaluation, Iterations) .... //
-void IFGraph_SubPartsIterator::Evaluate() {
-} // par defaut, ne fait rien; redefinie par les sous-classes
+void IFGraph_SubPartsIterator::Evaluate() {} // by default, does nothing; redefined by subclasses
Interface_GraphContent IFGraph_SubPartsIterator::Loaded() const
{
void IFGraph_SubPartsIterator::Start()
{
Evaluate();
- // On evalue les tailles des contenus des Parts
+ // Evaluate the sizes of the Parts contents
Standard_Integer nb = thegraph.Size();
Standard_Integer nbp = theparts->Length();
if (thepart > nbp)
{
thecurr = 1;
return;
- } // L Iteration s arrete de suite
+ } // Iteration stops immediately
- // - On fait les comptes (via tableaux pour performances)
+ // - Perform counts (via arrays for performance)
TColStd_Array1OfInteger partcounts(1, nbp);
partcounts.Init(0);
TColStd_Array1OfInteger partfirsts(1, nbp);
if (nbent == 0)
partfirsts.SetValue(nump, i);
}
- // - On les met en forme (c-a-d dans les sequences)
+ // - Format them (i.e. in sequences)
theparts->Clear();
thefirsts->Clear();
Standard_Integer lastp = 0;
}
if (lastp < nbp)
theparts->Remove(lastp + 1, nbp);
- // Enfin, on se prepare a iterer
+ // Finally, prepare to iterate
thecurr = 1;
}
if (thecurr > theparts->Length())
return;
if (theparts->Value(thecurr) == 0)
- Next(); // sauter parties vides
+ Next(); // skip empty parts
}
Standard_Boolean IFGraph_SubPartsIterator::IsSingle() const
if (nument == 0)
return iter;
if (theparts->Value(thecurr) == 1)
- nb = nument; // evident : 1 seule Entite
+ nb = nument; // obvious: 1 single Entity
for (Standard_Integer i = nument; i <= nb; i++)
{
if (thegraph.Status(i) == thecurr && thegraph.IsPresent(i))
#include <IFSelect_SessionFile.hxx>
#include <IFSelect_WorkSession.hxx>
-// Methodes de confort, evitant de devoir connaitre SessionFile, qui est un
-// Tool non destine a l export (en particulier, pas un Handle)
+// Convenience methods, avoiding having to know SessionFile, which is a
+// Tool not intended for export (in particular, not a Handle)
Standard_Boolean IFSelect::SaveSession(const Handle(IFSelect_WorkSession)& WS,
const Standard_CString file)
{
// #include <IFSelect_SelectTextType.hxx>
#define FIRSTCHAR 1
-// Param litteral "own" sous la forme :"<val>" -> first = 3
-// A present, forme simplifiee : <val> directement -> first = 1
+// Literal param "own" in the form :"<val>" -> first = 3
+// Now, simplified form : <val> directly -> first = 1
IFSelect_BasicDumper::IFSelect_BasicDumper() {}
Standard_Boolean IFSelect_ContextModif::IsSelected(const Handle(Standard_Transient)& ent) const
{
- // Select a deja verifie "IsTransferred"
+ // Select already verified "IsTransferred"
Standard_Integer num = thegraf.EntityNumber(ent);
if (num == 0)
return Standard_False;
IMPLEMENT_STANDARD_RTTIEXT(IFSelect_DispGlobal, IFSelect_Dispatch)
-// Genere un seul paquet avec la sortie finale
+// Generates a single packet with the final output
IFSelect_DispGlobal::IFSelect_DispGlobal() {}
TCollection_AsciiString IFSelect_DispGlobal::Label() const
return Standard_True;
}
-// 1 packet ( a partir de UniqueResult)
+// 1 packet (from UniqueResult)
void IFSelect_DispGlobal::Packets(const Interface_Graph& G, IFGraph_SubPartsIterator& packs) const
{
packs.AddPart();
IFGraph_SCRoots roots(G, Standard_False);
roots.SetLoad();
roots.GetFromIter(FinalSelection()->UniqueResult(G));
- // SCRoots a initie la resolution : decoupage en StrongComponants + selection
- // des racines. Un paquet correspond des lors a <count> racines
- // Donc, il faut iterer sur les Parts de roots et les prendre par <count>
+ // SCRoots initiated the resolution: splitting into StrongComponents + selection
+ // of roots. A packet then corresponds to <count> roots
+ // Therefore, we must iterate on the Parts of roots and take them by <count>
Standard_Integer i = 0;
for (roots.Start(); roots.More(); roots.Next())
if (!thecount.IsNull())
pcount = thecount->Value();
if (pcount <= 0)
- pcount = 1; // option prise par defaut
+ pcount = 1; // default option taken
return pcount;
}
void IFSelect_DispPerFiles::Packets(const Interface_Graph& G, IFGraph_SubPartsIterator& packs) const
{
- // Ressemble a DispPerOne, mais fait "count" AddPart racines
+ // Resembles DispPerOne, but does "count" AddPart roots
Standard_Integer pcount = CountValue();
IFGraph_SCRoots roots(G, Standard_False);
roots.SetLoad();
roots.GetFromIter(FinalSelection()->UniqueResult(G));
- // SCRoots a initie la resolution : decoupage en StrongComponants + selection
- // des racines. Un paquet correspond des lors a <count> racines
- // Donc, il faut iterer sur les Parts de roots et les prendre par <count>
- roots.Start(); // Start fait Evaluate specifique
+ // SCRoots initiated the resolution: breakdown into StrongComponents + selection
+ // of roots. A packet then corresponds to <count> roots
+ // Therefore, we need to iterate over the Parts of roots and take them by <count>
+ roots.Start(); // Start performs specific Evaluate
Standard_Integer nb = roots.NbParts();
if (pcount > 0)
- pcount = (nb - 1) / pcount + 1; // par packet
+ pcount = (nb - 1) / pcount + 1; // per packet
Standard_Integer i = 0;
for (; roots.More(); roots.Next())
- { // Start deja fait
+ { // Start already done
if (i == 0)
packs.AddPart();
i++;
IMPLEMENT_STANDARD_RTTIEXT(IFSelect_DispPerOne, IFSelect_Dispatch)
-// Genere un paquet par racine (strong comp.) locale a la liste transmise
+// Generates one packet per root (strong comp.) local to the transmitted list
IFSelect_DispPerOne::IFSelect_DispPerOne() {}
TCollection_AsciiString IFSelect_DispPerOne::Label() const
void IFSelect_DispPerOne::Packets(const Interface_Graph& G, IFGraph_SubPartsIterator& packs) const
{
- IFGraph_SCRoots packsc(G, Standard_False); // OK pour SubPartsIterator
+ IFGraph_SCRoots packsc(G, Standard_False); // OK for SubPartsIterator
packsc.SetLoad();
packsc.GetFromIter(FinalSelection()->UniqueResult(G));
- // SCRoots a initie la resolution : decoupage en StrongComponants + selection
- // des Racines. Chaque Racine correspond a un Packet. CQFD
+ // SCRoots initiated the resolution: splitting into StrongComponents + selection
+ // of Roots. Each Root corresponds to a Packet. QED
packs.GetParts(packsc);
}
iter.AddItem(thefinal);
for (; iter.More(); iter.Next())
{
- iter.Value()->FillIterator(iter); // Iterateur qui se court apres
+ iter.Value()->FillIterator(iter); // Iterator that runs itself after
}
return iter;
}
Interface_EntityIterator remain = Remainder(G);
if (remain.NbEntities() == 0)
return total;
- // sinon, faire la difference !
+ // otherwise, make the difference!
IFGraph_Compare GC(G);
GC.GetFromIter(total, Standard_True);
GC.GetFromIter(remain, Standard_False);
{
Interface_EntityIterator iter;
return iter;
-} // par defaut vide
+} // empty by default
Standard_Integer res = theeditor->NameNumber(name);
if (thecomplete || res == 0)
return res;
- // Sinon, chercher res dans thenums
+ // Otherwise, search res in thenums
Standard_Integer i, nb = thenums.Length();
for (i = 1; i <= nb; i++)
{
Standard_Integer res = theeditor->NameNumber(name);
if (thecomplete || res == 0)
return res;
- // Sinon, chercher res dans thenums
+ // Otherwise, search res in thenums
Standard_Integer i, nb = thenums.Length();
for (i = 1; i <= nb; i++)
{
else
{
- // Donnees sur lesquelles on a travaille
+ // Data on which we worked
if (themodel.IsNull())
{
if (theent.IsNull())
<< "****************************************************" << std::endl
<< std::endl;
- // Affichage des valeurs
+ // Display of values
Standard_Boolean nams = names;
Standard_Integer maxnam = theeditor->MaxNameLength(names ? 0 : -1);
if (maxnam == 0)
Standard_Integer jv = NumberFromRank(iv);
Standard_CString name = theeditor->Name(jv, !nams);
- // Original ou Final
+ // Original or Final
if (what != 0)
{
Handle(TCollection_HAsciiString) str;
Standard_Integer res;
if (thenames.Find(name, res))
return res;
- res = atoi(name); // si c est un entier, on tente le coup
+ res = atoi(name); // if it's an integer, we try it
if (res < 1 || res > NbValues())
res = 0;
return res;
nomlon = resfile.Length();
nomdeb = resfile.SearchFromEnd("/");
if (nomdeb <= 0)
- nomdeb = resfile.SearchFromEnd("\\"); // pour NT
+ nomdeb = resfile.SearchFromEnd("\\"); // for NT
if (nomdeb < 0)
nomdeb = 0;
nomfin = resfile.SearchFromEnd(".");
suffix = resfile.SubString(nomfin, nomlon);
}
-// Functions definit un certain nombre de commandes
-// enregistrees dans le Dictionnaire de Activator (par des Act unitaires)
-// Les actions elles-memes sont regroupees en fin de fichier
+// Functions defines a certain number of commands
+// registered in the Activator Dictionary (by unit Acts)
+// The actions themselves are grouped at the end of file
-// Les definitions
+// The definitions
static IFSelect_ReturnStatus funstatus(const Handle(IFSelect_SessionPilot)&)
{
}
IFSelect_ReturnStatus status = WS->ReadFile(arg1);
- // status : 0 OK, 1 erreur lecture, 2 Fail(try/catch),
- // -1 fichier non trouve, -2 lecture faite mais resultat vide
+ // status: 0 OK, 1 read error, 2 Fail(try/catch),
+ // -1 file not found, -2 reading done but empty result
switch (status)
{
case IFSelect_RetVoid:
// return IFSelect_RetError;
// }
- // Ajout : si Selection, on applique un GraphCounter
- // Et en ce cas, on peut en avoir plusieurs : la limite est le mot-cle "on"
+ // Addition: if Selection, we apply a GraphCounter
+ // And in this case, we can have several: the limit is the keyword "on"
Standard_Integer onflag = 0;
Standard_Integer i; // svv Jan11 2000 : porting on DEC
for (i = 2; i < argc; i++)
DeclareAndCast(IFSelect_SelectDeduct, seld, sel);
if (!seld.IsNull())
{
- // Si onflag, faire une SelectSuite
+ // If onflag, create a SelectSuite
if (onflag > 2)
{
Handle(IFSelect_SelectSuite) suite = new IFSelect_SelectSuite;
niv = 10;
break;
default:
- sout << "Unknown Mode . data tout court pour help" << std::endl;
+ sout << "Unknown Mode . data simply for help" << std::endl;
return IFSelect_RetError;
}
WS->TraceDumpModel(niv);
Message_Messenger::StreamBuffer sout = Message::SendInfo();
if (argc < 1)
{
- sout << "Donner la valeur entiere pour IntParam" << std::endl;
+ sout << "Give integer value for IntParam" << std::endl;
return IFSelect_RetError;
}
Handle(IFSelect_IntParam) intpar = new IFSelect_IntParam;
Message_Messenger::StreamBuffer sout = Message::SendInfo();
if (argc < 1)
{
- sout << "Donner la valeur texte pour TextParam" << std::endl;
+ sout << "Give text value for TextParam" << std::endl;
return IFSelect_RetError;
}
Handle(TCollection_HAsciiString) textpar = new TCollection_HAsciiString();
return IFSelect_RetError;
}
- // MakeList : sur Pointed existante ou a creer
+ // MakeList: on existing Pointed or to be created
Handle(IFSelect_SelectPointed) pnt;
if (mode == 'm')
{
if (argc < 2)
{
if (WS->FilePrefix().IsNull())
- sout << "Pas de prefixe defini" << std::endl;
+ sout << "No prefix defined" << std::endl;
else
sout << "Prefixe : " << WS->FilePrefix()->ToCString() << std::endl;
sout << "Pour changer : filepref newprefix" << std::endl;
Message_Messenger::StreamBuffer sout = Message::SendInfo();
if (argc < 2)
{
- sout << "Donner Dispatch et nom de Root" << std::endl;
+ sout << "Give Dispatch and Root name" << std::endl;
return IFSelect_RetError;
}
DeclareAndCast(IFSelect_Dispatch, disp, WS->NamedItem(arg1));
if (argc < 3)
{
if (WS->FileRoot(disp).IsNull())
- sout << "Pas de racine definie pour " << arg1 << std::endl;
+ sout << "No root defined for " << arg1 << std::endl;
else
- sout << "Racine pour " << arg1 << " : " << WS->FileRoot(disp)->ToCString() << std::endl;
+ sout << "Root for " << arg1 << " : " << WS->FileRoot(disp)->ToCString() << std::endl;
sout << "Pour changer : fileroot nomdisp newroot" << std::endl;
return IFSelect_RetVoid;
}
if (argc < 2)
{
if (WS->DefaultFileRoot().IsNull())
- sout << "Pas de racine par defaut definie" << std::endl;
+ sout << "No default root defined" << std::endl;
else
sout << "Racine par defaut : " << WS->DefaultFileRoot()->ToCString() << std::endl;
sout << "Pour changer : filedef newdef" << std::endl;
Message_Messenger::StreamBuffer sout = Message::SendInfo();
if (!WS->HasModel())
{
- sout << "Pas de Modele charge, abandon" << std::endl;
+ sout << "No Model loaded, abort" << std::endl;
return IFSelect_RetFail;
}
Message_Messenger::StreamBuffer sout = Message::SendInfo();
IFSelect_ReturnStatus stat = IFSelect_RetVoid;
if (argc < 2)
- sout << "Split : derniere liste de dispatches definie" << std::endl;
+ sout << "Split : last dispatch list defined" << std::endl;
else
{
WS->ClearShareOut(Standard_True);
DeclareAndCast(IFSelect_Selection, sel, WS->NamedItem(arg1));
if (sel.IsNull())
{
- sout << "Pas de Selection de Nom : " << arg1 << std::endl;
+ sout << "No Selection with Name : " << arg1 << std::endl;
return IFSelect_RetError;
}
if (arg2[0] == 'k')
DeclareAndCast(IFSelect_GeneralModifier, modif, WS->NamedItem(arg1));
if (modif.IsNull())
{
- sout << "Pas de Modifier de Nom : " << arg1 << std::endl;
+ sout << "No Modifier with Name : " << arg1 << std::endl;
return IFSelect_RetVoid;
}
Handle(IFSelect_IntParam) low, up;
if (argc < 2)
{
sout << "Donner Nom Modifier; + Nom Selection optionnel\n"
- << "Selection pour Mettre une Selection, sinon Annule" << std::endl;
+ << "Selection to Set a Selection, otherwise Cancel" << std::endl;
return IFSelect_RetError;
}
DeclareAndCast(IFSelect_GeneralModifier, modif, WS->NamedItem(arg1));
if (modif.IsNull())
{
- sout << "Pas un nom de Modifier : " << arg1 << std::endl;
+ sout << "Not a Modifier name : " << arg1 << std::endl;
return IFSelect_RetError;
}
Handle(IFSelect_Selection) sel;
sel = GetCasted(IFSelect_Selection, WS->NamedItem(arg2));
if (sel.IsNull())
{
- sout << "Pas un nom de Selection : " << arg2 << std::endl;
+ sout << "Not a Selection name : " << arg2 << std::endl;
return IFSelect_RetError;
}
}
DeclareAndCast(IFSelect_GeneralModifier, modif, WS->NamedItem(arg1));
if (modif.IsNull())
{
- sout << "Pas un nom de Modifier : " << arg1 << std::endl;
+ sout << "Not a Modifier name : " << arg1 << std::endl;
return IFSelect_RetError;
}
Handle(Standard_Transient) item;
DeclareAndCast(IFSelect_GeneralModifier, modif, WS->NamedItem(arg1));
if (modif.IsNull())
{
- sout << "Pas un nom de Modifier : " << arg1 << std::endl;
+ sout << "Not a Modifier name : " << arg1 << std::endl;
return IFSelect_RetError;
}
if (!WS->ResetAppliedModifier(modif))
Message_Messenger::StreamBuffer sout = Message::SendInfo();
if (argc < 4)
{
- sout << "modifmove MF rang1 rang2, M pour Model F pour File" << std::endl;
+ sout << "modifmove MF rang1 rang2, M for Model F for File" << std::endl;
return IFSelect_RetError;
}
Standard_Boolean formodel;
formodel = Standard_False;
else
{
- sout << "preciser M pour Model, F pour File" << std::endl;
+ sout << "specify M for Model, F for File" << std::endl;
return IFSelect_RetError;
}
Standard_Integer before = atoi(arg2);
DeclareAndCast(IFSelect_Dispatch, disp, WS->NamedItem(arg1));
if (disp.IsNull())
{
- sout << "Pas un nom de Dispatch : " << arg1 << std::endl;
+ sout << "Not a Dispatch name : " << arg1 << std::endl;
return IFSelect_RetError;
}
DeclareAndCast(IFSelect_Selection, sel, WS->NamedItem(arg2));
if (sel.IsNull())
{
- sout << "Pas un nom de Selection : " << arg2 << std::endl;
+ sout << "Not a Selection name : " << arg2 << std::endl;
return IFSelect_RetError;
}
if (!WS->SetItemSelection(disp, sel))
Message_Messenger::StreamBuffer sout = Message::SendInfo();
if (argc < 2)
{
- sout << "Donner Nom IntParam pour Count" << std::endl;
+ sout << "Give IntParam Name for Count" << std::endl;
return IFSelect_RetError;
}
DeclareAndCast(IFSelect_IntParam, par, WS->NamedItem(arg1));
if (par.IsNull())
{
- sout << "Pas un nom de IntParam : " << arg1 << std::endl;
+ sout << "Not an IntParam name : " << arg1 << std::endl;
return IFSelect_RetError;
}
Handle(IFSelect_DispPerCount) disp = new IFSelect_DispPerCount;
Message_Messenger::StreamBuffer sout = Message::SendInfo();
if (argc < 2)
{
- sout << "Donner Nom IntParam pour NbFiles" << std::endl;
+ sout << "Give IntParam Name for NbFiles" << std::endl;
return IFSelect_RetError;
}
DeclareAndCast(IFSelect_IntParam, par, WS->NamedItem(arg1));
if (par.IsNull())
{
- sout << "Pas un nom de IntParam : " << arg1 << std::endl;
+ sout << "Not an IntParam name : " << arg1 << std::endl;
return IFSelect_RetError;
}
Handle(IFSelect_DispPerFiles) disp = new IFSelect_DispPerFiles;
DeclareAndCast(IFSelect_Signature, sig, WS->NamedItem(arg1));
if (sig.IsNull())
{
- sout << "Pas un nom de Signature : " << arg1 << std::endl;
+ sout << "Not a Signature name : " << arg1 << std::endl;
return IFSelect_RetError;
}
Handle(IFSelect_DispPerSignature) disp = new IFSelect_DispPerSignature;
return IFSelect_RetError;
}
Standard_Integer num = WS->DispatchRank(disp);
- sout << "Dispatch de Nom : " << arg1 << " , en ShareOut, Numero " << num << " : ";
+ sout << "Dispatch with Name : " << arg1 << " , in ShareOut, Number " << num << " : ";
Handle(IFSelect_Selection) sel = WS->ItemSelection(disp);
Handle(TCollection_HAsciiString) selname = WS->Name(sel);
if (sel.IsNull())
- sout << "Pas de Selection Finale" << std::endl;
+ sout << "No Final Selection" << std::endl;
else if (selname.IsNull())
sout << "Selection Finale : #" << WS->ItemIdent(sel) << std::endl;
else
sout << "Selection Finale : " << selname->ToCString() << std::endl;
if (disp->HasRootName())
- sout << "-- Racine nom de fichier : " << disp->RootName()->ToCString() << std::endl;
+ sout << "-- Root file name : " << disp->RootName()->ToCString() << std::endl;
return IFSelect_RetVoid;
}
Message_Messenger::StreamBuffer sout = Message::SendInfo();
if (argc < 2)
{
- sout << "Donner Nom de Transformer" << std::endl;
+ sout << "Give Transformer Name" << std::endl;
return IFSelect_RetError;
}
DeclareAndCast(IFSelect_Transformer, tsf, WS->NamedItem(arg1));
sout << "Erreur, Transformation ignoree" << std::endl;
break;
case -2:
- sout << "Erreur sur edition sur place, risque de corruption (verifier)" << std::endl;
+ sout << "Error on in-place editing, risk of corruption (check)" << std::endl;
break;
case -1:
- sout << "Erreur sur edition locale, risque de corruption (verifier)" << std::endl;
+ sout << "Error on local editing, risk of corruption (check)" << std::endl;
break;
case 0:
if (tsf.IsNull())
// **** Run Modifier avec Standard Copy ****
// **** Run Modifier avec OnTheSpot ****
Standard_Boolean runcopy = (pilot->Arg(0)[3] == 'c');
- // soit c est un nom, sinon c est une commande
+ // either it's a name, otherwise it's a command
Handle(IFSelect_Modifier) modif;
if (WS->NameIdent(arg1) > 0)
modif = GetCasted(IFSelect_Modifier, WS->NamedItem(arg1));
else
{
- pilot->RemoveWord(0); // c etait la commande run
+ pilot->RemoveWord(0); // it was the run command
pilot->Perform();
modif = GetCasted(IFSelect_Modifier, pilot->RecordedItem());
}
Message_Messenger::StreamBuffer sout = Message::SendInfo();
if (modif.IsNull())
{
- sout << "Pas un nom de Modifier : " << arg1 << std::endl;
+ sout << "Not a Modifier name : " << arg1 << std::endl;
return IFSelect_RetError;
}
sout << "Erreur, Transformation ignoree" << std::endl;
break;
case -2:
- sout << "Erreur sur edition sur place, risque de corruption (verifier)" << std::endl;
+ sout << "Error on in-place editing, risk of corruption (check)" << std::endl;
break;
case -1:
- sout << "Erreur sur edition locale, risque de corruption (verifier)" << std::endl;
+ sout << "Error on local editing, risk of corruption (check)" << std::endl;
break;
case 0:
if (modif.IsNull())
Message_Messenger::StreamBuffer sout = Message::SendInfo();
if (argc < 2)
{
- sout << "Donner Nom de Selection" << std::endl;
+ sout << "Give Selection Name" << std::endl;
return IFSelect_RetError;
}
DeclareAndCast(IFSelect_Selection, sel, WS->NamedItem(arg1));
if (argc < 2)
{
sout << "Donner la description du SelectRange"
- << " Formes admises :\n <n1> <n2> : Range de <n1> a <n2>\n"
+ << " Accepted forms :\n <n1> <n2> : Range from <n1> to <n2>\n"
<< " <n1> tout seul : Range n0 <n1>\n from <n1> : Range From <n1>\n"
<< " until <n2> : Range Until <n2>" << std::endl;
return IFSelect_RetVoid;
return IFSelect_RetFail;
Message_Messenger::StreamBuffer sout = Message::SendInfo();
if (argc < 3)
- sout << "Diff sans input : ne pas oublier de les definir (ctlmain, ctlsec)!" << std::endl;
+ sout << "Diff without input : don't forget to define them (ctlmain, ctlsec)!" << std::endl;
DeclareAndCast(IFSelect_Selection, selmain, WS->NamedItem(arg1));
DeclareAndCast(IFSelect_Selection, selsec, WS->NamedItem(arg2));
if (argc >= 2)
Message_Messenger::StreamBuffer sout = Message::SendInfo();
if (argc < 3)
{
- sout << "Donner Noms de Control et MainInput" << std::endl;
+ sout << "Give Control and MainInput Names" << std::endl;
return IFSelect_RetError;
}
DeclareAndCast(IFSelect_Selection, sel, WS->NamedItem(arg1));
DeclareAndCast(IFSelect_Selection, selmain, WS->NamedItem(arg2));
if (WS->SetControl(sel, selmain, Standard_True))
return IFSelect_RetDone;
- sout << "Nom incorrect ou Selection " << arg1 << " pas de type Control" << std::endl;
+ sout << "Incorrect name or Selection " << arg1 << " not of Control type" << std::endl;
return IFSelect_RetFail;
}
Message_Messenger::StreamBuffer sout = Message::SendInfo();
if (argc < 3)
{
- sout << "Donner Noms de Control et SecondInput" << std::endl;
+ sout << "Give Control and SecondInput Names" << std::endl;
return IFSelect_RetError;
}
DeclareAndCast(IFSelect_Selection, sel, WS->NamedItem(arg1));
DeclareAndCast(IFSelect_Selection, seldif, WS->NamedItem(arg2));
if (WS->SetControl(sel, seldif, Standard_False))
return IFSelect_RetDone;
- sout << "Nom incorrect ou Selection " << arg1 << " pas de type Control" << std::endl;
+ sout << "Incorrect name or Selection " << arg1 << " not of Control type" << std::endl;
return IFSelect_RetFail;
}
Message_Messenger::StreamBuffer sout = Message::SendInfo();
if (argc < 2)
{
- sout << "Donner Nom IntParam pour n0 Entite" << std::endl;
+ sout << "Give IntParam Name for Entity n0" << std::endl;
return IFSelect_RetError;
}
DeclareAndCast(IFSelect_IntParam, par, WS->NamedItem(arg1));
sout << "Pas une SelectPointed:" << arg1 << std::endl;
return IFSelect_RetError;
}
- const Handle(Interface_InterfaceModel)& model = WS->Model(); // pour Print
+ const Handle(Interface_InterfaceModel)& model = WS->Model(); // for Print
if (argc == 2)
{ // listage simple
Standard_Integer nb = sp->NbItems();
}
else
{
- sout << "Ignore:" << argi << " , donner n0 PRECEDE de + ou - ou /" << std::endl;
+ sout << "Ignore:" << argi << " , give n0 PRECEDED by + or - or /" << std::endl;
}
}
return IFSelect_RetDone;
return IFSelect_RetError;
Standard_Boolean islist = edf->Editor()->IsList(num);
- Standard_CString name = edf->Editor()->Name(num, Standard_True); // vrai nom
+ Standard_CString name = edf->Editor()->Name(num, Standard_True); // real name
Handle(TColStd_HSequenceOfHAsciiString) listr;
Handle(TCollection_HAsciiString) str;
sout << "Value Name : " << name << (edf->IsModified(num) ? "(already edited) : " : " : ");
IFSelect_Act::AddFunc("settext",
"Name:TextParam newValue:string : Change valeur TextParam",
fun17);
- IFSelect_Act::AddFunc("dumpsel", "Dump Selection suivi du Nom de la Selection a dumper", fun19);
+ IFSelect_Act::AddFunc("dumpsel", "Dump Selection followed by Name of Selection to dump", fun19);
IFSelect_Act::AddFunc("evalsel", "name:Selection [num/sel] : Evalue une Selection", fun20);
IFSelect_Act::AddFunc("givelist", "num/sel [num/sel ...] : Evaluates GiveList", fun20);
IFSelect_Act::AddFunc("giveshort", "num/sel [num/sel ...] : GiveList in short form", fun20);
IFSelect_Act::AddFunc("listmodif", "List Final Modifiers", fun40);
IFSelect_Act::AddFunc("dumpmodif", "modif:Modifier : Affiche le Statut d'un Modifier", fun41);
IFSelect_Act::AddFunc("modifsel",
- "modif:Modifier [sel:Selection] : Change/Annule Selection de Modifier",
+ "modif:Modifier [sel:Selection] : Change/Cancel Selection of Modifier",
fun42);
IFSelect_Act::AddFunc(
"setapplied",
"modif:Modifier [name:un item sinon sortie fichier] : Applique un Modifier",
fun43);
IFSelect_Act::AddFunc("resetapplied",
- "modif:Modifier : Enleve un Modifier de la sortie fichier",
+ "modif:Modifier : Remove a Modifier from file output",
fun44);
IFSelect_Act::AddFunc(
"modifmove",
fun45);
IFSelect_Act::AddFunc("dispsel",
- "disp:Dispatch sel:Selection -> Selection Finale de Dispatch",
+ "disp:Dispatch sel:Selection -> Final Selection of Dispatch",
fun51);
IFSelect_Act::AddFSet("dispone", "cree DispPerOne", fun_dispone);
IFSelect_Act::AddFSet("dispglob", "cree DispGlobal", fun_dispglob);
IFSelect_Act::AddFSet("dispsign", "sign:Signature : cree DispPerSignature", fun_dispsign);
IFSelect_Act::AddFunc("dumpdisp", "disp:Dispatch : Affiche le Statut d'un Dispatch", fun56);
- IFSelect_Act::AddFunc("xremove", "nom : Remove a Control Item de la Session", fun57);
+ IFSelect_Act::AddFunc("xremove", "nom : Remove a Control Item from the Session", fun57);
IFSelect_Act::AddFunc("evaldisp",
"mode=[0-3] disp:Dispatch : Evaluates one or more Dispatch(es)",
fun58);
"writedisp",
"filepattern disp:Dispatch [givelist] : Writes Entities by Splitting by a Dispatch",
fun_writedisp);
- IFSelect_Act::AddFunc("evalcomplete", "Evaluation Complete de la Repartition", fun59);
+ IFSelect_Act::AddFunc("evalcomplete", "Complete Evaluation of the Distribution", fun59);
IFSelect_Act::AddFunc("runcheck", "affiche LastRunCheckList (write,modif)", fun60);
IFSelect_Act::AddFunc("runtranformer", "transf:Transformer : Applique un Transformer", fun61);
"sel:Selection genre Deduct ou Extract input:Selection : Set Input",
fun71);
IFSelect_Act::AddFSet("modelroots", "cree SelectModelRoots", fun72);
- IFSelect_Act::AddFSet("range", "options... : cree SelectRange ...; tout court pour help", fun73);
+ IFSelect_Act::AddFSet("range", "options... : create SelectRange ...; simply for help", fun73);
IFSelect_Act::AddFSet("roots", "cree SelectRoots (local roots)", fun74);
IFSelect_Act::AddFSet("shared", "cree SelectShared", fun75);
IFSelect_Act::AddFSet("diff", "[main:Selection diff:Selection] : cree SelectDiff", fun76);
IFSelect_Act::AddFSet("typecontain", "type:string : cree SelectTextType Contains", fun89);
IFSelect_Act::AddFSet("pointed", "cree SelectPointed [num/sel num/sel]", fun90);
IFSelect_Act::AddFunc("setpointed",
- "sel:SelectPointed : edition SelectPointed. tout court pour help",
+ "sel:SelectPointed : edit SelectPointed. simply for help",
fun91);
IFSelect_Act::AddFunc("setlist",
- "sel:SelectPointed : edition SelectPointed. tout court pour help",
+ "sel:SelectPointed : edit SelectPointed. simply for help",
fun91);
IFSelect_Act::AddFSet("incorrect", "cree SelectIncorrectEntities (computed)", fun92);
}
// ########################################################################
-// ######## OPERATIONS DE TRANSFERT GLOBAL (memorise ou non) ########
+// ######## GLOBAL TRANSFER OPERATIONS (memorized or not) ########
void IFSelect_ModelCopier::ClearResult()
{
return Standard_True;
}
-// .... Copy : Opere les Transferts, les Memorise (pas d envoi fichier ici)
+// .... Copy : Performs Transfers, Memorizes them (no file sending here)
Interface_CheckIterator IFSelect_ModelCopier::Copy(IFSelect_ShareOutResult& eval,
const Handle(IFSelect_WorkLibrary)& WL,
return Copying(eval, WL, protocol, TC);
}
-// Copy Interne
+// Internal Copy
Interface_CheckIterator IFSelect_ModelCopier::Copying(IFSelect_ShareOutResult& eval,
const Handle(IFSelect_WorkLibrary)& WL,
return checks;
}
-// Send a deux arguments : Envoi Fichier du Resultat deja memorise
+// Send with two arguments : File Sending of Result already memorized
Interface_CheckIterator IFSelect_ModelCopier::SendCopied(const Handle(IFSelect_WorkLibrary)& WL,
const Handle(Interface_Protocol)& protocol)
return checks;
}
-// .... Send a 4 arguments : Calcul du Transfert et Envoi sur Fichier
+// .... Send with 4 arguments : Transfer Calculation and File Sending
Interface_CheckIterator IFSelect_ModelCopier::Send(IFSelect_ShareOutResult& eval,
const Handle(IFSelect_WorkLibrary)& WL,
return checks;
}
-// .... SendAll : Donnees a tranferer dans G, aucun split, envoi sur fichier
+// .... SendAll : Data to transfer in G, no split, file sending
Interface_CheckIterator IFSelect_ModelCopier::SendAll(const Standard_CString filename,
const Interface_Graph& G,
return checks;
}
-// .... SendSelected : Donnees a tranferer dans G, filtrees par iter,
-// aucun split, envoi sur fichier
+// .... SendSelected : Data to transfer in G, filtered by iter,
+// no split, file sending
Interface_CheckIterator IFSelect_ModelCopier::SendSelected(
const Standard_CString filename,
return checks;
Handle(Interface_InterfaceModel) newmod = original->NewEmptyModel();
Interface_CopyTool TC(original, protocol);
- TC.FillModel(newmod); // pour Header ...
+ TC.FillModel(newmod); // for Header ...
- // Pas de copie : AddWithRefs plus declaration de Bind
+ // No copy : AddWithRefs plus Bind declaration
Interface_GeneralLib lib(protocol);
for (list.Start(); list.More(); list.Next())
{
newmod,
applied,
checks);
- // Alimenter Remaining : les entites copiees sont a noter
+ // Feed Remaining : copied entities are to be noted
Handle(Standard_Transient) ent1, ent2;
for (Standard_Integer ic = TC.LastCopiedAfter(0, ent1, ent2); ic > 0;
ic = TC.LastCopiedAfter(ic, ent1, ent2))
}
// ##########################################################################
-// ######## UN TRANSFERT UNITAIRE (avec Modifications) ########
+// ######## A UNIT TRANSFER (with Modifications) ########
void IFSelect_ModelCopier::CopiedModel(const Interface_Graph& G,
const Handle(IFSelect_WorkLibrary)& WL,
Handle(IFSelect_AppliedModifiers)& applied,
Interface_CheckIterator& checks) const
{
- // ... Premiere partie "standard" : remplissage du modele ...
- // On cree le Modele, on le remplit avec les Entites, et avec le Header depart
+ // ... First "standard" part : filling the model ...
+ // We create the Model, we fill it with Entities, and with the starting Header
- // ATTENTION : dispnum = 0 signifie prendre modele original, ne rien copier
- // et aussi : pas de Dispatch (envoi en bloc)
+ // WARNING : dispnum = 0 means take original model, copy nothing
+ // and also : no Dispatch (bulk sending)
applied.Nullify();
const Handle(Interface_InterfaceModel)& original = G.Model();
WL->CopyModel(original, newmod, tocopy, TC);
Handle(Standard_Transient) ent1, ent2;
- // Alimenter Remaining : les entites copiees sont a noter
+ // Feed Remaining : copied entities are to be noted
for (Standard_Integer ic = TC.LastCopiedAfter(0, ent1, ent2); ic > 0;
ic = TC.LastCopiedAfter(ic, ent1, ent2))
{
else if (newmod.IsNull())
newmod = original;
- // ... Ensuite : On prend en compte les Model Modifiers ...
+ // ... Then : We take into account the Model Modifiers ...
Standard_Integer nbmod = 0;
if (!theshareout.IsNull())
nbmod = theshareout->NbModifiers(Standard_True);
{
Handle(IFSelect_Modifier) unmod = theshareout->ModelModifier(i);
- // D abord, critere Dispatch/Packet
+ // First, Dispatch/Packet criterion
if (dispnum > 0)
if (!unmod->Applies(theshareout->Dispatch(dispnum)))
continue;
IFSelect_ContextModif ctx(G, TC, filename.ToCString());
- // Ensuite, la Selection
+ // Then, the Selection
Handle(IFSelect_Selection) sel = unmod->Selection();
if (!sel.IsNull())
{
Interface_CheckIterator checklst = ctx.CheckList();
checks.Merge(checklst);
- // Faut-il enregistrer les erreurs dans newmod ? bonne question
+ // Should we record errors in newmod ? good question
// if (!checks.IsEmpty(Standard_False)) {
// Message::SendWarning() <<
// " Messages on Copied Model n0 "<<numod<<", Dispatch Rank "<<dispnum<<std::endl;
// }
}
- // ... Puis les File Modifiers : en fait, on les enregistre ...
+ // ... Then the File Modifiers : in fact, we record them ...
nbmod = 0;
if (!theshareout.IsNull())
nbmod = theshareout->NbModifiers(Standard_False);
{
Handle(IFSelect_GeneralModifier) unmod = theshareout->GeneralModifier(Standard_False, i);
- // D abord, critere Dispatch/Packet
+ // First, Dispatch/Packet criterion
if (dispnum > 0)
if (!unmod->Applies(theshareout->Dispatch(dispnum)))
continue;
- // Ensuite, la Selection
+ // Then, the Selection
Handle(IFSelect_Selection) sel = unmod->Selection();
if (sel.IsNull())
- applied->AddModif(unmod); // vide -> on prend tout
+ applied->AddModif(unmod); // empty -> we take all
else
{
Interface_EntityIterator list = sel->UniqueResult(G);
Handle(Standard_Transient) newent;
- // Entites designees par la Selection et Copiees ?
- // -> s ilyena au moins une, le Modifier s applique, sinon il est rejete
- // -> et cette liste est exploitable par le Modifier ...
+ // Entities designated by the Selection and Copied ?
+ // -> if there is at least one, the Modifier applies, otherwise it is rejected
+ // -> and this list is exploitable by the Modifier ...
for (list.Start(); list.More(); list.Next())
{
if (TC.Search(list.Value(), newent))
newmod.Nullify();
else
{
- // CE QUI SUIT NE DOIT PAS ETRE SUPPRIME ! cf theremain
+ // WHAT FOLLOWS MUST NOT BE DELETED ! cf theremain
Handle(Standard_Transient) ent1, ent2;
for (Standard_Integer ic = TC.LastCopiedAfter(0, ent1, ent2); ic > 0;
ic = TC.LastCopiedAfter(ic, ent1, ent2))
if (ic <= theremain->Upper())
theremain->SetValue(ic, 1);
}
-// qq impressions de mise au point
+// some debugging prints
#ifdef MISOPOINT
std::cout << " Remaining Model : " << newmod->NbEntities() << " Entities" << std::endl;
Standard_Integer ne = 0;
if (theremain->Value(i) == 0)
{
if (ne == 0)
- std::cout << " Refractaires : ";
+ std::cout << " Refractory : ";
ne++;
std::cout << " " << i;
}
}
// ##########################################################################
-// ######## RESULTAT de la Memorisation des Transferts ########
+// ######## RESULT of Transfer Memorization ########
Standard_Integer IFSelect_ModelCopier::NbFiles() const
{
thesentfiles.Nullify();
if (record)
thesentfiles = new TColStd_HSequenceOfHAsciiString();
- // et numerotation des fichiers par defaut : detenue par ShareOut
+ // and default file numbering : held by ShareOut
if (sho.IsNull())
return;
Standard_Integer lastrun = sho->LastRun();
sho->ClearResult(Standard_True);
- sho->SetLastRun(lastrun); // on ne s interesse quaux numeros
+ sho->SetLastRun(lastrun); // we are only interested in the numbers
}
void IFSelect_ModelCopier::AddSentFile(const Standard_CString filename)
Standard_Boolean IFSelect_ParamEditor::Recognize(const Handle(IFSelect_EditForm)& /*form*/) const
{
return Standard_True;
-} // pas de contrainte
+} // no constraint
Handle(TCollection_HAsciiString) IFSelect_ParamEditor::StringValue(
const Handle(IFSelect_EditForm)& /*form*/,
#include <stdio.h>
IMPLEMENT_STANDARD_RTTIEXT(IFSelect_SelectAnyList, IFSelect_SelectDeduct)
-// .... Definition de liste : methodes "deferred" NbItems & FillResult
+// .... List definition: "deferred" methods NbItems & FillResult
void IFSelect_SelectAnyList::SetRange(const Handle(IFSelect_IntParam)& rankfrom,
const Handle(IFSelect_IntParam)& rankto)
{
return theupper->Value();
}
-// On prend les sous-entites de lower a upper (inclus)
+// Take the sub-entities from lower to upper (included)
Interface_EntityIterator IFSelect_SelectAnyList::RootResult(const Interface_Graph& G) const
{
Interface_EntityIterator input = InputResult(G);
IMPLEMENT_STANDARD_RTTIEXT(IFSelect_SelectBase, IFSelect_Selection)
void IFSelect_SelectBase::FillIterator(IFSelect_SelectionIterator&) const {
-} // rien a faire, une SelectBase ne depend d aucune autre Selection
+} // nothing to do, a SelectBase doesn't depend on any other Selection
if (!thenum.IsNull())
num = thenum->Value();
if (num < 1)
- return iter; // vide si num < 1 ou num > NbEntities
+ return iter; // empty if num < 1 or num > NbEntities
if (num <= G.Size())
iter.GetOneItem(G.Entity(num));
return iter;
const Standard_Integer,
const Handle(Standard_Transient)& ent,
const Handle(Interface_InterfaceModel)& model) const
-//.. ne peut pas marcher, il faut aussi le modele ! ex. via le graphe ...
+//.. cannot work, the model is also needed ! ex. via the graph ...
{
return model->IsErrorEntity(model->Number(ent));
}
Interface_EntityIterator IFSelect_SelectExplore::RootResult(const Interface_Graph& G) const
{
- // Attention, voila comme on procede
- // On a une IndexedMapOfTransient en entree (entites deja traitees/a traiter)
- // Elle est initialisee par InputResult
- // Et une map en sortie (resultats pris) -> le resultat sera unique
- // En entree, un curseur d entite courante
- // Pour chaque entite, on appelle Explore. 3 cas possibles :
- // retour False, on passe
- // retour True et liste vide, on prend cette entite sans aller plus loin
- // retour True et liste non vide, on ne prend pas cette entite mais on
- // considere son resultat.
- // Si dernier niveau, on le prend en entier. Sinon, il alimente l entree
+ // Attention, here's how we proceed
+ // We have an IndexedMapOfTransient as input (entities already processed/to process)
+ // It is initialized by InputResult
+ // And a map as output (results taken) -> the result will be unique
+ // As input, a cursor of current entity
+ // For each entity, we call Explore. 3 possible cases:
+ // return False, we skip
+ // return True and empty list, we take this entity without going further
+ // return True and non-empty list, we don't take this entity but we
+ // consider its result.
+ // If last level, we take it entirely. Otherwise, it feeds the input
Standard_Integer nb = G.Size();
TColStd_IndexedMapOfTransient entrees(nb);
if (!Explore(level, ent, G, exp))
continue;
- // On prend en compte : entite a prendre directement ?
- // reprendre liste en entree (niveau pas atteint) ou resultat (niveau atteint)
+ // We take into account : entity to take directly ?
+ // take back input list (level not reached) or result (level reached)
if (exp.NbEntities() == 0)
{
j = result.Add(ent);
}
}
- // On recolte le resultat
+ // We collect the result
Interface_EntityIterator res;
nb = result.Extent();
for (j = 1; j <= nb; j++)
Interface_EntityIterator IFSelect_SelectExtract::RootResult(const Interface_Graph& G) const
{
Interface_EntityIterator iter;
- Interface_EntityIterator inputer = InputResult(G); // tient compte de tout
+ Interface_EntityIterator inputer = InputResult(G); // takes everything into account
Standard_Integer rank = 0;
for (inputer.Start(); inputer.More(); inputer.Next())
{
IMPLEMENT_STANDARD_RTTIEXT(IFSelect_SelectInList, IFSelect_SelectAnyList)
-// .... Specialisation de SelectAnyList dans laquelle on traite une liste
-// dont chaque item est une Entite
+// .... Specialization of SelectAnyList in which we process a list
+// where each item is an Entity
void IFSelect_SelectInList::FillResult(const Standard_Integer n1,
const Standard_Integer n2,
const Handle(Standard_Transient)& ent,
Standard_Boolean IFSelect_SelectPointed::AddList(const Handle(TColStd_HSequenceOfTransient)& list)
{
- // Optimise avec une Map
+ // Optimized with a Map
Standard_Boolean res = Standard_False;
if (list.IsNull())
return res;
IFSelect_SelectRootComps::IFSelect_SelectRootComps() {}
-// Refait pour travailler en une fois
-// ATTENTION, il ne faut pas s interesser aux ENTITES mais aux COMPOSANTS
-// c-a-d gerer les CYCLES s il y en a
+// Redone to work at once
+// WARNING, we must not be interested in ENTITIES but in COMPONENTS
+// i.e. manage CYCLES if there are any
Interface_EntityIterator IFSelect_SelectRootComps::RootResult(const Interface_Graph& G) const
{
Interface_EntityIterator IEIinput = InputResult(G);
Interface_EntityIterator iter;
- // ICI, extraire les Componants, puis considerer une Entite de chacun
+ // HERE, extract the Components, then consider one Entity from each
IFGraph_StrongComponants comps(G, Standard_False);
comps.SetLoad();
comps.GetFromIter(IEIinput);
- Interface_EntityIterator inp1; // IEIinput reduit a une Entite par Composant
+ Interface_EntityIterator inp1; // IEIinput reduced to one Entity per Component
IFGraph_Cumulate GC(G);
- // On note dans le graphe : le cumul de chaque ensemble (Entite + Shared tous
- // niveaux). Les Roots initiales comptees une seule fois sont bonnes
- // Pour Entite : une par Componant (peu importe)
+ // We note in the graph: the cumulation of each set (Entity + Shared all
+ // levels). Initial Roots counted only once are good
+ // For Entity: one per Component (doesn't matter)
for (comps.Start(); comps.More(); comps.Next())
{
Handle(Standard_Transient) ent = comps.FirstEntity();
GC.GetFromEntity(ent);
inp1.GetOneItem(ent);
}
- // A present, on retient, parmi les inputs, celles comptees une seule fois
- // (N.B.: on prend inp1, qui donne UNE entite par composant, simple ou cycle)
+ // Now, we retain, among the inputs, those counted only once
+ // (N.B.: we take inp1, which gives ONE entity per component, simple or cycle)
for (inp1.Start(); inp1.More(); inp1.Next())
{
const Handle(Standard_Transient)& ent = inp1.Value();
IFSelect_SelectRoots::IFSelect_SelectRoots() {}
-// Refait pour travailler en une fois
+// Redone to work at once
Interface_EntityIterator IFSelect_SelectRoots::RootResult(const Interface_Graph& G) const
{
Interface_EntityIterator iter;
IFGraph_Cumulate GC(G);
- // On note dans le graphe : le cumul de chaque ensemble (Entite + Shared tous
- // niveaux). Les Roots initiales comptees une seule fois sont bonnes
+ // We note in the graph: the cumulation of each set (Entity + Shared all
+ // levels). The initial Roots counted only once are good
for (input.Start(); input.More(); input.Next())
{
const Handle(Standard_Transient)& ent = input.Value();
GC.GetFromEntity(ent);
}
- // A present, on retient, parmi les inputs, celles comptees une seule fois
+ // Now, we retain, among the inputs, those counted only once
for (input.Start(); input.More(); input.Next())
{
const Handle(Standard_Transient)& ent = input.Value();
IFSelect_SelectShared::IFSelect_SelectShared() {}
-// Entites partagees par d autres (a 1 niveau et au sens Strict)
+// Entities shared by others (at 1 level and in Strict sense)
Interface_EntityIterator IFSelect_SelectShared::RootResult(const Interface_Graph& G) const
{
IFSelect_SelectSharing::IFSelect_SelectSharing() {}
-// Entites en partageant d autres (a 1 niveau et au sens Strict)
+// Entities sharing others (at 1 level and in Strict sense)
Interface_EntityIterator IFSelect_SelectSharing::RootResult(const Interface_Graph& G) const
{
IMPLEMENT_STANDARD_RTTIEXT(IFSelect_SelectSignature, IFSelect_SelectExtract)
-// theexact : -1 OUI 0 NON une seule valeur > 0 NON nb de valeurs
-// signmode : 1 prendre si contenu, 2 refuser si contenu
-// 3 prendre si egal, 4 refuser si egal
-// ou test numerique, ajouter : 16 < 24 <= 32 > 40 >=
+// theexact : -1 YES 0 NO single value > 0 NO number of values
+// signmode: 1 take if contained, 2 refuse if contained
+// 3 take if equal, 4 refuse if equal
+// or numeric test, add : 16 < 24 <= 32 > 40 >=
static Standard_Integer multsign(const TCollection_AsciiString& signtext,
TColStd_SequenceOfAsciiString& signlist,
TColStd_SequenceOfInteger& signmode)
{
signlist.Append(item);
signmode.Append(imod);
- // mode ++; valait un au depart
+ // mode ++; was one at start
}
return mode;
}
return IFSelect_Signature::MatchValue(txt, thesigntext, (theexact < 0));
}
- // sinon : liste
- // Analyse en sequence : si alternance prend/prend-pas, le dernier a raison
- // en consequence, si que des prend ou que des prend-pas, c est commutatif
- // DONC recommendation : mettre les prend-pas en fin
+ // otherwise: list
+ // Sequence analysis: if take/don't-take alternation, the last one is right
+ // consequently, if only takes or only don't-takes, it's commutative
+ // THEREFORE recommendation: put the don't-takes at the end
- // AU DEPART : prendre = ne prendre que. prend-pas = prend-tout-sauf ...
- // Donc si le premier est un prend-pas, je commence par tout prendre
+ // AT START: take = take only. don't-take = take-all-except ...
+ // So if the first is a don't-take, I start by taking everything
Standard_Integer hmod = thesignmode.Value(1);
Standard_Integer jmod = hmod / 8;
Standard_Integer imod = hmod - (jmod * 8);
if (thematcher->Matches(ent, G.Model(), thesigntext, theexact))
return Standard_True;
- // sinon, on fait le tri ici
+ // otherwise, we do the sorting here
Interface_EntityIterator list = G.Shareds(ent);
- // Si plus de Shared, alors c est cuit
+ // If no more Shared, then it's finished
if (list.NbEntities() == 0)
return Standard_False;
- // Sinon, trier si on est au niveau
+ // Otherwise, sort if we are at the level
if (level < Level())
{
explored = list;
if (thematcher->Matches(ent, G.Model(), thesigntext, theexact))
return Standard_True;
- // sinon, on fait le tri ici
+ // otherwise, we do the sorting here
Interface_EntityIterator list = G.Sharings(ent);
- // Si plus de Sharing, alors c est cuit
+ // If no more Sharing, then it's finished
if (list.NbEntities() == 0)
return Standard_False;
- // Sinon, trier si on est au niveau
+ // Otherwise, sort if we are at the level
if (level < Level())
{
explored = list;
Standard_Boolean firstin = (HasInput() || HasAlternate());
if (firstin)
iter = InputResult(G);
- // Demarrage : on prend l Input/Alternate SI un des 2 est mis
- // Sinon, on demarre sur la definition de base de la premiere selection
+ // Starting : we take the Input/Alternate IF one of the 2 is set
+ // Otherwise, we start on the basic definition of the first selection
Standard_Integer i, nb = NbItems();
for (i = 1; i <= nb; i++)
Handle(IFSelect_SelectDeduct) anitem = Item(i);
if (firstin)
anitem->Alternate()->SetList(iter.Content());
- firstin = Standard_True; // ensuite c est systematique
+ firstin = Standard_True; // then it's systematic
iter = anitem->UniqueResult(G);
}
return iter;
return Standard_False;
} // eminemment redefinissable
-// UniqueResult, c est RootResult passe par une Map (-> mis a plat)
+// UniqueResult, it is RootResult passed through a Map (-> flattened)
Interface_EntityIterator IFSelect_Selection::UniqueResult(const Interface_Graph& G) const
{
return iter;
Interface_Graph GG(G);
GG.GetFromIter(iter, 0);
- return Interface_GraphContent(GG); // EntityIterator specialise (meme taille)
+ return Interface_GraphContent(GG); // specialized EntityIterator (same size)
}
-// CompleteResult, c est RootResult + propagation du partage (Shareds)
+// CompleteResult, it is RootResult + propagation of sharing (Shareds)
Interface_EntityIterator IFSelect_Selection::CompleteResult(const Interface_Graph& G) const
{
Interface_EntityIterator iter = RootResult(G);
- // On peut utiliser le Graphe a present
+ // We can use the Graph now
Interface_Graph GG(G);
for (iter.Start(); iter.More(); iter.Next())
{
const Handle(Standard_Transient)& ent = iter.Value();
- GG.GetFromEntity(ent, Standard_True); // et voila
+ GG.GetFromEntity(ent, Standard_True); // and there we go
}
- return Interface_GraphContent(GG); // EntityIterator specialise (meme taille)
+ return Interface_GraphContent(GG); // specialized EntityIterator (same size)
}
ClearLines();
themode = Standard_False;
if (!deja)
- { // au moins celui-la :
+ { // at least this one :
Handle(IFSelect_BasicDumper) basedumper = new IFSelect_BasicDumper;
deja = 1;
}
ClearLines();
themode = Standard_True;
if (!deja)
- { // au moins celui-la :
+ { // at least this one :
Handle(IFSelect_BasicDumper) basedumper = new IFSelect_BasicDumper;
deja = 1;
}
thelastgen = 0;
thesess = WS;
thedone = (Write(filename) == 0);
- // Close fait par Write (selon les cas)
+ // Close done by Write (depending on cases)
}
void IFSelect_SessionFile::ClearLines()
if (!lefic)
return Standard_False;
ClearLines();
- // read mode : lire les lignes
- // On charge le fichier dans "thelist"
+ // read mode : read the lines
+ // Load the file into "thelist"
Standard_Boolean header = Standard_False;
for (;;)
{
}
if (ligne[0] == '\0')
continue;
- // D abord ligne initiale ?
+ // First initial line ?
if (!header)
{
if (!RecognizeFile(ligne))
break;
header = Standard_True;
}
- ligne[200] = '\0'; // fin forcee ...
+ ligne[200] = '\0'; // forced end ...
TCollection_AsciiString onemore(ligne);
thelist.Append(onemore);
}
sout << "Lineno." << thenl << " : File Header Description Incorrect" << std::endl;
return Standard_False;
}
- // Value(3) definit la VERSION du format de fichier
+ // Value(3) defines the VERSION of the file format
return Standard_True;
}
}
// ##################################################################
-// ######## WriteSession : Ecriture du contenu ########
+// ######## WriteSession : Writing the content ########
Standard_Integer IFSelect_SessionFile::WriteSession()
{
char laligne[200];
thedone = Standard_True;
- // ... Preparation Specifique
+ // ... Specific Preparation
thenames.Clear();
Standard_Integer nbidents = thesess->MaxIdent();
thenums = new TColStd_HArray1OfInteger(0, nbidents);
thenums->SetValue(i, -1);
}
- // ... ECRITURE
+ // ... WRITING
Sprintf(laligne, "!XSTEP SESSION V1 %s", thesess->DynamicType()->Name());
WriteLine(laligne, '\n');
Sprintf(laligne, "!GENERALS");
i = idents->Value(j);
Handle(IFSelect_Selection) P = thesess->Selection(i);
NewItem(i, P);
- // .. Ecritures particulieres
- // -> Traiter les principaux sous-types : Extract,AnyList,AnyType
+ // .. Particular writings
+ // -> Handle the main sub-types : Extract,AnyList,AnyType
DeclareAndCast(IFSelect_SelectExtract, sxt, P);
if (!sxt.IsNull())
{
SendItem(sli->Upper());
SetOwn(Standard_True);
}
- // .. Ecritures specifiques selon dumpers
+ // .. Specific writings according to dumpers
WriteOwn(P);
WriteLine("", '\n');
}
WriteLine("!MODIFIERS", '\n');
for (j = 1; j <= nb; j++)
{
- // Description de base des Modifiers, donc sans Selection ni Dispatch-Rank
+ // Basic description of Modifiers, so without Selection or Dispatch-Rank
i = idents->Value(j);
Handle(IFSelect_GeneralModifier) P = thesess->GeneralModifier(i);
NewItem(i, P);
SetOwn(Standard_True);
- // .. Ecritures specifiques selon dumpers
+ // .. Specific writings according to dumpers
WriteOwn(P);
WriteLine("", '\n');
}
WriteLine("!TRANSFORMERS", '\n');
for (j = 1; j <= nb; j++)
{
- // Description des Transformers
+ // Description of Transformers
i = idents->Value(j);
Handle(IFSelect_Transformer) P = thesess->Transformer(i);
NewItem(i, P);
SetOwn(Standard_True);
- // .. Ecritures specifiques selon dumpers
+ // .. Specific writings according to dumpers
WriteOwn(P);
WriteLine("", '\n');
}
SetOwn(Standard_False);
SendItem(P->FinalSelection());
SetOwn(Standard_True);
- // .. Ecritures specifiques selon dumpers
+ // .. Specific writings according to dumpers
WriteOwn(P);
WriteLine("", '\n');
}
WriteLine("", '\n');
}
- // Pour les Modifiers, ATTENTION car il faut respecter l ORDRE effectif
- // Or il y a deux listes : Model Modifiers; File Modifiers
- // Les Modifiers eux-memes ont deja ete ecrits
- // Ici, on ecrit simplement leur utilisation dans l envoi final
+ // For Modifiers, CAUTION because we must respect the effective ORDER
+ // Now there are two lists : Model Modifiers; File Modifiers
+ // The Modifiers themselves have already been written
+ // Here, we simply write their use in the final sending
for (Standard_Integer formod = 1; formod >= 0; formod--)
{
- idents = thesess->FinalModifierIdents((formod > 0)); // donnes dans l ordre d application
+ idents = thesess->FinalModifierIdents((formod > 0)); // given in application order
nb = idents->Length();
if (nb == 0)
continue;
Handle(IFSelect_GeneralModifier) P = thesess->GeneralModifier(i);
SetOwn(Standard_False);
SendItem(P);
- // .. Parametres Generaux (les specifiques ont deja ete envoyes)
+ // .. General Parameters (the specific ones have already been sent)
SendItem(P->Selection());
SendItem(P->Dispatch());
WriteLine("", '\n');
Standard_Integer IFSelect_SessionFile::WriteEnd()
{
- WriteLine("!XSTEP END", '\n'); // sinon, cf sous-types de SessionFile ...
+ WriteLine("!XSTEP END", '\n'); // otherwise, see SessionFile sub-types ...
return 0;
}
}
// ##################################################################
-// ######## ReadSession : Lecture du contenu ########
+// ######## ReadSession : Content Reading ########
Standard_Integer IFSelect_SessionFile::ReadSession()
{
Message_Messenger::StreamBuffer sout = Message::SendInfo();
thedone = Standard_True;
- // ... Preparation Specifique
+ // ... Specific Preparation
thenums.Nullify();
thenames.Clear();
- // .. Donnees generales, controle
+ // .. General data, control
if (!ReadLine())
return 1;
if (theline.Length() != 4)
sout << "Lineno." << thenl << " : File Header Description Incorrect" << std::endl;
return 1;
}
- // Value(3) definit la VERSION du format de fichier
+ // Value(3) defines the VERSION of the file format
if (!ReadLine())
return 1;
- // .. Parametres Generaux
+ // .. General Parameters
Standard_Integer rubr = (theline.Length() == 1 && theline.Value(1).IsEqual("!GENERALS"));
while (rubr)
{
continue;
const TCollection_AsciiString& ungen = theline.Value(1);
if (ungen.Value(1) == '!')
- break; // fin des generaux
+ break; // end of generals
if (ungen.IsEqual("ErrorHandle"))
{
if (theline.Length() != 2)
}
// .. IntParams
- // deja fait if (!ReadLine()) return 1;
+ // already done if (!ReadLine()) return 1;
rubr = (theline.Length() == 1 && theline.Value(1).IsEqual("!INTEGERS"));
while (rubr)
{
AddItem(par);
}
- // .. TextParams (ligne de garde deja lue)
+ // .. TextParams (guard line already read)
rubr = (theline.Length() == 1 && theline.Value(1).IsEqual("!TEXTS"));
while (rubr)
{
sout << "Lineno." << thenl << " : A Text Parameter is badly defined" << std::endl;
continue;
}
- // Attention, un texte peut contenir des blancs ... repartir de line(thenl)
+ // Caution, a text can contain blanks ... restart from line(thenl)
TCollection_AsciiString oneline = thelist.Value(thenl);
Standard_Integer iw = 0, inc = 0;
for (Standard_Integer ic = 1; ic <= oneline.Length(); ic++)
AddItem(new TCollection_HAsciiString(oneline.ToCString()));
}
- // .. Selections (ligne de garde deja lue)
+ // .. Selections (guard line already read)
rubr = (theline.Length() == 1 && theline.Value(1).IsEqual("!SELECTIONS"));
while (rubr)
{
sout << "Lineno." << thenl << " : A Selection is badly defined" << std::endl;
continue;
}
- // .. Analyse de certains cas generaux
+ // .. Analysis of certain general cases
Handle(IFSelect_IntParam) low, up;
Standard_Integer firstown = 3;
Standard_Integer direct = 0;
}
SetLastGeneral(firstown - 1);
}
- Handle(Standard_Transient) item; // a fournir ...
+ Handle(Standard_Transient) item; // to be provided ...
ReadOwn(item);
if (item.IsNull())
continue;
continue;
}
Standard_Integer nbs = atoi(theline.Value(2).ToCString());
- // .. Differents cas reconnus
+ // .. Different recognized cases
DeclareAndCast(IFSelect_SelectExtract, sxt, sel);
if (!sxt.IsNull())
{
}
}
- // ... Modifiers en tout genre
+ // ... Modifiers of all kinds
rubr = (theline.Length() == 1 && theline.Value(1).IsEqual("!MODIFIERS"));
while (rubr)
{
sout << "Lineno." << thenl << " : A Modifier is badly defined" << std::endl;
continue;
}
- Handle(Standard_Transient) item; // a fournir ...
+ Handle(Standard_Transient) item; // to be provided ...
ReadOwn(item);
if (item.IsNull())
continue;
sout << "Lineno." << thenl << " : A Modifier has not been Recognized" << std::endl;
continue;
}
- AddItem(modif, Standard_False); // active plus tard
+ AddItem(modif, Standard_False); // active later
}
// ... Transformers
sout << "Lineno." << thenl << " : A Transformer is badly defined" << std::endl;
continue;
}
- Handle(Standard_Transient) item; // a fournir ...
+ Handle(Standard_Transient) item; // to be provided ...
ReadOwn(item);
if (item.IsNull())
continue;
sout << "Lineno." << thenl << " : A Transformer has not been Recognized" << std::endl;
continue;
}
- AddItem(trf, Standard_False); // active plus tard
+ AddItem(trf, Standard_False); // active later
}
- // ... Dispatches (ligne de garde deja lue)
+ // ... Dispatches (guard line already read)
rubr = (theline.Length() == 1 && theline.Value(1).IsEqual("!DISPATCHES"));
while (rubr)
{
}
DeclareAndCast(IFSelect_Selection, input, ItemValue(3));
SetLastGeneral(3);
- Handle(Standard_Transient) item; // a fournir ...
+ Handle(Standard_Transient) item; // to be provided ...
ReadOwn(item);
if (item.IsNull())
continue;
thesess->SetItemSelection(disp, input);
}
- // ... FileNaming (ligne de garde deja lue)
- // .. Modifiers deja lus et charges
+ // ... FileNaming (guard line already read)
+ // .. Modifiers already read and loaded
rubr = (theline.Length() == 4 && theline.Value(1).IsEqual("!FILENAMING"));
if (rubr)
{
thesess->SetFileRoot(disp, theline.Value(2).ToCString());
}
- // ... Modifiers (ligne de garde deja lue)
- // ... Attention, deux listes (MODELMODIFIERS et FILEMODIFIERS)
+ // ... Modifiers (guard line already read)
+ // ... Caution, two lists (MODELMODIFIERS and FILEMODIFIERS)
for (Standard_Integer formod = 1; formod >= 0; formod--)
{
rubr = (theline.Length() == 1
}
}
- // ... Conclusion : voir ReadEnd (separe)
+ // ... Conclusion: see ReadEnd (separate)
return 0;
}
return Standard_False;
thenl++;
Standard_CString ligne = thelist.Value(thenl).ToCString();
- // Lignes vides ?
+ // Empty lines?
if (ligne[0] == '\0')
return ReadLine();
SplitLine(ligne);
return Standard_False;
const TCollection_AsciiString& type = theline.Value(2);
if (thelastgen < 2)
- thelastgen = 2; // mini : ident+type d abord
+ thelastgen = 2; // mini : ident+type first
// thelastgen = theline.Length();
// for (Standard_Integer i = theline.Length(); i > 0; i --) {
// if (theline.Value(i).Value(1) == ':') thelastgen = i - 1;
return thesess;
}
-// ######## Actions Unitaires d ECRITURE ########
+// ######## Unit WRITING Actions ########
void IFSelect_SessionFile::NewItem(const Standard_Integer ident,
const Handle(Standard_Transient)& par)
WriteLine(laligne);
}
-// ######## Actions Unitaires de LECTURE ########
+// ######## Unit READING Actions ########
void IFSelect_SessionFile::SetLastGeneral(const Standard_Integer lastgen)
{
return thesess->Item(id);
}
-void IFSelect_SessionFile::Destroy() {} // agit si File non ferme, sinon ne fait rien
+void IFSelect_SessionFile::Destroy() {} // acts if File not closed, otherwise does nothing
// #define DEBUG_TRACE
-// Nb Maxi de words : cf thewords et method SetCommandLine
+// Max Nb of words : cf thewords and method SetCommandLine
IFSelect_SessionPilot::IFSelect_SessionPilot(const Standard_CString prompt)
: theprompt(prompt),
{
Standard_Integer lc = command.Length();
if (lc > 200)
- std::cout << " Commande TRES LONGUE : " << lc << " caracteres :" << std::endl
+ std::cout << " VERY LONG Command : " << lc << " characters :" << std::endl
<< command.ToCString() << std::endl;
thecommand = command;
if (thecommand.Value(lc) <= ' ')
thewords(thenbwords).AssignCat(unarg);
#ifdef DEBUG_TRACE
std::cout << "thewords(" << thenbwords << ")=" << unarg << std::endl
- << " .. Fin avec thenbwords=" << thenbwords + 1 << std::endl;
+ << " .. End with thenbwords=" << thenbwords + 1 << std::endl;
#endif
thenbwords++;
}
/*
- aligner sur MAXWORDS
+ align on MAXWORDS
char l0[80],l1[80],l2[80],l3[80],l4[80],l5[80],l6[80],l7[80],l8[80],l9[80];
char m0[80],m1[80],m2[80],m3[80],m4[80],m5[80],m6[80],m7[80],m8[80],m9[80];
thenbwords = sscanf
}
thewords(thenbwords).Clear();
thenbwords--;
- // Et refaire thecommand. Si num = 0, on supprime le debut (facile)
+ // And redo thecommand. If num = 0, we remove the beginning (easy)
if (num == 0)
{
thecommand.Remove(1, thewordeb(1));
}
else
{
- // Sinon, reconstituer, a partir des words
+ // Otherwise, reconstitute, from the words
thecommand.Clear();
for (i = 0; i < thenbwords; i++)
{
}
// #######################################################################
-// ######## CONTROLE D EXECUTION
+// ######## EXECUTION CONTROL
IFSelect_ReturnStatus IFSelect_SessionPilot::ReadScript(const Standard_CString file)
{
}
if (ligne[0] == '\0')
continue;
- // On interprete cette commande
+ // We interpret this command
TCollection_AsciiString command(ligne);
if (lefic)
- std::cout << file << ":" << command; // le return est dans la ligne ... !
+ std::cout << file << ":" << command; // the return is in the line ... !
stat = Execute(command);
if (stat == IFSelect_RetStop)
break;
std::cout << "End of Reading Script File " << file << std::endl;
if (stat == IFSelect_RetError || stat == IFSelect_RetFail)
return stat;
- return IFSelect_RetVoid; // fin fichier : depiler
+ return IFSelect_RetVoid; // end file : unstack
}
-// On boucle sur la lecture jusqu a une commande de fin ou un EOF
+// We loop on reading until an end command or an EOF
IFSelect_ReturnStatus IFSelect_SessionPilot::Perform()
{
if (thenbwords == 0)
return stat;
if (thewords(0).Value(1) == '#')
- return stat; // commentaire
+ return stat; // comment
theobjrec.Nullify();
- // Est-ce un nom ?
+ // Is it a name ?
- // Commande pour un Acteur
+ // Command for an Actor
Handle(IFSelect_Activator) actor;
Standard_Integer num;
if (IFSelect_Activator::Select(thewords(0).ToCString(), num, actor))
{
stat = actor->Do(num, this);
- // Prise en compte des commandes a resultat
- // Ici, resultat non nomme; Resultat nomme par commande x (plus loin)
+ // Taking into account commands with result
+ // Here, unnamed result; Result named by command x (further)
if (!theobjrec.IsNull())
{
- thesession->RemoveItem(theobjrec); //// depannage ?
+ thesession->RemoveItem(theobjrec); //// troubleshooting ?
Standard_Integer addws = thesession->AddItem(theobjrec);
if (addws == 0)
{
return stat;
}
std::cout << " Command : " << thewords(0) << " unknown" << std::endl;
- return IFSelect_RetError; // pas reconnu donc incorrect
+ return IFSelect_RetError; // not recognized therefore incorrect
}
IFSelect_ReturnStatus IFSelect_SessionPilot::ExecuteAlias(const TCollection_AsciiString& alias)
counter->AddModel(thesession->Model());
else
{
- // on demande un givelist
+ // we request a givelist
Handle(TColStd_HSequenceOfTransient) list = thesession->GiveList(CommandPart(numword));
if (list.IsNull())
{
IFSelect_ReturnStatus IFSelect_SessionPilot::Do(const Standard_Integer number,
const Handle(IFSelect_SessionPilot)& session)
{
- // Commandes Propres : x, exit, undo, redo, ?, help
+ // Own Commands : x, exit, undo, redo, ?, help
IFSelect_ReturnStatus stat = IFSelect_RetVoid;
Standard_Integer argc = NbWords();
const Standard_CString arg1 = Word(1).ToCString();
case -1: // **** HELP-XSNEW
modhelp = 1;
std::cout << " -- Commands candidate for xsnew --" << std::endl;
- // HELP : soit complet (par defaut) soit limite a xsnew
+ // HELP : either complete (by default) or limited to xsnew
Standard_FALLTHROUGH
case 0: { // **** HELP
Handle(TColStd_HSequenceOfAsciiString) list;
- // Help complet : on donne la liste des commandes, sans plus (deja pas mal)
+ // Complete Help : we give the list of commands, nothing more (already not bad)
if (thenbwords <= 1)
{
list = IFSelect_Activator::Commands(modhelp);
Standard_Integer nbcom = 0;
Standard_Integer nb = list->Length();
- std::cout << " -- Liste des Commands Disponibles --" << std::endl;
+ std::cout << " -- List of Available Commands --" << std::endl;
for (Standard_Integer i = 1; i <= nb; i++)
{
const TCollection_AsciiString& uncom = list->Value(i);
}
if (nbcom > 0)
std::cout << std::endl;
- std::cout << "\nhelp * liste toutes les commandes avec un help sur chacune\n"
- << "help <com> liste la ou les commande debutant par <com>"
- << " avec un help sur chacune" << std::endl;
+ std::cout << "\nhelp * lists all commands with help on each\n"
+ << "help <com> lists the command(s) starting with <com>"
+ << " with help on each" << std::endl;
- // Un Help particulier
+ // A particular Help
}
else
{
return IFSelect_RetVoid;
}
case 1:
- return IFSelect_RetStop; // **** Fin de session
+ return IFSelect_RetStop; // **** End of session
case 2: { // **** HELP
return Do(0, this);
}
case 3: { // **** COMMAND
if (argc < 2)
{
- std::cout << "Donner une option :\n"
- << "a : analyse une ligne r : toggle record mode\n"
- << "l : list recorded c : clear f nom : sauver dans fichier de nom"
- << std::endl;
+ std::cout << "Give an option :\n"
+ << "a : analyze a line r : toggle record mode\n"
+ << "l : list recorded c : clear f name : save in file of name" << std::endl;
return IFSelect_RetVoid;
}
switch (arg1[0])
case 'f': {
if (argc < 3)
{
- std::cout << "Donner nom de fichier" << std::endl;
+ std::cout << "Give file name" << std::endl;
return IFSelect_RetError;
}
Standard_Integer nb = session->NbCommands();
if (nb == 0)
{
- std::cout << "Aucune commande enregistree" << std::endl;
+ std::cout << "No command recorded" << std::endl;
break;
}
- std::cout << "Nb Commandes enregistrees : " << nb << std::endl;
+ std::cout << "Nb Recorded Commands : " << nb << std::endl;
std::ofstream fout(Word(2).ToCString(), std::ios::out);
for (Standard_Integer i = 1; i <= nb; i++)
fout << session->Command(i) << std::endl;
}
case 'l': { // **** command list
if (session->RecordMode())
- std::cout << " -- Record Mode Actif" << std::endl;
+ std::cout << " -- Record Mode Active" << std::endl;
else
- std::cout << " -- Record Mode Inactif" << std::endl;
+ std::cout << " -- Record Mode Inactive" << std::endl;
Standard_Integer nb = session->NbCommands();
- std::cout << "Nb Commandes enregistrees : " << nb << " :" << std::endl;
+ std::cout << "Nb Recorded Commands : " << nb << " :" << std::endl;
for (Standard_Integer i = 1; i <= nb; i++)
{
std::cout << " " << i << " " << session->Command(i) << std::endl;
case 'r': { // **** command record
Standard_Boolean mode = session->RecordMode();
if (mode)
- std::cout << " -- Record Mode a present Inactif" << std::endl;
+ std::cout << " -- Record Mode now Inactive" << std::endl;
else
- std::cout << " -- Record Mode a present Actif" << std::endl;
+ std::cout << " -- Record Mode now Active" << std::endl;
session->SetRecordMode(!mode);
break;
}
default:
- std::cout << "Option de controle de commande non comprise" << std::endl;
+ std::cout << "Command control option not understood" << std::endl;
}
return IFSelect_RetVoid;
}
case 4: { // **** FILE
if (argc < 2)
{
- std::cout << "Donner nom de fichier" << std::endl;
+ std::cout << "Give file name" << std::endl;
return IFSelect_RetError;
}
return session->ReadScript(TCollection_AsciiString(session->Word(1)).ToCString());
- // On recopie la string parce que Word(1) change tout le temps !
+ // We copy the string because Word(1) changes all the time !
}
case 5: { // **** XSTEP
if (argc < 2)
{
- std::cout << "xstep : prefixe neutre pour toute commande xstep-draw" << std::endl
- << "xstep command args equivaut a command args" << std::endl;
+ std::cout << "xstep : neutral prefix for any xstep-draw command" << std::endl
+ << "xstep command args equivalent to command args" << std::endl;
return Do(2, this);
}
else
case 6: { // **** XSNEW(variable)
if (argc < 3)
{
- std::cout << "xsnew nomvar command [args] creates an item" << std::endl
- << " nomvar : name of item (must be a new name) in the session" << std::endl;
+ std::cout << "xsnew varname command [args] creates an item" << std::endl
+ << " varname : name of item (must be a new name) in the session" << std::endl;
return Do(-1, this);
}
else
theobjrec.Nullify();
TCollection_AsciiString name = Word(1);
- // Le nom ne doit pas etre deja pris !
+ // The name must not be already taken !
if (thesession.IsNull())
{
std::cout << "Command with a Name and no Session defined !" << std::endl;
RemoveWord(0);
RemoveWord(0);
- // Commande pour un Acteur
+ // Command for an Actor
Handle(IFSelect_Activator) actor;
Standard_Integer num;
if (IFSelect_Activator::Select(thewords(0).ToCString(), num, actor))
{
theobjrec.Nullify();
stat = actor->Do(num, this);
- // Prise en compte des commandes a resultat
+ // Taking into account commands with result
if (!theobjrec.IsNull())
{
- thesession->RemoveItem(theobjrec); //// depannage ?
+ thesession->RemoveItem(theobjrec); //// troubleshooting ?
Standard_Integer addws = thesession->AddNamedItem(name.ToCString(), theobjrec);
theobjrec.Nullify();
if (addws == 0)
return stat;
}
std::cout << " Command : " << thewords(0) << " unknown" << std::endl;
- return IFSelect_RetError; // pas reconnu donc incorrect
+ return IFSelect_RetError; // not recognized therefore incorrect
}
}
default:
switch (number)
{
case 1:
- return "exit ou x : Fin de session";
+ return "exit or x : End of session";
case 2:
- return "Liste les commandes. ? <titre> : commandes debutant par <titre>";
+ return "Lists the commands. ? <title> : commands starting with <title>";
case 3:
- return "controle de commande. command tout court pour help complet";
+ return "command control. command alone for complete help";
case 4:
- return "lit les commandes depuis un fichier";
+ return "reads commands from a file";
case 5:
- return "prefixe neutre pour xstep-draw";
+ return "neutral prefix for xstep-draw";
case 6:
- return "creation item : donner nom_item puis commande args";
+ return "item creation : give item_name then command args";
default:
return "";
}
}
// #######################################################################
-// #### DISPATCHES (ENVOI DES FICHIERS) ####
+// #### DISPATCHES (FILE SENDING) ####
Standard_Integer IFSelect_ShareOut::NbDispatches() const
{
return Standard_True;
}
-// ChangeModifierRank revient a une permutation circulaire :
-// before est mis en after, ceux qui sont entre tournent
+// ChangeModifierRank amounts to a circular permutation :
+// before is put in after, those that are between rotate
Standard_Boolean IFSelect_ShareOut::ChangeModifierRank(const Standard_Boolean formodel,
const Standard_Integer before,
const Standard_Integer after)
}
// #######################################################################
-// #### NOMINATION DES FICHIERS ####
-// Rq : thenbdefs s applique tant que l on ne change pas les termes principaux
+// #### FILE NAMING ####
+// Note : thenbdefs applies as long as we don't change the main terms
Standard_Boolean IFSelect_ShareOut::SetRootName(const Standard_Integer num,
const Handle(TCollection_HAsciiString)& name)
thenbdefs++;
num = thenbdefs;
npac = 0;
- sufnum = Standard_True; // numeroter sur noms par defaut, des le 1er sans 0
+ sufnum = Standard_True; // number on default names, from the 1st without 0
}
TCollection_AsciiString res;
// Suffixe numerique
if (sufnum)
- { // sinon, pas de suffixe numerique
- // Nom du PacketSuffix : _ suivi du numero <num>
- // Si nbpack non nul, alors on a un majorant et on peut preceder de zeros
- // Ex.: nbpack = 50 (donc 2 chiffres), num = 3, cela donnera _03
- // idnum pas utilise : cette methode peut etre redefinie et utiliser idnum ...
- // Si nbpack = 0 ou 1, num = 1 pas de suffixe, sinon suffixe "_num" tel quel
- // MODIF du 3-NOV-1995 -> pour eviter toute confusion, num = 1 donne aussi _1
+ { // otherwise, no numeric suffix
+ // PacketSuffix name : _ followed by number <num>
+ // If nbpack non-zero, then we have an upper bound and we can precede with zeros
+ // Ex.: nbpack = 50 (so 2 digits), num = 3, this will give _03
+ // idnum not used : this method can be redefined and use idnum ...
+ // If nbpack = 0 or 1, num = 1 no suffix, otherwise suffix "_num" as is
+ // MODIF of 3-NOV-1995 -> to avoid any confusion, num = 1 also gives _1
Standard_Integer nbch = 0;
char format[30], suffixe[30];
format[1] = ' ';
void IFSelect_ShareOutResult::Evaluate()
{
if (theeval)
- return; // deja fait. si pas OK, faire Reset avant
+ return; // already done. if not OK, do Reset before
Prepare();
theeval = Standard_True;
}
if (iter.NbEntities() == 0)
continue;
thedispres.AddPart();
- thedispres.GetFromIter(iter); // on enregistre ce paquet
+ thedispres.GetFromIter(iter); // we register this packet
A.ResetData();
A.GetFromIter(iter);
- thedisplist.Append(i); // n0 du dispatch producteur
+ thedisplist.Append(i); // n0 of producer dispatch
}
}
thedispnum = thepacknum = 1;
- thepackdisp = 1; // calcul sur 1er Dispatch
+ thepackdisp = 1; // calculation on 1st Dispatch
thenbindisp = 0;
for (i = thepacknum; i <= thedisplist.Length(); i++)
{
IFSelect_SignCategory::IFSelect_SignCategory()
: IFSelect_Signature("Category")
{
- Interface_Category::Init(); // si pas deja fait
+ Interface_Category::Init(); // if not already done
Standard_Integer i, nb = Interface_Category::NbCategories();
for (i = 1; i <= nb; i++)
AddCase(Interface_Category::Name(i));
char nulsign[2];
nulsign[0] = '\0';
if (ent.IsNull() || thematcher.IsNull())
- Add(ent, nulsign); // pour compter les Nuls
+ Add(ent, nulsign); // to count the Nulls
else
Add(ent, thematcher->Value(ent, model));
}
if (model.IsNull())
return;
Standard_Integer nb = model->NbEntities();
- // Si on part de vide, on sait que chque entite est unique dans le modele
+ // If we start from empty, we know that each entity is unique in the model
Standard_Boolean mapstat = themapstat;
if (themap.Extent() == 0)
themapstat = Standard_False;
IMPLEMENT_STANDARD_RTTIEXT(IFSelect_SignMultiple, IFSelect_Signature)
-static TCollection_AsciiString theval; // temporaire pour construire Value
+static TCollection_AsciiString theval; // temporary to build Value
IFSelect_SignMultiple::IFSelect_SignMultiple(const Standard_CString name)
: IFSelect_Signature(name)
{
if (val[i] == cardeb)
{
- // un candidat
+ // a candidate
Standard_Boolean res = Standard_True;
for (j = 1; j < ln; j++)
{
if (nbent > maxent)
maxent = nbent;
const TCollection_AsciiString& name = iter.Key();
- // if (!name.IsIntegerValue()) continue; pas bien fiable
+ // if (!name.IsIntegerValue()) continue; not very reliable
Standard_Integer ic, nc = name.Length();
Standard_Boolean iaint = Standard_True;
for (ic = 1; ic <= nc; ic++)
if (unmod->MayChangeGraph())
chg = Standard_True;
- // Appliquer ce Modifier (nb : le Dispatch, on s en moque)
- // D abord, la Selection
+ // Apply this Modifier (nb : the Dispatch, we don't care about it)
+ // First, the Selection
IFSelect_ContextModif ctx(G, TC);
- // Ensuite, la Selection
- // S il y en a une ici, elle a priorite. Sinon, chaque Modifier a la sienne
+ // Then, the Selection
+ // If there is one here, it has priority. Otherwise, each Modifier has its own
Handle(IFSelect_Selection) sel = thesel;
if (sel.IsNull())
continue;
unmod->Perform(ctx, newmod, protocol, TC);
- // Report des Erreurs
- // Faut-il les enregistrer dans newmod ? bonne question
+ // Error Reporting
+ // Should we record them in newmod ? good question
Interface_CheckIterator checklist = ctx.CheckList();
if (!checklist.IsEmpty(Standard_False))
{
}
}
- // Modele pas modifie et Graphe pas modifie : le dire
+ // Model not modified and Graph not modified: say it
if (newmod == original && !chg)
newmod.Nullify();
return res;
Standard_Boolean IFSelect_Transformer::ChangeProtocol(Handle(Interface_Protocol)&) const
{
- return Standard_False; // par defaut, protocole inchange
+ return Standard_False; // by default, protocol unchanged
}
#define Flag_Incorrect 2
// (Bit Map n0 2)
-static Standard_Boolean errhand; // pb : un seul a la fois, mais ca va si vite
+static Standard_Boolean errhand; // pb : only one at a time, but it goes so fast
static TCollection_AsciiString bufstr;
// #################################################################
{
theshareout = shareout;
thecopier->SetShareOut(theshareout);
- // ... faudrait ajouter les Params, Dispatches, etc...
+ // ... should add Params, Dispatches, etc...
}
//=================================================================================================
myModel->SetGTool(thegtool);
thegraph.Nullify();
- ComputeGraph(); // fait qqchose si Protocol present. Sinon, ne fait rien
- ClearData(3); // RAZ CheckList, a refaire
+ ComputeGraph(); // does something if Protocol present. Otherwise, does nothing
+ ClearData(3); // Reset CheckList, to be redone
thecheckrun.Clear();
- // MISE A JOUR des SelectPointed C-A-D on efface leur contenu
+ // UPDATE of SelectPointed I.E. clear their content
if (clearpointed)
ClearData(4);
ClearData(0);
catch (Standard_Failure const& anException)
{
Message_Messenger::StreamBuffer sout = Message::SendInfo();
- sout << " **** Interruption ReadFile par Exception : ****\n";
+ sout << " **** ReadFile Interruption by Exception : ****\n";
sout << anException.GetMessageString();
sout << "\n Abandon" << std::endl;
status = IFSelect_RetFail;
catch (Standard_Failure const& anException)
{
Message_Messenger::StreamBuffer sout = Message::SendInfo();
- sout << " **** Interruption ReadFile par Exception : ****\n";
+ sout << " **** ReadFile Interruption by Exception : ****\n";
sout << anException.GetMessageString();
sout << "\n Abandon" << std::endl;
status = IFSelect_RetFail;
Handle(Standard_Transient) IFSelect_WorkSession::StartingEntity(const Standard_Integer num) const
{
- Handle(Standard_Transient) res; // Null par defaut
+ Handle(Standard_Transient) res; // Null by default
if (myModel.IsNull())
return res;
if (num < 1 || num > myModel->NbEntities())
{
Standard_Integer i, cnt = 0, num = atoi(val);
if (num > 0 || myModel.IsNull())
- return num; // un n0 direct : gagne !
- // Sinon, on considere que c est un label; a traiter en CaseNonSensitive ...
+ return num; // a direct n0 : won !
+ // Otherwise, consider it as a label; to be treated in CaseNonSensitive ...
if (num > myModel->NbEntities())
{
num = 0;
break;
}
case 4: {
- // MISE A JOUR des SelectPointed C-A-D on efface leur contenu
- // AINSI que des editeurs (en fait, les EditForm)
- // Des compteurs C-A-D on efface leur contenu (a reevaluer)
+ // UPDATE of SelectPointed I.E. clear their content
+ // AS WELL AS editors (in fact, the EditForm)
+ // Counters I.E. we erase their content (to reevaluate)
Handle(TColStd_HSequenceOfInteger) list = ItemIdents(STANDARD_TYPE(IFSelect_SelectPointed));
Standard_Integer nb = list->Length();
Standard_Integer i; // svv #1
}
if (myModel->NbEntities() == 0)
return Standard_False;
- // Il faut calculer le graphe pour de bon
+ // We must calculate the graph for good
thegraph = new Interface_HGraph(myModel, themodelstat);
Standard_Integer nb = myModel->NbEntities();
if (themodelstat)
thecheckdone = Standard_True;
if (themodelstat)
{
- // Calcul des categories, a present memorisees dans le modele
+ // Calculation of categories, now memorized in the model
Interface_Category categ(thegtool);
Interface_ShareTool sht(thegraph);
Standard_Integer i = 1;
myModel->FillSemanticChecks(checklist, Standard_False);
if (themodelstat)
{
- // Et on met a jour le Graphe (BitMap) ! Flag Incorrect (STX + SEM)
+ // And we update the Graph (BitMap) ! Flag Incorrect (STX + SEM)
Interface_BitMap& BM = CG.CBitMap();
BM.Init(Standard_False, Flag_Incorrect);
Standard_Integer num, nb = CG.Size();
}
// #####################################################################
-// .... LES VARIABLES ....
+// .... THE VARIABLES ....
//=================================================================================================
if (name[0] == '\0')
return res;
if (name[0] == '#')
- { // #nnn : pas un nom mais un n0 id.
+ { // #nnn : not a name but an id number
Standard_Integer id = atoi(&name[1]);
return Item(id);
}
if (name[0] == '\0')
return 0;
if (name[0] == '#')
- { // #nnn : pas un nom mais un n0 id.
+ { // #nnn : not a name but an id number
Standard_Integer id = atoi(&name[1]);
return id;
}
else
id = theitems.Add(item, item);
- // Cas particuliers : Dispatch,Modifier
+ // Special cases : Dispatch,Modifier
if (active)
SetActive(item, Standard_True);
return id;
return 0;
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
+ // #nnn : not a name but a number. !... : reserved (forbidden for a name)
+ // name already taken : we overwrite the old value
if (name[0] != '\0')
thenames.Bind(name, item);
att = item;
if (name[0] != '\0')
{
- // if (!att->IsKind(STANDARD_TYPE(TCollection_HAsciiString))) ecrasement admis !
+ // if (!att->IsKind(STANDARD_TYPE(TCollection_HAsciiString))) overwriting allowed !
att = new TCollection_HAsciiString(name);
}
}
else
id = theitems.Add(item, item);
- // Cas particuliers : Dispatch,Modifier
+ // Special cases : Dispatch,Modifier
if (active)
SetActive(item, Standard_True);
return id;
if (num <= theshareout->LastRun())
return Standard_False;
theshareout->RemoveDispatch(num);
- SetFileRoot(disp, ""); // si onlynamed : nettoie aussi ShareOut
+ SetFileRoot(disp, ""); // if onlynamed : also cleans ShareOut
return Standard_True;
}
}
if (item.IsNull())
return Standard_False;
if (!RemoveItem(item))
- return Standard_False; // qui se charge de tout
+ return Standard_False; // which takes care of everything
return Standard_True;
}
Handle(Standard_Transient) item = NamedItem(name);
if (item.IsNull())
return Standard_False;
- theitems.Add(item, item); // reste mais sans nom
+ theitems.Add(item, item); // remains but without name
return thenames.UnBind(name);
}
return Standard_False;
Handle(Standard_Transient)& att = theitems.ChangeFromIndex(id);
if (att.IsNull())
- return Standard_False; // deja annulle
+ return Standard_False; // already canceled
- // Cas particuliers : Dispatch,Modifier
+ // Special cases : Dispatch,Modifier
theshareout->RemoveItem(item);
- // Marquer "Removed" dans la Map (on ne peut pas la vider)
+ // Mark "Removed" in the Map (we cannot empty it)
if (att->IsKind(STANDARD_TYPE(TCollection_HAsciiString)))
{
if (!thenames.UnBind(GetCasted(TCollection_HAsciiString, att)->ToCString()))
return list;
}
-// .. Recherche par label : recherche en liste(noms) ou iterative
+// .. Search by label : search in list(names) or iterative
//=================================================================================================
return i;
break;
default:
- break; // break du switch
+ break; // break from switch
}
}
- return 0; // ici : pas trouve
+ return 0; // here : not found
}
// #################################################################
-// .... Parametres (Int et Text) ....
+// .... Parameters (Int and Text) ....
//=================================================================================================
try
{
OCC_CATCH_SIGNALS
- iter = EvalSelection(sel); // appel normal (donc, code pas duplique)
+ iter = EvalSelection(sel); // normal call (therefore, code not duplicated)
}
catch (Standard_Failure const& anException)
{
Message_Messenger::StreamBuffer sout = Message::SendInfo();
- sout << " **** Interruption EvalSelection par Exception : ****\n";
+ sout << " **** EvalSelection Interrupted by Exception : ****\n";
sout << anException.GetMessageString();
sout << "\n Abandon" << std::endl;
}
catch (Standard_Failure const& anException)
{
Message_Messenger::StreamBuffer sout = Message::SendInfo();
- sout << " **** Interruption SelectionResult par Exception : ****\n";
+ sout << " **** SelectionResult Interrupted by Exception : ****\n";
sout << anException.GetMessageString();
sout << "\n Abandon" << std::endl;
}
if (deduct.IsNull())
return SelectionResult(sel);
- // On va chercher la derniere deduction de la chaine des inputs
+ // We will search for the last deduction in the input chain
Handle(IFSelect_Selection) ssel, newinput;
ssel = sel;
Standard_Integer i, nb = MaxIdent();
ssel = newinput;
}
- // on y est (enfin, on devrait)
- // ssel est la derniere selection auscultee, deduct son downcast
- // input son Input (nulle si sel pas une deduction)
+ // we're there (finally, we should be)
+ // ssel is the last selection examined, deduct its downcast
+ // input its Input (null if sel is not a deduction)
deduct = GetCasted(IFSelect_SelectDeduct, ssel);
deduct->Alternate()->SetList(list);
- // On execute puis on nettoie
+ // We execute then we clean
Handle(TColStd_HSequenceOfTransient) res = SelectionResult(sel);
//// deduct->SetInput (newinput);
return res;
return disp->FinalSelection();
if (ItemIdent(modif) > 0)
return modif->Selection();
- return sel; // Nul ou inconnu -> Null
+ return sel; // Null or unknown -> Null
}
// ######################################################################
const Standard_Boolean formodel) const
{
// return ItemIdents(STANDARD_TYPE(IFSelect_Modifier));
- // On donne la liste dans l ordre du ModelCopier, qui fait foi
+ // We give the list in ModelCopier order, which is authoritative
Handle(TColStd_HSequenceOfInteger) list = new TColStd_HSequenceOfInteger();
Standard_Integer nbm = theshareout->NbModifiers(formodel);
for (Standard_Integer i = 1; i <= nbm; i++)
if (newmod.IsNull())
return (res ? 1 : -1);
- // MISE A JOUR des SelectPointed
+ // UPDATE of SelectPointed
Handle(TColStd_HSequenceOfInteger) list = ItemIdents(STANDARD_TYPE(IFSelect_SelectPointed));
Standard_Integer nb = list->Length();
for (Standard_Integer i = 1; i <= nb; i++)
return stf;
}
-// Ceci est une action directe : pourrait etre fait par un Transformer ...
+// This is a direct action: could be done by a Transformer ...
//=================================================================================================
Standard_Boolean IFSelect_WorkSession::SetModelContent(const Handle(IFSelect_Selection)& sel,
TC.FillModel(newmod);
if (newmod->NbEntities() == 0)
return Standard_False;
- // Mettre a jour (ne pas oublier SelectPointed)
+ // Update (don't forget SelectPointed)
theoldel = myModel;
SetModel(newmod, Standard_False);
- // MISE A JOUR des SelectPointed
+ // UPDATE of SelectPointed
Handle(TColStd_HSequenceOfInteger) pts = ItemIdents(STANDARD_TYPE(IFSelect_SelectPointed));
nb = pts->Length();
for (i = 1; i <= nb; i++)
Standard_CString IFSelect_WorkSession::GiveFileComplete(const Standard_CString file) const
{
- // ajouter si besoin : Prefix; Extension
+ // add if needed: Prefix; Extension
bufstr.Clear();
bufstr.AssignCat(file);
Standard_Integer i, j = 0, nb = bufstr.Length();
try
{
OCC_CATCH_SIGNALS
- EvaluateFile(); // appel normal (donc, code pas duplique)
+ EvaluateFile(); // normal call (therefore, code not duplicated)
}
catch (Standard_Failure const& anException)
{
Message_Messenger::StreamBuffer sout = Message::SendInfo();
- sout << " **** Interruption EvaluateFile par Exception : ****\n";
+ sout << " **** EvaluateFile Interrupted by Exception : ****\n";
sout << anException.GetMessageString();
sout << "\n Abandon" << std::endl;
checks.CCheck(0)->AddFail("Exception Raised -> Abandon");
}
// #########################################################################
-// .... Action de Transfert proprement dite : la grande affaire ! ....
+// .... Transfer Action properly speaking: the big deal! ....
//=================================================================================================
try
{
OCC_CATCH_SIGNALS
- return SendSplit(); // appel normal (donc, code pas duplique)
+ return SendSplit(); // normal call (therefore, code not duplicated)
}
catch (Standard_Failure const& anException)
{
Message_Messenger::StreamBuffer sout = Message::SendInfo();
- sout << " **** Interruption SendSplit par Exception : ****\n";
+ sout << " **** SendSplit Interrupted by Exception : ****\n";
sout << anException.GetMessageString();
sout << "\n Abandon" << std::endl;
checks.CCheck(0)->AddFail("Exception Raised -> Abandon");
Interface_EntityIterator iter = packs.Entities();
if (iter.NbEntities() == 0)
continue;
- // Ecrire une liste d entites
+ // Write a list of entities
Handle(IFSelect_SelectPointed) sp = new IFSelect_SelectPointed;
sp->SetList(iter.Content());
nf++;
{
theoldel = myModel;
SetModel(newmod, Standard_False);
- // MISE A JOUR des SelectPointed
+ // UPDATE of SelectPointed
Handle(TColStd_HSequenceOfInteger) list = ItemIdents(STANDARD_TYPE(IFSelect_SelectPointed));
Standard_Integer nb = list->Length();
for (Standard_Integer i = 1; i <= nb; i++)
catch (Standard_Failure const& anException)
{
Message_Messenger::StreamBuffer sout = Message::SendInfo();
- sout << " **** Interruption SendAll par Exception : ****\n";
+ sout << " **** SendAll Interrupted by Exception : ****\n";
sout << anException.GetMessageString();
sout << "\n Abandon" << std::endl;
errhand = theerrhand;
{
OCC_CATCH_SIGNALS
ComputeGraph(computegraph);
- return SendSelected(filename, sel); // appel normal
+ return SendSelected(filename, sel); // normal call
}
catch (Standard_Failure const& anException)
{
Message_Messenger::StreamBuffer sout = Message::SendInfo();
- sout << " **** Interruption SendSelected par Exception : ****\n";
+ sout << " **** SendSelected Interrupted by Exception : ****\n";
sout << anException.GetMessageString();
sout << "\n Abandon" << std::endl;
checks.CCheck(0)->AddFail("Exception Raised -> Abandon");
}
// ################################################################
-// .... Actions particulieres sur les Selections ....
+// .... Specific Actions on Selections ....
//=================================================================================================
}
// ###########################################################################
-// .... Analyse d un CheckIterator par rapport a un graphe ....
+// .... Analysis of a CheckIterator in relation to a graph ....
//=================================================================================================
if (i > 1)
list.SetNumber(num); // because recursive call + depth first
Standard_Integer n = list.Value(i);
- // y a t il lieu de propager ?
+ // is there a need to propagate?
// 1 W/place 2 F/place 3 Wprop 4Wprop+W/place 5Wprop+F/place
// 6 Fprop 7 Fprop+W/place 8 Fprop+F/place
char val = ana.Value(n);
else if (ach->HasWarnings())
thecheckana.SetValue(num, '1');
}
- // analyse selon le graphe ... codes : blc = rien
+ // analysis according to the graph ... codes : blc = nothing
// 1 W/place 2 F/place 3 Wprop 4Wprop+W/place 5Wprop+F/place
// 6 Fprop 7 Fprop+W/place 8 Fprop+F/place
Interface_IntList list; // = thegraph->Graph().SharingNums(0);
- // deux passes : d abord Warning, puis Fail
+ // two passes : first Warning, then Fail
for (i = 1; i <= nb; i++)
{
char val = thecheckana.Value(i);
return -1;
if (ndad == nson)
return 0;
- // on va calculer : pour chaque pere immediat, de <son>, status avec <dad> + 1
- // nb : pas protege contre les boucles ...
+ // we will calculate: for each immediate parent, of <son>, status with <dad> + 1
+ // nb: not protected against loops ...
Handle(TColStd_HSequenceOfTransient) list = thegraph->Graph().Sharings(entson).Content();
if (list.IsNull())
return -1;
}
// ###########################################################################
-// .... Dumps et Evaluations, pas faciles a passer en arguments ....
+// .... Dumps and Evaluations, not easy to pass as arguments ....
// #### #### #### #### #### #### #### #### ####
// .... DumpShare ....
editor->AddValue(val);
}
AddNamedItem("xst-params-edit", editor);
- // Les EditForm
+ // The EditForm
Handle(IFSelect_EditForm) paramsall = editor->Form(Standard_False);
AddNamedItem("xst-params-all", paramsall);
- // On attaque les EditForms partielles
+ // We tackle the partial EditForms
TColStd_SequenceOfInteger listgen, listload, listsend, listsplit, listread, listwrite;
for (i = uselist.Lower(); i <= uselist.Upper(); i++)
{
}
}
- // LISTER LES STATICS
- // Passer par les ParamEditor ...
+ // LIST THE STATICS
+ // Go through the ParamEditor ...
// Fin
if (use > 0)
}
Handle(Standard_Transient) item = NamedItem(nomsel);
- // Parentheses ? essayer Signature (plus tard : Selection parametree)
- // NB : on compte les niveaux de parentheses (imbrications repercutees)
+ // Parentheses? try Signature (later: parameterized Selection)
+ // NB: we count the levels of parentheses (reflected nesting)
if (np > 0 && nf > 0)
{
Handle(IFSelect_SelectSignature) selsign;
return sel;
}
- selsign->SetInput(new IFSelect_SelectModelEntities); // par defaut
+ selsign->SetInput(new IFSelect_SelectModelEntities); // by default
sel = selsign;
}
Handle(TColStd_HSequenceOfTransient) IFSelect_WorkSession::GiveList(
const Handle(Standard_Transient)& obj) const
{
- // Deja une liste
+ // Already a list
DeclareAndCast(TColStd_HSequenceOfTransient, list, obj);
if (!list.IsNull())
return list;
- // Rien du tout : retourne rien du tout
+ // Nothing at all: returns nothing at all
if (obj.IsNull())
return list;
- // Une selection : son resultat (standard)
+ // A selection: its result (standard)
DeclareAndCast(IFSelect_Selection, sel, obj);
if (!sel.IsNull())
{
return iter.Content();
}
- // Le modele : son contenu
+ // The model: its content
list = new TColStd_HSequenceOfTransient();
if (obj == myModel)
{
list->Append(myModel->Value(i));
}
- // Une entite du modele : cette entite
+ // A model entity: this entity
else if (StartingNumber(obj) > 0)
list->Append(obj);
- // Un Texte : son interpretation
+ // A Text: its interpretation
else
{
DeclareAndCast(TCollection_HAsciiString, str, obj);
return GiveList(str->ToCString());
}
- // Si c est pas tout ca : une liste vide
+ // If it's not all that: an empty list
return list;
}
if (second && second[0] == ' ')
return GiveList(first, &second[1]);
- // list NULLE sera interpretee comme SelectionResult (selection toute crue)
- // sinon comme SelectionResultFromList
+ // NULL list will be interpreted as SelectionResult (raw selection)
+ // otherwise as SelectionResultFromList
if (second && second[0] != '\0')
list = GiveList(second, "");
Handle(TColStd_HSequenceOfTransient) list;
Standard_Integer num;
- // LISTE DEFINIE D OFFICE (en ce cas, la liste d entree est ignoree)
+ // LIST DEFINED BY DEFAULT (in this case, the input list is ignored)
if (selname[0] == '(')
{
- // liste d entites donnees a la queue leu leu : (ID,ID,ID...)
+ // list of entities given one after another: (ID,ID,ID...)
char entid[50];
Standard_Integer i, j = 0;
TColStd_MapOfInteger numap;
if (num > 0)
return GiveList(StartingEntity(num));
- // Autres cas : y atil une liste d entree.
+ // Other cases: is there an input list.
// Si OUI -> SelectionResultFromList. Si NON -> SelectionResult
- // Si une entite isolee -> on en fait une liste
+ // If an isolated entity -> we make it a list
- list = GiveList(ent); // ent NULL -> list NULL sinon intreprete
+ list = GiveList(ent); // ent NULL -> list NULL otherwise interpreted
// Decomposition term1 term2 ...
list->Append(ent);
}
- // ents de l1 pas deja dans l2
+ // entities from l1 not already in l2
n = l1->Length();
for (i = n; i > 0; i--)
{
if (numap.Contains(ent))
{
- // dans l1 et dans l2
+ // in l1 and in l2
if (mode == 0)
list->Append(ent);
}
else
{
- // dans l1 mais pas dans l2
+ // in l1 but not in l2
if (mode != 0)
list->Append(ent);
}
catch (Standard_Failure const&)
{
Message_Messenger::StreamBuffer sout = Message::SendInfo();
- sout << " **** Interruption DumpModel (Check) par Exception ****\n";
+ sout << " **** DumpModel (Check) Interrupted by Exception ****\n";
S << " ** ** Exception Raised during Check ! ** **\n";
S << " --> what could be determined is listed" << std::endl;
}
else
C = CT.CompleteCheckList();
- // Check List : si vide (pas demandee), naturellement passee
+ // Check List: if empty (not requested), naturally passed
try
{
OCC_CATCH_SIGNALS
catch (Standard_Failure const& anException)
{
Message_Messenger::StreamBuffer sout = Message::SendInfo();
- sout << " **** Interruption DumpModel par Exception : ****\n";
+ sout << " **** DumpModel Interrupted by Exception : ****\n";
sout << anException.GetMessageString();
sout << "\n Abandon" << std::endl;
}
try
{
OCC_CATCH_SIGNALS
- EvaluateSelection(sel); // appel normal (->code unique)
+ EvaluateSelection(sel); // normal call (->unique code)
}
catch (Standard_Failure const& anException)
{
- sout << " **** Interruption EvaluateSelection par Exception **** Intitule\n";
+ sout << " **** EvaluateSelection Interrupted by Exception **** Title\n";
sout << anException.GetMessageString();
sout << "\n Abandon" << std::endl;
}
try
{
OCC_CATCH_SIGNALS
- EvaluateDispatch(disp, mode); // appel normal (->code unique)
+ EvaluateDispatch(disp, mode); // normal call (->unique code)
}
catch (Standard_Failure const& anException)
{
- sout << " **** Interruption EvaluateDispatch par Exception **** Intitule\n";
+ sout << " **** EvaluateDispatch Interrupted by Exception **** Title\n";
sout << anException.GetMessageString();
sout << "\n Abandon" << std::endl;
}
try
{
OCC_CATCH_SIGNALS
- EvaluateComplete(mode); // appel normal (donc, code pas duplique)
+ EvaluateComplete(mode); // normal call (therefore, code not duplicated)
}
catch (Standard_Failure const& anException)
{
- sout << " **** Interruption EvaluateComplete par Exception : ****\n";
+ sout << " **** EvaluateComplete Interrupted by Exception : ****\n";
sout << anException.GetMessageString();
sout << "\n Abandon" << std::endl;
}
}
catch (Standard_Failure const& anException)
{
- sout << " **** Interruption ListEntities par Exception : ****\n";
+ sout << " **** ListEntities Interrupted by Exception : ****\n";
sout << anException.GetMessageString();
sout << "\n Abandon" << std::endl;
}
void Interface_BitMap::Reservate(const Standard_Integer moreflags)
{
Standard_Integer nb = theflags->Upper();
- Standard_Integer nbflags = nb / thenbwords - 1; // flag 0 non compte ...
+ Standard_Integer nbflags = nb / thenbwords - 1; // flag 0 not counted ...
if (nbflags >= thenbflags + moreflags)
return;
Standard_Integer nbw = thenbwords * (thenbflags + moreflags + 2);
return 0;
}
-// Les valeurs ...
+// Values ...
Standard_Boolean Interface_BitMap::Value(const Standard_Integer item,
const Standard_Integer flag) const
IMPLEMENT_STANDARD_RTTIEXT(Interface_Check, Standard_Transient)
-// Un Check est cree au depart sans liste de message : celle ci est creee
-// seulement si au moins une erreur doit y etre enregitree (Fail-Warning)
+// A Check is created initially without a message list: this is created
+// only if at least one error must be recorded (Fail-Warning)
//=================================================================================================
Interface_Check::Interface_Check() {} // construit a vide
theent = anentity;
}
-// .... Ajout de message d Erreur vraie (Fail)
+// .... Adding a true Error message (Fail)
//=================================================================================================
return (final ? thefails : thefailo);
}
-// .... Ajout de message de Warning
+// .... Adding a Warning message
//=================================================================================================
return (final ? thewarns : thewarno);
}
-// .... Ajout de message d Info simple (not yet completed)
+// .... Adding a simple Info message (not yet completed)
//=================================================================================================
return (final ? theinfos : theinfoo);
}
-// .... Gestion generale
+// .... General management
//=================================================================================================
return Standard_True;
}
}
- // Cas courant
+ // Common case
if (num == 0)
{
n1 = 1;
}
else if (num < 0 || num > NbFails())
return Standard_False;
- // Un message
+ // A message
Handle(TCollection_HAsciiString) strf = thefails->Value(num);
Handle(TCollection_HAsciiString) stro = thefailo->Value(num);
if (pref && pref[0] != '\0')
SetEntity(anentity);
}
-// .. GetMessages, reprend les messages en les cumulant aux siens propres
-// .. GetAsWarning, reprend les messages en les cumulant et en les
-// considerant tous comme "Warning" . En outre, selon <failsonly>
-// failsonly True : ne pas reprendre les Warnings originaux
-// failsonly False : les prendre aussi
+// .. GetMessages, takes messages by accumulating them with its own
+// .. GetAsWarning, takes messages by accumulating them and
+// considering them all as "Warning". Furthermore, according to <failsonly>
+// failsonly True : do not take original Warnings
+// failsonly False : take them as well
//=================================================================================================
}
}
- // InfoMsg : regle causant (user message)
+ // InfoMsg : causal rule (user message)
if (level >= 0)
{
nb = NbInfoMsgs();
void Interface_CheckIterator::Add(const Handle(Interface_Check)& ach, const Standard_Integer num)
{
- // Add <meme num que le dernier> -> cumul des Checks
+ // Add <same num as the last> -> accumulate Checks
if (ach->NbWarnings() + ach->NbFails() == 0)
return;
Standard_Integer nm = num;
Handle(Interface_Check) lch = thelist->ChangeValue(numpos);
lch->GetMessages(ach);
}
- // Cas normal : on ajoute en fin de liste
+ // Normal case: add at end of list
else
{
thelist->Append(ach);
thenums->Append(nm);
}
}
- // Pas encore vu passe : inutile de chercher
+ // Not yet seen passed: no need to search
else
{
thelist->Append(ach);
}
}
-// thestat : evite a CheckSuccess de refaire un calcul prealablement fait :
-// bit valeur 1 : Verify fait, valeur 4 : et ilya des erreurs
-// bit valeur 2 : Analyse fait, valeur 8 : et ilya des erreurs
+// thestat : avoids CheckSuccess redoing a previously done calculation :
+// bit value 1 : Verify done, value 4 : and there are errors
+// bit value 2 : Analysis done, value 8 : and there are errors
//=================================================================================================
Standard_Integer CN;
if (thegtool->Select(ent, module, CN))
{
- // Sans try/catch (fait par l appelant, evite try/catch en boucle)
+ // Without try/catch (done by caller, avoids try/catch in loop)
if (!errh)
{
module->CheckCase(CN, ent, sh, ach);
return;
}
- // Avec try/catch
+ // With try/catch
try
{
OCC_CATCH_SIGNALS
list.Print(S, model, Standard_False);
}
-// .... Check General sur un Modele ....
+// .... General Check on a Model ....
-// Check : Une Entite d un Modele, designee par son rang
+// Check: An Entity of a Model, designated by its rank
//=================================================================================================
{
Handle(Interface_InterfaceModel) model = theshare.Model();
Handle(Standard_Transient) ent = model->Value(num);
- Handle(Interface_Check) ach = new Interface_Check(ent); // non filtre par "Warning" : tel quel
+ Handle(Interface_Check) ach = new Interface_Check(ent); // not filtered by "Warning": as is
errh = 1;
FillCheck(ent, theshare, ach);
return ach;
}
-// CheckSuccess : test passe-passe pas, sur CheckList(Fail) des Entites
+// CheckSuccess: test passes-doesn't pass, on CheckList(Fail) of Entities
//=================================================================================================
if (reset)
thestat = 0;
if (thestat > 3)
- throw Interface_CheckFailure // deja teste avec erreur
+ throw Interface_CheckFailure // already tested with error
("Interface Model : Global Check");
Handle(Interface_InterfaceModel) model = theshare.Model();
if (model->GlobalCheck()->NbFails() > 0)
if (modchk->HasFailed())
throw Interface_CheckFailure("Interface Model : Verify Check");
if (thestat == 3)
- return; // tout teste et ca passe
+ return; // everything tested and it passes
- errh = 0; // Pas de try/catch, car justement on raise
+ errh = 0; // No try/catch, because we precisely raise
Standard_Integer nb = model->NbEntities();
for (Standard_Integer i = 1; i <= nb; i++)
{
if (thestat & 1)
{
if (!model->IsErrorEntity(i))
- continue; // deja verify, reste analyse
+ continue; // already verify, remains analyse
}
if (thestat & 2)
{
if (model->IsErrorEntity(i))
- continue; // deja analyse, reste verify
+ continue; // already analyse, remains verify
}
Handle(Interface_Check) ach = new Interface_Check(ent);
}
}
-// CompleteCheckList : Tous Tests : GlobalCheck, Analyse-Verify en Fail ou en
-// Warning; plus les Unknown Entities (par Check vide)
+// CompleteCheckList: All Tests: GlobalCheck, Analyse-Verify in Fail or in
+// Warning; plus the Unknown Entities (by empty Check)
//=================================================================================================
if (model->IsReportEntity(i))
{
ach = model->ReportEntity(i)->Check(); // INCLUT Unknown
- if (ach->HasFailed()) // FAIL : pas de Check semantique
+ if (ach->HasFailed()) // FAIL : no semantic Check
{
res.Add(ach, i);
ach = new Interface_Check;
return res;
}
-// CheckList : Check Fail sur Entites, en Analyse (Read time) ou Verify
+// CheckList: Check Fail on Entities, in Analysis (Read time) or Verify
//=================================================================================================
return res;
}
-// AnalyseCheckList : Fail au chargement des Entites (Read time)
+// AnalyseCheckList: Fail during loading of Entities (Read time)
//=================================================================================================
return res;
}
-// VerifyCheckList : Fail/Warning sur Analyse (Entites chargees OK. Valides ?)
+// VerifyCheckList: Fail/Warning on Analysis (Entities loaded OK. Valid?)
//=================================================================================================
return res;
}
-// Warnings sur Entites (Read time ou apres)
+// Warnings on Entities (Read time or after)
//=================================================================================================
IMPLEMENT_STANDARD_RTTIEXT(Interface_CopyMap, Interface_CopyControl)
-// CopyMap : rien de plus qu une Map passive
+// CopyMap : nothing more than a passive Map
Interface_CopyMap::Interface_CopyMap(const Handle(Interface_InterfaceModel)& amodel)
: theres(0, amodel->NbEntities())
{
#include <Standard_Transient.hxx>
#include <TCollection_HAsciiString.hxx>
-// Se souvenir qu une version plus riche de CopyTool existe : c est
-// TransferDispatch (package Transfer). Cette classe offre beaucoup plus de
-// possibilite (parametrage des actions, gestion du Mapping ...)
-// Mais le principe (transfert en 2 passes) reste le meme, a savoir :
-// Passe 1 normale : les entites a transferer sont designees, elles entrainent
-// leurs sous-references vraies
-// Passe 2 : une fois tous les transferts faits, les relations "Imply" sont
-// mises, pour les entites designees ET QUI ONT ETE AUSSI TRANSFEREES, la
-// relation est reconduite (pas de nouveau Share)
+// Remember that a richer version of CopyTool exists: it is
+// TransferDispatch (package Transfer). This class offers much more
+// possibilities (parameterization of actions, Mapping management ...)
+// But the principle (transfer in 2 passes) remains the same, namely:
+// Pass 1 normal: the entities to transfer are designated, they involve
+// their true sub-references
+// Pass 2: once all transfers are done, the "Imply" relations are
+// set, for the designated entities AND WHICH HAVE ALSO BEEN TRANSFERRED, the
+// relation is continued (no new Share)
// #####################################################################
-// .... CONSTRUCTEURS ....
+// .... CONSTRUCTORS ....
Interface_CopyTool::Interface_CopyTool(const Handle(Interface_InterfaceModel)& amodel,
const Interface_GeneralLib& lib)
: thelib(lib),
}
// #####################################################################
-// .... Actions Individuelles ....
+// .... Individual Actions ....
void Interface_CopyTool::Clear()
{
}
return res;
}
- // On cree l Entite vide (NewVoid), la Copie reste a faire
+ // Create the empty Entity (NewVoid), the Copy remains to be done
res = NewVoid(entfrom, entto);
if (mapped)
- themap->Bind(entfrom, entto); // Mapper avant de continuer ...
+ themap->Bind(entfrom, entto); // Map before continuing ...
- // A present, on effectue la Copie (selon cas; si ShallowCopy ne suffit pas :
- // c est <themdu> qui decide)
+ // Now, perform the Copy (depending on case; if ShallowCopy is not enough:
+ // it is <themdu> who decides)
- // Une Entite en Erreur n est pas copiee (pas de sens et c est risque ...)
- // Cependant, elle est "Copiee a Vide (NewVoid)" donc referencable
+ // An Entity in Error is not copied (no sense and it's risky ...)
+ // However, it is "Copied Empty (NewVoid)" so referenceable
if (!errstat)
themdu->CopyCase(theCN, entfrom, entto, *this);
return res;
module->RenewImpliedCase(CN, entfrom, entto, *this);
}
-// .... Alimentation de la Map ....
+// .... Feeding the Map ....
Handle(Standard_Transient) Interface_CopyTool::Transferred(const Handle(Standard_Transient)& ent)
{
Handle(Standard_Transient) res;
if (ent.IsNull())
- return res; // Copie d un Null : tres simple ...
+ return res; // Copy of a Null : very simple ...
Standard_Integer nument = themod->Number(ent);
- // <nument> == 0 -> Peut etre une sous-partie non partagee ...
- // On accepte mais on se protege contre un bouclage
+ // <nument> == 0 -> May be a non-shared sub-part ...
+ // We accept but we protect against a loop
if (nument == 0 && thelev > 100)
throw Interface_InterfaceError(
"CopyTool : Transferred, Entity is not contained in Starting Model");
if (!themap->Search(ent, res))
- { // deja transfere ? sinon, le faire
+ { // already transferred ? if not, do it
- // On opere la Copie (enfin, on tente)
- // En cas d echec, rien n est enregistre
+ // We perform the Copy (finally, we try)
+ // In case of failure, nothing is recorded
if (!Copy(ent, res, (nument != 0), themod->IsRedefinedContent(nument)))
return res;
rep = themod->ReportEntity(nument);
if (!rep.IsNull())
{
- // ATTENTION ATTENTION, si ReportEntity : Copier aussi Content et refaire une
- // ReportEntity avec les termes initiaux
+ // WARNING WARNING, if ReportEntity : Also copy Content and remake a
+ // ReportEntity with the initial terms
if (rep->IsUnknown())
therep->Bind(ent, new Interface_ReportEntity(res));
else
therep->Bind(ent, repto);
}
}
- // Gerer le niveau d imbrication (0 = racine du transfert)
+ // Manage the nesting level (0 = root of transfer)
thelev--;
}
if (thelev == 0 && nument > 0)
}
// #########################################################################
-// .... Actions Generales ....
+// .... General Actions ....
void Interface_CopyTool::TransferEntity(const Handle(Standard_Transient)& ent)
{
void Interface_CopyTool::RenewImpliedRefs()
{
if (theimp)
- return; // deja fait
+ return; // already done
theimp = Standard_True;
- // Transfert Passe 2 : recuperation des relations non "Share" (mais "Imply")
- // c-a-d portant sur des entites qui ont pu ou non etre transferees
- // (Et que la 1re passe n a pas copie mais laisse en Null)
- // N.B. : on devrait interdire de commander des nouveaux transferts ...
+ // Transfer Pass 2 : recovery of non "Share" relations (but "Imply")
+ // i.e. concerning entities that may or may not have been transferred
+ // (And that the 1st pass did not copy but left as Null)
+ // N.B. : we should forbid commanding new transfers ...
Standard_Integer nb = themod->NbEntities();
for (Standard_Integer i = 1; i <= nb; i++)
Handle(Standard_Transient) ent = themod->Value(i);
Handle(Standard_Transient) res;
if (!themap->Search(ent, res))
- continue; // entite pas transferee
- // Reconduction des references "Imply". Attention, ne pas copier si non chargee
+ continue; // entity not transferred
+ // Renewal of "Imply" references. Warning, do not copy if not loaded
Handle(Standard_Transient) aRep;
if (!therep->Search(ent, aRep))
{
void Interface_CopyTool::FillModel(const Handle(Interface_InterfaceModel)& bmodel)
{
- // Travaux preparatoires concernant les modeles
- // On commence : cela implique le Header
+ // Preparatory work concerning the models
+ // We start : this involves the Header
bmodel->Clear();
bmodel->GetFromAnother(themod);
- // Transfert Passe 1 : On prend les Entites prealablement copiees
+ // Transfer Pass 1 : We take the Entities previously copied
Interface_EntityIterator list = CompleteResult(Standard_True);
bmodel->GetFromTransfer(list);
- // Transfert Passe 2 : recuperation des relations non "Share" (mais "Imply")
+ // Transfer Pass 2 : recovery of non "Share" relations (but "Imply")
RenewImpliedRefs();
}
IMPLEMENT_STANDARD_RTTIEXT(Interface_EntityCluster, Standard_Transient)
-// Un Cluster, ce sont 4 entites qui se suivent (dans le principe, nombre fixe,
-// meme si pas 4). Elles sont remplies depuis 0. Il y a donc autant d Entites
-// que de Handles non Nuls, plus le fait qu ils sont remplis dans l ordre
-// Ainsi (avec Next), on consomme 5 Handles pour 4 Entites, avec une pointe
-// pour 1 et 2 Entites (on reste a 5 Handles)
-// Suppression : On retasse le Cluster pour que les Nulls soient tjrs a la fin
+// A Cluster is 4 entities that follow each other (in principle, fixed number,
+// even if not 4). They are filled from 0. There are therefore as many Entities
+// as there are non-Null Handles, plus the fact that they are filled in order
+// Thus (with Next), we consume 5 Handles for 4 Entities, with a spike
+// for 1 and 2 Entities (we stay at 5 Handles)
+// Deletion: We compact the Cluster so that the Nulls are always at the end
// .... CONSTRUCTEURS ....
Interface_EntityCluster::Interface_EntityCluster() {}
else if (theents[3].IsNull())
theents[3] = ent;
else
- { // Si celui-ci est plein ...
+ { // If this one is full ...
if (thenext.IsNull())
thenext = new Interface_EntityCluster(ent);
else
if (ent.IsNull())
throw Standard_NullObject("Interface_EntityCluster Remove");
Standard_Integer i;
- // <ent> est-il ici ? si oui, on a son rang
+ // Is <ent> here? if yes, we have its rank
if (ent == theents[0])
i = 1;
else if (ent == theents[1])
else if (ent == theents[3])
i = 4;
- // Sinon, passer au suivant, qui peut du coup devenir vide ->
- // On enleve le cluster vide de la liste (en principe cest le dernier)
+ // Otherwise, go to the next one, which can then become empty ->
+ // We remove the empty cluster from the list (in principle it's the last one)
else
- { // Pas trouve dans celui-ci ...
+ { // Not found in this one ...
if (thenext.IsNull())
return Standard_False;
Standard_Integer res = thenext->Remove(ent);
}
for (Standard_Integer j = num; j < n; j--)
theents[j - 1] = theents[j];
- theents[3].Nullify(); // On Nullify par la fin
- return (n == 1); // Ancien NbLocal == 1 -> devient nul
+ theents[3].Nullify(); // We Nullify at the end
+ return (n == 1); // Old NbLocal == 1 -> becomes null
}
-// .... ACCES AUX DONNEES ....
+// .... DATA ACCESS ....
Standard_Integer Interface_EntityCluster::NbEntities() const
{
}
return aCurEntClust->theents[aLocalNum - 1];
}
- return theents[num - 1]; // numerotation a partir de 0
+ return theents[num - 1]; // numbering from 0
}
void Interface_EntityCluster::SetValue(const Standard_Integer num,
aCurEntClust->theents[aLocalNum - 1] = ent;
}
else
- theents[num - 1] = ent; // numerotation a partir de 0
+ theents[num - 1] = ent; // numbering from 0
}
void Interface_EntityCluster::FillIterator(Interface_EntityIterator& iter) const
#include <Standard_NoSuchObject.hxx>
#include <Standard_Transient.hxx>
-// Iterateur pour ecriture for, ou while avec Next en fin :
-// for (creer iterateur; iter.More(); iter.Next()) { val = iter.Value(); ... }
-// .... Definitions initiales : en particulier celles requises pour
-// les outils de graphe (construction avec le graphe, avec un vertex)
+// Iterator for for writing, or while with Next at the end :
+// for (create iterator; iter.More(); iter.Next()) { val = iter.Value(); ... }
+// .... Initial definitions : in particular those required for
+// graph tools (construction with graph, with a vertex)
Interface_EntityIterator::Interface_EntityIterator()
{
// thecurr = new Interface_IntVal;
// thecurr->CValue() = 0;
- // thelist = new TColStd_HSequenceOfTransient(); // constructeur vide
+ // thelist = new TColStd_HSequenceOfTransient(); // empty constructor
// thelist sera construit au premier Add (quelquefois, il nyena pas)
}
thelist = new TColStd_HSequenceOfTransient();
}
-// .... Fonctionnalites de tri prealable a l'iteration ....
+// .... Pre-iteration sorting functionalities ....
-// Facon "bete" : supprimer les termes qui ne conviennent pas : lent !
-// Mieux vaut refaire une autre sequence a cote
+// "Dumb" way : remove terms that don't fit : slow !
+// Better to make another sequence alongside
void Interface_EntityIterator::SelectType(const Handle(Standard_Type)& atype,
const Standard_Boolean keep)
{
if (!thecurr.IsNull())
thecurr->CValue() = 1;
-} // peut etre redefini ...
+} // can be redefined ...
Standard_Boolean Interface_EntityIterator::More() const
{
if (thecurr.IsNull())
return Standard_False;
if (thecurr->Value() == 0)
- Start(); // preparation de l iteration
+ Start(); // iteration preparation
if (thelist.IsNull())
return Standard_False;
return (thecurr->Value() <= thelist->Length());
const Handle(Standard_Transient)& Interface_EntityIterator::Value() const
{
- // NbEntity pas const (on ne sait pas comment il est implemente apres tout)
+ // NbEntity not const (we don't know how it is implemented after all)
if (thelist.IsNull())
throw Standard_NoSuchObject("Interface_EntityIterator");
if (thecurr->Value() < 1 || thecurr->Value() > thelist->Length())
if (!thecurr.IsNull() && thecurr->Value() == 0)
Start();
if (thelist.IsNull())
- return new TColStd_HSequenceOfTransient(); // vide
+ return new TColStd_HSequenceOfTransient(); // empty
return thelist;
}
void Interface_EntityIterator::Destroy()
{
thecurr.Nullify();
-} // redevient vide !
+} // becomes empty again !
Interface_EntityIterator::~Interface_EntityIterator()
{
#include <Standard_OutOfRange.hxx>
#include <Standard_Transient.hxx>
-// Une EntityList, c est au fond un "Handle" bien entoure :
-// S il est nul, la liste est vide
-// Si c est une Entite, la liste comprend cette entite et rien d autre
-// Si c est un EntityCluster, il definit (avec ses Next eventuels) le contenu
-// de la liste
+// An EntityList is basically a well-wrapped "Handle":
+// If it is null, the list is empty
+// If it is an Entity, the list includes this entity and nothing else
+// If it is an EntityCluster, it defines (with its possible Next) the content
+// of the list
Interface_EntityList::Interface_EntityList() {}
void Interface_EntityList::Clear()
theval.Nullify();
}
-// .... EDITIONS (ajout-suppression) ....
+// .... EDITIONS (add-remove) ....
void Interface_EntityList::Append(const Handle(Standard_Transient)& ent)
{
}
}
-// Difference avec Append : on optimise, en evitant la recursivite
-// En effet, quand un EntityCluster est plein, Append transmet au Next
-// Ici, EntityList garde le controle, le temps de traitement reste le meme
-// Moyennant quoi, l ordre n est pas garanti
+// Difference with Append : we optimize, avoiding recursion
+// Indeed, when an EntityCluster is full, Append transmits to Next
+// Here, EntityList keeps control, the processing time remains the same
+// With which, the order is not guaranteed
void Interface_EntityList::Add(const Handle(Standard_Transient)& ent)
{
}
}
-// Remove : Par Identification d Item a supprimer, ou par Rang
-// Identification : Item supprime ou qu il soit
-// N.B.: La liste peut devenir vide ... cf retour Remove de Cluster
+// Remove : By Identification of Item to remove, or by Rank
+// Identification : Item removed wherever it is
+// N.B.: The list can become empty ... cf return Remove from Cluster
void Interface_EntityList::Remove(const Handle(Standard_Transient)& ent)
{
}
Handle(Interface_EntityCluster) ec = Handle(Interface_EntityCluster)::DownCast(theval);
if (ec.IsNull())
- return; // Une seule Entite et pas la bonne
+ return; // A single Entity and not the right one
Standard_Boolean res = ec->Remove(ent);
if (res)
theval.Nullify();
}
-// Remove par rang : tester OutOfRange
+// Remove by rank : test OutOfRange
void Interface_EntityList::Remove(const Standard_Integer num)
{
theval.Nullify();
}
-// .... ACCES Unitaire AUX DONNEES ....
+// .... UNIT ACCESS TO DATA ....
Standard_Boolean Interface_EntityList::IsEmpty() const
{
return 0;
Handle(Interface_EntityCluster) ec = Handle(Interface_EntityCluster)::DownCast(theval);
if (ec.IsNull())
- return 1; // Une seuke Entite
+ return 1; // A single Entity
return ec->NbEntities();
}
void Interface_FileParameter::Init(const Standard_CString val, const Interface_ParamType typ)
{
- theval = (Standard_PCharacter)val; // Principe : Allocation geree par contenant (ParamSet)
+ theval = (Standard_PCharacter)val; // Principle: Allocation managed by container (ParamSet)
thetype = typ;
thenum = 0;
}
void Interface_FileParameter::Clear()
{
theval = NULL;
-} // delete theval; pas si gere par ParamSet
+} // delete theval; not if managed by ParamSet
//=================================================================================================
IMPLEMENT_STANDARD_RTTIEXT(Interface_FileReaderData, Standard_Transient)
-// Stoque les Donnees issues d un Fichier (Conservees sous forme Litterale)
-// Chaque norme peut s en servir comme base (listes de parametres litteraux,
-// entites associees) et y ajoute ses donnees propres.
-// Travaille sous le controle de FileReaderTool
-// Optimisation : Champs pas possibles, car Param est const. Dommage
-// Donc, on suppose qu on lit un fichier a la fois (hypothese raisonnable)
-// On note en champ un numero de fichier, par rapport auquel on optimise
+// Stores Data from a File (Preserved in Literal form)
+// Each standard can use it as a base (literal parameter lists,
+// associated entities) and add its own data to it.
+// Works under the control of FileReaderTool
+// Optimization : Fields not possible, because Param is const. Too bad
+// So, we assume that we read one file at a time (reasonable assumption)
+// We note in field a file number, relative to which we optimize
static Standard_Integer thefic = 0;
static Standard_Integer thenm0 = -1;
static Standard_Integer thenp0 = -1;
return nb;
}
-// .... Gestion des Parametres attaches aux Records ....
+// .... Management of Parameters attached to Records ....
void Interface_FileReaderData::InitParams(const Standard_Integer num)
{
return res;
}
-// .... Gestion des Entites Associees aux Donnees du Fichier ....
+// .... Management of Entities Associated with File Data ....
const Handle(Standard_Transient)& Interface_FileReaderData::BoundEntity(
const Standard_Integer num) const
// To use TCollectionHAsciiString
#include <TCollection_HAsciiString.hxx>
-// Failure pour recuperer erreur en lecture fichier,
-// TypeMismatch pour message d erreur circonstancie (cas particulier important)
+// Failure to recover error when reading file,
+// TypeMismatch for detailed error message (important special case)
-// Gere le chargement d un Fichier, prealablement transforme en FileReaderData
-// (de la bonne norme), dans un Modele
+// Manages the loading of a File, previously transformed into FileReaderData
+// (of the right standard), into a Model
//=================================================================================================
return theerrhand;
}
-// .... Actions Connexes au CHARGEMENT DU MODELE ....
+// .... Actions Related to MODEL LOADING ....
-// SetEntities fait appel a des methodes a fournir :
-// s appuyant sur un Recognizer adapte a l interface :
-// - Recognize fait reco->Evaluate(... : selon record no num)
-// et recupere le resultat
-// ainsi que la definition de l entite inconnue de l interface
+// SetEntities calls methods to be provided :
+// based on a Recognizer adapted to the interface :
+// - Recognize makes reco->Evaluate(... : according to record no num)
+// and retrieves the result
+// as well as the definition of the unknown entity of the interface
//=================================================================================================
Handle(Interface_ReaderModule) rmod;
Handle(Interface_Protocol) proto;
Standard_Integer CN = 0;
- // Chercher dans ReaderLib : Reconnaissance de cas -> CN , proto
+ // Search in ReaderLib : Case recognition -> CN , proto
for (rlib.Start(); rlib.More(); rlib.Next())
{
rmod = rlib.Module();
}
if (CN <= 0 || proto.IsNull())
return Standard_False;
- // Se recaler dans GeneralLib : Creation de l entite vide
+ // Recalibrate in GeneralLib : Creation of empty entity
Handle(Standard_Type) typrot = proto->DynamicType();
for (glib.Start(); glib.More(); glib.Next())
{
//=================================================================================================
void Interface_FileReaderTool::EndRead(const Handle(Interface_InterfaceModel)&) {
-} // par defaut, ne fait rien; redefinissable selon besoin
+} // by default, does nothing; redefinable as needed
// .... (Sa Majeste le) CHARGEMENT DU MODELE ....
void Interface_FileReaderTool::LoadModel(const Handle(Interface_InterfaceModel)& amodel)
//
-// Methode generale de lecture d un fichier : il est lu via un FileReaderData
-// qui doit y donner acces de la facon la plus performante possible
-// chaque interface definit son FileHeader avec ses methodes, appelees ici
+// General method for reading a file : it is read via a FileReaderData
+// which must provide access in the most efficient way possible
+// each interface defines its FileHeader with its methods, called here
{
// MGE 16/06/98
// Building of Messages
SetModel(amodel);
- // .. Demarrage : Lecture du Header ..
+ // .. Startup : Header Reading ..
if (theerrhand)
{
try
{
OCC_CATCH_SIGNALS
- BeginRead(amodel); // selon la norme
+ BeginRead(amodel); // according to the standard
}
catch (Standard_Failure const&)
{
else
BeginRead(amodel); // selon la norme
- // .. Lecture des Entites ..
+ // .. Reading Entities ..
amodel->Reservate(thereader->NbEntities());
while (num > 0)
{
- Standard_Integer ierr = 0; // erreur sur analyse d une entite
+ Standard_Integer ierr = 0; // error on analysis of an entity
Handle(Standard_Transient) anent;
try
{
{
num0 = num;
- // Lecture sous protection contre crash
- // (fait aussi AddEntity mais pas SetReportEntity)
+ // Reading under crash protection
+ // (also does AddEntity but not SetReportEntity)
anent = LoadedEntity(num);
- // Lecture non protegee : utile pour travailler avec dbx
+ // Unprotected reading : useful for working with dbx
//// else
//// anent = LoadedEntity(num);
- // .. Fin Lecture ..
+ // .. End Reading ..
if (anent.IsNull())
{
// Sending of message : Number of ignored Null Entities
}
continue;
}
- // LoadedEntity fait AddEntity MAIS PAS SetReport (en bloc a la fin)
+ // LoadedEntity does AddEntity BUT NOT SetReport (in block at the end)
- } // ---- fin boucle sur entites
- num0 = 0; // plus rien
+ } // ---- end loop on entities
+ num0 = 0; // nothing more
} // ---- fin du try, le catch suit
- // En cas d erreur NON PREVUE par l analyse, recuperation par defaut
- // Attention : la recuperation peut elle-meme planter ... (cf ierr)
+ // In case of UNFORESEEN error by the analysis, default recovery
+ // Warning : the recovery can itself crash ... (cf ierr)
catch (Standard_Failure const& anException)
{
- // Au passage suivant, on attaquera le record suivant
+ // On the next pass, we will attack the next record
// clang-format off
num0 = thereader->FindNextRecord(num); //:g9 abv 28 May 98: tr8_as2_ug.stp - infinite cycle: (0);
// clang-format on
{
// char mess[100]; svv #2
ierr = 1;
- // ce qui serait bien ici serait de recuperer le texte de l erreur pour ach ...
+ // what would be good here would be to recover the error text for ach ...
if (thetrace > 0)
{
// Sending of message : recovered entity
}
}
- // Finalement, on charge une Entite Inconnue
+ // Finally, we load an Unknown Entity
thenbreps++;
Handle(Interface_ReportEntity) rep = new Interface_ReportEntity(ach, anent);
Handle(Standard_Transient) undef = UnknownEntity();
thenbreps++;
thereports->SetValue(num, rep);
// if(isValid)
- amodel->AddEntity(anent); // pas fait par LoadedEntity ...
+ amodel->AddEntity(anent); // not done by LoadedEntity ...
}
else
{
TF->Send(Msg22, Message_Info);
}
}
- // On garde <rep> telle quelle : pas d analyse fichier supplementaire,
- // Mais la phase preliminaire eventuelle est conservee
- // (en particulier, on garde trace du Type lu du fichier, etc...)
+ // We keep <rep> as is : no additional file analysis,
+ // But the eventual preliminary phase is preserved
+ // (in particular, we keep trace of the Type read from the file, etc...)
}
} // ----- fin complete du try/catch
} // ----- fin du while
- // .. Ajout des Reports, silya
+ // .. Adding Reports, if any
if (!thereports.IsNull())
{
if (thetrace > 0)
}
}
- // Conclusion : peut ne rien faire : selon necessite
+ // Conclusion : may do nothing : according to necessity
if (theerrhand)
{
try
{
OCC_CATCH_SIGNALS
- EndRead(amodel); // selon la norme
+ EndRead(amodel); // according to the standard
}
catch (Standard_Failure const&)
{
}
}
- // Trace Entite Inconnue
+ // Trace Unknown Entity
if (thetrace >= 2 && theproto->IsUnknownEntity(anent))
{
Handle(Message_Messenger) TF = Messenger();
TF->Send(Msg22, Message_Info);
}
}
- // .. Chargement proprement dit : Specifique de la Norme ..
+ // .. Actual Loading : Standard Specific ..
AnalyseRecord(num, anent, ach);
- // .. Ajout dans le modele de l entite telle quelle ..
- // ATTENTION, ReportEntity traitee en bloc apres les Load
+ // .. Adding to the model the entity as is ..
+ // WARNING, ReportEntity processed in block after Load
themodel->AddEntity(anent);
- // Erreur ou Correction : On cree une ReportEntity qui memorise le Check,
- // l Entite, et en cas d Erreur une UndefinedEntity pour les Parametres
+ // Error or Correction : We create a ReportEntity that memorizes the Check,
+ // the Entity, and in case of Error an UndefinedEntity for the Parameters
- // On exploite ici le flag IsLoadError : s il a ete defini (a vrai ou faux)
- // il a priorite sur les fails du check. Sinon, ce sont les fails qui parlent
+ // We exploit here the IsLoadError flag: if it has been defined (true or false)
+ // it has priority over check fails. Otherwise, it's the fails that speak
Standard_Integer nbf = ach->NbFails();
Standard_Integer nbw = ach->NbWarnings();
}
}
- // Rechargement ? si oui, dans une UnknownEntity fournie par le protocole
+ // Reloading ? if yes, in an UnknownEntity provided by the protocol
if (thereader->IsErrorLoad())
nbf = (thereader->ResetErrorLoad() ? 1 : 0);
if (nbf > 0)
rep->SetContent(undef);
}
- // Conclusion (Unknown : traite en externe because traitement Raise)
+ // Conclusion (Unknown : treated externally because Raise treatment)
//// if (irep > 0) themodel->SetReportEntity (nbe,rep); en bloc a la fin
return anent;
SetDefaults(chars);
}
-// .... Controle d Envoi des Flottants ....
+// .... Control of Float Transmission ....
void Interface_FloatWriter::SetFormat(const Standard_CString form, const Standard_Boolean reset)
{
const Standard_CString mainform,
const Standard_CString rangeform)
{
- // Valeur flottante, expurgee de "0000" qui trainent et de "E+00"
+ // Float value, purged of trailing "0000" and "E+00"
const Standard_Integer anMasSize = 5; // change 6 to 5: index 5 is not used below
char lxp[anMasSize], *pText;
int i0 = 0, j0 = 0;
const Handle(Standard_Transient)& /*entto*/,
const Interface_CopyTool& /*TC*/) const
{
-} // Par defaut, ne fait rien
+} // By default, does nothing
void Interface_GeneralModule::WhenDeleteCase(const Standard_Integer /*casenum*/,
const Handle(Standard_Transient)& /*ent*/,
const Standard_Boolean /*dispatched*/) const
{
-} // par defaut, ne fait rien
+} // by default, does nothing
Standard_Integer Interface_GeneralModule::CategoryNumber(const Standard_Integer,
const Handle(Standard_Transient)&,
const Interface_ShareTool&) const
{
return 0;
-} // par defaut, non specifie
+} // by default, not specified
Handle(TCollection_HAsciiString) Interface_GeneralModule::Name(const Standard_Integer,
const Handle(Standard_Transient)&,
{
Handle(TCollection_HAsciiString) str;
return str;
-} // par defaut, non specifie
+} // by default, not specified
// .... CONSTRUCTEURS ....
-// .... Construction a partir de la connaissance des Entites ....
+// .... Construction from Entity knowledge ....
Interface_Graph::Interface_Graph(const Handle(Interface_InterfaceModel)& amodel,
const Interface_GeneralLib& /*lib*/,
Evaluate();
}
-// .... Construction depuis un autre Graph ....
+// .... Construction from another Graph ....
Interface_Graph::Interface_Graph(const Interface_Graph& agraph, const Standard_Boolean /*copied*/)
: themodel(agraph.Model()),
}
}
-// .... Construction depuis un autre Graph ....
+// .... Construction from another Graph ....
// ###########################################################################
-// .... ACCES UNITAIRES AUX DONNEES DE BASE ....
+// .... UNITARY ACCESS TO BASE DATA ....
void Interface_Graph::Reset()
{
// ###########################################################################
-// .... Chargements Elementaires avec Propagation de "Share" .... //
+// .... Elementary Loadings with "Share" Propagation .... //
const Handle(Interface_InterfaceModel)& Interface_Graph::Model() const
{
void Interface_Graph::GetFromModel()
{
if (themodel.IsNull() || thestats.IsNull())
- return; // no model ... (-> on n ira pas loin)
+ return; // no model ... (-> we won't go far)
theflags.Init(Standard_True, Graph_Present);
thestats->Init(0);
}
if (!num)
return;
if (theflags.CTrue(num, Graph_Present))
- return; // deja pris : on passe
+ return; // already taken : we skip
thestats->SetValue(num, newstat);
if (!shared)
return;
- // Attention a la redefinition !
+ // Watch out for redefinition !
Interface_EntityIterator aIter = GetShareds(ent);
for (; aIter.More(); aIter.Next())
if (pasla)
{
- /// theflags.SetTrue (num, Graph_Present); // nouveau : noter avec newstat
+ /// theflags.SetTrue (num, Graph_Present); // new : note with newstat
thestats->SetValue(num, newstat);
}
else
{
Standard_Integer overstat = stat;
if (stat != newstat)
- { // deja pris, meme statut : passer
+ { // already taken, same status : skip
if (cumul)
- overstat += overlapstat; // nouveau statut : avec cumul ...
+ overstat += overlapstat; // new status : with cumulation ...
else
- overstat = overlapstat; // ... ou sans (statut force)
- if (stat != overstat) // si repasse deja faite, passer
+ overstat = overlapstat; // ... or without (forced status)
+ if (stat != overstat) // if repass already done, skip
thestats->SetValue(num, overstat);
}
}
if (!shared)
return;
- // Attention a la redefinition !
+ // Watch out for redefinition !
Interface_EntityIterator aIter = GetShareds(ent);
for (; aIter.More(); aIter.Next())
// #####################################################################
-// .... Listage des Entites Partagees ....
+// .... Listing of Shared Entities ....
Standard_Boolean Interface_Graph::HasShareErrors(const Handle(Standard_Transient)& ent) const
{
Interface_EntityIterator::Start();
}
-void Interface_GraphContent::Evaluate() {} // par defaut, Evaluate ne fait rien
+void Interface_GraphContent::Evaluate() {} // by default, Evaluate does nothing
#include <Interface_IntList.hxx>
-// Organisation des donnees :
-// theents vaut : 0 pas de reference
-// > 0 : une reference, dont voici la valeur; pas de liste
-// < 0 : une liste de references; on stocke <rank>, elle debute a <rank>+1
-// la liste est dans therefs et est ainsi constitue :
-// liste de valeurs negatives, se terminant pas une valeur positive :
-// de <rank>+1 a <rank>+nb , <rank>+1 a <rank>+nb-1 sont negatifs et
-// <rank>+nb est negatif
-// un zero signifie : place libre
-// Pre-reservation : <rank> note le nombre courant, en positif strict
-// Il faut alors l incrementer a chaque ajout
-// Usage contextuel, il faut demander SetNumber(num < 0) pour exploiter cette
-// info et Add(ref < 0) pour la gerer.
-// Si elle n est pas presente, on bascule en mode courant
+// Data organization :
+// theents value : 0 no reference
+// > 0 : one reference, here is the value; no list
+// < 0 : a list of references; we store <rank>, it starts at <rank>+1
+// the list is in therefs and is thus constituted :
+// list of negative values, ending with a positive value :
+// from <rank>+1 to <rank>+nb , <rank>+1 to <rank>+nb-1 are negative and
+// <rank>+nb is negative
+// a zero means : free space
+// Pre-reservation : <rank> notes the current number, in strict positive
+// It must then be incremented at each addition
+// Contextual usage, you must call SetNumber(num < 0) to exploit this
+// info and Add(ref < 0) to manage it.
+// If it is not present, we switch to current mode
Interface_IntList::Interface_IntList()
{
thenbe = thenbr = thenum = thecount = therank = 0;
void Interface_IntList::SetNumber(const Standard_Integer number)
{
- // Usage en pre-reservation : a demander specifiquement ! -> optimisation
- // <preres> verifie que la pre-reservation est valide
+ // Pre-reservation usage : to be requested specifically ! -> optimization
+ // <preres> verifies that the pre-reservation is valid
if (number < 0)
{
if (thenum == -number || number < -thenbe)
if (preres)
return;
}
- // Usage courant. La suite en usage courant ou si pas de pre-reservation
+ // Current usage. The following in current usage or if no pre-reservation
else if (number > 0)
{
if (thenum == number || number > thenbe)
void Interface_IntList::Reservate(const Standard_Integer count)
{
- // Reservate (-count) = Reservate (count) + allocation sur entite courante + 1
+ // Reservate (-count) = Reservate (count) + allocation on current entity + 1
if (count < 0)
{
Reservate(-count - 1);
if (thenum == 0)
return;
thenbr++;
- therefs->SetValue(thenbr, 0); // contiendra le nombre ...
+ therefs->SetValue(thenbr, 0); // will contain the number ...
therank = thenbr;
theents->SetValue(thenum, -thenbr);
thenbr -= count;
}
Standard_Integer up, oldup = 0;
if (thenbr == 0)
- { // c-a-d pas encore allouee ...
+ { // i.e. not yet allocated ...
up = thenbe / 2 + 1;
if (up < 2)
up = 2;
up = count * 3 / 2;
therefs = new TColStd_HArray1OfInteger(0, up);
therefs->Init(0);
- thenbr = 2; // on commence apres (commodite d adressage)
+ thenbr = 2; // we start after (convenience of addressing)
}
oldup = therefs->Upper();
if (thenbr + count < oldup)
thecount++;
}
else if (thenbr == therank + thecount)
- { // place libre en fin
+ { // free space at end
therefs->SetValue(thenbr, -therefs->Value(thenbr));
therefs->SetValue(thenbr + 1, ref);
thenbr++;
thecount++;
}
else if (therefs->Value(therank + thecount + 1) == 0)
- { // place libre apres
+ { // free space after
therefs->SetValue(therank + thecount, -therefs->Value(therank + thecount));
therefs->SetValue(therank + thecount + 1, ref);
thecount++;
}
else
- { // recopier plus loin !
+ { // copy further !
Reservate(thecount + 2);
Standard_Integer rank = therank;
therank = thenbr;
void Interface_IntList::Clear()
{
if (thenbr == 0)
- return; // deja clear
+ return; // already clear
Standard_Integer i, low, up;
low = theents->Lower();
up = theents->Upper();
IMPLEMENT_STANDARD_RTTIEXT(Interface_InterfaceModel, Standard_Transient)
-// Un Modele d`Interface est un ensemble ferme d`Entites d`interface : chacune
-// est dans un seul modele a la fois; elle y a un numero (Number) qui permet de
-// verifier qu`une entite est bien dans un seul modele, de definir des Map tres
-// performantes, de fournir un identifieur numerique
-// Il est a meme d`etre utilise dans des traitements de Graphe
-// STATICS : les TEMPLATES
+// An Interface Model is a closed set of interface Entities: each one
+// is in a single model at a time; it has a number (Number) which allows to
+// verify that an entity is indeed in a single model, to define very
+// efficient Maps, to provide a numerical identifier
+// It is able to be used in Graph processing
+// STATICS : the TEMPLATES
static NCollection_DataMap<TCollection_AsciiString, Handle(Standard_Transient)> atemp;
static const Handle(Standard_Type)& typerep()
//=================================================================================================
-void Interface_InterfaceModel::Destroy() // on fait un mimumum
+void Interface_InterfaceModel::Destroy() // we do a minimum
{
- // Moins que Clear que, lui, est adapte a chaque norme
+ // Less than Clear which, itself, is adapted to each standard
ClearEntities();
thecheckstx->Clear();
thechecksem->Clear();
theentities.Clear();
}
-// .... ACCES AUX ENTITES ....
+// .... ENTITY ACCESS ....
//=================================================================================================
}
*/
-// .. Acces Speciaux (Report, etc...) ..
+// .. Special Access (Report, etc...) ..
//=================================================================================================
{
const Handle(Interface_Check)& ach = checks.Value();
Standard_Integer num = checks.Number();
- // global check : ok si MEME MODELE
+ // global check : ok if SAME MODEL
if (num == 0)
thechecksem->GetMessages(ach);
else
return rep->Check();
}
-// .... Chargement des donnees du Modele .... //
+// .... Loading of Model data .... //
//=================================================================================================
// Standard_Integer newnum; svv #2
if (!anentity->IsKind(typerep()))
theentities.Add(anentity);
- // Report : Ajouter Concerned, mais noter presence Report et sa valeur
+ // Report : Add Concerned, but note presence Report and its value
else
{
Handle(Interface_ReportEntity) rep = Handle(Interface_ReportEntity)::DownCast(anentity);
}
}
-// AddWithRefs itere sur les Entities referencees pour charger une Entite
-// au complet, avec tout ce dont elle a besoin
+// AddWithRefs iterates on referenced Entities to load an Entity
+// completely, with everything it needs
//=================================================================================================
if (lib.Select(anent, module, CN))
{
module->FillSharedCase(CN, anent, iter);
- // FillShared tout court : supposerait que le modele soit deja pret
- // or justement, on est en train de le construire ...
+ // FillShared simply : would suppose that the model is already ready
+ // or precisely, we are in the process of building it ...
module->ListImpliedCase(CN, anent, iter);
}
Standard_Integer lev1 = level - 1;
if (lev1 == 0)
- return; // level = 0 -> tous niveaux; sinon encore n-1
+ return; // level = 0 -> all levels; otherwise still n-1
for (iter.Start(); iter.More(); iter.Next())
AddWithRefs(iter.Value(), lib, lev1, listall);
}
theentities.Substitute(nument, anent);
}
-// ReverseOrders permet de mieux controler la numeration des Entites :
-// Souvent, les fichiers mettent les racines en fin, tandis que AddWithRefs
-// les met en tete.
+// ReverseOrders allows better control of Entity numbering :
+// Often, files put the roots at the end, while AddWithRefs
+// puts them at the head.
//=================================================================================================
Standard_Integer i; // svv #1
for (i = 1; i <= nb; i++)
ents.SetValue(i, theentities.FindKey(i));
- // On va vider la Map, puis la recharger : dans l ordre jusqua after
- // en ordre inverse apres
+ // We will empty the Map, then reload it : in order until after
+ // in reverse order after
theentities.Clear();
Reservate(nb);
for (i = 1; i <= after; i++)
theentities.Add(ents(i)); // svv #2
for (i = nb; i > after; i--)
theentities.Add(ents(i));
- // Faudra aussi s occuper des Reports
+ // Will also have to take care of the Reports
for (i = nb; i > after; i--)
{
Standard_Integer i2 = nb + after - i;
if (nb < 2 || newnum >= nb || cnt <= 0)
return;
TColStd_Array1OfTransient ents(1, nb);
- // On va preparer le changement
+ // We will prepare the change
Standard_Integer minum = (oldnum > newnum ? newnum : oldnum);
Standard_Integer mxnum = (oldnum < newnum ? newnum : oldnum);
Standard_Integer kount = (oldnum > newnum ? cnt : -cnt);
}
}
-// GetFromTransfer permet de recuperer un resultat prepare par ailleurs
-// Le Modele demarre a zero. Les entites doivent etre libres (cf AddEntity)
+// GetFromTransfer allows to recover a result prepared elsewhere
+// The Model starts at zero. Entities must be free (cf AddEntity)
//=================================================================================================
}
}
- // En "non exact", on admet de recevoir le numero entre 1 et n
+ // In "non exact", we admit to receive the number between 1 and n
if (exact)
return 0;
i = 0;
myLine.SetValue(i, ' ');
}
}
- // GERER KEEP : est-il jouable ? sinon, annuler. sioui, noter la jointure
+ // MANAGE KEEP: is it playable? otherwise, cancel. if yes, note the junction
if (myKeep > 0)
{
- myKeep += (myInit + 1); // myInit, et +1 car Keep INCLUS
+ myKeep += (myInit + 1); // myInit, and +1 because Keep INCLUDED
}
if (myKeep > 0)
{
void Interface_LineBuffer::Keep()
{
- // Si Keep, sauver de myKeep + 1 a myLen (+1 pour 0 final)
+ // If Keep, save from myKeep + 1 to myLen (+1 for final 0)
if (myKeep > 0)
{
myLine.SetValue(1, myKept);
}
}
-// ########### ARRONDIS DE FLOTTANTS ############
+// ########### FLOATING POINT ROUNDING ############
Standard_Real Interface_MSG::Intervalled(const Standard_Real val,
const Standard_Integer order,
rst = (upper ? 10. : 7.);
}
else
- { // n a de sens que jusqu a 10 ...
+ { // only makes sense up to 10 ...
if (rst <= 1.2)
rst = (upper ? 1.2 : 1.);
else if (rst <= 1.5)
const Standard_Integer ss,
const Standard_CString format)
{
- // valeurs nulles : en tete (avec au moins une non nulle, la derniere)
- // -> completees avec les valeurs actuelle (system date)
- // tout nul on laisse
+ // null values : at the beginning (with at least one non-null, the last one)
+ // -> completed with current values (system date)
+ // all null we leave
// svv #2 Standard_Integer y1 , m1 , d1 , h1 , n1 , s1;
Standard_Integer y2 = yy, m2 = mm, d2 = dd, h2 = hh, n2 = mn, s2 = ss;
themxpar = nres;
thenbpar = 0;
thelnval = 0;
- thelnres = 100; // *20; // 10 caracteres par Param (\0 inclus) : raisonnable
+ thelnres = 100; // *20; // 10 characters per Param (\0 included): reasonable
theval = new char[thelnres]; // szv#4:S4163:12Mar99 `thelnres+1` chars was wrong
}
-// Append(CString) : Gestion des caracteres selon <lnval>
-// Si lnval < 0, ParamSet passif, memoire geree de l exterieur, ParamSet
-// se contente de s y referer
-// Sinon, recopie dans une page locale
+// Append(CString): Character management according to <lnval>
+// If lnval < 0, ParamSet passive, memory managed externally, ParamSet
+// just refers to it
+// Otherwise, copy to a local page
Standard_Integer Interface_ParamSet::Append(const Standard_CString val,
const Standard_Integer lnval,
const Interface_ParamType typ,
const Standard_Integer nument)
{
- // Ici, gestion locale de String
+ // Here, local String management
thenbpar++;
if (thenbpar > themxpar)
{
}
else if (lnval < 0)
{
- // .. Gestion externe des caracteres ..
+ // .. External character management ..
Interface_FileParameter& FP = thelist->ChangeValue(thenbpar);
FP.Init(val, typ);
if (nument != 0)
}
else
{
- // .. Gestion locale des caracteres ..
+ // .. Local character management ..
Standard_Integer i;
if (thelnval + lnval + 1 > thelnres)
{
- // Reservation de caracteres insuffisante : d abord augmenter
+ // Insufficient character reservation: first increase
Standard_Integer newres = (Standard_Integer)(thelnres * 2 + lnval);
char* newval = new char[newres];
for (i = 0; i < thelnval; i++)
newval[i] = theval[i]; // szv#4:S4163:12Mar99 `<= thelnres` was wrong
- // et cepatou : il faut realigner les Params deja enregistres sur
- // l ancienne reservation de caracteres ...
+ // and that's not all: must realign Params already recorded on
+ // the old character reservation ...
// Standard_Integer delta = (Standard_Integer) (newval - theval);
- // difference a appliquer
+ // difference to apply
char* poldVal = &theval[0];
char* pnewVal = &newval[0];
for (i = 1; i < thenbpar; i++)
// if (oval < theval || oval >= (theval+thelnres))
// continue; //hors reserve //szv#4:S4163:12Mar99 `oval >` was wrong
Standard_Integer onum = OFP.EntityNumber();
- OFP.Init(pnewVal + delta, otyp); // et voila; on remet dans la boite
+ OFP.Init(pnewVal + delta, otyp); // and there we go; we put back in the box
if (onum != 0)
OFP.SetEntityNumber(onum);
}
- // Enteriner la nouvelle reservation
+ // Confirm the new reservation
delete[] theval;
theval = newval;
thelnres = newres;
}
- // Enregistrer ce parametre
+ // Register this parameter
for (i = 0; i < lnval; i++)
theval[thelnval + i] = val[i];
theval[thelnval + lnval] = '\0';
Standard_Integer Interface_ParamSet::Append(const Interface_FileParameter& FP)
{
- // Ici, FP tout pret : pas de gestion memoire sur String (dommage)
+ // Here, FP ready: no memory management on String (too bad)
thenbpar++;
if (thenbpar > themxpar)
n0 = 0;
nbp = thenbpar;
if (thenbpar <= themxpar)
- return thelist; // et zou
+ return thelist; // and there you go
}
Handle(Interface_ParamList) list = new Interface_ParamList;
if (nb == 0)
{
// if (!thenext.IsNull()) thenext->Destroy();
thenext.Nullify();
- // Destruction "manuelle" (gestion memoire directe)
+ // "Manual" destruction (direct memory management)
if (theval)
delete[] theval;
theval = NULL;
IMPLEMENT_STANDARD_RTTIEXT(Interface_Protocol, Standard_Transient)
-// Gestion du Protocol actif : tres simple, une variable statique
+// Management of active Protocol: very simple, a static variable
static Handle(Interface_Protocol)& theactive()
{
static Handle(Interface_Protocol) theact;
theactive().Nullify();
}
-// === Typage (formules fournies par defaut)
+// === Typing (formulas provided by default)
//=================================================================================================
//#include <Interface_Recognizer.ixx>
#include <Standard_NoSuchObject.hxx>
-// ATTENTION : TransRecognizer a exactement le meme code ...
-// Mais produit un Transient au lieu d un Persistent
-
-// Principe : a un objet de depart (cle), un Recognizer tente d'associer un
-// resultat. La classe Recognizer offre le mecanisme general gerant cela
-// Chaque classe particuliere (une fois definie l'instanciation) doit fournir
-// une methode specifique Eval, qui opere la correspondance
-// Eval considere l'objet par tous moyens appropries, et en cas de succes,
-// appelle SetOK(result) puis sort (return)
-// en cas d'echec, suite au retour d'Eval, Recognizer sait que SetOK n'a pas
-// ete appele
+// WARNING: TransRecognizer has exactly the same code ...
+// But produces a Transient instead of a Persistent
+
+// Principle: from a starting object (key), a Recognizer attempts to associate a
+// result. The Recognizer class provides the general mechanism managing this
+// Each particular class (once the instantiation is defined) must provide
+// a specific Eval method, which performs the correspondence
+// Eval considers the object by all appropriate means, and in case of success,
+// calls SetOK(result) then exits (return)
+// in case of failure, following the return from Eval, Recognizer knows that SetOK was not
+// called
Interface_Recognizer::Interface_Recognizer ()
{ hasnext = Standard_False; }
- //thekey.Nullify(); inutile, fait par le constructeur ...
+ //thekey.Nullify(); useless, done by the constructor ...
Standard_Boolean Interface_Recognizer::Evaluate
(const TheKey& akey, Handle(TheResul)& res)
{
if (thephw.IsNull())
{
- // 1re fois : vider les steps deja notees
+ // 1st time : empty the already noted steps
thetotal = 0.;
thephnam = new TColStd_HSequenceOfAsciiString();
thephw = new TColStd_HSequenceOfReal();
{
if (thephdeb.IsNull())
{
- // 1re fois : pour default phase, au moins creer receptacle des steps
+ // 1st time : for default phase, at least create receptacle for steps
thephdeb = new TColStd_HSequenceOfInteger();
thephfin = new TColStd_HSequenceOfInteger();
thestw = new TColStd_HSequenceOfReal();
thephfin->Append(1);
thestw->Append(0.);
}
- // A present, ajouter cette etape
+ // Now, add this step
Standard_Integer n0 = thephdeb->Value(thephdeb->Length());
- // Ceci donne dans thestw le numero du cumul des etapes
+ // This gives in thestw the number of the cumulative steps
thestw->ChangeValue(n0) += weight;
- thestw->Append(weight); // on ajoute cette etape
+ thestw->Append(weight); // we add this step
thephfin->ChangeValue(thephfin->Length())++;
}
{
if (thephdeb.IsNull())
{
- // Pas de phase, pas d etape ... donc une seule ...
+ // No phase, no step ... so only one ...
n0step = -1;
nbstep = 1;
weight = 1.;
}
if (thephw.IsNull())
{
- // Pas de phase mais des etapes
+ // No phase but steps
weight = 1.;
name = voidname;
}
nbstep = thephfin->Value(num);
}
- // Voyons pour cette phase
+ // Let's see for this phase
}
Standard_Real Interface_STAT::Step(const Standard_Integer num) const
// ############### COMPTAGE ################
-// Le comptage se fait sur la base suivante :
-// TOTAL : total des poids des phases par rapport auquel calculer
-// PHASES : poids des phases passees et poids de la phase en cours
-// Ces poids sont a ramener au TOTAL
-// PHASE COURANTE : nb d items et nb de cycles declares
-// Nb d items deja passes (cycle complet)
-// CYCLE COURANT : nb d items de ce cycle, total des poids des etapes
-// Poids des etapes deja passees, de l etape en cours, n0 etape en cours
-// ETAPE COURANTE : nb d items deja passes
+// The counting is done on the following basis :
+// TOTAL : total of phase weights against which to calculate
+// PHASES : weight of past phases and weight of current phase
+// These weights are to be brought back to TOTAL
+// CURRENT PHASE : nb of items and nb of declared cycles
+// Nb of items already passed (complete cycle)
+// CURRENT CYCLE : nb of items of this cycle, total of step weights
+// Weight of steps already passed, of the current step, n0 current step
+// CURRENT STEP : nb of items already passed
static struct zestat
{
Standard_CString itle, name;
- Standard_Real otal, // total des poids des phases
- oldph, // poids des phases deja passes
- phw, // poids de la phase en cours
- otph, // poids des etapes de la phase en cours (cycle en cours)
- oldst, // poids des etapes deja passees (cycle en cours)
- stw; // poids etape en cours
- Standard_Integer nbph, // total nb de phases
- numph, // n0 phase en cours
- n0, n1, // n0 et nb etapes dans phase en cours
+ Standard_Real otal, // total of phase weights
+ oldph, // weight of phases already passed
+ phw, // weight of the current phase
+ otph, // weight of steps in the current phase (current cycle)
+ oldst, // weight of steps already passed (current cycle)
+ stw; // weight of current step
+ Standard_Integer nbph, // total nb of phases
+ numph, // n0 current phase
+ n0, n1, // n0 and nb steps in current phase
nbitp, // nb items total phase
nbcyc, // nb cycles total phase
- olditp, // nb items deja passes (cycles passes) / phase
- numcyc, // n0 cycle en cours / phase
- nbitc, // nb items cycle en cours
- numst, // n0 etape en cours / cycle
- numitem; // nb items deja passes / etape courante
+ olditp, // nb items already passed (cycles passed) / phase
+ numcyc, // n0 current cycle / phase
+ nbitc, // nb items current cycle
+ numst, // n0 current step / cycle
+ numitem; // nb items already passed / current step
} TheStat;
void Interface_STAT::Start(const Standard_Integer items, const Standard_Integer cycles) const
void Interface_STAT::NextPhase(const Standard_Integer items, const Standard_Integer cycles)
{
- // On cumule la phase precedente au total, on efface les donnees "locales"
+ // We accumulate the previous phase to the total, we clear the "local" data
TheStat.numcyc = TheStat.numst = TheStat.olditp = 0;
TheStat.oldst = TheStat.stw = 0.;
if (TheStat.numph >= TheStat.nbph)
}
TheStat.numph++;
- TheStat.oldph += TheStat.phw; // cumule sur cette phase
+ TheStat.oldph += TheStat.phw; // accumulate on this phase
TheStat.nbitp = items;
TheStat.nbcyc = cycles;
statact.Phase(TheStat.numph, TheStat.n0, TheStat.n1, TheStat.phw, TheStat.name);
TheStat.otph = (TheStat.n1 > 1 ? statact.Step(TheStat.n0) : 1.);
- // si un seul cycle, on le demarre; sinon, attendre NextCycle
+ // if a single cycle, we start it; otherwise, wait NextCycle
TheStat.nbitc = 0;
if (cycles == 1)
NextCycle(items);
void Interface_STAT::NextCycle(const Standard_Integer items)
{
- // cumul de ce cycle sur les cycles deja passes, raz etapes
+ // accumulation of this cycle on cycles already passed, reset steps
TheStat.numcyc++;
TheStat.olditp += TheStat.nbitc;
// if (stat.olditem > stat.nbitp) return;
{
if (TheStat.numitem > TheStat.nbitc)
TheStat.numitem = TheStat.nbitc;
- // on compte les items deja passes
- Standard_Real enphase = TheStat.olditp * TheStat.otph + // cycles complets passes
- TheStat.nbitc * TheStat.oldst + // cycle courant, etapes completes passees
- TheStat.numitem * TheStat.stw; // etape courante
- // proportion pour cette phase
+ // we count the items already passed
+ Standard_Real enphase = TheStat.olditp * TheStat.otph + // complete cycles passed
+ TheStat.nbitc * TheStat.oldst + // current cycle, complete steps passed
+ TheStat.numitem * TheStat.stw; // current step
+ // proportion for this phase
Standard_Real prophase = enphase / (TheStat.nbitp * TheStat.otph);
Standard_Integer res = Standard_Integer(prophase * 100.);
if (phase)
return res;
- // voila pour cette phase
- // comptage dans les phases
+ // that's it for this phase
+ // counting in the phases
Standard_Real encours = (TheStat.oldph + TheStat.phw * prophase) / TheStat.otal;
res = Standard_Integer(encours * 100.);
return res;
theroots = new TColStd_HSequenceOfTransient();
for (Standard_Integer i = 1; i <= nb; i++)
{
- // Resultat obtenu depuis le Graph
+ // Result obtained from the Graph
Handle(Standard_Transient) ent = themodel->Value(i);
Handle(TColStd_HSequenceOfTransient) list = agraph.GetSharings(ent);
for (i = 1; i <= nb; i++)
{
- // ATTENTION : Si Entite non chargee donc illisible, basculer sur son
- // "Contenu" equivalent
+ // WARNING: If Entity not loaded hence unreadable, switch to its
+ // equivalent "Content"
Handle(Standard_Transient) ent = themodel->Value(i);
if (themodel->IsRedefinedContent(i))
ent = themodel->ReportEntity(i)->Content();
- // Resultat obtenu via GeneralLib
+ // Result obtained via GeneralLib
Interface_EntityIterator iter;
Handle(Interface_GeneralModule) module;
Standard_Integer CN;
module->FillShared(themodel, CN, ent, iter);
}
- // Entites partagees par <ent> : reste a noter chacune comme "Shared"
+ // Entities shared by <ent>: need to mark each one as "Shared"
for (iter.Start(); iter.More(); iter.Next())
{
Standard_Integer num = themodel->Number(iter.Value());
theHGraph = ahgraph;
}
-// Ajout des "Implied" sur toutes les Entites du Graphe
+// Addition of "Implied" on all Entities of the Graph
/*void Interface_ShareTool::AddImplied (const Handle(Interface_GTool)& gtool)
{
Interface_Graph& thegraph = theHGraph->CGraph();
fl->Init(0);
if (ent == model)
{
- // On passe les racines en revue (l ordre de base est conserve)
+ // We review the roots (the base order is preserved)
Interface_EntityIterator roots = RootEntities();
for (roots.Start(); roots.More(); roots.Next())
{
fl->SetValue(nm, n0);
}
}
- // Attention, y a t il des oublis ?
+ // Warning, are there any omissions?
for (i = 1; i <= nb; i++)
if (fl->Value(i) == 0)
{
{
Handle(TColStd_HSequenceOfTransient) sq = new TColStd_HSequenceOfTransient();
sq->Append(ent);
- // processus de type file
+ // file type process
for (i = 1; i <= sq->Length(); i++)
{ // Length croit
Handle(Standard_Transient) en = sq->Value(i);
Standard_Integer num = model->Number(en);
if (fl->Value(num) != 0)
- continue; // deja vu
+ continue; // already seen
n0++;
fl->SetValue(num, n0);
Interface_EntityIterator sh = Shareds(en);
sq->Append(sh.Content());
}
}
- // Reste a constituer la liste, retourner si necessaire
+ // Remains to constitute the list, return if necessary
Handle(TColStd_HArray1OfInteger) ord = new TColStd_HArray1OfInteger(0, nb);
ord->Init(0);
for (i = 1; i <= nb; i++)
static char defmess[31];
-// Fonctions Satisfies offertes en standard ...
+// Satisfies functions offered as standard ...
// svv #2
// static Standard_Boolean StaticPath(const Handle(TCollection_HAsciiString)& val)
}
// #######################################################################
-// ######### DICTIONNAIRE DES STATICS (static sur Static) ##########
+// ######### STATICS DICTIONARY (static on Static) ##########
Standard_Boolean Interface_Static::Init(const Standard_CString family,
const Standard_CString name,
Handle(Interface_Static) unstat = Interface_Static::Static(name);
if (unstat.IsNull())
return Standard_False;
- // Editions : init donne un petit texte d edition, en 2 termes "cmd var" :
+ // Editions : init gives a small edition text, in 2 terms "cmd var" :
// imin <ival> imax <ival> rmin <rval> rmax <rval> unit <def>
// enum <from> ematch <from> eval <cval>
Standard_Integer i, iblc = 0;
for (i = 0; init[i] != '\0'; i++)
if (init[i] == ' ')
iblc = i + 1;
- // Reconnaissance du sous-cas et aiguillage
+ // Recognition of the sub-case and routing
if (init[0] == 'i' && init[2] == 'i')
unstat->SetIntegerLimit(Standard_False, atoi(&init[iblc]));
else if (init[0] == 'i' && init[2] == 'a')
return 0;
}
-// ########## VALEUR COURANTE ###########
+// ########## CURRENT VALUE ###########
Standard_Boolean Interface_Static::IsSet(const Standard_CString name, const Standard_Boolean proper)
{
ok = Standard_True;
}
else
- { // tous ... sauf famille a $
+ { // all ... except family with $
if (item->Family()[0] == '$')
continue;
}
Interface_Static::Init("XSTEP", "read.maxprecision.val", 'r', "1.");
// encode regularity
- // negatif ou nul : ne rien faire. positif : on y va
+ // negative or null : do nothing. positive : let's go
Interface_Static::Init("XSTEP", "read.encoderegularity.angle", 'r', "0.01");
// compute surface curves
- // 0 : par defaut. 2 : ne garder que le 2D. 3 : ne garder que le 3D
+ // 0 : by default. 2 : keep only 2D. 3 : keep only 3D
// gka S4054
Interface_Static::Init("XSTEP", "read.surfacecurve.mode", 'e', "");
Interface_Static::Init("XSTEP", "read.surfacecurve.mode", '&', "ematch -3");
// Interface_Static::Init("XSTEP" ,"write.surfacecurve.mode", '&',"eval NoAnalytic");
Interface_Static::SetIVal("write.surfacecurve.mode", 1);
- // lastpreci : pour recuperer la derniere valeur codee (cf XSControl)
- // (0 pour dire : pas codee)
+ // lastpreci : to recover the last encoded value (cf XSControl)
+ // (0 to say : not encoded)
//: S4136 Interface_Static::Init("std" ,"lastpreci", 'r',"0.");
// load messages if needed
MoniTool_ValueType Interface_TypedValue::ParamTypeToValueType(const Interface_ParamType type)
{
return (MoniTool_ValueType)type;
-} // meme valeurs
+} // same values
Interface_ParamType Interface_TypedValue::ValueTypeToParamType(const MoniTool_ValueType type)
{
return (Interface_ParamType)type;
-} // meme valeurs
+} // same values
#define Content_LocalShift 5
#define Content_NumberShift 8
-// Cette classe donne les services de base pour definir des entites
-// Unknown (ceci, a defaut d'un double heritage) : description litterale
+// This class provides basic services for defining entities
+// Unknown (this, for lack of double inheritance) : literal description
Interface_UndefinedContent::Interface_UndefinedContent() // Unknown
{
thenbstr = 0;
}
-// .... Les Parametres ....
+// .... The Parameters ....
-// Les parametres sont organises comme suit (pas de FileParameter) :
-// - une liste de descripteurs (tenant sur un entier chacun) en tableau, avec
-// la localisation (Entity/literal), le type (ParamType), le rang dans la
-// la liste ad hoc (Entity ou literal)
-// (5 bits droits pour type; 3 bits pour localisation; restant pouradresse)
-// - pour les litteraux, une liste de String (tableau)
-// - pour les Entity, une liste d Entites (EntityList)
-// L aspect "place memoire" fait preferer des Tableaux a des Sequences, bien
-// que ces dernieres soient plus simples a gerer
-// En effet, il faut reserver et etendre si necessaire ...
+// The parameters are organized as follows (no FileParameter) :
+// - a list of descriptors (each fitting in an integer) in array, with
+// the location (Entity/literal), the type (ParamType), the rank in the
+// the ad hoc list (Entity or literal)
+// (5 right bits for type; 3 bits for location; remaining for address)
+// - for literals, a list of String (array)
+// - for Entity, a list of Entities (EntityList)
+// The "memory space" aspect makes Arrays preferable to Sequences, even though
+// the latter are simpler to manage
+// Indeed, we must reserve and extend if necessary ...
Standard_Integer Interface_UndefinedContent::NbParams() const
{
return thevalues->Value(desc >> Content_NumberShift);
}
-// .... Remplissage des parametres ....
+// .... Parameter filling ....
void Interface_UndefinedContent::Reservate(const Standard_Integer nb, const Standard_Integer nblit)
{
- // Reservation : Si agrandissement, recopier ancien dans nouveau ...
+ // Reservation: If enlargement, copy old to new ...
if (nb > thenbparams)
- { // Reservation en total
+ { // Total reservation
if (theparams.IsNull())
theparams = new TColStd_HArray1OfInteger(1, nb);
else if (nb > theparams->Length())
{
- Standard_Integer nbnew = 2 * thenbparams; // on reserve un peu large
+ Standard_Integer nbnew = 2 * thenbparams; // reserve a bit more
if (nbnew < nb)
nbnew = nb;
Handle(TColStd_HArray1OfInteger) newparams = new TColStd_HArray1OfInteger(1, nbnew);
}
if (nblit > thenbstr)
- { // Reservation en Litteraux
+ { // Literal reservation
if (thevalues.IsNull())
thevalues = new Interface_HArray1OfHAsciiString(1, nblit);
else if (nblit > thevalues->Length())
{
- Standard_Integer nbnew = 2 * thenbstr; // on reserve un peu large
+ Standard_Integer nbnew = 2 * thenbstr; // reserve a bit more
if (nbnew < nblit)
nbnew = nblit;
Handle(Interface_HArray1OfHAsciiString) newvalues =
thevalues = newvalues;
}
}
- // Entites : Parametres - Litteraux. En fait, EntityList est dynamique
+ // Entities: Parameters - Literals. In fact, EntityList is dynamic
}
void Interface_UndefinedContent::AddLiteral(const Interface_ParamType ptype,
Reservate(thenbparams + 1, 0);
Standard_Integer desc = Standard_Integer(ptype);
theentities.Append(ent);
- desc += Content_LocalRef << Content_LocalShift; // "C est une Entite"
- thenbparams++; // Rang : thenbparams - thenbstr
+ desc += Content_LocalRef << Content_LocalShift; // "It is an Entity"
+ thenbparams++; // Rank: thenbparams - thenbstr
desc += ((thenbparams - thenbstr) << Content_NumberShift);
theparams->SetValue(thenbparams, desc);
}
-// .... Edition des parametres ....
+// .... Parameter editing ....
void Interface_UndefinedContent::RemoveParam(const Standard_Integer num)
{
Standard_Integer rang = desc >> Content_NumberShift;
Standard_Integer local = ((desc >> Content_LocalShift) & Content_LocalField);
Standard_Boolean c1ent = (local == Content_LocalRef);
- // Supprimer une Entite
+ // Remove an Entity
if (c1ent)
theentities.Remove(rang);
- // Supprimer un Literal
+ // Remove a Literal
else
- { // thevalues->Remove(rang) mais c est un tableau
+ { // thevalues->Remove(rang) but it is an array
for (Standard_Integer i = rang + 1; i <= thenbstr; i++)
thevalues->SetValue(i - 1, thevalues->Value(i));
Handle(TCollection_HAsciiString) nulstr;
thevalues->SetValue(thenbstr, nulstr);
thenbstr--;
}
- // Supprimer ce parametre de la liste (qui est un tableau)
+ // Remove this parameter from the list (which is an array)
Standard_Integer np; // svv Jan11 2000 : porting on DEC
for (np = num + 1; np <= thenbparams; np++)
theparams->SetValue(np - 1, theparams->Value(np));
theparams->SetValue(thenbparams, 0);
thenbparams--;
- // Renumeroter, Entite ou Literal, selon
+ // Renumber, Entity or Literal, depending
for (np = 1; np <= thenbparams; np++)
{
desc = theparams->Value(np);
const Interface_ParamType ptype,
const Handle(TCollection_HAsciiString)& val)
{
- // On change un parametre. Si deja literal, simple substitution
- // Si Entite, supprimer l entite et renumeroter les Parametres "Entite"
+ // Change a parameter. If already literal, simple substitution
+ // If Entity, remove the entity and renumber the "Entity" Parameters
Standard_Integer desc = theparams->Value(num);
Standard_Integer rang = desc >> Content_NumberShift;
Standard_Integer local = ((desc >> Content_LocalShift) & Content_LocalField);
Standard_Boolean c1ent = (local == Content_LocalRef);
if (c1ent)
{
- // Entite : la supprimer et renumeroter les Parametres de type "Entity"
+ // Entity: remove it and renumber the "Entity" type Parameters
theentities.Remove(rang);
for (Standard_Integer i = 1; i <= thenbparams; i++)
{
&& (desc >> Content_NumberShift) > rang)
theparams->SetValue(i, desc - (1 << Content_NumberShift));
}
- // Et Preparer arrivee d un Literal supplementaire
+ // And prepare arrival of an additional Literal
Reservate(thenbparams, thenbstr + 1);
thenbstr++;
rang = thenbstr;
}
- // Mettre en place la nouvelle valeur et reconstruire le descripteur du Param
+ // Put the new value in place and rebuild the Param descriptor
thevalues->SetValue(rang, val);
desc = Standard_Integer(ptype) + (rang << Content_NumberShift);
theparams->SetValue(num, desc);
const Interface_ParamType ptype,
const Handle(Standard_Transient)& ent)
{
- // On change un Parametre. Si deja Entity, simple substitution
- // Si Literal, supprimer sa valeur et renumeroter les parametres Litteraux
+ // Change a Parameter. If already Entity, simple substitution
+ // If Literal, remove its value and renumber the Literal parameters
Standard_Integer desc = theparams->Value(num);
Standard_Integer rang = desc >> Content_NumberShift;
Standard_Integer local = ((desc >> Content_LocalShift) & Content_LocalField);
Standard_Boolean c1ent = (local == Content_LocalRef);
if (!c1ent)
{
- // Literal : le supprimer et renumeroter les Parametres de type "Entity"
- // (Remove Literal mais dans un tableau)
+ // Literal: remove it and renumber the "Entity" type Parameters
+ // (Remove Literal but in an array)
Standard_Integer i; // svv Jan11 2000 : porting on DEC
for (i = rang + 1; i <= thenbstr; i++)
thevalues->SetValue(i - 1, thevalues->Value(i));
&& (desc >> Content_NumberShift) > rang)
theparams->SetValue(i, desc - (1 << Content_NumberShift));
}
- // Et Preparer arrivee d une Entite supplementaire
+ // And prepare arrival of an additional Entity
thenbstr--;
rang = thenbparams - thenbstr;
- // Mettre en place la nouvelle valeur et reconstruire le descripteur du Param
+ // Put the new value in place and rebuild the Param descriptor
theentities.Append(ent);
}
else
void Interface_UndefinedContent::SetEntity(const Standard_Integer num,
const Handle(Standard_Transient)& ent)
{
- // On change l Entite definie par un Parametre, toutes autres choses egales,
- // A CONDITION que ce soit deja un Parametre de type "Entity"
+ // Change the Entity defined by a Parameter, all other things being equal,
+ // PROVIDED that it is already an "Entity" type Parameter
Standard_Integer desc = theparams->Value(num);
Standard_Integer rang = desc >> Content_NumberShift;
Standard_Integer local = ((desc >> Content_LocalShift) & Content_LocalField);
return theentities;
}
-// toutes les recopies de UndefinedEntity se ressemblent ... Partie commune
+// all copies of UndefinedEntity are similar ... Common part
void Interface_UndefinedContent::GetFromAnother(const Handle(Interface_UndefinedContent)& other,
Interface_CopyTool& TC)
{
//#include <LibCtl_GlobalNode.ixx>
-// Classe generique imbriquee dans Library : utilisee pour construire les
-// listes globales de Modules attaches a une classe instanciee de Library
-// (cf Library pour plus de details)
+// Generic class nested in Library: used to build the
+// global lists of Modules attached to an instantiated class of Library
+// (see Library for more details)
LibCtl_GlobalNode::LibCtl_GlobalNode () { }
-// ATTENTION, Add agit en substitution : pour un Protocol donne, c est le
-// dernier appel qui l emporte
+// WARNING, Add acts as substitution: for a given Protocol, it is the
+// last call wins
void LibCtl_GlobalNode::Add
(const Handle(TheModule)& amodule, const Handle(TheProtocol)& aprotocol)
{
#include <Standard_NoSuchObject.hxx>
-// Liste Globale des Modules, dans laquelle on va se servir
+// Global List of Modules, from which we will be served
static Handle(LibCtl_GlobalNode) theglobal;
-// Donnees pour optimisation (dernier Protocole demande)
+// Data for optimization (last Protocol requested)
static Handle(TheProtocol) theprotocol;
static Handle(LibCtl_Node) thelast;
-// Alimentation de la liste globale
-// ATTENTION : SetGlobal fait de la substitution, c-a-d que c est le dernier
-// qui a raison pour un Protocol donne
+// Feeding the global list
+// WARNING: SetGlobal performs substitution, i.e. it's the last one
+// that is right for a given Protocol
void LibCtl_Library::SetGlobal
(const Handle(TheModule)& amodule, const Handle(TheProtocol)& aprotocol)
{
theglobal->Add(amodule,aprotocol);
}
-// Constructeur d apres Protocole
+// Constructor from Protocol
LibCtl_Library::LibCtl_Library (const Handle(TheProtocol)& aprotocol)
{
Standard_Boolean last = Standard_False;
- if (aprotocol.IsNull()) return; // PAS de protocole = Lib VIDE
+ if (aprotocol.IsNull()) return; // NO protocol = EMPTY Lib
if (!theprotocol.IsNull()) last =
(theprotocol == aprotocol);
if (last) thelist = thelast;
-// Si Pas d optimisation disponible : construire la liste
+// If no optimization available: build the list
else {
AddProtocol(aprotocol);
-// Ceci definit l optimisation (pour la fois suivante)
+// This defines the optimization (for the next time)
thelast = thelist;
theprotocol = aprotocol;
}
LibCtl_Library::LibCtl_Library () { }
-// Ajout d un Protocol : attention, desoptimise (sinon risque de confusion !)
+// Adding a Protocol: beware, deoptimizes (otherwise risk of confusion!)
void LibCtl_Library::AddProtocol
(const Handle(Standard_Transient)& aprotocol)
{
-// DownCast car Protocol->Resources, meme redefini et utilise dans d autres
-// librairies, doit toujours renvoyer le type le plus haut
+// DownCast because Protocol->Resources, even redefined and used in other
+// libraries, must always return the highest type
Handle(TheProtocol) aproto = Handle(TheProtocol)::DownCast(aprotocol);
if (aproto.IsNull()) return;
-// D abord, ajouter celui-ci a la liste : chercher le Node
+// First, add this one to the list: search for the Node
Handle(LibCtl_GlobalNode) curr;
for (curr = theglobal; !curr.IsNull(); ) { // curr->Next : plus loin
const Handle(TheProtocol)& protocol = curr->Protocol();
break; // UN SEUL MODULE PAR PROTOCOLE
}
}
- curr = curr->Next(); // cette formule est refusee dans "for"
+ curr = curr->Next(); // this formula is refused in "for"
}
-// Ensuite, Traiter les ressources
+// Then, process the resources
Standard_Integer nb = aproto->NbResources();
for (Standard_Integer i = 1; i <= nb; i ++) {
AddProtocol (aproto->Resource(i));
}
-// Ne pas oublier de desoptimiser
+// Don't forget to deoptimize
theprotocol.Nullify();
thelast.Nullify();
}
void LibCtl_Library::SetComplete ()
{
thelist = new LibCtl_Node;
-// On prend chacun des Protocoles de la Liste Globale et on l ajoute
+// We take each of the Protocols from the Global List and add it
Handle(LibCtl_GlobalNode) curr;
for (curr = theglobal; !curr.IsNull(); ) { // curr->Next : plus loin
const Handle(TheProtocol)& protocol = curr->Protocol();
-// Comme on prend tout tout tout, on ne se preoccupe pas des Ressources !
+// Since we take everything, we don't worry about Resources!
if (!protocol.IsNull()) thelist->AddNode(curr);
- curr = curr->Next(); // cette formule est refusee dans "for"
+ curr = curr->Next(); // this formula is refused in "for"
}
}
-// Selection : Tres fort, on retourne le Module correspondant a un Type
-// (ainsi que le CaseNumber retourne par le protocole correspondant)
+// Selection: Very powerful, we return the Module corresponding to a Type
+// (as well as the CaseNumber returned by the corresponding protocol)
Standard_Boolean LibCtl_Library::Select
(const TheObject& obj,
Handle(TheModule)& module, Standard_Integer& CN) const
{
- module.Nullify(); CN = 0; // Reponse "pas trouve"
+ module.Nullify(); CN = 0; // Response "not found"
if (thelist.IsNull()) return Standard_False;
Handle(LibCtl_Node) curr = thelist;
for (curr = thelist; !curr.IsNull(); ) { // curr->Next : plus loin
return Standard_True;
}
}
- curr = curr->Next(); // cette formule est refusee dans "for"
+ curr = curr->Next(); // this formula is refused in "for"
}
- return Standard_False; // ici, pas trouce
+ return Standard_False; // here, not found
}
//#include <LibCtl_Node.ixx>
-// Classe generique imbriquee dans Library : utilisee pour construire la
-// listes de Modules d une librairie (cf Library pour plus de details)
-// (En fait : Liste de Global Nodes -> Module + Protocol)
+// Generic class nested in Library: used to build the
+// lists of Modules of a library (see Library for more details)
+// (In fact: List of Global Nodes -> Module + Protocol)
LibCtl_Node::LibCtl_Node () { }
static Standard_Boolean stachr = Standard_False;
// static OSD_Timer chrono;
-// because merdouille link dynamique & perf, ne creer le static qu au 1er usage
+// because mess of dynamic link & perf, only create the static on 1st usage
static OSD_Timer& chrono()
{
static OSD_Timer chr;
TCollection_AsciiString aname(name);
Standard_Integer subs = thesubst;
- // SetChange (calculer la position d apres Name)
+ // SetChange (calculate position from Name)
if (thesubst < 0)
{
if (name[0] != '\0')
return 0;
}
-// #### RETOUR DES VALEURS ####
+// #### RETURN OF VALUES ####
TopoDS_Shape MoniTool_CaseData::Shape(const Standard_Integer nd) const
{
return Standard_True;
}
-// #### MESSAGES ET DEFINITIONS ####
+// #### MESSAGES AND DEFINITIONS ####
Message_Msg MoniTool_CaseData::Msg() const
{
theeadds.Bind(itad.Key(), itad.Value());
}
- // on duplique la string
+ // we duplicate the string
if (!thehval.IsNull())
thehval = new TCollection_HAsciiString(other->CStringValue());
}
Standard_Boolean MoniTool_TypedValue::AddDef(const Standard_CString init)
{
- // Editions : init donne un petit texte d edition, en 2 termes "cmd var" :
+ // Editions : init gives a small edition text, in 2 terms "cmd var" :
Standard_Integer i, iblc = 0;
for (i = 0; init[i] != '\0'; i++)
if (init[i] == ' ')
iblc = i + 1;
if (iblc == 0)
return Standard_False;
- // Reconnaissance du sous-cas et aiguillage
+ // Recognition of sub-case and routing
if (init[0] == 'i' && init[2] == 'i') // imin ival
SetIntegerLimit(Standard_False, atoi(&init[iblc]));
else if (init[0] == 'i' && init[2] == 'a') // imax ival
return theunidef.ToCString();
}
-// ****** les enums ******
+// ****** the enums ******
void MoniTool_TypedValue::StartEnum(const Standard_Integer start, const Standard_Boolean match)
{
{
theenums->SetValue(num, TCollection_AsciiString(val));
}
- // On met AUSSI dans le dictionnaire
+ // We ALSO put in the dictionary
// else {
theeadds.Bind(val, num);
// }
return thesatisn.ToCString();
}
-// ########### VALEUR DU STATIC ############
+// ########### STATIC VALUE ############
Standard_Boolean MoniTool_TypedValue::IsSetValue() const
{
return theinterp(this, hval, native);
if (thetype == MoniTool_ValueEnum)
{
- // On admet les deux formes : Enum de preference, sinon Integer
+ // We accept both forms : Enum preferably, otherwise Integer
Standard_Integer startcase, endcase;
Standard_Boolean match;
EnumDef(startcase, endcase, match);
return Standard_True;
}
case MoniTool_ValueEnum: {
- // On admet les deux formes : Enum de preference, sinon Integer
+ // We accept both forms : Enum preferably, otherwise Integer
Standard_Integer startcase, endcase; // unused ival;
Standard_Boolean match;
EnumDef(startcase, endcase, match);
return Standard_True;
if (EnumCase(val->ToCString()) >= startcase)
return Standard_True;
- // Ici, on admet un entier dans la fourchette
+ // Here, we accept an integer in the range
//// if (val->IsIntegerValue()) ival = atoi (val->ToCString());
// PTV 16.09.2000 The if is comment, cause this check is never been done (You can see the
{
S << "\n*******************************************************************\n";
if (mode == 1)
- { // Statistiques de base
+ { // Basic statistics
S << "******** Basic Statistics ********" << std::endl;
Standard_Integer nbr = 0, nbe = 0, nbw = 0;
IMPLEMENT_STANDARD_RTTIEXT(Transfer_MultipleBinder, Transfer_Binder)
-// Resultat Multiple
-// Possibilite de definir un Resultat Multiple : plusieurs objets resultant
-// d un Transfert, sans pouvoir les distinguer
-// N.B. : Pour l heure, tous Transients (pourra evoluer)
+// Multiple Result
+// Possibility to define a Multiple Result : several objects resulting
+// from a Transfer, without being able to distinguish them
+// N.B. : For now, all Transients (may evolve)
Transfer_MultipleBinder::Transfer_MultipleBinder() {}
Standard_Boolean Transfer_MultipleBinder::IsMultiple() const
return "(list)";
}
-// .... Gestion du Resultat Multiple ....
+// .... Multiple Result Management ....
void Transfer_MultipleBinder::AddResult(const Handle(Standard_Transient)& res)
{
{
Handle(Transfer_Binder) binder = FindAndMask(start);
if (binder.IsNull())
- return; // rien a faire ...
+ return; // nothing to do ...
Handle(Interface_Check) ach = binder->CCheck();
ach->Mend(pref);
}
Handle(Transfer_Binder) former = Find(start);
Handle(Transfer_SimpleBinderOfTransient) binder =
Handle(Transfer_SimpleBinderOfTransient)::DownCast(former);
- // Binding sur place ?
+ // Binding in place?
if (!binder.IsNull())
{
if (binder->Status() == Transfer_StatusVoid)
{
if (!former.IsNull())
former->SetStatusExec(Transfer_StatusDone); //+
- return Handle(Transfer_Binder)(); // Binder Null ... que faire d autre ?
+ return Handle(Transfer_Binder)(); // Null Binder ... what else to do?
}
if (therootl >= thelevel)
themain->SetStart(ent);
themain->SetBinder(binder);
themain->Fill(TP);
- // Substitution de resultat pour la Shape (-> HShape) : pas ici, on est
- // dans le pk Transfer qui est general et ne sait pas ce qu est une Shape ...
+ // Result substitution for the Shape (-> HShape): not here, we are
+ // in the Transfer package which is general and doesn't know what a Shape is ...
if (!TP->Model().IsNull())
themodel = TP->Model();
if (themodel.IsNull())
IMPLEMENT_STANDARD_RTTIEXT(Transfer_SimpleBinderOfTransient, Transfer_Binder)
-// "Handle(Standard_Transient)" : la classe de base pour le Resultat
+// "Handle(Standard_Transient)": the base class for the Result
Transfer_SimpleBinderOfTransient::Transfer_SimpleBinderOfTransient() {}
// Standard_Boolean Transfer_SimpleBinderOfTransient::IsMultiple() const
return Interface_CopyTool::Copy(entfrom, entto, mapped, errstat);
if (!result->IsKind(STANDARD_TYPE(Transfer_SimpleBinderOfTransient)))
- return Standard_False; // Produit qq chose, mais quoi ?
+ return Standard_False; // Produces something, but what ?
entto = GetCasted(Transfer_SimpleBinderOfTransient, result)->Result();
return Standard_True;
}
Transfer_TransferInput::Transfer_TransferInput() {}
-// Resultats : Pour le Modele ...
+// Results : For the Model ...
Interface_EntityIterator Transfer_TransferInput::Entities(Transfer_TransferIterator& list) const
{
if (binder->IsKind(STANDARD_TYPE(Transfer_VoidBinder)))
continue;
- // Vrai resultat : doit etre transient (simple ou liste)
+ // True result : must be transient (simple or list)
DeclareAndCast(Transfer_SimpleBinderOfTransient, transb, binder);
DeclareAndCast(Transfer_MultipleBinder, multi, binder);
if (!transb.IsNull())
#include <Transfer_SimpleBinderOfTransient.hxx>
#include <Transfer_TransferIterator.hxx>
-static Handle(Standard_Transient) nultrans; // pour retour const&(Null)
+static Handle(Standard_Transient) nultrans; // for const&(Null) return
Transfer_TransferIterator::Transfer_TransferIterator()
{
return theitems->Value(thecurr);
}
-// .... Acces aux Donnees du Binder Courant ....
+// .... Access to Current Binder Data ....
Standard_Boolean Transfer_TransferIterator::HasResult() const
{
Handle(Transfer_Binder) atr = Value();
if (!atr->IsMultiple())
btype = atr->ResultType();
- // ResultType de Binder prend en compte le Type Dynamique pour les Handle
+ // Binder's ResultType takes into account the Dynamic Type for Handles
return btype;
}
*/
}
-// Resultats :
-// Pour transferer tout simplement toutes les racines d'un modele d'interface
-// Chacune est notee "Root" dans le Process final
+// Results :
+// To transfer quite simply all roots of an interface model
+// Each one is noted "Root" in the final Process
void Transfer_TransferOutput::TransferRoots(const Message_ProgressRange& theProgress)
{
Standard_OStream& S) const
{
S << "\n*******************************************************************\n";
- // if (mode == 1) { // Statistiques de base
+ // if (mode == 1) { // Basic statistics
S << "******** Basic Statistics ********" << std::endl;
Handle(Interface_InterfaceModel) model = Model();
if (sm.IsNull())
return TopAbs_EXTERNAL;
const TopoDS_Shape& mapped = sm->Value();
- // l egalite est assumee, on ne teste que l orientation
+ // equality is assumed, we only test the orientation
if (mapped.Orientation() != shape.Orientation())
return TopAbs_REVERSED;
return TopAbs_FORWARD;
if (vtx.Contains(avtx))
{
li->Append(TP->Mapped(i));
- break; // break de ce for interieur, entite suivante
+ break; // break from this inner for, next entity
}
}
}
}
// ###########################
-// Help du Transfer : controle de valeur + help
+// Transfer Help : value control + help
//=================================================================================================
}
// ###########################
-// Transfer : on fait ce qu il faut par defaut (avec ActorWrite)
-// peut etre redefini ...
+// Transfer : we do what is needed by default (with ActorWrite)
+// can be redefined ...
//=================================================================================================
}
// ###########################
-// Cutomisation ! On enregistre des Items pour une WorkSession
-// (annule et remplace)
-// Ensuite, on les remet en place a la demande
+// Customization ! We register Items for a WorkSession
+// (cancels and replaces)
+// Then, we put them back in place on demand
//=================================================================================================
{
sout << "Donner [mode facultatif : item ou root] , NUMERO , nom DRAW facultatif" << std::endl;
sout << " mode si present : item ou root, sinon n0 d entite modele" << std::endl;
- sout << " NUMERO entier : d entite, d item transfert ou de root transfert\n"
- << " ou * pour dire tous" << std::endl;
+ sout << " INTEGER NUMBER : of entity, of transfer item or of transfer root\n"
+ << " or * to say all" << std::endl;
return IFSelect_RetError;
}
Standard_Integer mode = 0, num = 0;
{
if (mode == 0)
{
- sout << "Pas de modele, preciser n0 d item de transfert" << std::endl;
+ sout << "No model, specify n0 of transfer item" << std::endl;
return IFSelect_RetError;
}
}
if (mode == 0)
{
- sout << "Entite de modele";
+ sout << "Model entity";
max = model->NbEntities();
}
if (mode == 1)
{
- sout << "Item de transfert";
+ sout << "Transfer item";
max = TP->NbMapped();
}
if (mode == 2)
{
- sout << "Racine de transfert";
+ sout << "Transfer root";
max = TP->NbRoots();
}
if (tout)
{
n1 = 1;
n2 = max;
- sout << ", listage de 1 a " << max << std::endl;
+ sout << ", listing from 1 to " << max << std::endl;
}
else if (num <= 0 || num > max)
{
else
{
n1 = n2 = num;
- nbvar = -1; // nbvar : 1ere shape simple = pas de n0
+ nbvar = -1; // nbvar : 1st simple shape = no n0
sout << ", n0 " << num << std::endl;
}
if (!binder->HasResult())
{
if (!tout)
- sout << "Entite n0 " << num << " : pas de resultat" << std::endl;
+ sout << "Entity n0 " << num << " : no result" << std::endl;
continue;
}
sh = TransferBRep::ShapeResult(binder);
Handle(Standard_Transient) resu = trb->Result();
if (resu.IsNull())
{
- sout << "Entite n0 " << num << " : pas de resultat" << std::endl;
+ sout << "Entity n0 " << num << " : no result" << std::endl;
continue;
}
DeclareAndCast(Geom_Geometry, geom, resu);
if (num == 0 || cascomp)
{
- TopoDS_Compound C; // pour cas compound
+ TopoDS_Compound C; // for compound case
BRep_Builder B;
B.MakeCompound(C);
TopoDS_Shape sh = TR->ShapeResult(mdl->Value(num));
if (sh.IsNull())
{
- sout << " Pas de resultat pour " << arg1 << std::endl;
+ sout << " No result for " << arg1 << std::endl;
return IFSelect_RetError;
}
if (argc > 2)
static IFSelect_ReturnStatus XSControl_trimport(const Handle(IFSelect_SessionPilot)& pilot)
{
- // FileName ou . (pour courant) VarName GiveList (obligatoire)
- // GiveList : * pour xst-transferrable-roots
+ // FileName or . (for current) VarName GiveList (mandatory)
+ // GiveList : * for xst-transferrable-roots
Handle(XSControl_WorkSession) WS = XSControl::Session(pilot);
Standard_Integer argc = pilot->NbWords();
Handle(XSControl_TransferWriter) TW = XSControl::Session(pilot)->TransferWriter();
if (argc < 2)
{
- sout << " donner nom de shape draw" << std::endl;
+ sout << " give draw shape name" << std::endl;
return IFSelect_RetError;
}
sout << "Attention, on alimente le modele courant ..." << std::endl;
TopoDS_Shape Shape = XSControl::Vars(pilot)->GetShape(ai);
if (Shape.IsNull())
{
- sout << "pas un nom de shape draw:" << arg1 << std::endl;
+ sout << "not a draw shape name:" << arg1 << std::endl;
continue;
}
sout << "Pour Shape : " << ai;
// name = "*" -> tous les transferts RACINES du TP
// name = "**" -> tous les transferts du TP : VRAIMENT TOUS
// name = "." -> reperage graphique (not yet impl)
- // name = nom(n1-n2) avec n1,n2 entiers : les variables de nom nomn1 a nomn2
+ // name = nom(n1-n2) with n1,n2 integers : the variables of name nomn1 to nomn2
Message_Messenger::StreamBuffer sout = Message::SendInfo();
if (list.IsNull())
list = new TopTools_HSequenceOfShape();
n2 = atoi(&name[moins + 1]);
n1 = atoi(&name[paro + 1]);
if (n1 < 0)
- n1 += n2; // sinon on a n1-n2
+ n1 += n2; // otherwise we have n1-n2
}
// liste
if (n1 <= n2 && n1 > 0)
Standard_Integer nomdeb, nomfin;
nomdeb = resfile.SearchFromEnd("/");
if (nomdeb <= 0)
- nomdeb = resfile.SearchFromEnd("\\"); // pour NT
+ nomdeb = resfile.SearchFromEnd("\\"); // for NT
if (nomdeb < 0)
nomdeb = 0;
nomfin = resfile.SearchFromEnd(".");
Standard_Integer mod2 = 0;
// g : general c : check (compte) C (liste) f : fails(compte) F (liste)
// resultats racines : n : n0s entites s : status b : binders
- // t : compte par type r : compte par resultat l : liste(type-resultat)
- // *n *s *b *t *r *l : idem sur tout
- // ?n etc.. : idem sur resultats anormaux
- // ? tout court pour help
+ // t : count by type r : count by result l : list(type-result)
+ // *n *s *b *t *r *l : same on everything
+ // ?n etc.. : same on abnormal results
+ // ? short for help
if (argc > 1)
{
const Handle(Transfer_TransientProcess)& TP =
XSControl::Session(pilot)->TransferReader()->TransientProcess();
// **** trecord : TransferReader ****
- Standard_Boolean tous = (argc == 1);
- Standard_Integer num = -1;
- const Handle(Interface_InterfaceModel)& mdl = XSControl::Session(pilot)->Model();
- const Handle(XSControl_TransferReader)& TR = XSControl::Session(pilot)->TransferReader();
+ Standard_Boolean all = (argc == 1);
+ Standard_Integer num = -1;
+ const Handle(Interface_InterfaceModel)& mdl = XSControl::Session(pilot)->Model();
+ const Handle(XSControl_TransferReader)& TR = XSControl::Session(pilot)->TransferReader();
Handle(Standard_Transient) ent;
Message_Messenger::StreamBuffer sout = Message::SendInfo();
if (mdl.IsNull() || TR.IsNull() || TP.IsNull())
sout << " init not done" << std::endl;
return IFSelect_RetError;
}
- if (!tous)
+ if (!all)
num = atoi(arg1);
- // Enregistrer les racines
- if (tous)
+ // Record the roots
+ if (all)
{
Standard_Integer nb = TP->NbRoots();
sout << " Recording " << nb << " Roots" << std::endl;
const Handle(Transfer_FinderProcess)& FP =
XSControl::Session(pilot)->TransferWriter()->FinderProcess();
// **** twstat ****
- // Pour Write
+ // For Write
Message_Messenger::StreamBuffer sout = Message::SendInfo();
if (!FP.IsNull())
{
therootsta = Standard_False;
theroots.Clear();
thesession = WS;
- // Il doit y avoir un Controller ... Sinon onverra plus tard (apres SetNorm)
+ // There must be a Controller ... Otherwise we'll see later (after SetNorm)
if (thesession->NormAdaptor().IsNull())
return;
Handle(Interface_InterfaceModel) model = thesession->Model();
return tm;
}
-// si resultat avec type: a exploiter tout de suite !
+// if result with type: to be exploited immediately!
XSControl_SignTransferStatus::XSControl_SignTransferStatus()
: IFSelect_Signature("Transfer Status")
Handle(Transfer_ResultFromModel) res = new Transfer_ResultFromModel;
res->Fill(myTP, ent);
- // Cas du resultat Shape : pour resultat principal, faire HShape ...
+ // Case of Shape result : for main result, make HShape ...
Handle(Transfer_Binder) binder = res->MainResult()->Binder();
DeclareAndCast(TransferBRep_ShapeBinder, shb, binder);
if (!shb.IsNull())
return Standard_True;
}
-// ######### ACCES UN PEU PLUS FIN #########
+// ######### SLIGHTLY MORE REFINED ACCESS #########
//=================================================================================================
XSControl_Utils xu;
TopoDS_Shape sh = xu.BinderShape(mres->Binder());
- // Ouh la vilaine verrue
+ // Ooh the ugly wart
Standard_Real tolang = Interface_Static::RVal("read.encoderegularity.angle");
if (tolang <= 0 || sh.IsNull())
return sh;
return Standard_True;
}
-// <<<< >>>> ATTENTION, pas terrible : mieux vaudrait
-// faire une map inverse et la consulter
-// ou muscler ResultFromModel ...
+// <<<< >>>> CAUTION, not great : it would be better
+// to make an inverse map and consult it
+// or beef up ResultFromModel ...
//=================================================================================================
const Standard_Integer mode) const
{
Handle(Standard_Transient) nulh;
- // cas de la shape
+ // case of the shape
XSControl_Utils xu;
TopoDS_Shape sh = xu.BinderShape(res);
if (!sh.IsNull())
if (mode == 0 || mode == 1)
{
- // on regarde dans le TransientProcess (Roots ou tous Mappeds)
+ // we look in the TransientProcess (Roots or all Mappeds)
if (!myTP.IsNull())
{
nb = (mode == 0 ? myTP->NbRoots() : myTP->NbMapped());
return nulh; // Null
}
- // Recherche dans myResults (racines)
+ // Search in myResults (roots)
// 2 : Main only 3 : Main + one sub; 4 : all
if (mode >= 2)
{
}
}
- // autres cas non encore implementes
+ // other cases not yet implemented
return nulh;
}
-// <<<< >>>> ATTENTION, encore moins bien que le precedent
+// <<<< >>>> CAUTION, even worse than the previous one
//=================================================================================================
XSControl_Utils xu;
if (mode == 0 || mode == 1 || mode == -1)
{
- // on regarde dans le TransientProcess
+ // we look in the TransientProcess
if (!myTP.IsNull())
{
nb = (mode == 0 ? myTP->NbRoots() : myTP->NbMapped());
{
if (sh == res)
return ent;
- // priorites moindre : Same (tjrs) ou Partner (mode < 0)
+ // lesser priorities : Same (always) or Partner (mode < 0)
if (sh.IsSame(res))
samesh = ent;
if (mode == -1 && sh.IsPartner(res))
}
}
}
- // Ici, pas trouve de vraie egalite. Priorites moindres : Same puis Partner
+ // Here, no true equality found. Lesser priorities: Same then Partner
if (!samesh.IsNull())
return samesh;
if (!partner.IsNull())
- return partner; // calcule si mode = -1
+ return partner; // calculated if mode = -1
return nulh;
}
- // Recherche dans myResults (racines)
+ // Search in myResults (roots)
// 2 : Main only 3 : Main + one sub; 4 : all
if (mode >= 2)
{
return lt;
TopTools_MapOfShape shapes;
- // On convertit res en une map, pour test de presence rapide
+ // We convert res to a map, for rapid presence test
Standard_Integer i, j, nb = res->Length();
if (nb == 0)
return lt;
for (i = 1; i <= nb; i++)
shapes.Add(res->Value(i));
- // A present, recherche et enregistrement
+ // Now, search and registration
XSControl_Utils xu;
if (mode == 0 || mode == 1)
{
- // on regarde dans le TransientProcess
+ // we look in the TransientProcess
if (!myTP.IsNull())
{
nb = (mode == 0 ? myTP->NbRoots() : myTP->NbMapped());
}
}
- // Recherche dans myResults (racines)
+ // Search in myResults (roots)
// 2 : Main only 3 : Main + one sub; 4 : all
if (mode >= 2)
{
Interface_CheckIterator chl;
if (myModel.IsNull() || ent.IsNull())
return chl;
- // Check-List COMPLETE ... tout le Modele
+ // Check-List COMPLETE ... the entire Model
if (ent == myModel)
{
Standard_Integer i, nb = myModel->NbEntities();
}
}
}
- // Check-List sur une LISTE ...
+ // Check-List on a LIST ...
else if (ent->IsKind(STANDARD_TYPE(TColStd_HSequenceOfTransient)))
{
DeclareAndCast(TColStd_HSequenceOfTransient, list, ent);
}
}
- // sinon, Check-List sur une entite : Last ou FinalResult
+ // otherwise, Check-List on an entity: Last or FinalResult
else if (level < 0)
{
if (myTP.IsNull())
myTP = new Transfer_TransientProcess(myModel->NbEntities());
Handle(Transfer_ActorOfTransientProcess) actor;
- myTP->SetActor(actor); // -> RAZ
+ myTP->SetActor(actor); // -> Reset
actor = Actor();
- myTP->SetActor(actor); // Set proprement dit
+ myTP->SetActor(actor); // Set properly
myTP->SetErrorHandle(Standard_True);
NCollection_DataMap<TCollection_AsciiString, Handle(Standard_Transient)>& aTPContext =
myTP->Context();
else
myTP->SetGraph(myGraph);
- // pour le log-file
+ // for the log-file
if (level > 1)
{
Standard_Integer num = myModel->Number(ent);
sout << "\n*******************************************************************\n";
}
- // seule difference entre TransferRoots et TransferOne
+ // only difference between TransferRoots and TransferOne
Standard_Integer res = 0;
const Handle(Standard_Transient)& obj = ent;
TP.Transfer(obj, theProgress);
return res;
myTP->SetRoot(obj);
- // Resultat ...
+ // Result ...
Handle(Transfer_Binder) binder = myTP->Find(obj);
if (binder.IsNull())
return res;
Standard_Integer i, nb = list->Length();
- // Pour le log-file
+ // For the log-file
if (level > 0)
{
Message_Messenger::StreamBuffer sout = myTP->Messenger()->SendInfo();
sout << "\n*******************************************************************\n";
}
- // seule difference entre TransferRoots et TransferOne
+ // only difference between TransferRoots and TransferOne
Standard_Integer res = 0;
nb = list->Length();
Handle(Standard_Transient) obj;
TP.Transfer(obj, aPS.Next());
myTP->SetRoot(obj);
- // Resultat ...
+ // Result ...
Handle(Transfer_Binder) binder = myTP->Find(obj);
if (binder.IsNull())
continue;
return res;
}
-// <<<< >>>> passage Graph : judicieux ?
+// <<<< >>>> Graph passing: judicious?
//=================================================================================================
else
myTP->SetGraph(myGraph);
- // Pour le log-file
+ // For the log-file
if (level > 0)
{
Interface_EntityIterator roots = G.RootEntities();
if (theProgress.UserBreak())
return -1;
- // Les entites transferees sont notees "asmain"
+ // The transferred entities are noted as "asmain"
Standard_Integer i, n = myTP->NbMapped();
for (i = 1; i <= n; i++)
{
RecordResult(ent);
}
- // Resultat ... on note soigneuseument les Shapes
+ // Result ... we carefully note the Shapes
myShapeResult = TransferBRep::Shapes(myTP, Standard_True);
// ???? Et ici, il faut alimenter Imagine ...
return myShapeResult->Length();
const Standard_Integer what,
const Standard_Integer mode) const
{
- // A ameliorer ... !
+ // To be improved ... !
sout << "\n*******************************************************************\n";
sout << "****** Statistics on Transfer (Read) ******" << std::endl;
sout << "\n*******************************************************************\n";
sout << "****** Data recorded on Last Transfer ******" << std::endl;
PrintStatsProcess(myTP, what, mode);
}
- // reste what = 10 : on liste les racines des final results
+ // remaining what = 10: we list the roots of final results
sout << "****** Final Results ******" << std::endl;
if (myModel.IsNull())
{
// **** UTILITAIRE DE STATISTIQUES GENERALES
-// BinderStatus retourne une valeur :
-// 0 Binder Null. 1 void 2 Warning seul 3 Fail seul
-// 11 Resultat OK. 12 Resultat+Warning. 13 Resultat+Fail
+// BinderStatus returns a value:
+// 0 Binder Null. 1 void 2 Warning only 3 Fail only
+// 11 Result OK. 12 Result+Warning. 13 Result+Fail
//=================================================================================================
sout << "****** Fail messages ******\n";
sout << "*******************************************************************\n";
- // Cas what = 1,2,3 : contenu du TP (binders)
+ // Case what = 1,2,3: content of TP (binders)
Standard_Boolean nolist = list.IsNull();
Handle(Interface_InterfaceModel) model = TP->Model();
Standard_Integer i = 0, nb = itrp.Number();
if (!nolist)
itrp.Filter(list);
- Standard_Integer nl = itrp.Number(); // apres filtrage
+ Standard_Integer nl = itrp.Number(); // after filtering
Handle(IFSelect_SignatureList) counter;
if (mode > 2)
counter = new IFSelect_SignatureList(mode == 6);
- Standard_Boolean notrec = (!nolist && mode > 2); // noter les "no record"
+ Standard_Boolean notrec = (!nolist && mode > 2); // note the "no record"
IFSelect_PrintCount pcm = IFSelect_CountByItem;
if (mode == 6)
pcm = IFSelect_ListByItem;
if (mode != 3)
{
stat = BinderStatus(binder, mess);
- // 0 Binder Null. 1 void 2 Warning seul 3 Fail seul
- // 11 Resultat OK. 12 Resultat+Warning. 13 Resultat+Fail
+ // 0 Binder Null. 1 void 2 Warning only 3 Fail only
+ // 11 Result OK. 12 Result+Warning. 13 Result+Fail
if (stat == 2)
nbw++;
if (stat == 3)
}
}
- // Fin de l iteration
+ // End of iteration
}
if (!counter.IsNull())
counter->PrintList(sout, model, pcm);
return;
}
- // Cas what = 4,5 : check-list
+ // Case what = 4,5: check-list
if (what == 4 || what == 5)
{
XSControl_Utils::XSControl_Utils() {}
// #########################################################
-// ####### Fonctions de TRACE #######
+// ####### TRACE Functions #######
void XSControl_Utils::TraceLine(const Standard_CString line) const
{
}
// #########################################################
-// ####### TRANSIENT : Quelques acces de base #######
+// ####### TRANSIENT : Some basic access #######
Standard_Boolean XSControl_Utils::IsKind(const Handle(Standard_Transient)& item,
const Handle(Standard_Type)& what) const
return tn;
}
-// ####### TRANSIENT : Fonctions de liste #######
+// ####### TRANSIENT : List functions #######
Handle(Standard_Transient) XSControl_Utils::TraValue(const Handle(Standard_Transient)& seqval,
const Standard_Integer num) const
}
// ##########################################################
-// ####### STRING : Ascii de base #######
+// ####### STRING : Basic Ascii #######
Standard_CString XSControl_Utils::ToCString(const Handle(TCollection_HAsciiString)& strval) const
{
return TCollection_AsciiString(strcon);
}
-// ####### STRING : Extended de base #######
+// ####### STRING : Basic Extended #######
Standard_ExtString XSControl_Utils::ToEString(
const Handle(TCollection_HExtendedString)& strval) const
}
// ##########################################################
-// ####### SHAPES : Acces de base #######
+// ####### SHAPES : Basic access #######
TopoDS_Shape XSControl_Utils::CompoundFromSeq(const Handle(TopTools_HSequenceOfShape)& seqval) const
{
typ = ShapeType(sh, compound);
if (res == TopAbs_SHAPE)
res = typ;
- // Egalite : OK; Pseudo-Egalite : EDGE/WIRE ou FACE/SHELL
+ // Equality: OK; Pseudo-Equality: EDGE/WIRE or FACE/SHELL
else if (res == TopAbs_EDGE && typ == TopAbs_WIRE)
res = typ;
else if (res == TopAbs_WIRE && typ == TopAbs_EDGE)
TopoDS_Shape sh, sh0;
Standard_Integer nb = 0;
- // Compound : on le prend, soit tel quel, soit son contenu
+ // Compound: we take it, either as is, or its content
if (typ == TopAbs_COMPOUND || typ == TopAbs_COMPSOLID)
{
TopoDS_Compound C;
if (mode >= 1 && mode <= 4)
IFSelect_WorkSession::ClearData(mode);
- // 5 : Transferts seuls
- // 6 : Resultats forces seuls
- // 7 : Management, y compris tous transferts (forces/calcules), views
+ // 5 : Transfers only
+ // 6 : Forced results only
+ // 7 : Management, including all transfers (forced/calculated), views
if (mode == 5 || mode == 7)
{
const Standard_Mutex::Sentry aMutexLock(WS_GLOBAL_MUTEX);
// Old norm and results
myTransferReader->Clear(-1);
- // ???? En toute rigueur, menage a faire dans XWS : virer les items
- // ( a la limite, pourquoi pas, refaire XWS en entier)
+ // ???? Strictly speaking, cleanup to do in XWS: remove the items
+ // ( at the limit, why not, redo XWS entirely)
Handle(XSControl_Controller) newadapt = XSControl_Controller::Recorded(normname);
if (newadapt.IsNull())
}
// ##########################################
-// ############ Contexte de Transfert ######
+// ############ Transfer Context ######
// ##########################################
//=================================================================================================
FP->StartTrace(binder, finder, 0, 0); // pb sout/S
if (!ent.IsNull())
{
- S << " ** Resultat Transient, type " << ent->DynamicType()->Name();
+ S << " ** Transient Result, type " << ent->DynamicType()->Name();
const Handle(Interface_InterfaceModel)& model = Model();
if (!model.IsNull())
{
TP->StartTrace(binder, ent, 0, 0);
}
- // *** CHECK (commun READ+WRITE) ***
+ // *** CHECK (common READ+WRITE) ***
if (!binder.IsNull())
{
const Handle(Interface_Check) ch = binder->Check();
else
SetTransferReader(myTransferReader);
- // mode = 0 fait par SetTransferReader suite a Nullify
+ // mode = 0 done by SetTransferReader following Nullify
if (mode == 1)
{
if (!myTransferReader.IsNull())
TP->SetGraph(HGraph());
if (TP->Model() != Model())
return Standard_False;
- // TR ne doit pas bouger, c est un "crochet" pour signatures, selections ...
- // En revanche, mieux vaut le RAZ
+ // TR must not move, it's a "hook" for signatures, selections ...
+ // On the other hand, better to reset it
// Handle(XSControl_TransferReader) TR = new XSControl_TransferReader;
Handle(XSControl_TransferReader) TR = myTransferReader;
TR->Clear(-1);
- SetTransferReader(TR); // avec le meme mais le reinitialise
- TR->SetTransientProcess(TP); // et prend le nouveau TP
+ SetTransferReader(TR); // with the same but reinitializes it
+ TR->SetTransientProcess(TP); // and takes the new TP
return Standard_True;
}
status = myTransferWriter->TransferWriteShape(model, shape, theProgress);
if (theProgress.UserBreak())
return IFSelect_RetStop;
- // qui s occupe de tout, try/catch inclus
+ // which takes care of everything, try/catch included
// skl insert param compgraph for XDE writing 10.12.2003
if (compgraph)
const Standard_Boolean scratch)
{
thesession = WS;
- // Un controller doit etre defini ...
+ // A controller must be defined ...
thesession->InitTransferReader(0);
Handle(Interface_InterfaceModel) model = Model(scratch);
}