1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-02 17:46:22 +03:00

0033811: CAD Import - Update DE Readers with ShapeHealing logic

This commit is contained in:
ichesnok 2024-08-29 17:25:42 +01:00
parent 2afe8d66cb
commit e13c6a27b8
27 changed files with 290 additions and 174 deletions

View File

@ -490,3 +490,11 @@ TCollection_AsciiString DE_ShapeFixConfigurationNode::Save() const
return aResult;
}
//=======================================================================
// function : ChangeHealingParams
// purpose :
//=======================================================================
void DE_ShapeFixConfigurationNode::ChangeHealingParams()
{
}

View File

@ -42,6 +42,9 @@ public:
//! @return result resource string
Standard_EXPORT virtual TCollection_AsciiString Save() const Standard_OVERRIDE;
//! Redefined some healing parameters, depending on format
Standard_EXPORT virtual void ChangeHealingParams();
public:
DE_ShapeFixParameters HealingParameters; //!< Shape healing parameters

View File

@ -0,0 +1,74 @@
// Copyright (c) 2024 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <DE_ShapeFixParameters.hxx>
#include <NCollection_DataMap.hxx>
#include <NCollection_Shared.hxx>
#include <TCollection_AsciiString.hxx>
//! Fill healing parameters map
void DE_ShapeFixParameters::FillParamsMap(DE_ShapeFixParameters::HealingParamMap& theMap)
{
theMap.Bind("Tolerance3d", TCollection_AsciiString(Tolerance3d));
theMap.Bind("MinTolerance3d", TCollection_AsciiString(MinTolerance3d));
theMap.Bind("MaxTolerance3d", TCollection_AsciiString(MaxTolerance3d));
theMap.Bind("FixFreeShellMode", TCollection_AsciiString(static_cast<int>(FixFreeShellMode)));
theMap.Bind("FixFreeFaceMode", TCollection_AsciiString(static_cast<int>(FixFreeFaceMode)));
theMap.Bind("FixFreeFaceMode", TCollection_AsciiString(static_cast<int>(FixFreeFaceMode)));
theMap.Bind("FixFreeWireMode", TCollection_AsciiString(static_cast<int>(FixFreeWireMode)));
theMap.Bind("FixSameParameterMode", TCollection_AsciiString(static_cast<int>(FixSameParameterMode)));
theMap.Bind("FixSolidMode", TCollection_AsciiString(static_cast<int>(FixSolidMode)));
theMap.Bind("FixShellOrientationMode", TCollection_AsciiString(static_cast<int>(FixShellOrientationMode)));
theMap.Bind("CreateOpenSolidMode", TCollection_AsciiString(static_cast<int>(CreateOpenSolidMode)));
theMap.Bind("FixShellMode", TCollection_AsciiString(static_cast<int>(FixShellMode)));
theMap.Bind("FixFaceOrientationMode", TCollection_AsciiString(static_cast<int>(FixFaceOrientationMode)));
theMap.Bind("FixFaceMode", TCollection_AsciiString(static_cast<int>(FixFaceMode)));
theMap.Bind("FixWireMode", TCollection_AsciiString(static_cast<int>(FixWireMode)));
theMap.Bind("FixOrientationMode", TCollection_AsciiString(static_cast<int>(FixOrientationMode)));
theMap.Bind("FixAddNaturalBoundMode", TCollection_AsciiString(static_cast<int>(FixAddNaturalBoundMode)));
theMap.Bind("FixMissingSeamMode", TCollection_AsciiString(static_cast<int>(FixMissingSeamMode)));
theMap.Bind("FixSmallAreaWireMode", TCollection_AsciiString(static_cast<int>(FixSmallAreaWireMode)));
theMap.Bind("RemoveSmallAreaFaceMode", TCollection_AsciiString(static_cast<int>(RemoveSmallAreaFaceMode)));
theMap.Bind("FixIntersectingWiresMode", TCollection_AsciiString(static_cast<int>(FixIntersectingWiresMode)));
theMap.Bind("FixLoopWiresMode", TCollection_AsciiString(static_cast<int>(FixLoopWiresMode)));
theMap.Bind("FixSplitFaceMode", TCollection_AsciiString(static_cast<int>(FixSplitFaceMode)));
theMap.Bind("AutoCorrectPrecisionMode", TCollection_AsciiString(static_cast<int>(AutoCorrectPrecisionMode)));
theMap.Bind("ModifyTopologyMode", TCollection_AsciiString(static_cast<int>(ModifyTopologyMode)));
theMap.Bind("ClosedWireMode", TCollection_AsciiString(static_cast<int>(ClosedWireMode)));
theMap.Bind("PreferencePCurveMode", TCollection_AsciiString(static_cast<int>(PreferencePCurveMode)));
theMap.Bind("FixReorderMode", TCollection_AsciiString(static_cast<int>(FixReorderMode)));
theMap.Bind("FixSmallMode", TCollection_AsciiString(static_cast<int>(FixSmallMode)));
theMap.Bind("FixConnectedMode", TCollection_AsciiString(static_cast<int>(FixConnectedMode)));
theMap.Bind("FixEdgeCurvesMode", TCollection_AsciiString(static_cast<int>(FixEdgeCurvesMode)));
theMap.Bind("FixDegeneratedMode", TCollection_AsciiString(static_cast<int>(FixDegeneratedMode)));
theMap.Bind("FixLackingMode", TCollection_AsciiString(static_cast<int>(FixLackingMode)));
theMap.Bind("FixSelfIntersectionMode", TCollection_AsciiString(static_cast<int>(FixSelfIntersectionMode)));
theMap.Bind("RemoveLoopMode", TCollection_AsciiString(static_cast<int>(RemoveLoopMode)));
theMap.Bind("FixReversed2dMode", TCollection_AsciiString(static_cast<int>(FixReversed2dMode)));
theMap.Bind("FixRemovePCurveMode", TCollection_AsciiString(static_cast<int>(FixRemovePCurveMode)));
theMap.Bind("FixRemoveCurve3dMode", TCollection_AsciiString(static_cast<int>(FixRemoveCurve3dMode)));
theMap.Bind("FixAddPCurveMode", TCollection_AsciiString(static_cast<int>(FixAddPCurveMode)));
theMap.Bind("FixAddCurve3dMode", TCollection_AsciiString(static_cast<int>(FixAddCurve3dMode)));
theMap.Bind("FixSeamMode", TCollection_AsciiString(static_cast<int>(FixSeamMode)));
theMap.Bind("FixShiftedMode", TCollection_AsciiString(static_cast<int>(FixShiftedMode)));
theMap.Bind("FixEdgeSameParameterMode", TCollection_AsciiString(static_cast<int>(FixEdgeSameParameterMode)));
theMap.Bind("FixNotchedEdgesMode", TCollection_AsciiString(static_cast<int>(FixNotchedEdgesMode)));
theMap.Bind("FixTailMode", TCollection_AsciiString(static_cast<int>(FixTailMode)));
theMap.Bind("MaxTailAngle", TCollection_AsciiString(static_cast<int>(MaxTailAngle)));
theMap.Bind("MaxTailWidth", TCollection_AsciiString(static_cast<int>(MaxTailWidth)));
theMap.Bind("FixSelfIntersectingEdgeMode", TCollection_AsciiString(static_cast<int>(FixSelfIntersectingEdgeMode)));
theMap.Bind("FixIntersectingEdgesMode", TCollection_AsciiString(static_cast<int>(FixIntersectingEdgesMode)));
theMap.Bind("FixNonAdjacentIntersectingEdgesMode", TCollection_AsciiString(static_cast<int>(FixNonAdjacentIntersectingEdgesMode)));
theMap.Bind("FixVertexPositionMode", TCollection_AsciiString(static_cast<int>(FixVertexPositionMode)));
theMap.Bind("FixVertexToleranceMode", TCollection_AsciiString(static_cast<int>(FixVertexToleranceMode)));
}

