From 570b34b666c62ca5840a3fe634c678d038187521 Mon Sep 17 00:00:00 2001 From: Pasukhin Dmitry Date: Thu, 13 Nov 2025 19:28:14 +0000 Subject: [PATCH] Coding - Removing simple gxx files (#827) - Converted generic template files to direct implementations for three packages (Extrema, MAT, TopBas/HLRAlgo) - Removed preprocessor macro-based includes and replaced with concrete type definitions - Updated CMake FILES lists to remove deprecated `.gxx` and `.lxx` files --- ...ESBasic_HArray1OfHArray1OfIGESEntity_0.cxx | 43 +++- .../IGESBasic_HArray1OfHArray1OfInteger_0.cxx | 41 +++- .../IGESBasic_HArray1OfHArray1OfReal_0.cxx | 41 +++- .../IGESBasic_HArray1OfHArray1OfXYZ_0.cxx | 40 +++- .../IGESBasic_HArray1OfHArray1OfXY_0.cxx | 40 +++- .../IGESData_GlobalNodeOfSpecificLib_0.cxx | 57 ++++-- .../IGESData_GlobalNodeOfWriterLib_0.cxx | 57 ++++-- .../IGESData/IGESData_NodeOfSpecificLib_0.cxx | 51 +++-- .../IGESData/IGESData_NodeOfWriterLib_0.cxx | 51 +++-- ...Array1OfHArray1OfTextDisplayTemplate_0.cxx | 43 +++- .../IGESSelect/IGESSelect_FileModifier_0.cxx | 10 +- .../IGESSelect/IGESSelect_ModelModifier_0.cxx | 40 +++- .../StepData_GlobalNodeOfWriterLib_0.cxx | 57 ++++-- .../StepData/StepData_NodeOfWriterLib_0.cxx | 51 +++-- .../StepSelect/StepSelect_FileModifier_0.cxx | 10 +- .../StepSelect/StepSelect_ModelModifier_0.cxx | 40 +++- .../TKXSBase/IFSelect/FILES.cmake | 2 - .../IFSelect/IFSelect_FileModifier.gxx | 19 -- .../IFSelect/IFSelect_ModelModifier.gxx | 45 ----- .../TKXSBase/Interface/FILES.cmake | 1 - .../Interface_GlobalNodeOfGeneralLib_0.cxx | 57 ++++-- .../Interface_GlobalNodeOfReaderLib_0.cxx | 57 ++++-- .../Interface/Interface_JaggedArray.gxx | 50 ----- .../Interface_NodeOfGeneralLib_0.cxx | 51 +++-- .../Interface/Interface_NodeOfReaderLib_0.cxx | 51 +++-- src/DataExchange/TKXSBase/LibCtl/FILES.cmake | 2 - .../TKXSBase/LibCtl/LibCtl_GlobalNode.gxx | 61 ------ .../TKXSBase/LibCtl/LibCtl_Node.gxx | 54 ----- ...ntersectorOfTheIntConicCurveOfGInter_0.cxx | 51 ++++- .../Geom2dInt_TheProjPCurOfGInter_0.cxx | 71 +++++-- ...plGradientOfTheComputeLineOfWLApprox_0.cxx | 48 +++-- ...ientOfTheComputeLineBezierOfWLApprox_0.cxx | 50 +++-- ...radientbisOfTheComputeLineOfWLApprox_0.cxx | 49 +++-- .../TKGeomAlgo/IntCurve/FILES.cmake | 1 - ...ve_MyImpParToolOfIntImpConicParConic_0.cxx | 48 ++++- .../IntCurve/IntCurve_ProjPCurGen.gxx | 63 ------ .../TKGeomAlgo/IntCurveSurface/FILES.cmake | 3 - .../IntCurveSurface_PolygonTool.gxx | 36 ---- .../IntCurveSurface_PolyhedronTool.gxx | 18 -- .../IntCurveSurface_QuadricCurveFunc.gxx | 57 ------ ...tCurveSurface_ThePolygonToolOfHInter_0.cxx | 30 ++- ...rveSurface_ThePolyhedronToolOfHInter_0.cxx | 10 +- ...QuadCurvFuncOfTheQuadCurvExactHInter_0.cxx | 50 ++++- .../TKGeomAlgo/IntImpParGen/FILES.cmake | 1 - .../IntImpParGen/IntImpParGen_ImpParTool.gxx | 51 ----- .../IntPatch_TheIWLineOfTheIWalking.hxx | 175 ++++++++++++++-- .../IntPatch_TheIWLineOfTheIWalking_0.cxx | 30 ++- .../IntPatch_ThePathPointOfTheSOnBounds.hxx | 78 ++++++-- .../IntPatch_ThePathPointOfTheSOnBounds_0.cxx | 41 +++- .../IntPatch_TheSegmentOfTheSOnBounds.hxx | 64 ++++-- .../IntPatch_TheSegmentOfTheSOnBounds_0.cxx | 29 ++- .../TKGeomAlgo/IntStart/FILES.cmake | 4 - .../IntStart/IntStart_PathPoint.gxx | 50 ----- .../IntStart/IntStart_PathPoint.lxx | 83 -------- .../TKGeomAlgo/IntStart/IntStart_Segment.gxx | 34 ---- .../TKGeomAlgo/IntStart/IntStart_Segment.lxx | 61 ------ .../TKGeomAlgo/IntWalk/FILES.cmake | 2 - .../TKGeomAlgo/IntWalk/IntWalk_IWLine.gxx | 39 ---- .../TKGeomAlgo/IntWalk/IntWalk_IWLine.lxx | 189 ------------------ .../Contap/Contap_TheIWLineOfTheIWalking.hxx | 175 ++++++++++++++-- .../Contap_TheIWLineOfTheIWalking_0.cxx | 29 ++- .../Contap/Contap_ThePathPointOfTheSearch.hxx | 78 ++++++-- .../Contap_ThePathPointOfTheSearch_0.cxx | 39 +++- .../Contap/Contap_TheSegmentOfTheSearch.hxx | 62 ++++-- .../Contap/Contap_TheSegmentOfTheSearch_0.cxx | 29 ++- .../TKHLR/HLRAlgo/HLRAlgo_Interference.hxx | 100 +++++++-- .../TKHLR/HLRAlgo/HLRAlgo_Interference_0.cxx | 25 ++- ...ntersectorOfTheIntConicCurveOfCInter_0.cxx | 51 ++++- .../HLRBRep_ThePolygonToolOfInterCSurf_0.cxx | 30 ++- ...LRBRep_ThePolyhedronToolOfInterCSurf_0.cxx | 9 +- .../HLRBRep/HLRBRep_TheProjPCurOfCInter_0.cxx | 71 +++++-- ...CurvFuncOfTheQuadCurvExactInterCSurf_0.cxx | 49 ++++- .../TKHLR/TopBas/FILES.cmake | 2 - .../TKHLR/TopBas/TopBas_Interference.gxx | 34 ---- .../TKHLR/TopBas/TopBas_Interference.lxx | 97 --------- .../TKHLR/TopBas/TopBas_TestInterference.hxx | 100 +++++++-- .../TopBas/TopBas_TestInterference_0.cxx | 25 ++- ...BSplGradientOfTheComputeLineOfApprox_0.cxx | 49 +++-- ...adientOfTheComputeLineBezierOfApprox_0.cxx | 52 +++-- ...yGradientbisOfTheComputeLineOfApprox_0.cxx | 49 +++-- .../TKTopAlgo/MAT/FILES.cmake | 2 - .../TKTopAlgo/MAT/MAT_TListNode.gxx | 19 -- .../TKTopAlgo/MAT/MAT_TListNode.lxx | 68 ------- .../MAT/MAT_TListNodeOfListOfBisector.hxx | 76 +++++-- .../MAT/MAT_TListNodeOfListOfBisector_0.cxx | 12 +- .../MAT/MAT_TListNodeOfListOfEdge.hxx | 73 +++++-- .../MAT/MAT_TListNodeOfListOfEdge_0.cxx | 12 +- ...BFGSOfMyBSplGradientOfBSplineCompute_0.cxx | 44 ++-- ...f_Gradient_BFGSOfMyGradientOfCompute_0.cxx | 43 ++-- ..._BFGSOfMyGradientbisOfBSplineCompute_0.cxx | 44 ++-- .../AppDef_Gradient_BFGSOfTheGradient_0.cxx | 43 ++-- .../AppParCurves_BSpGradient_BFGS.gxx | 48 ----- .../AppParCurves_Gradient_BFGS.gxx | 46 ----- .../TKGeomBase/AppParCurves/FILES.cmake | 2 - .../TKGeomBase/Extrema/Extrema_POnCurv.hxx | 20 +- .../TKGeomBase/Extrema/Extrema_POnCurv2d.hxx | 20 +- .../Extrema/Extrema_POnCurv2d_0.cxx | 21 +- .../TKGeomBase/Extrema/Extrema_POnCurv_0.cxx | 21 +- .../TKGeomBase/Extrema/Extrema_Point.gxx | 30 --- .../TKGeomBase/Extrema/Extrema_Point.lxx | 23 --- .../TKGeomBase/Extrema/FILES.cmake | 2 - 101 files changed, 2367 insertions(+), 2095 deletions(-) delete mode 100644 src/DataExchange/TKXSBase/IFSelect/IFSelect_FileModifier.gxx delete mode 100644 src/DataExchange/TKXSBase/IFSelect/IFSelect_ModelModifier.gxx delete mode 100644 src/DataExchange/TKXSBase/Interface/Interface_JaggedArray.gxx delete mode 100644 src/DataExchange/TKXSBase/LibCtl/LibCtl_GlobalNode.gxx delete mode 100644 src/DataExchange/TKXSBase/LibCtl/LibCtl_Node.gxx delete mode 100644 src/ModelingAlgorithms/TKGeomAlgo/IntCurve/IntCurve_ProjPCurGen.gxx delete mode 100644 src/ModelingAlgorithms/TKGeomAlgo/IntCurveSurface/IntCurveSurface_PolygonTool.gxx delete mode 100644 src/ModelingAlgorithms/TKGeomAlgo/IntCurveSurface/IntCurveSurface_PolyhedronTool.gxx delete mode 100644 src/ModelingAlgorithms/TKGeomAlgo/IntCurveSurface/IntCurveSurface_QuadricCurveFunc.gxx delete mode 100644 src/ModelingAlgorithms/TKGeomAlgo/IntImpParGen/IntImpParGen_ImpParTool.gxx delete mode 100644 src/ModelingAlgorithms/TKGeomAlgo/IntStart/IntStart_PathPoint.gxx delete mode 100644 src/ModelingAlgorithms/TKGeomAlgo/IntStart/IntStart_PathPoint.lxx delete mode 100644 src/ModelingAlgorithms/TKGeomAlgo/IntStart/IntStart_Segment.gxx delete mode 100644 src/ModelingAlgorithms/TKGeomAlgo/IntStart/IntStart_Segment.lxx delete mode 100644 src/ModelingAlgorithms/TKGeomAlgo/IntWalk/IntWalk_IWLine.gxx delete mode 100644 src/ModelingAlgorithms/TKGeomAlgo/IntWalk/IntWalk_IWLine.lxx delete mode 100644 src/ModelingAlgorithms/TKHLR/TopBas/TopBas_Interference.gxx delete mode 100644 src/ModelingAlgorithms/TKHLR/TopBas/TopBas_Interference.lxx delete mode 100644 src/ModelingAlgorithms/TKTopAlgo/MAT/MAT_TListNode.gxx delete mode 100644 src/ModelingAlgorithms/TKTopAlgo/MAT/MAT_TListNode.lxx delete mode 100644 src/ModelingData/TKGeomBase/AppParCurves/AppParCurves_BSpGradient_BFGS.gxx delete mode 100644 src/ModelingData/TKGeomBase/AppParCurves/AppParCurves_Gradient_BFGS.gxx delete mode 100644 src/ModelingData/TKGeomBase/Extrema/Extrema_Point.gxx delete mode 100644 src/ModelingData/TKGeomBase/Extrema/Extrema_Point.lxx diff --git a/src/DataExchange/TKDEIGES/IGESBasic/IGESBasic_HArray1OfHArray1OfIGESEntity_0.cxx b/src/DataExchange/TKDEIGES/IGESBasic/IGESBasic_HArray1OfHArray1OfIGESEntity_0.cxx index 6c196dbdcf..1dd334d9cf 100644 --- a/src/DataExchange/TKDEIGES/IGESBasic/IGESBasic_HArray1OfHArray1OfIGESEntity_0.cxx +++ b/src/DataExchange/TKDEIGES/IGESBasic/IGESBasic_HArray1OfHArray1OfIGESEntity_0.cxx @@ -18,10 +18,39 @@ #include -#define Handle_TheKey Handle(IGESData_HArray1OfIGESEntity) -#define TheKey IGESData_HArray1OfIGESEntity -#define TheKey_hxx -#define Interface_JaggedArray IGESBasic_HArray1OfHArray1OfIGESEntity -#define Interface_JaggedArray_hxx -#define Handle_Interface_JaggedArray Handle(IGESBasic_HArray1OfHArray1OfIGESEntity) -#include +IGESBasic_HArray1OfHArray1OfIGESEntity::IGESBasic_HArray1OfHArray1OfIGESEntity( + const Standard_Integer low, + const Standard_Integer up) + : thelist(low, up) +{ + Handle(Standard_Transient) nulo; + thelist.Init(nulo); +} + +Standard_Integer IGESBasic_HArray1OfHArray1OfIGESEntity::Lower() const +{ + return thelist.Lower(); +} + +Standard_Integer IGESBasic_HArray1OfHArray1OfIGESEntity::Upper() const +{ + return thelist.Upper(); +} + +Standard_Integer IGESBasic_HArray1OfHArray1OfIGESEntity::Length() const +{ + return thelist.Length(); +} + +void IGESBasic_HArray1OfHArray1OfIGESEntity::SetValue( + const Standard_Integer num, + const Handle(IGESData_HArray1OfIGESEntity)& val) +{ + thelist.SetValue(num, val); +} + +Handle(IGESData_HArray1OfIGESEntity) IGESBasic_HArray1OfHArray1OfIGESEntity::Value( + const Standard_Integer num) const +{ + return Handle(IGESData_HArray1OfIGESEntity)::DownCast(thelist.Value(num)); +} diff --git a/src/DataExchange/TKDEIGES/IGESBasic/IGESBasic_HArray1OfHArray1OfInteger_0.cxx b/src/DataExchange/TKDEIGES/IGESBasic/IGESBasic_HArray1OfHArray1OfInteger_0.cxx index c644d7feef..8d466a7cea 100644 --- a/src/DataExchange/TKDEIGES/IGESBasic/IGESBasic_HArray1OfHArray1OfInteger_0.cxx +++ b/src/DataExchange/TKDEIGES/IGESBasic/IGESBasic_HArray1OfHArray1OfInteger_0.cxx @@ -18,10 +18,37 @@ #include -#define Handle_TheKey Handle(TColStd_HArray1OfInteger) -#define TheKey TColStd_HArray1OfInteger -#define TheKey_hxx -#define Interface_JaggedArray IGESBasic_HArray1OfHArray1OfInteger -#define Interface_JaggedArray_hxx -#define Handle_Interface_JaggedArray Handle(IGESBasic_HArray1OfHArray1OfInteger) -#include +IGESBasic_HArray1OfHArray1OfInteger::IGESBasic_HArray1OfHArray1OfInteger(const Standard_Integer low, + const Standard_Integer up) + : thelist(low, up) +{ + Handle(Standard_Transient) nulo; + thelist.Init(nulo); +} + +Standard_Integer IGESBasic_HArray1OfHArray1OfInteger::Lower() const +{ + return thelist.Lower(); +} + +Standard_Integer IGESBasic_HArray1OfHArray1OfInteger::Upper() const +{ + return thelist.Upper(); +} + +Standard_Integer IGESBasic_HArray1OfHArray1OfInteger::Length() const +{ + return thelist.Length(); +} + +void IGESBasic_HArray1OfHArray1OfInteger::SetValue(const Standard_Integer num, + const Handle(TColStd_HArray1OfInteger)& val) +{ + thelist.SetValue(num, val); +} + +Handle(TColStd_HArray1OfInteger) IGESBasic_HArray1OfHArray1OfInteger::Value( + const Standard_Integer num) const +{ + return Handle(TColStd_HArray1OfInteger)::DownCast(thelist.Value(num)); +} diff --git a/src/DataExchange/TKDEIGES/IGESBasic/IGESBasic_HArray1OfHArray1OfReal_0.cxx b/src/DataExchange/TKDEIGES/IGESBasic/IGESBasic_HArray1OfHArray1OfReal_0.cxx index bdf44ba6ea..f0df9fa1f5 100644 --- a/src/DataExchange/TKDEIGES/IGESBasic/IGESBasic_HArray1OfHArray1OfReal_0.cxx +++ b/src/DataExchange/TKDEIGES/IGESBasic/IGESBasic_HArray1OfHArray1OfReal_0.cxx @@ -18,10 +18,37 @@ #include -#define Handle_TheKey Handle(TColStd_HArray1OfReal) -#define TheKey TColStd_HArray1OfReal -#define TheKey_hxx -#define Interface_JaggedArray IGESBasic_HArray1OfHArray1OfReal -#define Interface_JaggedArray_hxx -#define Handle_Interface_JaggedArray Handle(IGESBasic_HArray1OfHArray1OfReal) -#include +IGESBasic_HArray1OfHArray1OfReal::IGESBasic_HArray1OfHArray1OfReal(const Standard_Integer low, + const Standard_Integer up) + : thelist(low, up) +{ + Handle(Standard_Transient) nulo; + thelist.Init(nulo); +} + +Standard_Integer IGESBasic_HArray1OfHArray1OfReal::Lower() const +{ + return thelist.Lower(); +} + +Standard_Integer IGESBasic_HArray1OfHArray1OfReal::Upper() const +{ + return thelist.Upper(); +} + +Standard_Integer IGESBasic_HArray1OfHArray1OfReal::Length() const +{ + return thelist.Length(); +} + +void IGESBasic_HArray1OfHArray1OfReal::SetValue(const Standard_Integer num, + const Handle(TColStd_HArray1OfReal)& val) +{ + thelist.SetValue(num, val); +} + +Handle(TColStd_HArray1OfReal) IGESBasic_HArray1OfHArray1OfReal::Value( + const Standard_Integer num) const +{ + return Handle(TColStd_HArray1OfReal)::DownCast(thelist.Value(num)); +} diff --git a/src/DataExchange/TKDEIGES/IGESBasic/IGESBasic_HArray1OfHArray1OfXYZ_0.cxx b/src/DataExchange/TKDEIGES/IGESBasic/IGESBasic_HArray1OfHArray1OfXYZ_0.cxx index 739632afe3..7eef563e8b 100644 --- a/src/DataExchange/TKDEIGES/IGESBasic/IGESBasic_HArray1OfHArray1OfXYZ_0.cxx +++ b/src/DataExchange/TKDEIGES/IGESBasic/IGESBasic_HArray1OfHArray1OfXYZ_0.cxx @@ -18,10 +18,36 @@ #include -#define Handle_TheKey Handle(TColgp_HArray1OfXYZ) -#define TheKey TColgp_HArray1OfXYZ -#define TheKey_hxx -#define Interface_JaggedArray IGESBasic_HArray1OfHArray1OfXYZ -#define Interface_JaggedArray_hxx -#define Handle_Interface_JaggedArray Handle(IGESBasic_HArray1OfHArray1OfXYZ) -#include +IGESBasic_HArray1OfHArray1OfXYZ::IGESBasic_HArray1OfHArray1OfXYZ(const Standard_Integer low, + const Standard_Integer up) + : thelist(low, up) +{ + Handle(Standard_Transient) nulo; + thelist.Init(nulo); +} + +Standard_Integer IGESBasic_HArray1OfHArray1OfXYZ::Lower() const +{ + return thelist.Lower(); +} + +Standard_Integer IGESBasic_HArray1OfHArray1OfXYZ::Upper() const +{ + return thelist.Upper(); +} + +Standard_Integer IGESBasic_HArray1OfHArray1OfXYZ::Length() const +{ + return thelist.Length(); +} + +void IGESBasic_HArray1OfHArray1OfXYZ::SetValue(const Standard_Integer num, + const Handle(TColgp_HArray1OfXYZ)& val) +{ + thelist.SetValue(num, val); +} + +Handle(TColgp_HArray1OfXYZ) IGESBasic_HArray1OfHArray1OfXYZ::Value(const Standard_Integer num) const +{ + return Handle(TColgp_HArray1OfXYZ)::DownCast(thelist.Value(num)); +} diff --git a/src/DataExchange/TKDEIGES/IGESBasic/IGESBasic_HArray1OfHArray1OfXY_0.cxx b/src/DataExchange/TKDEIGES/IGESBasic/IGESBasic_HArray1OfHArray1OfXY_0.cxx index cc38f86276..a7fe0f0ddd 100644 --- a/src/DataExchange/TKDEIGES/IGESBasic/IGESBasic_HArray1OfHArray1OfXY_0.cxx +++ b/src/DataExchange/TKDEIGES/IGESBasic/IGESBasic_HArray1OfHArray1OfXY_0.cxx @@ -18,10 +18,36 @@ #include -#define Handle_TheKey Handle(TColgp_HArray1OfXY) -#define TheKey TColgp_HArray1OfXY -#define TheKey_hxx -#define Interface_JaggedArray IGESBasic_HArray1OfHArray1OfXY -#define Interface_JaggedArray_hxx -#define Handle_Interface_JaggedArray Handle(IGESBasic_HArray1OfHArray1OfXY) -#include +IGESBasic_HArray1OfHArray1OfXY::IGESBasic_HArray1OfHArray1OfXY(const Standard_Integer low, + const Standard_Integer up) + : thelist(low, up) +{ + Handle(Standard_Transient) nulo; + thelist.Init(nulo); +} + +Standard_Integer IGESBasic_HArray1OfHArray1OfXY::Lower() const +{ + return thelist.Lower(); +} + +Standard_Integer IGESBasic_HArray1OfHArray1OfXY::Upper() const +{ + return thelist.Upper(); +} + +Standard_Integer IGESBasic_HArray1OfHArray1OfXY::Length() const +{ + return thelist.Length(); +} + +void IGESBasic_HArray1OfHArray1OfXY::SetValue(const Standard_Integer num, + const Handle(TColgp_HArray1OfXY)& val) +{ + thelist.SetValue(num, val); +} + +Handle(TColgp_HArray1OfXY) IGESBasic_HArray1OfHArray1OfXY::Value(const Standard_Integer num) const +{ + return Handle(TColgp_HArray1OfXY)::DownCast(thelist.Value(num)); +} diff --git a/src/DataExchange/TKDEIGES/IGESData/IGESData_GlobalNodeOfSpecificLib_0.cxx b/src/DataExchange/TKDEIGES/IGESData/IGESData_GlobalNodeOfSpecificLib_0.cxx index 341466ee99..df58ab6f17 100644 --- a/src/DataExchange/TKDEIGES/IGESData/IGESData_GlobalNodeOfSpecificLib_0.cxx +++ b/src/DataExchange/TKDEIGES/IGESData/IGESData_GlobalNodeOfSpecificLib_0.cxx @@ -24,20 +24,43 @@ #include #include -#define TheObject Handle(IGESData_IGESEntity) -#define TheObject_hxx -#define Handle_TheModule Handle(IGESData_SpecificModule) -#define TheModule IGESData_SpecificModule -#define TheModule_hxx -#define Handle_TheProtocol Handle(IGESData_Protocol) -#define TheProtocol IGESData_Protocol -#define TheProtocol_hxx -#define LibCtl_GlobalNode IGESData_GlobalNodeOfSpecificLib -#define LibCtl_GlobalNode_hxx -#define LibCtl_Node IGESData_NodeOfSpecificLib -#define LibCtl_Node_hxx -#define Handle_LibCtl_GlobalNode Handle(IGESData_GlobalNodeOfSpecificLib) -#define Handle_LibCtl_Node Handle(IGESData_NodeOfSpecificLib) -#define LibCtl_Library IGESData_SpecificLib -#define LibCtl_Library_hxx -#include +IGESData_GlobalNodeOfSpecificLib::IGESData_GlobalNodeOfSpecificLib() {} + +void IGESData_GlobalNodeOfSpecificLib::Add(const Handle(IGESData_SpecificModule)& amodule, + const Handle(IGESData_Protocol)& aprotocol) +{ + if (themod == amodule) + return; + if (theprot == aprotocol) + themod = amodule; + else if (thenext.IsNull()) + { + if (themod.IsNull()) + { + themod = amodule; + theprot = aprotocol; + } + else + { + thenext = new IGESData_GlobalNodeOfSpecificLib; + thenext->Add(amodule, aprotocol); + } + } + else + thenext->Add(amodule, aprotocol); +} + +const Handle(IGESData_SpecificModule)& IGESData_GlobalNodeOfSpecificLib::Module() const +{ + return themod; +} + +const Handle(IGESData_Protocol)& IGESData_GlobalNodeOfSpecificLib::Protocol() const +{ + return theprot; +} + +const Handle(IGESData_GlobalNodeOfSpecificLib)& IGESData_GlobalNodeOfSpecificLib::Next() const +{ + return thenext; +} diff --git a/src/DataExchange/TKDEIGES/IGESData/IGESData_GlobalNodeOfWriterLib_0.cxx b/src/DataExchange/TKDEIGES/IGESData/IGESData_GlobalNodeOfWriterLib_0.cxx index 919abf863a..cb5ae08bea 100644 --- a/src/DataExchange/TKDEIGES/IGESData/IGESData_GlobalNodeOfWriterLib_0.cxx +++ b/src/DataExchange/TKDEIGES/IGESData/IGESData_GlobalNodeOfWriterLib_0.cxx @@ -24,20 +24,43 @@ #include #include -#define TheObject Handle(IGESData_IGESEntity) -#define TheObject_hxx -#define Handle_TheModule Handle(IGESData_ReadWriteModule) -#define TheModule IGESData_ReadWriteModule -#define TheModule_hxx -#define Handle_TheProtocol Handle(IGESData_Protocol) -#define TheProtocol IGESData_Protocol -#define TheProtocol_hxx -#define LibCtl_GlobalNode IGESData_GlobalNodeOfWriterLib -#define LibCtl_GlobalNode_hxx -#define LibCtl_Node IGESData_NodeOfWriterLib -#define LibCtl_Node_hxx -#define Handle_LibCtl_GlobalNode Handle(IGESData_GlobalNodeOfWriterLib) -#define Handle_LibCtl_Node Handle(IGESData_NodeOfWriterLib) -#define LibCtl_Library IGESData_WriterLib -#define LibCtl_Library_hxx -#include +IGESData_GlobalNodeOfWriterLib::IGESData_GlobalNodeOfWriterLib() {} + +void IGESData_GlobalNodeOfWriterLib::Add(const Handle(IGESData_ReadWriteModule)& amodule, + const Handle(IGESData_Protocol)& aprotocol) +{ + if (themod == amodule) + return; + if (theprot == aprotocol) + themod = amodule; + else if (thenext.IsNull()) + { + if (themod.IsNull()) + { + themod = amodule; + theprot = aprotocol; + } + else + { + thenext = new IGESData_GlobalNodeOfWriterLib; + thenext->Add(amodule, aprotocol); + } + } + else + thenext->Add(amodule, aprotocol); +} + +const Handle(IGESData_ReadWriteModule)& IGESData_GlobalNodeOfWriterLib::Module() const +{ + return themod; +} + +const Handle(IGESData_Protocol)& IGESData_GlobalNodeOfWriterLib::Protocol() const +{ + return theprot; +} + +const Handle(IGESData_GlobalNodeOfWriterLib)& IGESData_GlobalNodeOfWriterLib::Next() const +{ + return thenext; +} diff --git a/src/DataExchange/TKDEIGES/IGESData/IGESData_NodeOfSpecificLib_0.cxx b/src/DataExchange/TKDEIGES/IGESData/IGESData_NodeOfSpecificLib_0.cxx index 807b7a4e7d..9a1b2b9ebd 100644 --- a/src/DataExchange/TKDEIGES/IGESData/IGESData_NodeOfSpecificLib_0.cxx +++ b/src/DataExchange/TKDEIGES/IGESData/IGESData_NodeOfSpecificLib_0.cxx @@ -24,20 +24,37 @@ #include #include -#define TheObject Handle(IGESData_IGESEntity) -#define TheObject_hxx -#define Handle_TheModule Handle(IGESData_SpecificModule) -#define TheModule IGESData_SpecificModule -#define TheModule_hxx -#define Handle_TheProtocol Handle(IGESData_Protocol) -#define TheProtocol IGESData_Protocol -#define TheProtocol_hxx -#define LibCtl_GlobalNode IGESData_GlobalNodeOfSpecificLib -#define LibCtl_GlobalNode_hxx -#define LibCtl_Node IGESData_NodeOfSpecificLib -#define LibCtl_Node_hxx -#define Handle_LibCtl_GlobalNode Handle(IGESData_GlobalNodeOfSpecificLib) -#define Handle_LibCtl_Node Handle(IGESData_NodeOfSpecificLib) -#define LibCtl_Library IGESData_SpecificLib -#define LibCtl_Library_hxx -#include +IGESData_NodeOfSpecificLib::IGESData_NodeOfSpecificLib() {} + +void IGESData_NodeOfSpecificLib::AddNode(const Handle(IGESData_GlobalNodeOfSpecificLib)& anode) +{ + if (thenode == anode) + return; + if (thenext.IsNull()) + { + if (thenode.IsNull()) + thenode = anode; + else + { + thenext = new IGESData_NodeOfSpecificLib; + thenext->AddNode(anode); + } + } + else + thenext->AddNode(anode); +} + +const Handle(IGESData_SpecificModule)& IGESData_NodeOfSpecificLib::Module() const +{ + return thenode->Module(); +} + +const Handle(IGESData_Protocol)& IGESData_NodeOfSpecificLib::Protocol() const +{ + return thenode->Protocol(); +} + +const Handle(IGESData_NodeOfSpecificLib)& IGESData_NodeOfSpecificLib::Next() const +{ + return thenext; +} diff --git a/src/DataExchange/TKDEIGES/IGESData/IGESData_NodeOfWriterLib_0.cxx b/src/DataExchange/TKDEIGES/IGESData/IGESData_NodeOfWriterLib_0.cxx index be545f1e3d..7006605ee5 100644 --- a/src/DataExchange/TKDEIGES/IGESData/IGESData_NodeOfWriterLib_0.cxx +++ b/src/DataExchange/TKDEIGES/IGESData/IGESData_NodeOfWriterLib_0.cxx @@ -24,20 +24,37 @@ #include #include -#define TheObject Handle(IGESData_IGESEntity) -#define TheObject_hxx -#define Handle_TheModule Handle(IGESData_ReadWriteModule) -#define TheModule IGESData_ReadWriteModule -#define TheModule_hxx -#define Handle_TheProtocol Handle(IGESData_Protocol) -#define TheProtocol IGESData_Protocol -#define TheProtocol_hxx -#define LibCtl_GlobalNode IGESData_GlobalNodeOfWriterLib -#define LibCtl_GlobalNode_hxx -#define LibCtl_Node IGESData_NodeOfWriterLib -#define LibCtl_Node_hxx -#define Handle_LibCtl_GlobalNode Handle(IGESData_GlobalNodeOfWriterLib) -#define Handle_LibCtl_Node Handle(IGESData_NodeOfWriterLib) -#define LibCtl_Library IGESData_WriterLib -#define LibCtl_Library_hxx -#include +IGESData_NodeOfWriterLib::IGESData_NodeOfWriterLib() {} + +void IGESData_NodeOfWriterLib::AddNode(const Handle(IGESData_GlobalNodeOfWriterLib)& anode) +{ + if (thenode == anode) + return; + if (thenext.IsNull()) + { + if (thenode.IsNull()) + thenode = anode; + else + { + thenext = new IGESData_NodeOfWriterLib; + thenext->AddNode(anode); + } + } + else + thenext->AddNode(anode); +} + +const Handle(IGESData_ReadWriteModule)& IGESData_NodeOfWriterLib::Module() const +{ + return thenode->Module(); +} + +const Handle(IGESData_Protocol)& IGESData_NodeOfWriterLib::Protocol() const +{ + return thenode->Protocol(); +} + +const Handle(IGESData_NodeOfWriterLib)& IGESData_NodeOfWriterLib::Next() const +{ + return thenext; +} diff --git a/src/DataExchange/TKDEIGES/IGESDefs/IGESDefs_HArray1OfHArray1OfTextDisplayTemplate_0.cxx b/src/DataExchange/TKDEIGES/IGESDefs/IGESDefs_HArray1OfHArray1OfTextDisplayTemplate_0.cxx index 3e7d663924..03ae480941 100644 --- a/src/DataExchange/TKDEIGES/IGESDefs/IGESDefs_HArray1OfHArray1OfTextDisplayTemplate_0.cxx +++ b/src/DataExchange/TKDEIGES/IGESDefs/IGESDefs_HArray1OfHArray1OfTextDisplayTemplate_0.cxx @@ -18,10 +18,39 @@ #include -#define Handle_TheKey Handle(IGESGraph_HArray1OfTextDisplayTemplate) -#define TheKey IGESGraph_HArray1OfTextDisplayTemplate -#define TheKey_hxx -#define Interface_JaggedArray IGESDefs_HArray1OfHArray1OfTextDisplayTemplate -#define Interface_JaggedArray_hxx -#define Handle_Interface_JaggedArray Handle(IGESDefs_HArray1OfHArray1OfTextDisplayTemplate) -#include +IGESDefs_HArray1OfHArray1OfTextDisplayTemplate::IGESDefs_HArray1OfHArray1OfTextDisplayTemplate( + const Standard_Integer low, + const Standard_Integer up) + : thelist(low, up) +{ + Handle(Standard_Transient) nulo; + thelist.Init(nulo); +} + +Standard_Integer IGESDefs_HArray1OfHArray1OfTextDisplayTemplate::Lower() const +{ + return thelist.Lower(); +} + +Standard_Integer IGESDefs_HArray1OfHArray1OfTextDisplayTemplate::Upper() const +{ + return thelist.Upper(); +} + +Standard_Integer IGESDefs_HArray1OfHArray1OfTextDisplayTemplate::Length() const +{ + return thelist.Length(); +} + +void IGESDefs_HArray1OfHArray1OfTextDisplayTemplate::SetValue( + const Standard_Integer num, + const Handle(IGESGraph_HArray1OfTextDisplayTemplate)& val) +{ + thelist.SetValue(num, val); +} + +Handle(IGESGraph_HArray1OfTextDisplayTemplate) IGESDefs_HArray1OfHArray1OfTextDisplayTemplate:: + Value(const Standard_Integer num) const +{ + return Handle(IGESGraph_HArray1OfTextDisplayTemplate)::DownCast(thelist.Value(num)); +} diff --git a/src/DataExchange/TKDEIGES/IGESSelect/IGESSelect_FileModifier_0.cxx b/src/DataExchange/TKDEIGES/IGESSelect/IGESSelect_FileModifier_0.cxx index 44f626e5f8..c2c5d01207 100644 --- a/src/DataExchange/TKDEIGES/IGESSelect/IGESSelect_FileModifier_0.cxx +++ b/src/DataExchange/TKDEIGES/IGESSelect/IGESSelect_FileModifier_0.cxx @@ -21,9 +21,7 @@ #include #include -#define Writer IGESData_IGESWriter -#define Writer_hxx -#define IFSelect_FileModifier IGESSelect_FileModifier -#define IFSelect_FileModifier_hxx -#define Handle_IFSelect_FileModifier Handle(IGESSelect_FileModifier) -#include +IGESSelect_FileModifier::IGESSelect_FileModifier() + : IFSelect_GeneralModifier(Standard_False) +{ +} diff --git a/src/DataExchange/TKDEIGES/IGESSelect/IGESSelect_ModelModifier_0.cxx b/src/DataExchange/TKDEIGES/IGESSelect/IGESSelect_ModelModifier_0.cxx index 7330662208..310c416f99 100644 --- a/src/DataExchange/TKDEIGES/IGESSelect/IGESSelect_ModelModifier_0.cxx +++ b/src/DataExchange/TKDEIGES/IGESSelect/IGESSelect_ModelModifier_0.cxx @@ -24,14 +24,34 @@ #include #include #include +#include -#define Handle_Model Handle(IGESData_IGESModel) -#define Model IGESData_IGESModel -#define Model_hxx -#define Handle_Proto Handle(IGESData_Protocol) -#define Proto IGESData_Protocol -#define Proto_hxx -#define IFSelect_ModelModifier IGESSelect_ModelModifier -#define IFSelect_ModelModifier_hxx -#define Handle_IFSelect_ModelModifier Handle(IGESSelect_ModelModifier) -#include +IGESSelect_ModelModifier::IGESSelect_ModelModifier(const Standard_Boolean grf) + : IFSelect_Modifier(grf) +{ +} + +void IGESSelect_ModelModifier::Perform(IFSelect_ContextModif& ctx, + const Handle(Interface_InterfaceModel)& target, + const Handle(Interface_Protocol)& protocol, + Interface_CopyTool& TC) const +{ + ctx.TraceModifier(this); + Handle(IGESData_IGESModel) targ = Handle(IGESData_IGESModel)::DownCast(target); + Handle(IGESData_Protocol) prot = Handle(IGESData_Protocol)::DownCast(protocol); + if (targ.IsNull()) + { + ctx.CCheck()->AddFail("Model to Modify : unproper type"); + return; + } + PerformProtocol(ctx, targ, prot, TC); +} + +void IGESSelect_ModelModifier::PerformProtocol(IFSelect_ContextModif& ctx, + const Handle(IGESData_IGESModel)& target, + const Handle(IGESData_Protocol)& protocol, + Interface_CopyTool& TC) const +{ + ctx.SetProtocol(protocol); + Performing(ctx, target, TC); +} diff --git a/src/DataExchange/TKDESTEP/StepData/StepData_GlobalNodeOfWriterLib_0.cxx b/src/DataExchange/TKDESTEP/StepData/StepData_GlobalNodeOfWriterLib_0.cxx index ecdf0a3c30..ad8a931dbe 100644 --- a/src/DataExchange/TKDESTEP/StepData/StepData_GlobalNodeOfWriterLib_0.cxx +++ b/src/DataExchange/TKDESTEP/StepData/StepData_GlobalNodeOfWriterLib_0.cxx @@ -24,20 +24,43 @@ #include #include -#define TheObject Handle(Standard_Transient) -#define TheObject_hxx -#define Handle_TheModule Handle(StepData_ReadWriteModule) -#define TheModule StepData_ReadWriteModule -#define TheModule_hxx -#define Handle_TheProtocol Handle(StepData_Protocol) -#define TheProtocol StepData_Protocol -#define TheProtocol_hxx -#define LibCtl_GlobalNode StepData_GlobalNodeOfWriterLib -#define LibCtl_GlobalNode_hxx -#define LibCtl_Node StepData_NodeOfWriterLib -#define LibCtl_Node_hxx -#define Handle_LibCtl_GlobalNode Handle(StepData_GlobalNodeOfWriterLib) -#define Handle_LibCtl_Node Handle(StepData_NodeOfWriterLib) -#define LibCtl_Library StepData_WriterLib -#define LibCtl_Library_hxx -#include +StepData_GlobalNodeOfWriterLib::StepData_GlobalNodeOfWriterLib() {} + +void StepData_GlobalNodeOfWriterLib::Add(const Handle(StepData_ReadWriteModule)& amodule, + const Handle(StepData_Protocol)& aprotocol) +{ + if (themod == amodule) + return; + if (theprot == aprotocol) + themod = amodule; + else if (thenext.IsNull()) + { + if (themod.IsNull()) + { + themod = amodule; + theprot = aprotocol; + } + else + { + thenext = new StepData_GlobalNodeOfWriterLib; + thenext->Add(amodule, aprotocol); + } + } + else + thenext->Add(amodule, aprotocol); +} + +const Handle(StepData_ReadWriteModule)& StepData_GlobalNodeOfWriterLib::Module() const +{ + return themod; +} + +const Handle(StepData_Protocol)& StepData_GlobalNodeOfWriterLib::Protocol() const +{ + return theprot; +} + +const Handle(StepData_GlobalNodeOfWriterLib)& StepData_GlobalNodeOfWriterLib::Next() const +{ + return thenext; +} diff --git a/src/DataExchange/TKDESTEP/StepData/StepData_NodeOfWriterLib_0.cxx b/src/DataExchange/TKDESTEP/StepData/StepData_NodeOfWriterLib_0.cxx index a01a39f7b5..e872b36a96 100644 --- a/src/DataExchange/TKDESTEP/StepData/StepData_NodeOfWriterLib_0.cxx +++ b/src/DataExchange/TKDESTEP/StepData/StepData_NodeOfWriterLib_0.cxx @@ -24,20 +24,37 @@ #include #include -#define TheObject Handle(Standard_Transient) -#define TheObject_hxx -#define Handle_TheModule Handle(StepData_ReadWriteModule) -#define TheModule StepData_ReadWriteModule -#define TheModule_hxx -#define Handle_TheProtocol Handle(StepData_Protocol) -#define TheProtocol StepData_Protocol -#define TheProtocol_hxx -#define LibCtl_GlobalNode StepData_GlobalNodeOfWriterLib -#define LibCtl_GlobalNode_hxx -#define LibCtl_Node StepData_NodeOfWriterLib -#define LibCtl_Node_hxx -#define Handle_LibCtl_GlobalNode Handle(StepData_GlobalNodeOfWriterLib) -#define Handle_LibCtl_Node Handle(StepData_NodeOfWriterLib) -#define LibCtl_Library StepData_WriterLib -#define LibCtl_Library_hxx -#include +StepData_NodeOfWriterLib::StepData_NodeOfWriterLib() {} + +void StepData_NodeOfWriterLib::AddNode(const Handle(StepData_GlobalNodeOfWriterLib)& anode) +{ + if (thenode == anode) + return; + if (thenext.IsNull()) + { + if (thenode.IsNull()) + thenode = anode; + else + { + thenext = new StepData_NodeOfWriterLib; + thenext->AddNode(anode); + } + } + else + thenext->AddNode(anode); +} + +const Handle(StepData_ReadWriteModule)& StepData_NodeOfWriterLib::Module() const +{ + return thenode->Module(); +} + +const Handle(StepData_Protocol)& StepData_NodeOfWriterLib::Protocol() const +{ + return thenode->Protocol(); +} + +const Handle(StepData_NodeOfWriterLib)& StepData_NodeOfWriterLib::Next() const +{ + return thenext; +} diff --git a/src/DataExchange/TKDESTEP/StepSelect/StepSelect_FileModifier_0.cxx b/src/DataExchange/TKDESTEP/StepSelect/StepSelect_FileModifier_0.cxx index c44f320f6b..73cd30f076 100644 --- a/src/DataExchange/TKDESTEP/StepSelect/StepSelect_FileModifier_0.cxx +++ b/src/DataExchange/TKDESTEP/StepSelect/StepSelect_FileModifier_0.cxx @@ -21,9 +21,7 @@ #include #include -#define Writer StepData_StepWriter -#define Writer_hxx -#define IFSelect_FileModifier StepSelect_FileModifier -#define IFSelect_FileModifier_hxx -#define Handle_IFSelect_FileModifier Handle(StepSelect_FileModifier) -#include +StepSelect_FileModifier::StepSelect_FileModifier() + : IFSelect_GeneralModifier(Standard_False) +{ +} diff --git a/src/DataExchange/TKDESTEP/StepSelect/StepSelect_ModelModifier_0.cxx b/src/DataExchange/TKDESTEP/StepSelect/StepSelect_ModelModifier_0.cxx index 124d5370d4..16940fd837 100644 --- a/src/DataExchange/TKDESTEP/StepSelect/StepSelect_ModelModifier_0.cxx +++ b/src/DataExchange/TKDESTEP/StepSelect/StepSelect_ModelModifier_0.cxx @@ -24,14 +24,34 @@ #include #include #include +#include -#define Handle_Model Handle(StepData_StepModel) -#define Model StepData_StepModel -#define Model_hxx -#define Handle_Proto Handle(StepData_Protocol) -#define Proto StepData_Protocol -#define Proto_hxx -#define IFSelect_ModelModifier StepSelect_ModelModifier -#define IFSelect_ModelModifier_hxx -#define Handle_IFSelect_ModelModifier Handle(StepSelect_ModelModifier) -#include +StepSelect_ModelModifier::StepSelect_ModelModifier(const Standard_Boolean grf) + : IFSelect_Modifier(grf) +{ +} + +void StepSelect_ModelModifier::Perform(IFSelect_ContextModif& ctx, + const Handle(Interface_InterfaceModel)& target, + const Handle(Interface_Protocol)& protocol, + Interface_CopyTool& TC) const +{ + ctx.TraceModifier(this); + Handle(StepData_StepModel) targ = Handle(StepData_StepModel)::DownCast(target); + Handle(StepData_Protocol) prot = Handle(StepData_Protocol)::DownCast(protocol); + if (targ.IsNull()) + { + ctx.CCheck()->AddFail("Model to Modify : unproper type"); + return; + } + PerformProtocol(ctx, targ, prot, TC); +} + +void StepSelect_ModelModifier::PerformProtocol(IFSelect_ContextModif& ctx, + const Handle(StepData_StepModel)& target, + const Handle(StepData_Protocol)& protocol, + Interface_CopyTool& TC) const +{ + ctx.SetProtocol(protocol); + Performing(ctx, target, TC); +} diff --git a/src/DataExchange/TKXSBase/IFSelect/FILES.cmake b/src/DataExchange/TKXSBase/IFSelect/FILES.cmake index 2b276cf1e8..0ef4614985 100644 --- a/src/DataExchange/TKXSBase/IFSelect/FILES.cmake +++ b/src/DataExchange/TKXSBase/IFSelect/FILES.cmake @@ -36,7 +36,6 @@ set(OCCT_IFSelect_FILES IFSelect_Editor.cxx IFSelect_Editor.hxx IFSelect_EditValue.hxx - IFSelect_FileModifier.gxx IFSelect_Functions.cxx IFSelect_Functions.hxx IFSelect_GeneralModifier.cxx @@ -50,7 +49,6 @@ set(OCCT_IFSelect_FILES IFSelect_ListEditor.hxx IFSelect_ModelCopier.cxx IFSelect_ModelCopier.hxx - IFSelect_ModelModifier.gxx IFSelect_ModifEditForm.cxx IFSelect_ModifEditForm.hxx IFSelect_Modifier.cxx diff --git a/src/DataExchange/TKXSBase/IFSelect/IFSelect_FileModifier.gxx b/src/DataExchange/TKXSBase/IFSelect/IFSelect_FileModifier.gxx deleted file mode 100644 index ab4ddc5390..0000000000 --- a/src/DataExchange/TKXSBase/IFSelect/IFSelect_FileModifier.gxx +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) 1999-2014 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 - -IFSelect_FileModifier::IFSelect_FileModifier() - : IFSelect_GeneralModifier(Standard_False) -{ -} diff --git a/src/DataExchange/TKXSBase/IFSelect/IFSelect_ModelModifier.gxx b/src/DataExchange/TKXSBase/IFSelect/IFSelect_ModelModifier.gxx deleted file mode 100644 index db115dae8c..0000000000 --- a/src/DataExchange/TKXSBase/IFSelect/IFSelect_ModelModifier.gxx +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) 1999-2014 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 -#include - -IFSelect_ModelModifier::IFSelect_ModelModifier(const Standard_Boolean grf) - : IFSelect_Modifier(grf) -{ -} - -void IFSelect_ModelModifier::Perform(IFSelect_ContextModif& ctx, - const Handle(Interface_InterfaceModel)& target, - const Handle(Interface_Protocol)& protocol, - Interface_CopyTool& TC) const -{ - ctx.TraceModifier(this); - Handle(Model) targ = Handle(Model)::DownCast(target); - Handle(Proto) prot = Handle(Proto)::DownCast(protocol); - if (targ.IsNull()) - { - ctx.CCheck()->AddFail("Model to Modify : unproper type"); - return; - } - PerformProtocol(ctx, targ, prot, TC); -} - -void IFSelect_ModelModifier::PerformProtocol(IFSelect_ContextModif& ctx, - const Handle(Model)& target, - const Handle(Proto)& protocol, - Interface_CopyTool& TC) const -{ - ctx.SetProtocol(protocol); - Performing(ctx, target, TC); -} diff --git a/src/DataExchange/TKXSBase/Interface/FILES.cmake b/src/DataExchange/TKXSBase/Interface/FILES.cmake index 667c3c8a1a..223081a688 100644 --- a/src/DataExchange/TKXSBase/Interface/FILES.cmake +++ b/src/DataExchange/TKXSBase/Interface/FILES.cmake @@ -66,7 +66,6 @@ set(OCCT_Interface_FILES Interface_IntList.hxx Interface_IntVal.cxx Interface_IntVal.hxx - Interface_JaggedArray.gxx Interface_LineBuffer.cxx Interface_LineBuffer.hxx Interface_Macros.hxx diff --git a/src/DataExchange/TKXSBase/Interface/Interface_GlobalNodeOfGeneralLib_0.cxx b/src/DataExchange/TKXSBase/Interface/Interface_GlobalNodeOfGeneralLib_0.cxx index fc901d8f0a..c39964f923 100644 --- a/src/DataExchange/TKXSBase/Interface/Interface_GlobalNodeOfGeneralLib_0.cxx +++ b/src/DataExchange/TKXSBase/Interface/Interface_GlobalNodeOfGeneralLib_0.cxx @@ -24,20 +24,43 @@ #include #include -#define TheObject Handle(Standard_Transient) -#define TheObject_hxx -#define Handle_TheModule Handle(Interface_GeneralModule) -#define TheModule Interface_GeneralModule -#define TheModule_hxx -#define Handle_TheProtocol Handle(Interface_Protocol) -#define TheProtocol Interface_Protocol -#define TheProtocol_hxx -#define LibCtl_GlobalNode Interface_GlobalNodeOfGeneralLib -#define LibCtl_GlobalNode_hxx -#define LibCtl_Node Interface_NodeOfGeneralLib -#define LibCtl_Node_hxx -#define Handle_LibCtl_GlobalNode Handle(Interface_GlobalNodeOfGeneralLib) -#define Handle_LibCtl_Node Handle(Interface_NodeOfGeneralLib) -#define LibCtl_Library Interface_GeneralLib -#define LibCtl_Library_hxx -#include +Interface_GlobalNodeOfGeneralLib::Interface_GlobalNodeOfGeneralLib() {} + +void Interface_GlobalNodeOfGeneralLib::Add(const Handle(Interface_GeneralModule)& amodule, + const Handle(Interface_Protocol)& aprotocol) +{ + if (themod == amodule) + return; + if (theprot == aprotocol) + themod = amodule; + else if (thenext.IsNull()) + { + if (themod.IsNull()) + { + themod = amodule; + theprot = aprotocol; + } + else + { + thenext = new Interface_GlobalNodeOfGeneralLib; + thenext->Add(amodule, aprotocol); + } + } + else + thenext->Add(amodule, aprotocol); +} + +const Handle(Interface_GeneralModule)& Interface_GlobalNodeOfGeneralLib::Module() const +{ + return themod; +} + +const Handle(Interface_Protocol)& Interface_GlobalNodeOfGeneralLib::Protocol() const +{ + return theprot; +} + +const Handle(Interface_GlobalNodeOfGeneralLib)& Interface_GlobalNodeOfGeneralLib::Next() const +{ + return thenext; +} diff --git a/src/DataExchange/TKXSBase/Interface/Interface_GlobalNodeOfReaderLib_0.cxx b/src/DataExchange/TKXSBase/Interface/Interface_GlobalNodeOfReaderLib_0.cxx index 00c3f43e3d..336caa5c09 100644 --- a/src/DataExchange/TKXSBase/Interface/Interface_GlobalNodeOfReaderLib_0.cxx +++ b/src/DataExchange/TKXSBase/Interface/Interface_GlobalNodeOfReaderLib_0.cxx @@ -24,20 +24,43 @@ #include #include -#define TheObject Handle(Standard_Transient) -#define TheObject_hxx -#define Handle_TheModule Handle(Interface_ReaderModule) -#define TheModule Interface_ReaderModule -#define TheModule_hxx -#define Handle_TheProtocol Handle(Interface_Protocol) -#define TheProtocol Interface_Protocol -#define TheProtocol_hxx -#define LibCtl_GlobalNode Interface_GlobalNodeOfReaderLib -#define LibCtl_GlobalNode_hxx -#define LibCtl_Node Interface_NodeOfReaderLib -#define LibCtl_Node_hxx -#define Handle_LibCtl_GlobalNode Handle(Interface_GlobalNodeOfReaderLib) -#define Handle_LibCtl_Node Handle(Interface_NodeOfReaderLib) -#define LibCtl_Library Interface_ReaderLib -#define LibCtl_Library_hxx -#include +Interface_GlobalNodeOfReaderLib::Interface_GlobalNodeOfReaderLib() {} + +void Interface_GlobalNodeOfReaderLib::Add(const Handle(Interface_ReaderModule)& amodule, + const Handle(Interface_Protocol)& aprotocol) +{ + if (themod == amodule) + return; + if (theprot == aprotocol) + themod = amodule; + else if (thenext.IsNull()) + { + if (themod.IsNull()) + { + themod = amodule; + theprot = aprotocol; + } + else + { + thenext = new Interface_GlobalNodeOfReaderLib; + thenext->Add(amodule, aprotocol); + } + } + else + thenext->Add(amodule, aprotocol); +} + +const Handle(Interface_ReaderModule)& Interface_GlobalNodeOfReaderLib::Module() const +{ + return themod; +} + +const Handle(Interface_Protocol)& Interface_GlobalNodeOfReaderLib::Protocol() const +{ + return theprot; +} + +const Handle(Interface_GlobalNodeOfReaderLib)& Interface_GlobalNodeOfReaderLib::Next() const +{ + return thenext; +} diff --git a/src/DataExchange/TKXSBase/Interface/Interface_JaggedArray.gxx b/src/DataExchange/TKXSBase/Interface/Interface_JaggedArray.gxx deleted file mode 100644 index 9e35d16621..0000000000 --- a/src/DataExchange/TKXSBase/Interface/Interface_JaggedArray.gxx +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) 1999-2014 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 - -Interface_JaggedArray::Interface_JaggedArray(const Standard_Integer low, const Standard_Integer up) - : thelist(low, up) -{ - Handle(Standard_Transient) nulo; - thelist.Init(nulo); -} - -Standard_Integer Interface_JaggedArray::Lower() const -{ - return thelist.Lower(); -} - -Standard_Integer Interface_JaggedArray::Upper() const -{ - return thelist.Upper(); -} - -Standard_Integer Interface_JaggedArray::Length() const -{ - return thelist.Length(); -} - -void Interface_JaggedArray::SetValue(const Standard_Integer num, const Handle(TheKey)& val) -{ - thelist.SetValue(num, val); -} - -Handle(TheKey) Interface_JaggedArray::Value(const Standard_Integer num) const -{ - return Handle(TheKey)::DownCast(thelist.Value(num)); -} - -// Handle(TheKey)& Interface_JaggedArray::ChangeValue -// (const Standard_Integer num) -// { return thelist.ChangeValue(num); } diff --git a/src/DataExchange/TKXSBase/Interface/Interface_NodeOfGeneralLib_0.cxx b/src/DataExchange/TKXSBase/Interface/Interface_NodeOfGeneralLib_0.cxx index e6742e90d0..b4cbb4e626 100644 --- a/src/DataExchange/TKXSBase/Interface/Interface_NodeOfGeneralLib_0.cxx +++ b/src/DataExchange/TKXSBase/Interface/Interface_NodeOfGeneralLib_0.cxx @@ -24,20 +24,37 @@ #include #include -#define TheObject Handle(Standard_Transient) -#define TheObject_hxx -#define Handle_TheModule Handle(Interface_GeneralModule) -#define TheModule Interface_GeneralModule -#define TheModule_hxx -#define Handle_TheProtocol Handle(Interface_Protocol) -#define TheProtocol Interface_Protocol -#define TheProtocol_hxx -#define LibCtl_GlobalNode Interface_GlobalNodeOfGeneralLib -#define LibCtl_GlobalNode_hxx -#define LibCtl_Node Interface_NodeOfGeneralLib -#define LibCtl_Node_hxx -#define Handle_LibCtl_GlobalNode Handle(Interface_GlobalNodeOfGeneralLib) -#define Handle_LibCtl_Node Handle(Interface_NodeOfGeneralLib) -#define LibCtl_Library Interface_GeneralLib -#define LibCtl_Library_hxx -#include +Interface_NodeOfGeneralLib::Interface_NodeOfGeneralLib() {} + +void Interface_NodeOfGeneralLib::AddNode(const Handle(Interface_GlobalNodeOfGeneralLib)& anode) +{ + if (thenode == anode) + return; + if (thenext.IsNull()) + { + if (thenode.IsNull()) + thenode = anode; + else + { + thenext = new Interface_NodeOfGeneralLib; + thenext->AddNode(anode); + } + } + else + thenext->AddNode(anode); +} + +const Handle(Interface_GeneralModule)& Interface_NodeOfGeneralLib::Module() const +{ + return thenode->Module(); +} + +const Handle(Interface_Protocol)& Interface_NodeOfGeneralLib::Protocol() const +{ + return thenode->Protocol(); +} + +const Handle(Interface_NodeOfGeneralLib)& Interface_NodeOfGeneralLib::Next() const +{ + return thenext; +} diff --git a/src/DataExchange/TKXSBase/Interface/Interface_NodeOfReaderLib_0.cxx b/src/DataExchange/TKXSBase/Interface/Interface_NodeOfReaderLib_0.cxx index 50fb6bb0b3..ffd3047351 100644 --- a/src/DataExchange/TKXSBase/Interface/Interface_NodeOfReaderLib_0.cxx +++ b/src/DataExchange/TKXSBase/Interface/Interface_NodeOfReaderLib_0.cxx @@ -24,20 +24,37 @@ #include #include -#define TheObject Handle(Standard_Transient) -#define TheObject_hxx -#define Handle_TheModule Handle(Interface_ReaderModule) -#define TheModule Interface_ReaderModule -#define TheModule_hxx -#define Handle_TheProtocol Handle(Interface_Protocol) -#define TheProtocol Interface_Protocol -#define TheProtocol_hxx -#define LibCtl_GlobalNode Interface_GlobalNodeOfReaderLib -#define LibCtl_GlobalNode_hxx -#define LibCtl_Node Interface_NodeOfReaderLib -#define LibCtl_Node_hxx -#define Handle_LibCtl_GlobalNode Handle(Interface_GlobalNodeOfReaderLib) -#define Handle_LibCtl_Node Handle(Interface_NodeOfReaderLib) -#define LibCtl_Library Interface_ReaderLib -#define LibCtl_Library_hxx -#include +Interface_NodeOfReaderLib::Interface_NodeOfReaderLib() {} + +void Interface_NodeOfReaderLib::AddNode(const Handle(Interface_GlobalNodeOfReaderLib)& anode) +{ + if (thenode == anode) + return; + if (thenext.IsNull()) + { + if (thenode.IsNull()) + thenode = anode; + else + { + thenext = new Interface_NodeOfReaderLib; + thenext->AddNode(anode); + } + } + else + thenext->AddNode(anode); +} + +const Handle(Interface_ReaderModule)& Interface_NodeOfReaderLib::Module() const +{ + return thenode->Module(); +} + +const Handle(Interface_Protocol)& Interface_NodeOfReaderLib::Protocol() const +{ + return thenode->Protocol(); +} + +const Handle(Interface_NodeOfReaderLib)& Interface_NodeOfReaderLib::Next() const +{ + return thenext; +} diff --git a/src/DataExchange/TKXSBase/LibCtl/FILES.cmake b/src/DataExchange/TKXSBase/LibCtl/FILES.cmake index 51b5b1a6bf..d65375bd0f 100644 --- a/src/DataExchange/TKXSBase/LibCtl/FILES.cmake +++ b/src/DataExchange/TKXSBase/LibCtl/FILES.cmake @@ -2,7 +2,5 @@ set(OCCT_LibCtl_FILES_LOCATION "${CMAKE_CURRENT_LIST_DIR}") set(OCCT_LibCtl_FILES - LibCtl_GlobalNode.gxx LibCtl_Library.gxx - LibCtl_Node.gxx ) diff --git a/src/DataExchange/TKXSBase/LibCtl/LibCtl_GlobalNode.gxx b/src/DataExchange/TKXSBase/LibCtl/LibCtl_GlobalNode.gxx deleted file mode 100644 index a5d672d30f..0000000000 --- a/src/DataExchange/TKXSBase/LibCtl/LibCtl_GlobalNode.gxx +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) 1998-1999 Matra Datavision -// Copyright (c) 1999-2014 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 - -// Generic class nested in Library: used to build the -// global lists of Modules attached to an instantiated class of Library -// (see Library for more details) - -LibCtl_GlobalNode::LibCtl_GlobalNode() {} - -// WARNING, Add acts as substitution: for a given Protocol, it is the -// last call wins -void LibCtl_GlobalNode::Add(const Handle(TheModule)& amodule, const Handle(TheProtocol)& aprotocol) -{ - if (themod == amodule) - return; - if (theprot == aprotocol) - themod = amodule; - else if (thenext.IsNull()) - { - if (themod.IsNull()) - { - themod = amodule; - theprot = aprotocol; - } - else - { - thenext = new LibCtl_GlobalNode; - thenext->Add(amodule, aprotocol); - } - } - else - thenext->Add(amodule, aprotocol); -} - -const Handle(TheModule)& LibCtl_GlobalNode::Module() const -{ - return themod; -} - -const Handle(TheProtocol)& LibCtl_GlobalNode::Protocol() const -{ - return theprot; -} - -const Handle(LibCtl_GlobalNode)& LibCtl_GlobalNode::Next() const -{ - return thenext; -} diff --git a/src/DataExchange/TKXSBase/LibCtl/LibCtl_Node.gxx b/src/DataExchange/TKXSBase/LibCtl/LibCtl_Node.gxx deleted file mode 100644 index 4d4a41e7ea..0000000000 --- a/src/DataExchange/TKXSBase/LibCtl/LibCtl_Node.gxx +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) 1998-1999 Matra Datavision -// Copyright (c) 1999-2014 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 - -// Generic class nested in Library: used to build the -// lists of Modules of a library (see Library for more details) -// (In fact: List of Global Nodes -> Module + Protocol) - -LibCtl_Node::LibCtl_Node() {} - -void LibCtl_Node::AddNode(const Handle(LibCtl_GlobalNode)& anode) -{ - if (thenode == anode) - return; - if (thenext.IsNull()) - { - if (thenode.IsNull()) - thenode = anode; - else - { - thenext = new LibCtl_Node; - thenext->AddNode(anode); - } - } - else - thenext->AddNode(anode); -} - -const Handle(TheModule)& LibCtl_Node::Module() const -{ - return thenode->Module(); -} - -const Handle(TheProtocol)& LibCtl_Node::Protocol() const -{ - return thenode->Protocol(); -} - -const Handle(LibCtl_Node)& LibCtl_Node::Next() const -{ - return thenext; -} diff --git a/src/ModelingAlgorithms/TKGeomAlgo/Geom2dInt/Geom2dInt_MyImpParToolOfTheIntersectorOfTheIntConicCurveOfGInter_0.cxx b/src/ModelingAlgorithms/TKGeomAlgo/Geom2dInt/Geom2dInt_MyImpParToolOfTheIntersectorOfTheIntConicCurveOfGInter_0.cxx index 629ad88d27..b72310b171 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/Geom2dInt/Geom2dInt_MyImpParToolOfTheIntersectorOfTheIntConicCurveOfGInter_0.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/Geom2dInt/Geom2dInt_MyImpParToolOfTheIntersectorOfTheIntConicCurveOfGInter_0.cxx @@ -20,13 +20,44 @@ #include #include -#define ImpTool IntCurve_IConicTool -#define ImpTool_hxx -#define ParCurve Adaptor2d_Curve2d -#define ParCurve_hxx -#define ParTool Geom2dInt_Geom2dCurveTool -#define ParTool_hxx -#define IntImpParGen_ImpParTool Geom2dInt_MyImpParToolOfTheIntersectorOfTheIntConicCurveOfGInter -#define IntImpParGen_ImpParTool_hxx \ - -#include +#include + +Geom2dInt_MyImpParToolOfTheIntersectorOfTheIntConicCurveOfGInter:: + Geom2dInt_MyImpParToolOfTheIntersectorOfTheIntConicCurveOfGInter(const IntCurve_IConicTool& ITool, + const Adaptor2d_Curve2d& PC) + : TheImpTool(ITool) +{ + TheParCurve = (Standard_Address)(&PC); +} + +Standard_Boolean Geom2dInt_MyImpParToolOfTheIntersectorOfTheIntConicCurveOfGInter::Value( + const Standard_Real Param, + Standard_Real& ApproxDistance) +{ + ApproxDistance = TheImpTool.Distance( + Geom2dInt_Geom2dCurveTool::Value((*((Adaptor2d_Curve2d*)(TheParCurve))), Param)); + return (Standard_True); +} + +Standard_Boolean Geom2dInt_MyImpParToolOfTheIntersectorOfTheIntConicCurveOfGInter::Derivative( + const Standard_Real Param, + Standard_Real& D_ApproxDistance_DV) +{ + gp_Pnt2d Pt; + gp_Vec2d TanParCurve; + gp_Vec2d Grad = TheImpTool.GradDistance( + Geom2dInt_Geom2dCurveTool::Value((*((Adaptor2d_Curve2d*)(TheParCurve))), Param)); + Geom2dInt_Geom2dCurveTool::D1((*((Adaptor2d_Curve2d*)(TheParCurve))), Param, Pt, TanParCurve); + D_ApproxDistance_DV = Grad.Dot(TanParCurve); + return (Standard_True); +} + +Standard_Boolean Geom2dInt_MyImpParToolOfTheIntersectorOfTheIntConicCurveOfGInter::Values( + const Standard_Real Param, + Standard_Real& ApproxDistance, + Standard_Real& Deriv) +{ + this->Value(Param, ApproxDistance); + this->Derivative(Param, Deriv); + return (Standard_True); +} diff --git a/src/ModelingAlgorithms/TKGeomAlgo/Geom2dInt/Geom2dInt_TheProjPCurOfGInter_0.cxx b/src/ModelingAlgorithms/TKGeomAlgo/Geom2dInt/Geom2dInt_TheProjPCurOfGInter_0.cxx index b2d65c71ec..28c39322a4 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/Geom2dInt/Geom2dInt_TheProjPCurOfGInter_0.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/Geom2dInt/Geom2dInt_TheProjPCurOfGInter_0.cxx @@ -22,21 +22,58 @@ #include #include #include +#include -#define TheCurve Adaptor2d_Curve2d -#define TheCurve_hxx -#define TheCurveTool Geom2dInt_Geom2dCurveTool -#define TheCurveTool_hxx -#define IntCurve_TheCurveLocator Geom2dInt_TheCurveLocatorOfTheProjPCurOfGInter -#define IntCurve_TheCurveLocator_hxx -#define IntCurve_TheLocateExtPC Geom2dInt_TheLocateExtPCOfTheProjPCurOfGInter -#define IntCurve_TheLocateExtPC_hxx -#define IntCurve_PCLocFOfTheLocateExtPC Geom2dInt_PCLocFOfTheLocateExtPCOfTheProjPCurOfGInter -#define IntCurve_PCLocFOfTheLocateExtPC_hxx \ - -#define IntCurve_PCLocFOfTheLocateExtPC Geom2dInt_PCLocFOfTheLocateExtPCOfTheProjPCurOfGInter -#define IntCurve_PCLocFOfTheLocateExtPC_hxx \ - -#define IntCurve_ProjPCurGen Geom2dInt_TheProjPCurOfGInter -#define IntCurve_ProjPCurGen_hxx -#include +Standard_Real Geom2dInt_TheProjPCurOfGInter::FindParameter(const Adaptor2d_Curve2d& C, + const gp_Pnt2d& P, + const Standard_Real LowParameter, + const Standard_Real HighParameter, + const Standard_Real) +{ + Standard_Real theparam, defaultparam; + Standard_Integer NbPts = Geom2dInt_Geom2dCurveTool::NbSamples(C); + Standard_Real theEpsX = Geom2dInt_Geom2dCurveTool::EpsX(C); + Extrema_POnCurv2d POnC; + + Geom2dInt_TheCurveLocatorOfTheProjPCurOfGInter::Locate(P, + C, + NbPts, + LowParameter, + HighParameter, + POnC); + defaultparam = POnC.Parameter(); + Geom2dInt_TheLocateExtPCOfTheProjPCurOfGInter Loc(P, C, defaultparam, theEpsX); + + if (Loc.IsDone() == Standard_False) + { + //-- cout<<"\n Erreur dans LocateExtPC "< #include -#define MultiLine GeomInt_TheMultiLineOfWLApprox -#define MultiLine_hxx -#define ToolLine GeomInt_TheMultiLineToolOfWLApprox -#define ToolLine_hxx -#define AppParCurves_BSpParLeastSquare \ - GeomInt_BSpParLeastSquareOfMyBSplGradientOfTheComputeLineOfWLApprox -#define AppParCurves_BSpParLeastSquare_hxx \ - -#define AppParCurves_BSpParFunction GeomInt_BSpParFunctionOfMyBSplGradientOfTheComputeLineOfWLApprox -#define AppParCurves_BSpParFunction_hxx \ - -#define AppParCurves_BSpGradient_BFGS \ - GeomInt_BSpGradient_BFGSOfMyBSplGradientOfTheComputeLineOfWLApprox -#define AppParCurves_BSpGradient_BFGS_hxx \ - -#define AppParCurves_BSpGradient GeomInt_MyBSplGradientOfTheComputeLineOfWLApprox -#define AppParCurves_BSpGradient_hxx -#include +GeomInt_BSpGradient_BFGSOfMyBSplGradientOfTheComputeLineOfWLApprox:: + GeomInt_BSpGradient_BFGSOfMyBSplGradientOfTheComputeLineOfWLApprox( + math_MultipleVarFunctionWithGradient& F, + const math_Vector& StartingPoint, + const Standard_Real Tolerance3d, + const Standard_Real Tolerance2d, + const Standard_Real Eps, + const Standard_Integer NbIterations) + : math_BFGS(F.NbVariables(), Eps, NbIterations, Eps), + myTol3d(Tolerance3d), + myTol2d(Tolerance2d) +{ + Perform(F, StartingPoint); +} + +Standard_Boolean GeomInt_BSpGradient_BFGSOfMyBSplGradientOfTheComputeLineOfWLApprox:: + IsSolutionReached(math_MultipleVarFunctionWithGradient& F) const +{ + Standard_Boolean Result, Result2; + GeomInt_BSpParFunctionOfMyBSplGradientOfTheComputeLineOfWLApprox* F1 = + (GeomInt_BSpParFunctionOfMyBSplGradientOfTheComputeLineOfWLApprox*)&F; + + Result = (2.0 * fabs(TheMinimum - PreviousMinimum) + <= 1.e-10 * (fabs(TheMinimum) + fabs(PreviousMinimum)) + 1.e-12); + Standard_Real MErr3d = F1->MaxError3d(); + Standard_Real MErr2d = F1->MaxError2d(); + Result2 = ((MErr3d <= myTol3d) && (MErr2d <= myTol2d)); + + return (Result || Result2); +} diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GeomInt/GeomInt_Gradient_BFGSOfMyGradientOfTheComputeLineBezierOfWLApprox_0.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GeomInt/GeomInt_Gradient_BFGSOfMyGradientOfTheComputeLineBezierOfWLApprox_0.cxx index 128a0a8e82..2e5c63c4f6 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GeomInt/GeomInt_Gradient_BFGSOfMyGradientOfTheComputeLineBezierOfWLApprox_0.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GeomInt/GeomInt_Gradient_BFGSOfMyGradientOfTheComputeLineBezierOfWLApprox_0.cxx @@ -24,23 +24,33 @@ #include #include -#define MultiLine GeomInt_TheMultiLineOfWLApprox -#define MultiLine_hxx -#define ToolLine GeomInt_TheMultiLineToolOfWLApprox -#define ToolLine_hxx -#define AppParCurves_ParLeastSquare \ - GeomInt_ParLeastSquareOfMyGradientOfTheComputeLineBezierOfWLApprox -#define AppParCurves_ParLeastSquare_hxx \ - -#define AppParCurves_ResConstraint GeomInt_ResConstraintOfMyGradientOfTheComputeLineBezierOfWLApprox -#define AppParCurves_ResConstraint_hxx \ - -#define AppParCurves_ParFunction GeomInt_ParFunctionOfMyGradientOfTheComputeLineBezierOfWLApprox -#define AppParCurves_ParFunction_hxx \ - -#define AppParCurves_Gradient_BFGS GeomInt_Gradient_BFGSOfMyGradientOfTheComputeLineBezierOfWLApprox -#define AppParCurves_Gradient_BFGS_hxx \ - -#define AppParCurves_Gradient GeomInt_MyGradientOfTheComputeLineBezierOfWLApprox -#define AppParCurves_Gradient_hxx -#include +GeomInt_Gradient_BFGSOfMyGradientOfTheComputeLineBezierOfWLApprox:: + GeomInt_Gradient_BFGSOfMyGradientOfTheComputeLineBezierOfWLApprox( + math_MultipleVarFunctionWithGradient& F, + const math_Vector& StartingPoint, + const Standard_Real Tolerance3d, + const Standard_Real Tolerance2d, + const Standard_Real Eps, + const Standard_Integer NbIterations) + : math_BFGS(F.NbVariables(), Eps, NbIterations, Eps), + myTol3d(Tolerance3d), + myTol2d(Tolerance2d) +{ + Perform(F, StartingPoint); +} + +Standard_Boolean GeomInt_Gradient_BFGSOfMyGradientOfTheComputeLineBezierOfWLApprox:: + IsSolutionReached(math_MultipleVarFunctionWithGradient& F) const +{ + GeomInt_ParFunctionOfMyGradientOfTheComputeLineBezierOfWLApprox* F1 = + (GeomInt_ParFunctionOfMyGradientOfTheComputeLineBezierOfWLApprox*)&F; + Standard_Boolean Result, Result2; + + Result = (2.0 * fabs(TheMinimum - PreviousMinimum) + <= 1.e-10 * (fabs(TheMinimum) + fabs(PreviousMinimum)) + 1.e-12); + Standard_Real MErr3d = F1->MaxError3d(); + Standard_Real MErr2d = F1->MaxError2d(); + + Result2 = ((MErr3d <= myTol3d) && (MErr2d <= myTol2d)); + return (Result || Result2); +} diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GeomInt/GeomInt_Gradient_BFGSOfMyGradientbisOfTheComputeLineOfWLApprox_0.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GeomInt/GeomInt_Gradient_BFGSOfMyGradientbisOfTheComputeLineOfWLApprox_0.cxx index b3e440f6a6..490de18018 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GeomInt/GeomInt_Gradient_BFGSOfMyGradientbisOfTheComputeLineOfWLApprox_0.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GeomInt/GeomInt_Gradient_BFGSOfMyGradientbisOfTheComputeLineOfWLApprox_0.cxx @@ -24,22 +24,33 @@ #include #include -#define MultiLine GeomInt_TheMultiLineOfWLApprox -#define MultiLine_hxx -#define ToolLine GeomInt_TheMultiLineToolOfWLApprox -#define ToolLine_hxx -#define AppParCurves_ParLeastSquare GeomInt_ParLeastSquareOfMyGradientbisOfTheComputeLineOfWLApprox -#define AppParCurves_ParLeastSquare_hxx \ - -#define AppParCurves_ResConstraint GeomInt_ResConstraintOfMyGradientbisOfTheComputeLineOfWLApprox -#define AppParCurves_ResConstraint_hxx \ - -#define AppParCurves_ParFunction GeomInt_ParFunctionOfMyGradientbisOfTheComputeLineOfWLApprox -#define AppParCurves_ParFunction_hxx \ - -#define AppParCurves_Gradient_BFGS GeomInt_Gradient_BFGSOfMyGradientbisOfTheComputeLineOfWLApprox -#define AppParCurves_Gradient_BFGS_hxx \ - -#define AppParCurves_Gradient GeomInt_MyGradientbisOfTheComputeLineOfWLApprox -#define AppParCurves_Gradient_hxx -#include +GeomInt_Gradient_BFGSOfMyGradientbisOfTheComputeLineOfWLApprox:: + GeomInt_Gradient_BFGSOfMyGradientbisOfTheComputeLineOfWLApprox( + math_MultipleVarFunctionWithGradient& F, + const math_Vector& StartingPoint, + const Standard_Real Tolerance3d, + const Standard_Real Tolerance2d, + const Standard_Real Eps, + const Standard_Integer NbIterations) + : math_BFGS(F.NbVariables(), Eps, NbIterations, Eps), + myTol3d(Tolerance3d), + myTol2d(Tolerance2d) +{ + Perform(F, StartingPoint); +} + +Standard_Boolean GeomInt_Gradient_BFGSOfMyGradientbisOfTheComputeLineOfWLApprox::IsSolutionReached( + math_MultipleVarFunctionWithGradient& F) const +{ + GeomInt_ParFunctionOfMyGradientbisOfTheComputeLineOfWLApprox* F1 = + (GeomInt_ParFunctionOfMyGradientbisOfTheComputeLineOfWLApprox*)&F; + Standard_Boolean Result, Result2; + + Result = (2.0 * fabs(TheMinimum - PreviousMinimum) + <= 1.e-10 * (fabs(TheMinimum) + fabs(PreviousMinimum)) + 1.e-12); + Standard_Real MErr3d = F1->MaxError3d(); + Standard_Real MErr2d = F1->MaxError2d(); + + Result2 = ((MErr3d <= myTol3d) && (MErr2d <= myTol2d)); + return (Result || Result2); +} diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntCurve/FILES.cmake b/src/ModelingAlgorithms/TKGeomAlgo/IntCurve/FILES.cmake index 1ac4b607eb..5aea25f896 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntCurve/FILES.cmake +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntCurve/FILES.cmake @@ -30,6 +30,5 @@ set(OCCT_IntCurve_FILES IntCurve_Polygon2dGen.lxx IntCurve_ProjectOnPConicTool.cxx IntCurve_ProjectOnPConicTool.hxx - IntCurve_ProjPCurGen.gxx IntCurve_UserIntConicCurveGen.gxx ) diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntCurve/IntCurve_MyImpParToolOfIntImpConicParConic_0.cxx b/src/ModelingAlgorithms/TKGeomAlgo/IntCurve/IntCurve_MyImpParToolOfIntImpConicParConic_0.cxx index 4056e4f552..93b65286c1 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntCurve/IntCurve_MyImpParToolOfIntImpConicParConic_0.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntCurve/IntCurve_MyImpParToolOfIntImpConicParConic_0.cxx @@ -20,12 +20,42 @@ #include #include -#define ImpTool IntCurve_IConicTool -#define ImpTool_hxx -#define ParCurve IntCurve_PConic -#define ParCurve_hxx -#define ParTool IntCurve_PConicTool -#define ParTool_hxx -#define IntImpParGen_ImpParTool IntCurve_MyImpParToolOfIntImpConicParConic -#define IntImpParGen_ImpParTool_hxx -#include +#include + +IntCurve_MyImpParToolOfIntImpConicParConic::IntCurve_MyImpParToolOfIntImpConicParConic( + const IntCurve_IConicTool& ITool, + const IntCurve_PConic& PC) + : TheImpTool(ITool) +{ + TheParCurve = (Standard_Address)(&PC); +} + +Standard_Boolean IntCurve_MyImpParToolOfIntImpConicParConic::Value(const Standard_Real Param, + Standard_Real& ApproxDistance) +{ + ApproxDistance = + TheImpTool.Distance(IntCurve_PConicTool::Value((*((IntCurve_PConic*)(TheParCurve))), Param)); + return (Standard_True); +} + +Standard_Boolean IntCurve_MyImpParToolOfIntImpConicParConic::Derivative( + const Standard_Real Param, + Standard_Real& D_ApproxDistance_DV) +{ + gp_Pnt2d Pt; + gp_Vec2d TanParCurve; + gp_Vec2d Grad = TheImpTool.GradDistance( + IntCurve_PConicTool::Value((*((IntCurve_PConic*)(TheParCurve))), Param)); + IntCurve_PConicTool::D1((*((IntCurve_PConic*)(TheParCurve))), Param, Pt, TanParCurve); + D_ApproxDistance_DV = Grad.Dot(TanParCurve); + return (Standard_True); +} + +Standard_Boolean IntCurve_MyImpParToolOfIntImpConicParConic::Values(const Standard_Real Param, + Standard_Real& ApproxDistance, + Standard_Real& Deriv) +{ + this->Value(Param, ApproxDistance); + this->Derivative(Param, Deriv); + return (Standard_True); +} diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntCurve/IntCurve_ProjPCurGen.gxx b/src/ModelingAlgorithms/TKGeomAlgo/IntCurve/IntCurve_ProjPCurGen.gxx deleted file mode 100644 index ee8f39946a..0000000000 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntCurve/IntCurve_ProjPCurGen.gxx +++ /dev/null @@ -1,63 +0,0 @@ -// Created on: 1992-10-13 -// Created by: Laurent BUCHARD -// Copyright (c) 1992-1999 Matra Datavision -// Copyright (c) 1999-2014 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 - -Standard_Real IntCurve_ProjPCurGen::FindParameter(const TheCurve& C, - const gp_Pnt2d& P, - const Standard_Real LowParameter, - const Standard_Real HighParameter, - const Standard_Real) -{ - Standard_Real theparam, defaultparam; - Standard_Integer NbPts = TheCurveTool::NbSamples(C); - Standard_Real theEpsX = TheCurveTool::EpsX(C); - Extrema_POnCurv2d POnC; - - IntCurve_TheCurveLocator::Locate(P, C, NbPts, LowParameter, HighParameter, POnC); - defaultparam = POnC.Parameter(); - IntCurve_TheLocateExtPC Loc(P, C, defaultparam, theEpsX); - - if (Loc.IsDone() == Standard_False) - { - //-- cout<<"\n Erreur dans LocateExtPC "< - -//================================================================================================= - -IntCurveSurface_QuadricCurveFunc::IntCurveSurface_QuadricCurveFunc(const TheQuadric& Q, - const TheCurve& C) - : myQuadric(Q), - myCurve(C) -{ -} - -//================================================================================================= - -Standard_Boolean IntCurveSurface_QuadricCurveFunc::Value(const Standard_Real Param, - Standard_Real& F) -{ - F = myQuadric.Distance(TheCurveTool::Value(myCurve, Param)); - return (Standard_True); -} - -Standard_Boolean IntCurveSurface_QuadricCurveFunc::Derivative(const Standard_Real Param, - Standard_Real& D) -{ - gp_Pnt P; - gp_Vec T; - TheCurveTool::D1(myCurve, Param, P, T); - D = T.Dot(myQuadric.Gradient(P)); - return (Standard_True); -} - -Standard_Boolean IntCurveSurface_QuadricCurveFunc::Values(const Standard_Real Param, - Standard_Real& F, - Standard_Real& D) -{ - gp_Pnt P; - gp_Vec T, Grad; - TheCurveTool::D1(myCurve, Param, P, T); - myQuadric.ValAndGrad(P, F, Grad); - D = T.Dot(Grad); - return (Standard_True); -} diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntCurveSurface/IntCurveSurface_ThePolygonToolOfHInter_0.cxx b/src/ModelingAlgorithms/TKGeomAlgo/IntCurveSurface/IntCurveSurface_ThePolygonToolOfHInter_0.cxx index d9e0996259..e86b0e2f4b 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntCurveSurface/IntCurveSurface_ThePolygonToolOfHInter_0.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntCurveSurface/IntCurveSurface_ThePolygonToolOfHInter_0.cxx @@ -21,12 +21,24 @@ #include #include -#define ThePoint gp_Pnt -#define ThePoint_hxx -#define ThePolygon IntCurveSurface_ThePolygonOfHInter -#define ThePolygon_hxx -#define TheBoundingBox Bnd_Box -#define TheBoundingBox_hxx -#define IntCurveSurface_PolygonTool IntCurveSurface_ThePolygonToolOfHInter -#define IntCurveSurface_PolygonTool_hxx -#include +#include + +void IntCurveSurface_ThePolygonToolOfHInter::Dump(const IntCurveSurface_ThePolygonOfHInter& L) +{ + static Standard_Integer num = 0; + num++; + Standard_Integer nbs = IntCurveSurface_ThePolygonToolOfHInter::NbSegments(L); + std::cout << "\npol2d " << num << " " << nbs << std::endl; + std::cout << "Deflection " << IntCurveSurface_ThePolygonToolOfHInter::DeflectionOverEstimation(L) + << std::endl; + + for (Standard_Integer i = 1; i <= nbs; i++) + { + gp_Pnt P(IntCurveSurface_ThePolygonToolOfHInter::BeginOfSeg(L, i)); + std::cout << "pnt " << num << " " << i << " " << P.X() << " " << P.Y() << " " << P.Z() + << std::endl; + } + gp_Pnt PF(IntCurveSurface_ThePolygonToolOfHInter::EndOfSeg(L, nbs)); + std::cout << "pnt " << num << " " << nbs << " " << PF.X() << " " << PF.Y() << " " << PF.Z() + << std::endl; +} diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntCurveSurface/IntCurveSurface_ThePolyhedronToolOfHInter_0.cxx b/src/ModelingAlgorithms/TKGeomAlgo/IntCurveSurface/IntCurveSurface_ThePolyhedronToolOfHInter_0.cxx index dd3e4579f0..9f746aad70 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntCurveSurface/IntCurveSurface_ThePolyhedronToolOfHInter_0.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntCurveSurface/IntCurveSurface_ThePolyhedronToolOfHInter_0.cxx @@ -21,8 +21,8 @@ #include #include -#define ThePolyhedron IntCurveSurface_ThePolyhedronOfHInter -#define ThePolyhedron_hxx -#define IntCurveSurface_PolyhedronTool IntCurveSurface_ThePolyhedronToolOfHInter -#define IntCurveSurface_PolyhedronTool_hxx -#include +void IntCurveSurface_ThePolyhedronToolOfHInter::Dump( + const IntCurveSurface_ThePolyhedronOfHInter& polyh) +{ + polyh.Dump(); +} diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntCurveSurface/IntCurveSurface_TheQuadCurvFuncOfTheQuadCurvExactHInter_0.cxx b/src/ModelingAlgorithms/TKGeomAlgo/IntCurveSurface/IntCurveSurface_TheQuadCurvFuncOfTheQuadCurvExactHInter_0.cxx index 5a7d60db0b..eac0a73309 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntCurveSurface/IntCurveSurface_TheQuadCurvFuncOfTheQuadCurvExactHInter_0.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntCurveSurface/IntCurveSurface_TheQuadCurvFuncOfTheQuadCurvExactHInter_0.cxx @@ -19,14 +19,44 @@ #include #include #include +#include -#define TheQuadric IntSurf_Quadric -#define TheQuadric_hxx -#define TheCurve Handle(Adaptor3d_Curve) -#define TheCurve_hxx -#define TheCurveTool IntCurveSurface_TheHCurveTool -#define TheCurveTool_hxx -#define IntCurveSurface_QuadricCurveFunc IntCurveSurface_TheQuadCurvFuncOfTheQuadCurvExactHInter -#define IntCurveSurface_QuadricCurveFunc_hxx \ - -#include +IntCurveSurface_TheQuadCurvFuncOfTheQuadCurvExactHInter:: + IntCurveSurface_TheQuadCurvFuncOfTheQuadCurvExactHInter(const IntSurf_Quadric& Q, + const Handle(Adaptor3d_Curve)& C) + : myQuadric(Q), + myCurve(C) +{ +} + +Standard_Boolean IntCurveSurface_TheQuadCurvFuncOfTheQuadCurvExactHInter::Value( + const Standard_Real Param, + Standard_Real& F) +{ + F = myQuadric.Distance(IntCurveSurface_TheHCurveTool::Value(myCurve, Param)); + return (Standard_True); +} + +Standard_Boolean IntCurveSurface_TheQuadCurvFuncOfTheQuadCurvExactHInter::Derivative( + const Standard_Real Param, + Standard_Real& D) +{ + gp_Pnt P; + gp_Vec T; + IntCurveSurface_TheHCurveTool::D1(myCurve, Param, P, T); + D = T.Dot(myQuadric.Gradient(P)); + return (Standard_True); +} + +Standard_Boolean IntCurveSurface_TheQuadCurvFuncOfTheQuadCurvExactHInter::Values( + const Standard_Real Param, + Standard_Real& F, + Standard_Real& D) +{ + gp_Pnt P; + gp_Vec T, Grad; + IntCurveSurface_TheHCurveTool::D1(myCurve, Param, P, T); + myQuadric.ValAndGrad(P, F, Grad); + D = T.Dot(Grad); + return (Standard_True); +} diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntImpParGen/FILES.cmake b/src/ModelingAlgorithms/TKGeomAlgo/IntImpParGen/FILES.cmake index 56cdd7eb38..4df2e62238 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntImpParGen/FILES.cmake +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntImpParGen/FILES.cmake @@ -4,7 +4,6 @@ set(OCCT_IntImpParGen_FILES_LOCATION "${CMAKE_CURRENT_LIST_DIR}") set(OCCT_IntImpParGen_FILES IntImpParGen.cxx IntImpParGen.hxx - IntImpParGen_ImpParTool.gxx IntImpParGen_ImpTool.hxx IntImpParGen_Intersector.gxx IntImpParGen_Tool.cxx diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntImpParGen/IntImpParGen_ImpParTool.gxx b/src/ModelingAlgorithms/TKGeomAlgo/IntImpParGen/IntImpParGen_ImpParTool.gxx deleted file mode 100644 index 686cc37339..0000000000 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntImpParGen/IntImpParGen_ImpParTool.gxx +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) 1995-1999 Matra Datavision -// Copyright (c) 1999-2014 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 - -IntImpParGen_ImpParTool::IntImpParGen_ImpParTool(const ImpTool& ITool, const ParCurve& PC) - : TheImpTool(ITool) -{ - TheParCurve = (Standard_Address)(&PC); -} - -Standard_Boolean IntImpParGen_ImpParTool::Value(const Standard_Real Param, - Standard_Real& ApproxDistance) -{ - - ApproxDistance = TheImpTool.Distance(ParTool::Value((*((ParCurve*)(TheParCurve))), Param)); - return (Standard_True); -} - -Standard_Boolean IntImpParGen_ImpParTool::Derivative(const Standard_Real Param, - Standard_Real& D_ApproxDistance_DV) -{ - - gp_Pnt2d Pt; - gp_Vec2d TanParCurve; - gp_Vec2d Grad = TheImpTool.GradDistance(ParTool::Value((*((ParCurve*)(TheParCurve))), Param)); - ParTool::D1((*((ParCurve*)(TheParCurve))), Param, Pt, TanParCurve); - D_ApproxDistance_DV = Grad.Dot(TanParCurve); - return (Standard_True); -} - -Standard_Boolean IntImpParGen_ImpParTool::Values(const Standard_Real Param, - Standard_Real& ApproxDistance, - Standard_Real& Deriv) -{ - - this->Value(Param, ApproxDistance); - this->Derivative(Param, Deriv); - return (Standard_True); -} diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_TheIWLineOfTheIWalking.hxx b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_TheIWLineOfTheIWalking.hxx index 120b517468..709b056f1e 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_TheIWLineOfTheIWalking.hxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_TheIWLineOfTheIWalking.hxx @@ -26,7 +26,7 @@ #include #include #include -class IntSurf_LineOn2S; +#include class Standard_OutOfRange; class Standard_DomainError; class IntSurf_PathPoint; @@ -162,18 +162,169 @@ private: Standard_Boolean istgtend; }; -#define TheStartPoint IntSurf_PathPoint -#define TheStartPoint_hxx -#define IntWalk_IWLine IntPatch_TheIWLineOfTheIWalking -#define IntWalk_IWLine_hxx -#define Handle_IntWalk_IWLine Handle(IntPatch_TheIWLineOfTheIWalking) +//================================================================================================= +// Inline implementations +//================================================================================================= -#include +inline void IntPatch_TheIWLineOfTheIWalking::Cut(const Standard_Integer Index) +{ + Handle(IntSurf_LineOn2S) lost = line->Split(Index); +} + +inline void IntPatch_TheIWLineOfTheIWalking::AddPoint(const IntSurf_PntOn2S& P) +{ + line->Add(P); +} + +inline void IntPatch_TheIWLineOfTheIWalking::AddStatusFirst(const Standard_Boolean Closed, + const Standard_Boolean HasFirst) +{ + closed = Closed; + hasFirst = HasFirst; +} + +inline void IntPatch_TheIWLineOfTheIWalking::AddStatusLast(const Standard_Boolean HasLast) +{ + hasLast = HasLast; +} + +inline void IntPatch_TheIWLineOfTheIWalking::AddStatusFirst(const Standard_Boolean Closed, + const Standard_Boolean HasFirst, + const Standard_Integer Index, + const IntSurf_PathPoint& P) +{ + closed = Closed; + hasFirst = HasFirst; + firstIndex = Index; + theFirstPoint = P; +} + +inline void IntPatch_TheIWLineOfTheIWalking::AddStatusLast(const Standard_Boolean HasLast, + const Standard_Integer Index, + const IntSurf_PathPoint& P) +{ + hasLast = HasLast; + lastIndex = Index; + theLastPoint = P; +} + +inline void IntPatch_TheIWLineOfTheIWalking::AddStatusFirstLast(const Standard_Boolean Closed, + const Standard_Boolean HasFirst, + const Standard_Boolean HasLast) +{ + closed = Closed; + hasFirst = HasFirst; + hasLast = HasLast; +} + +inline void IntPatch_TheIWLineOfTheIWalking::AddIndexPassing(const Standard_Integer Index) +{ + couple.Append(IntSurf_Couple(line->NbPoints() + 1, Index)); +} + +inline Standard_Integer IntPatch_TheIWLineOfTheIWalking::NbPoints() const +{ + return line->NbPoints(); +} + +inline const IntSurf_PntOn2S& IntPatch_TheIWLineOfTheIWalking::Value( + const Standard_Integer Index) const +{ + return line->Value(Index); +} + +inline const Handle(IntSurf_LineOn2S)& IntPatch_TheIWLineOfTheIWalking::Line() const +{ + return line; +} + +inline Standard_Boolean IntPatch_TheIWLineOfTheIWalking::IsClosed() const +{ + return closed; +} + +inline Standard_Boolean IntPatch_TheIWLineOfTheIWalking::HasFirstPoint() const +{ + return hasFirst; +} + +inline Standard_Integer IntPatch_TheIWLineOfTheIWalking::FirstPointIndex() const +{ + if (!hasFirst) + throw Standard_DomainError(); + return firstIndex; +} + +inline const IntSurf_PathPoint& IntPatch_TheIWLineOfTheIWalking::FirstPoint() const +{ + if (!hasFirst) + throw Standard_DomainError(); + return theFirstPoint; +} + +inline Standard_Boolean IntPatch_TheIWLineOfTheIWalking::HasLastPoint() const +{ + return hasLast; +} + +inline const IntSurf_PathPoint& IntPatch_TheIWLineOfTheIWalking::LastPoint() const +{ + if (!hasLast) + throw Standard_DomainError(); + return theLastPoint; +} + +inline Standard_Integer IntPatch_TheIWLineOfTheIWalking::LastPointIndex() const +{ + if (!hasLast) + throw Standard_DomainError(); + return lastIndex; +} + +inline Standard_Integer IntPatch_TheIWLineOfTheIWalking::NbPassingPoint() const +{ + return couple.Length(); +} + +inline void IntPatch_TheIWLineOfTheIWalking::PassingPoint(const Standard_Integer Index, + Standard_Integer& IndexLine, + Standard_Integer& IndexPnts) const +{ + IndexLine = couple(Index).First(); + IndexPnts = couple(Index).Second(); +} + +inline void IntPatch_TheIWLineOfTheIWalking::SetTangentVector(const gp_Vec& V, + const Standard_Integer Index) +{ + indextg = Index; + vcttg = V; +} + +inline void IntPatch_TheIWLineOfTheIWalking::SetTangencyAtBegining(const Standard_Boolean IsTangent) +{ + istgtend = IsTangent; +} + +inline void IntPatch_TheIWLineOfTheIWalking::SetTangencyAtEnd(const Standard_Boolean IsTangent) +{ + istgtend = IsTangent; +} + +inline const gp_Vec& IntPatch_TheIWLineOfTheIWalking::TangentVector(Standard_Integer& Index) const +{ + Index = indextg; + return vcttg; +} -#undef TheStartPoint -#undef TheStartPoint_hxx -#undef IntWalk_IWLine -#undef IntWalk_IWLine_hxx -#undef Handle_IntWalk_IWLine +inline Standard_Boolean IntPatch_TheIWLineOfTheIWalking::IsTangentAtBegining() const +{ + return istgtbeg; +} + +inline Standard_Boolean IntPatch_TheIWLineOfTheIWalking::IsTangentAtEnd() const +{ + return istgtend; +} #endif // _IntPatch_TheIWLineOfTheIWalking_HeaderFile diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_TheIWLineOfTheIWalking_0.cxx b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_TheIWLineOfTheIWalking_0.cxx index a756686127..8c5dfd23ab 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_TheIWLineOfTheIWalking_0.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_TheIWLineOfTheIWalking_0.cxx @@ -25,9 +25,27 @@ #include #include -#define TheStartPoint IntSurf_PathPoint -#define TheStartPoint_hxx -#define IntWalk_IWLine IntPatch_TheIWLineOfTheIWalking -#define IntWalk_IWLine_hxx -#define Handle_IntWalk_IWLine Handle(IntPatch_TheIWLineOfTheIWalking) -#include +IntPatch_TheIWLineOfTheIWalking::IntPatch_TheIWLineOfTheIWalking( + const IntSurf_Allocator& theAllocator) + : line(new IntSurf_LineOn2S(theAllocator)), + closed(Standard_False), + hasFirst(Standard_False), + hasLast(Standard_False), + firstIndex(-1), + lastIndex(-1), + indextg(-1), + istgtbeg(Standard_False), + istgtend(Standard_False) +{ +} + +void IntPatch_TheIWLineOfTheIWalking::Reverse() +{ + line->Reverse(); + Standard_Integer N = line->NbPoints(); + Standard_Integer NbCouple = couple.Length(); + for (Standard_Integer i = 1; i <= NbCouple; i++) + { + couple(i) = IntSurf_Couple(N - couple(i).First() + 1, couple(i).Second()); + } +} diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_ThePathPointOfTheSOnBounds.hxx b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_ThePathPointOfTheSOnBounds.hxx index 0d63e7683d..6b53c36039 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_ThePathPointOfTheSOnBounds.hxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_ThePathPointOfTheSOnBounds.hxx @@ -75,20 +75,68 @@ private: Standard_Real param; }; -#define TheVertex Handle(Adaptor3d_HVertex) -#define TheVertex_hxx -#define TheArc Handle(Adaptor2d_Curve2d) -#define TheArc_hxx -#define IntStart_PathPoint IntPatch_ThePathPointOfTheSOnBounds -#define IntStart_PathPoint_hxx - -#include - -#undef TheVertex -#undef TheVertex_hxx -#undef TheArc -#undef TheArc_hxx -#undef IntStart_PathPoint -#undef IntStart_PathPoint_hxx +//================================================================================================= +// Inline implementations +//================================================================================================= + +inline void IntPatch_ThePathPointOfTheSOnBounds::SetValue(const gp_Pnt& P, + const Standard_Real Tol, + const Handle(Adaptor3d_HVertex)& V, + const Handle(Adaptor2d_Curve2d)& A, + const Standard_Real Parameter) +{ + isnew = Standard_False; + point = P; + tol = Tol; + vtx = V; + arc = A; + param = Parameter; +} + +inline void IntPatch_ThePathPointOfTheSOnBounds::SetValue(const gp_Pnt& P, + const Standard_Real Tol, + const Handle(Adaptor2d_Curve2d)& A, + const Standard_Real Parameter) +{ + isnew = Standard_True; + point = P; + tol = Tol; + arc = A; + param = Parameter; +} + +inline const gp_Pnt& IntPatch_ThePathPointOfTheSOnBounds::Value() const +{ + return point; +} + +inline Standard_Real IntPatch_ThePathPointOfTheSOnBounds::Tolerance() const +{ + return tol; +} + +inline Standard_Boolean IntPatch_ThePathPointOfTheSOnBounds::IsNew() const +{ + return isnew; +} + +inline const Handle(Adaptor3d_HVertex)& IntPatch_ThePathPointOfTheSOnBounds::Vertex() const +{ + if (isnew) + { + throw Standard_DomainError(); + } + return vtx; +} + +inline const Handle(Adaptor2d_Curve2d)& IntPatch_ThePathPointOfTheSOnBounds::Arc() const +{ + return arc; +} + +inline Standard_Real IntPatch_ThePathPointOfTheSOnBounds::Parameter() const +{ + return param; +} #endif // _IntPatch_ThePathPointOfTheSOnBounds_HeaderFile diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_ThePathPointOfTheSOnBounds_0.cxx b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_ThePathPointOfTheSOnBounds_0.cxx index f6f375821d..c5a4c89324 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_ThePathPointOfTheSOnBounds_0.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_ThePathPointOfTheSOnBounds_0.cxx @@ -21,10 +21,37 @@ #include #include -#define TheVertex Handle(Adaptor3d_HVertex) -#define TheVertex_hxx -#define TheArc Handle(Adaptor2d_Curve2d) -#define TheArc_hxx -#define IntStart_PathPoint IntPatch_ThePathPointOfTheSOnBounds -#define IntStart_PathPoint_hxx -#include +IntPatch_ThePathPointOfTheSOnBounds::IntPatch_ThePathPointOfTheSOnBounds() + : tol(0.0), + isnew(Standard_True), + param(0.0) +{ +} + +IntPatch_ThePathPointOfTheSOnBounds::IntPatch_ThePathPointOfTheSOnBounds( + const gp_Pnt& P, + const Standard_Real Tol, + const Handle(Adaptor3d_HVertex)& V, + const Handle(Adaptor2d_Curve2d)& A, + const Standard_Real Parameter) + : point(P), + tol(Tol), + isnew(Standard_False), + vtx(V), + arc(A), + param(Parameter) +{ +} + +IntPatch_ThePathPointOfTheSOnBounds::IntPatch_ThePathPointOfTheSOnBounds( + const gp_Pnt& P, + const Standard_Real Tol, + const Handle(Adaptor2d_Curve2d)& A, + const Standard_Real Parameter) + : point(P), + tol(Tol), + isnew(Standard_True), + arc(A), + param(Parameter) +{ +} diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_TheSegmentOfTheSOnBounds.hxx b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_TheSegmentOfTheSOnBounds.hxx index 5857a473f4..fba4378c6d 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_TheSegmentOfTheSOnBounds.hxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_TheSegmentOfTheSOnBounds.hxx @@ -70,24 +70,50 @@ private: IntPatch_ThePathPointOfTheSOnBounds thelp; }; -#define TheVertex Handle(Adaptor3d_HVertex) -#define TheVertex_hxx -#define TheArc Handle(Adaptor2d_Curve2d) -#define TheArc_hxx -#define ThePathPoint IntPatch_ThePathPointOfTheSOnBounds -#define ThePathPoint_hxx -#define IntStart_Segment IntPatch_TheSegmentOfTheSOnBounds -#define IntStart_Segment_hxx - -#include - -#undef TheVertex -#undef TheVertex_hxx -#undef TheArc -#undef TheArc_hxx -#undef ThePathPoint -#undef ThePathPoint_hxx -#undef IntStart_Segment -#undef IntStart_Segment_hxx +//================================================================================================= +// Inline implementations +//================================================================================================= + +inline void IntPatch_TheSegmentOfTheSOnBounds::SetValue(const Handle(Adaptor2d_Curve2d)& A) +{ + hasfp = Standard_False; + haslp = Standard_False; + arc = A; +} + +inline const Handle(Adaptor2d_Curve2d)& IntPatch_TheSegmentOfTheSOnBounds::Curve() const +{ + return arc; +} + +inline Standard_Boolean IntPatch_TheSegmentOfTheSOnBounds::HasFirstPoint() const +{ + return hasfp; +} + +inline const IntPatch_ThePathPointOfTheSOnBounds& IntPatch_TheSegmentOfTheSOnBounds::FirstPoint() + const +{ + if (!hasfp) + { + throw Standard_DomainError(); + } + return thefp; +} + +inline Standard_Boolean IntPatch_TheSegmentOfTheSOnBounds::HasLastPoint() const +{ + return haslp; +} + +inline const IntPatch_ThePathPointOfTheSOnBounds& IntPatch_TheSegmentOfTheSOnBounds::LastPoint() + const +{ + if (!haslp) + { + throw Standard_DomainError(); + } + return thelp; +} #endif // _IntPatch_TheSegmentOfTheSOnBounds_HeaderFile diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_TheSegmentOfTheSOnBounds_0.cxx b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_TheSegmentOfTheSOnBounds_0.cxx index 1f10705eb8..90f0c890db 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_TheSegmentOfTheSOnBounds_0.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_TheSegmentOfTheSOnBounds_0.cxx @@ -21,12 +21,23 @@ #include #include -#define TheVertex Handle(Adaptor3d_HVertex) -#define TheVertex_hxx -#define TheArc Handle(Adaptor2d_Curve2d) -#define TheArc_hxx -#define ThePathPoint IntPatch_ThePathPointOfTheSOnBounds -#define ThePathPoint_hxx -#define IntStart_Segment IntPatch_TheSegmentOfTheSOnBounds -#define IntStart_Segment_hxx -#include +IntPatch_TheSegmentOfTheSOnBounds::IntPatch_TheSegmentOfTheSOnBounds() + : hasfp(Standard_False), + haslp(Standard_False) +{ +} + +void IntPatch_TheSegmentOfTheSOnBounds::SetLimitPoint(const IntPatch_ThePathPointOfTheSOnBounds& V, + const Standard_Boolean First) +{ + if (First) + { + hasfp = Standard_True; + thefp = V; + } + else + { + haslp = Standard_True; + thelp = V; + } +} diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntStart/FILES.cmake b/src/ModelingAlgorithms/TKGeomAlgo/IntStart/FILES.cmake index 434e7832c2..0173015fbe 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntStart/FILES.cmake +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntStart/FILES.cmake @@ -2,14 +2,10 @@ set(OCCT_IntStart_FILES_LOCATION "${CMAKE_CURRENT_LIST_DIR}") set(OCCT_IntStart_FILES - IntStart_PathPoint.gxx - IntStart_PathPoint.lxx IntStart_SearchInside.gxx IntStart_SearchInside.lxx IntStart_SearchOnBoundaries.gxx IntStart_SearchOnBoundaries.lxx - IntStart_Segment.gxx - IntStart_Segment.lxx IntStart_SITopolTool.cxx IntStart_SITopolTool.hxx ) diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntStart/IntStart_PathPoint.gxx b/src/ModelingAlgorithms/TKGeomAlgo/IntStart/IntStart_PathPoint.gxx deleted file mode 100644 index 8b54daf8c3..0000000000 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntStart/IntStart_PathPoint.gxx +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) 1995-1999 Matra Datavision -// Copyright (c) 1999-2014 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. - -IntStart_PathPoint::IntStart_PathPoint() - : tol(0.0), - isnew(Standard_True), - param(0.0) -{ -} - -IntStart_PathPoint::IntStart_PathPoint(const gp_Pnt& P, - const Standard_Real Tol, - const TheVertex& V, - const TheArc& A, - const Standard_Real Parameter) - : - - point(P), - tol(Tol), - isnew(Standard_False), - vtx(V), - arc(A), - param(Parameter) -{ -} - -IntStart_PathPoint::IntStart_PathPoint(const gp_Pnt& P, - const Standard_Real Tol, - const TheArc& A, - const Standard_Real Parameter) - : - - point(P), - tol(Tol), - isnew(Standard_True), - arc(A), - param(Parameter) -{ -} diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntStart/IntStart_PathPoint.lxx b/src/ModelingAlgorithms/TKGeomAlgo/IntStart/IntStart_PathPoint.lxx deleted file mode 100644 index 2cfe7f33a4..0000000000 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntStart/IntStart_PathPoint.lxx +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) 1995-1999 Matra Datavision -// Copyright (c) 1999-2014 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 - -inline void IntStart_PathPoint::SetValue(const gp_Pnt& P, - const Standard_Real Tol, - const TheVertex& V, - const TheArc& A, - const Standard_Real Parameter) -{ - - isnew = Standard_False; - point = P; - tol = Tol; - vtx = V; - arc = A; - param = Parameter; -} - -inline void IntStart_PathPoint::SetValue(const gp_Pnt& P, - const Standard_Real Tol, - const TheArc& A, - const Standard_Real Parameter) -{ - - isnew = Standard_True; - point = P; - tol = Tol; - arc = A; - param = Parameter; -} - -inline const gp_Pnt& IntStart_PathPoint::Value() const -{ - - return point; -} - -inline Standard_Real IntStart_PathPoint::Tolerance() const -{ - - return tol; -} - -inline Standard_Boolean IntStart_PathPoint::IsNew() const -{ - - return isnew; -} - -inline const TheVertex& IntStart_PathPoint::Vertex() const -{ - - if (isnew) - { - throw Standard_DomainError(); - } - return vtx; -} - -inline const TheArc& IntStart_PathPoint::Arc() const -{ - - return arc; -} - -inline Standard_Real IntStart_PathPoint::Parameter() const -{ - - return param; -} diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntStart/IntStart_Segment.gxx b/src/ModelingAlgorithms/TKGeomAlgo/IntStart/IntStart_Segment.gxx deleted file mode 100644 index d41b01359e..0000000000 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntStart/IntStart_Segment.gxx +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) 1995-1999 Matra Datavision -// Copyright (c) 1999-2014 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. - -IntStart_Segment::IntStart_Segment() - : hasfp(Standard_False), - haslp(Standard_False) -{ -} - -void IntStart_Segment::SetLimitPoint(const ThePathPoint& V, const Standard_Boolean First) -{ - - if (First) - { - hasfp = Standard_True; - thefp = V; - } - else - { - haslp = Standard_True; - thelp = V; - } -} diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntStart/IntStart_Segment.lxx b/src/ModelingAlgorithms/TKGeomAlgo/IntStart/IntStart_Segment.lxx deleted file mode 100644 index 14190ddd50..0000000000 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntStart/IntStart_Segment.lxx +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) 1995-1999 Matra Datavision -// Copyright (c) 1999-2014 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 - -inline void IntStart_Segment::SetValue(const TheArc& A) -{ - - hasfp = Standard_False; - haslp = Standard_False; - arc = A; -} - -inline const TheArc& IntStart_Segment::Curve() const -{ - - return arc; -} - -inline Standard_Boolean IntStart_Segment::HasFirstPoint() const -{ - - return hasfp; -} - -inline const ThePathPoint& IntStart_Segment::FirstPoint() const -{ - - if (!hasfp) - { - throw Standard_DomainError(); - } - return thefp; -} - -inline Standard_Boolean IntStart_Segment::HasLastPoint() const -{ - - return haslp; -} - -inline const ThePathPoint& IntStart_Segment::LastPoint() const -{ - - if (!haslp) - { - throw Standard_DomainError(); - } - return thelp; -} diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntWalk/FILES.cmake b/src/ModelingAlgorithms/TKGeomAlgo/IntWalk/FILES.cmake index c2efbdb9cd..05628d9bbf 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntWalk/FILES.cmake +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntWalk/FILES.cmake @@ -4,8 +4,6 @@ set(OCCT_IntWalk_FILES_LOCATION "${CMAKE_CURRENT_LIST_DIR}") set(OCCT_IntWalk_FILES IntWalk_IWalking.gxx IntWalk_IWalking.lxx - IntWalk_IWLine.gxx - IntWalk_IWLine.lxx IntWalk_PWalking.cxx IntWalk_PWalking.hxx IntWalk_PWalking.lxx diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntWalk/IntWalk_IWLine.gxx b/src/ModelingAlgorithms/TKGeomAlgo/IntWalk/IntWalk_IWLine.gxx deleted file mode 100644 index d8715e1f46..0000000000 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntWalk/IntWalk_IWLine.gxx +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) 1995-1999 Matra Datavision -// Copyright (c) 1999-2014 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 - -IntWalk_IWLine::IntWalk_IWLine(const IntSurf_Allocator& theAllocator) - : line(new IntSurf_LineOn2S(theAllocator)), - closed(Standard_False), - hasFirst(Standard_False), - hasLast(Standard_False), - firstIndex(-1), - lastIndex(-1), - indextg(-1), - istgtbeg(Standard_False), - istgtend(Standard_False) -{ -} - -void IntWalk_IWLine::Reverse() -{ - line->Reverse(); - Standard_Integer N = line->NbPoints(); - Standard_Integer NbCouple = couple.Length(); - for (Standard_Integer i = 1; i <= NbCouple; i++) - { - couple(i) = IntSurf_Couple(N - couple(i).First() + 1, couple(i).Second()); - } -} diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntWalk/IntWalk_IWLine.lxx b/src/ModelingAlgorithms/TKGeomAlgo/IntWalk/IntWalk_IWLine.lxx deleted file mode 100644 index aaf815b8a6..0000000000 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntWalk/IntWalk_IWLine.lxx +++ /dev/null @@ -1,189 +0,0 @@ -// Copyright (c) 1995-1999 Matra Datavision -// Copyright (c) 1999-2014 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 -#include -#include -#include - -inline void IntWalk_IWLine::Cut(const Standard_Integer Index) -{ - //-- std::cout<<" split : "<Split(Index); -} - -inline void IntWalk_IWLine::AddPoint(const IntSurf_PntOn2S& P) -{ - line->Add(P); -} - -inline void IntWalk_IWLine::AddStatusFirst(const Standard_Boolean Closed, - const Standard_Boolean HasFirst) -{ - closed = Closed; - hasFirst = HasFirst; -} - -inline void IntWalk_IWLine::AddStatusLast(const Standard_Boolean HasLast) -{ - hasLast = HasLast; -} - -inline void IntWalk_IWLine::AddStatusFirst(const Standard_Boolean Closed, - const Standard_Boolean HasFirst, - const Standard_Integer Index, - const TheStartPoint& P) -{ - closed = Closed; - hasFirst = HasFirst; - firstIndex = Index; - theFirstPoint = P; -} - -inline void IntWalk_IWLine::AddStatusLast(const Standard_Boolean HasLast, - const Standard_Integer Index, - const TheStartPoint& P) -{ - hasLast = HasLast; - lastIndex = Index; - theLastPoint = P; -} - -inline void IntWalk_IWLine::AddStatusFirstLast(const Standard_Boolean Closed, - const Standard_Boolean HasFirst, - const Standard_Boolean HasLast) -{ - closed = Closed; - hasFirst = HasFirst; - hasLast = HasLast; -} - -inline void IntWalk_IWLine::AddIndexPassing(const Standard_Integer Index) - -{ - couple.Append(IntSurf_Couple(line->NbPoints() + 1, Index)); -} - -inline Standard_Integer IntWalk_IWLine::NbPoints() const -{ - return line->NbPoints(); -} - -inline const IntSurf_PntOn2S& IntWalk_IWLine::Value(const Standard_Integer Index) const -{ - return line->Value(Index); -} - -inline const Handle(IntSurf_LineOn2S)& IntWalk_IWLine::Line() const -{ - return line; -} - -inline Standard_Boolean IntWalk_IWLine::IsClosed() const -{ - return closed; -} - -inline Standard_Boolean IntWalk_IWLine::HasFirstPoint() const -{ - return hasFirst; -} - -inline Standard_Integer IntWalk_IWLine::FirstPointIndex() const -{ - if (!hasFirst) - throw Standard_DomainError(); - return firstIndex; -} - -inline const TheStartPoint& IntWalk_IWLine::FirstPoint() const -{ - if (!hasFirst) - throw Standard_DomainError(); - return theFirstPoint; -} - -inline Standard_Boolean IntWalk_IWLine::HasLastPoint() const -{ - return hasLast; -} - -inline const TheStartPoint& IntWalk_IWLine::LastPoint() const -{ - if (!hasLast) - throw Standard_DomainError(); - return theLastPoint; -} - -inline Standard_Integer IntWalk_IWLine::LastPointIndex() const -{ - if (!hasLast) - throw Standard_DomainError(); - return lastIndex; -} - -inline Standard_Integer IntWalk_IWLine::NbPassingPoint() const -{ - return couple.Length(); -} - -inline void IntWalk_IWLine::PassingPoint(const Standard_Integer Index, - Standard_Integer& IndexLine, - Standard_Integer& IndexPnts) const -{ - IndexLine = couple(Index).First(); - IndexPnts = couple(Index).Second(); -} - -inline void IntWalk_IWLine::SetTangentVector(const gp_Vec& V, const Standard_Integer Index) -{ - indextg = Index; - vcttg = V; - - //-- std::cout<<"\n IntWalk_IWLine::SetTangentVector : "< #include #include -class IntSurf_LineOn2S; +#include class Standard_OutOfRange; class Standard_DomainError; class IntSurf_PathPoint; @@ -164,18 +164,169 @@ private: Standard_Boolean istgtend; }; -#define TheStartPoint IntSurf_PathPoint -#define TheStartPoint_hxx -#define IntWalk_IWLine Contap_TheIWLineOfTheIWalking -#define IntWalk_IWLine_hxx -#define Handle_IntWalk_IWLine Handle(Contap_TheIWLineOfTheIWalking) +//================================================================================================= +// Inline implementations +//================================================================================================= -#include +inline void Contap_TheIWLineOfTheIWalking::Cut(const Standard_Integer Index) +{ + Handle(IntSurf_LineOn2S) lost = line->Split(Index); +} + +inline void Contap_TheIWLineOfTheIWalking::AddPoint(const IntSurf_PntOn2S& P) +{ + line->Add(P); +} + +inline void Contap_TheIWLineOfTheIWalking::AddStatusFirst(const Standard_Boolean Closed, + const Standard_Boolean HasFirst) +{ + closed = Closed; + hasFirst = HasFirst; +} + +inline void Contap_TheIWLineOfTheIWalking::AddStatusLast(const Standard_Boolean HasLast) +{ + hasLast = HasLast; +} + +inline void Contap_TheIWLineOfTheIWalking::AddStatusFirst(const Standard_Boolean Closed, + const Standard_Boolean HasFirst, + const Standard_Integer Index, + const IntSurf_PathPoint& P) +{ + closed = Closed; + hasFirst = HasFirst; + firstIndex = Index; + theFirstPoint = P; +} + +inline void Contap_TheIWLineOfTheIWalking::AddStatusLast(const Standard_Boolean HasLast, + const Standard_Integer Index, + const IntSurf_PathPoint& P) +{ + hasLast = HasLast; + lastIndex = Index; + theLastPoint = P; +} + +inline void Contap_TheIWLineOfTheIWalking::AddStatusFirstLast(const Standard_Boolean Closed, + const Standard_Boolean HasFirst, + const Standard_Boolean HasLast) +{ + closed = Closed; + hasFirst = HasFirst; + hasLast = HasLast; +} + +inline void Contap_TheIWLineOfTheIWalking::AddIndexPassing(const Standard_Integer Index) +{ + couple.Append(IntSurf_Couple(line->NbPoints() + 1, Index)); +} + +inline Standard_Integer Contap_TheIWLineOfTheIWalking::NbPoints() const +{ + return line->NbPoints(); +} + +inline const IntSurf_PntOn2S& Contap_TheIWLineOfTheIWalking::Value( + const Standard_Integer Index) const +{ + return line->Value(Index); +} + +inline const Handle(IntSurf_LineOn2S)& Contap_TheIWLineOfTheIWalking::Line() const +{ + return line; +} + +inline Standard_Boolean Contap_TheIWLineOfTheIWalking::IsClosed() const +{ + return closed; +} + +inline Standard_Boolean Contap_TheIWLineOfTheIWalking::HasFirstPoint() const +{ + return hasFirst; +} + +inline Standard_Integer Contap_TheIWLineOfTheIWalking::FirstPointIndex() const +{ + if (!hasFirst) + throw Standard_DomainError(); + return firstIndex; +} + +inline const IntSurf_PathPoint& Contap_TheIWLineOfTheIWalking::FirstPoint() const +{ + if (!hasFirst) + throw Standard_DomainError(); + return theFirstPoint; +} + +inline Standard_Boolean Contap_TheIWLineOfTheIWalking::HasLastPoint() const +{ + return hasLast; +} + +inline const IntSurf_PathPoint& Contap_TheIWLineOfTheIWalking::LastPoint() const +{ + if (!hasLast) + throw Standard_DomainError(); + return theLastPoint; +} + +inline Standard_Integer Contap_TheIWLineOfTheIWalking::LastPointIndex() const +{ + if (!hasLast) + throw Standard_DomainError(); + return lastIndex; +} + +inline Standard_Integer Contap_TheIWLineOfTheIWalking::NbPassingPoint() const +{ + return couple.Length(); +} + +inline void Contap_TheIWLineOfTheIWalking::PassingPoint(const Standard_Integer Index, + Standard_Integer& IndexLine, + Standard_Integer& IndexPnts) const +{ + IndexLine = couple(Index).First(); + IndexPnts = couple(Index).Second(); +} + +inline void Contap_TheIWLineOfTheIWalking::SetTangentVector(const gp_Vec& V, + const Standard_Integer Index) +{ + indextg = Index; + vcttg = V; +} + +inline void Contap_TheIWLineOfTheIWalking::SetTangencyAtBegining(const Standard_Boolean IsTangent) +{ + istgtend = IsTangent; +} + +inline void Contap_TheIWLineOfTheIWalking::SetTangencyAtEnd(const Standard_Boolean IsTangent) +{ + istgtend = IsTangent; +} + +inline const gp_Vec& Contap_TheIWLineOfTheIWalking::TangentVector(Standard_Integer& Index) const +{ + Index = indextg; + return vcttg; +} -#undef TheStartPoint -#undef TheStartPoint_hxx -#undef IntWalk_IWLine -#undef IntWalk_IWLine_hxx -#undef Handle_IntWalk_IWLine +inline Standard_Boolean Contap_TheIWLineOfTheIWalking::IsTangentAtBegining() const +{ + return istgtbeg; +} + +inline Standard_Boolean Contap_TheIWLineOfTheIWalking::IsTangentAtEnd() const +{ + return istgtend; +} #endif // _Contap_TheIWLineOfTheIWalking_HeaderFile diff --git a/src/ModelingAlgorithms/TKHLR/Contap/Contap_TheIWLineOfTheIWalking_0.cxx b/src/ModelingAlgorithms/TKHLR/Contap/Contap_TheIWLineOfTheIWalking_0.cxx index d8801ef798..240f1776f4 100644 --- a/src/ModelingAlgorithms/TKHLR/Contap/Contap_TheIWLineOfTheIWalking_0.cxx +++ b/src/ModelingAlgorithms/TKHLR/Contap/Contap_TheIWLineOfTheIWalking_0.cxx @@ -25,9 +25,26 @@ #include #include -#define TheStartPoint IntSurf_PathPoint -#define TheStartPoint_hxx -#define IntWalk_IWLine Contap_TheIWLineOfTheIWalking -#define IntWalk_IWLine_hxx -#define Handle_IntWalk_IWLine Handle(Contap_TheIWLineOfTheIWalking) -#include +Contap_TheIWLineOfTheIWalking::Contap_TheIWLineOfTheIWalking(const IntSurf_Allocator& theAllocator) + : line(new IntSurf_LineOn2S(theAllocator)), + closed(Standard_False), + hasFirst(Standard_False), + hasLast(Standard_False), + firstIndex(-1), + lastIndex(-1), + indextg(-1), + istgtbeg(Standard_False), + istgtend(Standard_False) +{ +} + +void Contap_TheIWLineOfTheIWalking::Reverse() +{ + line->Reverse(); + Standard_Integer N = line->NbPoints(); + Standard_Integer NbCouple = couple.Length(); + for (Standard_Integer i = 1; i <= NbCouple; i++) + { + couple(i) = IntSurf_Couple(N - couple(i).First() + 1, couple(i).Second()); + } +} diff --git a/src/ModelingAlgorithms/TKHLR/Contap/Contap_ThePathPointOfTheSearch.hxx b/src/ModelingAlgorithms/TKHLR/Contap/Contap_ThePathPointOfTheSearch.hxx index a8a79fc4bb..521f0c63bf 100644 --- a/src/ModelingAlgorithms/TKHLR/Contap/Contap_ThePathPointOfTheSearch.hxx +++ b/src/ModelingAlgorithms/TKHLR/Contap/Contap_ThePathPointOfTheSearch.hxx @@ -75,20 +75,68 @@ private: Standard_Real param; }; -#define TheVertex Handle(Adaptor3d_HVertex) -#define TheVertex_hxx -#define TheArc Handle(Adaptor2d_Curve2d) -#define TheArc_hxx -#define IntStart_PathPoint Contap_ThePathPointOfTheSearch -#define IntStart_PathPoint_hxx - -#include - -#undef TheVertex -#undef TheVertex_hxx -#undef TheArc -#undef TheArc_hxx -#undef IntStart_PathPoint -#undef IntStart_PathPoint_hxx +//================================================================================================= +// Inline implementations +//================================================================================================= + +inline void Contap_ThePathPointOfTheSearch::SetValue(const gp_Pnt& P, + const Standard_Real Tol, + const Handle(Adaptor3d_HVertex)& V, + const Handle(Adaptor2d_Curve2d)& A, + const Standard_Real Parameter) +{ + isnew = Standard_False; + point = P; + tol = Tol; + vtx = V; + arc = A; + param = Parameter; +} + +inline void Contap_ThePathPointOfTheSearch::SetValue(const gp_Pnt& P, + const Standard_Real Tol, + const Handle(Adaptor2d_Curve2d)& A, + const Standard_Real Parameter) +{ + isnew = Standard_True; + point = P; + tol = Tol; + arc = A; + param = Parameter; +} + +inline const gp_Pnt& Contap_ThePathPointOfTheSearch::Value() const +{ + return point; +} + +inline Standard_Real Contap_ThePathPointOfTheSearch::Tolerance() const +{ + return tol; +} + +inline Standard_Boolean Contap_ThePathPointOfTheSearch::IsNew() const +{ + return isnew; +} + +inline const Handle(Adaptor3d_HVertex)& Contap_ThePathPointOfTheSearch::Vertex() const +{ + if (isnew) + { + throw Standard_DomainError(); + } + return vtx; +} + +inline const Handle(Adaptor2d_Curve2d)& Contap_ThePathPointOfTheSearch::Arc() const +{ + return arc; +} + +inline Standard_Real Contap_ThePathPointOfTheSearch::Parameter() const +{ + return param; +} #endif // _Contap_ThePathPointOfTheSearch_HeaderFile diff --git a/src/ModelingAlgorithms/TKHLR/Contap/Contap_ThePathPointOfTheSearch_0.cxx b/src/ModelingAlgorithms/TKHLR/Contap/Contap_ThePathPointOfTheSearch_0.cxx index 14a488b303..f6be45807f 100644 --- a/src/ModelingAlgorithms/TKHLR/Contap/Contap_ThePathPointOfTheSearch_0.cxx +++ b/src/ModelingAlgorithms/TKHLR/Contap/Contap_ThePathPointOfTheSearch_0.cxx @@ -21,10 +21,35 @@ #include #include -#define TheVertex Handle(Adaptor3d_HVertex) -#define TheVertex_hxx -#define TheArc Handle(Adaptor2d_Curve2d) -#define TheArc_hxx -#define IntStart_PathPoint Contap_ThePathPointOfTheSearch -#define IntStart_PathPoint_hxx -#include +Contap_ThePathPointOfTheSearch::Contap_ThePathPointOfTheSearch() + : tol(0.0), + isnew(Standard_True), + param(0.0) +{ +} + +Contap_ThePathPointOfTheSearch::Contap_ThePathPointOfTheSearch(const gp_Pnt& P, + const Standard_Real Tol, + const Handle(Adaptor3d_HVertex)& V, + const Handle(Adaptor2d_Curve2d)& A, + const Standard_Real Parameter) + : point(P), + tol(Tol), + isnew(Standard_False), + vtx(V), + arc(A), + param(Parameter) +{ +} + +Contap_ThePathPointOfTheSearch::Contap_ThePathPointOfTheSearch(const gp_Pnt& P, + const Standard_Real Tol, + const Handle(Adaptor2d_Curve2d)& A, + const Standard_Real Parameter) + : point(P), + tol(Tol), + isnew(Standard_True), + arc(A), + param(Parameter) +{ +} diff --git a/src/ModelingAlgorithms/TKHLR/Contap/Contap_TheSegmentOfTheSearch.hxx b/src/ModelingAlgorithms/TKHLR/Contap/Contap_TheSegmentOfTheSearch.hxx index fc16547473..0cc441f38e 100644 --- a/src/ModelingAlgorithms/TKHLR/Contap/Contap_TheSegmentOfTheSearch.hxx +++ b/src/ModelingAlgorithms/TKHLR/Contap/Contap_TheSegmentOfTheSearch.hxx @@ -67,24 +67,48 @@ private: Contap_ThePathPointOfTheSearch thelp; }; -#define TheVertex Handle(Adaptor3d_HVertex) -#define TheVertex_hxx -#define TheArc Handle(Adaptor2d_Curve2d) -#define TheArc_hxx -#define ThePathPoint Contap_ThePathPointOfTheSearch -#define ThePathPoint_hxx -#define IntStart_Segment Contap_TheSegmentOfTheSearch -#define IntStart_Segment_hxx - -#include - -#undef TheVertex -#undef TheVertex_hxx -#undef TheArc -#undef TheArc_hxx -#undef ThePathPoint -#undef ThePathPoint_hxx -#undef IntStart_Segment -#undef IntStart_Segment_hxx +//================================================================================================= +// Inline implementations +//================================================================================================= + +inline void Contap_TheSegmentOfTheSearch::SetValue(const Handle(Adaptor2d_Curve2d)& A) +{ + hasfp = Standard_False; + haslp = Standard_False; + arc = A; +} + +inline const Handle(Adaptor2d_Curve2d)& Contap_TheSegmentOfTheSearch::Curve() const +{ + return arc; +} + +inline Standard_Boolean Contap_TheSegmentOfTheSearch::HasFirstPoint() const +{ + return hasfp; +} + +inline const Contap_ThePathPointOfTheSearch& Contap_TheSegmentOfTheSearch::FirstPoint() const +{ + if (!hasfp) + { + throw Standard_DomainError(); + } + return thefp; +} + +inline Standard_Boolean Contap_TheSegmentOfTheSearch::HasLastPoint() const +{ + return haslp; +} + +inline const Contap_ThePathPointOfTheSearch& Contap_TheSegmentOfTheSearch::LastPoint() const +{ + if (!haslp) + { + throw Standard_DomainError(); + } + return thelp; +} #endif // _Contap_TheSegmentOfTheSearch_HeaderFile diff --git a/src/ModelingAlgorithms/TKHLR/Contap/Contap_TheSegmentOfTheSearch_0.cxx b/src/ModelingAlgorithms/TKHLR/Contap/Contap_TheSegmentOfTheSearch_0.cxx index a194599839..f5d8262c8e 100644 --- a/src/ModelingAlgorithms/TKHLR/Contap/Contap_TheSegmentOfTheSearch_0.cxx +++ b/src/ModelingAlgorithms/TKHLR/Contap/Contap_TheSegmentOfTheSearch_0.cxx @@ -21,12 +21,23 @@ #include #include -#define TheVertex Handle(Adaptor3d_HVertex) -#define TheVertex_hxx -#define TheArc Handle(Adaptor2d_Curve2d) -#define TheArc_hxx -#define ThePathPoint Contap_ThePathPointOfTheSearch -#define ThePathPoint_hxx -#define IntStart_Segment Contap_TheSegmentOfTheSearch -#define IntStart_Segment_hxx -#include +Contap_TheSegmentOfTheSearch::Contap_TheSegmentOfTheSearch() + : hasfp(Standard_False), + haslp(Standard_False) +{ +} + +void Contap_TheSegmentOfTheSearch::SetLimitPoint(const Contap_ThePathPointOfTheSearch& V, + const Standard_Boolean First) +{ + if (First) + { + hasfp = Standard_True; + thefp = V; + } + else + { + haslp = Standard_True; + thelp = V; + } +} diff --git a/src/ModelingAlgorithms/TKHLR/HLRAlgo/HLRAlgo_Interference.hxx b/src/ModelingAlgorithms/TKHLR/HLRAlgo/HLRAlgo_Interference.hxx index 749ec9b30c..0f909570b2 100644 --- a/src/ModelingAlgorithms/TKHLR/HLRAlgo/HLRAlgo_Interference.hxx +++ b/src/ModelingAlgorithms/TKHLR/HLRAlgo/HLRAlgo_Interference.hxx @@ -72,20 +72,90 @@ private: TopAbs_Orientation myBTransition; }; -#define TheSubShape HLRAlgo_Intersection -#define TheSubShape_hxx -#define TheShape HLRAlgo_Coincidence -#define TheShape_hxx -#define TopBas_Interference HLRAlgo_Interference -#define TopBas_Interference_hxx - -#include - -#undef TheSubShape -#undef TheSubShape_hxx -#undef TheShape -#undef TheShape_hxx -#undef TopBas_Interference -#undef TopBas_Interference_hxx +//================================================================================================= +// Inline implementations +//================================================================================================= + +inline void HLRAlgo_Interference::Intersection(const HLRAlgo_Intersection& I) +{ + myIntersection = I; +} + +//================================================================================================= + +inline void HLRAlgo_Interference::Boundary(const HLRAlgo_Coincidence& B) +{ + myBoundary = B; +} + +//================================================================================================= + +inline void HLRAlgo_Interference::Orientation(const TopAbs_Orientation Or) +{ + myOrientation = Or; +} + +//================================================================================================= + +inline void HLRAlgo_Interference::Transition(const TopAbs_Orientation Or) +{ + myTransition = Or; +} + +//================================================================================================= + +inline void HLRAlgo_Interference::BoundaryTransition(const TopAbs_Orientation Or) +{ + myBTransition = Or; +} + +//================================================================================================= + +inline const HLRAlgo_Intersection& HLRAlgo_Interference::Intersection() const +{ + return myIntersection; +} + +//================================================================================================= + +inline HLRAlgo_Intersection& HLRAlgo_Interference::ChangeIntersection() +{ + return myIntersection; +} + +//================================================================================================= + +inline const HLRAlgo_Coincidence& HLRAlgo_Interference::Boundary() const +{ + return myBoundary; +} + +//================================================================================================= + +inline HLRAlgo_Coincidence& HLRAlgo_Interference::ChangeBoundary() +{ + return myBoundary; +} + +//================================================================================================= + +inline TopAbs_Orientation HLRAlgo_Interference::Orientation() const +{ + return myOrientation; +} + +//================================================================================================= + +inline TopAbs_Orientation HLRAlgo_Interference::Transition() const +{ + return myTransition; +} + +//================================================================================================= + +inline TopAbs_Orientation HLRAlgo_Interference::BoundaryTransition() const +{ + return myBTransition; +} #endif // _HLRAlgo_Interference_HeaderFile diff --git a/src/ModelingAlgorithms/TKHLR/HLRAlgo/HLRAlgo_Interference_0.cxx b/src/ModelingAlgorithms/TKHLR/HLRAlgo/HLRAlgo_Interference_0.cxx index 4382258753..a3a6ba2df1 100644 --- a/src/ModelingAlgorithms/TKHLR/HLRAlgo/HLRAlgo_Interference_0.cxx +++ b/src/ModelingAlgorithms/TKHLR/HLRAlgo/HLRAlgo_Interference_0.cxx @@ -19,10 +19,21 @@ #include #include -#define TheSubShape HLRAlgo_Intersection -#define TheSubShape_hxx -#define TheShape HLRAlgo_Coincidence -#define TheShape_hxx -#define TopBas_Interference HLRAlgo_Interference -#define TopBas_Interference_hxx -#include +//================================================================================================= + +HLRAlgo_Interference::HLRAlgo_Interference() {} + +//================================================================================================= + +HLRAlgo_Interference::HLRAlgo_Interference(const HLRAlgo_Intersection& Inters, + const HLRAlgo_Coincidence& Bound, + const TopAbs_Orientation Orient, + const TopAbs_Orientation Trans, + const TopAbs_Orientation BTrans) + : myIntersection(Inters), + myBoundary(Bound), + myOrientation(Orient), + myTransition(Trans), + myBTransition(BTrans) +{ +} diff --git a/src/ModelingAlgorithms/TKHLR/HLRBRep/HLRBRep_MyImpParToolOfTheIntersectorOfTheIntConicCurveOfCInter_0.cxx b/src/ModelingAlgorithms/TKHLR/HLRBRep/HLRBRep_MyImpParToolOfTheIntersectorOfTheIntConicCurveOfCInter_0.cxx index 4aa43b0263..322f394582 100644 --- a/src/ModelingAlgorithms/TKHLR/HLRBRep/HLRBRep_MyImpParToolOfTheIntersectorOfTheIntConicCurveOfCInter_0.cxx +++ b/src/ModelingAlgorithms/TKHLR/HLRBRep/HLRBRep_MyImpParToolOfTheIntersectorOfTheIntConicCurveOfCInter_0.cxx @@ -19,13 +19,44 @@ #include #include -#define ImpTool IntCurve_IConicTool -#define ImpTool_hxx -#define ParCurve Standard_Address -#define ParCurve_hxx -#define ParTool HLRBRep_CurveTool -#define ParTool_hxx -#define IntImpParGen_ImpParTool HLRBRep_MyImpParToolOfTheIntersectorOfTheIntConicCurveOfCInter -#define IntImpParGen_ImpParTool_hxx \ - -#include +#include + +HLRBRep_MyImpParToolOfTheIntersectorOfTheIntConicCurveOfCInter:: + HLRBRep_MyImpParToolOfTheIntersectorOfTheIntConicCurveOfCInter(const IntCurve_IConicTool& ITool, + const Standard_Address& PC) + : TheImpTool(ITool) +{ + TheParCurve = (Standard_Address)(&PC); +} + +Standard_Boolean HLRBRep_MyImpParToolOfTheIntersectorOfTheIntConicCurveOfCInter::Value( + const Standard_Real Param, + Standard_Real& ApproxDistance) +{ + ApproxDistance = + TheImpTool.Distance(HLRBRep_CurveTool::Value((*((Standard_Address*)(TheParCurve))), Param)); + return (Standard_True); +} + +Standard_Boolean HLRBRep_MyImpParToolOfTheIntersectorOfTheIntConicCurveOfCInter::Derivative( + const Standard_Real Param, + Standard_Real& D_ApproxDistance_DV) +{ + gp_Pnt2d Pt; + gp_Vec2d TanParCurve; + gp_Vec2d Grad = + TheImpTool.GradDistance(HLRBRep_CurveTool::Value((*((Standard_Address*)(TheParCurve))), Param)); + HLRBRep_CurveTool::D1((*((Standard_Address*)(TheParCurve))), Param, Pt, TanParCurve); + D_ApproxDistance_DV = Grad.Dot(TanParCurve); + return (Standard_True); +} + +Standard_Boolean HLRBRep_MyImpParToolOfTheIntersectorOfTheIntConicCurveOfCInter::Values( + const Standard_Real Param, + Standard_Real& ApproxDistance, + Standard_Real& Deriv) +{ + this->Value(Param, ApproxDistance); + this->Derivative(Param, Deriv); + return (Standard_True); +} diff --git a/src/ModelingAlgorithms/TKHLR/HLRBRep/HLRBRep_ThePolygonToolOfInterCSurf_0.cxx b/src/ModelingAlgorithms/TKHLR/HLRBRep/HLRBRep_ThePolygonToolOfInterCSurf_0.cxx index e421fdb42a..25a2433174 100644 --- a/src/ModelingAlgorithms/TKHLR/HLRBRep/HLRBRep_ThePolygonToolOfInterCSurf_0.cxx +++ b/src/ModelingAlgorithms/TKHLR/HLRBRep/HLRBRep_ThePolygonToolOfInterCSurf_0.cxx @@ -21,12 +21,24 @@ #include #include -#define ThePoint gp_Pnt -#define ThePoint_hxx -#define ThePolygon HLRBRep_ThePolygonOfInterCSurf -#define ThePolygon_hxx -#define TheBoundingBox Bnd_Box -#define TheBoundingBox_hxx -#define IntCurveSurface_PolygonTool HLRBRep_ThePolygonToolOfInterCSurf -#define IntCurveSurface_PolygonTool_hxx -#include +#include + +void HLRBRep_ThePolygonToolOfInterCSurf::Dump(const HLRBRep_ThePolygonOfInterCSurf& L) +{ + static Standard_Integer num = 0; + num++; + Standard_Integer nbs = HLRBRep_ThePolygonToolOfInterCSurf::NbSegments(L); + std::cout << "\npol2d " << num << " " << nbs << std::endl; + std::cout << "Deflection " << HLRBRep_ThePolygonToolOfInterCSurf::DeflectionOverEstimation(L) + << std::endl; + + for (Standard_Integer i = 1; i <= nbs; i++) + { + gp_Pnt P(HLRBRep_ThePolygonToolOfInterCSurf::BeginOfSeg(L, i)); + std::cout << "pnt " << num << " " << i << " " << P.X() << " " << P.Y() << " " << P.Z() + << std::endl; + } + gp_Pnt PF(HLRBRep_ThePolygonToolOfInterCSurf::EndOfSeg(L, nbs)); + std::cout << "pnt " << num << " " << nbs << " " << PF.X() << " " << PF.Y() << " " << PF.Z() + << std::endl; +} diff --git a/src/ModelingAlgorithms/TKHLR/HLRBRep/HLRBRep_ThePolyhedronToolOfInterCSurf_0.cxx b/src/ModelingAlgorithms/TKHLR/HLRBRep/HLRBRep_ThePolyhedronToolOfInterCSurf_0.cxx index 110df1a807..4759064b14 100644 --- a/src/ModelingAlgorithms/TKHLR/HLRBRep/HLRBRep_ThePolyhedronToolOfInterCSurf_0.cxx +++ b/src/ModelingAlgorithms/TKHLR/HLRBRep/HLRBRep_ThePolyhedronToolOfInterCSurf_0.cxx @@ -21,8 +21,7 @@ #include #include -#define ThePolyhedron HLRBRep_ThePolyhedronOfInterCSurf -#define ThePolyhedron_hxx -#define IntCurveSurface_PolyhedronTool HLRBRep_ThePolyhedronToolOfInterCSurf -#define IntCurveSurface_PolyhedronTool_hxx -#include +void HLRBRep_ThePolyhedronToolOfInterCSurf::Dump(const HLRBRep_ThePolyhedronOfInterCSurf& polyh) +{ + polyh.Dump(); +} diff --git a/src/ModelingAlgorithms/TKHLR/HLRBRep/HLRBRep_TheProjPCurOfCInter_0.cxx b/src/ModelingAlgorithms/TKHLR/HLRBRep/HLRBRep_TheProjPCurOfCInter_0.cxx index c41a7c1d60..ee5ebb9ba7 100644 --- a/src/ModelingAlgorithms/TKHLR/HLRBRep/HLRBRep_TheProjPCurOfCInter_0.cxx +++ b/src/ModelingAlgorithms/TKHLR/HLRBRep/HLRBRep_TheProjPCurOfCInter_0.cxx @@ -21,21 +21,58 @@ #include #include #include +#include -#define TheCurve Standard_Address -#define TheCurve_hxx -#define TheCurveTool HLRBRep_CurveTool -#define TheCurveTool_hxx -#define IntCurve_TheCurveLocator HLRBRep_TheCurveLocatorOfTheProjPCurOfCInter -#define IntCurve_TheCurveLocator_hxx -#define IntCurve_TheLocateExtPC HLRBRep_TheLocateExtPCOfTheProjPCurOfCInter -#define IntCurve_TheLocateExtPC_hxx -#define IntCurve_PCLocFOfTheLocateExtPC HLRBRep_PCLocFOfTheLocateExtPCOfTheProjPCurOfCInter -#define IntCurve_PCLocFOfTheLocateExtPC_hxx \ - -#define IntCurve_PCLocFOfTheLocateExtPC HLRBRep_PCLocFOfTheLocateExtPCOfTheProjPCurOfCInter -#define IntCurve_PCLocFOfTheLocateExtPC_hxx \ - -#define IntCurve_ProjPCurGen HLRBRep_TheProjPCurOfCInter -#define IntCurve_ProjPCurGen_hxx -#include +Standard_Real HLRBRep_TheProjPCurOfCInter::FindParameter(const Standard_Address& C, + const gp_Pnt2d& P, + const Standard_Real LowParameter, + const Standard_Real HighParameter, + const Standard_Real) +{ + Standard_Real theparam, defaultparam; + Standard_Integer NbPts = HLRBRep_CurveTool::NbSamples(C); + Standard_Real theEpsX = HLRBRep_CurveTool::EpsX(C); + Extrema_POnCurv2d POnC; + + HLRBRep_TheCurveLocatorOfTheProjPCurOfCInter::Locate(P, + C, + NbPts, + LowParameter, + HighParameter, + POnC); + defaultparam = POnC.Parameter(); + HLRBRep_TheLocateExtPCOfTheProjPCurOfCInter Loc(P, C, defaultparam, theEpsX); + + if (Loc.IsDone() == Standard_False) + { + //-- cout<<"\n Erreur dans LocateExtPC "< #include #include +#include -#define TheQuadric IntSurf_Quadric -#define TheQuadric_hxx -#define TheCurve gp_Lin -#define TheCurve_hxx -#define TheCurveTool HLRBRep_LineTool -#define TheCurveTool_hxx -#define IntCurveSurface_QuadricCurveFunc HLRBRep_TheQuadCurvFuncOfTheQuadCurvExactInterCSurf -#define IntCurveSurface_QuadricCurveFunc_hxx \ - -#include +HLRBRep_TheQuadCurvFuncOfTheQuadCurvExactInterCSurf:: + HLRBRep_TheQuadCurvFuncOfTheQuadCurvExactInterCSurf(const IntSurf_Quadric& Q, const gp_Lin& C) + : myQuadric(Q), + myCurve(C) +{ +} + +Standard_Boolean HLRBRep_TheQuadCurvFuncOfTheQuadCurvExactInterCSurf::Value( + const Standard_Real Param, + Standard_Real& F) +{ + F = myQuadric.Distance(HLRBRep_LineTool::Value(myCurve, Param)); + return (Standard_True); +} + +Standard_Boolean HLRBRep_TheQuadCurvFuncOfTheQuadCurvExactInterCSurf::Derivative( + const Standard_Real Param, + Standard_Real& D) +{ + gp_Pnt P; + gp_Vec T; + HLRBRep_LineTool::D1(myCurve, Param, P, T); + D = T.Dot(myQuadric.Gradient(P)); + return (Standard_True); +} + +Standard_Boolean HLRBRep_TheQuadCurvFuncOfTheQuadCurvExactInterCSurf::Values( + const Standard_Real Param, + Standard_Real& F, + Standard_Real& D) +{ + gp_Pnt P; + gp_Vec T, Grad; + HLRBRep_LineTool::D1(myCurve, Param, P, T); + myQuadric.ValAndGrad(P, F, Grad); + D = T.Dot(Grad); + return (Standard_True); +} diff --git a/src/ModelingAlgorithms/TKHLR/TopBas/FILES.cmake b/src/ModelingAlgorithms/TKHLR/TopBas/FILES.cmake index e2ae9827db..2f340cd0f3 100644 --- a/src/ModelingAlgorithms/TKHLR/TopBas/FILES.cmake +++ b/src/ModelingAlgorithms/TKHLR/TopBas/FILES.cmake @@ -2,8 +2,6 @@ set(OCCT_TopBas_FILES_LOCATION "${CMAKE_CURRENT_LIST_DIR}") set(OCCT_TopBas_FILES - TopBas_Interference.gxx - TopBas_Interference.lxx TopBas_ListIteratorOfListOfTestInterference.hxx TopBas_ListOfTestInterference.hxx TopBas_TestInterference.hxx diff --git a/src/ModelingAlgorithms/TKHLR/TopBas/TopBas_Interference.gxx b/src/ModelingAlgorithms/TKHLR/TopBas/TopBas_Interference.gxx deleted file mode 100644 index fac0f9d546..0000000000 --- a/src/ModelingAlgorithms/TKHLR/TopBas/TopBas_Interference.gxx +++ /dev/null @@ -1,34 +0,0 @@ -// Created on: 1992-08-13 -// Created by: Remi LEQUETTE -// Copyright (c) 1992-1999 Matra Datavision -// Copyright (c) 1999-2014 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. - -//================================================================================================= - -TopBas_Interference::TopBas_Interference() {} - -//================================================================================================= - -TopBas_Interference::TopBas_Interference(const TheSubShape& Inters, - const TheShape& Bound, - const TopAbs_Orientation Orient, - const TopAbs_Orientation Trans, - const TopAbs_Orientation BTrans) - : myIntersection(Inters), - myBoundary(Bound), - myOrientation(Orient), - myTransition(Trans), - myBTransition(BTrans) -{ -} diff --git a/src/ModelingAlgorithms/TKHLR/TopBas/TopBas_Interference.lxx b/src/ModelingAlgorithms/TKHLR/TopBas/TopBas_Interference.lxx deleted file mode 100644 index 1bd8be4e2c..0000000000 --- a/src/ModelingAlgorithms/TKHLR/TopBas/TopBas_Interference.lxx +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) 1995-1999 Matra Datavision -// Copyright (c) 1999-2014 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. - -//================================================================================================= - -inline void TopBas_Interference::Intersection(const TheSubShape& I) -{ - myIntersection = I; -} - -//================================================================================================= - -inline void TopBas_Interference::Boundary(const TheShape& B) -{ - myBoundary = B; -} - -//================================================================================================= - -inline void TopBas_Interference::Orientation(const TopAbs_Orientation Or) -{ - myOrientation = Or; -} - -//================================================================================================= - -inline void TopBas_Interference::Transition(const TopAbs_Orientation Or) -{ - myTransition = Or; -} - -//================================================================================================= - -inline void TopBas_Interference::BoundaryTransition(const TopAbs_Orientation Or) -{ - myBTransition = Or; -} - -//================================================================================================= - -inline const TheSubShape& TopBas_Interference::Intersection() const -{ - return myIntersection; -} - -//================================================================================================= - -inline TheSubShape& TopBas_Interference::ChangeIntersection() -{ - return myIntersection; -} - -//================================================================================================= - -inline const TheShape& TopBas_Interference::Boundary() const -{ - return myBoundary; -} - -//================================================================================================= - -inline TheShape& TopBas_Interference::ChangeBoundary() -{ - return myBoundary; -} - -//================================================================================================= - -inline TopAbs_Orientation TopBas_Interference::Orientation() const -{ - return myOrientation; -} - -//================================================================================================= - -inline TopAbs_Orientation TopBas_Interference::Transition() const -{ - return myTransition; -} - -//================================================================================================= - -inline TopAbs_Orientation TopBas_Interference::BoundaryTransition() const -{ - return myBTransition; -} diff --git a/src/ModelingAlgorithms/TKHLR/TopBas/TopBas_TestInterference.hxx b/src/ModelingAlgorithms/TKHLR/TopBas/TopBas_TestInterference.hxx index f4863a16d4..3b1c68ddbe 100644 --- a/src/ModelingAlgorithms/TKHLR/TopBas/TopBas_TestInterference.hxx +++ b/src/ModelingAlgorithms/TKHLR/TopBas/TopBas_TestInterference.hxx @@ -70,20 +70,90 @@ private: TopAbs_Orientation myBTransition; }; -#define TheSubShape Standard_Real -#define TheSubShape_hxx -#define TheShape Standard_Integer -#define TheShape_hxx -#define TopBas_Interference TopBas_TestInterference -#define TopBas_Interference_hxx - -#include - -#undef TheSubShape -#undef TheSubShape_hxx -#undef TheShape -#undef TheShape_hxx -#undef TopBas_Interference -#undef TopBas_Interference_hxx +//================================================================================================= +// Inline implementations +//================================================================================================= + +inline void TopBas_TestInterference::Intersection(const Standard_Real& I) +{ + myIntersection = I; +} + +//================================================================================================= + +inline void TopBas_TestInterference::Boundary(const Standard_Integer& B) +{ + myBoundary = B; +} + +//================================================================================================= + +inline void TopBas_TestInterference::Orientation(const TopAbs_Orientation Or) +{ + myOrientation = Or; +} + +//================================================================================================= + +inline void TopBas_TestInterference::Transition(const TopAbs_Orientation Or) +{ + myTransition = Or; +} + +//================================================================================================= + +inline void TopBas_TestInterference::BoundaryTransition(const TopAbs_Orientation Or) +{ + myBTransition = Or; +} + +//================================================================================================= + +inline const Standard_Real& TopBas_TestInterference::Intersection() const +{ + return myIntersection; +} + +//================================================================================================= + +inline Standard_Real& TopBas_TestInterference::ChangeIntersection() +{ + return myIntersection; +} + +//================================================================================================= + +inline const Standard_Integer& TopBas_TestInterference::Boundary() const +{ + return myBoundary; +} + +//================================================================================================= + +inline Standard_Integer& TopBas_TestInterference::ChangeBoundary() +{ + return myBoundary; +} + +//================================================================================================= + +inline TopAbs_Orientation TopBas_TestInterference::Orientation() const +{ + return myOrientation; +} + +//================================================================================================= + +inline TopAbs_Orientation TopBas_TestInterference::Transition() const +{ + return myTransition; +} + +//================================================================================================= + +inline TopAbs_Orientation TopBas_TestInterference::BoundaryTransition() const +{ + return myBTransition; +} #endif // _TopBas_TestInterference_HeaderFile diff --git a/src/ModelingAlgorithms/TKHLR/TopBas/TopBas_TestInterference_0.cxx b/src/ModelingAlgorithms/TKHLR/TopBas/TopBas_TestInterference_0.cxx index b6ab6668f7..3d92fdf1b8 100644 --- a/src/ModelingAlgorithms/TKHLR/TopBas/TopBas_TestInterference_0.cxx +++ b/src/ModelingAlgorithms/TKHLR/TopBas/TopBas_TestInterference_0.cxx @@ -16,10 +16,21 @@ #include -#define TheSubShape Standard_Real -#define TheSubShape_hxx -#define TheShape Standard_Integer -#define TheShape_hxx -#define TopBas_Interference TopBas_TestInterference -#define TopBas_Interference_hxx -#include +//================================================================================================= + +TopBas_TestInterference::TopBas_TestInterference() {} + +//================================================================================================= + +TopBas_TestInterference::TopBas_TestInterference(const Standard_Real& Inters, + const Standard_Integer& Bound, + const TopAbs_Orientation Orient, + const TopAbs_Orientation Trans, + const TopAbs_Orientation BTrans) + : myIntersection(Inters), + myBoundary(Bound), + myOrientation(Orient), + myTransition(Trans), + myBTransition(BTrans) +{ +} diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepApprox/BRepApprox_BSpGradient_BFGSOfMyBSplGradientOfTheComputeLineOfApprox_0.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepApprox/BRepApprox_BSpGradient_BFGSOfMyBSplGradientOfTheComputeLineOfApprox_0.cxx index 395f7a9751..6da238afe7 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepApprox/BRepApprox_BSpGradient_BFGSOfMyBSplGradientOfTheComputeLineOfApprox_0.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepApprox/BRepApprox_BSpGradient_BFGSOfMyBSplGradientOfTheComputeLineOfApprox_0.cxx @@ -23,22 +23,33 @@ #include #include -#define MultiLine BRepApprox_TheMultiLineOfApprox -#define MultiLine_hxx -#define ToolLine BRepApprox_TheMultiLineToolOfApprox -#define ToolLine_hxx -#define AppParCurves_BSpParLeastSquare \ - BRepApprox_BSpParLeastSquareOfMyBSplGradientOfTheComputeLineOfApprox -#define AppParCurves_BSpParLeastSquare_hxx \ - -#define AppParCurves_BSpParFunction \ - BRepApprox_BSpParFunctionOfMyBSplGradientOfTheComputeLineOfApprox -#define AppParCurves_BSpParFunction_hxx \ - -#define AppParCurves_BSpGradient_BFGS \ - BRepApprox_BSpGradient_BFGSOfMyBSplGradientOfTheComputeLineOfApprox -#define AppParCurves_BSpGradient_BFGS_hxx \ - -#define AppParCurves_BSpGradient BRepApprox_MyBSplGradientOfTheComputeLineOfApprox -#define AppParCurves_BSpGradient_hxx -#include +BRepApprox_BSpGradient_BFGSOfMyBSplGradientOfTheComputeLineOfApprox:: + BRepApprox_BSpGradient_BFGSOfMyBSplGradientOfTheComputeLineOfApprox( + math_MultipleVarFunctionWithGradient& F, + const math_Vector& StartingPoint, + const Standard_Real Tolerance3d, + const Standard_Real Tolerance2d, + const Standard_Real Eps, + const Standard_Integer NbIterations) + : math_BFGS(F.NbVariables(), Eps, NbIterations, Eps), + myTol3d(Tolerance3d), + myTol2d(Tolerance2d) +{ + Perform(F, StartingPoint); +} + +Standard_Boolean BRepApprox_BSpGradient_BFGSOfMyBSplGradientOfTheComputeLineOfApprox:: + IsSolutionReached(math_MultipleVarFunctionWithGradient& F) const +{ + Standard_Boolean Result, Result2; + BRepApprox_BSpParFunctionOfMyBSplGradientOfTheComputeLineOfApprox* F1 = + (BRepApprox_BSpParFunctionOfMyBSplGradientOfTheComputeLineOfApprox*)&F; + + Result = (2.0 * fabs(TheMinimum - PreviousMinimum) + <= 1.e-10 * (fabs(TheMinimum) + fabs(PreviousMinimum)) + 1.e-12); + Standard_Real MErr3d = F1->MaxError3d(); + Standard_Real MErr2d = F1->MaxError2d(); + Result2 = ((MErr3d <= myTol3d) && (MErr2d <= myTol2d)); + + return (Result || Result2); +} diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepApprox/BRepApprox_Gradient_BFGSOfMyGradientOfTheComputeLineBezierOfApprox_0.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepApprox/BRepApprox_Gradient_BFGSOfMyGradientOfTheComputeLineBezierOfApprox_0.cxx index 63ccdb91b7..59cbfed532 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepApprox/BRepApprox_Gradient_BFGSOfMyGradientOfTheComputeLineBezierOfApprox_0.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepApprox/BRepApprox_Gradient_BFGSOfMyGradientOfTheComputeLineBezierOfApprox_0.cxx @@ -24,25 +24,33 @@ #include #include -#define MultiLine BRepApprox_TheMultiLineOfApprox -#define MultiLine_hxx -#define ToolLine BRepApprox_TheMultiLineToolOfApprox -#define ToolLine_hxx -#define AppParCurves_ParLeastSquare \ - BRepApprox_ParLeastSquareOfMyGradientOfTheComputeLineBezierOfApprox -#define AppParCurves_ParLeastSquare_hxx \ - -#define AppParCurves_ResConstraint \ - BRepApprox_ResConstraintOfMyGradientOfTheComputeLineBezierOfApprox -#define AppParCurves_ResConstraint_hxx \ - -#define AppParCurves_ParFunction BRepApprox_ParFunctionOfMyGradientOfTheComputeLineBezierOfApprox -#define AppParCurves_ParFunction_hxx \ - -#define AppParCurves_Gradient_BFGS \ - BRepApprox_Gradient_BFGSOfMyGradientOfTheComputeLineBezierOfApprox -#define AppParCurves_Gradient_BFGS_hxx \ - -#define AppParCurves_Gradient BRepApprox_MyGradientOfTheComputeLineBezierOfApprox -#define AppParCurves_Gradient_hxx -#include +BRepApprox_Gradient_BFGSOfMyGradientOfTheComputeLineBezierOfApprox:: + BRepApprox_Gradient_BFGSOfMyGradientOfTheComputeLineBezierOfApprox( + math_MultipleVarFunctionWithGradient& F, + const math_Vector& StartingPoint, + const Standard_Real Tolerance3d, + const Standard_Real Tolerance2d, + const Standard_Real Eps, + const Standard_Integer NbIterations) + : math_BFGS(F.NbVariables(), Eps, NbIterations, Eps), + myTol3d(Tolerance3d), + myTol2d(Tolerance2d) +{ + Perform(F, StartingPoint); +} + +Standard_Boolean BRepApprox_Gradient_BFGSOfMyGradientOfTheComputeLineBezierOfApprox:: + IsSolutionReached(math_MultipleVarFunctionWithGradient& F) const +{ + BRepApprox_ParFunctionOfMyGradientOfTheComputeLineBezierOfApprox* F1 = + (BRepApprox_ParFunctionOfMyGradientOfTheComputeLineBezierOfApprox*)&F; + Standard_Boolean Result, Result2; + + Result = (2.0 * fabs(TheMinimum - PreviousMinimum) + <= 1.e-10 * (fabs(TheMinimum) + fabs(PreviousMinimum)) + 1.e-12); + Standard_Real MErr3d = F1->MaxError3d(); + Standard_Real MErr2d = F1->MaxError2d(); + + Result2 = ((MErr3d <= myTol3d) && (MErr2d <= myTol2d)); + return (Result || Result2); +} diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepApprox/BRepApprox_Gradient_BFGSOfMyGradientbisOfTheComputeLineOfApprox_0.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepApprox/BRepApprox_Gradient_BFGSOfMyGradientbisOfTheComputeLineOfApprox_0.cxx index 04d89d48c0..ef3be530ec 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepApprox/BRepApprox_Gradient_BFGSOfMyGradientbisOfTheComputeLineOfApprox_0.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepApprox/BRepApprox_Gradient_BFGSOfMyGradientbisOfTheComputeLineOfApprox_0.cxx @@ -24,22 +24,33 @@ #include #include -#define MultiLine BRepApprox_TheMultiLineOfApprox -#define MultiLine_hxx -#define ToolLine BRepApprox_TheMultiLineToolOfApprox -#define ToolLine_hxx -#define AppParCurves_ParLeastSquare BRepApprox_ParLeastSquareOfMyGradientbisOfTheComputeLineOfApprox -#define AppParCurves_ParLeastSquare_hxx \ - -#define AppParCurves_ResConstraint BRepApprox_ResConstraintOfMyGradientbisOfTheComputeLineOfApprox -#define AppParCurves_ResConstraint_hxx \ - -#define AppParCurves_ParFunction BRepApprox_ParFunctionOfMyGradientbisOfTheComputeLineOfApprox -#define AppParCurves_ParFunction_hxx \ - -#define AppParCurves_Gradient_BFGS BRepApprox_Gradient_BFGSOfMyGradientbisOfTheComputeLineOfApprox -#define AppParCurves_Gradient_BFGS_hxx \ - -#define AppParCurves_Gradient BRepApprox_MyGradientbisOfTheComputeLineOfApprox -#define AppParCurves_Gradient_hxx -#include +BRepApprox_Gradient_BFGSOfMyGradientbisOfTheComputeLineOfApprox:: + BRepApprox_Gradient_BFGSOfMyGradientbisOfTheComputeLineOfApprox( + math_MultipleVarFunctionWithGradient& F, + const math_Vector& StartingPoint, + const Standard_Real Tolerance3d, + const Standard_Real Tolerance2d, + const Standard_Real Eps, + const Standard_Integer NbIterations) + : math_BFGS(F.NbVariables(), Eps, NbIterations, Eps), + myTol3d(Tolerance3d), + myTol2d(Tolerance2d) +{ + Perform(F, StartingPoint); +} + +Standard_Boolean BRepApprox_Gradient_BFGSOfMyGradientbisOfTheComputeLineOfApprox::IsSolutionReached( + math_MultipleVarFunctionWithGradient& F) const +{ + BRepApprox_ParFunctionOfMyGradientbisOfTheComputeLineOfApprox* F1 = + (BRepApprox_ParFunctionOfMyGradientbisOfTheComputeLineOfApprox*)&F; + Standard_Boolean Result, Result2; + + Result = (2.0 * fabs(TheMinimum - PreviousMinimum) + <= 1.e-10 * (fabs(TheMinimum) + fabs(PreviousMinimum)) + 1.e-12); + Standard_Real MErr3d = F1->MaxError3d(); + Standard_Real MErr2d = F1->MaxError2d(); + + Result2 = ((MErr3d <= myTol3d) && (MErr2d <= myTol2d)); + return (Result || Result2); +} diff --git a/src/ModelingAlgorithms/TKTopAlgo/MAT/FILES.cmake b/src/ModelingAlgorithms/TKTopAlgo/MAT/FILES.cmake index b75747eb9b..d0bf0943ad 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/MAT/FILES.cmake +++ b/src/ModelingAlgorithms/TKTopAlgo/MAT/FILES.cmake @@ -31,8 +31,6 @@ set(OCCT_MAT_FILES MAT_Side.hxx MAT_TList.gxx MAT_TList.lxx - MAT_TListNode.gxx - MAT_TListNode.lxx MAT_TListNodeOfListOfBisector.hxx MAT_TListNodeOfListOfBisector_0.cxx MAT_TListNodeOfListOfEdge.hxx diff --git a/src/ModelingAlgorithms/TKTopAlgo/MAT/MAT_TListNode.gxx b/src/ModelingAlgorithms/TKTopAlgo/MAT/MAT_TListNode.gxx deleted file mode 100644 index f46c4655b4..0000000000 --- a/src/ModelingAlgorithms/TKTopAlgo/MAT/MAT_TListNode.gxx +++ /dev/null @@ -1,19 +0,0 @@ -// Created on: 1992-06-24 -// Created by: Gilles DEBARBOUILLE -// Copyright (c) 1992-1999 Matra Datavision -// Copyright (c) 1999-2014 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. - -//================================================================================================= - -void MAT_TListNode::Dummy() const {} diff --git a/src/ModelingAlgorithms/TKTopAlgo/MAT/MAT_TListNode.lxx b/src/ModelingAlgorithms/TKTopAlgo/MAT/MAT_TListNode.lxx deleted file mode 100644 index 13d6d406c8..0000000000 --- a/src/ModelingAlgorithms/TKTopAlgo/MAT/MAT_TListNode.lxx +++ /dev/null @@ -1,68 +0,0 @@ -// Created on: 1992-06-24 -// Created by: Gilles DEBARBOUILLE -// Copyright (c) 1992-1999 Matra Datavision -// Copyright (c) 1999-2014 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. - -//================================================================================================= - -inline MAT_TListNode::MAT_TListNode() {} - -//================================================================================================= - -inline MAT_TListNode::MAT_TListNode(const Item& anitem) -{ - theitem = anitem; -} - -//================================================================================================= - -inline Item MAT_TListNode::GetItem() const -{ - return theitem; -} - -//================================================================================================= - -inline Handle(MAT_TListNode) MAT_TListNode::Next() const -{ - return thenext; -} - -//================================================================================================= - -inline Handle(MAT_TListNode) MAT_TListNode::Previous() const -{ - return theprevious; -} - -//================================================================================================= - -inline void MAT_TListNode::SetItem(const Item& anitem) -{ - theitem = anitem; -} - -//================================================================================================= - -inline void MAT_TListNode::Next(const Handle(MAT_TListNode)& atlistnode) -{ - thenext = atlistnode; -} - -//================================================================================================= - -inline void MAT_TListNode::Previous(const Handle(MAT_TListNode)& atlistnode) -{ - theprevious = atlistnode; -} diff --git a/src/ModelingAlgorithms/TKTopAlgo/MAT/MAT_TListNodeOfListOfBisector.hxx b/src/ModelingAlgorithms/TKTopAlgo/MAT/MAT_TListNodeOfListOfBisector.hxx index 85114d6655..2f7a477999 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/MAT/MAT_TListNodeOfListOfBisector.hxx +++ b/src/ModelingAlgorithms/TKTopAlgo/MAT/MAT_TListNodeOfListOfBisector.hxx @@ -58,24 +58,62 @@ private: Handle(MAT_Bisector) theitem; }; -#define Item Handle(MAT_Bisector) -#define Item_hxx -#define MAT_TListNode MAT_TListNodeOfListOfBisector -#define MAT_TListNode_hxx -#define Handle_MAT_TListNode Handle(MAT_TListNodeOfListOfBisector) -#define MAT_TList MAT_ListOfBisector -#define MAT_TList_hxx -#define Handle_MAT_TList Handle(MAT_ListOfBisector) - -#include - -#undef Item -#undef Item_hxx -#undef MAT_TListNode -#undef MAT_TListNode_hxx -#undef Handle_MAT_TListNode -#undef MAT_TList -#undef MAT_TList_hxx -#undef Handle_MAT_TList +//================================================================================================= +// Inline implementations +//================================================================================================= + +inline MAT_TListNodeOfListOfBisector::MAT_TListNodeOfListOfBisector() {} + +//================================================================================================= + +inline MAT_TListNodeOfListOfBisector::MAT_TListNodeOfListOfBisector( + const Handle(MAT_Bisector)& anitem) +{ + theitem = anitem; +} + +//================================================================================================= + +inline Handle(MAT_Bisector) MAT_TListNodeOfListOfBisector::GetItem() const +{ + return theitem; +} + +//================================================================================================= + +inline Handle(MAT_TListNodeOfListOfBisector) MAT_TListNodeOfListOfBisector::Next() const +{ + return thenext; +} + +//================================================================================================= + +inline Handle(MAT_TListNodeOfListOfBisector) MAT_TListNodeOfListOfBisector::Previous() const +{ + return theprevious; +} + +//================================================================================================= + +inline void MAT_TListNodeOfListOfBisector::SetItem(const Handle(MAT_Bisector)& anitem) +{ + theitem = anitem; +} + +//================================================================================================= + +inline void MAT_TListNodeOfListOfBisector::Next( + const Handle(MAT_TListNodeOfListOfBisector)& atlistnode) +{ + thenext = atlistnode; +} + +//================================================================================================= + +inline void MAT_TListNodeOfListOfBisector::Previous( + const Handle(MAT_TListNodeOfListOfBisector)& atlistnode) +{ + theprevious = atlistnode; +} #endif // _MAT_TListNodeOfListOfBisector_HeaderFile diff --git a/src/ModelingAlgorithms/TKTopAlgo/MAT/MAT_TListNodeOfListOfBisector_0.cxx b/src/ModelingAlgorithms/TKTopAlgo/MAT/MAT_TListNodeOfListOfBisector_0.cxx index 99378d4fc7..e651c2ee14 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/MAT/MAT_TListNodeOfListOfBisector_0.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/MAT/MAT_TListNodeOfListOfBisector_0.cxx @@ -21,12 +21,6 @@ #include #include -#define Item Handle(MAT_Bisector) -#define Item_hxx -#define MAT_TListNode MAT_TListNodeOfListOfBisector -#define MAT_TListNode_hxx -#define Handle_MAT_TListNode Handle(MAT_TListNodeOfListOfBisector) -#define MAT_TList MAT_ListOfBisector -#define MAT_TList_hxx -#define Handle_MAT_TList Handle(MAT_ListOfBisector) -#include +//================================================================================================= + +void MAT_TListNodeOfListOfBisector::Dummy() const {} diff --git a/src/ModelingAlgorithms/TKTopAlgo/MAT/MAT_TListNodeOfListOfEdge.hxx b/src/ModelingAlgorithms/TKTopAlgo/MAT/MAT_TListNodeOfListOfEdge.hxx index 3b970e340a..d7aaf5d259 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/MAT/MAT_TListNodeOfListOfEdge.hxx +++ b/src/ModelingAlgorithms/TKTopAlgo/MAT/MAT_TListNodeOfListOfEdge.hxx @@ -58,24 +58,59 @@ private: Handle(MAT_Edge) theitem; }; -#define Item Handle(MAT_Edge) -#define Item_hxx -#define MAT_TListNode MAT_TListNodeOfListOfEdge -#define MAT_TListNode_hxx -#define Handle_MAT_TListNode Handle(MAT_TListNodeOfListOfEdge) -#define MAT_TList MAT_ListOfEdge -#define MAT_TList_hxx -#define Handle_MAT_TList Handle(MAT_ListOfEdge) - -#include - -#undef Item -#undef Item_hxx -#undef MAT_TListNode -#undef MAT_TListNode_hxx -#undef Handle_MAT_TListNode -#undef MAT_TList -#undef MAT_TList_hxx -#undef Handle_MAT_TList +//================================================================================================= +// Inline implementations +//================================================================================================= + +inline MAT_TListNodeOfListOfEdge::MAT_TListNodeOfListOfEdge() {} + +//================================================================================================= + +inline MAT_TListNodeOfListOfEdge::MAT_TListNodeOfListOfEdge(const Handle(MAT_Edge)& anitem) +{ + theitem = anitem; +} + +//================================================================================================= + +inline Handle(MAT_Edge) MAT_TListNodeOfListOfEdge::GetItem() const +{ + return theitem; +} + +//================================================================================================= + +inline Handle(MAT_TListNodeOfListOfEdge) MAT_TListNodeOfListOfEdge::Next() const +{ + return thenext; +} + +//================================================================================================= + +inline Handle(MAT_TListNodeOfListOfEdge) MAT_TListNodeOfListOfEdge::Previous() const +{ + return theprevious; +} + +//================================================================================================= + +inline void MAT_TListNodeOfListOfEdge::SetItem(const Handle(MAT_Edge)& anitem) +{ + theitem = anitem; +} + +//================================================================================================= + +inline void MAT_TListNodeOfListOfEdge::Next(const Handle(MAT_TListNodeOfListOfEdge)& atlistnode) +{ + thenext = atlistnode; +} + +//================================================================================================= + +inline void MAT_TListNodeOfListOfEdge::Previous(const Handle(MAT_TListNodeOfListOfEdge)& atlistnode) +{ + theprevious = atlistnode; +} #endif // _MAT_TListNodeOfListOfEdge_HeaderFile diff --git a/src/ModelingAlgorithms/TKTopAlgo/MAT/MAT_TListNodeOfListOfEdge_0.cxx b/src/ModelingAlgorithms/TKTopAlgo/MAT/MAT_TListNodeOfListOfEdge_0.cxx index 4bd966b3d2..b8b36feaaa 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/MAT/MAT_TListNodeOfListOfEdge_0.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/MAT/MAT_TListNodeOfListOfEdge_0.cxx @@ -21,12 +21,6 @@ #include #include -#define Item Handle(MAT_Edge) -#define Item_hxx -#define MAT_TListNode MAT_TListNodeOfListOfEdge -#define MAT_TListNode_hxx -#define Handle_MAT_TListNode Handle(MAT_TListNodeOfListOfEdge) -#define MAT_TList MAT_ListOfEdge -#define MAT_TList_hxx -#define Handle_MAT_TList Handle(MAT_ListOfEdge) -#include +//================================================================================================= + +void MAT_TListNodeOfListOfEdge::Dummy() const {} diff --git a/src/ModelingData/TKGeomBase/AppDef/AppDef_BSpGradient_BFGSOfMyBSplGradientOfBSplineCompute_0.cxx b/src/ModelingData/TKGeomBase/AppDef/AppDef_BSpGradient_BFGSOfMyBSplGradientOfBSplineCompute_0.cxx index 4fa1d90e35..cb3f043deb 100644 --- a/src/ModelingData/TKGeomBase/AppDef/AppDef_BSpGradient_BFGSOfMyBSplGradientOfBSplineCompute_0.cxx +++ b/src/ModelingData/TKGeomBase/AppDef/AppDef_BSpGradient_BFGSOfMyBSplGradientOfBSplineCompute_0.cxx @@ -23,18 +23,32 @@ #include #include -#define MultiLine AppDef_MultiLine -#define MultiLine_hxx -#define ToolLine AppDef_MyLineTool -#define ToolLine_hxx -#define AppParCurves_BSpParLeastSquare AppDef_BSpParLeastSquareOfMyBSplGradientOfBSplineCompute -#define AppParCurves_BSpParLeastSquare_hxx \ - -#define AppParCurves_BSpParFunction AppDef_BSpParFunctionOfMyBSplGradientOfBSplineCompute -#define AppParCurves_BSpParFunction_hxx -#define AppParCurves_BSpGradient_BFGS AppDef_BSpGradient_BFGSOfMyBSplGradientOfBSplineCompute -#define AppParCurves_BSpGradient_BFGS_hxx \ - -#define AppParCurves_BSpGradient AppDef_MyBSplGradientOfBSplineCompute -#define AppParCurves_BSpGradient_hxx -#include "../AppParCurves/AppParCurves_BSpGradient_BFGS.gxx" +AppDef_BSpGradient_BFGSOfMyBSplGradientOfBSplineCompute:: + AppDef_BSpGradient_BFGSOfMyBSplGradientOfBSplineCompute(math_MultipleVarFunctionWithGradient& F, + const math_Vector& StartingPoint, + const Standard_Real Tolerance3d, + const Standard_Real Tolerance2d, + const Standard_Real Eps, + const Standard_Integer NbIterations) + : math_BFGS(F.NbVariables(), Eps, NbIterations, Eps), + myTol3d(Tolerance3d), + myTol2d(Tolerance2d) +{ + Perform(F, StartingPoint); +} + +Standard_Boolean AppDef_BSpGradient_BFGSOfMyBSplGradientOfBSplineCompute::IsSolutionReached( + math_MultipleVarFunctionWithGradient& F) const +{ + Standard_Boolean Result, Result2; + AppDef_BSpParFunctionOfMyBSplGradientOfBSplineCompute* F1 = + (AppDef_BSpParFunctionOfMyBSplGradientOfBSplineCompute*)&F; + + Result = (2.0 * fabs(TheMinimum - PreviousMinimum) + <= 1.e-10 * (fabs(TheMinimum) + fabs(PreviousMinimum)) + 1.e-12); + Standard_Real MErr3d = F1->MaxError3d(); + Standard_Real MErr2d = F1->MaxError2d(); + Result2 = ((MErr3d <= myTol3d) && (MErr2d <= myTol2d)); + + return (Result || Result2); +} diff --git a/src/ModelingData/TKGeomBase/AppDef/AppDef_Gradient_BFGSOfMyGradientOfCompute_0.cxx b/src/ModelingData/TKGeomBase/AppDef/AppDef_Gradient_BFGSOfMyGradientOfCompute_0.cxx index 4e8d238ae3..b8eb12fbe1 100644 --- a/src/ModelingData/TKGeomBase/AppDef/AppDef_Gradient_BFGSOfMyGradientOfCompute_0.cxx +++ b/src/ModelingData/TKGeomBase/AppDef/AppDef_Gradient_BFGSOfMyGradientOfCompute_0.cxx @@ -24,18 +24,31 @@ #include #include -#define MultiLine AppDef_MultiLine -#define MultiLine_hxx -#define ToolLine AppDef_MyLineTool -#define ToolLine_hxx -#define AppParCurves_ParLeastSquare AppDef_ParLeastSquareOfMyGradientOfCompute -#define AppParCurves_ParLeastSquare_hxx -#define AppParCurves_ResConstraint AppDef_ResConstraintOfMyGradientOfCompute -#define AppParCurves_ResConstraint_hxx -#define AppParCurves_ParFunction AppDef_ParFunctionOfMyGradientOfCompute -#define AppParCurves_ParFunction_hxx -#define AppParCurves_Gradient_BFGS AppDef_Gradient_BFGSOfMyGradientOfCompute -#define AppParCurves_Gradient_BFGS_hxx -#define AppParCurves_Gradient AppDef_MyGradientOfCompute -#define AppParCurves_Gradient_hxx -#include +AppDef_Gradient_BFGSOfMyGradientOfCompute::AppDef_Gradient_BFGSOfMyGradientOfCompute( + math_MultipleVarFunctionWithGradient& F, + const math_Vector& StartingPoint, + const Standard_Real Tolerance3d, + const Standard_Real Tolerance2d, + const Standard_Real Eps, + const Standard_Integer NbIterations) + : math_BFGS(F.NbVariables(), Eps, NbIterations, Eps), + myTol3d(Tolerance3d), + myTol2d(Tolerance2d) +{ + Perform(F, StartingPoint); +} + +Standard_Boolean AppDef_Gradient_BFGSOfMyGradientOfCompute::IsSolutionReached( + math_MultipleVarFunctionWithGradient& F) const +{ + AppDef_ParFunctionOfMyGradientOfCompute* F1 = (AppDef_ParFunctionOfMyGradientOfCompute*)&F; + Standard_Boolean Result, Result2; + + Result = (2.0 * fabs(TheMinimum - PreviousMinimum) + <= 1.e-10 * (fabs(TheMinimum) + fabs(PreviousMinimum)) + 1.e-12); + Standard_Real MErr3d = F1->MaxError3d(); + Standard_Real MErr2d = F1->MaxError2d(); + + Result2 = ((MErr3d <= myTol3d) && (MErr2d <= myTol2d)); + return (Result || Result2); +} diff --git a/src/ModelingData/TKGeomBase/AppDef/AppDef_Gradient_BFGSOfMyGradientbisOfBSplineCompute_0.cxx b/src/ModelingData/TKGeomBase/AppDef/AppDef_Gradient_BFGSOfMyGradientbisOfBSplineCompute_0.cxx index 78f6a0ad41..ad2192af46 100644 --- a/src/ModelingData/TKGeomBase/AppDef/AppDef_Gradient_BFGSOfMyGradientbisOfBSplineCompute_0.cxx +++ b/src/ModelingData/TKGeomBase/AppDef/AppDef_Gradient_BFGSOfMyGradientbisOfBSplineCompute_0.cxx @@ -24,18 +24,32 @@ #include #include -#define MultiLine AppDef_MultiLine -#define MultiLine_hxx -#define ToolLine AppDef_MyLineTool -#define ToolLine_hxx -#define AppParCurves_ParLeastSquare AppDef_ParLeastSquareOfMyGradientbisOfBSplineCompute -#define AppParCurves_ParLeastSquare_hxx -#define AppParCurves_ResConstraint AppDef_ResConstraintOfMyGradientbisOfBSplineCompute -#define AppParCurves_ResConstraint_hxx -#define AppParCurves_ParFunction AppDef_ParFunctionOfMyGradientbisOfBSplineCompute -#define AppParCurves_ParFunction_hxx -#define AppParCurves_Gradient_BFGS AppDef_Gradient_BFGSOfMyGradientbisOfBSplineCompute -#define AppParCurves_Gradient_BFGS_hxx -#define AppParCurves_Gradient AppDef_MyGradientbisOfBSplineCompute -#define AppParCurves_Gradient_hxx -#include +AppDef_Gradient_BFGSOfMyGradientbisOfBSplineCompute:: + AppDef_Gradient_BFGSOfMyGradientbisOfBSplineCompute(math_MultipleVarFunctionWithGradient& F, + const math_Vector& StartingPoint, + const Standard_Real Tolerance3d, + const Standard_Real Tolerance2d, + const Standard_Real Eps, + const Standard_Integer NbIterations) + : math_BFGS(F.NbVariables(), Eps, NbIterations, Eps), + myTol3d(Tolerance3d), + myTol2d(Tolerance2d) +{ + Perform(F, StartingPoint); +} + +Standard_Boolean AppDef_Gradient_BFGSOfMyGradientbisOfBSplineCompute::IsSolutionReached( + math_MultipleVarFunctionWithGradient& F) const +{ + AppDef_ParFunctionOfMyGradientbisOfBSplineCompute* F1 = + (AppDef_ParFunctionOfMyGradientbisOfBSplineCompute*)&F; + Standard_Boolean Result, Result2; + + Result = (2.0 * fabs(TheMinimum - PreviousMinimum) + <= 1.e-10 * (fabs(TheMinimum) + fabs(PreviousMinimum)) + 1.e-12); + Standard_Real MErr3d = F1->MaxError3d(); + Standard_Real MErr2d = F1->MaxError2d(); + + Result2 = ((MErr3d <= myTol3d) && (MErr2d <= myTol2d)); + return (Result || Result2); +} diff --git a/src/ModelingData/TKGeomBase/AppDef/AppDef_Gradient_BFGSOfTheGradient_0.cxx b/src/ModelingData/TKGeomBase/AppDef/AppDef_Gradient_BFGSOfTheGradient_0.cxx index b28e694396..84fc77e02a 100644 --- a/src/ModelingData/TKGeomBase/AppDef/AppDef_Gradient_BFGSOfTheGradient_0.cxx +++ b/src/ModelingData/TKGeomBase/AppDef/AppDef_Gradient_BFGSOfTheGradient_0.cxx @@ -24,18 +24,31 @@ #include #include -#define MultiLine AppDef_MultiLine -#define MultiLine_hxx -#define ToolLine AppDef_MyLineTool -#define ToolLine_hxx -#define AppParCurves_ParLeastSquare AppDef_ParLeastSquareOfTheGradient -#define AppParCurves_ParLeastSquare_hxx -#define AppParCurves_ResConstraint AppDef_ResConstraintOfTheGradient -#define AppParCurves_ResConstraint_hxx -#define AppParCurves_ParFunction AppDef_ParFunctionOfTheGradient -#define AppParCurves_ParFunction_hxx -#define AppParCurves_Gradient_BFGS AppDef_Gradient_BFGSOfTheGradient -#define AppParCurves_Gradient_BFGS_hxx -#define AppParCurves_Gradient AppDef_TheGradient -#define AppParCurves_Gradient_hxx -#include +AppDef_Gradient_BFGSOfTheGradient::AppDef_Gradient_BFGSOfTheGradient( + math_MultipleVarFunctionWithGradient& F, + const math_Vector& StartingPoint, + const Standard_Real Tolerance3d, + const Standard_Real Tolerance2d, + const Standard_Real Eps, + const Standard_Integer NbIterations) + : math_BFGS(F.NbVariables(), Eps, NbIterations, Eps), + myTol3d(Tolerance3d), + myTol2d(Tolerance2d) +{ + Perform(F, StartingPoint); +} + +Standard_Boolean AppDef_Gradient_BFGSOfTheGradient::IsSolutionReached( + math_MultipleVarFunctionWithGradient& F) const +{ + AppDef_ParFunctionOfTheGradient* F1 = (AppDef_ParFunctionOfTheGradient*)&F; + Standard_Boolean Result, Result2; + + Result = (2.0 * fabs(TheMinimum - PreviousMinimum) + <= 1.e-10 * (fabs(TheMinimum) + fabs(PreviousMinimum)) + 1.e-12); + Standard_Real MErr3d = F1->MaxError3d(); + Standard_Real MErr2d = F1->MaxError2d(); + + Result2 = ((MErr3d <= myTol3d) && (MErr2d <= myTol2d)); + return (Result || Result2); +} diff --git a/src/ModelingData/TKGeomBase/AppParCurves/AppParCurves_BSpGradient_BFGS.gxx b/src/ModelingData/TKGeomBase/AppParCurves/AppParCurves_BSpGradient_BFGS.gxx deleted file mode 100644 index 8eb25c93f9..0000000000 --- a/src/ModelingData/TKGeomBase/AppParCurves/AppParCurves_BSpGradient_BFGS.gxx +++ /dev/null @@ -1,48 +0,0 @@ -// Created on: 1999-12-16 -// Created by: Atelier CAS2000 -// Copyright (c) 1999-1999 Matra Datavision -// Copyright (c) 1999-2014 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. - -// Redefinition de math_BFGS: -// ========================== - -AppParCurves_BSpGradient_BFGS::AppParCurves_BSpGradient_BFGS( - math_MultipleVarFunctionWithGradient& F, - const math_Vector& StartingPoint, - const Standard_Real Tolerance3d, - const Standard_Real Tolerance2d, - const Standard_Real Eps, - const Standard_Integer NbIterations) - : math_BFGS(F.NbVariables(), Eps, NbIterations, Eps), - myTol3d(Tolerance3d), - myTol2d(Tolerance2d) -{ - - Perform(F, StartingPoint); -} - -Standard_Boolean AppParCurves_BSpGradient_BFGS::IsSolutionReached( - math_MultipleVarFunctionWithGradient& F) const -{ - Standard_Boolean Result, Result2; - AppParCurves_BSpParFunction* F1 = (AppParCurves_BSpParFunction*)&F; - - Result = (2.0 * fabs(TheMinimum - PreviousMinimum) - <= 1.e-10 * (fabs(TheMinimum) + fabs(PreviousMinimum)) + 1.e-12); - Standard_Real MErr3d = F1->MaxError3d(); - Standard_Real MErr2d = F1->MaxError2d(); - Result2 = ((MErr3d <= myTol3d) && (MErr2d <= myTol2d)); - - return (Result || Result2); -} diff --git a/src/ModelingData/TKGeomBase/AppParCurves/AppParCurves_Gradient_BFGS.gxx b/src/ModelingData/TKGeomBase/AppParCurves/AppParCurves_Gradient_BFGS.gxx deleted file mode 100644 index a0a9bb643d..0000000000 --- a/src/ModelingData/TKGeomBase/AppParCurves/AppParCurves_Gradient_BFGS.gxx +++ /dev/null @@ -1,46 +0,0 @@ -// Created on: 1999-12-16 -// Created by: Atelier CAS2000 -// Copyright (c) 1999 Matra Datavision -// Copyright (c) 1999-2014 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. - -// Redefinition de math_BFGS: -// ========================== - -AppParCurves_Gradient_BFGS::AppParCurves_Gradient_BFGS(math_MultipleVarFunctionWithGradient& F, - const math_Vector& StartingPoint, - const Standard_Real Tolerance3d, - const Standard_Real Tolerance2d, - const Standard_Real Eps, - const Standard_Integer NbIterations) - : math_BFGS(F.NbVariables(), Eps, NbIterations, Eps), - myTol3d(Tolerance3d), - myTol2d(Tolerance2d) -{ - Perform(F, StartingPoint); -} - -Standard_Boolean AppParCurves_Gradient_BFGS::IsSolutionReached( - math_MultipleVarFunctionWithGradient& F) const -{ - AppParCurves_ParFunction* F1 = (AppParCurves_ParFunction*)&F; - Standard_Boolean Result, Result2; - - Result = (2.0 * fabs(TheMinimum - PreviousMinimum) - <= 1.e-10 * (fabs(TheMinimum) + fabs(PreviousMinimum)) + 1.e-12); - Standard_Real MErr3d = F1->MaxError3d(); - Standard_Real MErr2d = F1->MaxError2d(); - - Result2 = ((MErr3d <= myTol3d) && (MErr2d <= myTol2d)); - return (Result || Result2); -} diff --git a/src/ModelingData/TKGeomBase/AppParCurves/FILES.cmake b/src/ModelingData/TKGeomBase/AppParCurves/FILES.cmake index 6f29275de6..1fa5a483e9 100644 --- a/src/ModelingData/TKGeomBase/AppParCurves/FILES.cmake +++ b/src/ModelingData/TKGeomBase/AppParCurves/FILES.cmake @@ -10,13 +10,11 @@ set(OCCT_AppParCurves_FILES AppParCurves_Array1OfMultiPoint.hxx AppParCurves_BSpFunction.gxx AppParCurves_BSpGradient.gxx - AppParCurves_BSpGradient_BFGS.gxx AppParCurves_Constraint.hxx AppParCurves_ConstraintCouple.cxx AppParCurves_ConstraintCouple.hxx AppParCurves_Function.gxx AppParCurves_Gradient.gxx - AppParCurves_Gradient_BFGS.gxx AppParCurves_HArray1OfConstraintCouple.hxx AppParCurves_HArray1OfMultiBSpCurve.hxx AppParCurves_HArray1OfMultiCurve.hxx diff --git a/src/ModelingData/TKGeomBase/Extrema/Extrema_POnCurv.hxx b/src/ModelingData/TKGeomBase/Extrema/Extrema_POnCurv.hxx index f10330348d..f4ccc3700e 100644 --- a/src/ModelingData/TKGeomBase/Extrema/Extrema_POnCurv.hxx +++ b/src/ModelingData/TKGeomBase/Extrema/Extrema_POnCurv.hxx @@ -51,16 +51,18 @@ private: gp_Pnt myP; }; -#define Pnt gp_Pnt -#define Pnt_hxx -#define Extrema_Point Extrema_POnCurv -#define Extrema_Point_hxx +//================================================================================================= +// Inline implementations +//================================================================================================= -#include +inline Standard_Real Extrema_POnCurv::Parameter() const +{ + return myU; +} -#undef Pnt -#undef Pnt_hxx -#undef Extrema_Point -#undef Extrema_Point_hxx +inline const gp_Pnt& Extrema_POnCurv::Value() const +{ + return myP; +} #endif // _Extrema_POnCurv_HeaderFile diff --git a/src/ModelingData/TKGeomBase/Extrema/Extrema_POnCurv2d.hxx b/src/ModelingData/TKGeomBase/Extrema/Extrema_POnCurv2d.hxx index a2955efc76..4917325e0e 100644 --- a/src/ModelingData/TKGeomBase/Extrema/Extrema_POnCurv2d.hxx +++ b/src/ModelingData/TKGeomBase/Extrema/Extrema_POnCurv2d.hxx @@ -50,16 +50,18 @@ private: gp_Pnt2d myP; }; -#define Pnt gp_Pnt2d -#define Pnt_hxx -#define Extrema_Point Extrema_POnCurv2d -#define Extrema_Point_hxx +//================================================================================================= +// Inline implementations +//================================================================================================= -#include +inline Standard_Real Extrema_POnCurv2d::Parameter() const +{ + return myU; +} -#undef Pnt -#undef Pnt_hxx -#undef Extrema_Point -#undef Extrema_Point_hxx +inline const gp_Pnt2d& Extrema_POnCurv2d::Value() const +{ + return myP; +} #endif // _Extrema_POnCurv2d_HeaderFile diff --git a/src/ModelingData/TKGeomBase/Extrema/Extrema_POnCurv2d_0.cxx b/src/ModelingData/TKGeomBase/Extrema/Extrema_POnCurv2d_0.cxx index 34451fdba8..30edd8056d 100644 --- a/src/ModelingData/TKGeomBase/Extrema/Extrema_POnCurv2d_0.cxx +++ b/src/ModelingData/TKGeomBase/Extrema/Extrema_POnCurv2d_0.cxx @@ -18,8 +18,19 @@ #include -#define Pnt gp_Pnt2d -#define Pnt_hxx -#define Extrema_Point Extrema_POnCurv2d -#define Extrema_Point_hxx -#include +Extrema_POnCurv2d::Extrema_POnCurv2d() + : myU(0.0) +{ +} + +Extrema_POnCurv2d::Extrema_POnCurv2d(const Standard_Real U, const gp_Pnt2d& P) +{ + myU = U; + myP = P; +} + +void Extrema_POnCurv2d::SetValues(const Standard_Real U, const gp_Pnt2d& P) +{ + myU = U; + myP = P; +} diff --git a/src/ModelingData/TKGeomBase/Extrema/Extrema_POnCurv_0.cxx b/src/ModelingData/TKGeomBase/Extrema/Extrema_POnCurv_0.cxx index bf54ce3410..9394926ae2 100644 --- a/src/ModelingData/TKGeomBase/Extrema/Extrema_POnCurv_0.cxx +++ b/src/ModelingData/TKGeomBase/Extrema/Extrema_POnCurv_0.cxx @@ -18,8 +18,19 @@ #include -#define Pnt gp_Pnt -#define Pnt_hxx -#define Extrema_Point Extrema_POnCurv -#define Extrema_Point_hxx -#include +Extrema_POnCurv::Extrema_POnCurv() + : myU(0.0) +{ +} + +Extrema_POnCurv::Extrema_POnCurv(const Standard_Real U, const gp_Pnt& P) +{ + myU = U; + myP = P; +} + +void Extrema_POnCurv::SetValues(const Standard_Real U, const gp_Pnt& P) +{ + myU = U; + myP = P; +} diff --git a/src/ModelingData/TKGeomBase/Extrema/Extrema_Point.gxx b/src/ModelingData/TKGeomBase/Extrema/Extrema_Point.gxx deleted file mode 100644 index fd53fb3925..0000000000 --- a/src/ModelingData/TKGeomBase/Extrema/Extrema_Point.gxx +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) 1995-1999 Matra Datavision -// Copyright (c) 1999-2014 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. - -Extrema_Point::Extrema_Point() - : myU(0.0) -{ -} - -Extrema_Point::Extrema_Point(const Standard_Real U, const Pnt& P) -{ - myU = U; - myP = P; -} - -void Extrema_Point::SetValues(const Standard_Real U, const Pnt& P) -{ - myU = U; - myP = P; -} diff --git a/src/ModelingData/TKGeomBase/Extrema/Extrema_Point.lxx b/src/ModelingData/TKGeomBase/Extrema/Extrema_Point.lxx deleted file mode 100644 index 29cfd3c772..0000000000 --- a/src/ModelingData/TKGeomBase/Extrema/Extrema_Point.lxx +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) 1995-1999 Matra Datavision -// Copyright (c) 1999-2014 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. - -inline Standard_Real Extrema_Point::Parameter() const -{ - return myU; -} - -inline const Pnt& Extrema_Point::Value() const -{ - return myP; -} diff --git a/src/ModelingData/TKGeomBase/Extrema/FILES.cmake b/src/ModelingData/TKGeomBase/Extrema/FILES.cmake index 91a7c9308a..29c1f2d2cf 100644 --- a/src/ModelingData/TKGeomBase/Extrema/FILES.cmake +++ b/src/ModelingData/TKGeomBase/Extrema/FILES.cmake @@ -143,8 +143,6 @@ set(OCCT_Extrema_FILES Extrema_PCLocFOfLocEPCOfLocateExtPC2d.hxx Extrema_PCLocFOfLocEPCOfLocateExtPC2d_0.cxx Extrema_PCLocFOfLocEPCOfLocateExtPC_0.cxx - Extrema_Point.gxx - Extrema_Point.lxx Extrema_POnCurv.hxx Extrema_POnCurv2d.hxx Extrema_POnCurv2d_0.cxx -- 2.39.5