mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03: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:
@@ -68,18 +68,14 @@
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(IGESControl_Controller,XSControl_Controller)
|
||||
|
||||
//szv#4:S4163:12Mar99 never referenced
|
||||
//static const Standard_CString thelong = "IGES";
|
||||
//static const Standard_CString theshort = "iges";
|
||||
//=======================================================================
|
||||
//function : IGESControl_Controller
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
IGESControl_Controller::IGESControl_Controller (const Standard_Boolean mod)
|
||||
//JR/Hp
|
||||
: XSControl_Controller ((Standard_CString ) (mod ? "FNES" : "IGES") , (Standard_CString ) (mod ? "fnes" : "iges") ) ,
|
||||
// : XSControl_Controller ( (mod ? "FNES" : "iges") , (mod ? "fnes" : "iges") ) ,
|
||||
themode (mod)
|
||||
: XSControl_Controller ((Standard_CString ) (mod ? "FNES" : "IGES") , (Standard_CString ) (mod ? "fnes" : "iges") ),
|
||||
themode (mod)
|
||||
{
|
||||
static Standard_Boolean init = Standard_False;
|
||||
if (!init) {
|
||||
@@ -87,54 +83,48 @@ IGESControl_Controller::IGESControl_Controller (const Standard_Boolean mod)
|
||||
IGESAppli::Init();
|
||||
init = Standard_True;
|
||||
}
|
||||
AddSessionItem (new IGESSelect_RemoveCurves(Standard_True) ,"iges-remove-pcurves");
|
||||
AddSessionItem (new IGESSelect_RemoveCurves(Standard_True) ,"iges-remove-pcurves");
|
||||
AddSessionItem (new IGESSelect_RemoveCurves(Standard_False),"iges-remove-curves-3d");
|
||||
AddSessionItem (new IGESSelect_SetLabel (0,Standard_True) ,"iges-clear-label");
|
||||
AddSessionItem (new IGESSelect_SetLabel (1,Standard_False),"iges-set-label-dnum");
|
||||
|
||||
AddSessionItem (new IGESSelect_AutoCorrect,"iges-auto-correct","send");
|
||||
AddSessionItem (new IGESSelect_ComputeStatus,"iges-compute-status","send");
|
||||
AddSessionItem (new IGESSelect_AutoCorrect,"iges-auto-correct",Standard_True);
|
||||
AddSessionItem (new IGESSelect_ComputeStatus,"iges-compute-status",Standard_True);
|
||||
|
||||
Handle(IGESSelect_FloatFormat) flf = new IGESSelect_FloatFormat;
|
||||
flf->SetDefault (12);
|
||||
AddSessionItem (flf,"iges-float-digits-12","send");
|
||||
AddSessionItem (flf,"iges-float-digits-12",Standard_True);
|
||||
|
||||
// -- Sender Product Identification -- (pas un statique ...)
|
||||
// -- Sender Product Identification -- (pas un statique ...)
|
||||
Handle(IGESSelect_SetGlobalParameter) set3 = new IGESSelect_SetGlobalParameter(3);
|
||||
//#58 rln Handle(TCollection_HAsciiString) pa3 = new TCollection_HAsciiString("MDTV X-STEP");
|
||||
Handle(TCollection_HAsciiString) pa3 =
|
||||
Interface_Static::Static("write.iges.header.product")->HStringValue();
|
||||
Handle(TCollection_HAsciiString) pa3 = Interface_Static::Static("write.iges.header.product")->HStringValue();
|
||||
set3->SetValue(pa3);
|
||||
AddSessionItem (pa3, "iges-header-val-sender");
|
||||
AddSessionItem (set3,"iges-header-set-sender","send");
|
||||
AddSessionItem (set3,"iges-header-set-sender",Standard_True);
|
||||
|
||||
AddSessionItem (new IGESSelect_UpdateFileName,"iges-update-file-name","send");
|
||||
AddSessionItem (new IGESSelect_UpdateFileName,"iges-update-file-name",Standard_True);
|
||||
|
||||
// -- Receiver -- Acces par Static, ajustable
|
||||
// -- Receiver -- Acces par Static, ajustable
|
||||
Handle(IGESSelect_SetGlobalParameter) set12 = new IGESSelect_SetGlobalParameter(12);
|
||||
// Handle(TCollection_HAsciiString) pa12 = new TCollection_HAsciiString("Unknown");
|
||||
Handle(TCollection_HAsciiString) pa12 =
|
||||
Interface_Static::Static("write.iges.header.receiver")->HStringValue();
|
||||
Handle(TCollection_HAsciiString) pa12 = Interface_Static::Static("write.iges.header.receiver")->HStringValue();
|
||||
set12->SetValue(pa12);
|
||||
AddSessionItem (pa12, "iges-header-val-receiver");
|
||||
AddSessionItem (set12,"iges-header-set-receiver","send");
|
||||
AddSessionItem (set12,"iges-header-set-receiver",Standard_True);
|
||||
|
||||
// -- Auteur -- acces par Static (demarre par whoami), ajustable
|
||||
// -- Auteur -- acces par Static (demarre par whoami), ajustable
|
||||
Handle(IGESSelect_SetGlobalParameter) set21 = new IGESSelect_SetGlobalParameter(21);
|
||||
// Handle(TCollection_HAsciiString) pa21 = new TCollection_HAsciiString("Unknown");
|
||||
Handle(TCollection_HAsciiString) pa21 =
|
||||
Interface_Static::Static("write.iges.header.author")->HStringValue();
|
||||
Handle(TCollection_HAsciiString) pa21 = Interface_Static::Static("write.iges.header.author")->HStringValue();
|
||||
set21->SetValue(pa21);
|
||||
AddSessionItem (pa21, "iges-header-val-author");
|
||||
AddSessionItem (set21,"iges-header-set-author","send");
|
||||
AddSessionItem (set21,"iges-header-set-author",Standard_True);
|
||||
|
||||
// -- Compagnie (de l auteur) -- acces par Static, ajustable
|
||||
// -- Compagnie (de l auteur) -- acces par Static, ajustable
|
||||
Handle(IGESSelect_SetGlobalParameter) set22 = new IGESSelect_SetGlobalParameter(22);
|
||||
// Handle(TCollection_HAsciiString) pa22 = new TCollection_HAsciiString("MATRA-DATAVISION");
|
||||
Handle(TCollection_HAsciiString) pa22 =
|
||||
Interface_Static::Static("write.iges.header.company")->HStringValue();
|
||||
Handle(TCollection_HAsciiString) pa22 = Interface_Static::Static("write.iges.header.company")->HStringValue();
|
||||
set22->SetValue(pa22);
|
||||
AddSessionItem (pa22, "iges-header-val-company");
|
||||
AddSessionItem (set22,"iges-header-set-company","send");
|
||||
AddSessionItem (set22,"iges-header-set-company",Standard_True);
|
||||
|
||||
// -- STATICS
|
||||
|
||||
TraceStatic ("read.iges.bspline.approxd1.mode",5);
|
||||
@@ -146,56 +136,55 @@ IGESControl_Controller::IGESControl_Controller (const Standard_Boolean mod)
|
||||
TraceStatic ("write.iges.unit",6);
|
||||
TraceStatic ("write.iges.brep.mode",6);
|
||||
|
||||
theAdaptorLibrary = new IGESSelect_WorkLibrary(themode);
|
||||
theAdaptorProtocol = IGESSelect_WorkLibrary::DefineProtocol();
|
||||
myAdaptorLibrary = new IGESSelect_WorkLibrary(themode);
|
||||
myAdaptorProtocol = IGESSelect_WorkLibrary::DefineProtocol();
|
||||
|
||||
Handle(IGESToBRep_Actor) anactiges = new IGESToBRep_Actor;
|
||||
anactiges->SetContinuity(0);
|
||||
theAdaptorRead = anactiges;
|
||||
myAdaptorRead = anactiges;
|
||||
|
||||
myAdaptorWrite = new IGESControl_ActorWrite;
|
||||
|
||||
theAdaptorWrite = new IGESControl_ActorWrite;
|
||||
SetModeWrite (0,1);
|
||||
SetModeWriteHelp (0,"Faces");
|
||||
SetModeWriteHelp (1,"BRep");
|
||||
}
|
||||
|
||||
void IGESControl_Controller::Customise(Handle(XSControl_WorkSession)& WS)
|
||||
{
|
||||
XSControl_Controller::Customise(WS);
|
||||
|
||||
// --- SELECTIONS, SIGNATURES, COMPTEURS, EDITEURS
|
||||
// -- BypassGroup / xst-model-roots
|
||||
|
||||
// --- SELECTIONS, SIGNATURES, COMPTEURS, EDITEURS
|
||||
// -- BypassGroup / xst-model-roots
|
||||
|
||||
|
||||
//DeclareAndCast(IFSelect_Selection,xma,SessionItem("xst-model-all"));
|
||||
// Should be already set by the above call to Customise
|
||||
Handle(IFSelect_SelectModelEntities) xma;
|
||||
Handle(Standard_Transient) xma1 = WS->NamedItem("xst-model-all");
|
||||
if(xma1.IsNull()) xma = new IFSelect_SelectModelEntities;
|
||||
if (xma1.IsNull()) xma = new IFSelect_SelectModelEntities;
|
||||
else {
|
||||
xma =Handle(IFSelect_SelectModelEntities)::DownCast(xma1);
|
||||
xma = Handle(IFSelect_SelectModelEntities)::DownCast(xma1);
|
||||
WS->AddNamedItem ("xst-model-all",xma);
|
||||
}
|
||||
|
||||
//DeclareAndCast(IFSelect_Selection,xmr,SessionItem("xst-model-roots"));
|
||||
Handle(IFSelect_SelectModelRoots) xmr;
|
||||
Handle(IFSelect_SelectModelRoots) xmr;
|
||||
Handle(Standard_Transient) xmr1 = WS->NamedItem("xst-model-roots");
|
||||
if(!xmr1.IsNull())
|
||||
if (!xmr1.IsNull())
|
||||
xmr = Handle(IFSelect_SelectModelRoots)::DownCast(xmr1);
|
||||
else {
|
||||
xmr = new IFSelect_SelectModelRoots;
|
||||
WS->AddNamedItem ("xst-model-roots",xmr);
|
||||
}
|
||||
// DeclareAndCast(IFSelect_Selection,xtr,SessionItem("xst-transferrable-roots"));
|
||||
|
||||
Handle(XSControl_SelectForTransfer) xtr;
|
||||
Handle(Standard_Transient) xtr1 = WS->NamedItem("xst-transferrable-roots");
|
||||
if(!xtr1.IsNull())
|
||||
if (!xtr1.IsNull())
|
||||
xtr = Handle(XSControl_SelectForTransfer)::DownCast(xtr1);
|
||||
//st1->SetInput (slr);
|
||||
else {
|
||||
xtr= new XSControl_SelectForTransfer;
|
||||
xtr = new XSControl_SelectForTransfer;
|
||||
xtr->SetReader (WS->TransferReader());
|
||||
WS->AddNamedItem ("xst-transferrable-roots",xtr);
|
||||
}
|
||||
|
||||
if (!xmr.IsNull()) {
|
||||
Handle(IGESSelect_SelectVisibleStatus) visa = new IGESSelect_SelectVisibleStatus;
|
||||
visa->SetInput(xmr);
|
||||
@@ -300,10 +289,9 @@ void IGESControl_Controller::Customise(Handle(XSControl_WorkSession)& WS)
|
||||
Handle(IFSelect_EditForm) eddirpf = eddirp->Form(Standard_False);
|
||||
WS->AddNamedItem ("iges-dir-part",eddirpf);
|
||||
|
||||
theSignType = typnam;
|
||||
//szv:mySignType = typnam;
|
||||
WS->SetSignType( typnam );
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -312,9 +300,9 @@ void IGESControl_Controller::Customise(Handle(XSControl_WorkSession)& WS)
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Interface_InterfaceModel) IGESControl_Controller::NewModel () const
|
||||
Handle(Interface_InterfaceModel) IGESControl_Controller::NewModel () const
|
||||
{
|
||||
// On prend un modele qu on prepare avec les statiques enregistres
|
||||
// On prend un modele qu on prepare avec les statiques enregistres
|
||||
DeclareAndCast(IGESData_IGESModel,igm,Interface_InterfaceModel::Template("iges"));
|
||||
IGESData_GlobalSection GS = igm->GlobalSection();
|
||||
|
||||
@@ -332,21 +320,17 @@ void IGESControl_Controller::Customise(Handle(XSControl_WorkSession)& WS)
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Transfer_ActorOfTransientProcess) IGESControl_Controller::ActorRead
|
||||
(const Handle(Interface_InterfaceModel)& model) const
|
||||
Handle(Transfer_ActorOfTransientProcess) IGESControl_Controller::ActorRead (const Handle(Interface_InterfaceModel)& model) const
|
||||
{
|
||||
DeclareAndCast(IGESToBRep_Actor,anactiges,theAdaptorRead);
|
||||
if (anactiges.IsNull()) return theAdaptorRead;
|
||||
//sln 14.01.2002 OCC51 : verifying whether entry model is IGESDatat_IGESModel,
|
||||
// if this condition is false new model is created
|
||||
Handle(Interface_InterfaceModel) aModel;
|
||||
if(model->IsKind(STANDARD_TYPE(IGESData_IGESModel)))
|
||||
aModel = model;
|
||||
else
|
||||
aModel = NewModel();
|
||||
anactiges->SetModel(GetCasted(IGESData_IGESModel,aModel));
|
||||
anactiges->SetContinuity(Interface_Static::IVal("read.iges.bspline.continuity"));
|
||||
return anactiges;
|
||||
DeclareAndCast(IGESToBRep_Actor,anactiges,myAdaptorRead);
|
||||
if (!anactiges.IsNull()) {
|
||||
// sln 14.01.2002 OCC51 : verifying whether entry model is IGESDatat_IGESModel,
|
||||
// if this condition is false new model is created
|
||||
Handle(Interface_InterfaceModel) aModel = (model->IsKind(STANDARD_TYPE(IGESData_IGESModel))? model : NewModel());
|
||||
anactiges->SetModel(GetCasted(IGESData_IGESModel,aModel));
|
||||
anactiges->SetContinuity(Interface_Static::IVal("read.iges.bspline.continuity"));
|
||||
}
|
||||
return myAdaptorRead;
|
||||
}
|
||||
|
||||
// #### TRANSFERT (ECRITURE SHAPE) ####
|
||||
@@ -357,10 +341,10 @@ void IGESControl_Controller::Customise(Handle(XSControl_WorkSession)& WS)
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
IFSelect_ReturnStatus IGESControl_Controller::TransferWriteShape (const TopoDS_Shape& shape,
|
||||
const Handle(Transfer_FinderProcess)& FP,
|
||||
const Handle(Interface_InterfaceModel)& model,
|
||||
const Standard_Integer modetrans) const
|
||||
IFSelect_ReturnStatus IGESControl_Controller::TransferWriteShape (const TopoDS_Shape& shape,
|
||||
const Handle(Transfer_FinderProcess)& FP,
|
||||
const Handle(Interface_InterfaceModel)& model,
|
||||
const Standard_Integer modetrans) const
|
||||
{
|
||||
return XSControl_Controller::TransferWriteShape (shape,FP,model,modetrans);
|
||||
}
|
||||
@@ -370,7 +354,7 @@ void IGESControl_Controller::Customise(Handle(XSControl_WorkSession)& WS)
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean IGESControl_Controller::Init ()
|
||||
Standard_Boolean IGESControl_Controller::Init ()
|
||||
{
|
||||
static Standard_Boolean inic = Standard_False;
|
||||
if (!inic) {
|
||||
|
@@ -143,9 +143,9 @@ void IGESControl_Reader::PrintTransferInfo
|
||||
(const IFSelect_PrintFail failsonly, const IFSelect_PrintCount mode) const
|
||||
{
|
||||
Standard_Integer nbWarn = 0, nbFail= 0, nbEntities =0, nbRoots = 0, nbResults = 0;
|
||||
Handle(Transfer_TransientProcess) TP = WS()->MapReader();
|
||||
const Handle(Transfer_TransientProcess) &TP = WS()->TransferReader()->TransientProcess();
|
||||
Handle(Message_Messenger) TF = TP->Messenger();
|
||||
Handle(Interface_InterfaceModel) model = TP->Model();
|
||||
const Handle(Interface_InterfaceModel) &model = TP->Model();
|
||||
if (! model.IsNull()) {
|
||||
nbEntities = model->NbEntities();
|
||||
nbRoots = TP->NbRoots();
|
||||
|
@@ -47,64 +47,47 @@
|
||||
#include <Transfer_FinderProcess.hxx>
|
||||
#include <XSAlgo.hxx>
|
||||
#include <XSAlgo_AlgoContainer.hxx>
|
||||
#include <XSControl_TransferWriter.hxx>
|
||||
|
||||
#include <errno.h>
|
||||
IGESControl_Writer::IGESControl_Writer ()
|
||||
: theTP (new Transfer_FinderProcess(10000)) ,
|
||||
thest (Standard_False)
|
||||
: myTP (new Transfer_FinderProcess(10000)) ,
|
||||
myIsComputed (Standard_False)
|
||||
{
|
||||
// faudrait aussi (?) prendre les parametres par defaut ... ?
|
||||
IGESControl_Controller::Init();
|
||||
thedit.Init(IGESSelect_WorkLibrary::DefineProtocol());
|
||||
thedit.SetUnitName(Interface_Static::CVal ("write.iges.unit"));
|
||||
thedit.ApplyUnit();
|
||||
thecr = Interface_Static::IVal ("write.iges.brep.mode");
|
||||
themod = thedit.Model();
|
||||
myEditor.Init(IGESSelect_WorkLibrary::DefineProtocol());
|
||||
myEditor.SetUnitName(Interface_Static::CVal ("write.iges.unit"));
|
||||
myEditor.ApplyUnit();
|
||||
myWriteMode = Interface_Static::IVal ("write.iges.brep.mode");
|
||||
myModel = myEditor.Model();
|
||||
}
|
||||
|
||||
IGESControl_Writer::IGESControl_Writer
|
||||
(const Standard_CString unit, const Standard_Integer modecr)
|
||||
: theTP (new Transfer_FinderProcess(10000)) ,
|
||||
thecr (modecr) , thest (Standard_False)
|
||||
: myTP (new Transfer_FinderProcess(10000)) ,
|
||||
myWriteMode (modecr) , myIsComputed (Standard_False)
|
||||
{
|
||||
// faudrait aussi (?) prendre les parametres par defaut ... ?
|
||||
IGESControl_Controller::Init();
|
||||
thedit.Init(IGESSelect_WorkLibrary::DefineProtocol());
|
||||
thedit.SetUnitName(unit);
|
||||
thedit.ApplyUnit();
|
||||
themod = thedit.Model();
|
||||
myEditor.Init(IGESSelect_WorkLibrary::DefineProtocol());
|
||||
myEditor.SetUnitName(unit);
|
||||
myEditor.ApplyUnit();
|
||||
myModel = myEditor.Model();
|
||||
}
|
||||
|
||||
IGESControl_Writer::IGESControl_Writer
|
||||
(const Handle(IGESData_IGESModel)& model, const Standard_Integer modecr)
|
||||
: theTP (new Transfer_FinderProcess(10000)) ,
|
||||
themod (model) ,
|
||||
thedit (model,IGESSelect_WorkLibrary::DefineProtocol()) ,
|
||||
thecr (modecr) , thest (Standard_False) { }
|
||||
|
||||
Handle(IGESData_IGESModel) IGESControl_Writer::Model () const
|
||||
{
|
||||
return themod;
|
||||
}
|
||||
|
||||
Handle(Transfer_FinderProcess) IGESControl_Writer::TransferProcess () const
|
||||
{
|
||||
return theTP;
|
||||
}
|
||||
|
||||
void IGESControl_Writer::SetTransferProcess
|
||||
(const Handle(Transfer_FinderProcess)& TP)
|
||||
{
|
||||
theTP = TP;
|
||||
}
|
||||
: myTP (new Transfer_FinderProcess(10000)) ,
|
||||
myModel (model) ,
|
||||
myEditor (model,IGESSelect_WorkLibrary::DefineProtocol()) ,
|
||||
myWriteMode (modecr) , myIsComputed (Standard_False) { }
|
||||
|
||||
Standard_Boolean IGESControl_Writer::AddShape (const TopoDS_Shape& theShape)
|
||||
{
|
||||
if (theShape.IsNull()) return Standard_False;
|
||||
|
||||
// for progress indication
|
||||
Handle(Message_ProgressIndicator) progress = theTP->GetProgress();
|
||||
Handle(Message_ProgressIndicator) progress = myTP->GetProgress();
|
||||
if ( ! progress.IsNull() ) {
|
||||
Standard_Integer nbfaces=0;
|
||||
for( TopExp_Explorer exp(theShape,TopAbs_FACE); exp.More(); exp.Next() )
|
||||
@@ -123,25 +106,23 @@ Standard_Boolean IGESControl_Writer::AddShape (const TopoDS_Shape& theShape)
|
||||
"write.iges.sequence", info,
|
||||
progress );
|
||||
// modified by NIZHNY-EAP Tue Aug 29 11:17:01 2000 ___END___
|
||||
Handle(IGESData_IGESEntity) ent;
|
||||
BRepToIGES_BREntity B0; B0.SetTransferProcess(theTP); B0.SetModel(themod);
|
||||
BRepToIGESBRep_Entity B1; B1.SetTransferProcess(theTP); B1.SetModel(themod);
|
||||
if (thecr) ent = B1.TransferShape(Shape);
|
||||
else ent = B0.TransferShape(Shape);
|
||||
BRepToIGES_BREntity B0; B0.SetTransferProcess(myTP); B0.SetModel(myModel);
|
||||
BRepToIGESBRep_Entity B1; B1.SetTransferProcess(myTP); B1.SetModel(myModel);
|
||||
Handle(IGESData_IGESEntity) ent = myWriteMode? B1.TransferShape(Shape) : B0.TransferShape(Shape);
|
||||
|
||||
if(ent.IsNull())
|
||||
return Standard_False;
|
||||
// modified by NIZHNY-EAP Tue Aug 29 11:37:18 2000 ___BEGIN___
|
||||
XSAlgo::AlgoContainer()->MergeTransferInfo(theTP, info);
|
||||
XSAlgo::AlgoContainer()->MergeTransferInfo(myTP, info);
|
||||
// modified by NIZHNY-EAP Tue Aug 29 11:37:25 2000 ___END___
|
||||
|
||||
//22.10.98 gka BUC60080
|
||||
|
||||
Standard_Integer oldnb = themod->NbEntities();
|
||||
Standard_Integer oldnb = myModel->NbEntities();
|
||||
Standard_Boolean aent = AddEntity (ent);
|
||||
Standard_Integer newnb = themod->NbEntities();
|
||||
Standard_Integer newnb = myModel->NbEntities();
|
||||
|
||||
Standard_Real oldtol = themod->GlobalSection().Resolution(), newtol;
|
||||
Standard_Real oldtol = myModel->GlobalSection().Resolution(), newtol;
|
||||
|
||||
Standard_Integer tolmod = Interface_Static::IVal("write.precision.mode");
|
||||
if (tolmod == 2)
|
||||
@@ -165,7 +146,7 @@ Standard_Boolean IGESControl_Writer::AddShape (const TopoDS_Shape& theShape)
|
||||
}
|
||||
}
|
||||
|
||||
IGESData_GlobalSection gs = themod->GlobalSection();
|
||||
IGESData_GlobalSection gs = myModel->GlobalSection();
|
||||
gs.SetResolution (newtol / gs.UnitValue());//rln 28.12.98 CCI60005
|
||||
|
||||
//#34 22.10.98 rln BUC60081
|
||||
@@ -182,7 +163,7 @@ Standard_Boolean IGESControl_Writer::AddShape (const TopoDS_Shape& theShape)
|
||||
aZmin / gs.UnitValue()));
|
||||
}
|
||||
|
||||
themod->SetGlobalSection(gs);
|
||||
myModel->SetGlobalSection(gs);
|
||||
|
||||
return aent;
|
||||
}
|
||||
@@ -199,11 +180,11 @@ Standard_Boolean IGESControl_Writer::AddGeom (const Handle(Standard_Transient)&
|
||||
// quid de Point; Geom2d ?
|
||||
|
||||
// GeomToIGES_GeomPoint GP;
|
||||
GeomToIGES_GeomCurve GC; GC.SetModel(themod);
|
||||
GeomToIGES_GeomSurface GS; GS.SetModel(themod);
|
||||
GeomToIGES_GeomCurve GC; GC.SetModel(myModel);
|
||||
GeomToIGES_GeomSurface GS; GS.SetModel(myModel);
|
||||
|
||||
//#34 22.10.98 rln BUC60081
|
||||
IGESData_GlobalSection gs = themod->GlobalSection();
|
||||
IGESData_GlobalSection gs = myModel->GlobalSection();
|
||||
Bnd_Box box;
|
||||
|
||||
if (!Curve.IsNull()) {
|
||||
@@ -224,24 +205,25 @@ Standard_Boolean IGESControl_Writer::AddGeom (const Handle(Standard_Transient)&
|
||||
gs.MaxMaxCoords (gp_XYZ (aXmin / gs.UnitValue(),
|
||||
aYmin / gs.UnitValue(),
|
||||
aZmin / gs.UnitValue()));
|
||||
themod->SetGlobalSection(gs);
|
||||
myModel->SetGlobalSection(gs);
|
||||
return AddEntity (ent);
|
||||
}
|
||||
|
||||
Standard_Boolean IGESControl_Writer::AddEntity (const Handle(IGESData_IGESEntity)& ent)
|
||||
{
|
||||
if (ent.IsNull()) return Standard_False;
|
||||
themod->AddWithRefs(ent,IGESSelect_WorkLibrary::DefineProtocol());
|
||||
thest = Standard_False;
|
||||
myModel->AddWithRefs(ent,IGESSelect_WorkLibrary::DefineProtocol());
|
||||
myIsComputed = Standard_False;
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
void IGESControl_Writer::ComputeModel ()
|
||||
{
|
||||
if (thest) return;
|
||||
thedit.ComputeStatus();
|
||||
thedit.AutoCorrectModel();
|
||||
thest = Standard_True;
|
||||
if (!myIsComputed) {
|
||||
myEditor.ComputeStatus();
|
||||
myEditor.AutoCorrectModel();
|
||||
myIsComputed = Standard_True;
|
||||
}
|
||||
}
|
||||
|
||||
Standard_Boolean IGESControl_Writer::Write
|
||||
@@ -249,13 +231,13 @@ Standard_Boolean IGESControl_Writer::Write
|
||||
{
|
||||
if (!S) return Standard_False;
|
||||
ComputeModel();
|
||||
Standard_Integer nbEnt = themod->NbEntities();
|
||||
Standard_Integer nbEnt = myModel->NbEntities();
|
||||
#ifdef OCCT_DEBUG
|
||||
cout<<" IGES Write : "<<nbEnt<<" ent.s"<< flush;
|
||||
#endif
|
||||
if(!nbEnt)
|
||||
return Standard_False;
|
||||
IGESData_IGESWriter IW (themod);
|
||||
IGESData_IGESWriter IW (myModel);
|
||||
// ne pas oublier le mode fnes ... a transmettre a IW
|
||||
IW.SendModel (IGESSelect_WorkLibrary::DefineProtocol());
|
||||
#ifdef OCCT_DEBUG
|
||||
@@ -286,9 +268,3 @@ Standard_Boolean IGESControl_Writer::Write
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
void IGESControl_Writer::PrintStatsTransfer
|
||||
(const Standard_Integer what, const Standard_Integer mode) const
|
||||
{
|
||||
XSControl_TransferWriter::PrintStatsProcess (theTP,what,mode);
|
||||
}
|
||||
|
@@ -48,7 +48,6 @@ class IGESControl_Writer
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Creates a writer object with the
|
||||
//! default unit (millimeters) and write mode (Face).
|
||||
@@ -73,13 +72,16 @@ public:
|
||||
Standard_EXPORT IGESControl_Writer(const Handle(IGESData_IGESModel)& model, const Standard_Integer modecr = 0);
|
||||
|
||||
//! Returns the IGES model to be written in output.
|
||||
Standard_EXPORT Handle(IGESData_IGESModel) Model() const;
|
||||
|
||||
Standard_EXPORT Handle(Transfer_FinderProcess) TransferProcess() const;
|
||||
|
||||
const Handle(IGESData_IGESModel) & Model() const
|
||||
{ return myModel; }
|
||||
|
||||
const Handle(Transfer_FinderProcess) & TransferProcess() const
|
||||
{ return myTP; }
|
||||
|
||||
//! Returns/Sets the TransferProcess : it contains final results
|
||||
//! and if some, check messages
|
||||
Standard_EXPORT void SetTransferProcess (const Handle(Transfer_FinderProcess)& TP);
|
||||
void SetTransferProcess (const Handle(Transfer_FinderProcess)& TP)
|
||||
{ myTP = TP; }
|
||||
|
||||
//! Translates a Shape to IGES Entities and adds them to the model
|
||||
//! Returns True if done, False if Shape not suitable for IGES or null
|
||||
@@ -109,36 +111,14 @@ public:
|
||||
//! False if an error occurred (for instance,
|
||||
//! if the processor could not create the file).
|
||||
Standard_EXPORT Standard_Boolean Write (const Standard_CString file, const Standard_Boolean fnes = Standard_False);
|
||||
|
||||
//! Prints Statistics about Transfer
|
||||
Standard_EXPORT void PrintStatsTransfer (const Standard_Integer what, const Standard_Integer mode = 0) const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Handle(Transfer_FinderProcess) theTP;
|
||||
Handle(IGESData_IGESModel) themod;
|
||||
IGESData_BasicEditor thedit;
|
||||
Standard_Integer thecr;
|
||||
Standard_Boolean thest;
|
||||
|
||||
private:
|
||||
|
||||
Handle(Transfer_FinderProcess) myTP;
|
||||
Handle(IGESData_IGESModel) myModel;
|
||||
IGESData_BasicEditor myEditor;
|
||||
Standard_Integer myWriteMode;
|
||||
Standard_Boolean myIsComputed;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _IGESControl_Writer_HeaderFile
|
||||
|
Reference in New Issue
Block a user