mirror of
https://github.com/Open-Cascade-SAS/OCCT.git
synced 2026-06-07 13:47:37 +08:00
0027349: XtControl_Reader is not thread-safe
Support of profiles for norms is removed Getting rid of thread-unsafe static variables. Sequence is not thread-safe. Replacing it with Vector. Updating samples due to previous changes. Resolving conflict with system environment.
This commit is contained in:
@@ -44,8 +44,6 @@
|
||||
#include <Interface_Static.hxx>
|
||||
#include <Message.hxx>
|
||||
#include <Message_Messenger.hxx>
|
||||
#include <MoniTool_Option.hxx>
|
||||
#include <MoniTool_Profile.hxx>
|
||||
#include <Standard_DomainError.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
@@ -71,283 +69,182 @@ IMPLEMENT_STANDARD_RTTIEXT(XSControl_Controller,MMgt_TShared)
|
||||
|
||||
// ParamEditor
|
||||
// Transferts
|
||||
static Handle(Dico_DictionaryOfTransient)& listadapt()
|
||||
static const Handle(Dico_DictionaryOfTransient)& listadapt()
|
||||
{
|
||||
static Handle(Dico_DictionaryOfTransient) listad;
|
||||
if (listad.IsNull()) listad = new Dico_DictionaryOfTransient;
|
||||
return listad;
|
||||
}
|
||||
|
||||
static TColStd_IndexedMapOfTransient& mapadapt()
|
||||
//=======================================================================
|
||||
//function : XSControl_Controller
|
||||
//purpose : Constructor
|
||||
//=======================================================================
|
||||
|
||||
XSControl_Controller::XSControl_Controller (const Standard_CString theLongName, const Standard_CString theShortName)
|
||||
: myShortName(theShortName), myLongName(theLongName)
|
||||
{
|
||||
static TColStd_IndexedMapOfTransient mapad;
|
||||
return mapad;
|
||||
}
|
||||
|
||||
|
||||
XSControl_Controller::XSControl_Controller
|
||||
(const Standard_CString longname, const Standard_CString shortname)
|
||||
: theShortName (shortname) , theLongName (longname)
|
||||
{
|
||||
theAdaptorApplied.Clear();
|
||||
theAdaptorHooks = new TColStd_HSequenceOfHAsciiString();
|
||||
|
||||
// Parametres Standard
|
||||
|
||||
// Standard parameters
|
||||
Interface_Static::Standards();
|
||||
// TraceStatic ("read.stdsameparameter.mode",5);
|
||||
TraceStatic ("read.precision.mode" , 5);
|
||||
TraceStatic ("read.precision.val" , 5);
|
||||
TraceStatic ("write.precision.mode" , 6);
|
||||
TraceStatic ("write.precision.val" , 6);
|
||||
|
||||
// Initialisation du Profile
|
||||
|
||||
theProfile = new MoniTool_Profile;
|
||||
|
||||
/* essai option sur parametre
|
||||
Handle(MoniTool_Option) optrdprec = new MoniTool_Option
|
||||
(Interface_Static::Static ("read.precision.mode"),"readprecision.mode");
|
||||
optrdprec->AddBasic("default","File");
|
||||
optrdprec->AddBasic("Session");
|
||||
optrdprec->Switch ("default");
|
||||
theProfile->AddOption (optrdprec);
|
||||
*/
|
||||
|
||||
// Handle(MoniTool_Option) optproto = new MoniTool_Option
|
||||
// (STANDARD_TYPE(Interface_Protocol),"protocol");
|
||||
// theProfile->AddOption (optproto);
|
||||
|
||||
Handle(MoniTool_Option) optsign = new MoniTool_Option
|
||||
(STANDARD_TYPE(IFSelect_Signature),"sign-type");
|
||||
optsign->Add ("default",theSignType);
|
||||
theProfile->AddOption (optsign);
|
||||
|
||||
// Handle(MoniTool_Option) optwlib = new MoniTool_Option
|
||||
// (STANDARD_TYPE(IFSelect_WorkLibrary),"access");
|
||||
// theProfile->AddOption (optwlib);
|
||||
|
||||
Handle(MoniTool_Option) optactrd = new MoniTool_Option
|
||||
(STANDARD_TYPE(Transfer_ActorOfTransientProcess),"tr-read");
|
||||
theProfile->AddOption (optactrd);
|
||||
|
||||
Handle(MoniTool_Option) optactwr = new MoniTool_Option
|
||||
(STANDARD_TYPE(Transfer_ActorOfFinderProcess),"tr-write");
|
||||
theProfile->AddOption (optactwr);
|
||||
|
||||
// Definition de la config de base : suite a la customisation
|
||||
}
|
||||
|
||||
void XSControl_Controller::SetNames
|
||||
(const Standard_CString longname, const Standard_CString shortname)
|
||||
//=======================================================================
|
||||
//function : TraceStatic
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void XSControl_Controller::TraceStatic (const Standard_CString theName, const Standard_Integer theUse)
|
||||
{
|
||||
if (longname && longname[0] != '\0') {
|
||||
theLongName.Clear(); theLongName.AssignCat (longname);
|
||||
Handle(Interface_Static) val = Interface_Static::Static(theName);
|
||||
if (val.IsNull()) return;
|
||||
myParams.Append (val);
|
||||
myParamUses.Append(theUse);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetNames
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void XSControl_Controller::SetNames (const Standard_CString theLongName, const Standard_CString theShortName)
|
||||
{
|
||||
if (theLongName && theLongName[0] != '\0') {
|
||||
myLongName.Clear(); myLongName.AssignCat (theLongName);
|
||||
}
|
||||
if (shortname && shortname[0] != '\0') {
|
||||
theShortName.Clear(); theShortName.AssignCat (shortname);
|
||||
if (theShortName && theShortName[0] != '\0') {
|
||||
myShortName.Clear(); myShortName.AssignCat(theShortName);
|
||||
}
|
||||
}
|
||||
|
||||
void XSControl_Controller::AutoRecord () const
|
||||
{
|
||||
Record (Name(Standard_True));
|
||||
Record (Name(Standard_False));
|
||||
}
|
||||
//=======================================================================
|
||||
//function : Record
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void XSControl_Controller::Record (const Standard_CString name) const
|
||||
void XSControl_Controller::Record (const Standard_CString theName) const
|
||||
{
|
||||
Standard_Boolean deja;
|
||||
Handle(Standard_Transient)& newadapt = listadapt()->NewItem (name,deja);
|
||||
if (deja) {
|
||||
Standard_Boolean isAlreadyRegistered = Standard_False;
|
||||
Handle(Standard_Transient)& newadapt = listadapt()->NewItem(theName,isAlreadyRegistered);
|
||||
if (isAlreadyRegistered) {
|
||||
Handle(Standard_Transient) thisadapt (this);
|
||||
if (newadapt->IsKind(thisadapt->DynamicType()))
|
||||
{
|
||||
}
|
||||
else if (thisadapt->IsKind(newadapt->DynamicType()))
|
||||
{
|
||||
newadapt = this;
|
||||
if (mapadapt().FindIndex(newadapt) == 0) mapadapt().Add(newadapt);
|
||||
}
|
||||
else
|
||||
if (thisadapt != newadapt) Standard_DomainError::Raise
|
||||
("XSControl_Controller : Record");
|
||||
}
|
||||
else {
|
||||
newadapt = this;
|
||||
if (mapadapt().FindIndex(newadapt) == 0) mapadapt().Add(newadapt);
|
||||
if (newadapt->IsKind(thisadapt->DynamicType()))
|
||||
return;
|
||||
if (!(thisadapt->IsKind(newadapt->DynamicType())) && thisadapt != newadapt)
|
||||
Standard_DomainError::Raise("XSControl_Controller : Record");
|
||||
}
|
||||
newadapt = this;
|
||||
}
|
||||
|
||||
Handle(XSControl_Controller) XSControl_Controller::Recorded
|
||||
(const Standard_CString name)
|
||||
//=======================================================================
|
||||
//function : Recorded
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(XSControl_Controller) XSControl_Controller::Recorded (const Standard_CString theName)
|
||||
{
|
||||
Handle(Standard_Transient) recorded;
|
||||
if (!listadapt()->GetItem (name,recorded)) recorded.Nullify();
|
||||
return Handle(XSControl_Controller)::DownCast (recorded);
|
||||
return (listadapt()->GetItem(theName,recorded)?
|
||||
Handle(XSControl_Controller)::DownCast(recorded) :
|
||||
Handle(XSControl_Controller)());
|
||||
}
|
||||
|
||||
Handle(TColStd_HSequenceOfHAsciiString) XSControl_Controller::ListRecorded
|
||||
(const Standard_Integer mode)
|
||||
{
|
||||
Handle(TColStd_HSequenceOfHAsciiString) list = new TColStd_HSequenceOfHAsciiString();
|
||||
if (mode == 0) {
|
||||
Dico_IteratorOfDictionaryOfTransient iter (listadapt());
|
||||
for (; iter.More(); iter.Next()) {
|
||||
Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString
|
||||
(iter.Name());
|
||||
list->Append(name);
|
||||
}
|
||||
} else {
|
||||
Standard_Integer i, nb = mapadapt().Extent();
|
||||
for (i = 1; i <= nb; i ++) {
|
||||
DeclareAndCast(XSControl_Controller,ctl,mapadapt().FindKey(i));
|
||||
if (ctl.IsNull()) continue;
|
||||
Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString
|
||||
(ctl->Name( (mode < 0) ));
|
||||
list->Append(name);
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
Standard_CString XSControl_Controller::Name (const Standard_Boolean rsc) const
|
||||
{ return (rsc ? theShortName.ToCString() : theLongName.ToCString()); }
|
||||
|
||||
// #### PROFILE ####
|
||||
|
||||
Handle(MoniTool_Profile) XSControl_Controller::Profile () const
|
||||
{ return theProfile; }
|
||||
|
||||
void XSControl_Controller::DefineProfile
|
||||
(const Standard_CString confname)
|
||||
{
|
||||
if (!theProfile->HasConf(confname)) theProfile->AddConf (confname);
|
||||
theProfile->SetFromCurrent (confname);
|
||||
}
|
||||
|
||||
Standard_Boolean XSControl_Controller::SetProfile
|
||||
(const Standard_CString confname)
|
||||
{
|
||||
if (!theProfile->SetCurrent (confname)) return Standard_False;
|
||||
|
||||
Handle(Standard_Transient) anItem;
|
||||
// theProfile->Value("protocol",theAdaptorProtocol);
|
||||
if (theProfile->Value("sign-type",anItem))
|
||||
theSignType = Handle(IFSelect_Signature)::DownCast (anItem);
|
||||
// theProfile->Value("access",theAdaptorLibrary);
|
||||
if (theProfile->Value("tr-read",anItem))
|
||||
theAdaptorRead = Handle(Transfer_ActorOfTransientProcess)::DownCast (anItem);
|
||||
if (theProfile->Value("tr-write",anItem))
|
||||
theAdaptorWrite = Handle(Transfer_ActorOfFinderProcess)::DownCast (anItem);
|
||||
|
||||
return SettingProfile (confname);
|
||||
}
|
||||
|
||||
Standard_Boolean XSControl_Controller::SettingProfile
|
||||
(const Standard_CString )
|
||||
{ return Standard_True; }
|
||||
|
||||
Standard_Boolean XSControl_Controller::ApplyProfile
|
||||
(const Handle(XSControl_WorkSession)& WS, const Standard_CString confname)
|
||||
{
|
||||
if (!SetProfile (confname)) return Standard_False;
|
||||
|
||||
// Typed Values : toutes
|
||||
|
||||
theProfile->SetTypedValues();
|
||||
|
||||
// SignType
|
||||
Handle(Standard_Transient) signtype;
|
||||
theProfile->Value ("sign-type",signtype);
|
||||
WS->SetSignType (Handle(IFSelect_Signature)::DownCast (signtype));
|
||||
|
||||
// ActorRead
|
||||
|
||||
Handle(Standard_Transient) actrd;
|
||||
theProfile->Value ("tr-read",actrd);
|
||||
WS->TransferReader()->SetActor (Handle(Transfer_ActorOfTransientProcess)::DownCast (actrd));
|
||||
|
||||
// ActorWrite : dans le Controller meme
|
||||
|
||||
Handle(Standard_Transient) actwr;
|
||||
theProfile->Value ("tr-write",actwr);
|
||||
theAdaptorWrite = Handle (Transfer_ActorOfFinderProcess)::DownCast (actwr);
|
||||
|
||||
return ApplyingProfile (WS,confname);
|
||||
}
|
||||
|
||||
Standard_Boolean XSControl_Controller::ApplyingProfile
|
||||
(const Handle(XSControl_WorkSession)& , const Standard_CString )
|
||||
{ return Standard_True; }
|
||||
|
||||
// #### DEFINITION ####
|
||||
|
||||
Handle(Interface_Protocol) XSControl_Controller::Protocol () const
|
||||
{ return theAdaptorProtocol; }
|
||||
//=======================================================================
|
||||
//function : ActorRead
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(IFSelect_Signature) XSControl_Controller::SignType () const
|
||||
{ return theSignType; }
|
||||
Handle(Transfer_ActorOfTransientProcess) XSControl_Controller::ActorRead (const Handle(Interface_InterfaceModel)&) const
|
||||
{
|
||||
return myAdaptorRead;
|
||||
}
|
||||
|
||||
Handle(IFSelect_WorkLibrary) XSControl_Controller::WorkLibrary () const
|
||||
{ return theAdaptorLibrary; }
|
||||
//=======================================================================
|
||||
//function : ActorWrite
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Transfer_ActorOfFinderProcess) XSControl_Controller::ActorWrite () const
|
||||
{ return theAdaptorWrite; }
|
||||
|
||||
void XSControl_Controller::UpdateStatics
|
||||
(const Standard_Integer, const Standard_CString ) const
|
||||
{ } // a redefinir si besoin
|
||||
Handle(Transfer_ActorOfFinderProcess) XSControl_Controller::ActorWrite () const
|
||||
{
|
||||
return myAdaptorWrite;
|
||||
}
|
||||
|
||||
// ###########################
|
||||
// Help du Transfer : controle de valeur + help
|
||||
|
||||
void XSControl_Controller::SetModeWrite
|
||||
(const Standard_Integer modemin, const Standard_Integer modemax,
|
||||
const Standard_Boolean )
|
||||
//=======================================================================
|
||||
//function : SetModeWrite
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void XSControl_Controller::SetModeWrite
|
||||
(const Standard_Integer modemin, const Standard_Integer modemax, const Standard_Boolean )
|
||||
{
|
||||
if (modemin > modemax) { theModeWriteShapeN.Nullify(); return; }
|
||||
theModeWriteShapeN = new Interface_HArray1OfHAsciiString (modemin,modemax);
|
||||
if (modemin > modemax) { myModeWriteShapeN.Nullify(); return; }
|
||||
myModeWriteShapeN = new Interface_HArray1OfHAsciiString (modemin,modemax);
|
||||
}
|
||||
|
||||
void XSControl_Controller::SetModeWriteHelp
|
||||
(const Standard_Integer modetrans, const Standard_CString help,
|
||||
const Standard_Boolean )
|
||||
//=======================================================================
|
||||
//function : SetModeWriteHelp
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void XSControl_Controller::SetModeWriteHelp
|
||||
(const Standard_Integer modetrans, const Standard_CString help, const Standard_Boolean )
|
||||
{
|
||||
if (theModeWriteShapeN.IsNull()) return;
|
||||
if (modetrans < theModeWriteShapeN->Lower() ||
|
||||
modetrans > theModeWriteShapeN->Upper()) return;
|
||||
if (myModeWriteShapeN.IsNull()) return;
|
||||
if (modetrans < myModeWriteShapeN->Lower() ||
|
||||
modetrans > myModeWriteShapeN->Upper()) return;
|
||||
Handle(TCollection_HAsciiString) hl = new TCollection_HAsciiString (help);
|
||||
theModeWriteShapeN->SetValue (modetrans,hl);
|
||||
myModeWriteShapeN->SetValue (modetrans,hl);
|
||||
}
|
||||
|
||||
Standard_Boolean XSControl_Controller::ModeWriteBounds
|
||||
(Standard_Integer& modemin, Standard_Integer& modemax,
|
||||
const Standard_Boolean ) const
|
||||
//=======================================================================
|
||||
//function : ModeWriteBounds
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean XSControl_Controller::ModeWriteBounds
|
||||
(Standard_Integer& modemin, Standard_Integer& modemax, const Standard_Boolean ) const
|
||||
{
|
||||
modemin = modemax = 0;
|
||||
if (theModeWriteShapeN.IsNull()) return Standard_False;
|
||||
modemin = theModeWriteShapeN->Lower();
|
||||
modemax = theModeWriteShapeN->Upper();
|
||||
if (myModeWriteShapeN.IsNull()) return Standard_False;
|
||||
modemin = myModeWriteShapeN->Lower();
|
||||
modemax = myModeWriteShapeN->Upper();
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
Standard_Boolean XSControl_Controller::IsModeWrite
|
||||
//=======================================================================
|
||||
//function : IsModeWrite
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean XSControl_Controller::IsModeWrite
|
||||
(const Standard_Integer modetrans, const Standard_Boolean ) const
|
||||
{
|
||||
if (theModeWriteShapeN.IsNull()) return Standard_True;
|
||||
if (modetrans < theModeWriteShapeN->Lower()) return Standard_False;
|
||||
if (modetrans > theModeWriteShapeN->Upper()) return Standard_False;
|
||||
if (myModeWriteShapeN.IsNull()) return Standard_True;
|
||||
if (modetrans < myModeWriteShapeN->Lower()) return Standard_False;
|
||||
if (modetrans > myModeWriteShapeN->Upper()) return Standard_False;
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
Standard_CString XSControl_Controller::ModeWriteHelp
|
||||
//=======================================================================
|
||||
//function : ModeWriteHelp
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_CString XSControl_Controller::ModeWriteHelp
|
||||
(const Standard_Integer modetrans, const Standard_Boolean ) const
|
||||
{
|
||||
if (theModeWriteShapeN.IsNull()) return "";
|
||||
if (modetrans < theModeWriteShapeN->Lower()) return "";
|
||||
if (modetrans > theModeWriteShapeN->Upper()) return "";
|
||||
Handle(TCollection_HAsciiString) str = theModeWriteShapeN->Value(modetrans);
|
||||
if (myModeWriteShapeN.IsNull()) return "";
|
||||
if (modetrans < myModeWriteShapeN->Lower()) return "";
|
||||
if (modetrans > myModeWriteShapeN->Upper()) return "";
|
||||
Handle(TCollection_HAsciiString) str = myModeWriteShapeN->Value(modetrans);
|
||||
if (str.IsNull()) return "";
|
||||
return str->ToCString();
|
||||
}
|
||||
@@ -357,41 +254,49 @@ static TColStd_IndexedMapOfTransient& mapadapt()
|
||||
// Transfer : on fait ce qu il faut par defaut (avec ActorWrite)
|
||||
// peut etre redefini ...
|
||||
|
||||
Standard_Boolean XSControl_Controller::RecognizeWriteTransient
|
||||
//=======================================================================
|
||||
//function : RecognizeWriteTransient
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean XSControl_Controller::RecognizeWriteTransient
|
||||
(const Handle(Standard_Transient)& obj,
|
||||
const Standard_Integer modetrans) const
|
||||
{
|
||||
if (theAdaptorWrite.IsNull()) return Standard_False;
|
||||
theAdaptorWrite->ModeTrans() = modetrans;
|
||||
return theAdaptorWrite->Recognize (new Transfer_TransientMapper(obj));
|
||||
if (myAdaptorWrite.IsNull()) return Standard_False;
|
||||
myAdaptorWrite->ModeTrans() = modetrans;
|
||||
return myAdaptorWrite->Recognize (new Transfer_TransientMapper(obj));
|
||||
}
|
||||
|
||||
// Fonction interne
|
||||
//=======================================================================
|
||||
//function : TransferFinder
|
||||
//purpose : internal function
|
||||
//=======================================================================
|
||||
|
||||
static IFSelect_ReturnStatus TransferFinder
|
||||
(const Handle(Transfer_ActorOfFinderProcess)& actor,
|
||||
const Handle(Transfer_Finder)& mapper,
|
||||
const Handle(Transfer_FinderProcess)& FP,
|
||||
const Handle(Interface_InterfaceModel)& model,
|
||||
const Standard_Integer modetrans)
|
||||
(const Handle(Transfer_ActorOfFinderProcess)& theActor,
|
||||
const Handle(Transfer_Finder)& theMapper,
|
||||
const Handle(Transfer_FinderProcess)& theFP,
|
||||
const Handle(Interface_InterfaceModel)& theModel,
|
||||
const Standard_Integer theModeTrans)
|
||||
{
|
||||
if (actor.IsNull()) return IFSelect_RetError;
|
||||
if (model.IsNull()) return IFSelect_RetError;
|
||||
actor->ModeTrans() = modetrans;
|
||||
FP->SetModel (model);
|
||||
FP->SetActor (actor);
|
||||
FP->Transfer (mapper);
|
||||
if (theActor.IsNull()) return IFSelect_RetError;
|
||||
if (theModel.IsNull()) return IFSelect_RetError;
|
||||
theActor->ModeTrans() = theModeTrans;
|
||||
theFP->SetModel (theModel);
|
||||
theFP->SetActor (theActor);
|
||||
theFP->Transfer (theMapper);
|
||||
|
||||
IFSelect_ReturnStatus stat = IFSelect_RetFail;
|
||||
Handle(Transfer_Binder) binder = FP->Find (mapper);
|
||||
Handle(Transfer_Binder) binder = theFP->Find (theMapper);
|
||||
Handle(Transfer_SimpleBinderOfTransient) bindtr;
|
||||
while (!binder.IsNull()) {
|
||||
bindtr = Handle(Transfer_SimpleBinderOfTransient)::DownCast (binder);
|
||||
if (!bindtr.IsNull()) {
|
||||
Handle(Standard_Transient) ent = bindtr->Result();
|
||||
if (!ent.IsNull()) {
|
||||
stat = IFSelect_RetDone;
|
||||
model->AddWithRefs (ent);
|
||||
stat = IFSelect_RetDone;
|
||||
theModel->AddWithRefs (ent);
|
||||
}
|
||||
}
|
||||
binder = binder->NextResult();
|
||||
@@ -399,28 +304,42 @@ static IFSelect_ReturnStatus TransferFinder
|
||||
return stat;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : TransferWriteTransient
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
IFSelect_ReturnStatus XSControl_Controller::TransferWriteTransient
|
||||
(const Handle(Standard_Transient)& obj,
|
||||
const Handle(Transfer_FinderProcess)& FP,
|
||||
const Handle(Interface_InterfaceModel)& model,
|
||||
const Standard_Integer modetrans) const
|
||||
IFSelect_ReturnStatus XSControl_Controller::TransferWriteTransient
|
||||
(const Handle(Standard_Transient)& theObj,
|
||||
const Handle(Transfer_FinderProcess)& theFP,
|
||||
const Handle(Interface_InterfaceModel)& theModel,
|
||||
const Standard_Integer theModeTrans) const
|
||||
{
|
||||
if (obj.IsNull()) return IFSelect_RetVoid;
|
||||
if (theObj.IsNull()) return IFSelect_RetVoid;
|
||||
return TransferFinder
|
||||
(theAdaptorWrite,new Transfer_TransientMapper(obj), FP,model,modetrans);
|
||||
(myAdaptorWrite,new Transfer_TransientMapper(theObj),theFP,theModel,theModeTrans);
|
||||
}
|
||||
|
||||
Standard_Boolean XSControl_Controller::RecognizeWriteShape
|
||||
//=======================================================================
|
||||
//function : RecognizeWriteShape
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean XSControl_Controller::RecognizeWriteShape
|
||||
(const TopoDS_Shape& shape,
|
||||
const Standard_Integer modetrans) const
|
||||
{
|
||||
if (theAdaptorWrite.IsNull()) return Standard_False;
|
||||
theAdaptorWrite->ModeTrans() = modetrans;
|
||||
return theAdaptorWrite->Recognize (new TransferBRep_ShapeMapper(shape));
|
||||
if (myAdaptorWrite.IsNull()) return Standard_False;
|
||||
myAdaptorWrite->ModeTrans() = modetrans;
|
||||
return myAdaptorWrite->Recognize (new TransferBRep_ShapeMapper(shape));
|
||||
}
|
||||
|
||||
IFSelect_ReturnStatus XSControl_Controller::TransferWriteShape
|
||||
//=======================================================================
|
||||
//function : TransferWriteShape
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
IFSelect_ReturnStatus XSControl_Controller::TransferWriteShape
|
||||
(const TopoDS_Shape& shape,
|
||||
const Handle(Transfer_FinderProcess)& FP,
|
||||
const Handle(Interface_InterfaceModel)& model,
|
||||
@@ -429,249 +348,147 @@ static IFSelect_ReturnStatus TransferFinder
|
||||
if (shape.IsNull()) return IFSelect_RetVoid;
|
||||
|
||||
IFSelect_ReturnStatus theReturnStat = TransferFinder
|
||||
(theAdaptorWrite,new TransferBRep_ShapeMapper(shape), FP,model,modetrans);
|
||||
(myAdaptorWrite,new TransferBRep_ShapeMapper(shape),FP,model,modetrans);
|
||||
return theReturnStat;
|
||||
}
|
||||
|
||||
// ###########################
|
||||
// File Cluster : quand un ensemble de donnees n est pas envoye d un coup mais
|
||||
// en plusieurs petits paquets ...
|
||||
// D abord, on detecte la chose et on prepare un contexte de resolution
|
||||
// specifique du cas a traiter. Null Handle si rien a faire (par defaut)
|
||||
// Ensuite on resoud
|
||||
// Les formules par defaut ne font rien (redefinissables)
|
||||
|
||||
Handle(Standard_Transient) XSControl_Controller::ClusterContext
|
||||
(const Handle(XSControl_WorkSession)& ) const
|
||||
{ Handle(Standard_Transient) nulctx; return nulctx; }
|
||||
|
||||
Interface_CheckIterator XSControl_Controller::ResolveCluster
|
||||
(const Handle(XSControl_WorkSession)& , const Handle(Standard_Transient)& ) const
|
||||
{ Interface_CheckIterator nulist; return nulist; }
|
||||
|
||||
|
||||
// ###########################
|
||||
// ControlItems : si ActorWrite etc... ne suffisent meme plus, on peut en
|
||||
// rajouter, Controller ne fait alors que les accueillir
|
||||
|
||||
void XSControl_Controller::AddControlItem
|
||||
(const Handle(Standard_Transient)& item, const Standard_CString name)
|
||||
{
|
||||
if (item.IsNull() || name[0] == '\0') return;
|
||||
if (theItems.IsNull()) theItems = new Dico_DictionaryOfTransient;
|
||||
theItems->SetItem (name,item);
|
||||
}
|
||||
|
||||
Handle(Standard_Transient) XSControl_Controller::ControlItem
|
||||
(const Standard_CString name) const
|
||||
{
|
||||
Handle(Standard_Transient) item;
|
||||
if (theItems.IsNull()) return item;
|
||||
theItems->GetItem (name,item);
|
||||
return item;
|
||||
}
|
||||
|
||||
// ###########################
|
||||
// Cutomisation ! On enregistre des Items pour une WorkSession
|
||||
// (annule et remplace)
|
||||
// Ensuite, on les remet en place a la demande
|
||||
|
||||
void XSControl_Controller::TraceStatic
|
||||
(const Standard_CString name, const Standard_Integer use)
|
||||
//=======================================================================
|
||||
//function : AddSessionItem
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void XSControl_Controller::AddSessionItem
|
||||
(const Handle(Standard_Transient)& theItem, const Standard_CString theName, const Standard_Boolean toApply)
|
||||
{
|
||||
Handle(Interface_Static) val = Interface_Static::Static(name);
|
||||
if (val.IsNull()) return;
|
||||
theParams.Append (val);
|
||||
theParamUses.Append(use);
|
||||
if (theItem.IsNull() || theName[0] == '\0') return;
|
||||
if (myAdaptorSession.IsNull())
|
||||
myAdaptorSession = new Dico_DictionaryOfTransient;
|
||||
myAdaptorSession->SetItem (theName,theItem);
|
||||
if (toApply && theItem->IsKind(STANDARD_TYPE(IFSelect_GeneralModifier)))
|
||||
myAdaptorApplied.Append(theItem);
|
||||
}
|
||||
|
||||
void XSControl_Controller::AddSessionItem
|
||||
(const Handle(Standard_Transient)& item, const Standard_CString name,
|
||||
const Standard_CString setapplied)
|
||||
{
|
||||
if (item.IsNull() || name[0] == '\0') return;
|
||||
if (theAdaptorSession.IsNull()) theAdaptorSession =
|
||||
new Dico_DictionaryOfTransient;
|
||||
theAdaptorSession->SetItem (name,item);
|
||||
if (!setapplied || setapplied[0] == '\0') return;
|
||||
if (item->IsKind(STANDARD_TYPE(IFSelect_GeneralModifier))) {
|
||||
// cout<<" -- Xstep Controller : SetApplied n0."<<theAdaptorApplied.Length()+1
|
||||
// <<" Name:"<<name<<endl;
|
||||
theAdaptorApplied.Append(item);
|
||||
Handle(TCollection_HAsciiString) hook = new TCollection_HAsciiString(setapplied);
|
||||
theAdaptorHooks->Append (hook);
|
||||
}
|
||||
}
|
||||
//=======================================================================
|
||||
//function : SessionItem
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Standard_Transient) XSControl_Controller::SessionItem
|
||||
(const Standard_CString name) const
|
||||
Handle(Standard_Transient) XSControl_Controller::SessionItem (const Standard_CString theName) const
|
||||
{
|
||||
Handle(Standard_Transient) item;
|
||||
if (theAdaptorSession.IsNull()) return item;
|
||||
theAdaptorSession->GetItem (name,item);
|
||||
if (!myAdaptorSession.IsNull())
|
||||
myAdaptorSession->GetItem (theName,item);
|
||||
return item;
|
||||
}
|
||||
|
||||
Standard_Boolean XSControl_Controller::IsApplied
|
||||
(const Handle(Standard_Transient)& item) const
|
||||
//=======================================================================
|
||||
//function : Customise
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void XSControl_Controller::Customise (Handle(XSControl_WorkSession)& WS)
|
||||
{
|
||||
if (item.IsNull()) return Standard_False;
|
||||
for (Standard_Integer i = theAdaptorApplied.Length(); i >= 1; i --)
|
||||
if (item == theAdaptorApplied.Value(i)) return Standard_True;
|
||||
return Standard_False;
|
||||
}
|
||||
WS->SetParams (myParams,myParamUses);
|
||||
|
||||
void XSControl_Controller::Customise
|
||||
( Handle(XSControl_WorkSession)& WS)
|
||||
{
|
||||
WS->SetParams (theParams,theParamUses);
|
||||
// General
|
||||
if (!myAdaptorSession.IsNull()) {
|
||||
Dico_IteratorOfDictionaryOfTransient iter(myAdaptorSession);
|
||||
for (iter.Start(); iter.More(); iter.Next())
|
||||
WS->AddNamedItem (iter.Name().ToCString(), iter.Value());
|
||||
}
|
||||
|
||||
if (WS->NamedItem("xst-model-all").IsNull()) {
|
||||
|
||||
// General
|
||||
if(!theAdaptorSession.IsNull()) {
|
||||
Dico_IteratorOfDictionaryOfTransient iter(theAdaptorSession);
|
||||
for (iter.Start(); iter.More(); iter.Next()) {
|
||||
WS->AddNamedItem (iter.Name().ToCString() , iter.Value());
|
||||
Handle(IFSelect_SelectModelEntities) sle = new IFSelect_SelectModelEntities;
|
||||
WS->AddNamedItem ("xst-model-all",sle);
|
||||
|
||||
Handle(IFSelect_SelectModelRoots) slr = new IFSelect_SelectModelRoots;
|
||||
WS->AddNamedItem ("xst-model-roots",slr);
|
||||
|
||||
if(strcasecmp(WS->SelectedNorm(),"STEP")) {
|
||||
Handle(XSControl_SelectForTransfer) st1 = new XSControl_SelectForTransfer;
|
||||
st1->SetInput (slr);
|
||||
st1->SetReader (WS->TransferReader());
|
||||
WS->AddNamedItem ("xst-transferrable-roots",st1);
|
||||
}
|
||||
}
|
||||
Customising(WS);
|
||||
// Applied Modifiers
|
||||
Standard_Integer i, nb = theAdaptorApplied.Length();
|
||||
for (i = 1; i <= nb; i ++) {
|
||||
Handle(Standard_Transient) anitem = theAdaptorApplied.Value(i);
|
||||
Handle(TCollection_HAsciiString) name = WS->Name(anitem);
|
||||
// Handle(Message_Messenger) sout = Message::DefaultMessenger();
|
||||
// sout<<" -- Customise applied n0."<<i<<" type:"<<anitem->DynamicType()->Name();
|
||||
// if (name.IsNull()) sout<<" no name"<<endl;
|
||||
// else sout<<" name:"<<name->ToCString()<<endl;
|
||||
WS->SetAppliedModifier
|
||||
(GetCasted(IFSelect_GeneralModifier,theAdaptorApplied.Value(i)),
|
||||
WS->ShareOut() );
|
||||
|
||||
Handle(XSControl_SelectForTransfer) st2 = new XSControl_SelectForTransfer;
|
||||
st2->SetInput (sle);
|
||||
st2->SetReader (WS->TransferReader());
|
||||
WS->AddNamedItem ("xst-transferrable-all",st2);
|
||||
|
||||
Handle(XSControl_SignTransferStatus) strs = new XSControl_SignTransferStatus;
|
||||
strs->SetReader (WS->TransferReader());
|
||||
WS->AddNamedItem ("xst-transfer-status",strs);
|
||||
|
||||
Handle(XSControl_ConnectedShapes) scs = new XSControl_ConnectedShapes;
|
||||
scs->SetReader (WS->TransferReader());
|
||||
WS->AddNamedItem ("xst-connected-faces",scs);
|
||||
|
||||
Handle(IFSelect_SignType) stp = new IFSelect_SignType (Standard_False);
|
||||
WS->AddNamedItem ("xst-long-type",stp);
|
||||
|
||||
Handle(IFSelect_SignType) stc = new IFSelect_SignType (Standard_True);
|
||||
WS->AddNamedItem ("xst-type",stc);
|
||||
|
||||
WS->AddNamedItem ("xst-ancestor-type",new IFSelect_SignAncestor);
|
||||
WS->AddNamedItem ("xst-types",new IFSelect_SignCounter(stp,Standard_False,Standard_True));
|
||||
WS->AddNamedItem ("xst-category",new IFSelect_SignCategory);
|
||||
WS->AddNamedItem ("xst-validity",new IFSelect_SignValidity);
|
||||
|
||||
Handle(IFSelect_DispPerOne) dispone = new IFSelect_DispPerOne;
|
||||
dispone->SetFinalSelection(slr);
|
||||
WS->AddNamedItem ("xst-disp-one",dispone);
|
||||
|
||||
Handle(IFSelect_DispPerCount) dispcount = new IFSelect_DispPerCount;
|
||||
Handle(IFSelect_IntParam) intcount = new IFSelect_IntParam;
|
||||
intcount->SetValue(5);
|
||||
dispcount->SetCount(intcount);
|
||||
dispcount->SetFinalSelection(slr);
|
||||
WS->AddNamedItem ("xst-disp-count",dispcount);
|
||||
|
||||
Handle(IFSelect_DispPerFiles) dispfiles = new IFSelect_DispPerFiles;
|
||||
Handle(IFSelect_IntParam) intfiles = new IFSelect_IntParam;
|
||||
intfiles->SetValue(10);
|
||||
dispfiles->SetCount(intfiles);
|
||||
dispfiles->SetFinalSelection(slr);
|
||||
WS->AddNamedItem ("xst-disp-files",dispfiles);
|
||||
|
||||
Handle(IFSelect_DispPerSignature) dispsign = new IFSelect_DispPerSignature;
|
||||
dispsign->SetSignCounter(new IFSelect_SignCounter(Handle(IFSelect_Signature)(stc)));
|
||||
dispsign->SetFinalSelection(slr);
|
||||
WS->AddNamedItem ("xst-disp-sign",dispsign);
|
||||
|
||||
// Not used directly but useful anyway
|
||||
WS->AddNamedItem ("xst-pointed",new IFSelect_SelectPointed);
|
||||
WS->AddNamedItem ("xst-sharing",new IFSelect_SelectSharing);
|
||||
WS->AddNamedItem ("xst-shared",new IFSelect_SelectShared);
|
||||
WS->AddNamedItem ("xst-nb-selected",new IFSelect_GraphCounter);
|
||||
|
||||
//szv:mySignType = stp;
|
||||
WS->SetSignType( stp );
|
||||
}
|
||||
|
||||
// Editeurs de Parametres
|
||||
// Ici car les constructeurs specifiques des controlleurs ont pu creer des
|
||||
// Parametres : attendre donc ici
|
||||
// Applied Modifiers
|
||||
Standard_Integer i, nb = myAdaptorApplied.Length();
|
||||
for (i = 1; i <= nb; i ++) {
|
||||
const Handle(Standard_Transient) &anitem = myAdaptorApplied.Value(i);
|
||||
Handle(TCollection_HAsciiString) name = WS->Name(anitem);
|
||||
WS->SetAppliedModifier(GetCasted(IFSelect_GeneralModifier,anitem),WS->ShareOut());
|
||||
}
|
||||
|
||||
// Editors of Parameters
|
||||
// Here for the specific manufacturers of controllers could create the
|
||||
// Parameters: So wait here
|
||||
|
||||
Handle(TColStd_HSequenceOfHAsciiString) listat = Interface_Static::Items();
|
||||
Handle(IFSelect_ParamEditor) paramed =
|
||||
IFSelect_ParamEditor::StaticEditor (listat,"All Static Parameters");
|
||||
Handle(IFSelect_ParamEditor) paramed = IFSelect_ParamEditor::StaticEditor (listat,"All Static Parameters");
|
||||
WS->AddNamedItem ("xst-static-params-edit",paramed);
|
||||
Handle(IFSelect_EditForm) paramform = paramed->Form(Standard_False);
|
||||
WS->AddNamedItem ("xst-static-params",paramform);
|
||||
|
||||
// Norm Specific
|
||||
//Customising (WS);
|
||||
|
||||
// Loading Options of the Profile
|
||||
|
||||
// Available Signatures
|
||||
Handle(MoniTool_Option) optsign = theProfile->Option ("sign-type");
|
||||
// Handle(TColStd_HSequenceOfHAsciiString) signs =
|
||||
// WS->ItemNames (STANDARD_TYPE(IFSelect_Signature));
|
||||
// Standard_Integer isign, nbsign = (signs.IsNull() ? 0 : signs->Length());
|
||||
// for (isign = 1; isign <= nbsign; isign ++) {
|
||||
// Handle(TCollection_HAsciiString) signame = signs->Value(isign);
|
||||
// Handle(Standard_Transient) asign = WS->NamedItem (signame);
|
||||
// optsign->Add (signame->ToCString(),asign);
|
||||
// }
|
||||
optsign->Add ("default",theSignType); // defaut specifique
|
||||
optsign->Switch ("default"); // garder courante la definition par defaut !
|
||||
|
||||
// Actor Read
|
||||
Handle(MoniTool_Option) optacrd = theProfile->Option ("tr-read");
|
||||
optacrd->Add ("default",theAdaptorRead);
|
||||
optacrd->Switch ("default");
|
||||
|
||||
// Actor Write
|
||||
Handle(MoniTool_Option) optacwr = theProfile->Option ("tr-write");
|
||||
optacwr->Add ("default",theAdaptorWrite);
|
||||
optacwr->Switch ("default");
|
||||
|
||||
// Basic configuration
|
||||
|
||||
theProfile->AddConf ("Base");
|
||||
theProfile->AddSwitch ("Base","sign-type","default");
|
||||
theProfile->AddSwitch ("Base","tr-read","default");
|
||||
theProfile->AddSwitch ("Base","tr-write","default");
|
||||
theProfile->SetCurrent ("Base");
|
||||
}
|
||||
|
||||
void XSControl_Controller::Customising
|
||||
( Handle(XSControl_WorkSession)& WS)
|
||||
{
|
||||
//ndle(IFSelect_SelectModelRoots) slr = new IFSelect_SelectModelRoots;
|
||||
///WS->AddNamedItem ("xst-model-roots",slr);
|
||||
if(!WS->NamedItem("xst-model-all").IsNull()) return;
|
||||
Handle(IFSelect_SelectModelEntities) sle = new IFSelect_SelectModelEntities;
|
||||
WS->AddNamedItem ("xst-model-all",sle);
|
||||
Handle(IFSelect_SelectModelRoots) slr;
|
||||
slr = new IFSelect_SelectModelRoots;
|
||||
WS->AddNamedItem ("xst-model-roots",slr);
|
||||
if(strcasecmp(WS->SelectedNorm(),"STEP")) {
|
||||
Handle(XSControl_SelectForTransfer) st1 = new XSControl_SelectForTransfer;
|
||||
st1->SetInput (slr);
|
||||
st1->SetReader (WS->TransferReader());
|
||||
WS->AddNamedItem ("xst-transferrable-roots",st1);
|
||||
|
||||
}
|
||||
//else slr = Handle(IFSelect_SelectModelRoots)::DownCast(WS->NamedItem("xst-model-roots"));
|
||||
Handle(XSControl_SelectForTransfer) st2 = new XSControl_SelectForTransfer;
|
||||
st2->SetInput (sle);
|
||||
st2->SetReader (WS->TransferReader());
|
||||
WS->AddNamedItem ("xst-transferrable-all",st2);
|
||||
|
||||
Handle(XSControl_SignTransferStatus) strs = new XSControl_SignTransferStatus;
|
||||
strs->SetReader (WS->TransferReader());
|
||||
WS->AddNamedItem ("xst-transfer-status",strs);
|
||||
|
||||
Handle(XSControl_ConnectedShapes) scs = new XSControl_ConnectedShapes;
|
||||
scs->SetReader (WS->TransferReader());
|
||||
WS->AddNamedItem ("xst-connected-faces",scs);
|
||||
|
||||
Handle(IFSelect_SignType) stp = new IFSelect_SignType (Standard_False);
|
||||
WS->AddNamedItem ("xst-long-type",stp);
|
||||
Handle(IFSelect_SignType) stc = new IFSelect_SignType (Standard_True);
|
||||
WS->AddNamedItem ("xst-type",stc);
|
||||
Handle(IFSelect_SignAncestor) sta = new IFSelect_SignAncestor;
|
||||
WS->AddNamedItem ("xst-ancestor-type",sta);
|
||||
Handle(IFSelect_SignCounter) tc1 =
|
||||
new IFSelect_SignCounter(stp,Standard_False,Standard_True);
|
||||
WS->AddNamedItem ("xst-types",tc1);
|
||||
Handle(IFSelect_SignCategory) sca = new IFSelect_SignCategory;
|
||||
WS->AddNamedItem ("xst-category",sca);
|
||||
Handle(IFSelect_SignValidity) sva = new IFSelect_SignValidity;
|
||||
WS->AddNamedItem ("xst-validity",sva);
|
||||
|
||||
Handle(IFSelect_DispPerOne) dispone = new IFSelect_DispPerOne;
|
||||
dispone->SetFinalSelection(slr);
|
||||
WS->AddNamedItem ("xst-disp-one",dispone);
|
||||
Handle(IFSelect_DispPerCount) dispcount = new IFSelect_DispPerCount;
|
||||
Handle(IFSelect_IntParam) intcount = new IFSelect_IntParam;
|
||||
intcount->SetValue(5);
|
||||
dispcount->SetCount(intcount);
|
||||
dispcount->SetFinalSelection(slr);
|
||||
WS->AddNamedItem ("xst-disp-count",dispcount);
|
||||
Handle(IFSelect_DispPerFiles) dispfiles = new IFSelect_DispPerFiles;
|
||||
Handle(IFSelect_IntParam) intfiles = new IFSelect_IntParam;
|
||||
intfiles->SetValue(10);
|
||||
dispfiles->SetCount(intfiles);
|
||||
dispfiles->SetFinalSelection(slr);
|
||||
WS->AddNamedItem ("xst-disp-files",dispfiles);
|
||||
Handle(IFSelect_DispPerSignature) dispsign = new IFSelect_DispPerSignature;
|
||||
dispsign->SetSignCounter(new IFSelect_SignCounter(Handle(IFSelect_Signature)(stc)));
|
||||
dispsign->SetFinalSelection(slr);
|
||||
WS->AddNamedItem ("xst-disp-sign",dispsign);
|
||||
|
||||
// Pas utilisables directement mais bien utiles quand meme
|
||||
WS->AddNamedItem ("xst-pointed",new IFSelect_SelectPointed);
|
||||
WS->AddNamedItem ("xst-sharing",new IFSelect_SelectSharing);
|
||||
WS->AddNamedItem ("xst-shared",new IFSelect_SelectShared);
|
||||
WS->AddNamedItem ("xst-nb-selected",new IFSelect_GraphCounter);
|
||||
theSignType = stp;
|
||||
// au moins cela
|
||||
}
|
||||
Handle(Dico_DictionaryOfTransient) XSControl_Controller::AdaptorSession() const
|
||||
{
|
||||
return theAdaptorSession;
|
||||
}
|
||||
|
||||
@@ -26,11 +26,8 @@
|
||||
#include <TColStd_SequenceOfInteger.hxx>
|
||||
#include <Interface_HArray1OfHAsciiString.hxx>
|
||||
#include <MMgt_TShared.hxx>
|
||||
#include <Standard_CString.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <NCollection_Vector.hxx>
|
||||
#include <IFSelect_ReturnStatus.hxx>
|
||||
class MoniTool_Profile;
|
||||
class IFSelect_WorkLibrary;
|
||||
class Interface_Protocol;
|
||||
class IFSelect_Signature;
|
||||
@@ -59,10 +56,6 @@ DEFINE_STANDARD_HANDLE(XSControl_Controller, MMgt_TShared)
|
||||
//! IGES-5.1) and an application data model (CasCade Shapes for
|
||||
//! instance).
|
||||
//!
|
||||
//! A Controller brings a Profile, this allows to have several
|
||||
//! variants on the same basic definition, for instance keep the
|
||||
//! norm definition but give several transfer actors, etc
|
||||
//!
|
||||
//! Finally, Controller can be gathered in a general dictionary then
|
||||
//! retreived later by a general call (method Recorded)
|
||||
//!
|
||||
@@ -70,18 +63,20 @@ DEFINE_STANDARD_HANDLE(XSControl_Controller, MMgt_TShared)
|
||||
//! link between the norm and the application
|
||||
class XSControl_Controller : public MMgt_TShared
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
public:
|
||||
|
||||
//! Changes names
|
||||
//! if a name is empty, the formerly set one remains
|
||||
//! Remark : Does not call Record or AutoRecord
|
||||
Standard_EXPORT void SetNames (const Standard_CString longname, const Standard_CString shortname);
|
||||
Standard_EXPORT void SetNames (const Standard_CString theLongName, const Standard_CString theShortName);
|
||||
|
||||
//! Records <me> is a general dictionary under Short and Long
|
||||
//! Names (see method Name)
|
||||
Standard_EXPORT void AutoRecord() const;
|
||||
void AutoRecord() const
|
||||
{
|
||||
Record (Name(Standard_True));
|
||||
Record (Name(Standard_False));
|
||||
}
|
||||
|
||||
//! Records <me> in a general dictionary under a name
|
||||
//! Error if <name> already used for another one
|
||||
@@ -91,60 +86,24 @@ public:
|
||||
//! Returns a Null Handle if <name> is unknown
|
||||
Standard_EXPORT static Handle(XSControl_Controller) Recorded (const Standard_CString name);
|
||||
|
||||
//! Returns the list of names of recorded norms, according to mode
|
||||
//! = 0 (D) : all the recorded names
|
||||
//! < 0 : for each distinct norm, its resource (short) name
|
||||
//! > 0 : for each distinct norm, its complete (long) name
|
||||
Standard_EXPORT static Handle(TColStd_HSequenceOfHAsciiString) ListRecorded (const Standard_Integer mode = 0);
|
||||
|
||||
//! Returns a name, as given when initializing :
|
||||
//! rsc = False (D) : True Name attached to the Norm (long name)
|
||||
//! rsc = True : Name of the ressource set (i.e. short name)
|
||||
Standard_EXPORT Standard_CString Name (const Standard_Boolean rsc = Standard_False) const;
|
||||
|
||||
//! Returns the Profile
|
||||
//! It starts with a first configuration Base (empty) and the
|
||||
//! following options :
|
||||
//! protocol for the Protocol
|
||||
//! sign-type for the SignType (Default Signature for Type)
|
||||
//! access for the WorkLibrary
|
||||
//! tr-read for ActorRead (import processor)
|
||||
//! tr-write for ActorWrite (export processor)
|
||||
Standard_EXPORT Handle(MoniTool_Profile) Profile() const;
|
||||
|
||||
//! Considers the current state of the Controller as defining a
|
||||
//! configuration, newly created or already existing
|
||||
Standard_EXPORT void DefineProfile (const Standard_CString confname);
|
||||
|
||||
//! Sets the Controller in a given Configuration of its Profile
|
||||
//! Calls SettingProfile (which can be redefined)
|
||||
//!
|
||||
//! Returns True if done, False if <confname> unknown
|
||||
Standard_EXPORT Standard_Boolean SetProfile (const Standard_CString confname);
|
||||
|
||||
//! This method is called by SetProfile, it can be redefined
|
||||
//! for specific sub-class of Controller
|
||||
//! The default does nothing
|
||||
Standard_EXPORT virtual Standard_Boolean SettingProfile (const Standard_CString confname);
|
||||
|
||||
//! Applies a Configuration of the Profile to the WorkSession
|
||||
//! I.E. calls SetProfile then fills WorkSession with definitions
|
||||
Standard_EXPORT Standard_Boolean ApplyProfile (const Handle(XSControl_WorkSession)& WS, const Standard_CString confname);
|
||||
|
||||
//! Called by ApplyProfile, can be redefined for specific
|
||||
//! sub-class of Controller
|
||||
//! The default does nothing
|
||||
Standard_EXPORT virtual Standard_Boolean ApplyingProfile (const Handle(XSControl_WorkSession)& WS, const Standard_CString confname);
|
||||
Standard_CString Name (const Standard_Boolean rsc = Standard_False) const
|
||||
{ return (rsc ? myShortName.ToCString() : myLongName.ToCString()); }
|
||||
|
||||
//! Returns the Protocol attached to the Norm (from field)
|
||||
Standard_EXPORT Handle(Interface_Protocol) Protocol() const;
|
||||
const Handle(Interface_Protocol) & Protocol () const
|
||||
{ return myAdaptorProtocol; }
|
||||
|
||||
//! Returns the SignType attached to the norm (from field)
|
||||
Standard_EXPORT Handle(IFSelect_Signature) SignType() const;
|
||||
//szv:const Handle(IFSelect_Signature) & SignType1() const
|
||||
//szv:{ return mySignType; }
|
||||
|
||||
//! Returns the WorkLibrary attached to the Norm. Remark that it
|
||||
//! has to be in phase with the Protocol (read from field)
|
||||
Standard_EXPORT Handle(IFSelect_WorkLibrary) WorkLibrary() const;
|
||||
const Handle(IFSelect_WorkLibrary) & WorkLibrary() const
|
||||
{ return myAdaptorLibrary; }
|
||||
|
||||
//! Creates a new empty Model ready to receive data of the Norm
|
||||
//! Used to write data from Imagine to an interface file
|
||||
@@ -153,22 +112,12 @@ public:
|
||||
//! Returns the Actor for Read attached to the pair (norm,appli)
|
||||
//! It can be adapted for data of the input Model, as required
|
||||
//! Can be read from field then adapted with Model as required
|
||||
Standard_EXPORT virtual Handle(Transfer_ActorOfTransientProcess) ActorRead (const Handle(Interface_InterfaceModel)& model) const = 0;
|
||||
Standard_EXPORT virtual Handle(Transfer_ActorOfTransientProcess) ActorRead (const Handle(Interface_InterfaceModel)& model) const;
|
||||
|
||||
//! Returns the Actor for Write attached to the pair (norm,appli)
|
||||
//! Read from field. Can be redefined
|
||||
Standard_EXPORT virtual Handle(Transfer_ActorOfFinderProcess) ActorWrite() const;
|
||||
|
||||
//! Updates static values
|
||||
//! <mode> precises the kind of updating : (see Items from Static)
|
||||
//! -1 : a precise static item : criter = its name
|
||||
//! 0 : all items of a family : criter = the family name
|
||||
//! 1 : all items which match regexp name : criter = regexp name
|
||||
//! By default (criter empty) should consider all relevant statics
|
||||
//! If <name> is defined, can consider only this static item
|
||||
//! The provided default method does nothing, to be redefined
|
||||
Standard_EXPORT virtual void UpdateStatics (const Standard_Integer mode, const Standard_CString criter = "") const;
|
||||
|
||||
//! Sets mininum and maximum values for modetrans (write)
|
||||
//! Erases formerly recorded bounds and values
|
||||
//! Actually only for shape
|
||||
@@ -219,120 +168,55 @@ public:
|
||||
//! Returned value is a status, as follows :
|
||||
//! Done OK , Void : No Result , Fail : Fail (e.g. exception)
|
||||
//! Error : bad conditions , bad model or null model
|
||||
//! Resolution of file clusters
|
||||
//! According to each norm, there can (or not) be files of which
|
||||
//! definition is not complete but refers to other files : this defines
|
||||
//! a file cluster.
|
||||
//! It can then be resolved by two calls :
|
||||
//! - ClusterContext prepares the resolution, specific of each case
|
||||
//! - ResolveCluster performs the resolution, its result consists in
|
||||
//! having all data gathered in one final model
|
||||
Standard_EXPORT virtual IFSelect_ReturnStatus TransferWriteShape (const TopoDS_Shape& shape, const Handle(Transfer_FinderProcess)& FP, const Handle(Interface_InterfaceModel)& model, const Standard_Integer modetrans = 0) const;
|
||||
|
||||
//! Prepares and returns a context to resolve a cluster
|
||||
//! All data to be used are detained by the WorkSession
|
||||
//! The definition of this context is free and proper to each case
|
||||
//! remark that it is aimed to be used in ResolveCluster
|
||||
//!
|
||||
//! The context must be prepared, but resolution must not have
|
||||
//! began
|
||||
//!
|
||||
//! If no cluster has to be resolved, should return a null handle
|
||||
//! This is the default case, which can be redefined
|
||||
Standard_EXPORT virtual Handle(Standard_Transient) ClusterContext (const Handle(XSControl_WorkSession)& WS) const;
|
||||
|
||||
//! Performs the resolution itself, from the starting data and
|
||||
//! the cluster context
|
||||
//!
|
||||
//! Can fill a CheckList as necessary (especially when one or
|
||||
//! more references remain unresolved)
|
||||
//!
|
||||
//! Default does nothing and returns an empty CheckList
|
||||
Standard_EXPORT virtual Interface_CheckIterator ResolveCluster (const Handle(XSControl_WorkSession)& WS, const Handle(Standard_Transient)& context) const;
|
||||
|
||||
//! Adds an item in the control list
|
||||
//! A control item of a controller is accessed by its name which
|
||||
//! is specific of a kind of item (i.e. a kind of functionnality)
|
||||
//! Adds or replaces if <name> is already recorded
|
||||
Standard_EXPORT void AddControlItem (const Handle(Standard_Transient)& item, const Standard_CString name);
|
||||
|
||||
//! Returns a control item from its name, Null if <name> unknown
|
||||
//! To be used then, it just remains to be down-casted
|
||||
Standard_EXPORT Handle(Standard_Transient) ControlItem (const Standard_CString name) const;
|
||||
|
||||
//! Records the name of a Static to be traced for a given use
|
||||
Standard_EXPORT void TraceStatic (const Standard_CString name, const Standard_Integer use);
|
||||
|
||||
//! Records a Session Item, to be added for customisation of the
|
||||
//! Work Session. It must have a specific name.
|
||||
//! Records a Session Item, to be added for customisation of the Work Session.
|
||||
//! It must have a specific name.
|
||||
//! <setapplied> is used if <item> is a GeneralModifier, to decide
|
||||
//! to which hook list it will be applied, if not empty (else,
|
||||
//! not applied to any hook list)
|
||||
//! ACTUAL : only one hook list is managed : "send"
|
||||
//! Remark : this method is to be called at Create time, the
|
||||
//! recorded items will be used by Customise
|
||||
//! If set to true, <item> will be applied to the hook list "send".
|
||||
//! Else, it is not applied to any hook list.
|
||||
//! Remark : this method is to be called at Create time,
|
||||
//! the recorded items will be used by Customise
|
||||
//! Warning : if <name> conflicts, the last recorded item is kept
|
||||
Standard_EXPORT void AddSessionItem (const Handle(Standard_Transient)& item, const Standard_CString name, const Standard_CString setapplied = "");
|
||||
Standard_EXPORT void AddSessionItem (const Handle(Standard_Transient)& theItem, const Standard_CString theName, const Standard_Boolean toApply = Standard_False);
|
||||
|
||||
//! Returns an item given its name to record in a Session
|
||||
//! If <name> is unknown, returns a Null Handle
|
||||
Standard_EXPORT Handle(Standard_Transient) SessionItem (const Standard_CString name) const;
|
||||
Standard_EXPORT Handle(Standard_Transient) SessionItem (const Standard_CString theName) const;
|
||||
|
||||
//! Returns True if <item> is recorded as <setapplied = True>
|
||||
Standard_EXPORT Standard_Boolean IsApplied (const Handle(Standard_Transient)& item) const;
|
||||
|
||||
//! Customises a WorkSession, by adding to it the recorded items
|
||||
//! (by AddSessionItem), then by calling a specific method
|
||||
//! Customising, set by default to do nothing
|
||||
//! Customises a WorkSession, by adding to it the recorded items (by AddSessionItem)
|
||||
Standard_EXPORT virtual void Customise (Handle(XSControl_WorkSession)& WS);
|
||||
|
||||
//! Specific customisation method, which can be redefined
|
||||
//! Default does nothing
|
||||
Standard_EXPORT void Customising (Handle(XSControl_WorkSession)& WS);
|
||||
|
||||
Standard_EXPORT Handle(Dico_DictionaryOfTransient) AdaptorSession() const;
|
||||
|
||||
|
||||
|
||||
const Handle(Dico_DictionaryOfTransient) & AdaptorSession() const
|
||||
{ return myAdaptorSession; }
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(XSControl_Controller,MMgt_TShared)
|
||||
|
||||
protected:
|
||||
|
||||
protected:
|
||||
|
||||
//! Initializing with names
|
||||
//! <longname> is for the complete, official, long name
|
||||
//! <shortname> is for the short name used for resources
|
||||
Standard_EXPORT XSControl_Controller(const Standard_CString longname, const Standard_CString shortname);
|
||||
//! <theLongName> is for the complete, official, long name
|
||||
//! <theShortName> is for the short name used for resources
|
||||
Standard_EXPORT XSControl_Controller(const Standard_CString theLongName, const Standard_CString theShortName);
|
||||
|
||||
TCollection_AsciiString theShortName;
|
||||
TCollection_AsciiString theLongName;
|
||||
Handle(IFSelect_WorkLibrary) theAdaptorLibrary;
|
||||
Handle(Interface_Protocol) theAdaptorProtocol;
|
||||
Handle(IFSelect_Signature) theSignType;
|
||||
Handle(Transfer_ActorOfTransientProcess) theAdaptorRead;
|
||||
Handle(Transfer_ActorOfFinderProcess) theAdaptorWrite;
|
||||
Handle(Dico_DictionaryOfTransient) theAdaptorSession;
|
||||
//! Records the name of a Static to be traced for a given use
|
||||
Standard_EXPORT void TraceStatic (const Standard_CString theName, const Standard_Integer theUse);
|
||||
|
||||
TCollection_AsciiString myShortName;
|
||||
TCollection_AsciiString myLongName;
|
||||
Handle(IFSelect_WorkLibrary) myAdaptorLibrary;
|
||||
Handle(Interface_Protocol) myAdaptorProtocol;
|
||||
//szv:Handle(IFSelect_Signature) mySignType;
|
||||
Handle(Transfer_ActorOfTransientProcess) myAdaptorRead;
|
||||
Handle(Transfer_ActorOfFinderProcess) myAdaptorWrite;
|
||||
Handle(Dico_DictionaryOfTransient) myAdaptorSession;
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Handle(MoniTool_Profile) theProfile;
|
||||
Handle(Dico_DictionaryOfTransient) theItems;
|
||||
TColStd_SequenceOfTransient theAdaptorApplied;
|
||||
Handle(TColStd_HSequenceOfHAsciiString) theAdaptorHooks;
|
||||
TColStd_SequenceOfTransient theParams;
|
||||
TColStd_SequenceOfInteger theParamUses;
|
||||
Handle(Interface_HArray1OfHAsciiString) theModeWriteShapeN;
|
||||
|
||||
private:
|
||||
|
||||
TColStd_SequenceOfTransient myAdaptorApplied;
|
||||
NCollection_Vector<Handle(Standard_Transient)> myParams;
|
||||
NCollection_Vector<Standard_Integer> myParamUses;
|
||||
Handle(Interface_HArray1OfHAsciiString) myModeWriteShapeN;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _XSControl_Controller_HeaderFile
|
||||
|
||||
@@ -74,7 +74,7 @@ static IFSelect_ReturnStatus XSControl_tpdraw
|
||||
const Standard_CString arg1 = pilot->Arg(1);
|
||||
const Standard_CString arg2 = pilot->Arg(2);
|
||||
const Standard_CString arg3 = pilot->Arg(3);
|
||||
Handle(Transfer_TransientProcess) TP = XSControl::Session(pilot)->TransferReader()->TransientProcess();
|
||||
const Handle(Transfer_TransientProcess) &TP = XSControl::Session(pilot)->TransferReader()->TransientProcess();
|
||||
Handle(Message_Messenger) sout = Message::DefaultMessenger();
|
||||
if (TP.IsNull()) { sout<<"No Transfer Read"<<endl; return IFSelect_RetError;}
|
||||
// **** tpdraw ****
|
||||
@@ -240,7 +240,7 @@ static IFSelect_ReturnStatus XSControl_tpcompound
|
||||
{
|
||||
Standard_Integer argc = pilot->NbWords();
|
||||
const Standard_CString arg1 = pilot->Arg(1);
|
||||
Handle(Transfer_TransientProcess) TP = XSControl::Session(pilot)->TransferReader()->TransientProcess();
|
||||
const Handle(Transfer_TransientProcess) &TP = XSControl::Session(pilot)->TransferReader()->TransientProcess();
|
||||
Handle(Message_Messenger) sout = Message::DefaultMessenger();
|
||||
if (TP.IsNull()) { sout<<"No Transfer Read"<<endl; return IFSelect_RetError;}
|
||||
// **** tpcompound ****
|
||||
@@ -283,10 +283,10 @@ static IFSelect_ReturnStatus XSControl_traccess
|
||||
Standard_Boolean cascomp = (pilot->Word(0).Location(1,'o',1,5) > 0);
|
||||
Standard_Boolean cassave = (pilot->Word(0).Location(1,'s',1,5) > 0);
|
||||
char nomsh[100], noms[100];
|
||||
Handle(XSControl_TransferReader) TR = XSControl::Session(pilot)->TransferReader();
|
||||
const Handle(XSControl_TransferReader) &TR = XSControl::Session(pilot)->TransferReader();
|
||||
Handle(Message_Messenger) sout = Message::DefaultMessenger();
|
||||
if (TR.IsNull()) { sout<<" manque init"<<endl; return IFSelect_RetError; }
|
||||
Handle(Interface_InterfaceModel) mdl = TR->Model();
|
||||
const Handle(Interface_InterfaceModel) &mdl = TR->Model();
|
||||
if (mdl.IsNull()) { sout<<" modele absent"<<endl; return IFSelect_RetError; }
|
||||
Standard_Integer num = (argc > 1 ? IFSelect_Functions::GiveEntityNumber(XSControl::Session(pilot),arg1) : 0);
|
||||
|
||||
@@ -299,7 +299,7 @@ static IFSelect_ReturnStatus XSControl_traccess
|
||||
BRep_Builder B;
|
||||
B.MakeCompound(C);
|
||||
|
||||
Handle(TopTools_HSequenceOfShape) list = TR->ShapeResultList(Standard_True);
|
||||
const Handle(TopTools_HSequenceOfShape) &list = TR->ShapeResultList(Standard_True);
|
||||
Standard_Integer i, nb = list->Length();
|
||||
sout<<" TOUS RESULTATS par ShapeResultList, soit "<<nb<<endl;
|
||||
for (i = 1; i <= nb; i ++) {
|
||||
@@ -382,7 +382,7 @@ static IFSelect_ReturnStatus XSControl_fromshape
|
||||
}
|
||||
|
||||
// IMPORT
|
||||
Handle(XSControl_TransferReader) TR = XSControl::Session(pilot)->TransferReader();
|
||||
const Handle(XSControl_TransferReader) &TR = XSControl::Session(pilot)->TransferReader();
|
||||
if (TR.IsNull()) { } // sout<<"No read transfer (import) recorded"<<endl;
|
||||
else {
|
||||
yena = Standard_True;
|
||||
@@ -459,8 +459,8 @@ static IFSelect_ReturnStatus XSControl_fromshape
|
||||
}
|
||||
|
||||
// ET EN EXPORT ?
|
||||
Handle(Transfer_FinderProcess) FP = XSControl::Session(pilot)->MapWriter();
|
||||
if (FP.IsNull()) { } //sout<<"No write transfer (export) recorded"<<endl;
|
||||
const Handle(Transfer_FinderProcess) &FP = XSControl::Session(pilot)->TransferWriter()->FinderProcess();
|
||||
if (FP.IsNull()) { }
|
||||
else {
|
||||
yena = Standard_True;
|
||||
Handle(Transfer_Finder) fnd = TransferBRep::ShapeMapper (FP,Shape);
|
||||
@@ -528,7 +528,7 @@ static IFSelect_ReturnStatus XSControl_trconnexentities
|
||||
Standard_Integer argc = pilot->NbWords();
|
||||
const Standard_CString arg1 = pilot->Arg(1);
|
||||
// **** connected entities (last transfer) ****
|
||||
Handle(XSControl_TransferReader) TR = XSControl::Session(pilot)->TransferReader();
|
||||
const Handle(XSControl_TransferReader) &TR = XSControl::Session(pilot)->TransferReader();
|
||||
Handle(Transfer_TransientProcess) TP;
|
||||
if (!TR.IsNull()) TP = TR->TransientProcess();
|
||||
Handle(Message_Messenger) sout = Message::DefaultMessenger();
|
||||
@@ -546,7 +546,7 @@ static IFSelect_ReturnStatus XSControl_trconnexentities
|
||||
XSControl_ConnectedShapes::AdjacentEntities (Shape,TP,TopAbs_FACE);
|
||||
Standard_Integer i, nb = list->Length();
|
||||
sout<<nb<<" Entities produced Connected Shapes :"<<endl;
|
||||
Handle(Interface_InterfaceModel) model = XSControl::Session(pilot)->Model();
|
||||
const Handle(Interface_InterfaceModel) &model = XSControl::Session(pilot)->Model();
|
||||
sout<<"(";
|
||||
for (i = 1; i <= nb; i ++) {
|
||||
if (i > 1) sout<<",";
|
||||
@@ -618,7 +618,7 @@ static IFSelect_ReturnStatus XSControl_trimport
|
||||
// Starting Transfer
|
||||
|
||||
WS->InitTransferReader (0);
|
||||
Handle(XSControl_TransferReader) TR = WS->TransferReader();
|
||||
const Handle(XSControl_TransferReader) &TR = WS->TransferReader();
|
||||
if (TR.IsNull()) { sout<<" init not done or failed"<<endl; return IFSelect_RetError; }
|
||||
|
||||
TR->BeginTransfer();
|
||||
@@ -761,7 +761,7 @@ Standard_Integer XSControl_FuncShape::MoreShapes
|
||||
Handle(Message_Messenger) sout = Message::DefaultMessenger();
|
||||
if (list.IsNull()) list = new TopTools_HSequenceOfShape();
|
||||
if (name[0] == '*' && (name[1] == '\0' || (name[1] == '*' && name[2] == '\0'))) {
|
||||
Handle(Transfer_TransientProcess) TP = session->TransferReader()->TransientProcess();
|
||||
const Handle(Transfer_TransientProcess) &TP = session->TransferReader()->TransientProcess();
|
||||
if (TP.IsNull()) { sout<<"last transfer : unknown"<<endl;return 0; }
|
||||
Handle(TopTools_HSequenceOfShape) li = TransferBRep::Shapes(TP,(name[1] == '\0'));
|
||||
if (li.IsNull()) return 0;
|
||||
|
||||
@@ -23,11 +23,6 @@
|
||||
#include <Interface_Static.hxx>
|
||||
#include <Message.hxx>
|
||||
#include <Message_Messenger.hxx>
|
||||
#include <MoniTool_Option.hxx>
|
||||
#include <MoniTool_Profile.hxx>
|
||||
#include <MoniTool_TypedValue.hxx>
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
#include <TColStd_HSequenceOfAsciiString.hxx>
|
||||
#include <TColStd_HSequenceOfHAsciiString.hxx>
|
||||
#include <TColStd_HSequenceOfTransient.hxx>
|
||||
#include <Transfer_Binder.hxx>
|
||||
@@ -44,10 +39,6 @@
|
||||
#include <XSControl_TransferWriter.hxx>
|
||||
#include <XSControl_WorkSession.hxx>
|
||||
|
||||
//#include <TransferBRep_ShapeBinder.hxx>
|
||||
//#include <TransferBRep_ShapeListBinder.hxx>
|
||||
//#include <TransferBRep_ShapeMapper.hxx>
|
||||
//#include <TransferBRep_OrientedShapeMapper.hxx>
|
||||
// #######################################################################
|
||||
// ## ##
|
||||
// ## ##
|
||||
@@ -83,7 +74,7 @@ static IFSelect_ReturnStatus XSControl_xnorm(const Handle(IFSelect_SessionPilot)
|
||||
Handle(XSControl_Controller) control = WS->NormAdaptor();
|
||||
Handle(Message_Messenger) sout = Message::DefaultMessenger();
|
||||
if (argc == 1)
|
||||
sout<<"Current Norm. xnorm newnorm [profile] to change , xnorm ? for the list"<<endl;
|
||||
sout<<"Current Norm. xnorm newnorm to change"<<endl;
|
||||
else sout<<"Current Norm :"<<endl;
|
||||
if (control.IsNull()) sout<<"no norm currently defined"<<endl;
|
||||
else
|
||||
@@ -91,273 +82,15 @@ static IFSelect_ReturnStatus XSControl_xnorm(const Handle(IFSelect_SessionPilot)
|
||||
<< " Short name (resource) : "<<control->Name(Standard_True)<<endl;
|
||||
if (argc == 1) return IFSelect_RetVoid;
|
||||
|
||||
if (arg1[0] == '?') {
|
||||
sout<<"List of available norms"<<endl;
|
||||
Standard_Integer i,nb;
|
||||
Handle(TColStd_HSequenceOfHAsciiString) norms = XSControl_Controller::ListRecorded(-1);
|
||||
nb = norms->Length();
|
||||
sout<<"Short Proper Names (complete names) : "<<nb<<" :";
|
||||
for (i = 1; i <= nb; i ++) sout<<" "<<norms->Value(i)->ToCString();
|
||||
sout<<endl;
|
||||
norms = XSControl_Controller::ListRecorded(1);
|
||||
nb = norms->Length();
|
||||
sout<<"Long Proper Names (resource names) : "<<nb<<" :";
|
||||
for (i = 1; i <= nb; i ++) sout<<" "<<norms->Value(i)->ToCString();
|
||||
sout<<endl;
|
||||
norms = XSControl_Controller::ListRecorded(0);
|
||||
nb = norms->Length();
|
||||
sout<<"All Norm Names (short, long and aliases) "<<nb<<" :";
|
||||
for (i = 1; i <= nb; i ++) sout<<" "<<norms->Value(i)->ToCString();
|
||||
sout<<endl;
|
||||
sout<<"To change, xnorm newnorm"<<endl;
|
||||
return IFSelect_RetVoid;
|
||||
}
|
||||
|
||||
control = XSControl_Controller::Recorded(arg1);
|
||||
if (control.IsNull()) { sout<<" No norm named : "<<arg1<<endl; return IFSelect_RetError; }
|
||||
else {
|
||||
WS->SetController(control);
|
||||
sout<<"new norm : "<<control->Name()<<endl;
|
||||
if (argc > 2) {
|
||||
const Standard_CString arg2 = pilot->Arg(2);
|
||||
if (!control->Profile()->SetCurrent (arg2))
|
||||
sout<<"profile could not be set to "<<arg2<<endl;
|
||||
}
|
||||
sout<<"current profile : "<<control->Profile()->Current()<<endl;
|
||||
|
||||
IFSelect_Activator::SetCurrentAlias (WS->SelectedNorm(Standard_True));
|
||||
return IFSelect_RetDone;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : xprofile
|
||||
//=======================================================================
|
||||
static IFSelect_ReturnStatus XSControl_xprofile(const Handle(IFSelect_SessionPilot)& pilot)
|
||||
{
|
||||
Standard_Integer argc = pilot->NbWords();
|
||||
const Standard_CString arg1 = pilot->Arg(1);
|
||||
// **** xprofile ****
|
||||
Handle(XSControl_WorkSession) WS = XSControl::Session(pilot);
|
||||
Handle(XSControl_Controller) control = WS->NormAdaptor();
|
||||
if (control.IsNull()) return IFSelect_RetFail;
|
||||
Handle(MoniTool_Profile) prof = control->Profile();
|
||||
Handle(Message_Messenger) sout = Message::DefaultMessenger();
|
||||
sout<<"Current Profile : "<<prof->Current().ToCString()<<endl;
|
||||
|
||||
if (argc < 2) {
|
||||
sout<<"xprofile ? for list of profile confs"<<endl
|
||||
<< "xprofile . to apply the current profile (after editing)"<<endl
|
||||
<< "xprofile profname to select one and apply it"<<endl
|
||||
<< "xprofile profname . to record current profile as profname"<<endl
|
||||
<<" (in followings, profname may be replaced by . for current profile)"<<endl
|
||||
<< "xprofile profname ? to list its definition"<<endl
|
||||
<< "xprofile profname - to clear it completely"<<endl
|
||||
<< "xprofile profname optname casename to edit an option of it"<<endl
|
||||
<< "xprofile profname - optname to clear an option from it"<<endl;
|
||||
return IFSelect_RetVoid;
|
||||
if (control.IsNull()) {
|
||||
sout<<" No norm named : "<<arg1<<endl;
|
||||
return IFSelect_RetError;
|
||||
}
|
||||
|
||||
if (argc == 2) {
|
||||
if (arg1[0] == '?') {
|
||||
Handle(TColStd_HSequenceOfAsciiString) confs = prof->ConfList();
|
||||
Standard_Integer i, nb = confs->Length();
|
||||
sout<<"List of Available Profile Configurations : "<<nb<<" Items"<<endl;
|
||||
for (i = 1; i <= nb; i ++) sout<<confs->Value(i).ToCString()<<endl;
|
||||
return IFSelect_RetVoid;
|
||||
} else if (arg1[0] == '.' && arg1[1] == '\0') {
|
||||
if (!control->ApplyProfile(WS,".")) {
|
||||
sout<<"Applying current profile has failed"<<endl;
|
||||
return IFSelect_RetFail;
|
||||
}
|
||||
return IFSelect_RetDone;
|
||||
} else {
|
||||
|
||||
// Select a Profile
|
||||
if (!control->ApplyProfile(WS,arg1)) {
|
||||
sout<<"Setting "<<arg1<<" as current has failed"<<endl;
|
||||
return IFSelect_RetFail;
|
||||
}
|
||||
sout<<"Setting "<<arg1<<" as current"<<endl;
|
||||
return IFSelect_RetDone;
|
||||
}
|
||||
}
|
||||
|
||||
if (argc == 3) {
|
||||
const Standard_CString arg2 = pilot->Arg(2);
|
||||
|
||||
// List the definition of a profile
|
||||
if (arg2[0] == '?') {
|
||||
Handle(TColStd_HSequenceOfAsciiString) opts, cases;
|
||||
prof->SwitchList (arg1,opts,cases);
|
||||
Standard_Integer i,nb = opts->Length();
|
||||
sout<<"Option -- Case -- ("<<nb<<" switches on configuration "<<arg1<<")"<<endl;
|
||||
for (i = 1; i <= nb; i ++) {
|
||||
sout<<opts->Value(i).ToCString()<<" "<<cases->Value(i).ToCString()<<endl;
|
||||
}
|
||||
return IFSelect_RetVoid;
|
||||
|
||||
// Clear a profile
|
||||
} else if (arg2[0] == '-' && arg2[1] == '\0') {
|
||||
if (!prof->ClearConf(arg1)) {
|
||||
sout<<"Clearing profile "<<arg2<<" has failed"<<endl;
|
||||
return IFSelect_RetFail;
|
||||
}
|
||||
return IFSelect_RetDone;
|
||||
|
||||
// Merge Profile arg2 to arg1
|
||||
} else {
|
||||
if (!prof->HasConf (arg1)) prof->AddConf (arg1);
|
||||
if (!prof->AddFromOtherConf (arg1,arg2)) {
|
||||
sout<<"Merging profile "<<arg2<<" to "<<arg1<<" has failed"<<endl;
|
||||
return IFSelect_RetFail;
|
||||
}
|
||||
return IFSelect_RetDone;
|
||||
}
|
||||
}
|
||||
|
||||
// Editing / Adding a switch in a profile
|
||||
if (argc == 4) {
|
||||
const Standard_CString arg2 = pilot->Arg(2);
|
||||
const Standard_CString arg3 = pilot->Arg(3);
|
||||
|
||||
// Removing a switch
|
||||
if (arg2[0] == '-' && arg2[1] == '\0') {
|
||||
if (!prof->RemoveSwitch (arg1,arg3)) {
|
||||
sout<<"Removing switch on option "<<arg3<<" in profile "<<arg1<<" has failed"<<endl;
|
||||
return IFSelect_RetFail;
|
||||
}
|
||||
sout<<"Edition of profile "<<arg1<<" done. To apply it : xprofile "<<arg1<<endl;
|
||||
return IFSelect_RetDone;
|
||||
|
||||
// Setting a switch
|
||||
} else {
|
||||
if (!prof->AddSwitch (arg1,arg2,arg3)) {
|
||||
sout<<"Setting profile "<<arg1<<" for option "<<arg2<<" to case "<<arg3<<" has failed"<<endl;
|
||||
return IFSelect_RetFail;
|
||||
}
|
||||
sout<<"Edition of profile "<<arg1<<" done. To apply it : xprofile "<<arg1<<endl;
|
||||
return IFSelect_RetDone;
|
||||
}
|
||||
}
|
||||
|
||||
return IFSelect_RetVoid;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : xoption
|
||||
//=======================================================================
|
||||
static IFSelect_ReturnStatus XSControl_xoption(const Handle(IFSelect_SessionPilot)& pilot)
|
||||
{
|
||||
Standard_Integer argc = pilot->NbWords();
|
||||
const Standard_CString arg1 = pilot->Arg(1);
|
||||
const Standard_CString arg2 = pilot->Arg(2);
|
||||
const Standard_CString arg3 = pilot->Arg(3);
|
||||
// **** xoption ****
|
||||
Handle(XSControl_WorkSession) WS = XSControl::Session(pilot);
|
||||
Handle(XSControl_Controller) control = WS->NormAdaptor();
|
||||
if (control.IsNull()) return IFSelect_RetFail;
|
||||
Handle(MoniTool_Profile) prof = control->Profile();
|
||||
Handle(Message_Messenger) sout = Message::DefaultMessenger();
|
||||
sout<<"Current Profile : "<<prof->Current().ToCString()<<endl;
|
||||
|
||||
if (argc < 2) {
|
||||
sout<<"xoption anopt : query an option"<<endl
|
||||
<< "xoption anopt newcase : switch (basic definition)"
|
||||
<<" (but is superseded by current configuration)"<<endl
|
||||
<<"xoption + optname [param] : create an option on a parameter"<<endl
|
||||
<<" (param absent is taken param=optname)"
|
||||
<<"xoption anopt + casename [value] : add a case for a parameter"<<endl
|
||||
<<" (value absent is taken value=casename)"<<endl;
|
||||
|
||||
Handle(TColStd_HSequenceOfAsciiString) optlist = prof->OptionList();
|
||||
Standard_Integer iopt, nbopt = optlist->Length();
|
||||
sout<<"Total : "<<nbopt<<" Options"<<endl;
|
||||
for (iopt = 1; iopt <= nbopt; iopt ++) {
|
||||
TCollection_AsciiString optname = optlist->Value(iopt);
|
||||
Handle(MoniTool_Option) opt = prof->Option (optname.ToCString());
|
||||
sout<<optname.ToCString()<<" : "<<opt->CaseName()<<endl;
|
||||
}
|
||||
return IFSelect_RetVoid;
|
||||
}
|
||||
|
||||
// xoption optname : description
|
||||
|
||||
if (argc == 2) {
|
||||
Handle(MoniTool_Option) opt = prof->Option (arg1);
|
||||
if (opt.IsNull()) { sout<<"Not a recorded Option : "<<arg1<<endl; return IFSelect_RetError; }
|
||||
|
||||
// On va lister les valeurs admises
|
||||
Handle(TColStd_HSequenceOfAsciiString) caselist = opt->ItemList();
|
||||
Standard_Integer icase, nbcase = caselist->Length();
|
||||
Handle(MoniTool_TypedValue) tv = opt->TypedValue();
|
||||
if (tv.IsNull()) sout<<"Option : "<<arg1<<" Type : "<<opt->Type()->Name();
|
||||
else sout<<"Option : "<<arg1<<" TypedValue. Name : "<<tv->Name()<<endl<<" Definition : "<<tv->Definition();
|
||||
|
||||
sout<<endl<<" Current Case (basic) : "<<opt->CaseName()<<" Total : "<<nbcase<<" Cases :"<<endl;
|
||||
for (icase = 1; icase <= nbcase; icase ++) {
|
||||
const TCollection_AsciiString& acase = caselist->Value(icase);
|
||||
sout<<acase.ToCString();
|
||||
|
||||
// Aliases ?
|
||||
Handle(TColStd_HSequenceOfAsciiString) aliases = opt->Aliases(acase.ToCString());
|
||||
Standard_Integer ial, nbal = (aliases.IsNull() ? 0 : aliases->Length());
|
||||
if (nbal > 0) sout<<" - Alias:";
|
||||
for (ial = 1; ial <= nbal; ial ++) sout<<" "<<aliases->Value(ial);
|
||||
if (!tv.IsNull()) {
|
||||
// TypedValue : on peut afficher la valeur
|
||||
Handle(Standard_Transient) str;
|
||||
opt->Item (acase.ToCString(),str);
|
||||
if (!str.IsNull()) sout<<" - Value:"<< Handle(TCollection_HAsciiString)::DownCast(str)->ToCString();
|
||||
}
|
||||
|
||||
sout<<endl;
|
||||
}
|
||||
return IFSelect_RetVoid;
|
||||
}
|
||||
|
||||
// xoption + optname [paramname]
|
||||
if (argc >= 3 && arg1[0] == '+' && arg1[1] == '\0') {
|
||||
Standard_CString parname = pilot->Arg(argc-1);
|
||||
Handle(Interface_Static) param = Interface_Static::Static(parname);
|
||||
if (param.IsNull()) { sout<<"No static parameter is named "<<parname<<endl;
|
||||
return IFSelect_RetError; }
|
||||
const Handle(MoniTool_TypedValue)& aparam = param; // to avoid ambiguity
|
||||
Handle(MoniTool_Option) opt = new MoniTool_Option(aparam,arg2);
|
||||
prof->AddOption (opt);
|
||||
return IFSelect_RetDone;
|
||||
}
|
||||
|
||||
// xoption optname + case [val]
|
||||
if (argc >= 4 && arg2[0] == '+' && arg2[1] == '\0') {
|
||||
Handle(MoniTool_Option) opt = prof->Option (arg1);
|
||||
if (opt.IsNull()) { sout<<"Not a recorded Option : "<<arg1<<endl; return IFSelect_RetError; }
|
||||
Handle(MoniTool_TypedValue) tv = opt->TypedValue();
|
||||
if (tv.IsNull()) { sout<<"Option not for a Parameter : "<<arg1<<endl; return IFSelect_RetError; }
|
||||
Standard_CString valname = pilot->Arg(argc-1);
|
||||
if (!opt->AddBasic (arg3,valname)) {
|
||||
sout<<"Option "<<arg1<<" : not an allowed value : "<<valname<<endl;
|
||||
return IFSelect_RetError;
|
||||
}
|
||||
return IFSelect_RetDone;
|
||||
}
|
||||
|
||||
// xoption optname newcase : edition
|
||||
if (argc == 3) {
|
||||
Handle(MoniTool_Option) opt = prof->Option (arg1);
|
||||
if (opt.IsNull()) { sout<<"Not a recorded Option : "<<arg1<<endl; return IFSelect_RetError; }
|
||||
if (!opt->Switch (arg2)) {
|
||||
sout<<"Option : "<<arg1<<" , Not a suitable case : "<<arg2<<endl;
|
||||
return IFSelect_RetFail;
|
||||
}
|
||||
sout<<"Option : "<<arg1<<" switched to case : "<<arg2<<endl;
|
||||
return IFSelect_RetDone;
|
||||
}
|
||||
|
||||
|
||||
return IFSelect_RetVoid;
|
||||
WS->SetController(control);
|
||||
sout<<"new norm : "<<control->Name()<<endl;
|
||||
return IFSelect_RetDone;
|
||||
}
|
||||
|
||||
|
||||
@@ -380,13 +113,12 @@ static IFSelect_ReturnStatus XSControl_newmodel(const Handle(IFSelect_SessionPil
|
||||
static IFSelect_ReturnStatus XSControl_tpclear(const Handle(IFSelect_SessionPilot)& pilot)
|
||||
{
|
||||
// **** tpclear/twclear ****
|
||||
Standard_Boolean modew = Standard_False;
|
||||
if (pilot->Word(0).Value(2) == 'w') modew = Standard_True;
|
||||
Handle(Transfer_FinderProcess) FP = XSControl::Session(pilot)->MapWriter();
|
||||
Handle(Transfer_TransientProcess) TP = XSControl::Session(pilot)->MapReader();
|
||||
const Standard_Boolean modew = (pilot->Word(0).Value(2) == 'w');
|
||||
const Handle(Transfer_FinderProcess) &FP = XSControl::Session(pilot)->TransferWriter()->FinderProcess();
|
||||
const Handle(Transfer_TransientProcess) &TP = XSControl::Session(pilot)->TransferReader()->TransientProcess();
|
||||
Handle(Message_Messenger) sout = Message::DefaultMessenger();
|
||||
if ( modew) { if(!FP.IsNull()) FP->Clear(); else sout<<"No Transfer Write"<<endl; }
|
||||
else { if(!TP.IsNull()) TP->Clear(); else sout<<"No Transfer Read"<<endl; }
|
||||
if (modew) { if(!FP.IsNull()) FP->Clear(); else sout<<"No Transfer Write"<<endl; }
|
||||
else { if(!TP.IsNull()) TP->Clear(); else sout<<"No Transfer Read"<<endl; }
|
||||
return IFSelect_RetDone;
|
||||
}
|
||||
|
||||
@@ -399,7 +131,7 @@ static IFSelect_ReturnStatus XSControl_tpstat(const Handle(IFSelect_SessionPilot
|
||||
Standard_Integer argc = pilot->NbWords();
|
||||
const Standard_CString arg1 = pilot->Arg(1);
|
||||
//const Standard_CString arg2 = pilot->Arg(2);
|
||||
Handle(Transfer_TransientProcess) TP= XSControl::Session(pilot)->MapReader();
|
||||
const Handle(Transfer_TransientProcess) &TP = XSControl::Session(pilot)->TransferReader()->TransientProcess();
|
||||
Handle(Message_Messenger) sout = Message::DefaultMessenger();
|
||||
if (TP.IsNull()) { sout<<"No Transfer Read"<<endl; return IFSelect_RetError;}
|
||||
// **** tpstat ****
|
||||
@@ -478,7 +210,7 @@ static IFSelect_ReturnStatus XSControl_tpent(const Handle(IFSelect_SessionPilot)
|
||||
{
|
||||
Standard_Integer argc = pilot->NbWords();
|
||||
const Standard_CString arg1 = pilot->Arg(1);
|
||||
Handle(Transfer_TransientProcess) TP= XSControl::Session(pilot)->MapReader();
|
||||
const Handle(Transfer_TransientProcess) &TP = XSControl::Session(pilot)->TransferReader()->TransientProcess();
|
||||
// **** tpent ****
|
||||
Handle(Message_Messenger) sout = Message::DefaultMessenger();
|
||||
if (TP.IsNull()) { sout<<"No Transfer Read"<<endl; return IFSelect_RetError;}
|
||||
@@ -519,67 +251,6 @@ static IFSelect_ReturnStatus XSControl_tpitem(const Handle(IFSelect_SessionPilot
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : tpatr
|
||||
//=======================================================================
|
||||
static IFSelect_ReturnStatus XSControl_tpatr(const Handle(IFSelect_SessionPilot)& /*pilot*/)
|
||||
{
|
||||
/*skl
|
||||
Standard_Integer argc = pilot->NbWords();
|
||||
const Standard_CString arg1 = pilot->Arg(1);
|
||||
Handle(XSControl_WorkSession) WS = XSControl::Session(pilot);
|
||||
Handle(Transfer_TransientProcess) TP = WS->MapReader();
|
||||
|
||||
Handle(Message_Messenger) sout = Message::DefaultMessenger();
|
||||
// tpatr tout court : liste tous les attributs
|
||||
// tpatr nomatr : sur cet attribut, liste les valeurs par entite
|
||||
|
||||
if (argc < 2) {
|
||||
Handle(Dico_DictionaryOfInteger) list = TP->Attributes();
|
||||
for (Dico_IteratorOfDictionaryOfInteger iter(list); iter.More(); iter.Next()) {
|
||||
TCollection_AsciiString name = iter.Name();
|
||||
Standard_Integer nbatr = iter.Value();
|
||||
Interface_ParamType aty = TP->AttributeType (name.ToCString());
|
||||
sout<<"Name : "<<name<<" Count="<<nbatr<<" Type : ";
|
||||
switch (aty) {
|
||||
case Interface_ParamInteger : sout<<"Integer"; break;
|
||||
case Interface_ParamReal : sout<<"Real"; break;
|
||||
case Interface_ParamIdent : sout<<"Object"; break;
|
||||
case Interface_ParamText : sout<<"String"; break;
|
||||
default : sout<<"(Mixed)";
|
||||
}
|
||||
sout<<endl;
|
||||
}
|
||||
}
|
||||
|
||||
else {
|
||||
|
||||
Standard_Integer num , nb = 0;
|
||||
sout<<"Attribute Name : "<<arg1<<endl;
|
||||
for (num = TP->NextItemWithAttribute(arg1,0); num > 0;
|
||||
num = TP->NextItemWithAttribute(arg1,num)) {
|
||||
nb ++;
|
||||
sout<<"Item "<<num<<" , Entity ";
|
||||
WS->Model()->Print(TP->Mapped(num),sout);
|
||||
Handle(Transfer_Binder) bnd = TP->MapItem (num);
|
||||
Interface_ParamType aty = bnd->AttributeType(arg1);
|
||||
switch (aty) {
|
||||
case Interface_ParamInteger : sout<<" Integer="<<bnd->IntegerAttribute(arg1); break;
|
||||
case Interface_ParamReal : sout<<" Real="<<bnd->RealAttribute(arg1); break;
|
||||
case Interface_ParamIdent : sout<<" Object,Type:"<<bnd->Attribute(arg1)->DynamicType()->Name(); break;
|
||||
case Interface_ParamText : sout<<" String="<<bnd->StringAttribute(arg1);
|
||||
default : sout<<"(none)"; break;
|
||||
}
|
||||
sout<<endl;
|
||||
}
|
||||
sout<<"Attribute Name : "<<arg1<<" on "<<nb<<" Items"<<endl;
|
||||
}
|
||||
skl*/
|
||||
|
||||
return IFSelect_RetVoid;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : trecord
|
||||
//=======================================================================
|
||||
@@ -587,12 +258,12 @@ static IFSelect_ReturnStatus XSControl_trecord(const Handle(IFSelect_SessionPilo
|
||||
{
|
||||
Standard_Integer argc = pilot->NbWords();
|
||||
const Standard_CString arg1 = pilot->Arg(1);
|
||||
Handle(Transfer_TransientProcess) TP = XSControl::Session(pilot)->MapReader();
|
||||
const Handle(Transfer_TransientProcess) &TP = XSControl::Session(pilot)->TransferReader()->TransientProcess();
|
||||
// **** trecord : TransferReader ****
|
||||
Standard_Boolean tous = (argc == 1);
|
||||
Standard_Integer num = -1;
|
||||
Handle(Interface_InterfaceModel) mdl = XSControl::Session(pilot)->Model();
|
||||
Handle(XSControl_TransferReader) TR = XSControl::Session(pilot)->TransferReader();
|
||||
const Handle(Interface_InterfaceModel) &mdl = XSControl::Session(pilot)->Model();
|
||||
const Handle(XSControl_TransferReader) &TR = XSControl::Session(pilot)->TransferReader();
|
||||
Handle(Standard_Transient) ent;
|
||||
Handle(Message_Messenger) sout = Message::DefaultMessenger();
|
||||
if (mdl.IsNull() || TR.IsNull() || TP.IsNull())
|
||||
@@ -625,7 +296,7 @@ static IFSelect_ReturnStatus XSControl_trstat(const Handle(IFSelect_SessionPilot
|
||||
const Standard_CString arg1 = pilot->Arg(1);
|
||||
Handle(Message_Messenger) sout = Message::DefaultMessenger();
|
||||
// **** trstat : TransferReader ****
|
||||
Handle(XSControl_TransferReader) TR = XSControl::Session(pilot)->TransferReader();
|
||||
const Handle(XSControl_TransferReader) &TR = XSControl::Session(pilot)->TransferReader();
|
||||
if (TR.IsNull()) { sout<<" init not done"<<endl; return IFSelect_RetError; }
|
||||
Handle(Interface_InterfaceModel) mdl = TR->Model();
|
||||
if (mdl.IsNull()) { sout<<" No model"<<endl; return IFSelect_RetError; }
|
||||
@@ -659,12 +330,12 @@ static IFSelect_ReturnStatus XSControl_trstat(const Handle(IFSelect_SessionPilot
|
||||
static IFSelect_ReturnStatus XSControl_trbegin(const Handle(IFSelect_SessionPilot)& pilot)
|
||||
{
|
||||
// **** trbegin : TransferReader ****
|
||||
Handle(XSControl_TransferReader) TR = XSControl::Session(pilot)->TransferReader();
|
||||
Handle(XSControl_TransferReader) TR = XSControl::Session(pilot)->TransferReader();
|
||||
Standard_Boolean init = TR.IsNull();
|
||||
if (pilot->NbWords() > 1) { if (pilot->Arg(1)[0] == 'i') init = Standard_True; }
|
||||
if (init) {
|
||||
XSControl::Session(pilot)->InitTransferReader (0);
|
||||
TR = XSControl::Session(pilot)->TransferReader();
|
||||
TR = XSControl::Session(pilot)->TransferReader();
|
||||
if (TR.IsNull()) {
|
||||
Handle(Message_Messenger) sout = Message::DefaultMessenger();
|
||||
sout<<" init not done or failed"<<endl;
|
||||
@@ -685,9 +356,9 @@ static IFSelect_ReturnStatus XSControl_tread(const Handle(IFSelect_SessionPilot)
|
||||
//const Standard_CString arg1 = pilot->Arg(1);
|
||||
// **** tread : TransferReader ****
|
||||
Handle(Message_Messenger) sout = Message::DefaultMessenger();
|
||||
Handle(XSControl_TransferReader) TR = XSControl::Session(pilot)->TransferReader();
|
||||
const Handle(XSControl_TransferReader) &TR = XSControl::Session(pilot)->TransferReader();
|
||||
if (TR.IsNull()) { sout<<" init not done"<<endl; return IFSelect_RetError; }
|
||||
Handle(Interface_InterfaceModel) mdl = TR->Model();
|
||||
const Handle(Interface_InterfaceModel) &mdl = TR->Model();
|
||||
if (mdl.IsNull()) { sout<<" No model"<<endl; return IFSelect_RetError; }
|
||||
if (argc < 2) {
|
||||
// DeclareAndCast(IFSelect_Selection,sel,pilot->Session()->NamedItem("xst-model-roots"));
|
||||
@@ -712,11 +383,10 @@ static IFSelect_ReturnStatus XSControl_tread(const Handle(IFSelect_SessionPilot)
|
||||
static IFSelect_ReturnStatus XSControl_trtp(const Handle(IFSelect_SessionPilot)& pilot)
|
||||
{
|
||||
// **** TReader -> TProcess ****
|
||||
Handle(XSControl_TransferReader) TR = XSControl::Session(pilot)->TransferReader();
|
||||
const Handle(XSControl_TransferReader) &TR = XSControl::Session(pilot)->TransferReader();
|
||||
Handle(Message_Messenger) sout = Message::DefaultMessenger();
|
||||
if (TR.IsNull()) sout<<" No TransferReader"<<endl;
|
||||
else if (TR->TransientProcess().IsNull()) sout<<" Transfer Reader without Process"<<endl;
|
||||
////else { XSDRAW::SetTransferProcess(TR->TransientProcess()); return IFSelect_RetDone; }
|
||||
return IFSelect_RetVoid;
|
||||
}
|
||||
|
||||
@@ -768,7 +438,7 @@ static IFSelect_ReturnStatus XSControl_twstat(const Handle(IFSelect_SessionPilot
|
||||
//Standard_Integer argc = pilot->NbWords();
|
||||
//const Standard_CString arg1 = pilot->Arg(1);
|
||||
//const Standard_CString arg2 = pilot->Arg(2);
|
||||
Handle(Transfer_FinderProcess) FP = XSControl::Session(pilot)->MapWriter();
|
||||
const Handle(Transfer_FinderProcess) &FP = XSControl::Session(pilot)->TransferWriter()->FinderProcess();
|
||||
// **** twstat ****
|
||||
// Pour Write
|
||||
Handle(Message_Messenger) sout = Message::DefaultMessenger();
|
||||
@@ -807,8 +477,6 @@ void XSControl_Functions::Init ()
|
||||
|
||||
IFSelect_Act::AddFunc ("xinit","[norm:string to change norme] reinitialises according to the norm",XSControl_xinit);
|
||||
IFSelect_Act::AddFunc ("xnorm","displays current norm +norm : changes it",XSControl_xnorm);
|
||||
IFSelect_Act::AddFunc ("xprofile","displays current profile +prof : changes it",XSControl_xprofile);
|
||||
IFSelect_Act::AddFunc ("xoption","lists options +opt : lists cases +case : changes current case",XSControl_xoption);
|
||||
|
||||
IFSelect_Act::AddFunc ("newmodel","produces a new empty model, for the session",XSControl_newmodel);
|
||||
|
||||
@@ -823,7 +491,6 @@ void XSControl_Functions::Init ()
|
||||
IFSelect_Act::AddFunc ("tproot","[num:integer] Statistics on a ROOT of transfert (READ)" ,XSControl_tpitem);
|
||||
IFSelect_Act::AddFunc ("twitem","[num:integer] Statistics on an ITEM of transfer (WRITE)" ,XSControl_tpitem);
|
||||
IFSelect_Act::AddFunc ("twroot","[num:integer] Statistics on a ROOT of transfer (WRITE)",XSControl_tpitem);
|
||||
IFSelect_Act::AddFunc ("tpatr","[name] List all Attributes, or values for a Name",XSControl_tpatr);
|
||||
|
||||
IFSelect_Act::AddFunc ("trecord","record : all root results; or num : for entity n0.num",XSControl_trecord);
|
||||
IFSelect_Act::AddFunc ("trstat","general statistics; or num : stats on entity n0 num",XSControl_trstat);
|
||||
|
||||
@@ -18,10 +18,6 @@
|
||||
#define _XSControl_Functions_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
|
||||
|
||||
//! Functions from XSControl gives access to actions which can be
|
||||
//! commanded with the resources provided by XSControl: especially
|
||||
@@ -30,35 +26,10 @@
|
||||
//! It works by adding functions by method Init
|
||||
class XSControl_Functions
|
||||
{
|
||||
public:
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Defines and loads all functions for XSControl (as ActFunc)
|
||||
Standard_EXPORT static void Init();
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _XSControl_Functions_HeaderFile
|
||||
|
||||
@@ -237,7 +237,7 @@ Standard_Boolean XSControl_Reader::TransferEntity
|
||||
(const Handle(Standard_Transient)& start)
|
||||
{
|
||||
if (start.IsNull()) return Standard_False;
|
||||
Handle(XSControl_TransferReader) TR = thesession->TransferReader();
|
||||
const Handle(XSControl_TransferReader) &TR = thesession->TransferReader();
|
||||
TR->BeginTransfer();
|
||||
if (TR->TransferOne (start) == 0) return Standard_False;
|
||||
TopoDS_Shape sh = TR->ShapeResult(start);
|
||||
@@ -260,7 +260,7 @@ Standard_Integer XSControl_Reader::TransferList
|
||||
if (list.IsNull()) return 0;
|
||||
Standard_Integer nbt = 0;
|
||||
Standard_Integer i, nb = list->Length();
|
||||
Handle(XSControl_TransferReader) TR = thesession->TransferReader();
|
||||
const Handle(XSControl_TransferReader) &TR = thesession->TransferReader();
|
||||
TR->BeginTransfer();
|
||||
ClearShapes();
|
||||
ShapeExtend_Explorer STU;
|
||||
@@ -286,12 +286,12 @@ Standard_Integer XSControl_Reader::TransferRoots ()
|
||||
NbRootsForTransfer();
|
||||
Standard_Integer nbt = 0;
|
||||
Standard_Integer i, nb = theroots.Length();
|
||||
Handle(XSControl_TransferReader) TR = thesession->TransferReader();
|
||||
const Handle(XSControl_TransferReader) &TR = thesession->TransferReader();
|
||||
|
||||
TR->BeginTransfer();
|
||||
ClearShapes();
|
||||
ShapeExtend_Explorer STU;
|
||||
Handle(Transfer_TransientProcess) proc = thesession->MapReader();
|
||||
const Handle(Transfer_TransientProcess) &proc = thesession->TransferReader()->TransientProcess();
|
||||
Message_ProgressSentry PS ( proc->GetProgress(), "Root", 0, nb, 1 );
|
||||
for (i = 1; i <= nb && PS.More(); i ++,PS.Next()) {
|
||||
Handle(Standard_Transient) start = theroots.Value(i);
|
||||
@@ -415,7 +415,7 @@ void XSControl_Reader::GetStatsTransfer (const Handle(TColStd_HSequenceOfTransie
|
||||
Standard_Integer& nbWithResult,
|
||||
Standard_Integer& nbWithFail) const
|
||||
{
|
||||
Handle(Transfer_TransientProcess) TP = thesession->MapReader();
|
||||
const Handle(Transfer_TransientProcess) &TP = thesession->TransferReader()->TransientProcess();
|
||||
Transfer_IteratorOfProcessForTransient itrp(Standard_True);
|
||||
itrp = TP->CompleteResult(Standard_True);
|
||||
if(!list.IsNull()) itrp.Filter (list);
|
||||
|
||||
@@ -57,17 +57,6 @@
|
||||
#include <stdio.h>
|
||||
IMPLEMENT_STANDARD_RTTIEXT(XSControl_TransferReader,MMgt_TShared)
|
||||
|
||||
// Precision :
|
||||
// Pour les regularites
|
||||
//=======================================================================
|
||||
//function : XSControl_TransferReader
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
XSControl_TransferReader::XSControl_TransferReader ()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SetController
|
||||
//purpose :
|
||||
@@ -75,24 +64,12 @@ XSControl_TransferReader::XSControl_TransferReader ()
|
||||
|
||||
void XSControl_TransferReader::SetController(const Handle(XSControl_Controller)& control)
|
||||
{
|
||||
theController = control;
|
||||
theActor.Nullify();
|
||||
myController = control;
|
||||
myActor.Nullify();
|
||||
Clear(-1);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SetActor
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void XSControl_TransferReader::SetActor
|
||||
(const Handle(Transfer_ActorOfTransientProcess)& actor)
|
||||
{
|
||||
theActor = actor;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Actor
|
||||
//purpose :
|
||||
@@ -100,9 +77,9 @@ void XSControl_TransferReader::SetActor
|
||||
|
||||
Handle(Transfer_ActorOfTransientProcess) XSControl_TransferReader::Actor ()
|
||||
{
|
||||
if ( theActor.IsNull() && !theController.IsNull() && !theModel.IsNull())
|
||||
theActor = theController->ActorRead(theModel);
|
||||
return theActor;
|
||||
if ( myActor.IsNull() && !myController.IsNull() && !myModel.IsNull())
|
||||
myActor = myController->ActorRead(myModel);
|
||||
return myActor;
|
||||
}
|
||||
|
||||
|
||||
@@ -113,8 +90,8 @@ Handle(Transfer_ActorOfTransientProcess) XSControl_TransferReader::Actor ()
|
||||
|
||||
void XSControl_TransferReader::SetModel(const Handle(Interface_InterfaceModel)& model)
|
||||
{
|
||||
theModel = model;
|
||||
if (!theTransfer.IsNull()) theTransfer->SetModel(model);
|
||||
myModel = model;
|
||||
if (!myTP.IsNull()) myTP->SetModel(model);
|
||||
}
|
||||
|
||||
|
||||
@@ -127,25 +104,14 @@ void XSControl_TransferReader::SetGraph(const Handle(Interface_HGraph)& graph)
|
||||
{
|
||||
if (graph.IsNull())
|
||||
{
|
||||
theModel.Nullify();
|
||||
myModel.Nullify();
|
||||
}
|
||||
else
|
||||
theModel = graph->Graph().Model();
|
||||
myModel = graph->Graph().Model();
|
||||
|
||||
theGraph = graph;
|
||||
myGraph = graph;
|
||||
|
||||
if (!theTransfer.IsNull()) theTransfer->SetGraph(graph);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Model
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Interface_InterfaceModel) XSControl_TransferReader::Model () const
|
||||
{
|
||||
return theModel;
|
||||
if (!myTP.IsNull()) myTP->SetGraph(graph);
|
||||
}
|
||||
|
||||
|
||||
@@ -157,8 +123,8 @@ Handle(Interface_InterfaceModel) XSControl_TransferReader::Model () const
|
||||
void XSControl_TransferReader::SetContext(const Standard_CString name,
|
||||
const Handle(Standard_Transient)& ctx)
|
||||
{
|
||||
if (theContext.IsNull()) theContext = new Dico_DictionaryOfTransient;
|
||||
theContext->SetItem (name,ctx);
|
||||
if (myContext.IsNull()) myContext = new Dico_DictionaryOfTransient;
|
||||
myContext->SetItem (name,ctx);
|
||||
}
|
||||
|
||||
|
||||
@@ -171,8 +137,8 @@ Standard_Boolean XSControl_TransferReader::GetContext
|
||||
(const Standard_CString name, const Handle(Standard_Type)& type,
|
||||
Handle(Standard_Transient)& ctx) const
|
||||
{
|
||||
if (theContext.IsNull()) return Standard_False;
|
||||
if (!theContext->GetItem (name,ctx)) ctx.Nullify();
|
||||
if (myContext.IsNull()) return Standard_False;
|
||||
if (!myContext->GetItem (name,ctx)) ctx.Nullify();
|
||||
if (ctx.IsNull()) return Standard_False;
|
||||
if (type.IsNull()) return Standard_True;
|
||||
if (!ctx->IsKind(type)) ctx.Nullify();
|
||||
@@ -180,40 +146,6 @@ Standard_Boolean XSControl_TransferReader::GetContext
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Context
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Dico_DictionaryOfTransient)& XSControl_TransferReader::Context ()
|
||||
{
|
||||
return theContext;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SetFileName
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void XSControl_TransferReader::SetFileName (const Standard_CString name)
|
||||
{
|
||||
theFilename.Clear();
|
||||
theFilename.AssignCat(name);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : FileName
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_CString XSControl_TransferReader::FileName () const
|
||||
{
|
||||
return theFilename.ToCString();
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Clear
|
||||
//purpose :
|
||||
@@ -222,42 +154,19 @@ Standard_CString XSControl_TransferReader::FileName () const
|
||||
void XSControl_TransferReader::Clear (const Standard_Integer mode)
|
||||
{
|
||||
if (mode & 1) {
|
||||
theResults.Clear();
|
||||
theShapeResult.Nullify();
|
||||
myResults.Clear();
|
||||
myShapeResult.Nullify();
|
||||
}
|
||||
if (mode & 2) {
|
||||
theModel.Nullify();
|
||||
theGraph.Nullify();
|
||||
theTransfer.Nullify();
|
||||
theActor.Nullify();
|
||||
theFilename.Clear();
|
||||
myModel.Nullify();
|
||||
myGraph.Nullify();
|
||||
myTP.Nullify();
|
||||
myActor.Nullify();
|
||||
myFileName.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : TransientProcess
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Transfer_TransientProcess) XSControl_TransferReader::TransientProcess () const
|
||||
{
|
||||
return theTransfer;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SetTransientProcess
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void XSControl_TransferReader::SetTransientProcess
|
||||
(const Handle(Transfer_TransientProcess)& TP)
|
||||
{
|
||||
theTransfer = TP;
|
||||
}
|
||||
|
||||
|
||||
// ########################################################
|
||||
// ########### RESULTATS ############
|
||||
|
||||
@@ -270,13 +179,13 @@ void XSControl_TransferReader::SetTransientProcess
|
||||
Standard_Boolean XSControl_TransferReader::RecordResult
|
||||
(const Handle(Standard_Transient)& ent)
|
||||
{
|
||||
if (theModel.IsNull() || theTransfer.IsNull()) return Standard_False;
|
||||
Standard_Integer num = theModel->Number(ent);
|
||||
if (myModel.IsNull() || myTP.IsNull()) return Standard_False;
|
||||
Standard_Integer num = myModel->Number(ent);
|
||||
if (num == 0) return Standard_False;
|
||||
Handle(TCollection_HAsciiString) lab = theModel->StringLabel(ent);
|
||||
Handle(TCollection_HAsciiString) lab = myModel->StringLabel(ent);
|
||||
|
||||
Handle(Transfer_ResultFromModel) res = new Transfer_ResultFromModel;
|
||||
res->Fill (theTransfer,ent);
|
||||
res->Fill (myTP,ent);
|
||||
|
||||
// Cas du resultat Shape : pour resultat principal, faire HShape ...
|
||||
Handle(Transfer_Binder) binder = res->MainResult()->Binder();
|
||||
@@ -288,8 +197,8 @@ Standard_Boolean XSControl_TransferReader::RecordResult
|
||||
res->MainResult()->SetBinder (trb);
|
||||
}
|
||||
|
||||
res->SetFileName(theFilename.ToCString());
|
||||
theResults.Bind(num,res);
|
||||
res->SetFileName(myFileName.ToCString());
|
||||
myResults.Bind(num,res);
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
@@ -302,11 +211,11 @@ Standard_Boolean XSControl_TransferReader::RecordResult
|
||||
Standard_Boolean XSControl_TransferReader::IsRecorded
|
||||
(const Handle(Standard_Transient)& ent) const
|
||||
{
|
||||
if (theModel.IsNull()) return Standard_False;
|
||||
Standard_Integer num = theModel->Number(ent);
|
||||
if (myModel.IsNull()) return Standard_False;
|
||||
Standard_Integer num = myModel->Number(ent);
|
||||
if (num == 0) return Standard_False;
|
||||
if(!theResults.IsBound(num)) return Standard_False;
|
||||
return (theResults.Find(num)->DynamicType() == STANDARD_TYPE(Transfer_ResultFromModel) );
|
||||
if(!myResults.IsBound(num)) return Standard_False;
|
||||
return (myResults.Find(num)->DynamicType() == STANDARD_TYPE(Transfer_ResultFromModel) );
|
||||
}
|
||||
|
||||
|
||||
@@ -318,11 +227,11 @@ Standard_Boolean XSControl_TransferReader::IsRecorded
|
||||
Standard_Boolean XSControl_TransferReader::HasResult
|
||||
(const Handle(Standard_Transient)& ent) const
|
||||
{
|
||||
if (theModel.IsNull()) return Standard_False;
|
||||
Standard_Integer num = theModel->Number(ent);
|
||||
if (myModel.IsNull()) return Standard_False;
|
||||
Standard_Integer num = myModel->Number(ent);
|
||||
if (num == 0) return Standard_False;
|
||||
if(!theResults.IsBound(num)) return Standard_False;
|
||||
DeclareAndCast(Transfer_ResultFromModel,fr,theResults.Find(num));
|
||||
if(!myResults.IsBound(num)) return Standard_False;
|
||||
DeclareAndCast(Transfer_ResultFromModel,fr,myResults.Find(num));
|
||||
if (fr.IsNull()) return Standard_False;
|
||||
return fr->HasResult();
|
||||
}
|
||||
@@ -336,11 +245,11 @@ Standard_Boolean XSControl_TransferReader::HasResult
|
||||
Handle(TColStd_HSequenceOfTransient) XSControl_TransferReader::RecordedList () const
|
||||
{
|
||||
Handle(TColStd_HSequenceOfTransient) li = new TColStd_HSequenceOfTransient();
|
||||
if (theModel.IsNull()) return li;
|
||||
Standard_Integer i, nb = theModel->NbEntities();
|
||||
if (myModel.IsNull()) return li;
|
||||
Standard_Integer i, nb = myModel->NbEntities();
|
||||
for (i = 1; i <= nb; i ++) {
|
||||
if(theResults.IsBound(i))
|
||||
if(!theResults.Find(i).IsNull()) li->Append (theModel->Value(i));
|
||||
if(myResults.IsBound(i))
|
||||
if(!myResults.Find(i).IsNull()) li->Append (myModel->Value(i));
|
||||
}
|
||||
return li;
|
||||
}
|
||||
@@ -353,10 +262,10 @@ Handle(TColStd_HSequenceOfTransient) XSControl_TransferReader::RecordedList () c
|
||||
|
||||
Standard_Boolean XSControl_TransferReader::Skip(const Handle(Standard_Transient)& ent)
|
||||
{
|
||||
if (theModel.IsNull() || theTransfer.IsNull()) return Standard_False;
|
||||
Standard_Integer num = theModel->Number(ent);
|
||||
if (myModel.IsNull() || myTP.IsNull()) return Standard_False;
|
||||
Standard_Integer num = myModel->Number(ent);
|
||||
if (num == 0) return Standard_False;
|
||||
theResults.Bind(num,ent);
|
||||
myResults.Bind(num,ent);
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
@@ -369,11 +278,11 @@ Standard_Boolean XSControl_TransferReader::Skip(const Handle(Standard_Transient)
|
||||
Standard_Boolean XSControl_TransferReader::IsSkipped
|
||||
(const Handle(Standard_Transient)& ent) const
|
||||
{
|
||||
if (theModel.IsNull()) return Standard_False;
|
||||
Standard_Integer num = theModel->Number(ent);
|
||||
if (myModel.IsNull()) return Standard_False;
|
||||
Standard_Integer num = myModel->Number(ent);
|
||||
if (num == 0) return Standard_False;
|
||||
if(!theResults.IsBound(num)) return Standard_False;
|
||||
return (theResults.Find(num)->DynamicType() != STANDARD_TYPE(Transfer_ResultFromModel) );
|
||||
if(!myResults.IsBound(num)) return Standard_False;
|
||||
return (myResults.Find(num)->DynamicType() != STANDARD_TYPE(Transfer_ResultFromModel) );
|
||||
}
|
||||
|
||||
|
||||
@@ -385,11 +294,11 @@ Standard_Boolean XSControl_TransferReader::IsSkipped
|
||||
Standard_Boolean XSControl_TransferReader::IsMarked
|
||||
(const Handle(Standard_Transient)& ent) const
|
||||
{
|
||||
if (theModel.IsNull()) return Standard_False;
|
||||
Standard_Integer num = theModel->Number(ent);
|
||||
if (myModel.IsNull()) return Standard_False;
|
||||
Standard_Integer num = myModel->Number(ent);
|
||||
if (num == 0) return Standard_False;
|
||||
if(!theResults.IsBound(num)) return Standard_False;
|
||||
if (theResults.Find(num).IsNull()) return Standard_False;
|
||||
if(!myResults.IsBound(num)) return Standard_False;
|
||||
if (myResults.Find(num).IsNull()) return Standard_False;
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
@@ -406,11 +315,11 @@ Handle(Transfer_ResultFromModel) XSControl_TransferReader::FinalResult
|
||||
(const Handle(Standard_Transient)& ent) const
|
||||
{
|
||||
Handle(Transfer_ResultFromModel) res;
|
||||
if (theModel.IsNull()) return res;
|
||||
Standard_Integer num = theModel->Number(ent);
|
||||
if (myModel.IsNull()) return res;
|
||||
Standard_Integer num = myModel->Number(ent);
|
||||
if (num == 0) return res;
|
||||
if(!theResults.IsBound(num)) return res;
|
||||
res = GetCasted(Transfer_ResultFromModel,theResults.Find(num));
|
||||
if(!myResults.IsBound(num)) return res;
|
||||
res = GetCasted(Transfer_ResultFromModel,myResults.Find(num));
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -452,9 +361,9 @@ Handle(Transfer_ResultFromModel) XSControl_TransferReader::ResultFromNumber
|
||||
(const Standard_Integer num) const
|
||||
{
|
||||
Handle(Transfer_ResultFromModel) res;
|
||||
if ( num<1 || num>theModel->NbEntities() ) return res;
|
||||
if(!theResults.IsBound(num)) return res;
|
||||
res = GetCasted(Transfer_ResultFromModel,theResults.Find(num));
|
||||
if ( num<1 || num>myModel->NbEntities() ) return res;
|
||||
if(!myResults.IsBound(num)) return res;
|
||||
res = GetCasted(Transfer_ResultFromModel,myResults.Find(num));
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -511,14 +420,14 @@ TopoDS_Shape XSControl_TransferReader::ShapeResult
|
||||
Standard_Boolean XSControl_TransferReader::ClearResult
|
||||
(const Handle(Standard_Transient)& ent, const Standard_Integer mode)
|
||||
{
|
||||
if (theModel.IsNull()) return Standard_False;
|
||||
Standard_Integer num = theModel->Number(ent);
|
||||
if (myModel.IsNull()) return Standard_False;
|
||||
Standard_Integer num = myModel->Number(ent);
|
||||
if (num == 0) return Standard_False;
|
||||
if(!theResults.IsBound(num)) return Standard_False;
|
||||
if(!myResults.IsBound(num)) return Standard_False;
|
||||
if (mode < 0)
|
||||
theResults.ChangeFind(num).Nullify();
|
||||
myResults.ChangeFind(num).Nullify();
|
||||
else {
|
||||
DeclareAndCast(Transfer_ResultFromModel,resu,theResults.Find(num));
|
||||
DeclareAndCast(Transfer_ResultFromModel,resu,myResults.Find(num));
|
||||
if (resu.IsNull()) return Standard_False;
|
||||
resu->Strip (mode);
|
||||
}
|
||||
@@ -551,29 +460,29 @@ Handle(Standard_Transient) XSControl_TransferReader::EntityFromResult
|
||||
|
||||
if (mode == 0 || mode == 1) {
|
||||
// on regarde dans le TransientProcess (Roots ou tous Mappeds)
|
||||
if (!theTransfer.IsNull()) {
|
||||
nb = (mode == 0 ? theTransfer->NbRoots() : theTransfer->NbMapped());
|
||||
if (!myTP.IsNull()) {
|
||||
nb = (mode == 0 ? myTP->NbRoots() : myTP->NbMapped());
|
||||
for (j = 1; j <= nb; j ++) {
|
||||
i = (mode == 0 ? theModel->Number (theTransfer->Root(j)) : j);
|
||||
i = (mode == 0 ? myModel->Number (myTP->Root(j)) : j);
|
||||
if (i == 0) continue;
|
||||
abinder = theTransfer->MapItem(i);
|
||||
abinder = myTP->MapItem(i);
|
||||
if (abinder.IsNull()) continue;
|
||||
if (!binder.IsNull()) {
|
||||
if (binder == abinder) return theTransfer->Mapped(i);
|
||||
if (binder == abinder) return myTP->Mapped(i);
|
||||
continue;
|
||||
}
|
||||
DeclareAndCast(Transfer_SimpleBinderOfTransient,trb,abinder);
|
||||
if (trb.IsNull()) continue;
|
||||
if (trb->Result() == res) return theTransfer->Mapped(i);
|
||||
if (trb->Result() == res) return myTP->Mapped(i);
|
||||
}
|
||||
}
|
||||
return nulh; // Null
|
||||
}
|
||||
|
||||
// Recherche dans theResults (racines)
|
||||
// Recherche dans myResults (racines)
|
||||
// 2 : Main only 3 : Main + one sub; 4 : all
|
||||
if (mode >= 2) {
|
||||
nb = theModel->NbEntities();
|
||||
nb = myModel->NbEntities();
|
||||
for (i = 1; i <= nb; i ++) {
|
||||
Handle(Transfer_ResultFromModel) rec = ResultFromNumber (i);
|
||||
if (rec.IsNull()) return nulh;
|
||||
@@ -611,13 +520,13 @@ Handle(Standard_Transient) XSControl_TransferReader::EntityFromShapeResult
|
||||
XSControl_Utils xu;
|
||||
if (mode == 0 || mode == 1 || mode == -1) {
|
||||
// on regarde dans le TransientProcess
|
||||
if (!theTransfer.IsNull()) {
|
||||
nb = (mode == 0 ? theTransfer->NbRoots() : theTransfer->NbMapped());
|
||||
if (!myTP.IsNull()) {
|
||||
nb = (mode == 0 ? myTP->NbRoots() : myTP->NbMapped());
|
||||
for (j = 1; j <= nb; j ++) {
|
||||
i = (mode == 0 ? theModel->Number (theTransfer->Root(j)) : j);
|
||||
i = (mode == 0 ? myModel->Number (myTP->Root(j)) : j);
|
||||
if (i == 0) continue;
|
||||
Handle(Standard_Transient) ent = theTransfer->Mapped(i);
|
||||
TopoDS_Shape sh = TransferBRep::ShapeResult (theTransfer,ent);
|
||||
Handle(Standard_Transient) ent = myTP->Mapped(i);
|
||||
TopoDS_Shape sh = TransferBRep::ShapeResult (myTP,ent);
|
||||
if (!sh.IsNull()) {
|
||||
if (sh == res) return ent;
|
||||
// priorites moindre : Same (tjrs) ou Partner (mode < 0)
|
||||
@@ -632,10 +541,10 @@ Handle(Standard_Transient) XSControl_TransferReader::EntityFromShapeResult
|
||||
return nulh;
|
||||
}
|
||||
|
||||
// Recherche dans theResults (racines)
|
||||
// Recherche dans myResults (racines)
|
||||
// 2 : Main only 3 : Main + one sub; 4 : all
|
||||
if (mode >= 2) {
|
||||
nb = theModel->NbEntities();
|
||||
nb = myModel->NbEntities();
|
||||
for (i = 1; i <= nb; i ++) {
|
||||
Handle(Transfer_ResultFromModel) rec = ResultFromNumber (i);
|
||||
if (rec.IsNull()) continue;
|
||||
@@ -679,24 +588,24 @@ Handle(TColStd_HSequenceOfTransient) XSControl_TransferReader::EntitiesFromShape
|
||||
XSControl_Utils xu;
|
||||
if (mode == 0 || mode == 1) {
|
||||
// on regarde dans le TransientProcess
|
||||
if (!theTransfer.IsNull()) {
|
||||
nb = (mode == 0 ? theTransfer->NbRoots() : theTransfer->NbMapped());
|
||||
if (!myTP.IsNull()) {
|
||||
nb = (mode == 0 ? myTP->NbRoots() : myTP->NbMapped());
|
||||
for (j = 1; j <= nb; j ++) {
|
||||
i = (mode == 0 ? theModel->Number (theTransfer->Root(j)) : j);
|
||||
i = (mode == 0 ? myModel->Number (myTP->Root(j)) : j);
|
||||
if (i == 0) continue;
|
||||
TopoDS_Shape sh = xu.BinderShape (theTransfer->MapItem(i));
|
||||
TopoDS_Shape sh = xu.BinderShape (myTP->MapItem(i));
|
||||
if (!sh.IsNull() && shapes.Contains(sh)) {
|
||||
lt->Append (theTransfer->Mapped(i));
|
||||
lt->Append (myTP->Mapped(i));
|
||||
j=nb; //skl (for looking for entities in checkbrep)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Recherche dans theResults (racines)
|
||||
// Recherche dans myResults (racines)
|
||||
// 2 : Main only 3 : Main + one sub; 4 : all
|
||||
if (mode >= 2) {
|
||||
nb = theModel->NbEntities();
|
||||
nb = myModel->NbEntities();
|
||||
for (i = 1; i <= nb; i ++) {
|
||||
Handle(Transfer_ResultFromModel) rec = ResultFromNumber (i);
|
||||
if (rec.IsNull()) continue;
|
||||
@@ -729,10 +638,10 @@ Interface_CheckIterator XSControl_TransferReader::CheckList
|
||||
(const Handle(Standard_Transient)& ent, const Standard_Integer level) const
|
||||
{
|
||||
Interface_CheckIterator chl;
|
||||
if (theModel.IsNull() || ent.IsNull()) return chl;
|
||||
if (myModel.IsNull() || ent.IsNull()) return chl;
|
||||
// Check-List COMPLETE ... tout le Modele
|
||||
if (ent == theModel) {
|
||||
Standard_Integer i,nb = theModel->NbEntities();
|
||||
if (ent == myModel) {
|
||||
Standard_Integer i,nb = myModel->NbEntities();
|
||||
for (i = 1; i <= nb; i ++) {
|
||||
Handle(Transfer_ResultFromModel) rec = ResultFromNumber (i);
|
||||
if (!rec.IsNull()) {
|
||||
@@ -756,14 +665,14 @@ Interface_CheckIterator XSControl_TransferReader::CheckList
|
||||
|
||||
// sinon, Check-List sur une entite : Last ou FinalResult
|
||||
else if (level < 0) {
|
||||
if (theTransfer.IsNull()) return chl;
|
||||
chl.Add (theTransfer->Check(ent),theModel->Number(ent));
|
||||
if (myTP.IsNull()) return chl;
|
||||
chl.Add (myTP->Check(ent),myModel->Number(ent));
|
||||
} else {
|
||||
Handle(Transfer_ResultFromModel) rec = FinalResult (ent);
|
||||
if (rec.IsNull()) return chl;
|
||||
chl = rec->CheckList(Standard_False,level); // manque level ...
|
||||
}
|
||||
if (ent == theModel) chl.SetName ("XSControl : CheckList complete Model");
|
||||
if (ent == myModel) chl.SetName ("XSControl : CheckList complete Model");
|
||||
else if (level < 0) chl.SetName ("XSControl : CheckList Last");
|
||||
else if (level == 0) chl.SetName ("XSControl : CheckList Final Main");
|
||||
else if (level == 1) chl.SetName ("XSControl : CheckList Final Main+Subs");
|
||||
@@ -801,8 +710,8 @@ Handle(TColStd_HSequenceOfTransient) XSControl_TransferReader::CheckedList
|
||||
Handle(TColStd_HSequenceOfTransient) res = new TColStd_HSequenceOfTransient();
|
||||
if (ent.IsNull()) return res;
|
||||
|
||||
if (ent == theModel) {
|
||||
Standard_Integer i,nb = theModel->NbEntities();
|
||||
if (ent == myModel) {
|
||||
Standard_Integer i,nb = myModel->NbEntities();
|
||||
for (i = 1; i <= nb; i ++) {
|
||||
Handle(Transfer_ResultFromModel) rec = ResultFromNumber (i);
|
||||
if (!rec.IsNull()) res->Append (rec->CheckedList(withcheck,level));
|
||||
@@ -834,19 +743,19 @@ Handle(TColStd_HSequenceOfTransient) XSControl_TransferReader::CheckedList
|
||||
|
||||
Standard_Boolean XSControl_TransferReader::BeginTransfer ()
|
||||
{
|
||||
if (theModel.IsNull()) return Standard_False;
|
||||
if (myModel.IsNull()) return Standard_False;
|
||||
if (Actor().IsNull()) return Standard_False;
|
||||
theShapeResult.Nullify();
|
||||
myShapeResult.Nullify();
|
||||
|
||||
if (theTransfer.IsNull()) theTransfer = new Transfer_TransientProcess
|
||||
(theModel->NbEntities());
|
||||
if (myTP.IsNull()) myTP = new Transfer_TransientProcess
|
||||
(myModel->NbEntities());
|
||||
|
||||
Handle(Transfer_ActorOfTransientProcess) actor;
|
||||
theTransfer->SetActor (actor); // -> RAZ
|
||||
myTP->SetActor (actor); // -> RAZ
|
||||
actor = Actor();
|
||||
theTransfer->SetActor (actor); // Set proprement dit
|
||||
theTransfer->SetErrorHandle (Standard_True);
|
||||
theTransfer->Context() = theContext;
|
||||
myTP->SetActor (actor); // Set proprement dit
|
||||
myTP->SetErrorHandle (Standard_True);
|
||||
myTP->Context() = myContext;
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
@@ -859,8 +768,8 @@ Standard_Boolean XSControl_TransferReader::BeginTransfer ()
|
||||
Standard_Boolean XSControl_TransferReader::Recognize
|
||||
(const Handle(Standard_Transient)& ent)
|
||||
{
|
||||
if (theActor.IsNull()) return Standard_False;
|
||||
return theActor->Recognize (ent);
|
||||
if (myActor.IsNull()) return Standard_False;
|
||||
return myActor->Recognize (ent);
|
||||
}
|
||||
|
||||
|
||||
@@ -872,30 +781,30 @@ Standard_Boolean XSControl_TransferReader::Recognize
|
||||
Standard_Integer XSControl_TransferReader::TransferOne
|
||||
(const Handle(Standard_Transient)& ent, const Standard_Boolean rec)
|
||||
{
|
||||
if (theActor.IsNull() || theModel.IsNull()) return 0;
|
||||
if (myActor.IsNull() || myModel.IsNull()) return 0;
|
||||
|
||||
if (theTransfer.IsNull()) { if (!BeginTransfer()) return 0; }
|
||||
if (myTP.IsNull()) { if (!BeginTransfer()) return 0; }
|
||||
|
||||
Handle(Message_Messenger) sout = theTransfer->Messenger();
|
||||
Standard_Integer level = theTransfer->TraceLevel();
|
||||
Handle(Message_Messenger) sout = myTP->Messenger();
|
||||
Standard_Integer level = myTP->TraceLevel();
|
||||
|
||||
|
||||
Transfer_TransferOutput TP (theTransfer,theModel);
|
||||
if (theGraph.IsNull()) theTransfer->SetModel(theModel);
|
||||
else theTransfer->SetGraph(theGraph);
|
||||
Transfer_TransferOutput TP (myTP,myModel);
|
||||
if (myGraph.IsNull()) myTP->SetModel(myModel);
|
||||
else myTP->SetGraph(myGraph);
|
||||
|
||||
// pour le log-file
|
||||
if (level > 1) {
|
||||
Standard_Integer num = theModel->Number(ent);
|
||||
Handle(TCollection_HAsciiString) lab = theModel->StringLabel(ent);
|
||||
Standard_Integer num = myModel->Number(ent);
|
||||
Handle(TCollection_HAsciiString) lab = myModel->StringLabel(ent);
|
||||
sout<<"\n*******************************************************************\n";
|
||||
sout << "****** Transferring one Entity ******"<<endl;
|
||||
if (!lab.IsNull())
|
||||
sout<<"****** N0 in file : "<<Interface_MSG::Blanks(num,5)<<num
|
||||
<<" Ident : "<<lab->ToCString()
|
||||
<< Interface_MSG::Blanks(14 - lab->Length())<<"******\n";
|
||||
sout << "****** Type : "<<theModel->TypeName(ent,Standard_False)
|
||||
<< Interface_MSG::Blanks((Standard_Integer) (44 - strlen(theModel->TypeName(ent,Standard_False))))
|
||||
sout << "****** Type : "<<myModel->TypeName(ent,Standard_False)
|
||||
<< Interface_MSG::Blanks((Standard_Integer) (44 - strlen(myModel->TypeName(ent,Standard_False))))
|
||||
<< "******";
|
||||
sout<<"\n*******************************************************************\n";
|
||||
}
|
||||
@@ -904,10 +813,10 @@ Standard_Integer XSControl_TransferReader::TransferOne
|
||||
Standard_Integer res = 0;
|
||||
Handle(Standard_Transient) obj = ent;
|
||||
TP.Transfer (obj);
|
||||
theTransfer->SetRoot (obj);
|
||||
myTP->SetRoot (obj);
|
||||
|
||||
// Resultat ...
|
||||
Handle(Transfer_Binder) binder = theTransfer->Find (obj);
|
||||
Handle(Transfer_Binder) binder = myTP->Find (obj);
|
||||
if (binder.IsNull()) return res;
|
||||
if (rec) RecordResult (obj);
|
||||
|
||||
@@ -926,16 +835,16 @@ Standard_Integer XSControl_TransferReader::TransferOne
|
||||
Standard_Integer XSControl_TransferReader::TransferList
|
||||
(const Handle(TColStd_HSequenceOfTransient)& list, const Standard_Boolean rec)
|
||||
{
|
||||
if (theActor.IsNull() || theModel.IsNull()) return 0;
|
||||
if (myActor.IsNull() || myModel.IsNull()) return 0;
|
||||
|
||||
if (theTransfer.IsNull()) { if (!BeginTransfer()) return 0; }
|
||||
if (myTP.IsNull()) { if (!BeginTransfer()) return 0; }
|
||||
|
||||
Handle(Message_Messenger) sout = theTransfer->Messenger();
|
||||
Standard_Integer level = theTransfer->TraceLevel();
|
||||
Handle(Message_Messenger) sout = myTP->Messenger();
|
||||
Standard_Integer level = myTP->TraceLevel();
|
||||
|
||||
Transfer_TransferOutput TP (theTransfer,theModel);
|
||||
if (theGraph.IsNull()) theTransfer->SetModel(theModel);
|
||||
else theTransfer->SetGraph(theGraph);
|
||||
Transfer_TransferOutput TP (myTP,myModel);
|
||||
if (myGraph.IsNull()) myTP->SetModel(myModel);
|
||||
else myTP->SetGraph(myGraph);
|
||||
|
||||
Standard_Integer i,nb = list->Length();
|
||||
|
||||
@@ -947,7 +856,7 @@ Standard_Integer XSControl_TransferReader::TransferList
|
||||
|
||||
Handle(IFSelect_SignatureList) sl = new IFSelect_SignatureList;
|
||||
for (i = 1; i <= nb; i ++)
|
||||
sl->Add (list->Value(i), theModel->TypeName(list->Value(i),Standard_False));
|
||||
sl->Add (list->Value(i), myModel->TypeName(list->Value(i),Standard_False));
|
||||
sl->SetName ("Entities to Transfer");
|
||||
sl->PrintCount (sout);
|
||||
sout<<"\n*******************************************************************\n";
|
||||
@@ -961,10 +870,10 @@ Standard_Integer XSControl_TransferReader::TransferList
|
||||
for (i = 1; i <= nb; i ++) {
|
||||
obj = list->Value(i);
|
||||
TP.Transfer (obj);
|
||||
theTransfer->SetRoot (obj);
|
||||
myTP->SetRoot (obj);
|
||||
|
||||
// Resultat ...
|
||||
Handle(Transfer_Binder) binder = theTransfer->Find (obj);
|
||||
Handle(Transfer_Binder) binder = myTP->Find (obj);
|
||||
if (binder.IsNull()) continue;
|
||||
if (rec) RecordResult (obj);
|
||||
|
||||
@@ -985,14 +894,14 @@ Standard_Integer XSControl_TransferReader::TransferList
|
||||
|
||||
Standard_Integer XSControl_TransferReader::TransferRoots(const Interface_Graph& G)
|
||||
{
|
||||
if (theModel != G.Model()) return -1;
|
||||
if (myModel != G.Model()) return -1;
|
||||
if (!BeginTransfer()) return -1;
|
||||
Handle(Message_Messenger) sout = theTransfer->Messenger();
|
||||
Standard_Integer level = theTransfer->TraceLevel();
|
||||
Handle(Message_Messenger) sout = myTP->Messenger();
|
||||
Standard_Integer level = myTP->TraceLevel();
|
||||
|
||||
Transfer_TransferOutput TP (theTransfer,theModel);
|
||||
if (theGraph.IsNull()) theTransfer->SetModel(theModel);
|
||||
else theTransfer->SetGraph(theGraph);
|
||||
Transfer_TransferOutput TP (myTP,myModel);
|
||||
if (myGraph.IsNull()) myTP->SetModel(myModel);
|
||||
else myTP->SetGraph(myGraph);
|
||||
|
||||
// Pour le log-file
|
||||
if (level > 0) {
|
||||
@@ -1003,7 +912,7 @@ Standard_Integer XSControl_TransferReader::TransferRoots(const Interface_Graph&
|
||||
sout<<"\n*******************************************************************\n";
|
||||
Handle(IFSelect_SignatureList) sl = new IFSelect_SignatureList;
|
||||
for (roots.Start(); roots.More(); roots.Next())
|
||||
sl->Add (roots.Value(),theModel->TypeName(roots.Value(),Standard_False));
|
||||
sl->Add (roots.Value(),myModel->TypeName(roots.Value(),Standard_False));
|
||||
sl->SetName ("Entities to Transfer");
|
||||
sl->PrintCount (sout);
|
||||
sout<<"\n*******************************************************************\n";
|
||||
@@ -1012,19 +921,19 @@ Standard_Integer XSControl_TransferReader::TransferRoots(const Interface_Graph&
|
||||
TP.TransferRoots (G);
|
||||
|
||||
// Les entites transferees sont notees "asmain"
|
||||
Standard_Integer i,n = theTransfer->NbMapped();
|
||||
Standard_Integer i,n = myTP->NbMapped();
|
||||
for (i = 1; i <= n; i ++) {
|
||||
Handle(Standard_Transient) ent = theTransfer->Mapped(i);
|
||||
Handle(Transfer_Binder) bnd = theTransfer->MapItem(i);
|
||||
Handle(Standard_Transient) ent = myTP->Mapped(i);
|
||||
Handle(Transfer_Binder) bnd = myTP->MapItem(i);
|
||||
if (bnd.IsNull()) continue;
|
||||
if (!bnd->HasResult()) continue;
|
||||
RecordResult (ent);
|
||||
}
|
||||
|
||||
// Resultat ... on note soigneuseument les Shapes
|
||||
theShapeResult = TransferBRep::Shapes (theTransfer,Standard_True);
|
||||
myShapeResult = TransferBRep::Shapes (myTP,Standard_True);
|
||||
// ???? Et ici, il faut alimenter Imagine ...
|
||||
return theShapeResult->Length();
|
||||
return myShapeResult->Length();
|
||||
}
|
||||
|
||||
|
||||
@@ -1036,10 +945,10 @@ Standard_Integer XSControl_TransferReader::TransferRoots(const Interface_Graph&
|
||||
void XSControl_TransferReader::TransferClear(const Handle(Standard_Transient)& ent,
|
||||
const Standard_Integer level)
|
||||
{
|
||||
if (theTransfer.IsNull()) return;
|
||||
if (ent == theModel) { theTransfer->Clear(); return; }
|
||||
if (myTP.IsNull()) return;
|
||||
if (ent == myModel) { myTP->Clear(); return; }
|
||||
|
||||
theTransfer->RemoveResult (ent,level);
|
||||
myTP->RemoveResult (ent,level);
|
||||
ClearResult (ent,-1);
|
||||
|
||||
}
|
||||
@@ -1053,7 +962,7 @@ void XSControl_TransferReader::TransferClear(const Handle(Standard_Transient)& e
|
||||
void XSControl_TransferReader::PrintStats
|
||||
(const Standard_Integer what, const Standard_Integer mode) const
|
||||
{
|
||||
Handle(Message_Messenger) sout = theTransfer->Messenger();
|
||||
Handle(Message_Messenger) sout = myTP->Messenger();
|
||||
// A ameliorer ... !
|
||||
sout<<"\n*******************************************************************\n";
|
||||
sout << "****** Statistics on Transfer (Read) ******"<<endl;
|
||||
@@ -1061,11 +970,11 @@ void XSControl_TransferReader::PrintStats
|
||||
if (what > 10) { sout<<" *** Not yet implemented"<<endl; return; }
|
||||
if (what < 10) {
|
||||
sout << "****** Data recorded on Last Transfer ******"<<endl;
|
||||
PrintStatsProcess (theTransfer,what,mode);
|
||||
PrintStatsProcess (myTP,what,mode);
|
||||
}
|
||||
// reste what = 10 : on liste les racines des final results
|
||||
sout << "****** Final Results ******"<<endl;
|
||||
if (theModel.IsNull()) { sout<<"**** Model unknown"<<endl; return; }
|
||||
if (myModel.IsNull()) { sout<<"**** Model unknown"<<endl; return; }
|
||||
Handle(TColStd_HSequenceOfTransient) list = RecordedList();
|
||||
Standard_Integer i, nb = list->Length();
|
||||
Handle(IFSelect_SignatureList) counter;
|
||||
@@ -1076,17 +985,17 @@ void XSControl_TransferReader::PrintStats
|
||||
sout<<"**** Nb Recorded : "<<nb<<" : entities n0s : ";
|
||||
for (i = 1; i <= nb; i ++) {
|
||||
Handle(Standard_Transient) ent = list->Value(i);
|
||||
if (mode == 0) { sout<<" "<<theModel->Number(ent); continue; }
|
||||
if (mode == 0) { sout<<" "<<myModel->Number(ent); continue; }
|
||||
if (mode == 1 || mode == 2) {
|
||||
sout<<"[ "<<Interface_MSG::Blanks (i,6)<<" ]:";
|
||||
theModel->Print (ent,sout);
|
||||
sout<<" Type:"<<theModel->TypeName(ent,Standard_False);
|
||||
myModel->Print (ent,sout);
|
||||
sout<<" Type:"<<myModel->TypeName(ent,Standard_False);
|
||||
}
|
||||
if (mode >= 3 && mode <= 6) {
|
||||
counter->Add (ent,theModel->TypeName(ent,Standard_False));
|
||||
counter->Add (ent,myModel->TypeName(ent,Standard_False));
|
||||
}
|
||||
}
|
||||
if (!counter.IsNull()) counter->PrintList(sout,theModel,pcm);
|
||||
if (!counter.IsNull()) counter->PrintList(sout,myModel,pcm);
|
||||
|
||||
sout<<endl;
|
||||
}
|
||||
@@ -1104,7 +1013,7 @@ void XSControl_TransferReader::PrintStats
|
||||
Interface_CheckIterator XSControl_TransferReader::LastCheckList () const
|
||||
{
|
||||
Interface_CheckIterator chl;
|
||||
if (!theTransfer.IsNull()) chl = theTransfer->CheckList (Standard_False);
|
||||
if (!myTP.IsNull()) chl = myTP->CheckList (Standard_False);
|
||||
return chl;
|
||||
}
|
||||
|
||||
@@ -1118,15 +1027,15 @@ Handle(TColStd_HSequenceOfTransient) XSControl_TransferReader::LastTransferList
|
||||
(const Standard_Boolean roots) const
|
||||
{
|
||||
Handle(TColStd_HSequenceOfTransient) li = new TColStd_HSequenceOfTransient();
|
||||
if (theTransfer.IsNull()) return li;
|
||||
if (myTP.IsNull()) return li;
|
||||
Standard_Integer i,j,nb =
|
||||
(roots ? theTransfer->NbRoots() : theTransfer->NbMapped());
|
||||
(roots ? myTP->NbRoots() : myTP->NbMapped());
|
||||
for (j = 1; j <= nb; j ++) {
|
||||
i = (roots ? theModel->Number (theTransfer->Root(j)) : j);
|
||||
Handle(Transfer_Binder) bnd = theTransfer->MapItem(i);
|
||||
i = (roots ? myModel->Number (myTP->Root(j)) : j);
|
||||
Handle(Transfer_Binder) bnd = myTP->MapItem(i);
|
||||
if (bnd.IsNull()) continue;
|
||||
if (!bnd->HasResult()) continue;
|
||||
li->Append (theTransfer->Mapped(i));
|
||||
li->Append (myTP->Mapped(i));
|
||||
}
|
||||
return li;
|
||||
}
|
||||
@@ -1137,26 +1046,25 @@ Handle(TColStd_HSequenceOfTransient) XSControl_TransferReader::LastTransferList
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(TopTools_HSequenceOfShape) XSControl_TransferReader::ShapeResultList
|
||||
const Handle(TopTools_HSequenceOfShape) & XSControl_TransferReader::ShapeResultList
|
||||
(const Standard_Boolean rec)
|
||||
{
|
||||
if (!rec) {
|
||||
if (theShapeResult.IsNull()) theShapeResult =
|
||||
TransferBRep::Shapes (theTransfer,Standard_True);
|
||||
if (theShapeResult.IsNull()) theShapeResult = new TopTools_HSequenceOfShape();
|
||||
if (myShapeResult.IsNull()) myShapeResult = TransferBRep::Shapes (myTP,Standard_True);
|
||||
if (myShapeResult.IsNull()) myShapeResult = new TopTools_HSequenceOfShape();
|
||||
} else {
|
||||
if (theShapeResult.IsNull()) theShapeResult = new TopTools_HSequenceOfShape();
|
||||
if (theModel.IsNull()) return theShapeResult;
|
||||
if (myShapeResult.IsNull()) myShapeResult = new TopTools_HSequenceOfShape();
|
||||
if (myModel.IsNull()) return myShapeResult;
|
||||
Handle(TColStd_HSequenceOfTransient) li = RecordedList();
|
||||
theShapeResult = new TopTools_HSequenceOfShape();
|
||||
Standard_Integer i, nb = theModel->NbEntities();
|
||||
myShapeResult = new TopTools_HSequenceOfShape();
|
||||
Standard_Integer i, nb = myModel->NbEntities();
|
||||
TopoDS_Shape sh;
|
||||
for (i = 1; i <= nb; i ++) {
|
||||
sh = ShapeResult (theModel->Value(i));
|
||||
if (!sh.IsNull()) theShapeResult->Append(sh);
|
||||
sh = ShapeResult (myModel->Value(i));
|
||||
if (!sh.IsNull()) myShapeResult->Append(sh);
|
||||
}
|
||||
}
|
||||
return theShapeResult;
|
||||
return myShapeResult;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -24,10 +24,6 @@
|
||||
#include <TColStd_DataMapOfIntegerTransient.hxx>
|
||||
#include <TopTools_HSequenceOfShape.hxx>
|
||||
#include <MMgt_TShared.hxx>
|
||||
#include <Standard_CString.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <TColStd_HSequenceOfTransient.hxx>
|
||||
#include <Interface_CheckStatus.hxx>
|
||||
class XSControl_Controller;
|
||||
@@ -66,20 +62,20 @@ DEFINE_STANDARD_HANDLE(XSControl_TransferReader, MMgt_TShared)
|
||||
//! Transient or Shapes
|
||||
class XSControl_TransferReader : public MMgt_TShared
|
||||
{
|
||||
public:
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Creates a TransferReader, empty
|
||||
Standard_EXPORT XSControl_TransferReader();
|
||||
XSControl_TransferReader()
|
||||
{}
|
||||
|
||||
//! Sets a Controller. It is required to generate the Actor.
|
||||
//! Elsewhere, the Actor must be provided directly
|
||||
Standard_EXPORT void SetController (const Handle(XSControl_Controller)& control);
|
||||
Standard_EXPORT void SetController (const Handle(XSControl_Controller)& theControl);
|
||||
|
||||
//! Sets the Actor directly : this value will be used if the
|
||||
//! Controller is not set
|
||||
Standard_EXPORT void SetActor (const Handle(Transfer_ActorOfTransientProcess)& actor);
|
||||
void SetActor (const Handle(Transfer_ActorOfTransientProcess)& theActor)
|
||||
{ myActor = theActor; }
|
||||
|
||||
//! Returns the Actor, determined by the Controller, or if this
|
||||
//! one is unknown, directly set.
|
||||
@@ -88,64 +84,70 @@ public:
|
||||
|
||||
//! Sets an InterfaceModel. This causes former results, computed
|
||||
//! from another one, to be lost (see also Clear)
|
||||
Standard_EXPORT void SetModel (const Handle(Interface_InterfaceModel)& model);
|
||||
Standard_EXPORT void SetModel (const Handle(Interface_InterfaceModel)& theModel);
|
||||
|
||||
//! Sets a Graph and its InterfaceModel (calls SetModel)
|
||||
Standard_EXPORT void SetGraph (const Handle(Interface_HGraph)& graph);
|
||||
Standard_EXPORT void SetGraph (const Handle(Interface_HGraph)& theGraph);
|
||||
|
||||
//! Returns the currently set InterfaceModel
|
||||
Standard_EXPORT Handle(Interface_InterfaceModel) Model() const;
|
||||
const Handle(Interface_InterfaceModel) & Model() const
|
||||
{ return myModel; }
|
||||
|
||||
//! Sets a Context : according to receiving appli, to be
|
||||
//! interpreted by the Actor
|
||||
Standard_EXPORT void SetContext (const Standard_CString name, const Handle(Standard_Transient)& ctx);
|
||||
Standard_EXPORT void SetContext (const Standard_CString theName, const Handle(Standard_Transient)& theCtx);
|
||||
|
||||
//! Returns the Context attached to a name, if set and if it is
|
||||
//! Kind of the type, else a Null Handle
|
||||
//! Returns True if OK, False if no Context
|
||||
Standard_EXPORT Standard_Boolean GetContext (const Standard_CString name, const Handle(Standard_Type)& type, Handle(Standard_Transient)& ctx) const;
|
||||
Standard_EXPORT Standard_Boolean GetContext (const Standard_CString theName, const Handle(Standard_Type)& theType, Handle(Standard_Transient)& theCtx) const;
|
||||
|
||||
//! Returns (modifiable) the whole definition of Context
|
||||
//! Rather for internal use (ex.: preparing and setting in once)
|
||||
Standard_EXPORT Handle(Dico_DictionaryOfTransient)& Context();
|
||||
Handle(Dico_DictionaryOfTransient)& Context()
|
||||
{ return myContext; }
|
||||
|
||||
//! Sets a new value for (loaded) file name
|
||||
Standard_EXPORT void SetFileName (const Standard_CString name);
|
||||
|
||||
void SetFileName (const Standard_CString theName)
|
||||
{ myFileName = theName; }
|
||||
|
||||
//! Returns actual value of file name
|
||||
Standard_EXPORT Standard_CString FileName() const;
|
||||
Standard_CString FileName() const
|
||||
{ return myFileName.ToCString(); }
|
||||
|
||||
//! Clears data, according mode :
|
||||
//! -1 all
|
||||
//! 0 nothing done
|
||||
//! +1 final results
|
||||
//! +2 working data (model, context, transfer process)
|
||||
Standard_EXPORT void Clear (const Standard_Integer mode);
|
||||
Standard_EXPORT void Clear (const Standard_Integer theMode);
|
||||
|
||||
//! Returns the currently used TransientProcess
|
||||
//! It is computed from the model by TransferReadRoots, or by
|
||||
//! BeginTransferRead
|
||||
Standard_EXPORT Handle(Transfer_TransientProcess) TransientProcess() const;
|
||||
const Handle(Transfer_TransientProcess) & TransientProcess () const
|
||||
{ return myTP; }
|
||||
|
||||
//! Forces the TransientProcess
|
||||
//! Remark : it also changes the Model and the Actor, from those
|
||||
//! recorded in the new TransientProcess
|
||||
Standard_EXPORT void SetTransientProcess (const Handle(Transfer_TransientProcess)& TP);
|
||||
void SetTransientProcess (const Handle(Transfer_TransientProcess)& theTP)
|
||||
{ myTP = theTP; }
|
||||
|
||||
//! Records a final result of transferring an entity
|
||||
//! This result is recorded as a ResultFromModel, taken from
|
||||
//! the TransientProcess
|
||||
//! Returns True if a result is available, False else
|
||||
Standard_EXPORT Standard_Boolean RecordResult (const Handle(Standard_Transient)& ent);
|
||||
Standard_EXPORT Standard_Boolean RecordResult (const Handle(Standard_Transient)& theEnt);
|
||||
|
||||
//! Returns True if a final result is recorded for an entity
|
||||
//! Remark that it can bring no effective result if transfer has
|
||||
//! completely failed (FinalResult brings only fail messages ...)
|
||||
Standard_EXPORT Standard_Boolean IsRecorded (const Handle(Standard_Transient)& ent) const;
|
||||
Standard_EXPORT Standard_Boolean IsRecorded (const Handle(Standard_Transient)& theEnt) const;
|
||||
|
||||
//! Returns True if a final result is recorded AND BRINGS AN
|
||||
//! EFFECTIVE RESULT (else, it brings only fail messages)
|
||||
Standard_EXPORT Standard_Boolean HasResult (const Handle(Standard_Transient)& ent) const;
|
||||
Standard_EXPORT Standard_Boolean HasResult (const Handle(Standard_Transient)& theEnt) const;
|
||||
|
||||
//! Returns the list of entities to which a final result is
|
||||
//! attached (i.e. processed by RecordResult)
|
||||
@@ -155,38 +157,38 @@ public:
|
||||
//! result at all is available (typically : case not implemented)
|
||||
//! It is not an error, but it gives a specific status : Skipped
|
||||
//! Returns True if done, False if <ent> is not in starting model
|
||||
Standard_EXPORT Standard_Boolean Skip (const Handle(Standard_Transient)& ent);
|
||||
Standard_EXPORT Standard_Boolean Skip (const Handle(Standard_Transient)& theEnt);
|
||||
|
||||
//! Returns True if an entity is noted as skipped
|
||||
Standard_EXPORT Standard_Boolean IsSkipped (const Handle(Standard_Transient)& ent) const;
|
||||
Standard_EXPORT Standard_Boolean IsSkipped (const Handle(Standard_Transient)& theEnt) const;
|
||||
|
||||
//! Returns True if an entity has been asked for transfert, hence
|
||||
//! it is marked, as : Recorded (a computation has ran, with or
|
||||
//! without an effective result), or Skipped (case ignored)
|
||||
Standard_EXPORT Standard_Boolean IsMarked (const Handle(Standard_Transient)& ent) const;
|
||||
Standard_EXPORT Standard_Boolean IsMarked (const Handle(Standard_Transient)& theEnt) const;
|
||||
|
||||
//! Returns the final result recorded for an entity, as such
|
||||
Standard_EXPORT Handle(Transfer_ResultFromModel) FinalResult (const Handle(Standard_Transient)& ent) const;
|
||||
Standard_EXPORT Handle(Transfer_ResultFromModel) FinalResult (const Handle(Standard_Transient)& theEnt) const;
|
||||
|
||||
//! Returns the label attached to an entity recorded for final,
|
||||
//! or an empty string if not recorded
|
||||
Standard_EXPORT Standard_CString FinalEntityLabel (const Handle(Standard_Transient)& ent) const;
|
||||
Standard_EXPORT Standard_CString FinalEntityLabel (const Handle(Standard_Transient)& theEnt) const;
|
||||
|
||||
//! Returns the number attached to the entity recorded for final,
|
||||
//! or zero if not recorded (looks in the ResultFromModel)
|
||||
Standard_EXPORT Standard_Integer FinalEntityNumber (const Handle(Standard_Transient)& ent) const;
|
||||
Standard_EXPORT Standard_Integer FinalEntityNumber (const Handle(Standard_Transient)& theEnt) const;
|
||||
|
||||
//! Returns the final result recorded for a NUMBER of entity
|
||||
//! (internal use). Null if out of range
|
||||
Standard_EXPORT Handle(Transfer_ResultFromModel) ResultFromNumber (const Standard_Integer num) const;
|
||||
Standard_EXPORT Handle(Transfer_ResultFromModel) ResultFromNumber (const Standard_Integer theNum) const;
|
||||
|
||||
//! Returns the resulting object as a Transient
|
||||
//! Null Handle if no result or result not transient
|
||||
Standard_EXPORT Handle(Standard_Transient) TransientResult (const Handle(Standard_Transient)& ent) const;
|
||||
Standard_EXPORT Handle(Standard_Transient) TransientResult (const Handle(Standard_Transient)& theEnt) const;
|
||||
|
||||
//! Returns the resulting object as a Shape
|
||||
//! Null Shape if no result or result not a shape
|
||||
Standard_EXPORT TopoDS_Shape ShapeResult (const Handle(Standard_Transient)& ent) const;
|
||||
Standard_EXPORT TopoDS_Shape ShapeResult (const Handle(Standard_Transient)& theEnt) const;
|
||||
|
||||
//! Clears recorded result for an entity, according mode
|
||||
//! <mode> = -1 : true, complete, clearing (erasing result)
|
||||
@@ -195,7 +197,7 @@ public:
|
||||
//! 10 for all but final result,
|
||||
//! 11 for all : just label, status and filename are kept
|
||||
//! Returns True when done, False if nothing was to clear
|
||||
Standard_EXPORT Standard_Boolean ClearResult (const Handle(Standard_Transient)& ent, const Standard_Integer mode);
|
||||
Standard_EXPORT Standard_Boolean ClearResult (const Handle(Standard_Transient)& theEnt, const Standard_Integer theMode);
|
||||
|
||||
//! Returns an entity from which a given result was produced.
|
||||
//! If <mode> = 0 (D), searches in last root transfers
|
||||
@@ -205,16 +207,16 @@ public:
|
||||
//! <res> can be, either a transient object (result itself) or
|
||||
//! a binder. For a binder of shape, calls EntityFromShapeResult
|
||||
//! Returns a Null Handle if <res> not recorded
|
||||
Standard_EXPORT Handle(Standard_Transient) EntityFromResult (const Handle(Standard_Transient)& res, const Standard_Integer mode = 0) const;
|
||||
Standard_EXPORT Handle(Standard_Transient) EntityFromResult (const Handle(Standard_Transient)& theRes, const Standard_Integer theMode = 0) const;
|
||||
|
||||
//! Returns an entity from which a given shape result was produced
|
||||
//! Returns a Null Handle if <res> not recorded or not a Shape
|
||||
Standard_EXPORT Handle(Standard_Transient) EntityFromShapeResult (const TopoDS_Shape& res, const Standard_Integer mode = 0) const;
|
||||
Standard_EXPORT Handle(Standard_Transient) EntityFromShapeResult (const TopoDS_Shape& theRes, const Standard_Integer theMode = 0) const;
|
||||
|
||||
//! Returns the list of entities from which some shapes were
|
||||
//! produced : it corresponds to a loop on EntityFromShapeResult,
|
||||
//! but is optimised
|
||||
Standard_EXPORT Handle(TColStd_HSequenceOfTransient) EntitiesFromShapeList (const Handle(TopTools_HSequenceOfShape)& res, const Standard_Integer mode = 0) const;
|
||||
Standard_EXPORT Handle(TColStd_HSequenceOfTransient) EntitiesFromShapeList (const Handle(TopTools_HSequenceOfShape)& theRes, const Standard_Integer theMode = 0) const;
|
||||
|
||||
//! Returns the CheckList resulting from transferring <ent>, i.e.
|
||||
//! stored in its recorded form ResultFromModel
|
||||
@@ -228,13 +230,13 @@ public:
|
||||
//! <level> : 0 for <ent> only (D)
|
||||
//! 1 for <ent> and its immediate subtransfers, if any
|
||||
//! 2 for <ent> and subtransferts at all levels
|
||||
Standard_EXPORT Interface_CheckIterator CheckList (const Handle(Standard_Transient)& ent, const Standard_Integer level = 0) const;
|
||||
Standard_EXPORT Interface_CheckIterator CheckList (const Handle(Standard_Transient)& theEnt, const Standard_Integer theLevel = 0) const;
|
||||
|
||||
//! Returns True if an entity (with a final result) has checks :
|
||||
//! - failsonly = False : any kind of check message
|
||||
//! - failsonly = True : fails only
|
||||
//! Returns False if <ent> is not recorded
|
||||
Standard_EXPORT Standard_Boolean HasChecks (const Handle(Standard_Transient)& ent, const Standard_Boolean failsonly) const;
|
||||
Standard_EXPORT Standard_Boolean HasChecks (const Handle(Standard_Transient)& theEnt, const Standard_Boolean FailsOnly) const;
|
||||
|
||||
//! Returns the list of starting entities to which a given check
|
||||
//! status is attached, IN FINAL RESULTS
|
||||
@@ -249,7 +251,7 @@ public:
|
||||
//! <check> = 2 , entities with fail
|
||||
//! <result> : if True, only entities with an attached result
|
||||
//! Remark : result True and check=0 will give an empty list
|
||||
Standard_EXPORT Handle(TColStd_HSequenceOfTransient) CheckedList (const Handle(Standard_Transient)& ent, const Interface_CheckStatus withcheck = Interface_CheckAny, const Standard_Boolean result = Standard_True) const;
|
||||
Standard_EXPORT Handle(TColStd_HSequenceOfTransient) CheckedList (const Handle(Standard_Transient)& theEnt, const Interface_CheckStatus WithCheck = Interface_CheckAny, const Standard_Boolean theResult = Standard_True) const;
|
||||
|
||||
//! Defines a new TransferProcess for reading transfer
|
||||
//! Returns True if done, False if data are not properly defined
|
||||
@@ -258,34 +260,34 @@ public:
|
||||
|
||||
//! Tells if an entity is recognized as a valid candidate for
|
||||
//! Transfer. Calls method Recognize from the Actor (if known)
|
||||
Standard_EXPORT Standard_Boolean Recognize (const Handle(Standard_Transient)& ent);
|
||||
Standard_EXPORT Standard_Boolean Recognize (const Handle(Standard_Transient)& theEnt);
|
||||
|
||||
//! Commands the transfer on reading for an entity to data for
|
||||
//! Imagine, using the selected Actor for Read
|
||||
//! Returns count of transferred entities, ok or with fails (0/1)
|
||||
//! If <rec> is True (D), the result is recorded by RecordResult
|
||||
Standard_EXPORT Standard_Integer TransferOne (const Handle(Standard_Transient)& ent, const Standard_Boolean rec = Standard_True);
|
||||
Standard_EXPORT Standard_Integer TransferOne (const Handle(Standard_Transient)& theEnt, const Standard_Boolean theRec = Standard_True);
|
||||
|
||||
//! Commands the transfer on reading for a list of entities to
|
||||
//! data for Imagine, using the selected Actor for Read
|
||||
//! Returns count of transferred entities, ok or with fails (0/1)
|
||||
//! If <rec> is True (D), the results are recorded by RecordResult
|
||||
Standard_EXPORT Standard_Integer TransferList (const Handle(TColStd_HSequenceOfTransient)& list, const Standard_Boolean rec = Standard_True);
|
||||
Standard_EXPORT Standard_Integer TransferList (const Handle(TColStd_HSequenceOfTransient)& theList, const Standard_Boolean theRec = Standard_True);
|
||||
|
||||
//! Transfers the content of the current Interface Model to
|
||||
//! data handled by Imagine, starting from its Roots (determined
|
||||
//! by the Graph <G>), using the selected Actor for Read
|
||||
//! Returns the count of performed root transfers (i.e. 0 if none)
|
||||
//! or -1 if no actor is defined
|
||||
Standard_EXPORT Standard_Integer TransferRoots (const Interface_Graph& G);
|
||||
Standard_EXPORT Standard_Integer TransferRoots (const Interface_Graph &theGraph);
|
||||
|
||||
//! Clears the results attached to an entity
|
||||
//! if <ents> equates the starting model, clears all results
|
||||
Standard_EXPORT void TransferClear (const Handle(Standard_Transient)& ent, const Standard_Integer level = 0);
|
||||
Standard_EXPORT void TransferClear (const Handle(Standard_Transient)& theEnt, const Standard_Integer theLevel = 0);
|
||||
|
||||
//! Prints statistics on current Trace File, according <what> and
|
||||
//! <mode>. See PrintStatsProcess for details
|
||||
Standard_EXPORT void PrintStats (const Standard_Integer what, const Standard_Integer mode = 0) const;
|
||||
Standard_EXPORT void PrintStats (const Standard_Integer theWhat, const Standard_Integer theMode = 0) const;
|
||||
|
||||
//! Returns the CheckList resulting from last TransferRead
|
||||
//! i.e. from TransientProcess itself, recorded from last Clear
|
||||
@@ -295,14 +297,14 @@ public:
|
||||
//! i.e. from TransientProcess itself, recorded from last Clear
|
||||
//! If <roots> is True , considers only roots of transfer
|
||||
//! If <roots> is False, considers all entities bound with result
|
||||
Standard_EXPORT Handle(TColStd_HSequenceOfTransient) LastTransferList (const Standard_Boolean roots) const;
|
||||
Standard_EXPORT Handle(TColStd_HSequenceOfTransient) LastTransferList (const Standard_Boolean theRoots) const;
|
||||
|
||||
//! Returns a list of result Shapes
|
||||
//! If <rec> is True , sees RecordedList
|
||||
//! If <rec> is False, sees LastTransferList (last ROOT transfers)
|
||||
//! For each one, if it is a Shape, it is cumulated to the list
|
||||
//! If no Shape is found, returns an empty Sequence
|
||||
Standard_EXPORT Handle(TopTools_HSequenceOfShape) ShapeResultList (const Standard_Boolean rec);
|
||||
Standard_EXPORT const Handle(TopTools_HSequenceOfShape) & ShapeResultList (const Standard_Boolean theRec);
|
||||
|
||||
//! This routines prints statistics about a TransientProcess
|
||||
//! It can be called, by a TransferReader, or isolately
|
||||
@@ -334,42 +336,25 @@ public:
|
||||
//! 2 : ShortByItem (count + 5 first numbers)
|
||||
//! 3 : ListByItem (count + entity numbers)
|
||||
//! 4 : EntitiesByItem (count + entity numbers and labels)
|
||||
Standard_EXPORT static void PrintStatsProcess (const Handle(Transfer_TransientProcess)& TP, const Standard_Integer what, const Standard_Integer mode = 0);
|
||||
Standard_EXPORT static void PrintStatsProcess (const Handle(Transfer_TransientProcess)& theTP, const Standard_Integer theWhat, const Standard_Integer theMode = 0);
|
||||
|
||||
//! Works as PrintStatsProcess, but displays data only on the
|
||||
//! entities which are in <list> (filter)
|
||||
Standard_EXPORT static void PrintStatsOnList (const Handle(Transfer_TransientProcess)& TP, const Handle(TColStd_HSequenceOfTransient)& list, const Standard_Integer what, const Standard_Integer mode = 0);
|
||||
|
||||
|
||||
|
||||
Standard_EXPORT static void PrintStatsOnList (const Handle(Transfer_TransientProcess)& theTP, const Handle(TColStd_HSequenceOfTransient)& theList, const Standard_Integer theWhat, const Standard_Integer theMode = 0);
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(XSControl_TransferReader,MMgt_TShared)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Handle(XSControl_Controller) theController;
|
||||
TCollection_AsciiString theFilename;
|
||||
Handle(Interface_InterfaceModel) theModel;
|
||||
Handle(Interface_HGraph) theGraph;
|
||||
Handle(Dico_DictionaryOfTransient) theContext;
|
||||
Handle(Transfer_ActorOfTransientProcess) theActor;
|
||||
Handle(Transfer_TransientProcess) theTransfer;
|
||||
TColStd_DataMapOfIntegerTransient theResults;
|
||||
Handle(TopTools_HSequenceOfShape) theShapeResult;
|
||||
|
||||
private:
|
||||
|
||||
Handle(XSControl_Controller) myController;
|
||||
TCollection_AsciiString myFileName;
|
||||
Handle(Interface_InterfaceModel) myModel;
|
||||
Handle(Interface_HGraph) myGraph;
|
||||
Handle(Dico_DictionaryOfTransient) myContext;
|
||||
Handle(Transfer_ActorOfTransientProcess) myActor;
|
||||
Handle(Transfer_TransientProcess) myTP;
|
||||
TColStd_DataMapOfIntegerTransient myResults;
|
||||
Handle(TopTools_HSequenceOfShape) myShapeResult;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _XSControl_TransferReader_HeaderFile
|
||||
|
||||
@@ -32,47 +32,33 @@
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(XSControl_TransferWriter,MMgt_TShared)
|
||||
|
||||
XSControl_TransferWriter::XSControl_TransferWriter ()
|
||||
{ theTransferWrite = new Transfer_FinderProcess; theTransferMode = 0; }
|
||||
|
||||
Handle(Transfer_FinderProcess) XSControl_TransferWriter::FinderProcess () const
|
||||
{ return theTransferWrite; }
|
||||
//=======================================================================
|
||||
//function : Clear
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void XSControl_TransferWriter::SetFinderProcess (const Handle(Transfer_FinderProcess)& FP)
|
||||
{ theTransferWrite = FP; }
|
||||
|
||||
Handle(XSControl_Controller) XSControl_TransferWriter::Controller () const
|
||||
{ return theController; }
|
||||
|
||||
void XSControl_TransferWriter::SetController (const Handle(XSControl_Controller)& ctl)
|
||||
void XSControl_TransferWriter::Clear (const Standard_Integer mode)
|
||||
{
|
||||
theController = ctl;
|
||||
Clear(-1);
|
||||
if (mode < 0 || myTransferWriter.IsNull())
|
||||
myTransferWriter = new Transfer_FinderProcess;
|
||||
else myTransferWriter->Clear();
|
||||
}
|
||||
|
||||
void XSControl_TransferWriter::Clear (const Standard_Integer mode)
|
||||
//=======================================================================
|
||||
//function : PrintStats
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void XSControl_TransferWriter::PrintStats (const Standard_Integer , const Standard_Integer ) const
|
||||
{
|
||||
if (mode < 0 || theTransferWrite.IsNull())
|
||||
theTransferWrite = new Transfer_FinderProcess;
|
||||
else theTransferWrite->Clear();
|
||||
}
|
||||
|
||||
Standard_Integer XSControl_TransferWriter::TransferMode () const
|
||||
{ return theTransferMode; }
|
||||
|
||||
void XSControl_TransferWriter::SetTransferMode (const Standard_Integer mod)
|
||||
{ theTransferMode = mod; }
|
||||
|
||||
void XSControl_TransferWriter::PrintStats
|
||||
(const Standard_Integer , const Standard_Integer ) const
|
||||
{
|
||||
Handle(Message_Messenger) sout = theTransferWrite->Messenger();
|
||||
Handle(Message_Messenger) sout = myTransferWriter->Messenger();
|
||||
// A ameliorer ... !
|
||||
sout<<"\n*******************************************************************\n";
|
||||
sout << "****** Statistics on Transfer (Write) ******"<<endl;
|
||||
sout<<"\n*******************************************************************\n";
|
||||
sout << "****** Transfer Mode = "<<theTransferMode;
|
||||
Standard_CString modehelp = theController->ModeWriteHelp (theTransferMode);
|
||||
sout << "****** Transfer Mode = "<<myTransferMode;
|
||||
Standard_CString modehelp = myController->ModeWriteHelp (myTransferMode);
|
||||
if (modehelp && modehelp[0] != 0) sout<<" I.E. "<<modehelp;
|
||||
sout<<" ******"<<endl;
|
||||
}
|
||||
@@ -80,36 +66,45 @@ XSControl_TransferWriter::XSControl_TransferWriter ()
|
||||
|
||||
// ########## LES ACTIONS ##########
|
||||
|
||||
Standard_Boolean XSControl_TransferWriter::RecognizeTransient
|
||||
(const Handle(Standard_Transient)& obj)
|
||||
//=======================================================================
|
||||
//function : RecognizeTransient
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean XSControl_TransferWriter::RecognizeTransient (const Handle(Standard_Transient)& obj)
|
||||
{
|
||||
if (theController.IsNull()) return Standard_False;
|
||||
if (myController.IsNull()) return Standard_False;
|
||||
XSControl_Utils xu;
|
||||
TopoDS_Shape sh = xu.BinderShape (obj);
|
||||
if (!sh.IsNull()) return RecognizeShape (sh);
|
||||
return theController->RecognizeWriteTransient (obj,theTransferMode);
|
||||
return myController->RecognizeWriteTransient (obj,myTransferMode);
|
||||
}
|
||||
|
||||
IFSelect_ReturnStatus XSControl_TransferWriter::TransferWriteTransient
|
||||
//=======================================================================
|
||||
//function : TransferWriteTransient
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
IFSelect_ReturnStatus XSControl_TransferWriter::TransferWriteTransient
|
||||
(const Handle(Interface_InterfaceModel)& model,
|
||||
const Handle(Standard_Transient)& obj)
|
||||
{
|
||||
IFSelect_ReturnStatus status = IFSelect_RetVoid;
|
||||
if (theController.IsNull()) return IFSelect_RetError;
|
||||
if (myController.IsNull()) return IFSelect_RetError;
|
||||
if (model.IsNull()) return IFSelect_RetVoid;
|
||||
|
||||
if (theTransferWrite.IsNull()) theTransferWrite = new Transfer_FinderProcess;
|
||||
if (myTransferWriter.IsNull()) myTransferWriter = new Transfer_FinderProcess;
|
||||
Handle(Transfer_ActorOfFinderProcess) nulact;
|
||||
theTransferWrite->SetActor (nulact);
|
||||
myTransferWriter->SetActor (nulact);
|
||||
Handle(Standard_Transient) resultat;
|
||||
Handle(Message_Messenger) sout = theTransferWrite->Messenger();
|
||||
Handle(Message_Messenger) sout = myTransferWriter->Messenger();
|
||||
try {
|
||||
OCC_CATCH_SIGNALS
|
||||
PrintStats(theTransferMode);
|
||||
PrintStats(myTransferMode);
|
||||
sout << "****** Transferring Transient, CDL Type = ";
|
||||
sout<<obj->DynamicType()->Name()<<" ******"<<endl;
|
||||
status = theController->TransferWriteTransient
|
||||
(obj,theTransferWrite,model,theTransferMode);
|
||||
status = myController->TransferWriteTransient
|
||||
(obj,myTransferWriter,model,myTransferMode);
|
||||
}
|
||||
catch(Standard_Failure) {
|
||||
sout<<"**** **** TransferWriteShape, EXCEPTION : ";
|
||||
@@ -120,37 +115,44 @@ XSControl_TransferWriter::XSControl_TransferWriter ()
|
||||
return status;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : RecognizeShape
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean XSControl_TransferWriter::RecognizeShape
|
||||
(const TopoDS_Shape& shape)
|
||||
Standard_Boolean XSControl_TransferWriter::RecognizeShape (const TopoDS_Shape& shape)
|
||||
{
|
||||
if (theController.IsNull()) return Standard_False;
|
||||
if (myController.IsNull()) return Standard_False;
|
||||
if (shape.IsNull()) return Standard_False;
|
||||
return theController->RecognizeWriteShape (shape,theTransferMode);
|
||||
return myController->RecognizeWriteShape (shape,myTransferMode);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : TransferWriteShape
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
IFSelect_ReturnStatus XSControl_TransferWriter::TransferWriteShape
|
||||
IFSelect_ReturnStatus XSControl_TransferWriter::TransferWriteShape
|
||||
(const Handle(Interface_InterfaceModel)& model,
|
||||
const TopoDS_Shape& shape)
|
||||
{
|
||||
IFSelect_ReturnStatus status = IFSelect_RetVoid;
|
||||
if (theController.IsNull()) return IFSelect_RetError;
|
||||
if (myController.IsNull()) return IFSelect_RetError;
|
||||
if (model.IsNull()) return IFSelect_RetVoid;
|
||||
|
||||
if (theTransferWrite.IsNull()) theTransferWrite = new Transfer_FinderProcess;
|
||||
if (myTransferWriter.IsNull()) myTransferWriter = new Transfer_FinderProcess;
|
||||
// effacer l actor : Controller s en charge
|
||||
Handle(Transfer_ActorOfFinderProcess) nulact;
|
||||
theTransferWrite->SetActor (nulact);
|
||||
myTransferWriter->SetActor (nulact);
|
||||
Handle(Standard_Transient) resultat;
|
||||
Handle(Message_Messenger) sout = theTransferWrite->Messenger();
|
||||
Handle(Message_Messenger) sout = myTransferWriter->Messenger();
|
||||
try {
|
||||
OCC_CATCH_SIGNALS
|
||||
PrintStats(theTransferMode);
|
||||
PrintStats(myTransferMode);
|
||||
sout << "****** Transferring Shape, ShapeType = " << shape.ShapeType();
|
||||
sout<<" ******"<<endl;
|
||||
status = theController->TransferWriteShape
|
||||
(shape,theTransferWrite,model,theTransferMode);
|
||||
status = myController->TransferWriteShape
|
||||
(shape,myTransferWriter,model,myTransferMode);
|
||||
}
|
||||
catch(Standard_Failure) {
|
||||
sout<<"**** **** TransferWriteShape, EXCEPTION : ";
|
||||
@@ -161,35 +163,42 @@ XSControl_TransferWriter::XSControl_TransferWriter ()
|
||||
return status;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : CheckList
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Interface_CheckIterator XSControl_TransferWriter::CheckList () const
|
||||
Interface_CheckIterator XSControl_TransferWriter::CheckList () const
|
||||
{
|
||||
Interface_CheckIterator chl;
|
||||
if (theTransferWrite.IsNull()) return chl;
|
||||
Standard_Integer i, nb = theTransferWrite->NbMapped();
|
||||
if (myTransferWriter.IsNull()) return chl;
|
||||
Standard_Integer i, nb = myTransferWriter->NbMapped();
|
||||
for (i = 1; i <= nb; i ++) {
|
||||
DeclareAndCast(Transfer_SimpleBinderOfTransient,tb,theTransferWrite->MapItem
|
||||
(i));
|
||||
DeclareAndCast(Transfer_SimpleBinderOfTransient,tb,myTransferWriter->MapItem(i));
|
||||
if (tb.IsNull()) continue;
|
||||
Handle(Interface_Check) ach = tb->Check();
|
||||
if (ach->NbFails() == 0 || ach->NbWarnings() == 0) continue;
|
||||
DeclareAndCast(Transfer_TransientMapper,tm,theTransferWrite->Mapped(i));
|
||||
if (tm.IsNull()) ach->GetEntity (theTransferWrite->Mapped(i));
|
||||
DeclareAndCast(Transfer_TransientMapper,tm,myTransferWriter->Mapped(i));
|
||||
if (tm.IsNull()) ach->GetEntity (myTransferWriter->Mapped(i));
|
||||
else ach->GetEntity (tm->Value());
|
||||
chl.Add(ach);
|
||||
}
|
||||
return chl;
|
||||
}
|
||||
|
||||
Interface_CheckIterator XSControl_TransferWriter::ResultCheckList
|
||||
//=======================================================================
|
||||
//function : ResultCheckList
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Interface_CheckIterator XSControl_TransferWriter::ResultCheckList
|
||||
(const Handle(Interface_InterfaceModel)& model) const
|
||||
{
|
||||
Interface_CheckIterator chl;
|
||||
if (theTransferWrite.IsNull()) return chl;
|
||||
Standard_Integer i, nb = theTransferWrite->NbMapped();
|
||||
if (myTransferWriter.IsNull()) return chl;
|
||||
Standard_Integer i, nb = myTransferWriter->NbMapped();
|
||||
for (i = 1; i <= nb; i ++) {
|
||||
DeclareAndCast(Transfer_SimpleBinderOfTransient,tb,theTransferWrite->MapItem
|
||||
(i));
|
||||
DeclareAndCast(Transfer_SimpleBinderOfTransient,tb,myTransferWriter->MapItem(i));
|
||||
if (tb.IsNull()) continue;
|
||||
const Handle(Interface_Check) ach = tb->Check();
|
||||
if (ach->NbFails() == 0 || ach->NbWarnings() == 0) continue;
|
||||
@@ -199,8 +208,3 @@ XSControl_TransferWriter::XSControl_TransferWriter ()
|
||||
}
|
||||
return chl;
|
||||
}
|
||||
|
||||
void XSControl_TransferWriter::PrintStatsProcess
|
||||
(const Handle(Transfer_FinderProcess)& ,
|
||||
const Standard_Integer , const Standard_Integer )
|
||||
{ }
|
||||
|
||||
@@ -20,12 +20,10 @@
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <MMgt_TShared.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <IFSelect_ReturnStatus.hxx>
|
||||
#include <Transfer_FinderProcess.hxx>
|
||||
class XSControl_Controller;
|
||||
class Transfer_FinderProcess;
|
||||
class Standard_Transient;
|
||||
class Interface_InterfaceModel;
|
||||
class TopoDS_Shape;
|
||||
@@ -43,67 +41,77 @@ DEFINE_STANDARD_HANDLE(XSControl_TransferWriter, MMgt_TShared)
|
||||
//! checks
|
||||
class XSControl_TransferWriter : public MMgt_TShared
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
public:
|
||||
|
||||
//! Creates a TransferWriter, empty, ready to run
|
||||
//! with an empty FinderProcess (but no controller, etc)
|
||||
Standard_EXPORT XSControl_TransferWriter();
|
||||
XSControl_TransferWriter()
|
||||
: myTransferWriter(new Transfer_FinderProcess),
|
||||
myTransferMode(0)
|
||||
{}
|
||||
|
||||
//! Returns the FinderProcess itself
|
||||
Standard_EXPORT Handle(Transfer_FinderProcess) FinderProcess() const;
|
||||
const Handle(Transfer_FinderProcess) & FinderProcess() const
|
||||
{ return myTransferWriter; }
|
||||
|
||||
//! Sets a new FinderProcess and forgets the former one
|
||||
Standard_EXPORT void SetFinderProcess (const Handle(Transfer_FinderProcess)& FP);
|
||||
|
||||
void SetFinderProcess (const Handle(Transfer_FinderProcess)& theFP)
|
||||
{ myTransferWriter = theFP; }
|
||||
|
||||
//! Returns the currently used Controller
|
||||
Standard_EXPORT Handle(XSControl_Controller) Controller() const;
|
||||
const Handle(XSControl_Controller) & Controller() const
|
||||
{ return myController; }
|
||||
|
||||
//! Sets a new Controller, also sets a new FinderProcess
|
||||
Standard_EXPORT void SetController (const Handle(XSControl_Controller)& ctl);
|
||||
Standard_EXPORT void SetController (const Handle(XSControl_Controller)& theCtl)
|
||||
{
|
||||
myController = theCtl;
|
||||
Clear(-1);
|
||||
}
|
||||
|
||||
//! Clears recorded data according a mode
|
||||
//! 0 clears FinderProcess (results, checks)
|
||||
//! -1 create a new FinderProcess
|
||||
Standard_EXPORT void Clear (const Standard_Integer mode);
|
||||
Standard_EXPORT void Clear (const Standard_Integer theMode);
|
||||
|
||||
//! Returns the current Transfer Mode (an Integer)
|
||||
//! It will be interpreted by the Controller to run Transfers
|
||||
//! This call form could be later replaced by more specific ones
|
||||
//! (parameters suited for each norm / transfer case)
|
||||
Standard_EXPORT Standard_Integer TransferMode() const;
|
||||
|
||||
Standard_Integer TransferMode() const
|
||||
{ return myTransferMode; }
|
||||
|
||||
//! Changes the Transfer Mode
|
||||
Standard_EXPORT void SetTransferMode (const Standard_Integer mode);
|
||||
|
||||
void SetTransferMode (const Standard_Integer theMode)
|
||||
{ myTransferMode = theMode; }
|
||||
|
||||
//! Prints statistics on current Trace File, according what,mode
|
||||
//! See PrintStatsProcess for details
|
||||
Standard_EXPORT void PrintStats (const Standard_Integer what, const Standard_Integer mode = 0) const;
|
||||
Standard_EXPORT void PrintStats (const Standard_Integer theWhat, const Standard_Integer theMode = 0) const;
|
||||
|
||||
//! Tells if a transient object (from an application) is a valid
|
||||
//! candidate for a transfer to a model
|
||||
//! Asks the Controller (RecognizeWriteTransient)
|
||||
//! If <obj> is a HShape, calls RecognizeShape
|
||||
Standard_EXPORT Standard_Boolean RecognizeTransient (const Handle(Standard_Transient)& obj);
|
||||
Standard_EXPORT Standard_Boolean RecognizeTransient (const Handle(Standard_Transient)& theObj);
|
||||
|
||||
//! Transfers a Transient object (from an application) to a model
|
||||
//! of current norm, according to the last call to SetTransferMode
|
||||
//! Works by calling the Controller
|
||||
//! Returns status : =0 if OK, >0 if error during transfer, <0 if
|
||||
//! transfer badly initialised
|
||||
Standard_EXPORT IFSelect_ReturnStatus TransferWriteTransient (const Handle(Interface_InterfaceModel)& model, const Handle(Standard_Transient)& obj);
|
||||
Standard_EXPORT IFSelect_ReturnStatus TransferWriteTransient (const Handle(Interface_InterfaceModel)& theModel, const Handle(Standard_Transient)& theObj);
|
||||
|
||||
//! Tells if a Shape is valid for a transfer to a model
|
||||
//! Asks the Controller (RecognizeWriteShape)
|
||||
Standard_EXPORT Standard_Boolean RecognizeShape (const TopoDS_Shape& shape);
|
||||
Standard_EXPORT Standard_Boolean RecognizeShape (const TopoDS_Shape& theShape);
|
||||
|
||||
//! Transfers a Shape from CasCade to a model of current norm,
|
||||
//! according to the last call to SetTransferMode
|
||||
//! Works by calling the Controller
|
||||
//! Returns status : =0 if OK, >0 if error during transfer, <0 if
|
||||
//! transfer badly initialised
|
||||
Standard_EXPORT IFSelect_ReturnStatus TransferWriteShape (const Handle(Interface_InterfaceModel)& model, const TopoDS_Shape& shape);
|
||||
Standard_EXPORT IFSelect_ReturnStatus TransferWriteShape (const Handle(Interface_InterfaceModel)& theModel, const TopoDS_Shape& theShape);
|
||||
|
||||
//! Returns the check-list of last transfer (write), i.e. the
|
||||
//! check-list currently recorded in the FinderProcess
|
||||
@@ -112,35 +120,15 @@ public:
|
||||
//! Returns the check-list of last transfer (write), but tries
|
||||
//! to bind to each check, the resulting entity in the model
|
||||
//! instead of keeping the original Mapper, whenever known
|
||||
Standard_EXPORT Interface_CheckIterator ResultCheckList (const Handle(Interface_InterfaceModel)& model) const;
|
||||
|
||||
//! Forecast to print statitics about a FinderProcess
|
||||
Standard_EXPORT static void PrintStatsProcess (const Handle(Transfer_FinderProcess)& TP, const Standard_Integer what, const Standard_Integer mode = 0);
|
||||
|
||||
|
||||
|
||||
Standard_EXPORT Interface_CheckIterator ResultCheckList (const Handle(Interface_InterfaceModel)& theModel) const;
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(XSControl_TransferWriter,MMgt_TShared)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Handle(XSControl_Controller) theController;
|
||||
Handle(Transfer_FinderProcess) theTransferWrite;
|
||||
Standard_Integer theTransferMode;
|
||||
|
||||
private:
|
||||
|
||||
Handle(XSControl_Controller) myController;
|
||||
Handle(Transfer_FinderProcess) myTransferWriter;
|
||||
Standard_Integer myTransferMode;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _XSControl_TransferWriter_HeaderFile
|
||||
|
||||
@@ -24,11 +24,8 @@
|
||||
#include <Interface_IntVal.hxx>
|
||||
#include <Interface_Macros.hxx>
|
||||
#include <Message_Messenger.hxx>
|
||||
#include <MoniTool_Profile.hxx>
|
||||
#include <Standard_ErrorHandler.hxx>
|
||||
#include <Standard_Failure.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TColStd_HSequenceOfTransient.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <Transfer_Binder.hxx>
|
||||
@@ -41,23 +38,21 @@
|
||||
#include <TransferBRep.hxx>
|
||||
#include <XSControl_Controller.hxx>
|
||||
#include <XSControl_TransferReader.hxx>
|
||||
#include <XSControl_TransferWriter.hxx>
|
||||
#include <XSControl_Vars.hxx>
|
||||
#include <XSControl_WorkSession.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(XSControl_WorkSession,IFSelect_WorkSession)
|
||||
|
||||
// tpent
|
||||
//=======================================================================
|
||||
//function : XSControl_WorkSession
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
XSControl_WorkSession::XSControl_WorkSession ()
|
||||
: myTransferReader(new XSControl_TransferReader),
|
||||
myTransferWriter(new XSControl_TransferWriter),
|
||||
myVars(new XSControl_Vars)
|
||||
{
|
||||
theModeWriteShape = 0;
|
||||
theTransferRead = new XSControl_TransferReader;
|
||||
theTransferWrite = new XSControl_TransferWriter;
|
||||
theVars = new XSControl_Vars;
|
||||
}
|
||||
|
||||
|
||||
@@ -76,11 +71,11 @@ void XSControl_WorkSession::ClearData (const Standard_Integer mode)
|
||||
// 7 : Management, y compris tous transferts (forces/calcules), views
|
||||
|
||||
if (mode == 5 || mode == 7) {
|
||||
theTransferRead->Clear(-1);
|
||||
theTransferWrite->Clear(-1);
|
||||
myTransferReader->Clear(-1);
|
||||
myTransferWriter->Clear(-1);
|
||||
}
|
||||
if (mode == 6 && !theTransferRead.IsNull()) theTransferRead->Clear(1);
|
||||
theTransferRead->SetGraph (HGraph());
|
||||
if (mode == 6 && !myTransferReader.IsNull()) myTransferReader->Clear(1);
|
||||
myTransferReader->SetGraph (HGraph());
|
||||
}
|
||||
|
||||
|
||||
@@ -89,69 +84,44 @@ void XSControl_WorkSession::ClearData (const Standard_Integer mode)
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean XSControl_WorkSession::SelectNorm(const Standard_CString normname,
|
||||
const Standard_CString profile)
|
||||
Standard_Boolean XSControl_WorkSession::SelectNorm(const Standard_CString normname)
|
||||
{
|
||||
// RAZ ancienne norme et resultats
|
||||
theTransferRead->Clear(-1);
|
||||
// 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)
|
||||
|
||||
Handle(XSControl_Controller) newadapt =
|
||||
XSControl_Controller::Recorded (normname);
|
||||
Handle(XSControl_Controller) newadapt = XSControl_Controller::Recorded (normname);
|
||||
if (newadapt.IsNull()) return Standard_False;
|
||||
if (newadapt == theController) return Standard_True;
|
||||
if (newadapt == myController) return Standard_True;
|
||||
SetController (newadapt);
|
||||
if (profile && profile[0] != '\0') newadapt->Profile()->SetCurrent(profile);
|
||||
|
||||
// cout<<"##########################\n"
|
||||
// <<"## Select Norm : "<<normname<<"\n"
|
||||
// <<"##########################"<<endl;
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SelectProfile
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean XSControl_WorkSession::SelectProfile(const Standard_CString profile)
|
||||
{
|
||||
return theController->Profile()->SetCurrent(profile);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SetController
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void XSControl_WorkSession::SetController(const Handle(XSControl_Controller)& ctl)
|
||||
void XSControl_WorkSession::SetController(const Handle(XSControl_Controller)& ctl)
|
||||
{
|
||||
theController = ctl;
|
||||
myController = ctl;
|
||||
|
||||
SetLibrary ( theController->WorkLibrary() );
|
||||
SetProtocol ( theController->Protocol() );
|
||||
ClearItems(); ClearFinalModifiers();
|
||||
ClearShareOut(Standard_False); ClearFile();
|
||||
Handle(XSControl_WorkSession) aWorkSession = this;
|
||||
theController->Customise (aWorkSession);
|
||||
SetSignType ( theController->SignType() );
|
||||
theTransferRead->SetController (theController);
|
||||
theTransferWrite->SetController (theController);
|
||||
SetLibrary ( myController->WorkLibrary() );
|
||||
SetProtocol ( myController->Protocol() );
|
||||
|
||||
AdaptNorm ();
|
||||
}
|
||||
ClearItems();
|
||||
ClearFinalModifiers();
|
||||
ClearShareOut(Standard_False);
|
||||
ClearFile();
|
||||
|
||||
// Set worksession parameters from teh controller
|
||||
Handle(XSControl_WorkSession) aWorkSession(this);
|
||||
myController->Customise (aWorkSession);
|
||||
|
||||
//=======================================================================
|
||||
//function : AdaptNorm
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void XSControl_WorkSession::AdaptNorm ()
|
||||
{
|
||||
myTransferReader->SetController (myController);
|
||||
myTransferWriter->SetController (myController);
|
||||
}
|
||||
|
||||
|
||||
@@ -163,21 +133,9 @@ void XSControl_WorkSession::AdaptNorm ()
|
||||
Standard_CString XSControl_WorkSession::SelectedNorm(const Standard_Boolean rsc) const
|
||||
{
|
||||
//JR/Hp :
|
||||
Standard_CString astr = (Standard_CString ) (theController.IsNull() ? "" : theController->Name(rsc));
|
||||
Standard_CString astr = (Standard_CString ) (myController.IsNull() ? "" : myController->Name(rsc));
|
||||
return astr ;
|
||||
}
|
||||
// { return (theController.IsNull() ? "" : theController->Name(rsc)); }
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : NormAdaptor
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(XSControl_Controller) XSControl_WorkSession::NormAdaptor () const
|
||||
{
|
||||
return theController;
|
||||
}
|
||||
|
||||
|
||||
// ##########################################
|
||||
@@ -185,17 +143,6 @@ Handle(XSControl_Controller) XSControl_WorkSession::NormAdaptor () const
|
||||
// ##########################################
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Context
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Dico_DictionaryOfTransient) XSControl_WorkSession::Context () const
|
||||
{
|
||||
return theContext;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SetAllContext
|
||||
//purpose :
|
||||
@@ -203,8 +150,8 @@ Handle(Dico_DictionaryOfTransient) XSControl_WorkSession::Context () const
|
||||
|
||||
void XSControl_WorkSession::SetAllContext(const Handle(Dico_DictionaryOfTransient)& context)
|
||||
{
|
||||
theContext = context;
|
||||
theTransferRead->Context() = context;
|
||||
myContext = context;
|
||||
myTransferReader->Context() = context;
|
||||
}
|
||||
|
||||
|
||||
@@ -215,8 +162,8 @@ void XSControl_WorkSession::SetAllContext(const Handle(Dico_DictionaryOfTransien
|
||||
|
||||
void XSControl_WorkSession::ClearContext ()
|
||||
{
|
||||
Handle(Dico_DictionaryOfTransient) nulctx;
|
||||
SetAllContext(nulctx);
|
||||
myContext.Nullify();
|
||||
myTransferReader->Context().Nullify();
|
||||
}
|
||||
|
||||
|
||||
@@ -234,8 +181,8 @@ Standard_Boolean XSControl_WorkSession::PrintTransferStatus(const Standard_Inte
|
||||
const Standard_Boolean wri,
|
||||
const Handle(Message_Messenger)& S) const
|
||||
{
|
||||
Handle(Transfer_FinderProcess) FP = MapWriter();
|
||||
Handle(Transfer_TransientProcess) TP = MapReader();
|
||||
const Handle(Transfer_FinderProcess) &FP = myTransferWriter->FinderProcess();
|
||||
Handle(Transfer_TransientProcess) TP = myTransferReader->TransientProcess();
|
||||
|
||||
Handle(Transfer_Binder) binder;
|
||||
Handle(Transfer_Finder) finder;
|
||||
@@ -266,7 +213,7 @@ Standard_Boolean XSControl_WorkSession::PrintTransferStatus(const Standard_Inte
|
||||
FP->StartTrace (binder,finder,0,0); // pb sout/S
|
||||
if (!ent.IsNull()) {
|
||||
S<<" ** Resultat Transient, type "<<ent->DynamicType()->Name();
|
||||
Handle(Interface_InterfaceModel) model = Model();
|
||||
const Handle(Interface_InterfaceModel) &model = Model();
|
||||
if (!model.IsNull())
|
||||
{ S<<" In output Model, Entity "; model->Print(ent,S); }
|
||||
S<<endl;
|
||||
@@ -327,33 +274,33 @@ Standard_Boolean XSControl_WorkSession::PrintTransferStatus(const Standard_Inte
|
||||
|
||||
void XSControl_WorkSession::InitTransferReader(const Standard_Integer mode)
|
||||
{
|
||||
if (mode == 0 || mode == 5) theTransferRead->Clear(-1); // full clear
|
||||
if (theTransferRead.IsNull()) SetTransferReader (new XSControl_TransferReader);
|
||||
else SetTransferReader (theTransferRead);
|
||||
if (mode == 0 || mode == 5) myTransferReader->Clear(-1); // full clear
|
||||
if (myTransferReader.IsNull()) SetTransferReader (new XSControl_TransferReader);
|
||||
else SetTransferReader (myTransferReader);
|
||||
|
||||
// mode = 0 fait par SetTransferReader suite a Nullify
|
||||
if (mode == 1) {
|
||||
if (!theTransferRead.IsNull()) theTransferRead->Clear(-1);
|
||||
if (!myTransferReader.IsNull()) myTransferReader->Clear(-1);
|
||||
else SetTransferReader (new XSControl_TransferReader);
|
||||
}
|
||||
if (mode == 2) {
|
||||
Handle(Transfer_TransientProcess) TP = theTransferRead->TransientProcess();
|
||||
Handle(Transfer_TransientProcess) TP = myTransferReader->TransientProcess();
|
||||
if (TP.IsNull()) {
|
||||
TP = new Transfer_TransientProcess;
|
||||
theTransferRead->SetTransientProcess(TP);
|
||||
myTransferReader->SetTransientProcess(TP);
|
||||
TP->SetGraph (HGraph());
|
||||
}
|
||||
Handle(TColStd_HSequenceOfTransient) lis = theTransferRead->RecordedList();
|
||||
Handle(TColStd_HSequenceOfTransient) lis = myTransferReader->RecordedList();
|
||||
Standard_Integer i, nb = lis->Length();
|
||||
for (i = 1; i <= nb; i ++) TP->SetRoot(lis->Value(i));
|
||||
}
|
||||
if (mode == 3) {
|
||||
Handle(Transfer_TransientProcess) TP = theTransferRead->TransientProcess();
|
||||
Handle(Transfer_TransientProcess) TP = myTransferReader->TransientProcess();
|
||||
if (TP.IsNull()) return;
|
||||
Standard_Integer i, nb = TP->NbRoots();
|
||||
for (i = 1; i <= nb; i ++) theTransferRead->RecordResult(TP->Root(i));
|
||||
for (i = 1; i <= nb; i ++) myTransferReader->RecordResult(TP->Root(i));
|
||||
}
|
||||
if (mode == 4 || mode == 5) theTransferRead->BeginTransfer();
|
||||
if (mode == 4 || mode == 5) myTransferReader->BeginTransfer();
|
||||
}
|
||||
|
||||
|
||||
@@ -364,10 +311,10 @@ void XSControl_WorkSession::InitTransferReader(const Standard_Integer mode)
|
||||
|
||||
void XSControl_WorkSession::SetTransferReader(const Handle(XSControl_TransferReader)& TR)
|
||||
{
|
||||
if (theTransferRead != TR) //i1 pdn 03.04.99 BUC60301
|
||||
theTransferRead = TR;
|
||||
if (myTransferReader != TR) //i1 pdn 03.04.99 BUC60301
|
||||
myTransferReader = TR;
|
||||
if (TR.IsNull()) return;
|
||||
TR->SetController (theController);
|
||||
TR->SetController (myController);
|
||||
TR->SetGraph (HGraph());
|
||||
if (!TR->TransientProcess().IsNull()) return;
|
||||
Handle(Transfer_TransientProcess) TP = new Transfer_TransientProcess
|
||||
@@ -378,44 +325,21 @@ void XSControl_WorkSession::SetTransferReader(const Handle(XSControl_TransferRea
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : TransferReader
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(XSControl_TransferReader) XSControl_WorkSession::TransferReader () const
|
||||
{
|
||||
return theTransferRead;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : MapReader
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Transfer_TransientProcess) XSControl_WorkSession::MapReader () const
|
||||
{
|
||||
return theTransferRead->TransientProcess();
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SetMapReader
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean XSControl_WorkSession::SetMapReader
|
||||
(const Handle(Transfer_TransientProcess)& TP)
|
||||
Standard_Boolean XSControl_WorkSession::SetMapReader (const Handle(Transfer_TransientProcess)& TP)
|
||||
{
|
||||
if ( TP.IsNull()) return Standard_False;
|
||||
if (TP.IsNull()) return Standard_False;
|
||||
if (TP->Model().IsNull()) TP->SetModel (Model());
|
||||
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
|
||||
// Handle(XSControl_TransferReader) TR = new XSControl_TransferReader;
|
||||
Handle(XSControl_TransferReader) TR = theTransferRead;
|
||||
Handle(XSControl_TransferReader) TR = myTransferReader;
|
||||
TR->Clear(-1);
|
||||
|
||||
SetTransferReader (TR); // avec le meme mais le reinitialise
|
||||
@@ -438,12 +362,12 @@ Handle(Standard_Transient) XSControl_WorkSession::Result
|
||||
Handle(Transfer_Binder) binder;
|
||||
Handle(Transfer_ResultFromModel) resu;
|
||||
|
||||
if (ouca != 1) resu = theTransferRead->FinalResult(ent);
|
||||
if (ouca != 1) resu = myTransferReader->FinalResult(ent);
|
||||
if (mode == 20) return resu;
|
||||
|
||||
if (!resu.IsNull()) binder = resu->MainResult()->Binder();
|
||||
if (binder.IsNull() && ouca > 0)
|
||||
binder = theTransferRead->TransientProcess()->Find(ent);
|
||||
binder = myTransferReader->TransientProcess()->Find(ent);
|
||||
|
||||
if (kica == 1) return binder;
|
||||
DeclareAndCast(Transfer_SimpleBinderOfTransient,trb,binder);
|
||||
@@ -461,15 +385,14 @@ Handle(Standard_Transient) XSControl_WorkSession::Result
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer XSControl_WorkSession::TransferReadOne
|
||||
(const Handle(Standard_Transient)& ent)
|
||||
Standard_Integer XSControl_WorkSession::TransferReadOne (const Handle(Standard_Transient)& ent)
|
||||
{
|
||||
Handle(Interface_InterfaceModel) model = Model();
|
||||
if (ent == model) return TransferReadRoots();
|
||||
|
||||
Handle(TColStd_HSequenceOfTransient) list = GiveList(ent);
|
||||
if (list->Length() == 1) return theTransferRead->TransferOne(list->Value(1));
|
||||
else return theTransferRead->TransferList (list);
|
||||
if (list->Length() == 1) return myTransferReader->TransferOne(list->Value(1));
|
||||
else return myTransferReader->TransferList (list);
|
||||
}
|
||||
|
||||
|
||||
@@ -478,9 +401,9 @@ Standard_Integer XSControl_WorkSession::TransferReadOne
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer XSControl_WorkSession::TransferReadRoots ()
|
||||
Standard_Integer XSControl_WorkSession::TransferReadRoots ()
|
||||
{
|
||||
return theTransferRead->TransferRoots(Graph());
|
||||
return myTransferReader->TransferRoots(Graph());
|
||||
}
|
||||
|
||||
|
||||
@@ -496,92 +419,33 @@ Standard_Integer XSControl_WorkSession::TransferReadRoots ()
|
||||
Handle(Interface_InterfaceModel) XSControl_WorkSession::NewModel ()
|
||||
{
|
||||
Handle(Interface_InterfaceModel) newmod;
|
||||
if (theController.IsNull()) return newmod;
|
||||
newmod = theController->NewModel();
|
||||
if (myController.IsNull()) return newmod;
|
||||
newmod = myController->NewModel();
|
||||
|
||||
SetModel(newmod);
|
||||
if(!MapReader().IsNull())
|
||||
MapReader()->Clear();
|
||||
if(!myTransferReader->TransientProcess().IsNull())
|
||||
myTransferReader->TransientProcess()->Clear();
|
||||
//clear all contains of WS
|
||||
theTransferRead->Clear(3);
|
||||
theTransferWrite->Clear(-1);
|
||||
myTransferReader->Clear(3);
|
||||
myTransferWriter->Clear(-1);
|
||||
|
||||
return newmod;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : TransferWriter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(XSControl_TransferWriter) XSControl_WorkSession::TransferWriter () const
|
||||
{
|
||||
return theTransferWrite;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : MapWriter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Transfer_FinderProcess) XSControl_WorkSession::MapWriter () const
|
||||
{
|
||||
return theTransferWrite->FinderProcess();
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SetMapWriter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean XSControl_WorkSession::SetMapWriter
|
||||
(const Handle(Transfer_FinderProcess)& FP)
|
||||
{
|
||||
if ( FP.IsNull()) return Standard_False;
|
||||
theTransferWrite->SetFinderProcess (FP);
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SetModeWriteShape
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void XSControl_WorkSession::SetModeWriteShape(const Standard_Integer mode)
|
||||
{
|
||||
theTransferWrite->SetTransferMode(mode);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : ModeWriteShape
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer XSControl_WorkSession::ModeWriteShape () const
|
||||
{
|
||||
return theTransferWrite->TransferMode();
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : TransferWriteShape
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
IFSelect_ReturnStatus XSControl_WorkSession::TransferWriteShape
|
||||
(const TopoDS_Shape& shape, const Standard_Boolean compgraph)
|
||||
IFSelect_ReturnStatus XSControl_WorkSession::TransferWriteShape (const TopoDS_Shape& shape, const Standard_Boolean compgraph)
|
||||
{
|
||||
IFSelect_ReturnStatus status;
|
||||
if (theController.IsNull()) return IFSelect_RetError;
|
||||
Handle(Interface_InterfaceModel) model = Model();
|
||||
if (myController.IsNull()) return IFSelect_RetError;
|
||||
const Handle(Interface_InterfaceModel) &model = Model();
|
||||
if (model.IsNull()) return IFSelect_RetVoid;
|
||||
|
||||
status = theTransferWrite->TransferWriteShape (model,shape);
|
||||
status = myTransferWriter->TransferWriteShape (model,shape);
|
||||
// qui s occupe de tout, try/catch inclus
|
||||
|
||||
//skl insert param compgraph for XDE writing 10.12.2003
|
||||
@@ -598,29 +462,7 @@ IFSelect_ReturnStatus XSControl_WorkSession::TransferWriteShape
|
||||
|
||||
Interface_CheckIterator XSControl_WorkSession::TransferWriteCheckList () const
|
||||
{
|
||||
return theTransferWrite->ResultCheckList (Model());
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Vars
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(XSControl_Vars) XSControl_WorkSession::Vars () const
|
||||
{
|
||||
return theVars;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SetVars
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void XSControl_WorkSession::SetVars (const Handle(XSControl_Vars)& newvars)
|
||||
{
|
||||
theVars = newvars;
|
||||
return myTransferWriter->ResultCheckList (Model());
|
||||
}
|
||||
|
||||
|
||||
@@ -631,7 +473,7 @@ void XSControl_WorkSession::SetVars (const Handle(XSControl_Vars)& newvars)
|
||||
|
||||
void XSControl_WorkSession::ClearBinders()
|
||||
{
|
||||
Handle(Transfer_FinderProcess) FP = theTransferWrite->FinderProcess();
|
||||
const Handle(Transfer_FinderProcess) &FP = myTransferWriter->FinderProcess();
|
||||
//Due to big number of chains of binders it is necessary to
|
||||
//collect head binders of each chain in the sequence
|
||||
TColStd_SequenceOfTransient aSeqBnd;
|
||||
@@ -665,16 +507,3 @@ void XSControl_WorkSession::ClearBinders()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Destroy
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void XSControl_WorkSession::Destroy()
|
||||
{
|
||||
ClearBinders();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -20,14 +20,11 @@
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <IFSelect_WorkSession.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_CString.hxx>
|
||||
#include <IFSelect_ReturnStatus.hxx>
|
||||
#include <XSControl_TransferWriter.hxx>
|
||||
class XSControl_Controller;
|
||||
class XSControl_TransferReader;
|
||||
class XSControl_TransferWriter;
|
||||
class Dico_DictionaryOfTransient;
|
||||
class XSControl_Vars;
|
||||
class Message_Messenger;
|
||||
@@ -52,58 +49,48 @@ DEFINE_STANDARD_HANDLE(XSControl_WorkSession, IFSelect_WorkSession)
|
||||
//! Each item is accessed by a Name
|
||||
class XSControl_WorkSession : public IFSelect_WorkSession
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
public:
|
||||
|
||||
Standard_EXPORT XSControl_WorkSession();
|
||||
|
||||
~XSControl_WorkSession()
|
||||
{ ClearBinders(); }
|
||||
|
||||
//! In addition to basic ClearData, clears Transfer and Management
|
||||
//! for interactive use, for mode = 0,1,2 and over 4
|
||||
//! Plus : mode = 5 to clear Transfers (both ways) only
|
||||
//! mode = 6 to clear enforced results
|
||||
//! mode = 7 to clear transfers, results
|
||||
Standard_EXPORT virtual void ClearData (const Standard_Integer mode) Standard_OVERRIDE;
|
||||
Standard_EXPORT virtual void ClearData (const Standard_Integer theMode) Standard_OVERRIDE;
|
||||
|
||||
//! Selects a Norm defined by its name.
|
||||
//! A Norm is described and handled by a Controller
|
||||
//! Returns True if done, False if <normname> is unknown
|
||||
//!
|
||||
//! A Profile may be set too. If no Profile is provided, the
|
||||
//! current Profile for this Norm is taken
|
||||
//! If the asked Profile is not defined for this Norm, it remains
|
||||
//! in current Profile, returned value is True
|
||||
Standard_EXPORT Standard_Boolean SelectNorm (const Standard_CString normname, const Standard_CString profile = "");
|
||||
|
||||
//! Sets a Profile as current for the current Norm
|
||||
//! Returns True if done, False if <profile> is unknown for this norm
|
||||
//!
|
||||
//! For more infos on Profile, query the Profile of the Controller
|
||||
Standard_EXPORT Standard_Boolean SelectProfile (const Standard_CString profile);
|
||||
//! The current Profile for this Norm is taken.
|
||||
Standard_EXPORT Standard_Boolean SelectNorm (const Standard_CString theNormName);
|
||||
|
||||
//! Selects a Norm defined by its Controller itself
|
||||
Standard_EXPORT void SetController (const Handle(XSControl_Controller)& ctl);
|
||||
|
||||
//! This method is called once a new norm has been successfully
|
||||
//! selected. It can be redefined, default does nothing
|
||||
Standard_EXPORT virtual void AdaptNorm();
|
||||
Standard_EXPORT void SetController (const Handle(XSControl_Controller)& theCtl);
|
||||
|
||||
//! Returns the name of the last Selected Norm. If none is
|
||||
//! defined, returns an empty string
|
||||
//! By default, returns the complete name of the norm
|
||||
//! If <rsc> is True, returns the short name used for resource
|
||||
Standard_EXPORT Standard_CString SelectedNorm (const Standard_Boolean rsc = Standard_False) const;
|
||||
Standard_EXPORT Standard_CString SelectedNorm (const Standard_Boolean theRsc = Standard_False) const;
|
||||
|
||||
//! Returns the norm controller itself
|
||||
Standard_EXPORT Handle(XSControl_Controller) NormAdaptor() const;
|
||||
const Handle(XSControl_Controller) & NormAdaptor() const
|
||||
{ return myController; }
|
||||
|
||||
//! Returns the current Context List, Null if not defined
|
||||
//! The Context is given to the TransientProcess for TransferRead
|
||||
Standard_EXPORT Handle(Dico_DictionaryOfTransient) Context() const;
|
||||
const Handle(Dico_DictionaryOfTransient) & Context() const
|
||||
{ return myContext; }
|
||||
|
||||
//! Sets the current Context List, as a whole
|
||||
//! Sets it to the TransferReader
|
||||
Standard_EXPORT void SetAllContext (const Handle(Dico_DictionaryOfTransient)& context);
|
||||
Standard_EXPORT void SetAllContext (const Handle(Dico_DictionaryOfTransient)& theContext);
|
||||
|
||||
//! Clears the whole current Context (nullifies it)
|
||||
Standard_EXPORT void ClearContext();
|
||||
@@ -112,7 +99,7 @@ public:
|
||||
//! the Mapped n0 <num>, from MapWriter if <wri> is True, or
|
||||
//! from MapReader if <wri> is False
|
||||
//! Returns True when done, False else (i.e. num out of range)
|
||||
Standard_EXPORT Standard_Boolean PrintTransferStatus (const Standard_Integer num, const Standard_Boolean wri, const Handle(Message_Messenger)& S) const;
|
||||
Standard_EXPORT Standard_Boolean PrintTransferStatus (const Standard_Integer theNum, const Standard_Boolean theWri, const Handle(Message_Messenger)& theS) const;
|
||||
|
||||
//! Sets a Transfer Reader, by internal ways, according mode :
|
||||
//! 0 recreates it clear, 1 clears it (does not recreate)
|
||||
@@ -120,22 +107,20 @@ public:
|
||||
//! 3 aligns final Results from Roots of TransientProcess
|
||||
//! 4 begins a new transfer (by BeginTransfer)
|
||||
//! 5 recreates TransferReader then begins a new transfer
|
||||
Standard_EXPORT void InitTransferReader (const Standard_Integer mode);
|
||||
Standard_EXPORT void InitTransferReader (const Standard_Integer theMode);
|
||||
|
||||
//! Sets a Transfer Reader, which manages transfers on reading
|
||||
Standard_EXPORT void SetTransferReader (const Handle(XSControl_TransferReader)& TR);
|
||||
Standard_EXPORT void SetTransferReader (const Handle(XSControl_TransferReader)& theTR);
|
||||
|
||||
//! Returns the Transfer Reader, Null if not set
|
||||
Standard_EXPORT Handle(XSControl_TransferReader) TransferReader() const;
|
||||
|
||||
//! Returns the TransientProcess(internal data for TransferReader)
|
||||
Standard_EXPORT Handle(Transfer_TransientProcess) MapReader() const;
|
||||
const Handle(XSControl_TransferReader) & TransferReader () const
|
||||
{ return myTransferReader; }
|
||||
|
||||
//! Changes the Map Reader, i.e. considers that the new one
|
||||
//! defines the relevant read results (forgets the former ones)
|
||||
//! Returns True when done, False in case of bad definition, i.e.
|
||||
//! if Model from TP differs from that of Session
|
||||
Standard_EXPORT Standard_Boolean SetMapReader (const Handle(Transfer_TransientProcess)& TP);
|
||||
Standard_EXPORT Standard_Boolean SetMapReader (const Handle(Transfer_TransientProcess)& theTP);
|
||||
|
||||
//! Returns the result attached to a starting entity
|
||||
//! If <mode> = 0, returns Final Result
|
||||
@@ -146,7 +131,7 @@ public:
|
||||
//! <mode> = 10,11,12 idem but returns the Binder itself
|
||||
//! (if it is not, e.g. Shape, returns the Binder)
|
||||
//! <mode> = 20, returns the ResultFromModel
|
||||
Standard_EXPORT Handle(Standard_Transient) Result (const Handle(Standard_Transient)& ent, const Standard_Integer mode) const;
|
||||
Standard_EXPORT Handle(Standard_Transient) Result (const Handle(Standard_Transient)& theEnt, const Standard_Integer theMode) const;
|
||||
|
||||
//! Commands the transfer of, either one entity, or a list
|
||||
//! I.E. calls the TransferReader after having analysed <ents>
|
||||
@@ -156,7 +141,7 @@ public:
|
||||
//! - <ents> a HSequenceOfTransient : this list
|
||||
//! - <ents> the Model : in this specific case, all the roots,
|
||||
//! with no cumulation of former transfers (TransferReadRoots)
|
||||
Standard_EXPORT Standard_Integer TransferReadOne (const Handle(Standard_Transient)& ents);
|
||||
Standard_EXPORT Standard_Integer TransferReadOne (const Handle(Standard_Transient)& theEnts);
|
||||
|
||||
//! Commands the transfer of all the root entities of the model
|
||||
//! i.e. calls TransferRoot from the TransferReader with the Graph
|
||||
@@ -169,29 +154,24 @@ public:
|
||||
Standard_EXPORT Handle(Interface_InterfaceModel) NewModel();
|
||||
|
||||
//! Returns the Transfer Reader, Null if not set
|
||||
Standard_EXPORT Handle(XSControl_TransferWriter) TransferWriter() const;
|
||||
|
||||
//! Returns the FinderProcess (internal data for TransferWriter)
|
||||
Standard_EXPORT Handle(Transfer_FinderProcess) MapWriter() const;
|
||||
const Handle(XSControl_TransferWriter) & TransferWriter() const
|
||||
{ return myTransferWriter; }
|
||||
|
||||
//! Changes the Map Reader, i.e. considers that the new one
|
||||
//! defines the relevant read results (forgets the former ones)
|
||||
//! Returns True when done, False if <FP> is Null
|
||||
Standard_EXPORT Standard_Boolean SetMapWriter (const Handle(Transfer_FinderProcess)& FP);
|
||||
|
||||
//! Sets a mode to transfer Shapes from CasCade to entities of the
|
||||
//! current norm, which interprets it (see various Controllers)
|
||||
//! This call form could be later replaced by a more general one
|
||||
Standard_EXPORT void SetModeWriteShape (const Standard_Integer mode);
|
||||
|
||||
//! Records the current Mode to Write Shapes
|
||||
Standard_EXPORT Standard_Integer ModeWriteShape() const;
|
||||
Standard_Boolean SetMapWriter (const Handle(Transfer_FinderProcess)& theFP)
|
||||
{
|
||||
if (theFP.IsNull()) return Standard_False;
|
||||
myTransferWriter->SetFinderProcess(theFP);
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
//! Transfers a Shape from CasCade to a model of current norm,
|
||||
//! according to the last call to SetModeWriteShape
|
||||
//! Returns status :Done if OK, Fail if error during transfer,
|
||||
//! Error if transfer badly initialised
|
||||
Standard_EXPORT IFSelect_ReturnStatus TransferWriteShape (const TopoDS_Shape& shape, const Standard_Boolean compgraph = Standard_True);
|
||||
Standard_EXPORT IFSelect_ReturnStatus TransferWriteShape (const TopoDS_Shape& theShape, const Standard_Boolean theCompGraph = Standard_True);
|
||||
|
||||
//! Returns the check-list of last transfer (write)
|
||||
//! It is recorded in the FinderProcess, but it must be bound with
|
||||
@@ -199,45 +179,24 @@ public:
|
||||
//! with original objects (in fact, their mappers)
|
||||
Standard_EXPORT Interface_CheckIterator TransferWriteCheckList() const;
|
||||
|
||||
Standard_EXPORT Handle(XSControl_Vars) Vars() const;
|
||||
const Handle(XSControl_Vars) & Vars() const
|
||||
{ return myVars; }
|
||||
|
||||
Standard_EXPORT void SetVars (const Handle(XSControl_Vars)& newvars);
|
||||
void SetVars (const Handle(XSControl_Vars)& theVars)
|
||||
{ myVars = theVars; }
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(XSControl_WorkSession,IFSelect_WorkSession)
|
||||
|
||||
private:
|
||||
|
||||
//! Clears binders
|
||||
Standard_EXPORT void ClearBinders();
|
||||
|
||||
Standard_EXPORT void Destroy();
|
||||
~XSControl_WorkSession()
|
||||
{
|
||||
Destroy();
|
||||
}
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(XSControl_WorkSession,IFSelect_WorkSession)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Handle(XSControl_Controller) theController;
|
||||
Handle(XSControl_TransferReader) theTransferRead;
|
||||
Handle(XSControl_TransferWriter) theTransferWrite;
|
||||
Handle(Dico_DictionaryOfTransient) theContext;
|
||||
Standard_Integer theModeWriteShape;
|
||||
Handle(XSControl_Vars) theVars;
|
||||
|
||||
|
||||
Handle(XSControl_Controller) myController;
|
||||
Handle(XSControl_TransferReader) myTransferReader;
|
||||
Handle(XSControl_TransferWriter) myTransferWriter;
|
||||
Handle(Dico_DictionaryOfTransient) myContext;
|
||||
Handle(XSControl_Vars) myVars;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _XSControl_WorkSession_HeaderFile
|
||||
|
||||
@@ -68,7 +68,7 @@ XSControl_Writer::XSControl_Writer ()
|
||||
IFSelect_ReturnStatus XSControl_Writer::TransferShape
|
||||
(const TopoDS_Shape& sh, const Standard_Integer mode)
|
||||
{
|
||||
thesession->SetModeWriteShape (mode);
|
||||
thesession->TransferWriter()->SetTransferMode (mode);
|
||||
return thesession->TransferWriteShape (sh);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user