mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-03 17:56:21 +03:00
Data Exchange - Schema missed during export #343
Refactor model creating to apply schema based on DE parameters. New model creating stage no more inject header info.
This commit is contained in:
parent
6c77143364
commit
10d1902820
@ -15,7 +15,6 @@
|
|||||||
// gka 05.04.99 S4136: parameters definitions changed
|
// gka 05.04.99 S4136: parameters definitions changed
|
||||||
|
|
||||||
#include <APIHeaderSection_EditHeader.hxx>
|
#include <APIHeaderSection_EditHeader.hxx>
|
||||||
#include <APIHeaderSection_MakeHeader.hxx>
|
|
||||||
#include <IFSelect_EditForm.hxx>
|
#include <IFSelect_EditForm.hxx>
|
||||||
#include <IFSelect_SelectModelRoots.hxx>
|
#include <IFSelect_SelectModelRoots.hxx>
|
||||||
#include <IFSelect_SelectSignature.hxx>
|
#include <IFSelect_SelectSignature.hxx>
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||||
// commercial license or contractual agreement.
|
// commercial license or contractual agreement.
|
||||||
|
|
||||||
|
#include <APIHeaderSection_MakeHeader.hxx>
|
||||||
#include <DE_ShapeFixParameters.hxx>
|
#include <DE_ShapeFixParameters.hxx>
|
||||||
#include <IFSelect_WorkLibrary.hxx>
|
#include <IFSelect_WorkLibrary.hxx>
|
||||||
#include <Interface_EntityIterator.hxx>
|
#include <Interface_EntityIterator.hxx>
|
||||||
@ -101,6 +102,8 @@ IFSelect_ReturnStatus STEPControl_Reader::ReadFile(const Standard_CString filena
|
|||||||
Handle(StepData_StepModel) aStepModel = new StepData_StepModel;
|
Handle(StepData_StepModel) aStepModel = new StepData_StepModel;
|
||||||
aStepModel->InternalParameters.InitFromStatic();
|
aStepModel->InternalParameters.InitFromStatic();
|
||||||
aStepModel->SetSourceCodePage(aStepModel->InternalParameters.ReadCodePage);
|
aStepModel->SetSourceCodePage(aStepModel->InternalParameters.ReadCodePage);
|
||||||
|
APIHeaderSection_MakeHeader aHeaderMaker;
|
||||||
|
aHeaderMaker.Apply(aStepModel);
|
||||||
IFSelect_ReturnStatus status = IFSelect_RetVoid;
|
IFSelect_ReturnStatus status = IFSelect_RetVoid;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -143,6 +146,8 @@ IFSelect_ReturnStatus STEPControl_Reader::ReadFile(const Standard_CString file
|
|||||||
Handle(StepData_StepModel) aStepModel = new StepData_StepModel;
|
Handle(StepData_StepModel) aStepModel = new StepData_StepModel;
|
||||||
aStepModel->InternalParameters = theParams;
|
aStepModel->InternalParameters = theParams;
|
||||||
aStepModel->SetSourceCodePage(aStepModel->InternalParameters.ReadCodePage);
|
aStepModel->SetSourceCodePage(aStepModel->InternalParameters.ReadCodePage);
|
||||||
|
APIHeaderSection_MakeHeader aHeaderMaker;
|
||||||
|
aHeaderMaker.Apply(aStepModel);
|
||||||
IFSelect_ReturnStatus status = IFSelect_RetVoid;
|
IFSelect_ReturnStatus status = IFSelect_RetVoid;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -185,6 +190,8 @@ IFSelect_ReturnStatus STEPControl_Reader::ReadStream(const Standard_CString theN
|
|||||||
Handle(StepData_StepModel) aStepModel = new StepData_StepModel;
|
Handle(StepData_StepModel) aStepModel = new StepData_StepModel;
|
||||||
aStepModel->InternalParameters.InitFromStatic();
|
aStepModel->InternalParameters.InitFromStatic();
|
||||||
aStepModel->SetSourceCodePage(aStepModel->InternalParameters.ReadCodePage);
|
aStepModel->SetSourceCodePage(aStepModel->InternalParameters.ReadCodePage);
|
||||||
|
APIHeaderSection_MakeHeader aHeaderMaker;
|
||||||
|
aHeaderMaker.Apply(aStepModel);
|
||||||
IFSelect_ReturnStatus status = IFSelect_RetVoid;
|
IFSelect_ReturnStatus status = IFSelect_RetVoid;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -228,6 +235,8 @@ IFSelect_ReturnStatus STEPControl_Reader::ReadStream(const Standard_CString th
|
|||||||
Handle(StepData_StepModel) aStepModel = new StepData_StepModel;
|
Handle(StepData_StepModel) aStepModel = new StepData_StepModel;
|
||||||
aStepModel->InternalParameters = theParams;
|
aStepModel->InternalParameters = theParams;
|
||||||
aStepModel->SetSourceCodePage(aStepModel->InternalParameters.ReadCodePage);
|
aStepModel->SetSourceCodePage(aStepModel->InternalParameters.ReadCodePage);
|
||||||
|
APIHeaderSection_MakeHeader aHeaderMaker;
|
||||||
|
aHeaderMaker.Apply(aStepModel);
|
||||||
IFSelect_ReturnStatus status = IFSelect_RetVoid;
|
IFSelect_ReturnStatus status = IFSelect_RetVoid;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
|
|
||||||
#include <STEPControl_Writer.hxx>
|
#include <STEPControl_Writer.hxx>
|
||||||
|
|
||||||
|
#include <APIHeaderSection_MakeHeader.hxx>
|
||||||
#include <DE_ShapeFixParameters.hxx>
|
#include <DE_ShapeFixParameters.hxx>
|
||||||
#include <Interface_InterfaceModel.hxx>
|
#include <Interface_InterfaceModel.hxx>
|
||||||
#include <Interface_Macros.hxx>
|
#include <Interface_Macros.hxx>
|
||||||
@ -140,10 +141,9 @@ IFSelect_ReturnStatus STEPControl_Writer::Transfer(const TopoDS_Shape&
|
|||||||
XSAlgo_ShapeProcessor::PrepareForTransfer(); // update unit info
|
XSAlgo_ShapeProcessor::PrepareForTransfer(); // update unit info
|
||||||
Model()->SetLocalLengthUnit(UnitsMethods::GetCasCadeLengthUnit());
|
Model()->SetLocalLengthUnit(UnitsMethods::GetCasCadeLengthUnit());
|
||||||
}
|
}
|
||||||
if (!thesession->Model().IsNull())
|
Model()->InternalParameters = theParams;
|
||||||
{
|
APIHeaderSection_MakeHeader aHeaderMaker;
|
||||||
Handle(StepData_StepModel)::DownCast(thesession->Model())->InternalParameters = theParams;
|
aHeaderMaker.Apply(Model());
|
||||||
}
|
|
||||||
Handle(STEPControl_ActorWrite) ActWrite =
|
Handle(STEPControl_ActorWrite) ActWrite =
|
||||||
Handle(STEPControl_ActorWrite)::DownCast(WS()->NormAdaptor()->ActorWrite());
|
Handle(STEPControl_ActorWrite)::DownCast(WS()->NormAdaptor()->ActorWrite());
|
||||||
ActWrite->SetGroupMode(
|
ActWrite->SetGroupMode(
|
||||||
@ -156,6 +156,13 @@ IFSelect_ReturnStatus STEPControl_Writer::Transfer(const TopoDS_Shape&
|
|||||||
|
|
||||||
IFSelect_ReturnStatus STEPControl_Writer::Write(const Standard_CString theFileName)
|
IFSelect_ReturnStatus STEPControl_Writer::Write(const Standard_CString theFileName)
|
||||||
{
|
{
|
||||||
|
Handle(StepData_StepModel) aModel = Model();
|
||||||
|
if (aModel.IsNull())
|
||||||
|
{
|
||||||
|
return IFSelect_RetFail;
|
||||||
|
}
|
||||||
|
APIHeaderSection_MakeHeader aHeaderMaker;
|
||||||
|
aHeaderMaker.Apply(aModel);
|
||||||
return thesession->SendAll(theFileName);
|
return thesession->SendAll(theFileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -177,6 +184,8 @@ IFSelect_ReturnStatus STEPControl_Writer::WriteStream(std::ostream& theOStream)
|
|||||||
|
|
||||||
StepData_StepWriter aWriter(aModel);
|
StepData_StepWriter aWriter(aModel);
|
||||||
aWriter.SendModel(aProtocol);
|
aWriter.SendModel(aProtocol);
|
||||||
|
APIHeaderSection_MakeHeader aHeaderMaker;
|
||||||
|
aHeaderMaker.Apply(aModel);
|
||||||
return aWriter.Print(theOStream) ? IFSelect_RetDone : IFSelect_RetFail;
|
return aWriter.Print(theOStream) ? IFSelect_RetDone : IFSelect_RetFail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,7 +13,6 @@
|
|||||||
|
|
||||||
#include <STEPEdit.hxx>
|
#include <STEPEdit.hxx>
|
||||||
|
|
||||||
#include <APIHeaderSection_MakeHeader.hxx>
|
|
||||||
#include <IFSelect_SelectModelEntities.hxx>
|
#include <IFSelect_SelectModelEntities.hxx>
|
||||||
#include <IFSelect_SelectModelRoots.hxx>
|
#include <IFSelect_SelectModelRoots.hxx>
|
||||||
#include <IFSelect_SelectSignature.hxx>
|
#include <IFSelect_SelectSignature.hxx>
|
||||||
@ -38,8 +37,9 @@ Handle(Interface_Protocol) STEPEdit::Protocol()
|
|||||||
|
|
||||||
Handle(StepData_StepModel) STEPEdit::NewModel()
|
Handle(StepData_StepModel) STEPEdit::NewModel()
|
||||||
{
|
{
|
||||||
APIHeaderSection_MakeHeader head;
|
Handle(StepData_StepModel) stepmodel = new StepData_StepModel;
|
||||||
return head.NewModel(STEPEdit::Protocol());
|
stepmodel->SetProtocol(STEPEdit::Protocol());
|
||||||
|
return stepmodel;
|
||||||
}
|
}
|
||||||
|
|
||||||
Handle(IFSelect_Signature) STEPEdit::SignType()
|
Handle(IFSelect_Signature) STEPEdit::SignType()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user