+// Copyright (c) 1999-2014 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and / or modify it
+// under the terms of the GNU Lesser General Public version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
//#1 svv 10.01.00 : porting on DEC
//smh#14 17.03.2000 : FRA62479 Clearing of gtool
#include <Standard_ErrorHandler.hxx>
thecopier->SetShareOut (theshareout);
thecheckdone = Standard_False;
thegtool = new Interface_GTool;
+ themodelstat = Standard_False;
}
if (!thegtool.IsNull()) thegtool->ClearEntities(); //smh#14 FRA62479
// themodel->SetProtocol(theprotocol);
themodel->SetGTool (thegtool);
- thegtool->Reservate (themodel->NbEntities()+20,Standard_True);
+
thegraph.Nullify();
ComputeGraph(); // fait qqchose si Protocol present. Sinon, ne fait rien
ClearData(3); // RAZ CheckList, a refaire
//function :
//purpose :
//=======================================================================
-
Handle(Interface_InterfaceModel) IFSelect_WorkSession::Model () const
{
return themodel;
}
if (cnt == 1) return num;
num = -num;
-// if (cnt == 0) cout<<" Label:"<<val<<" -> 0 ent"<<endl;
-// if (cnt > 0) cout<<" Label:"<<val<<" ->"<<cnt<<" ent.s, refus"<<endl;
+
return num;
}
{
if (theprotocol.IsNull()) return Standard_False;
if (themodel.IsNull()) return Standard_False;
- if (themodel->NbEntities() == 0) return Standard_False;
+ //if (themodel->NbEntities() == 0) return Standard_False;
if (enforce) thegraph.Nullify();
if (!thegraph.IsNull()) {
if (themodel->NbEntities() == thegraph->Graph().Size()) return Standard_True;
thegraph.Nullify();
}
+ if (themodel->NbEntities() == 0) return Standard_False;
// Il faut calculer le graphe pour de bon
- thegraph = new Interface_HGraph (themodel,thegtool);
+ thegraph = new Interface_HGraph (themodel,themodelstat);
Standard_Integer nb = themodel->NbEntities();
- Standard_Integer i; // svv #1
- for (i = 1; i <= nb; i ++) thegraph->CGraph().SetStatus(i,0);
- Interface_BitMap& bm = thegraph->CGraph().CBitMap();
- bm.AddFlag();
- bm.SetFlagName (Flag_Incorrect,"Incorrect");
-
+ if(themodelstat)
+ {
+ Standard_Integer i; // svv #1
+ for (i = 1; i <= nb; i ++) thegraph->CGraph().SetStatus(i,0);
+ Interface_BitMap& bm = thegraph->CGraph().CBitMap();
+ bm.AddFlag();
+ bm.SetFlagName (Flag_Incorrect,"Incorrect");
+ }
ComputeCheck();
thecheckdone = Standard_True;
-
-// Calcul des categories, a present memorisees dans le modele
- Interface_Category categ(thegtool);
- Interface_ShareTool sht(thegraph);
- for (i = 1; i <= nb; i ++) themodel->SetCategoryNumber
- (i,categ.CatNum(themodel->Value(i),sht));
+ if(themodelstat)
+ {
+ // Calcul des categories, a present memorisees dans le modele
+ Interface_Category categ(thegtool);
+ Interface_ShareTool sht(thegraph);
+ Standard_Integer i =1;
+ for ( ; i <= nb; i ++) themodel->SetCategoryNumber
+ (i,categ.CatNum(themodel->Value(i),sht));
+ }
return Standard_True;
}
Interface_CheckTool cht(thegraph);
Interface_CheckIterator checklist = cht.VerifyCheckList();
themodel->FillSemanticChecks(checklist,Standard_False);
-
-// Et on met a jour le Graphe (BitMap) ! Flag Incorrect (STX + SEM)
- Interface_BitMap& BM = CG.CBitMap();
- BM.Init (Standard_False,Flag_Incorrect);
- Standard_Integer num, nb = CG.Size();
- for (checklist.Start(); checklist.More(); checklist.Next()) {
- const Handle(Interface_Check) chk = checklist.Value();
- if (!chk->HasFailed()) continue;
- num = checklist.Number();
- if (num > 0 && num <= nb) BM.SetTrue (num,Flag_Incorrect);
+ if(themodelstat)
+ {
+ // Et on met a jour le Graphe (BitMap) ! Flag Incorrect (STX + SEM)
+ Interface_BitMap& BM = CG.CBitMap();
+ BM.Init (Standard_False,Flag_Incorrect);
+ Standard_Integer num, nb = CG.Size();
+ for (checklist.Start(); checklist.More(); checklist.Next()) {
+ const Handle(Interface_Check) chk = checklist.Value();
+ if (!chk->HasFailed()) continue;
+ num = checklist.Number();
+ if (num > 0 && num <= nb) BM.SetTrue (num,Flag_Incorrect);
+ }
+ for (num = 1; num <= nb; num ++)
+ if (themodel->IsErrorEntity (num)) BM.SetTrue (num,Flag_Incorrect);
}
- for (num = 1; num <= nb; num ++)
- if (themodel->IsErrorEntity (num)) BM.SetTrue (num,Flag_Incorrect);
-
return Standard_True;
}
if (id > 0) {
Handle(Standard_Transient)& att = theitems.ChangeFromIndex(id);
if (att.IsNull()) att = item;
-//// if (theitems.FindFromIndex(id).IsNull()) id0 = theitems.Add(item,item);
}
else id = theitems.Add(item,item);
return Standard_True;
}
}
-/* UTILISER EXPLICITEMENT SetAppliedModifier
- if (item->IsKind(STANDARD_TYPE(IFSelect_GeneralModifier))) {
- DeclareAndCast(IFSelect_GeneralModifier,modif,item);
- if (mode) {
- theshareout->AddModifier(modif,0);
- return Standard_True;
- } else {
- return theshareout->RemoveItem(modif);
- }
- }
-*/
+
return Standard_False;
}
{
Handle(Standard_Transient) item = NamedItem(name);
if (item.IsNull()) return Standard_False;
-#ifdef DEB
- Standard_Integer bid =
-#endif
- theitems.Add(item,item); // reste mais sans nom
+ theitems.Add(item,item); // reste mais sans nom
return thenames->RemoveItem(name);
}
}
if (thegraph.IsNull()) return iter;
-// if (ItemIdent(sel) != 0) iter = sel->UniqueResult(thegraph->Graph());
- iter = sel->UniqueResult(thegraph->Graph());
+ iter = sel->UniqueResult(thegraph->Graph());
return iter;
}
// ssel est la derniere selection auscultee, deduct son downcast
// input son Input (nulle si sel pas une deduction)
deduct = GetCasted(IFSelect_SelectDeduct,ssel);
-/*
- Handle(IFSelect_SelectPointed) sp = new IFSelect_SelectPointed;
- sp->AddList(list);
- deduct->SetInput (sp);
-*/
+
deduct->Alternate()->SetList (list);
// On execute puis on nettoie
}
}
else checks = thecopier->SendAll(filename,thegraph->Graph(),thelibrary,theprotocol);
-
+ Handle_Interface_Check aMainFail = checks.CCheck(0);
+ if (!aMainFail.IsNull() && aMainFail->HasFailed ())
+ {
+ return IFSelect_RetStop;
+ }
if (theloaded.Length() == 0) theloaded.AssignCat(filename);
thecheckrun = checks;
if (checks.IsEmpty(Standard_True)) return IFSelect_RetDone;
{
if (!IsLoaded()) return;
Standard_Integer i,nb = themodel->NbEntities();
- thecheckana = TCollection_AsciiString (' ',nb+1);
+ thecheckana = TCollection_AsciiString (nb+1,' ');
for (chl.Start(); chl.More(); chl.Next()) {
Standard_Integer num = chl.Number();
const Handle(Interface_Check) ach = chl.Value();
// analyse selon le graphe ... codes : blc = rien
// 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);
+ Interface_IntList list;// = thegraph->Graph().SharingNums(0);
// deux passes : d abord Warning, puis Fail
for (i = 1; i <= nb; i ++) {
char val = thecheckana.Value(i);
Standard_Integer stat = QueryParent ( entdad,list->Value(i) );
if (stat >= 0) return stat+1;
}
-/*
- Interface_IntList sharings = thegraph->Graph().SharingNums (nson);
- Standard_Integer i, nb = sharings.Length();
- for (i = 1; i <= nb; i ++) {
- if (sharings.Value(i) == nson) return 1;
- Standard_Integer stat = QueryParent
- ( entson,StartingEntity(sharings.Value(i)) );
- if (stat >= 0) return stat+1;
- }
-*/
return -1; // not yet implemented ...
}
if (level == 5 || level == 8) mode = IFSelect_CountByItem;
if (level == 6 || level == 9) mode = IFSelect_ListByItem;
if (level == 7 || level == 10) mode = IFSelect_EntitiesByItem;
- Standard_Boolean failsonly = Standard_False;
- if (level < 8 && level != 4) failsonly = Standard_True;
PrintCheckList (ModelCheckList(),Standard_False, mode);
} else {
if (level == 3) S << " ******** Check Model (Fails) ********"<<endl;
Interface_CheckIterator chks = checklist;
Handle(IFSelect_CheckCounter) counter =
new IFSelect_CheckCounter (mode>1 && mode != IFSelect_CountSummary);
- counter->Analyse (chks,themodel,Standard_False,failsonly);
+ counter->Analyse (chks,themodel,Standard_True,failsonly);
counter->PrintList (sout,themodel,mode);
}
}
sout<<"\n Abandon"<<endl;
}
}
+
+void IFSelect_WorkSession::SetModeStat( Standard_Boolean theStatMode)
+{
+ themodelstat = theStatMode;
+}
+
+Standard_Boolean IFSelect_WorkSession::GetModeStat() const
+{
+ return themodelstat;
+}