#include <Interface_Macros.hxx>
#include <Interface_MSG.hxx>
#include <Interface_Static.hxx>
+#include <Message_ProgressScope.hxx>
#include <MoniTool_DataMapOfShapeTransient.hxx>
#include <OSD_Timer.hxx>
#include <ShapeAnalysis_ShapeTolerance.hxx>
//=======================================================================
Handle(Transfer_Binder) STEPControl_ActorWrite::Transfer (const Handle(Transfer_Finder)& start,
- const Handle(Transfer_FinderProcess)& FP)
+ const Handle(Transfer_FinderProcess)& FP,
+ const Message_ProgressRange& theProgress)
{
XSAlgo::AlgoContainer()->PrepareForTransfer();
Handle(StepShape_ShapeDefinitionRepresentation) sdr = SDRTool.SDRValue();
// transfer shape
- Handle(Transfer_Binder) resbind = TransferShape (mapper,sdr,FP);
+ Handle(Transfer_Binder) resbind = TransferShape (mapper,sdr,FP, 0L, Standard_True, theProgress);
// Handle(StepShape_ShapeRepresentation) resultat;
// FP->GetTypedTransient (resbind,STANDARD_TYPE(StepShape_ShapeRepresentation),resultat);
}
-Handle(Transfer_Binder) STEPControl_ActorWrite::TransferShape (const Handle(Transfer_Finder)& start,
- const Handle(StepShape_ShapeDefinitionRepresentation)& SDR0,
- const Handle(Transfer_FinderProcess)& FP,
- const Handle(TopTools_HSequenceOfShape)& shapeGroup,
- const Standard_Boolean isManifold)
+Handle(Transfer_Binder) STEPControl_ActorWrite::TransferShape
+ (const Handle(Transfer_Finder)& start,
+ const Handle(StepShape_ShapeDefinitionRepresentation)& SDR0,
+ const Handle(Transfer_FinderProcess)& FP,
+ const Handle(TopTools_HSequenceOfShape)& shapeGroup,
+ const Standard_Boolean isManifold,
+ const Message_ProgressRange& theProgress)
{
STEPControl_StepModelType mymode = Mode();
Handle(TransferBRep_ShapeMapper) mapper = Handle(TransferBRep_ShapeMapper)::DownCast(start);
// MODE ASSEMBLY : if Compound, (sub-)assembly
if ( IsAssembly(theShape) )
- return TransferCompound(start, SDR0, FP);
+ return TransferCompound(start, SDR0, FP, theProgress);
+
+ Message_ProgressScope aPSRoot(theProgress, NULL, 2);
// [BEGIN] Separate manifold topology from non-manifold in group mode 0 (ssv; 18.11.2010)
Standard_Boolean isNMMode = Interface_Static::IVal("write.step.nonmanifold") != 0;
// Complete SDR with shape representations.
// NOTE: aNMBinder is connected now with this SDR. It will be added to the resulting
// binder in the end of this invocation of TransferShape
- for (Standard_Integer i = 1; i <= aNMItemsNb; i++) {
+ Message_ProgressScope aPS (aPSRoot.Next(), NULL, aNMItemsNb);
+ for (Standard_Integer i = 1; i <= aNMItemsNb && aPS.More(); i++) {
Handle(TransferBRep_ShapeMapper) aMapper = TransferBRep::ShapeMapper( FP, RepItemSeq->Value(i) );
- TransferShape(aMapper, sdr, FP, NonManifoldGroup, Standard_False);
+ TransferShape(aMapper, sdr, FP, NonManifoldGroup, Standard_False, aPS.Next());
}
// Nothing else needed for pure non-manifold topology, return
}
// [END] Separate manifold topology from non-manifold in group mode 0 (ssv; 18.11.2010)
+ if (aPSRoot.UserBreak())
+ return Handle(Transfer_Binder)();
+
// create a list of items to translate
Handle(TopTools_HSequenceOfShape) RepItemSeq = new TopTools_HSequenceOfShape();
else if (theShape.ShapeType() == TopAbs_COMPSOLID) {
FP->AddWarning(start,"NonManifold COMPSOLID was translated like a set of SOLIDs");
if ( GroupMode() > 0)
- return TransferCompound(start, SDR0, FP);
+ return TransferCompound(start, SDR0, FP, aPSRoot.Next());
else {
TopExp_Explorer SolidExp;
for (SolidExp.Init(theShape, TopAbs_SOLID);
//ptv 10.11.00: allow to write empty Compound: if (GroupMode() >0)
ItemSeq->Append (myContext.GetDefaultAxis());
STEPControl_StepModelType trmode = mymode;
- for (Standard_Integer i = 1; i <= nbs; i++) {
+ Message_ProgressScope aPS (aPSRoot.Next(), NULL, nbs);
+ for (Standard_Integer i = 1; i <= nbs && aPS.More(); i++) {
TopoDS_Shape xShape = RepItemSeq->Value(i);
if(mymode == STEPControl_AsIs) {
Handle(Standard_Transient) info;
Standard_Real maxTol = Interface_Static::RVal("read.maxprecision.val");
+ Message_ProgressScope aPS1 (aPS.Next(), NULL, 2);
+
TopoDS_Shape aShape;
aShape = XSAlgo::AlgoContainer()->ProcessShape(xShape, Tol, maxTol,
"write.step.resource.name",
"write.step.sequence", info,
- FP->GetProgress() );
+ aPS1.Next());
+ if (aPS1.UserBreak())
+ return Handle(Transfer_Binder)();
+
if (!isManifold) {
mergeInfoForNM(FP, info);
}
for ( TopoDS_Iterator It ( aSolid ); It.More(); It.Next() )
if (It.Value().ShapeType() == TopAbs_SHELL) nbShells++;
if ( nbShells >1 ) {
- TopoDSToStep_MakeBrepWithVoids MkBRepWithVoids(aSolid,FP);
+ TopoDSToStep_MakeBrepWithVoids MkBRepWithVoids(aSolid,FP, aPS1.Next());
MkBRepWithVoids.Tolerance() = Tol;
if (MkBRepWithVoids.IsDone()) {
item = MkBRepWithVoids.Value();
}
if ( nbShells ==1 ) {
- TopoDSToStep_MakeManifoldSolidBrep MkManifoldSolidBrep(aSolid,FP);
+ TopoDSToStep_MakeManifoldSolidBrep MkManifoldSolidBrep(aSolid,FP, aPS1.Next());
MkManifoldSolidBrep.Tolerance() = Tol;
if (MkManifoldSolidBrep.IsDone()) {
item = MkManifoldSolidBrep.Value();
}
else if (aShape.ShapeType() == TopAbs_SHELL) {
TopoDS_Shell aShell = TopoDS::Shell(aShape);
- TopoDSToStep_MakeManifoldSolidBrep MkManifoldSolidBrep(aShell,FP);
+ TopoDSToStep_MakeManifoldSolidBrep MkManifoldSolidBrep(aShell,FP, aPS1.Next());
MkManifoldSolidBrep.Tolerance() = Tol;
if (MkManifoldSolidBrep.IsDone()) {
item = MkManifoldSolidBrep.Value();
{
if (aShape.ShapeType() == TopAbs_SOLID) {
TopoDS_Solid aSolid = TopoDS::Solid(aShape);
- TopoDSToStep_MakeBrepWithVoids MkBRepWithVoids(aSolid,FP);
+ TopoDSToStep_MakeBrepWithVoids MkBRepWithVoids(aSolid,FP, aPS1.Next());
MkBRepWithVoids.Tolerance() = Tol;
if (MkBRepWithVoids.IsDone()) {
item = MkBRepWithVoids.Value();
}
if (aShape.ShapeType() == TopAbs_SOLID) {
TopoDS_Solid aSolid = TopoDS::Solid(aShape);
- TopoDSToStep_MakeFacetedBrep MkFacetedBrep(aSolid,FP);
+ TopoDSToStep_MakeFacetedBrep MkFacetedBrep(aSolid,FP, aPS1.Next());
MkFacetedBrep.Tolerance() = Tol;
if (MkFacetedBrep.IsDone()) {
item = MkFacetedBrep.Value();
if (aShape.ShapeType() == TopAbs_SOLID) {
TopoDS_Solid aSolid = TopoDS::Solid(aShape);
TopoDSToStep_MakeFacetedBrepAndBrepWithVoids
- MkFacetedBrepAndBrepWithVoids(aSolid,FP);
+ MkFacetedBrepAndBrepWithVoids(aSolid,FP, aPS1.Next());
MkFacetedBrepAndBrepWithVoids.Tolerance() = Tol;
if (MkFacetedBrepAndBrepWithVoids.IsDone()) {
item = MkFacetedBrepAndBrepWithVoids.Value();
if (aShape.ShapeType() == TopAbs_SOLID) {
TopoDS_Solid aSolid = TopoDS::Solid(aShape);
TopoDSToStep_MakeShellBasedSurfaceModel
- MkShellBasedSurfaceModel(aSolid, FP);
+ MkShellBasedSurfaceModel(aSolid, FP, aPS1.Next());
MkShellBasedSurfaceModel.Tolerance() = Tol;
if (MkShellBasedSurfaceModel.IsDone()) {
item = MkShellBasedSurfaceModel.Value();
else if (aShape.ShapeType() == TopAbs_SHELL) {
TopoDS_Shell aShell = TopoDS::Shell(aShape);
// Non-manifold topology is stored via NMSSR containing series of SBSM (ssv; 13.11.2010)
- TopoDSToStep_MakeShellBasedSurfaceModel MkShellBasedSurfaceModel(aShell, FP);
+ TopoDSToStep_MakeShellBasedSurfaceModel MkShellBasedSurfaceModel(aShell, FP, aPS1.Next());
MkShellBasedSurfaceModel.Tolerance() = Tol;
if (MkShellBasedSurfaceModel.IsDone()) {
item = MkShellBasedSurfaceModel.Value();
else if (aShape.ShapeType() == TopAbs_FACE) {
TopoDS_Face aFace = TopoDS::Face(aShape);
TopoDSToStep_MakeShellBasedSurfaceModel
- MkShellBasedSurfaceModel(aFace, FP);
+ MkShellBasedSurfaceModel(aFace, FP, aPS1.Next());
MkShellBasedSurfaceModel.Tolerance() = Tol;
if (MkShellBasedSurfaceModel.IsDone()) {
item = MkShellBasedSurfaceModel.Value();
//purpose :
//=======================================================================
-Handle(Transfer_Binder) STEPControl_ActorWrite::TransferCompound (const Handle(Transfer_Finder)& start,
- const Handle(StepShape_ShapeDefinitionRepresentation)& SDR0,
- const Handle(Transfer_FinderProcess)& FP)
+Handle(Transfer_Binder) STEPControl_ActorWrite::TransferCompound
+ (const Handle(Transfer_Finder)& start,
+ const Handle(StepShape_ShapeDefinitionRepresentation)& SDR0,
+ const Handle(Transfer_FinderProcess)& FP,
+ const Message_ProgressRange& theProgress)
{
Handle(TransferBRep_ShapeMapper) mapper = Handle(TransferBRep_ShapeMapper)::DownCast(start);
Handle(Transfer_Binder) binder;
Handle(TColStd_HSequenceOfTransient) ItemSeq = new TColStd_HSequenceOfTransient();
ItemSeq->Append (myContext.GetDefaultAxis());
myContext.NextLevel();
- for ( i = 1; i <= nbs; i ++) {
+ Message_ProgressScope aPS(theProgress, NULL, nbs);
+ for (i = 1; i <= nbs && aPS.More(); i++) {
Handle(TransferBRep_ShapeMapper) subs = TransferBRep::ShapeMapper (FP,RepItemSeq->Value(i));
Handle(StepGeom_Axis2Placement3d) AX1;
- Handle(Transfer_Binder) bnd = TransferSubShape(subs, SDR0, AX1, FP, NonManifoldGroup, isManifold);
+ Handle(Transfer_Binder) bnd = TransferSubShape(subs, SDR0, AX1, FP, NonManifoldGroup, isManifold, aPS.Next());
if (!AX1.IsNull()) ItemSeq->Append (AX1);
// copy binders so as to have all roots in upper binder, but do not conflict
//purpose :
//=======================================================================
-Handle(Transfer_Binder) STEPControl_ActorWrite::TransferSubShape (const Handle(Transfer_Finder)& start,
- const Handle(StepShape_ShapeDefinitionRepresentation)& SDR0,
- Handle(StepGeom_Axis2Placement3d)& AX1,
- const Handle(Transfer_FinderProcess)& FP,
- const Handle(TopTools_HSequenceOfShape)& shapeGroup,
- const Standard_Boolean isManifold)
+Handle(Transfer_Binder) STEPControl_ActorWrite::TransferSubShape
+ (const Handle(Transfer_Finder)& start,
+ const Handle(StepShape_ShapeDefinitionRepresentation)& SDR0,
+ Handle(StepGeom_Axis2Placement3d)& AX1,
+ const Handle(Transfer_FinderProcess)& FP,
+ const Handle(TopTools_HSequenceOfShape)& shapeGroup,
+ const Standard_Boolean isManifold,
+ const Message_ProgressRange& theProgress)
{
Handle(TransferBRep_ShapeMapper) mapper = Handle(TransferBRep_ShapeMapper)::DownCast(start);
if (mapper.IsNull()) return NullResult();
//:abv 20.05.02: see comment in TransferShape(): added "! iasdr ||"
Handle(Transfer_Binder) resprod = TransientResult(sdr); //KA - OCC7141(skl 10.11.2004)
if ( ! iasdr || resbind.IsNull() ) {
- resbind = TransferShape(mapper, sdr, FP, shapeGroup, isManifold);
+ resbind = TransferShape(mapper, sdr, FP, shapeGroup, isManifold, theProgress);
Handle(Transfer_Binder) oldbind = FP->Find ( mapper );
if ( ! oldbind.IsNull() && !resbind.IsNull()) resbind->AddResult ( oldbind );
FP->Bind (mapper,resbind);