View File

@ -14,9 +14,15 @@
#ifndef _DE_ShapeFixParameters_HeaderFile
#define _DE_ShapeFixParameters_HeaderFile
#include <NCollection_DataMap.hxx>
#include <NCollection_Shared.hxx>
#include <TCollection_AsciiString.hxx>
//! Struct for shape healing parameters storage
struct DE_ShapeFixParameters
{
typedef NCollection_Shared<NCollection_DataMap<TCollection_AsciiString, TCollection_AsciiString>> HealingParamMap;
//! Enum, classifying a type of value for parameters
enum class FixMode : char
{
@ -47,7 +53,7 @@ struct DE_ShapeFixParameters
FixMode FixIntersectingWiresMode = FixMode::FixOrNot;
FixMode FixLoopWiresMode = FixMode::FixOrNot;
FixMode FixSplitFaceMode = FixMode::FixOrNot;
FixMode AutoCorrectPrecisionMode = FixMode::FixOrNot;
FixMode AutoCorrectPrecisionMode = FixMode::Fix;
FixMode ModifyTopologyMode = FixMode::NotFix;
FixMode ModifyGeometryMode = FixMode::Fix;
FixMode ClosedWireMode = FixMode::Fix;
@ -77,6 +83,10 @@ struct DE_ShapeFixParameters
FixMode FixNonAdjacentIntersectingEdgesMode = FixMode::FixOrNot;
FixMode FixVertexPositionMode = FixMode::NotFix;
FixMode FixVertexToleranceMode = FixMode::FixOrNot;
//! Fill healing parameters map
Standard_EXPORT void DE_ShapeFixParameters::FillParamsMap(DE_ShapeFixParameters::HealingParamMap& theMap);
};
#endif // _DE_ShapeFixParameters_HeaderFile

View File

@ -7,6 +7,7 @@ DE_Provider.cxx
DE_Provider.hxx
DE_ShapeFixConfigurationNode.cxx
DE_ShapeFixConfigurationNode.hxx
DE_ShapeFixParameters.cxx
DE_ShapeFixParameters.hxx
DE_Wrapper.cxx
DE_Wrapper.hxx

View File

@ -18,7 +18,7 @@
#include <IGESCAFControl_Provider.hxx>
#include <NCollection_Buffer.hxx>
IMPLEMENT_STANDARD_RTTIEXT(IGESCAFControl_ConfigurationNode, DE_ConfigurationNode)
IMPLEMENT_STANDARD_RTTIEXT(IGESCAFControl_ConfigurationNode, DE_ShapeFixConfigurationNode)
namespace
{
@ -37,17 +37,20 @@ namespace
// purpose :
//=======================================================================
IGESCAFControl_ConfigurationNode::IGESCAFControl_ConfigurationNode() :
DE_ConfigurationNode()
{}
DE_ShapeFixConfigurationNode()
{
ChangeHealingParams();
}
//=======================================================================
// function : IGESCAFControl_ConfigurationNode
// purpose :
//=======================================================================
IGESCAFControl_ConfigurationNode::IGESCAFControl_ConfigurationNode(const Handle(IGESCAFControl_ConfigurationNode)& theNode)
:DE_ConfigurationNode(theNode)
:DE_ShapeFixConfigurationNode(theNode)
{
InternalParameters = theNode->InternalParameters;
ChangeHealingParams();
}
//=======================================================================
@ -456,3 +459,12 @@ bool IGESCAFControl_ConfigurationNode::CheckContent(const Handle(NCollection_Buf
}
return false;
}
//=======================================================================
// function : ChangeHealingParams
// purpose :
//=======================================================================
void IGESCAFControl_ConfigurationNode::ChangeHealingParams()
{
HealingParameters.CreateOpenSolidMode = DE_ShapeFixParameters::FixMode::Fix;
}

View File

@ -14,7 +14,7 @@
#ifndef _IGESCAFControl_ConfigurationNode_HeaderFile
#define _IGESCAFControl_ConfigurationNode_HeaderFile
#include <DE_ConfigurationNode.hxx>
#include <DE_ShapeFixConfigurationNode.hxx>
#include <UnitsMethods_LengthUnit.hxx>
//! The purpose of this class is to configure the transfer process for IGES format
@ -27,9 +27,9 @@
//! The supported CAD extensions are ".igs", ".iges"
//! The import process is supported.
//! The export process is supported.
class IGESCAFControl_ConfigurationNode : public DE_ConfigurationNode
class IGESCAFControl_ConfigurationNode : public DE_ShapeFixConfigurationNode
{
DEFINE_STANDARD_RTTIEXT(IGESCAFControl_ConfigurationNode, DE_ConfigurationNode)
DEFINE_STANDARD_RTTIEXT(IGESCAFControl_ConfigurationNode, DE_ShapeFixConfigurationNode)
public:
//! Initializes all fields by default
@ -84,6 +84,9 @@ public:
//! @return Standard_True if file is supported by a current provider
Standard_EXPORT virtual bool CheckContent(const Handle(NCollection_Buffer)& theBuffer) const Standard_OVERRIDE;
//! Redefined some healing parameters, depending on format
Standard_EXPORT virtual void ChangeHealingParams() Standard_OVERRIDE;
public:
enum ReadMode_BSplineContinuity

View File

@ -20,9 +20,12 @@
#include <IGESControl_Controller.hxx>
#include <IGESData.hxx>
#include <IGESData_IGESModel.hxx>
#include <IGESToBRep_Actor.hxx>
#include <Interface_Static.hxx>
#include <Message.hxx>
#include <MoniTool_Macros.hxx>
#include <XCAFDoc_DocumentTool.hxx>
#include <XSControl_TransferReader.hxx>
#include <XSControl_WorkSession.hxx>
#include <UnitsMethods.hxx>
@ -187,14 +190,19 @@ bool IGESCAFControl_Provider::Read(const TCollection_AsciiString& thePath,
IGESCAFControl_Reader aReader;
aReader.SetWS(theWS);
aReader.SetReadVisible(aNode->InternalParameters.ReadOnlyVisible);
DE_ShapeFixParameters::HealingParamMap aMap = aReader.DEHealingParameters();
aNode->HealingParameters.FillParamsMap(aMap);
aReader.SetDEHealingParameters(aMap);
aReader.SetReadVisible(aNode->InternalParameters.ReadOnlyVisible);
aReader.SetColorMode(aNode->InternalParameters.ReadColor);
aReader.SetNameMode(aNode->InternalParameters.ReadName);
aReader.SetLayerMode(aNode->InternalParameters.ReadLayer);
IFSelect_ReturnStatus aReadStat = IFSelect_RetVoid;
aReadStat = aReader.ReadFile(thePath.ToCString());
DeclareAndCast(IGESToBRep_Actor, anActor, aReader.WS()->TransferReader()->Actor());
anActor->SetDEHealingParameters(aMap);
if (aReadStat != IFSelect_RetDone)
{
Message::SendFail() << "Error in the IGESCAFControl_Provider during reading the file " <<
@ -302,8 +310,15 @@ bool IGESCAFControl_Provider::Read(const TCollection_AsciiString& thePath,
IGESControl_Reader aReader;
aReader.SetWS(theWS);
aReader.SetReadVisible(aNode->InternalParameters.ReadOnlyVisible);
DE_ShapeFixParameters::HealingParamMap aMap = aReader.DEHealingParameters();
aNode->HealingParameters.FillParamsMap(aMap);
aReader.SetDEHealingParameters(aMap);
IFSelect_ReturnStatus aReadStat = IFSelect_RetVoid;
aReadStat = aReader.ReadFile(thePath.ToCString());
DeclareAndCast(IGESToBRep_Actor, anActor, aReader.WS()->TransferReader()->Actor());
anActor->SetDEHealingParameters(aMap);
if (aReadStat != IFSelect_RetDone)
{
Message::SendFail() << "Error in the IGESCAFControl_Provider during reading the file " <<

View File

@ -33,6 +33,7 @@
#include <TransferBRep_ShapeBinder.hxx>
#include <XSAlgo.hxx>
#include <XSAlgo_AlgoContainer.hxx>
#include <XSAlgo_AlgoProcessShape.hxx>
IMPLEMENT_STANDARD_RTTIEXT(IGESToBRep_Actor,Transfer_ActorOfTransientProcess)
@ -194,11 +195,17 @@ Handle(Transfer_Binder) IGESToBRep_Actor::Transfer
// fixing shape
Handle(Standard_Transient) info;
shape = XSAlgo::AlgoContainer()->ProcessShape(shape, theeps, CAS.GetMaxTol(),
"read.iges.resource.name",
"read.iges.sequence",
info, mymodel->ReShape(),
aPS.Next(), false, TopAbs_EDGE);
XSAlgo_AlgoProcessShape aProcessShape;
aProcessShape.SetShape(shape);
aProcessShape.SetPrscfile("read.iges.resource.name");
aProcessShape.SetPseq("read.iges.sequence");
aProcessShape.SetInfo(info);
aProcessShape.SetDetalisationLevel(TopAbs_EDGE);
aProcessShape.SetProgressRange(aPS.Next());
aProcessShape.SetPrecision(theeps);
aProcessShape.SetMaxTol(CAS.GetMaxTol());
aProcessShape.SetReShape(mymodel->ReShape());
shape = aProcessShape.ProcessShape();
XSAlgo::AlgoContainer()->MergeTransferInfo(TP, info, nbTPitems);
}

View File

@ -20,6 +20,7 @@
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <DE_ShapeFixParameters.hxx>
#include <Standard_Integer.hxx>
#include <Transfer_ActorOfTransientProcess.hxx>
#include <Message_ProgressRange.hxx>
@ -66,7 +67,11 @@ public:
//! the file or from statics
Standard_EXPORT Standard_Real UsedTolerance() const;
//! Returns healing parameters map
Standard_EXPORT DE_ShapeFixParameters::HealingParamMap DEHealingParameters() const { return myDEHealingParameters; }
//! Sets healing parameters map
Standard_EXPORT void SetDEHealingParameters(DE_ShapeFixParameters::HealingParamMap theDEHealingParams) { myDEHealingParameters = theDEHealingParams; }
DEFINE_STANDARD_RTTIEXT(IGESToBRep_Actor,Transfer_ActorOfTransientProcess)
@ -82,7 +87,7 @@ private:
Handle(Interface_InterfaceModel) themodel;
Standard_Integer thecontinuity;
Standard_Real theeps;
DE_ShapeFixParameters::HealingParamMap myDEHealingParameters;
};

View File

@ -46,6 +46,7 @@
#include <TransferBRep.hxx>
#include <XSAlgo.hxx>
#include <XSAlgo_AlgoContainer.hxx>
#include <XSAlgo_AlgoProcessShape.hxx>
#include <stdio.h>
//#include <ShapeCustom.hxx>
@ -549,10 +550,17 @@ Standard_Boolean IGESToBRep_Reader::Transfer(const Standard_Integer num,
// shape = XSAlgo::AlgoContainer()->PerformFixShape ( shape, theProc, eps*CAS.GetUnitFactor(), CAS.GetMaxTol() );
Handle(Standard_Transient) info;
shape = XSAlgo::AlgoContainer()->ProcessShape( shape, eps*CAS.GetUnitFactor(), CAS.GetMaxTol(),
"read.iges.resource.name",
"read.iges.sequence", info,
aPS.Next(), false, TopAbs_EDGE);
XSAlgo_AlgoProcessShape aProcessShape;
aProcessShape.SetShape(shape);
aProcessShape.SetPrscfile("read.iges.resource.name");
aProcessShape.SetPseq("read.iges.sequence");
aProcessShape.SetInfo(info);
aProcessShape.SetDetalisationLevel(TopAbs_EDGE);
aProcessShape.SetProgressRange(theProgress);
aProcessShape.SetPrecision(eps * CAS.GetUnitFactor());
aProcessShape.SetMaxTol(CAS.GetMaxTol());
shape = aProcessShape.ProcessShape();
if (aPS.UserBreak())
return Standard_False;

View File

@ -14,11 +14,12 @@
#include <STEPCAFControl_ConfigurationNode.hxx>
#include <DE_ConfigurationContext.hxx>
#include <DE_ShapeFixConfigurationNode.hxx>
#include <DE_PluginHolder.hxx>
#include <NCollection_Buffer.hxx>
#include <STEPCAFControl_Provider.hxx>
IMPLEMENT_STANDARD_RTTIEXT(STEPCAFControl_ConfigurationNode, DE_ConfigurationNode)
IMPLEMENT_STANDARD_RTTIEXT(STEPCAFControl_ConfigurationNode, DE_ShapeFixConfigurationNode)
namespace
{
@ -37,17 +38,19 @@ namespace
// purpose :
//=======================================================================
STEPCAFControl_ConfigurationNode::STEPCAFControl_ConfigurationNode() :
DE_ConfigurationNode()
{}
DE_ShapeFixConfigurationNode()
{
}
//=======================================================================
// function : STEPCAFControl_ConfigurationNode
// purpose :
//=======================================================================
STEPCAFControl_ConfigurationNode::STEPCAFControl_ConfigurationNode(const Handle(STEPCAFControl_ConfigurationNode)& theNode)
:DE_ConfigurationNode(theNode),
:DE_ShapeFixConfigurationNode(theNode),
InternalParameters(theNode->InternalParameters)
{}
{
}
//=======================================================================
// function : Load

View File

@ -14,7 +14,7 @@
#ifndef _STEPCAFControl_ConfigurationNode_HeaderFile
#define _STEPCAFControl_ConfigurationNode_HeaderFile
#include <DE_ConfigurationNode.hxx>
#include <DE_ShapeFixConfigurationNode.hxx>
#include <STEPControl_StepModelType.hxx>
#include <StepData_ConfParameters.hxx>
#include <Resource_FormatType.hxx>
@ -30,9 +30,9 @@
//! The supported CAD extensions are ".stp", ".step", ".stpz"
//! The import process is supported.
//! The export process is supported.
class STEPCAFControl_ConfigurationNode : public DE_ConfigurationNode
class STEPCAFControl_ConfigurationNode : public DE_ShapeFixConfigurationNode
{
DEFINE_STANDARD_RTTIEXT(STEPCAFControl_ConfigurationNode, DE_ConfigurationNode)
DEFINE_STANDARD_RTTIEXT(STEPCAFControl_ConfigurationNode, DE_ShapeFixConfigurationNode)
public:
//! Initializes all field by default

View File

@ -14,6 +14,7 @@
#include <STEPCAFControl_Provider.hxx>
#include <BinXCAFDrivers.hxx>
#include <DE_ShapeFixParameters.hxx>
#include <Interface_Static.hxx>
#include <Message.hxx>
#include <StepData_StepModel.hxx>
@ -23,6 +24,8 @@
#include <STEPCAFControl_Reader.hxx>
#include <STEPCAFControl_Writer.hxx>
#include <XCAFDoc_DocumentTool.hxx>
#include <XSAlgo.hxx>
#include <XSAlgo_AlgoContainer.hxx>
#include <XSControl_WorkSession.hxx>
#include <UnitsMethods.hxx>
@ -68,12 +71,17 @@ bool STEPCAFControl_Provider::Read(const TCollection_AsciiString& thePath,
personizeWS(theWS);
XCAFDoc_DocumentTool::SetLengthUnit(theDocument, aNode->GlobalParameters.LengthUnit, UnitsMethods_LengthUnit_Millimeter);
STEPCAFControl_Reader aReader;
DE_ShapeFixParameters aParameters;
DE_ShapeFixParameters::HealingParamMap aDEHealingParams = aReader.ChangeReader().DEHealingParameters();
aNode->HealingParameters.FillParamsMap(aDEHealingParams);
aReader.ChangeReader().SetDEHealingParameters(aDEHealingParams);
aReader.Init(theWS);
aReader.SetColorMode(aNode->InternalParameters.ReadColor);
aReader.SetNameMode(aNode->InternalParameters.ReadName);
aReader.SetLayerMode(aNode->InternalParameters.ReadLayer);
aReader.SetPropsMode(aNode->InternalParameters.ReadProps);
aReader.SetMetaMode(aNode->InternalParameters.ReadMetadata);
aReader.SetDEHealingParameters(aReader.ChangeReader().DEHealingParameters());
IFSelect_ReturnStatus aReadStat = IFSelect_RetVoid;
StepData_ConfParameters aParams;
@ -200,6 +208,9 @@ bool STEPCAFControl_Provider::Read(const TCollection_AsciiString& thePath,
personizeWS(theWS);
STEPControl_Reader aReader;
aReader.SetWS(theWS);
DE_ShapeFixParameters::HealingParamMap aDEHealingParams = aReader.DEHealingParameters();
aNode->HealingParameters.FillParamsMap(aDEHealingParams);
aReader.SetDEHealingParameters(aDEHealingParams);
IFSelect_ReturnStatus aReadstat = IFSelect_RetVoid;
StepData_ConfParameters aParams;
aReadstat = aReader.ReadFile(thePath.ToCString(), aParams);

View File

@ -24,6 +24,7 @@
#include <HeaderSection_FileSchema.hxx>
#include <Interface_Static.hxx>
#include <Message_ProgressScope.hxx>
#include <MoniTool_Macros.hxx>
#include <NCollection_DataMap.hxx>
#include <OSD_Path.hxx>
#include <Quantity_ColorRGBA.hxx>
@ -2341,7 +2342,8 @@ Standard_Boolean readAnnotationPlane(const Handle(StepVisual_AnnotationPlane)& t
void readAnnotation(const Handle(XSControl_TransferReader)& theTR,
const Handle(Standard_Transient)& theGDT,
const Handle(Standard_Transient)& theDimObject,
const StepData_Factors& theLocalFactors)
const StepData_Factors& theLocalFactors,
DE_ShapeFixParameters::HealingParamMap theDEParams)
{
if (theGDT.IsNull() || theDimObject.IsNull())
return;
@ -2370,6 +2372,7 @@ void readAnnotation(const Handle(XSControl_TransferReader)& theTR,
Handle(StepVisual_DraughtingModel)::DownCast(aDMIA->UsedRepresentation());
XSAlgo::AlgoContainer()->PrepareForTransfer();
STEPControl_ActorRead anActor(aTP->Model());
anActor.SetDEHealingParameters(theDEParams);
StepData_Factors aLocalFactors = theLocalFactors;
anActor.PrepareUnits(aDModel, aTP, aLocalFactors);
Standard_Real aFact = aLocalFactors.LengthFactor();
@ -2457,7 +2460,8 @@ void readAnnotation(const Handle(XSControl_TransferReader)& theTR,
void readConnectionPoints(const Handle(XSControl_TransferReader)& theTR,
const Handle(Standard_Transient)& theGDT,
const Handle(XCAFDimTolObjects_DimensionObject)& theDimObject,
const StepData_Factors& theLocalFactors)
const StepData_Factors& theLocalFactors,
DE_ShapeFixParameters::HealingParamMap theDEParams)
{
if (theGDT.IsNull() || theDimObject.IsNull())
return;
@ -2479,6 +2483,7 @@ void readConnectionPoints(const Handle(XSControl_TransferReader)& theTR,
{
XSAlgo::AlgoContainer()->PrepareForTransfer();
STEPControl_ActorRead anActor(theTR->Model());
anActor.SetDEHealingParameters(theDEParams);
StepData_Factors aLocalFactors = theLocalFactors;
anActor.PrepareUnits(aSDR, aTP, aLocalFactors);
aFact = aLocalFactors.LengthFactor();
@ -2783,7 +2788,7 @@ Standard_Boolean STEPCAFControl_Reader::setDatumToXCAF(const Handle(StepDimTol_D
collectShapeAspect(aSAR->RelatingShapeAspect(), theWS, aSAs);
Handle(StepDimTol_DatumFeature) aDF = Handle(StepDimTol_DatumFeature)::DownCast(aSAR->RelatingShapeAspect());
if (!aSAR->RelatingShapeAspect()->IsKind(STANDARD_TYPE(StepDimTol_DatumTarget)))
readAnnotation(aTR, aSAR->RelatingShapeAspect(), aDatObj, theLocalFactors);
readAnnotation(aTR, aSAR->RelatingShapeAspect(), aDatObj, theLocalFactors, myDEParameters);
}
// Collect shape labels
@ -2917,6 +2922,7 @@ Standard_Boolean STEPCAFControl_Reader::setDatumToXCAF(const Handle(StepDimTol_D
= Handle(StepGeom_Axis2Placement3d)::DownCast(aSRWP->ItemsValue(j));
XSAlgo::AlgoContainer()->PrepareForTransfer();
STEPControl_ActorRead anActor(aTP->Model());
anActor.SetDEHealingParameters(myDEParameters);
StepData_Factors aLocalFactors = theLocalFactors;
anActor.PrepareUnits(aSRWP, aTP, aLocalFactors);
Handle(Geom_Axis2Placement) anAxis = StepToGeom::MakeAxis2Placement(anAx, aLocalFactors);
@ -2964,7 +2970,7 @@ Standard_Boolean STEPCAFControl_Reader::setDatumToXCAF(const Handle(StepDimTol_D
aDGTTool->SetDatumToGeomTol(aDatL, theGDTL);
aDatTargetObj->IsDatumTarget(Standard_True);
aDatTargetObj->SetDatumTargetNumber(aDT->TargetId()->IntegerValue());
readAnnotation(aTR, aDT, aDatTargetObj, theLocalFactors);
readAnnotation(aTR, aDT, aDatTargetObj, theLocalFactors, myDEParameters);
aDat->SetObject(aDatTargetObj);
isExistDatumTarget = Standard_True;
}
@ -2993,7 +2999,7 @@ Standard_Boolean STEPCAFControl_Reader::setDatumToXCAF(const Handle(StepDimTol_D
aDGTTool->SetDatumToGeomTol(aDatL, theGDTL);
if (aDatObj->GetPresentation().IsNull()) {
// Try find annotation connected to datum entity (not right case, according recommended practices)
readAnnotation(aTR, theDat, aDatObj, theLocalFactors);
readAnnotation(aTR, theDat, aDatObj, theLocalFactors, myDEParameters);
}
aDat->SetObject(aDatObj);
}
@ -3638,7 +3644,8 @@ static void setDimObjectToXCAF(const Handle(Standard_Transient)& theEnt,
const TDF_Label& aDimL,
const Handle(TDocStd_Document)& theDoc,
const Handle(XSControl_WorkSession)& theWS,
const StepData_Factors& theLocalFactors)
const StepData_Factors& theLocalFactors,
DE_ShapeFixParameters::HealingParamMap theUseDEHealingParams)
{
Handle(XCAFDoc_ShapeTool) aSTool = XCAFDoc_DocumentTool::ShapeTool(theDoc->Main());
Handle(XCAFDoc_DimTolTool) aDGTTool = XCAFDoc_DocumentTool::DimTolTool(theDoc->Main());
@ -4057,8 +4064,8 @@ static void setDimObjectToXCAF(const Handle(Standard_Transient)& theEnt,
if (aDimL.FindAttribute(XCAFDoc_Dimension::GetID(), aDim))
{
readAnnotation(aTR, theEnt, aDimObj, theLocalFactors);
readConnectionPoints(aTR, theEnt, aDimObj, theLocalFactors);
readAnnotation(aTR, theEnt, aDimObj, theLocalFactors, theUseDEHealingParams);
readConnectionPoints(aTR, theEnt, aDimObj, theLocalFactors, theUseDEHealingParams);
aDim->SetObject(aDimObj);
}
}
@ -4180,7 +4187,8 @@ static void setGeomTolObjectToXCAF(const Handle(Standard_Transient)& theEnt,
const TDF_Label& theTolL,
const Handle(TDocStd_Document)& theDoc,
const Handle(XSControl_WorkSession)& theWS,
const StepData_Factors& theLocalFactors)
const StepData_Factors& theLocalFactors,
DE_ShapeFixParameters::HealingParamMap theUseDEHealingParams)
{
Handle(XCAFDoc_ShapeTool) aSTool = XCAFDoc_DocumentTool::ShapeTool(theDoc->Main());
Handle(XCAFDoc_DimTolTool) aDGTTool = XCAFDoc_DocumentTool::DimTolTool(theDoc->Main());
@ -4327,7 +4335,7 @@ static void setGeomTolObjectToXCAF(const Handle(Standard_Transient)& theEnt,
aTolObj->SetMaxValueModifier(aVal);
}
readAnnotation(aTR, theEnt, aTolObj, theLocalFactors);
readAnnotation(aTR, theEnt, aTolObj, theLocalFactors, theUseDEHealingParams);
aGTol->SetObject(aTolObj);
}
@ -4361,10 +4369,10 @@ Standard_Boolean STEPCAFControl_Reader::ReadGDTs(const Handle(XSControl_WorkSess
TDF_Label aGDTL = createGDTObjectInXCAF(anEnt, theDoc, theWS, theLocalFactors);
if (!aGDTL.IsNull()) {
if (anEnt->IsKind(STANDARD_TYPE(StepDimTol_GeometricTolerance))) {
setGeomTolObjectToXCAF(anEnt, aGDTL, theDoc, theWS, theLocalFactors);
setGeomTolObjectToXCAF(anEnt, aGDTL, theDoc, theWS, theLocalFactors, myDEParameters);
}
else {
setDimObjectToXCAF(anEnt, aGDTL, theDoc, theWS, theLocalFactors);
setDimObjectToXCAF(anEnt, aGDTL, theDoc, theWS, theLocalFactors, myDEParameters);
}
}
}
@ -4457,6 +4465,7 @@ Standard_Boolean STEPCAFControl_Reader::ReadGDTs(const Handle(XSControl_WorkSess
{
XSAlgo::AlgoContainer()->PrepareForTransfer();
STEPControl_ActorRead anActor(aModel);
anActor.SetDEHealingParameters(myDEParameters);
Handle(Transfer_TransientProcess) aTP = aTR->TransientProcess();
anActor.PrepareUnits(aDMIA->UsedRepresentation(), aTP, aLocalFactors);
aFact = aLocalFactors.LengthFactor();
@ -4813,6 +4822,7 @@ Standard_Boolean STEPCAFControl_Reader::ReadViews(const Handle(XSControl_WorkSes
{
XSAlgo::AlgoContainer()->PrepareForTransfer();
STEPControl_ActorRead anActor(aTP->Model());
anActor.SetDEHealingParameters(myDEParameters);
anActor.PrepareUnits(aDModel, aTP, aLocalFactors);
}

View File

@ -16,6 +16,7 @@
#ifndef _STEPCAFControl_Reader_HeaderFile
#define _STEPCAFControl_Reader_HeaderFile
#include <DE_ShapeFixParameters.hxx>
#include <STEPControl_Reader.hxx>
#include <StepData_Factors.hxx>
#include <IFSelect_ReturnStatus.hxx>
@ -207,6 +208,13 @@ public:
//! Get View mode
Standard_EXPORT Standard_Boolean GetViewMode() const;
//! Returns healing parameters map
Standard_EXPORT DE_ShapeFixParameters::HealingParamMap DEHealingParameters() const { return myDEParameters; }
//! Sets healing parameters map
Standard_EXPORT void SetDEHealingParameters(DE_ShapeFixParameters::HealingParamMap theDEHealingParams) { myDEParameters = theDEHealingParams; }
const XCAFDoc_DataMapOfShapeLabel& GetShapeLabelMap() const { return myMap; }
protected:
@ -375,6 +383,7 @@ private:
Standard_Boolean myMatMode;
Standard_Boolean myViewMode;
NCollection_DataMap<Handle(Standard_Transient), TDF_Label> myGDTMap;
DE_ShapeFixParameters::HealingParamMap myDEParameters;
};

View File

@ -120,6 +120,7 @@
#include <UnitsMethods.hxx>
#include <XSAlgo.hxx>
#include <XSAlgo_AlgoContainer.hxx>
#include <XSAlgo_AlgoProcessShape.hxx>
#include <StepRepr_ConstructiveGeometryRepresentationRelationship.hxx>
#include <StepRepr_ConstructiveGeometryRepresentation.hxx>
#include <StepRepr_MechanicalDesignAndDraughtingRelationship.hxx>
@ -935,11 +936,16 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity(
Handle(Standard_Transient) info;
// IMPORTANT: any fixing on non-manifold topology must be done after the shape is transferred from STEP
TopoDS_Shape fixedResult =
XSAlgo::AlgoContainer()->ProcessShape( comp, myPrecision, myMaxTol,
"read.step.resource.name",
"read.step.sequence", info,
aPS1.Next(), Standard_True);
XSAlgo_AlgoProcessShape aProcessShape;
aProcessShape.SetShape(comp);
aProcessShape.SetPrscfile("read.step.resource.name");
aProcessShape.SetPseq("read.step.sequence");
aProcessShape.SetInfo(info);
aProcessShape.SetNonManifold(Standard_True);
aProcessShape.SetProgressRange(theProgress);
aProcessShape.SetPrecision(myPrecision);
aProcessShape.SetMaxTol(myMaxTol);
TopoDS_Shape fixedResult = aProcessShape.ProcessShape();
XSAlgo::AlgoContainer()->MergeTransferInfo(TP, info, nbTPitems);
if (fixedResult.ShapeType() == TopAbs_COMPOUND)
@ -1555,11 +1561,15 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity
if (isManifold && aHasGeom)
{
Handle(Standard_Transient) info;
mappedShape =
XSAlgo::AlgoContainer()->ProcessShape( mappedShape, myPrecision, myMaxTol,
"read.step.resource.name",
"read.step.sequence", info,
aPS.Next());
XSAlgo_AlgoProcessShape aProcessShape;
aProcessShape.SetShape(mappedShape);
aProcessShape.SetPrscfile("read.step.resource.name");
aProcessShape.SetPseq("read.step.sequence");
aProcessShape.SetInfo(info);
aProcessShape.SetProgressRange(aPS.Next());
aProcessShape.SetPrecision(myPrecision);
aProcessShape.SetMaxTol(myMaxTol);
mappedShape = aProcessShape.ProcessShape();
XSAlgo::AlgoContainer()->MergeTransferInfo(TP, info, nbTPitems);
}
}
@ -1727,10 +1737,15 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity
TopoDS_Shape S = sb->Result();
Handle(Standard_Transient) info;
TopoDS_Shape shape = XSAlgo::AlgoContainer()->ProcessShape(S, myPrecision, myMaxTol,
"read.step.resource.name",
"read.step.sequence", info,
theProgress);
XSAlgo_AlgoProcessShape aProcessShape;
aProcessShape.SetShape(S);
aProcessShape.SetPrscfile("read.step.resource.name");
aProcessShape.SetPseq("read.step.sequence");
aProcessShape.SetInfo(info);
aProcessShape.SetProgressRange(theProgress);
aProcessShape.SetPrecision(myPrecision);
aProcessShape.SetMaxTol(myMaxTol);
TopoDS_Shape shape = aProcessShape.ProcessShape();
// TopoDS_Shape shape = XSAlgo::AlgoContainer()->PerformFixShape( S, TP, myPrecision, myMaxTol );
if (shape != S)
sb->SetResult(shape);

View File

@ -28,6 +28,7 @@
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
#include <Message_ProgressRange.hxx>
#include <Interface_InterfaceModel.hxx>
#include <DE_ShapeFixParameters.hxx>
class StepRepr_Representation;
class Standard_Transient;
@ -115,7 +116,11 @@ public:
gp_Trsf& Trsf,
const StepData_Factors& theLocalFactors = StepData_Factors());
//! Returns healing parameters map
Standard_EXPORT DE_ShapeFixParameters::HealingParamMap DEHealingParameters() const { return myDEParameters; }
//! Sets healing parameters map
Standard_EXPORT void SetDEHealingParameters(DE_ShapeFixParameters::HealingParamMap theDEHealingParams) { myDEParameters = theDEHealingParams; }
DEFINE_STANDARD_RTTIEXT(STEPControl_ActorRead,Transfer_ActorOfTransientProcess)
@ -226,6 +231,7 @@ private:
Standard_Real myMaxTol;
Handle(StepRepr_Representation) mySRContext;
Handle(Interface_InterfaceModel) myModel;
DE_ShapeFixParameters::HealingParamMap myDEParameters;
};

View File

@ -1003,7 +1003,6 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::TransferShape
if (hasGeometry(aShape))
{
Standard_Real maxTol = aStepModel->InternalParameters.ReadMaxPrecisionVal;
aShape = XSAlgo::AlgoContainer()->ProcessShape(xShape, Tol, maxTol,
"write.step.resource.name",
"write.step.sequence", info,

View File

@ -130,7 +130,8 @@ IFSelect_ReturnStatus STEPControl_Reader::ReadFile(const Standard_CString filena
WS()->InitTransferReader(4);
return status;
}
#include <STEPControl_ActorRead.hxx>
#include <MoniTool_Macros.hxx>
//=======================================================================
//function : ReadFile
//purpose :
@ -164,6 +165,8 @@ IFSelect_ReturnStatus STEPControl_Reader::ReadFile(const Standard_CString filena
WS()->SetModel(aStepModel);
WS()->SetLoadedFile(filename);
WS()->InitTransferReader(4);
//DeclareAndCast(STEPControl_ActorRead, anActor, WS()->TransferReader()->Actor());
//anActor->SetDEHealingParameters(DEHealingParameters());
return status;
}

View File

@ -67,7 +67,6 @@ IMPLEMENT_STANDARD_RTTIEXT(XSAlgo_AlgoContainer,Standard_Transient)
//purpose :
//=======================================================================
XSAlgo_AlgoContainer::XSAlgo_AlgoContainer()
: myDEHealingParamsUsage(false)
{
myTC = new XSAlgo_ToolContainer;
}
@ -107,8 +106,6 @@ TopoDS_Shape XSAlgo_AlgoContainer::ProcessShape(const TopoDS_Shape& theShape,
aProcessShape.SetPrscfile(thePrscfile);
aProcessShape.SetPseq(thePseq);
aProcessShape.SetInfo(theInfo);
aProcessShape.SetHealingParamsFlag(myDEHealingParamsUsage);
aProcessShape.SetHealingParameters(myHealingParameters);
aProcessShape.SetDetalisationLevel(theDetalisationLevel);
aProcessShape.SetNonManifold(theNonManifold);
aProcessShape.SetProgressRange(theProgress);

View File

@ -48,31 +48,6 @@ public:
//! Sets ToolContainer
void SetToolContainer (const Handle(XSAlgo_ToolContainer)& TC);
//! Gets healing parameters flag
const bool GetHealingParameteresFlag()
{
return myDEHealingParamsUsage;
}
//! Sets healing parameters flag
//! Uses defined DE healing parameters (if true) or parameters from resource file/Static_Interface
void SetHealingParametersFlag(const bool theHealingParamsFlag)
{
myDEHealingParamsUsage = theHealingParamsFlag;
}
//! Gets healing parameters
const DE_ShapeFixParameters& GetHealingParameteres()
{
return myHealingParameters;
}
//! Sets healing parameters
void SetHealingParameters(const DE_ShapeFixParameters& theHealingParams)
{
myHealingParameters = theHealingParams;
}
//! Returns ToolContainer
Handle(XSAlgo_ToolContainer) ToolContainer() const;
@ -137,8 +112,6 @@ public:
Standard_EXPORT virtual void MergeTransferInfo (const Handle(Transfer_FinderProcess)& FP, const Handle(Standard_Transient)& info) const;
DEFINE_STANDARD_RTTIEXT(XSAlgo_AlgoContainer,Standard_Transient)
protected:
@ -148,10 +121,7 @@ protected:
private:
bool myDEHealingParamsUsage;
Handle(XSAlgo_ToolContainer) myTC;
DE_ShapeFixParameters myHealingParameters;
};

View File

@ -39,7 +39,6 @@ XSAlgo_AlgoProcessShape::XSAlgo_AlgoProcessShape()
myMaxTol(1.),
myNonManifold(false),
myDetalisationLevel(TopAbs_VERTEX),
myDEHealingParamsUsage(false),
myProgressRange(Message_ProgressRange())
{
}
@ -55,18 +54,21 @@ TopoDS_Shape XSAlgo_AlgoProcessShape::ProcessShape()
return myShape;
}
if (myReShape.IsNull())
{
myReShape = new ShapeBuild_ReShape();
}
Standard_CString aRscfile = "";
Handle(ShapeProcess_ShapeContext) aContext = Handle(ShapeProcess_ShapeContext)::DownCast(myInfo);
if (aContext.IsNull())
{
aRscfile = Interface_Static::CVal(myPrscfile);
aContext = new ShapeProcess_ShapeContext(myShape, aRscfile);
if (myDEHealingParamsUsage)
{
// Use defined shape healing parameters
FillMap(aContext->ResourceManager()->GetMap());
}
else if (!aContext->ResourceManager()->IsInitialized())
}
if (myDEParameters.IsEmpty())
{
if (!aContext->ResourceManager()->IsInitialized())
{
// If resource file wasn't found, use static values instead
Interface_Static::FillMap(aContext->ResourceManager()->GetMap());
@ -145,64 +147,3 @@ TopoDS_Shape XSAlgo_AlgoProcessShape::ProcessShape()
return aContext->Result();
}
//=======================================================================
//function : FillMap
//purpose :
//=======================================================================
void XSAlgo_AlgoProcessShape::FillMap(NCollection_DataMap<TCollection_AsciiString, TCollection_AsciiString>& theMap) const
{
theMap.Clear();
theMap.Bind("Tolerance3d", TCollection_AsciiString(myHealingParameters.Tolerance3d));
theMap.Bind("MinTolerance3d", TCollection_AsciiString(myHealingParameters.MinTolerance3d));
theMap.Bind("MaxTolerance3d", TCollection_AsciiString(myHealingParameters.MaxTolerance3d));
theMap.Bind("FixFreeShellMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixFreeShellMode)));
theMap.Bind("FixFreeFaceMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixFreeFaceMode)));
theMap.Bind("FixFreeFaceMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixFreeFaceMode)));
theMap.Bind("FixFreeWireMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixFreeWireMode)));
theMap.Bind("FixSameParameterMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixSameParameterMode)));
theMap.Bind("FixSolidMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixSolidMode)));
theMap.Bind("FixShellOrientationMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixShellOrientationMode)));
theMap.Bind("CreateOpenSolidMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.CreateOpenSolidMode)));
theMap.Bind("FixShellMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixShellMode)));
theMap.Bind("FixFaceOrientationMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixFaceOrientationMode)));
theMap.Bind("FixFaceMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixFaceMode)));
theMap.Bind("FixWireMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixWireMode)));
theMap.Bind("FixOrientationMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixOrientationMode)));
theMap.Bind("FixAddNaturalBoundMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixAddNaturalBoundMode)));
theMap.Bind("FixMissingSeamMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixMissingSeamMode)));
theMap.Bind("FixSmallAreaWireMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixSmallAreaWireMode)));
theMap.Bind("RemoveSmallAreaFaceMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.RemoveSmallAreaFaceMode)));
theMap.Bind("FixIntersectingWiresMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixIntersectingWiresMode)));
theMap.Bind("FixLoopWiresMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixLoopWiresMode)));
theMap.Bind("FixSplitFaceMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixSplitFaceMode)));
theMap.Bind("AutoCorrectPrecisionMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.AutoCorrectPrecisionMode)));
theMap.Bind("ModifyTopologyMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.ModifyTopologyMode)));
theMap.Bind("ClosedWireMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.ClosedWireMode)));
theMap.Bind("PreferencePCurveMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.PreferencePCurveMode)));
theMap.Bind("FixReorderMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixReorderMode)));
theMap.Bind("FixSmallMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixSmallMode)));
theMap.Bind("FixConnectedMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixConnectedMode)));
theMap.Bind("FixEdgeCurvesMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixEdgeCurvesMode)));
theMap.Bind("FixDegeneratedMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixDegeneratedMode)));
theMap.Bind("FixLackingMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixLackingMode)));
theMap.Bind("FixSelfIntersectionMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixSelfIntersectionMode)));
theMap.Bind("RemoveLoopMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.RemoveLoopMode)));
theMap.Bind("FixReversed2dMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixReversed2dMode)));
theMap.Bind("FixRemovePCurveMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixRemovePCurveMode)));
theMap.Bind("FixRemoveCurve3dMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixRemoveCurve3dMode)));
theMap.Bind("FixAddPCurveMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixAddPCurveMode)));
theMap.Bind("FixAddCurve3dMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixAddCurve3dMode)));
theMap.Bind("FixSeamMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixSeamMode)));
theMap.Bind("FixShiftedMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixShiftedMode)));
theMap.Bind("FixEdgeSameParameterMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixEdgeSameParameterMode)));
theMap.Bind("FixNotchedEdgesMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixNotchedEdgesMode)));
theMap.Bind("FixTailMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixTailMode)));
theMap.Bind("MaxTailAngle", TCollection_AsciiString(static_cast<int>(myHealingParameters.MaxTailAngle)));
theMap.Bind("MaxTailWidth", TCollection_AsciiString(static_cast<int>(myHealingParameters.MaxTailWidth)));
theMap.Bind("FixSelfIntersectingEdgeMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixSelfIntersectingEdgeMode)));
theMap.Bind("FixIntersectingEdgesMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixIntersectingEdgesMode)));
theMap.Bind("FixNonAdjacentIntersectingEdgesMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixNonAdjacentIntersectingEdgesMode)));
theMap.Bind("FixVertexPositionMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixVertexPositionMode)));
theMap.Bind("FixVertexToleranceMode", TCollection_AsciiString(static_cast<int>(myHealingParameters.FixVertexToleranceMode)));
}

View File

@ -47,9 +47,6 @@ public:
//! Shape processing with specified tolerances
Standard_EXPORT TopoDS_Shape ProcessShape();
//! Fill map from DE shape healing parameters
void FillMap(NCollection_DataMap<TCollection_AsciiString, TCollection_AsciiString>& theMap) const;
//! Get shape for processing
const TopoDS_Shape& GetShape() { return myShape; }
@ -74,19 +71,6 @@ public:
//! Set information to be recorded in the translation map
void SetInfo(const Handle(Standard_Transient)& theInfo) { myInfo = theInfo; }
//! Get flag of healing parameters
const bool GetHealingParamsFlag() { return myDEHealingParamsUsage; }
//! Set flag of healing parameters
//! Uses defined DE healing parameters (if true) or parameters from resource file/Static_Interface
void SetHealingParamsFlag(const bool theHealingParamsFlag) { myDEHealingParamsUsage = theHealingParamsFlag; }
//! Get healing parameters
const DE_ShapeFixParameters& GetHealingParameters() { return myHealingParameters; }
//! Set healing parameters
void SetHealingParameters(const DE_ShapeFixParameters& theHealingParams) { myHealingParameters = theHealingParams; }
//! Get flag to proceed with non-manifold topology
const bool GetNonManifold() { return myNonManifold; }
@ -123,6 +107,12 @@ public:
//! Set tool to record the modifications of input shape
void SetReShape(const Handle(ShapeBuild_ReShape)& theReShape) { myReShape = theReShape; }
//! Returns healing parameters map
DE_ShapeFixParameters::HealingParamMap DEHealingParameters() const { return myDEParameters; }
//! Sets healing parameters map
void SetDEHealingParameters(DE_ShapeFixParameters::HealingParamMap theDEHealingParams) { myDEParameters = theDEHealingParams; }
DEFINE_STANDARD_RTTIEXT(XSAlgo_AlgoProcessShape, Standard_Transient)
private:
@ -134,11 +124,10 @@ private:
double myMaxTol;
bool myNonManifold;
TopAbs_ShapeEnum myDetalisationLevel;
bool myDEHealingParamsUsage;
DE_ShapeFixParameters myHealingParameters;
Message_ProgressRange myProgressRange;
Handle(Standard_Transient) myInfo;
Handle(ShapeBuild_ReShape) myReShape;
DE_ShapeFixParameters::HealingParamMap myDEParameters;
};

View File

@ -21,6 +21,7 @@
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <DE_ShapeFixParameters.hxx>
#include <TColStd_SequenceOfTransient.hxx>
#include <TopTools_SequenceOfShape.hxx>
#include <Standard_CString.hxx>
@ -260,7 +261,11 @@ public:
//! Gives statistics about Transfer
Standard_EXPORT void GetStatsTransfer (const Handle(TColStd_HSequenceOfTransient)& list, Standard_Integer& nbMapped, Standard_Integer& nbWithResult, Standard_Integer& nbWithFail) const;
//! Returns healing parameters map
Standard_EXPORT DE_ShapeFixParameters::HealingParamMap DEHealingParameters() const { return myDEParameters; }
//! Sets healing parameters map
Standard_EXPORT void SetDEHealingParameters(DE_ShapeFixParameters::HealingParamMap theDEHealingParams) { myDEParameters = theDEHealingParams; }
protected:
@ -280,6 +285,7 @@ private:
Handle(XSControl_WorkSession) thesession;
TopTools_SequenceOfShape theshapes;
DE_ShapeFixParameters::HealingParamMap myDEParameters;
};

View File

@ -835,6 +835,11 @@ static Standard_Integer ReadIges(Draw_Interpretor& theDI,
Standard_Integer onlyVisible = Interface_Static::IVal("read.iges.onlyvisible");
aReader.SetReadVisible(onlyVisible == 1);
DE_ShapeFixParameters aParameters;
DE_ShapeFixParameters::HealingParamMap aDEHealingParams = aReader.DEHealingParameters();
aParameters.FillParamsMap(aDEHealingParams);
aReader.SetDEHealingParameters(aDEHealingParams);
if (theNbArgs == 4)
{
Standard_Boolean mode = Standard_True;

View File

@ -17,6 +17,7 @@
#include <DDF.hxx>
#include <DDocStd.hxx>
#include <DDocStd_DrawDocument.hxx>
#include <DE_ShapeFixParameters.hxx>
#include <Draw.hxx>
#include <Draw_Interpretor.hxx>
#include <Draw_PluginMacro.hxx>
@ -693,6 +694,11 @@ static Standard_Integer ReadStep(Draw_Interpretor& theDI,
}
STEPCAFControl_Reader aReader(XSDRAW::Session(), isFileMode);
DE_ShapeFixParameters aParameters;
DE_ShapeFixParameters::HealingParamMap aDEHealingParams = aReader.ChangeReader().DEHealingParameters();
aParameters.FillParamsMap(aDEHealingParams);
aReader.ChangeReader().SetDEHealingParameters(aDEHealingParams);
if (!aModeStr.IsEmpty())
{
Standard_Boolean aMode = Standard_True;