From 36b9ff756a7908cef88239d914201ab89a7de05d Mon Sep 17 00:00:00 2001 From: rkv Date: Wed, 14 Oct 2015 17:48:41 +0300 Subject: [PATCH] 0026595: Lost some comments in OCCT-code after cdl elimination Recovered comments for instance classes from CDL generic classes. --- src/Adaptor2d/Adaptor2d_HLine2d.hxx | 6 + src/Adaptor3d/Adaptor3d_HCurveOnSurface.hxx | 8 + src/Adaptor3d/Adaptor3d_HIsoCurve.hxx | 8 + src/Adaptor3d/Adaptor3d_HOffsetCurve.hxx | 6 + .../Adaptor3d_HSurfaceOfLinearExtrusion.hxx | 6 + .../Adaptor3d_HSurfaceOfRevolution.hxx | 6 + ...nctionOfMyBSplGradientOfBSplineCompute.hxx | 31 +++ ...SquareOfMyBSplGradientOfBSplineCompute.hxx | 83 +++++++ src/AppDef/AppDef_BSplineCompute.hxx | 45 ++++ src/AppDef/AppDef_Compute.hxx | 35 +++ .../AppDef_MyBSplGradientOfBSplineCompute.hxx | 25 ++ src/AppDef/AppDef_MyGradientOfCompute.hxx | 19 ++ .../AppDef_MyGradientbisOfBSplineCompute.hxx | 19 ++ ...ppDef_ParFunctionOfMyGradientOfCompute.hxx | 23 ++ ...unctionOfMyGradientbisOfBSplineCompute.hxx | 23 ++ .../AppDef_ParFunctionOfTheGradient.hxx | 23 ++ ...ef_ParLeastSquareOfMyGradientOfCompute.hxx | 83 +++++++ ...tSquareOfMyGradientbisOfBSplineCompute.hxx | 83 +++++++ .../AppDef_ParLeastSquareOfTheGradient.hxx | 83 +++++++ ...Def_ResConstraintOfMyGradientOfCompute.hxx | 19 ++ ...straintOfMyGradientbisOfBSplineCompute.hxx | 19 ++ .../AppDef_ResConstraintOfTheGradient.hxx | 19 ++ src/AppDef/AppDef_TheFunction.hxx | 23 ++ src/AppDef/AppDef_TheGradient.hxx | 19 ++ src/AppDef/AppDef_TheLeastSquares.hxx | 83 +++++++ src/AppDef/AppDef_TheResol.hxx | 19 ++ src/Approx/Approx_FitAndDivide.hxx | 18 ++ src/Approx/Approx_FitAndDivide2d.hxx | 18 ++ src/BRepAdaptor/BRepAdaptor_HCompCurve.hxx | 8 + src/BRepAdaptor/BRepAdaptor_HCurve.hxx | 8 + src/BRepAdaptor/BRepAdaptor_HCurve2d.hxx | 6 + src/BRepAdaptor/BRepAdaptor_HSurface.hxx | 6 + ...MyBSplGradientOfTheComputeLineOfApprox.hxx | 31 +++ ...MyBSplGradientOfTheComputeLineOfApprox.hxx | 83 +++++++ ...MyBSplGradientOfTheComputeLineOfApprox.hxx | 25 ++ ...GradientOfTheComputeLineBezierOfApprox.hxx | 19 ++ ..._MyGradientbisOfTheComputeLineOfApprox.hxx | 19 ++ ...GradientOfTheComputeLineBezierOfApprox.hxx | 23 ++ ...fMyGradientbisOfTheComputeLineOfApprox.hxx | 23 ++ ...GradientOfTheComputeLineBezierOfApprox.hxx | 83 +++++++ ...fMyGradientbisOfTheComputeLineOfApprox.hxx | 83 +++++++ ...GradientOfTheComputeLineBezierOfApprox.hxx | 19 ++ ...fMyGradientbisOfTheComputeLineOfApprox.hxx | 19 ++ ...RepApprox_TheComputeLineBezierOfApprox.hxx | 35 +++ .../BRepApprox_TheComputeLineOfApprox.hxx | 45 ++++ ...fTheInt2SOfThePrmPrmSvSurfacesOfApprox.hxx | 2 + ...BRepApprox_TheImpPrmSvSurfacesOfApprox.hxx | 1 + ..._TheInt2SOfThePrmPrmSvSurfacesOfApprox.hxx | 36 +++ .../BRepApprox_TheMultiLineOfApprox.hxx | 25 ++ .../BRepApprox_TheMultiLineToolOfApprox.hxx | 24 ++ ...BRepApprox_ThePrmPrmSvSurfacesOfApprox.hxx | 1 + ...erImpFuncOfTheImpPrmSvSurfacesOfApprox.hxx | 2 + src/BRepBlend/BRepBlend_AppSurf.hxx | 10 + src/BRepBlend/BRepBlend_Walking.hxx | 2 + .../BRepClass_FClass2dOfFClassifier.hxx | 18 ++ src/BRepClass/BRepClass_FClassifier.hxx | 17 ++ .../BRepClass_FacePassiveClassifier.hxx | 18 ++ .../BRepClass3d_SolidPassiveClassifier.hxx | 12 + src/BRepFill/BRepFill_ComputeCLine.hxx | 18 ++ src/BRepLProp/BRepLProp_CLProps.hxx | 36 +++ src/BRepLProp/BRepLProp_SLProps.hxx | 49 ++++ src/BiTgte/BiTgte_HCurveOnEdge.hxx | 8 + src/BiTgte/BiTgte_HCurveOnVertex.hxx | 8 + src/Bnd/Bnd_B2d.hxx | 43 ++++ src/Bnd/Bnd_B2f.hxx | 43 ++++ src/Bnd/Bnd_B3d.hxx | 49 ++++ src/Bnd/Bnd_B3f.hxx | 49 ++++ src/ChFiDS/ChFiDS_HElSpine.hxx | 8 + .../Contap_SequenceOfIWLineOfTheIWalking.hxx | 149 +++++++++++ .../Contap_SequenceOfPathPointOfTheSearch.hxx | 149 +++++++++++ .../Contap_SequenceOfSegmentOfTheSearch.hxx | 149 +++++++++++ src/Contap/Contap_TheIWLineOfTheIWalking.hxx | 39 +++ src/Contap/Contap_TheIWalking.hxx | 31 +++ src/Contap/Contap_TheSearch.hxx | 24 ++ src/Contap/Contap_TheSearchInside.hxx | 8 + src/Contap/Contap_TheSegmentOfTheSearch.hxx | 12 + src/Dico/Dico_DictionaryOfInteger.hxx | 66 +++++ src/Dico/Dico_DictionaryOfTransient.hxx | 66 +++++ .../Dico_IteratorOfDictionaryOfInteger.hxx | 13 + .../Dico_IteratorOfDictionaryOfTransient.hxx | 13 + .../Dico_StackItemOfDictionaryOfInteger.hxx | 5 + .../Dico_StackItemOfDictionaryOfTransient.hxx | 5 + src/Extrema/Extrema_CCLocFOfLocECC.hxx | 14 ++ src/Extrema/Extrema_CCLocFOfLocECC2d.hxx | 14 ++ src/Extrema/Extrema_ECC.hxx | 18 ++ src/Extrema/Extrema_ECC2d.hxx | 18 ++ src/Extrema/Extrema_ELPCOfLocateExtPC.hxx | 31 +++ src/Extrema/Extrema_ELPCOfLocateExtPC2d.hxx | 31 +++ .../Extrema_EPCOfELPCOfLocateExtPC.hxx | 34 +++ .../Extrema_EPCOfELPCOfLocateExtPC2d.hxx | 34 +++ src/Extrema/Extrema_EPCOfExtPC.hxx | 34 +++ src/Extrema/Extrema_EPCOfExtPC2d.hxx | 34 +++ src/Extrema/Extrema_ExtPC.hxx | 31 +++ src/Extrema/Extrema_ExtPC2d.hxx | 31 +++ src/Extrema/Extrema_LocECC.hxx | 10 + src/Extrema/Extrema_LocECC2d.hxx | 10 + src/Extrema/Extrema_LocEPCOfLocateExtPC.hxx | 27 ++ src/Extrema/Extrema_LocEPCOfLocateExtPC2d.hxx | 27 ++ src/Extrema/Extrema_LocateExtPC.hxx | 24 ++ src/Extrema/Extrema_LocateExtPC2d.hxx | 24 ++ .../Extrema_PCFOfEPCOfELPCOfLocateExtPC.hxx | 13 + .../Extrema_PCFOfEPCOfELPCOfLocateExtPC2d.hxx | 13 + src/Extrema/Extrema_PCFOfEPCOfExtPC.hxx | 13 + src/Extrema/Extrema_PCFOfEPCOfExtPC2d.hxx | 13 + .../Extrema_PCLocFOfLocEPCOfLocateExtPC.hxx | 13 + .../Extrema_PCLocFOfLocEPCOfLocateExtPC2d.hxx | 13 + src/Extrema/Extrema_POnCurv.hxx | 6 + src/Extrema/Extrema_POnCurv2d.hxx | 6 + ...ema_SeqPCOfPCFOfEPCOfELPCOfLocateExtPC.hxx | 149 +++++++++++ ...a_SeqPCOfPCFOfEPCOfELPCOfLocateExtPC2d.hxx | 149 +++++++++++ .../Extrema_SeqPCOfPCFOfEPCOfExtPC.hxx | 149 +++++++++++ .../Extrema_SeqPCOfPCFOfEPCOfExtPC2d.hxx | 149 +++++++++++ ...ema_SeqPCOfPCLocFOfLocEPCOfLocateExtPC.hxx | 149 +++++++++++ ...a_SeqPCOfPCLocFOfLocEPCOfLocateExtPC2d.hxx | 149 +++++++++++ .../Extrema_SeqPOnCOfCCLocFOfLocECC.hxx | 149 +++++++++++ .../Extrema_SeqPOnCOfCCLocFOfLocECC2d.hxx | 149 +++++++++++ src/Geom2dAdaptor/Geom2dAdaptor_GHCurve.hxx | 6 + src/Geom2dHatch/Geom2dHatch_Classifier.hxx | 17 ++ .../Geom2dHatch_FClass2dOfClassifier.hxx | 18 ++ src/Geom2dInt/Geom2dInt_GInter.hxx | 17 ++ .../Geom2dInt_IntConicCurveOfGInter.hxx | 13 + ...eIntersectorOfTheIntConicCurveOfGInter.hxx | 7 + ...FOfTheLocateExtPCOfTheProjPCurOfGInter.hxx | 13 + ...FOfTheLocateExtPCOfTheProjPCurOfGInter.hxx | 149 +++++++++++ ...t_TheCurveLocatorOfTheProjPCurOfGInter.hxx | 11 + ...eenPCurvesOfTheIntPCurvePCurveOfGInter.hxx | 14 ++ .../Geom2dInt_TheIntConicCurveOfGInter.hxx | 15 ++ .../Geom2dInt_TheIntPCurvePCurveOfGInter.hxx | 5 + ...eIntersectorOfTheIntConicCurveOfGInter.hxx | 11 + ...nt_TheLocateExtPCOfTheProjPCurOfGInter.hxx | 27 ++ ...ePolygon2dOfTheIntPCurvePCurveOfGInter.hxx | 14 ++ .../Geom2dInt_TheProjPCurOfGInter.hxx | 25 ++ src/Geom2dLProp/Geom2dLProp_CLProps2d.hxx | 36 +++ src/GeomAdaptor/GeomAdaptor_GHCurve.hxx | 8 + src/GeomAdaptor/GeomAdaptor_GHSurface.hxx | 6 + src/GeomFill/GeomFill_AppSurf.hxx | 10 + src/GeomFill/GeomFill_AppSweep.hxx | 10 + ...BSplGradientOfTheComputeLineOfWLApprox.hxx | 31 +++ ...BSplGradientOfTheComputeLineOfWLApprox.hxx | 83 +++++++ ...BSplGradientOfTheComputeLineOfWLApprox.hxx | 25 ++ ...adientOfTheComputeLineBezierOfWLApprox.hxx | 19 ++ ...yGradientbisOfTheComputeLineOfWLApprox.hxx | 19 ++ ...adientOfTheComputeLineBezierOfWLApprox.hxx | 23 ++ ...yGradientbisOfTheComputeLineOfWLApprox.hxx | 23 ++ ...adientOfTheComputeLineBezierOfWLApprox.hxx | 83 +++++++ ...yGradientbisOfTheComputeLineOfWLApprox.hxx | 83 +++++++ ...adientOfTheComputeLineBezierOfWLApprox.hxx | 19 ++ ...yGradientbisOfTheComputeLineOfWLApprox.hxx | 19 ++ ...GeomInt_TheComputeLineBezierOfWLApprox.hxx | 35 +++ .../GeomInt_TheComputeLineOfWLApprox.hxx | 45 ++++ ...heInt2SOfThePrmPrmSvSurfacesOfWLApprox.hxx | 2 + .../GeomInt_TheImpPrmSvSurfacesOfWLApprox.hxx | 1 + ...heInt2SOfThePrmPrmSvSurfacesOfWLApprox.hxx | 36 +++ .../GeomInt_TheMultiLineOfWLApprox.hxx | 25 ++ .../GeomInt_TheMultiLineToolOfWLApprox.hxx | 24 ++ .../GeomInt_ThePrmPrmSvSurfacesOfWLApprox.hxx | 1 + ...ImpFuncOfTheImpPrmSvSurfacesOfWLApprox.hxx | 2 + src/GeomLProp/GeomLProp_CLProps.hxx | 36 +++ src/GeomLProp/GeomLProp_SLProps.hxx | 49 ++++ src/HLRBRep/HLRBRep_CInter.hxx | 17 ++ src/HLRBRep/HLRBRep_CLProps.hxx | 36 +++ src/HLRBRep/HLRBRep_IntConicCurveOfCInter.hxx | 13 + src/HLRBRep/HLRBRep_InterCSurf.hxx | 19 ++ ...eIntersectorOfTheIntConicCurveOfCInter.hxx | 7 + ...FOfTheLocateExtPCOfTheProjPCurOfCInter.hxx | 13 + src/HLRBRep/HLRBRep_SLProps.hxx | 49 ++++ ...FOfTheLocateExtPCOfTheProjPCurOfCInter.hxx | 149 +++++++++++ ...p_TheCurveLocatorOfTheProjPCurOfCInter.hxx | 11 + ...eenPCurvesOfTheIntPCurvePCurveOfCInter.hxx | 14 ++ src/HLRBRep/HLRBRep_TheExactInterCSurf.hxx | 32 +++ .../HLRBRep_TheIntConicCurveOfCInter.hxx | 15 ++ .../HLRBRep_TheIntPCurvePCurveOfCInter.hxx | 5 + .../HLRBRep_TheInterferenceOfInterCSurf.hxx | 34 +++ ...eIntersectorOfTheIntConicCurveOfCInter.hxx | 11 + ...ep_TheLocateExtPCOfTheProjPCurOfCInter.hxx | 27 ++ ...ePolygon2dOfTheIntPCurvePCurveOfCInter.hxx | 14 ++ .../HLRBRep_ThePolygonOfInterCSurf.hxx | 10 + .../HLRBRep_ThePolygonToolOfInterCSurf.hxx | 3 + .../HLRBRep_ThePolyhedronOfInterCSurf.hxx | 31 +++ .../HLRBRep_ThePolyhedronToolOfInterCSurf.hxx | 19 ++ src/HLRBRep/HLRBRep_TheProjPCurOfCInter.hxx | 25 ++ .../HLRBRep_TheQuadCurvExactInterCSurf.hxx | 4 + ...adCurvFuncOfTheQuadCurvExactInterCSurf.hxx | 10 + src/IGESData/IGESData_FileRecognizer.hxx | 20 ++ .../IGESData_GlobalNodeOfSpecificLib.hxx | 9 + .../IGESData_GlobalNodeOfWriterLib.hxx | 9 + src/IGESData/IGESData_NodeOfSpecificLib.hxx | 7 + src/IGESData/IGESData_NodeOfWriterLib.hxx | 7 + src/IGESData/IGESData_SpecificLib.hxx | 28 +++ src/IGESData/IGESData_WriterLib.hxx | 28 +++ src/IGESSelect/IGESSelect_FileModifier.hxx | 10 + src/IGESSelect/IGESSelect_ModelModifier.hxx | 13 + src/IntCurve/IntCurve_IntImpConicParConic.hxx | 11 + ...urve_MyImpParToolOfIntImpConicParConic.hxx | 7 + .../IntCurveSurface_HInter.hxx | 19 ++ .../IntCurveSurface_TheExactHInter.hxx | 32 +++ .../IntCurveSurface_TheHCurveTool.hxx | 34 +++ ...ntCurveSurface_TheInterferenceOfHInter.hxx | 34 +++ .../IntCurveSurface_ThePolygonOfHInter.hxx | 10 + ...IntCurveSurface_ThePolygonToolOfHInter.hxx | 3 + .../IntCurveSurface_ThePolyhedronOfHInter.hxx | 31 +++ ...CurveSurface_ThePolyhedronToolOfHInter.hxx | 19 ++ ...IntCurveSurface_TheQuadCurvExactHInter.hxx | 4 + ...heQuadCurvFuncOfTheQuadCurvExactHInter.hxx | 10 + src/IntPatch/IntPatch_CurvIntSurf.hxx | 32 +++ ...IntPatch_SequenceOfIWLineOfTheIWalking.hxx | 149 +++++++++++ ...atch_SequenceOfPathPointOfTheSOnBounds.hxx | 149 +++++++++++ ...tPatch_SequenceOfSegmentOfTheSOnBounds.hxx | 149 +++++++++++ .../IntPatch_TheIWLineOfTheIWalking.hxx | 39 +++ src/IntPatch/IntPatch_TheIWalking.hxx | 31 +++ src/IntPatch/IntPatch_TheSOnBounds.hxx | 24 ++ src/IntPatch/IntPatch_TheSearchInside.hxx | 8 + .../IntPatch_TheSegmentOfTheSOnBounds.hxx | 12 + src/IntPatch/IntPatch_TheSurfFunction.hxx | 2 + src/IntTools/IntTools_CArray1OfInteger.hxx | 39 +++ src/IntTools/IntTools_CArray1OfReal.hxx | 39 +++ src/IntWalk/IntWalk_TheFunctionOfTheInt2S.hxx | 2 + src/IntWalk/IntWalk_TheInt2S.hxx | 36 +++ src/Interface/Interface_GeneralLib.hxx | 28 +++ .../Interface_GlobalNodeOfGeneralLib.hxx | 9 + .../Interface_GlobalNodeOfReaderLib.hxx | 9 + src/Interface/Interface_NodeOfGeneralLib.hxx | 7 + src/Interface/Interface_NodeOfReaderLib.hxx | 7 + src/Interface/Interface_ReaderLib.hxx | 28 +++ src/LProp3d/LProp3d_CLProps.hxx | 36 +++ src/LProp3d/LProp3d_SLProps.hxx | 49 ++++ src/ProjLib/ProjLib_HCompProjectedCurve.hxx | 6 + src/ProjLib/ProjLib_HProjectedCurve.hxx | 6 + .../STEPCAFControl_DictionaryOfExternFile.hxx | 66 +++++ ...ntrol_IteratorOfDictionaryOfExternFile.hxx | 13 + ...trol_StackItemOfDictionaryOfExternFile.hxx | 5 + .../ShapeProcess_DictionaryOfOperator.hxx | 66 +++++ ...Process_IteratorOfDictionaryOfOperator.hxx | 13 + ...rocess_StackItemOfDictionaryOfOperator.hxx | 5 + src/StepData/StepData_FileRecognizer.hxx | 20 ++ .../StepData_GlobalNodeOfWriterLib.hxx | 9 + src/StepData/StepData_NodeOfWriterLib.hxx | 7 + src/StepData/StepData_WriterLib.hxx | 28 +++ src/StepSelect/StepSelect_FileModifier.hxx | 10 + src/StepSelect/StepSelect_ModelModifier.hxx | 13 + .../Transfer_ActorOfProcessForFinder.hxx | 31 +++ .../Transfer_ActorOfProcessForTransient.hxx | 31 +++ .../Transfer_IteratorOfProcessForFinder.hxx | 17 ++ ...Transfer_IteratorOfProcessForTransient.hxx | 17 ++ src/Transfer/Transfer_ProcessForFinder.hxx | 232 ++++++++++++++++++ src/Transfer/Transfer_ProcessForTransient.hxx | 232 ++++++++++++++++++ ...Transfer_TransferMapOfProcessForFinder.hxx | 57 +++++ ...nsfer_TransferMapOfProcessForTransient.hxx | 57 +++++ src/Transfer/Transfer_TransientMapper.hxx | 11 + .../TransferBRep_OrientedShapeMapper.hxx | 11 + src/TransferBRep/TransferBRep_ShapeMapper.hxx | 11 + 251 files changed, 8209 insertions(+) diff --git a/src/Adaptor2d/Adaptor2d_HLine2d.hxx b/src/Adaptor2d/Adaptor2d_HLine2d.hxx index 4e3480ed4c..ebe4cf544b 100644 --- a/src/Adaptor2d/Adaptor2d_HLine2d.hxx +++ b/src/Adaptor2d/Adaptor2d_HLine2d.hxx @@ -39,14 +39,20 @@ class Adaptor2d_HLine2d : public Adaptor2d_HCurve2d public: + //! Creates an empty GenHCurve2d. Standard_EXPORT Adaptor2d_HLine2d(); + //! Creates a GenHCurve2d from a Curve Standard_EXPORT Adaptor2d_HLine2d(const Adaptor2d_Line2d& C); + //! Sets the field of the GenHCurve2d. Standard_EXPORT void Set (const Adaptor2d_Line2d& C); + //! Returns the curve used to create the GenHCurve2d. + //! This is redefined from HCurve2d, cannot be inline. Standard_EXPORT const Adaptor2d_Curve2d& Curve2d() const; + //! Returns the curve used to create the GenHCurve. Adaptor2d_Line2d& ChangeCurve2d(); diff --git a/src/Adaptor3d/Adaptor3d_HCurveOnSurface.hxx b/src/Adaptor3d/Adaptor3d_HCurveOnSurface.hxx index 274f4b99e3..474158af84 100644 --- a/src/Adaptor3d/Adaptor3d_HCurveOnSurface.hxx +++ b/src/Adaptor3d/Adaptor3d_HCurveOnSurface.hxx @@ -39,16 +39,24 @@ class Adaptor3d_HCurveOnSurface : public Adaptor3d_HCurve public: + //! Creates an empty GenHCurve. Standard_EXPORT Adaptor3d_HCurveOnSurface(); + //! Creates a GenHCurve from a Curve Standard_EXPORT Adaptor3d_HCurveOnSurface(const Adaptor3d_CurveOnSurface& C); + //! Sets the field of the GenHCurve. Standard_EXPORT void Set (const Adaptor3d_CurveOnSurface& C); + //! Returns the curve used to create the GenHCurve. + //! This is redefined from HCurve, cannot be inline. Standard_EXPORT const Adaptor3d_Curve& Curve() const; + //! Returns the curve used to create the GenHCurve. + //! This is redefined from HCurve, cannot be inline. Standard_EXPORT Adaptor3d_Curve& GetCurve(); + //! Returns the curve used to create the GenHCurve. Adaptor3d_CurveOnSurface& ChangeCurve(); diff --git a/src/Adaptor3d/Adaptor3d_HIsoCurve.hxx b/src/Adaptor3d/Adaptor3d_HIsoCurve.hxx index 18e92ca3c6..7882705e9e 100644 --- a/src/Adaptor3d/Adaptor3d_HIsoCurve.hxx +++ b/src/Adaptor3d/Adaptor3d_HIsoCurve.hxx @@ -39,16 +39,24 @@ class Adaptor3d_HIsoCurve : public Adaptor3d_HCurve public: + //! Creates an empty GenHCurve. Standard_EXPORT Adaptor3d_HIsoCurve(); + //! Creates a GenHCurve from a Curve Standard_EXPORT Adaptor3d_HIsoCurve(const Adaptor3d_IsoCurve& C); + //! Sets the field of the GenHCurve. Standard_EXPORT void Set (const Adaptor3d_IsoCurve& C); + //! Returns the curve used to create the GenHCurve. + //! This is redefined from HCurve, cannot be inline. Standard_EXPORT const Adaptor3d_Curve& Curve() const; + //! Returns the curve used to create the GenHCurve. + //! This is redefined from HCurve, cannot be inline. Standard_EXPORT Adaptor3d_Curve& GetCurve(); + //! Returns the curve used to create the GenHCurve. Adaptor3d_IsoCurve& ChangeCurve(); diff --git a/src/Adaptor3d/Adaptor3d_HOffsetCurve.hxx b/src/Adaptor3d/Adaptor3d_HOffsetCurve.hxx index 04dd1466a5..210f893938 100644 --- a/src/Adaptor3d/Adaptor3d_HOffsetCurve.hxx +++ b/src/Adaptor3d/Adaptor3d_HOffsetCurve.hxx @@ -39,14 +39,20 @@ class Adaptor3d_HOffsetCurve : public Adaptor2d_HCurve2d public: + //! Creates an empty GenHCurve2d. Standard_EXPORT Adaptor3d_HOffsetCurve(); + //! Creates a GenHCurve2d from a Curve Standard_EXPORT Adaptor3d_HOffsetCurve(const Adaptor3d_OffsetCurve& C); + //! Sets the field of the GenHCurve2d. Standard_EXPORT void Set (const Adaptor3d_OffsetCurve& C); + //! Returns the curve used to create the GenHCurve2d. + //! This is redefined from HCurve2d, cannot be inline. Standard_EXPORT const Adaptor2d_Curve2d& Curve2d() const; + //! Returns the curve used to create the GenHCurve. Adaptor3d_OffsetCurve& ChangeCurve2d(); diff --git a/src/Adaptor3d/Adaptor3d_HSurfaceOfLinearExtrusion.hxx b/src/Adaptor3d/Adaptor3d_HSurfaceOfLinearExtrusion.hxx index 947b62d11b..a0eef627b3 100644 --- a/src/Adaptor3d/Adaptor3d_HSurfaceOfLinearExtrusion.hxx +++ b/src/Adaptor3d/Adaptor3d_HSurfaceOfLinearExtrusion.hxx @@ -39,14 +39,20 @@ class Adaptor3d_HSurfaceOfLinearExtrusion : public Adaptor3d_HSurface public: + //! Creates an empty GenHSurface. Standard_EXPORT Adaptor3d_HSurfaceOfLinearExtrusion(); + //! Creates a GenHSurface from a Surface. Standard_EXPORT Adaptor3d_HSurfaceOfLinearExtrusion(const Adaptor3d_SurfaceOfLinearExtrusion& S); + //! Sets the field of the GenHSurface. Standard_EXPORT void Set (const Adaptor3d_SurfaceOfLinearExtrusion& S); + //! Returns a reference to the Surface inside the HSurface. + //! This is redefined from HSurface, cannot be inline. Standard_EXPORT const Adaptor3d_Surface& Surface() const; + //! Returns the surface used to create the GenHSurface. Adaptor3d_SurfaceOfLinearExtrusion& ChangeSurface(); diff --git a/src/Adaptor3d/Adaptor3d_HSurfaceOfRevolution.hxx b/src/Adaptor3d/Adaptor3d_HSurfaceOfRevolution.hxx index bfc7d23fc1..56a54646be 100644 --- a/src/Adaptor3d/Adaptor3d_HSurfaceOfRevolution.hxx +++ b/src/Adaptor3d/Adaptor3d_HSurfaceOfRevolution.hxx @@ -39,14 +39,20 @@ class Adaptor3d_HSurfaceOfRevolution : public Adaptor3d_HSurface public: + //! Creates an empty GenHSurface. Standard_EXPORT Adaptor3d_HSurfaceOfRevolution(); + //! Creates a GenHSurface from a Surface. Standard_EXPORT Adaptor3d_HSurfaceOfRevolution(const Adaptor3d_SurfaceOfRevolution& S); + //! Sets the field of the GenHSurface. Standard_EXPORT void Set (const Adaptor3d_SurfaceOfRevolution& S); + //! Returns a reference to the Surface inside the HSurface. + //! This is redefined from HSurface, cannot be inline. Standard_EXPORT const Adaptor3d_Surface& Surface() const; + //! Returns the surface used to create the GenHSurface. Adaptor3d_SurfaceOfRevolution& ChangeSurface(); diff --git a/src/AppDef/AppDef_BSpParFunctionOfMyBSplGradientOfBSplineCompute.hxx b/src/AppDef/AppDef_BSpParFunctionOfMyBSplGradientOfBSplineCompute.hxx index 86e92fdddf..5e425c210b 100644 --- a/src/AppDef/AppDef_BSpParFunctionOfMyBSplGradientOfBSplineCompute.hxx +++ b/src/AppDef/AppDef_BSpParFunctionOfMyBSplGradientOfBSplineCompute.hxx @@ -51,30 +51,59 @@ public: DEFINE_STANDARD_ALLOC + //! initializes the fields of the function. The approximating + //! curve has control points. Standard_EXPORT AppDef_BSpParFunctionOfMyBSplGradientOfBSplineCompute(const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, const math_Vector& Parameters, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const Standard_Integer NbPol); + //! returns the number of variables of the function. It + //! corresponds to the number of MultiPoints. Standard_EXPORT Standard_Integer NbVariables() const; + //! this method computes the new approximation of the + //! MultiLine + //! SSP and calculates F = sum (||Pui - Bi*Pi||2) for each + //! point of the MultiLine. Standard_EXPORT Standard_Boolean Value (const math_Vector& X, Standard_Real& F); + //! returns the gradient G of the sum above for the + //! parameters Xi. Standard_EXPORT Standard_Boolean Gradient (const math_Vector& X, math_Vector& G); + //! returns the value F=sum(||Pui - Bi*Pi||)2. + //! returns the value G = grad(F) for the parameters Xi. Standard_EXPORT Standard_Boolean Values (const math_Vector& X, Standard_Real& F, math_Vector& G); + //! returns the new parameters of the MultiLine. Standard_EXPORT const math_Vector& NewParameters() const; + //! returns the MultiBSpCurve approximating the set after + //! computing the value F or Grad(F). Standard_EXPORT AppParCurves_MultiBSpCurve CurveValue(); + //! returns the distance between the MultiPoint of range + //! IPoint and the curve CurveIndex. Standard_EXPORT Standard_Real Error (const Standard_Integer IPoint, const Standard_Integer CurveIndex); + //! returns the maximum distance between the points + //! and the MultiBSpCurve. Standard_EXPORT Standard_Real MaxError3d() const; + //! returns the maximum distance between the points + //! and the MultiBSpCurve. Standard_EXPORT Standard_Real MaxError2d() const; + //! returns the function matrix used to approximate the + //! multiline. Standard_EXPORT const math_Matrix& FunctionMatrix() const; + //! returns the derivative function matrix used to approximate the + //! multiline. Standard_EXPORT const math_Matrix& DerivativeFunctionMatrix() const; + //! Returns the indexes of the first non null values of + //! A and DA. + //! The values are non null from Index(ieme point) +1 + //! to Index(ieme point) + degree +1. Standard_EXPORT const math_IntegerVector& Index() const; Standard_EXPORT AppParCurves_Constraint FirstConstraint (const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, const Standard_Integer FirstPoint) const; @@ -91,6 +120,8 @@ public: protected: + //! this method is used each time Value or Gradient is + //! needed. Standard_EXPORT void Perform (const math_Vector& X); diff --git a/src/AppDef/AppDef_BSpParLeastSquareOfMyBSplGradientOfBSplineCompute.hxx b/src/AppDef/AppDef_BSpParLeastSquareOfMyBSplGradientOfBSplineCompute.hxx index 3931f599a5..b4789a6a15 100644 --- a/src/AppDef/AppDef_BSpParLeastSquareOfMyBSplGradientOfBSplineCompute.hxx +++ b/src/AppDef/AppDef_BSpParLeastSquareOfMyBSplGradientOfBSplineCompute.hxx @@ -52,46 +52,120 @@ public: DEFINE_STANDARD_ALLOC + //! given a MultiLine, this algorithm computes the least + //! square resolution using the Householder-QR method. + //! If the first and/or the last point is a constraint + //! point, the value of the tangency or curvature is + //! computed in the resolution. + //! NbPol is the number of control points wanted + //! for the approximating curves. + //! The system to solve is the following: + //! A X = B. + //! Where A is the Bernstein matrix computed with the + //! parameters, B the points coordinates and X the poles + //! solutions. + //! The matrix A is the same for each coordinate x, y and z + //! and is also the same for each MultiLine point because + //! they are approximated in parallel(so with the same + //! parameter, only the vector B changes). Standard_EXPORT AppDef_BSpParLeastSquareOfMyBSplGradientOfBSplineCompute(const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const AppParCurves_Constraint FirstCons, const AppParCurves_Constraint LastCons, const math_Vector& Parameters, const Standard_Integer NbPol); + //! Initializes the fields of the object. Standard_EXPORT AppDef_BSpParLeastSquareOfMyBSplGradientOfBSplineCompute(const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const AppParCurves_Constraint FirstCons, const AppParCurves_Constraint LastCons, const Standard_Integer NbPol); + //! given a MultiLine, this algorithm computes the least + //! square resolution using the Householder-QR method. + //! If the first and/or the last point is a constraint + //! point, the value of the tangency or curvature is + //! computed in the resolution. + //! Deg is the degree wanted for the approximating curves. + //! The system to solve is the following: + //! A X = B. + //! Where A is the BSpline functions matrix computed with + //! , B the points coordinates and X the poles + //! solutions. + //! The matrix A is the same for each coordinate x, y and z + //! and is also the same for each MultiLine point because + //! they are approximated in parallel(so with the same + //! parameter, only the vector B changes). Standard_EXPORT AppDef_BSpParLeastSquareOfMyBSplGradientOfBSplineCompute(const AppDef_MultiLine& SSP, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const AppParCurves_Constraint FirstCons, const AppParCurves_Constraint LastCons, const math_Vector& Parameters, const Standard_Integer NbPol); + //! Initializes the fields of the object. Standard_EXPORT AppDef_BSpParLeastSquareOfMyBSplGradientOfBSplineCompute(const AppDef_MultiLine& SSP, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const AppParCurves_Constraint FirstCons, const AppParCurves_Constraint LastCons, const Standard_Integer NbPol); + //! Is used after having initialized the fields. + //! The case "CurvaturePoint" is not treated in this method. Standard_EXPORT void Perform (const math_Vector& Parameters); + //! Is used after having initialized the fields. Standard_EXPORT void Perform (const math_Vector& Parameters, const Standard_Real l1, const Standard_Real l2); + //! Is used after having initialized the fields. + //! is the tangent vector at the first point. + //! is the tangent vector at the last point. Standard_EXPORT void Perform (const math_Vector& Parameters, const math_Vector& V1t, const math_Vector& V2t, const Standard_Real l1, const Standard_Real l2); + //! Is used after having initialized the fields. + //! is the tangent vector at the first point. + //! is the tangent vector at the last point. + //! is the tangent vector at the first point. + //! is the tangent vector at the last point. Standard_EXPORT void Perform (const math_Vector& Parameters, const math_Vector& V1t, const math_Vector& V2t, const math_Vector& V1c, const math_Vector& V2c, const Standard_Real l1, const Standard_Real l2); + //! returns True if all has been correctly done. Standard_EXPORT Standard_Boolean IsDone() const; + //! returns the result of the approximation, i.e. all the + //! Curves. + //! An exception is raised if NotDone. Standard_EXPORT AppParCurves_MultiCurve BezierValue(); + //! returns the result of the approximation, i.e. all the + //! Curves. + //! An exception is raised if NotDone. Standard_EXPORT const AppParCurves_MultiBSpCurve& BSplineValue(); + //! returns the function matrix used to approximate the + //! set. Standard_EXPORT const math_Matrix& FunctionMatrix() const; + //! returns the derivative function matrix used + //! to approximate the set. Standard_EXPORT const math_Matrix& DerivativeFunctionMatrix() const; + //! returns the maximum errors between the MultiLine + //! and the approximation curves. F is the sum of the square + //! distances. Grad is the derivative vector of the + //! function F. Standard_EXPORT void ErrorGradient (math_Vector& Grad, Standard_Real& F, Standard_Real& MaxE3d, Standard_Real& MaxE2d); + //! returns the distances between the points of the + //! multiline and the approximation curves. Standard_EXPORT const math_Matrix& Distance(); + //! returns the maximum errors between the MultiLine + //! and the approximation curves. F is the sum of the square + //! distances. Standard_EXPORT void Error (Standard_Real& F, Standard_Real& MaxE3d, Standard_Real& MaxE2d); + //! returns the value (P2 - P1)/ V1 if the first point + //! was a tangency point. Standard_EXPORT Standard_Real FirstLambda() const; + //! returns the value (PN - PN-1)/ VN if the last point + //! was a tangency point. Standard_EXPORT Standard_Real LastLambda() const; + //! returns the matrix of points value. Standard_EXPORT const math_Matrix& Points() const; + //! returns the matrix of resulting control points value. Standard_EXPORT const math_Matrix& Poles() const; + //! Returns the indexes of the first non null values of + //! A and DA. + //! The values are non null from Index(ieme point) +1 + //! to Index(ieme point) + degree +1. Standard_EXPORT const math_IntegerVector& KIndex() const; @@ -100,24 +174,33 @@ public: protected: + //! is used by the constuctors above. Standard_EXPORT void Init (const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint); + //! returns the number of second member columns. + //! Is used internally to initialize the fields. Standard_EXPORT Standard_Integer NbBColumns (const AppDef_MultiLine& SSP) const; + //! returns the first point beeing fitted. Standard_EXPORT Standard_Integer TheFirstPoint (const AppParCurves_Constraint FirstCons, const Standard_Integer FirstPoint) const; + //! returns the last point beeing fitted. Standard_EXPORT Standard_Integer TheLastPoint (const AppParCurves_Constraint LastCons, const Standard_Integer LastPoint) const; + //! Affects the fields in the case of a constraint point. Standard_EXPORT void Affect (const AppDef_MultiLine& SSP, const Standard_Integer Index, AppParCurves_Constraint& Cons, math_Vector& Vt, math_Vector& Vc); Standard_EXPORT void ComputeFunction (const math_Vector& Parameters); Standard_EXPORT void SearchIndex (math_IntegerVector& Index); + //! computes internal matrixes for the resolution Standard_EXPORT void MakeTAA (math_Vector& TheA, math_Vector& TheB); + //! computes internal matrixes for the resolution Standard_EXPORT void MakeTAA (math_Vector& TheA); + //! computes internal matrixes for the resolution Standard_EXPORT void MakeTAA (math_Vector& TheA, math_Matrix& TheB); diff --git a/src/AppDef/AppDef_BSplineCompute.hxx b/src/AppDef/AppDef_BSplineCompute.hxx index 9e7e3d5051..ebbdf3fe79 100644 --- a/src/AppDef/AppDef_BSplineCompute.hxx +++ b/src/AppDef/AppDef_BSplineCompute.hxx @@ -56,44 +56,86 @@ public: DEFINE_STANDARD_ALLOC + //! The MultiLine will be approximated until tolerances + //! will be reached. + //! The approximation will be done from degreemin to degreemax + //! with a cutting if the corresponding boolean is True. + //! If is True, the computation will be done with + //! no iteration at all. + //! + //! The multiplicities of the internal knots is set by + //! default. Standard_EXPORT AppDef_BSplineCompute(const AppDef_MultiLine& Line, const Standard_Integer degreemin = 4, const Standard_Integer degreemax = 8, const Standard_Real Tolerance3d = 1.0e-3, const Standard_Real Tolerance2d = 1.0e-6, const Standard_Integer NbIterations = 5, const Standard_Boolean cutting = Standard_True, const Approx_ParametrizationType parametrization = Approx_ChordLength, const Standard_Boolean Squares = Standard_False); + //! The MultiLine will be approximated until tolerances + //! will be reached. + //! The approximation will be done from degreemin to degreemax + //! with a cutting if the corresponding boolean is True. + //! If is True, the computation will be done with + //! no iteration at all. Standard_EXPORT AppDef_BSplineCompute(const AppDef_MultiLine& Line, const math_Vector& Parameters, const Standard_Integer degreemin = 4, const Standard_Integer degreemax = 8, const Standard_Real Tolerance3d = 1.0e-03, const Standard_Real Tolerance2d = 1.0e-06, const Standard_Integer NbIterations = 5, const Standard_Boolean cutting = Standard_True, const Standard_Boolean Squares = Standard_False); + //! Initializes the fields of the algorithm. Standard_EXPORT AppDef_BSplineCompute(const math_Vector& Parameters, const Standard_Integer degreemin = 4, const Standard_Integer degreemax = 8, const Standard_Real Tolerance3d = 1.0e-03, const Standard_Real Tolerance2d = 1.0e-06, const Standard_Integer NbIterations = 5, const Standard_Boolean cutting = Standard_True, const Standard_Boolean Squares = Standard_False); + //! Initializes the fields of the algorithm. Standard_EXPORT AppDef_BSplineCompute(const Standard_Integer degreemin = 4, const Standard_Integer degreemax = 8, const Standard_Real Tolerance3d = 1.0e-03, const Standard_Real Tolerance2d = 1.0e-06, const Standard_Integer NbIterations = 5, const Standard_Boolean cutting = Standard_True, const Approx_ParametrizationType parametrization = Approx_ChordLength, const Standard_Boolean Squares = Standard_False); + //! Constructs an interpolation of the MultiLine + //! The result will be a C2 curve of degree 3. Standard_EXPORT void Interpol (const AppDef_MultiLine& Line); + //! Initializes the fields of the algorithm. Standard_EXPORT void Init (const Standard_Integer degreemin = 4, const Standard_Integer degreemax = 8, const Standard_Real Tolerance3d = 1.0e-03, const Standard_Real Tolerance2d = 1.0e-06, const Standard_Integer NbIterations = 5, const Standard_Boolean cutting = Standard_True, const Approx_ParametrizationType parametrization = Approx_ChordLength, const Standard_Boolean Squares = Standard_False); + //! runs the algorithm after having initialized the fields. Standard_EXPORT void Perform (const AppDef_MultiLine& Line); + //! The approximation will begin with the + //! set of parameters . Standard_EXPORT void SetParameters (const math_Vector& ThePar); + //! The approximation will be done with the + //! set of knots . The multiplicities will be set + //! with the degree and the desired continuity. Standard_EXPORT void SetKnots (const TColStd_Array1OfReal& Knots); + //! The approximation will be done with the + //! set of knots and the multiplicities . Standard_EXPORT void SetKnotsAndMultiplicities (const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults); + //! changes the degrees of the approximation. Standard_EXPORT void SetDegrees (const Standard_Integer degreemin, const Standard_Integer degreemax); + //! Changes the tolerances of the approximation. Standard_EXPORT void SetTolerances (const Standard_Real Tolerance3d, const Standard_Real Tolerance2d); + //! sets the continuity of the spline. + //! if C = 2, the spline will be C2. Standard_EXPORT void SetContinuity (const Standard_Integer C); + //! changes the first and the last constraint points. Standard_EXPORT void SetConstraints (const AppParCurves_Constraint firstC, const AppParCurves_Constraint lastC); + //! returns False if at a moment of the approximation, + //! the status NoApproximation has been sent by the user + //! when more points were needed. Standard_EXPORT Standard_Boolean IsAllApproximated() const; + //! returns False if the status NoPointsAdded has been sent. Standard_EXPORT Standard_Boolean IsToleranceReached() const; + //! returns the tolerances 2d and 3d of the MultiBSpCurve. Standard_EXPORT void Error (Standard_Real& tol3d, Standard_Real& tol2d) const; + //! returns the result of the approximation. Standard_EXPORT const AppParCurves_MultiBSpCurve& Value() const; + //! returns the result of the approximation. Standard_EXPORT AppParCurves_MultiBSpCurve& ChangeValue(); + //! returns the new parameters of the approximation + //! corresponding to the points of the MultiBSpCurve. Standard_EXPORT const TColStd_Array1OfReal& Parameters() const; @@ -108,10 +150,13 @@ protected: private: + //! is internally used in the algorithm. Standard_EXPORT Standard_Boolean Compute (const AppDef_MultiLine& Line, const Standard_Integer fpt, const Standard_Integer lpt, math_Vector& Para, const TColStd_Array1OfReal& Knots, TColStd_Array1OfInteger& Mults); + //! is internally used in the algorithm. Standard_EXPORT Standard_Boolean ComputeCurve (const AppDef_MultiLine& Line, const Standard_Integer firspt, const Standard_Integer lastpt); + //! computes new parameters between firstP and lastP. Standard_EXPORT void Parameters (const AppDef_MultiLine& Line, const Standard_Integer firstP, const Standard_Integer LastP, math_Vector& TheParameters) const; Standard_EXPORT Standard_Real SearchFirstLambda (const AppDef_MultiLine& Line, const math_Vector& Para, const TColStd_Array1OfReal& Knots, const math_Vector& V, const Standard_Integer index) const; diff --git a/src/AppDef/AppDef_Compute.hxx b/src/AppDef/AppDef_Compute.hxx index 91a6ed031c..c387e88122 100644 --- a/src/AppDef/AppDef_Compute.hxx +++ b/src/AppDef/AppDef_Compute.hxx @@ -54,40 +54,72 @@ public: DEFINE_STANDARD_ALLOC + //! The MultiLine will be approximated until tolerances + //! will be reached. + //! The approximation will be done from degreemin to degreemax + //! with a cutting if the corresponding boolean is True. + //! If is True, the computation will be done with + //! no iteration at all. Standard_EXPORT AppDef_Compute(const AppDef_MultiLine& Line, const Standard_Integer degreemin = 4, const Standard_Integer degreemax = 8, const Standard_Real Tolerance3d = 1.0e-3, const Standard_Real Tolerance2d = 1.0e-6, const Standard_Integer NbIterations = 5, const Standard_Boolean cutting = Standard_True, const Approx_ParametrizationType parametrization = Approx_ChordLength, const Standard_Boolean Squares = Standard_False); + //! The MultiLine will be approximated until tolerances + //! will be reached. + //! The approximation will be done from degreemin to degreemax + //! with a cutting if the corresponding boolean is True. + //! If is True, the computation will be done with + //! no iteration at all. Standard_EXPORT AppDef_Compute(const AppDef_MultiLine& Line, const math_Vector& Parameters, const Standard_Integer degreemin = 4, const Standard_Integer degreemax = 8, const Standard_Real Tolerance3d = 1.0e-03, const Standard_Real Tolerance2d = 1.0e-06, const Standard_Integer NbIterations = 5, const Standard_Boolean cutting = Standard_True, const Standard_Boolean Squares = Standard_False); + //! Initializes the fields of the algorithm. Standard_EXPORT AppDef_Compute(const math_Vector& Parameters, const Standard_Integer degreemin = 4, const Standard_Integer degreemax = 8, const Standard_Real Tolerance3d = 1.0e-03, const Standard_Real Tolerance2d = 1.0e-06, const Standard_Integer NbIterations = 5, const Standard_Boolean cutting = Standard_True, const Standard_Boolean Squares = Standard_False); + //! Initializes the fields of the algorithm. Standard_EXPORT AppDef_Compute(const Standard_Integer degreemin = 4, const Standard_Integer degreemax = 8, const Standard_Real Tolerance3d = 1.0e-03, const Standard_Real Tolerance2d = 1.0e-06, const Standard_Integer NbIterations = 5, const Standard_Boolean cutting = Standard_True, const Approx_ParametrizationType parametrization = Approx_ChordLength, const Standard_Boolean Squares = Standard_False); + //! Initializes the fields of the algorithm. Standard_EXPORT void Init (const Standard_Integer degreemin = 4, const Standard_Integer degreemax = 8, const Standard_Real Tolerance3d = 1.0e-03, const Standard_Real Tolerance2d = 1.0e-06, const Standard_Integer NbIterations = 5, const Standard_Boolean cutting = Standard_True, const Approx_ParametrizationType parametrization = Approx_ChordLength, const Standard_Boolean Squares = Standard_False); + //! runs the algorithm after having initialized the fields. Standard_EXPORT void Perform (const AppDef_MultiLine& Line); + //! changes the degrees of the approximation. Standard_EXPORT void SetDegrees (const Standard_Integer degreemin, const Standard_Integer degreemax); + //! Changes the tolerances of the approximation. Standard_EXPORT void SetTolerances (const Standard_Real Tolerance3d, const Standard_Real Tolerance2d); + //! changes the first and the last constraint points. Standard_EXPORT void SetConstraints (const AppParCurves_Constraint firstC, const AppParCurves_Constraint lastC); + //! returns False if at a moment of the approximation, + //! the status NoApproximation has been sent by the user + //! when more points were needed. Standard_EXPORT Standard_Boolean IsAllApproximated() const; + //! returns False if the status NoPointsAdded has been sent. Standard_EXPORT Standard_Boolean IsToleranceReached() const; + //! returns the tolerances 2d and 3d of the MultiCurve. Standard_EXPORT void Error (const Standard_Integer Index, Standard_Real& tol3d, Standard_Real& tol2d) const; + //! Returns the number of MultiCurve doing the approximation + //! of the MultiLine. Standard_EXPORT Standard_Integer NbMultiCurves() const; + //! returns the result of the approximation. Standard_EXPORT const AppParCurves_MultiCurve& Value (const Standard_Integer Index = 1) const; + //! returns the result of the approximation. Standard_EXPORT AppParCurves_MultiCurve& ChangeValue (const Standard_Integer Index = 1); + //! returns the result of the approximation. Standard_EXPORT const AppParCurves_MultiBSpCurve& SplineValue(); + //! returns the type of parametrization Standard_EXPORT void Parametrization (Approx_ParametrizationType& partype) const; + //! returns the new parameters of the approximation + //! corresponding to the points of the multicurve . Standard_EXPORT const TColStd_Array1OfReal& Parameters (const Standard_Integer Index = 1) const; @@ -102,10 +134,13 @@ protected: private: + //! is internally used in the algorithm. Standard_EXPORT Standard_Boolean Compute (const AppDef_MultiLine& Line, const Standard_Integer fpt, const Standard_Integer lpt, math_Vector& Para, Standard_Real& TheTol3d, Standard_Real& TheTol2d); + //! is internally used in the algorithm. Standard_EXPORT Standard_Boolean ComputeCurve (const AppDef_MultiLine& Line, const Standard_Integer firspt, const Standard_Integer lastpt); + //! computes new parameters between firstP and lastP. Standard_EXPORT void Parameters (const AppDef_MultiLine& Line, const Standard_Integer firstP, const Standard_Integer LastP, math_Vector& TheParameters) const; Standard_EXPORT Standard_Real SearchFirstLambda (const AppDef_MultiLine& Line, const math_Vector& Para, const math_Vector& V, const Standard_Integer index) const; diff --git a/src/AppDef/AppDef_MyBSplGradientOfBSplineCompute.hxx b/src/AppDef/AppDef_MyBSplGradientOfBSplineCompute.hxx index 4d08cc0d75..cf59263e93 100644 --- a/src/AppDef/AppDef_MyBSplGradientOfBSplineCompute.hxx +++ b/src/AppDef/AppDef_MyBSplGradientOfBSplineCompute.hxx @@ -47,20 +47,45 @@ public: DEFINE_STANDARD_ALLOC + //! Tries to minimize the sum (square(||Qui - Bi*Pi||)) + //! where Pui describe the approximating BSpline curves'Poles + //! and Qi the MultiLine points with a parameter ui. + //! In this algorithm, the parameters ui are the unknowns. + //! The tolerance required on this sum is given by Tol. + //! The desired degree of the resulting curve is Deg. Standard_EXPORT AppDef_MyBSplGradientOfBSplineCompute(const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, math_Vector& Parameters, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const Standard_Integer Deg, const Standard_Real Tol3d, const Standard_Real Tol2d, const Standard_Integer NbIterations = 1); + //! Tries to minimize the sum (square(||Qui - Bi*Pi||)) + //! where Pui describe the approximating BSpline curves'Poles + //! and Qi the MultiLine points with a parameter ui. + //! In this algorithm, the parameters ui are the unknowns. + //! The tolerance required on this sum is given by Tol. + //! The desired degree of the resulting curve is Deg. Standard_EXPORT AppDef_MyBSplGradientOfBSplineCompute(const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, math_Vector& Parameters, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const Standard_Integer Deg, const Standard_Real Tol3d, const Standard_Real Tol2d, const Standard_Integer NbIterations, const Standard_Real lambda1, const Standard_Real lambda2); + //! returns True if all has been correctly done. Standard_EXPORT Standard_Boolean IsDone() const; + //! returns all the BSpline curves approximating the + //! MultiLine SSP after minimization of the parameter. Standard_EXPORT AppParCurves_MultiBSpCurve Value() const; + //! returns the difference between the old and the new + //! approximation. + //! An exception is raised if NotDone. + //! An exception is raised if Index<1 or Index>NbParameters. Standard_EXPORT Standard_Real Error (const Standard_Integer Index) const; + //! returns the maximum difference between the old and the + //! new approximation. Standard_EXPORT Standard_Real MaxError3d() const; + //! returns the maximum difference between the old and the + //! new approximation. Standard_EXPORT Standard_Real MaxError2d() const; + //! returns the average error between the old and the + //! new approximation. Standard_EXPORT Standard_Real AverageError() const; diff --git a/src/AppDef/AppDef_MyGradientOfCompute.hxx b/src/AppDef/AppDef_MyGradientOfCompute.hxx index 9051722f6d..88815d6804 100644 --- a/src/AppDef/AppDef_MyGradientOfCompute.hxx +++ b/src/AppDef/AppDef_MyGradientOfCompute.hxx @@ -46,18 +46,37 @@ public: DEFINE_STANDARD_ALLOC + //! Tries to minimize the sum (square(||Qui - Bi*Pi||)) + //! where Pui describe the approximating Bezier curves'Poles + //! and Qi the MultiLine points with a parameter ui. + //! In this algorithm, the parameters ui are the unknowns. + //! The tolerance required on this sum is given by Tol. + //! The desired degree of the resulting curve is Deg. Standard_EXPORT AppDef_MyGradientOfCompute(const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, math_Vector& Parameters, const Standard_Integer Deg, const Standard_Real Tol3d, const Standard_Real Tol2d, const Standard_Integer NbIterations = 200); + //! returns True if all has been correctly done. Standard_EXPORT Standard_Boolean IsDone() const; + //! returns all the Bezier curves approximating the + //! MultiLine SSP after minimization of the parameter. Standard_EXPORT AppParCurves_MultiCurve Value() const; + //! returns the difference between the old and the new + //! approximation. + //! An exception is raised if NotDone. + //! An exception is raised if Index<1 or Index>NbParameters. Standard_EXPORT Standard_Real Error (const Standard_Integer Index) const; + //! returns the maximum difference between the old and the + //! new approximation. Standard_EXPORT Standard_Real MaxError3d() const; + //! returns the maximum difference between the old and the + //! new approximation. Standard_EXPORT Standard_Real MaxError2d() const; + //! returns the average error between the old and the + //! new approximation. Standard_EXPORT Standard_Real AverageError() const; diff --git a/src/AppDef/AppDef_MyGradientbisOfBSplineCompute.hxx b/src/AppDef/AppDef_MyGradientbisOfBSplineCompute.hxx index d4052518e0..2606608423 100644 --- a/src/AppDef/AppDef_MyGradientbisOfBSplineCompute.hxx +++ b/src/AppDef/AppDef_MyGradientbisOfBSplineCompute.hxx @@ -46,18 +46,37 @@ public: DEFINE_STANDARD_ALLOC + //! Tries to minimize the sum (square(||Qui - Bi*Pi||)) + //! where Pui describe the approximating Bezier curves'Poles + //! and Qi the MultiLine points with a parameter ui. + //! In this algorithm, the parameters ui are the unknowns. + //! The tolerance required on this sum is given by Tol. + //! The desired degree of the resulting curve is Deg. Standard_EXPORT AppDef_MyGradientbisOfBSplineCompute(const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, math_Vector& Parameters, const Standard_Integer Deg, const Standard_Real Tol3d, const Standard_Real Tol2d, const Standard_Integer NbIterations = 200); + //! returns True if all has been correctly done. Standard_EXPORT Standard_Boolean IsDone() const; + //! returns all the Bezier curves approximating the + //! MultiLine SSP after minimization of the parameter. Standard_EXPORT AppParCurves_MultiCurve Value() const; + //! returns the difference between the old and the new + //! approximation. + //! An exception is raised if NotDone. + //! An exception is raised if Index<1 or Index>NbParameters. Standard_EXPORT Standard_Real Error (const Standard_Integer Index) const; + //! returns the maximum difference between the old and the + //! new approximation. Standard_EXPORT Standard_Real MaxError3d() const; + //! returns the maximum difference between the old and the + //! new approximation. Standard_EXPORT Standard_Real MaxError2d() const; + //! returns the average error between the old and the + //! new approximation. Standard_EXPORT Standard_Real AverageError() const; diff --git a/src/AppDef/AppDef_ParFunctionOfMyGradientOfCompute.hxx b/src/AppDef/AppDef_ParFunctionOfMyGradientOfCompute.hxx index b557a4e2ed..4363971d9c 100644 --- a/src/AppDef/AppDef_ParFunctionOfMyGradientOfCompute.hxx +++ b/src/AppDef/AppDef_ParFunctionOfMyGradientOfCompute.hxx @@ -48,24 +48,45 @@ public: DEFINE_STANDARD_ALLOC + //! initializes the fields of the function. The approximating + //! curve has the desired degree Deg. Standard_EXPORT AppDef_ParFunctionOfMyGradientOfCompute(const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, const math_Vector& Parameters, const Standard_Integer Deg); + //! returns the number of variables of the function. It + //! corresponds to the number of MultiPoints. Standard_EXPORT Standard_Integer NbVariables() const; + //! this method computes the new approximation of the + //! MultiLine + //! SSP and calculates F = sum (||Pui - Bi*Pi||2) for each + //! point of the MultiLine. Standard_EXPORT Standard_Boolean Value (const math_Vector& X, Standard_Real& F); + //! returns the gradient G of the sum above for the + //! parameters Xi. Standard_EXPORT Standard_Boolean Gradient (const math_Vector& X, math_Vector& G); + //! returns the value F=sum(||Pui - Bi*Pi||)2. + //! returns the value G = grad(F) for the parameters Xi. Standard_EXPORT Standard_Boolean Values (const math_Vector& X, Standard_Real& F, math_Vector& G); + //! returns the new parameters of the MultiLine. Standard_EXPORT const math_Vector& NewParameters() const; + //! returns the MultiCurve approximating the set after + //! computing the value F or Grad(F). Standard_EXPORT const AppParCurves_MultiCurve& CurveValue(); + //! returns the distance between the MultiPoint of range + //! IPoint and the curve CurveIndex. Standard_EXPORT Standard_Real Error (const Standard_Integer IPoint, const Standard_Integer CurveIndex) const; + //! returns the maximum distance between the points + //! and the MultiCurve. Standard_EXPORT Standard_Real MaxError3d() const; + //! returns the maximum distance between the points + //! and the MultiCurve. Standard_EXPORT Standard_Real MaxError2d() const; Standard_EXPORT AppParCurves_Constraint FirstConstraint (const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, const Standard_Integer FirstPoint) const; @@ -78,6 +99,8 @@ public: protected: + //! this method is used each time Value or Gradient is + //! needed. Standard_EXPORT void Perform (const math_Vector& X); diff --git a/src/AppDef/AppDef_ParFunctionOfMyGradientbisOfBSplineCompute.hxx b/src/AppDef/AppDef_ParFunctionOfMyGradientbisOfBSplineCompute.hxx index 8fed57ee99..5a7686b611 100644 --- a/src/AppDef/AppDef_ParFunctionOfMyGradientbisOfBSplineCompute.hxx +++ b/src/AppDef/AppDef_ParFunctionOfMyGradientbisOfBSplineCompute.hxx @@ -48,24 +48,45 @@ public: DEFINE_STANDARD_ALLOC + //! initializes the fields of the function. The approximating + //! curve has the desired degree Deg. Standard_EXPORT AppDef_ParFunctionOfMyGradientbisOfBSplineCompute(const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, const math_Vector& Parameters, const Standard_Integer Deg); + //! returns the number of variables of the function. It + //! corresponds to the number of MultiPoints. Standard_EXPORT Standard_Integer NbVariables() const; + //! this method computes the new approximation of the + //! MultiLine + //! SSP and calculates F = sum (||Pui - Bi*Pi||2) for each + //! point of the MultiLine. Standard_EXPORT Standard_Boolean Value (const math_Vector& X, Standard_Real& F); + //! returns the gradient G of the sum above for the + //! parameters Xi. Standard_EXPORT Standard_Boolean Gradient (const math_Vector& X, math_Vector& G); + //! returns the value F=sum(||Pui - Bi*Pi||)2. + //! returns the value G = grad(F) for the parameters Xi. Standard_EXPORT Standard_Boolean Values (const math_Vector& X, Standard_Real& F, math_Vector& G); + //! returns the new parameters of the MultiLine. Standard_EXPORT const math_Vector& NewParameters() const; + //! returns the MultiCurve approximating the set after + //! computing the value F or Grad(F). Standard_EXPORT const AppParCurves_MultiCurve& CurveValue(); + //! returns the distance between the MultiPoint of range + //! IPoint and the curve CurveIndex. Standard_EXPORT Standard_Real Error (const Standard_Integer IPoint, const Standard_Integer CurveIndex) const; + //! returns the maximum distance between the points + //! and the MultiCurve. Standard_EXPORT Standard_Real MaxError3d() const; + //! returns the maximum distance between the points + //! and the MultiCurve. Standard_EXPORT Standard_Real MaxError2d() const; Standard_EXPORT AppParCurves_Constraint FirstConstraint (const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, const Standard_Integer FirstPoint) const; @@ -78,6 +99,8 @@ public: protected: + //! this method is used each time Value or Gradient is + //! needed. Standard_EXPORT void Perform (const math_Vector& X); diff --git a/src/AppDef/AppDef_ParFunctionOfTheGradient.hxx b/src/AppDef/AppDef_ParFunctionOfTheGradient.hxx index c697ff1870..1c732a84eb 100644 --- a/src/AppDef/AppDef_ParFunctionOfTheGradient.hxx +++ b/src/AppDef/AppDef_ParFunctionOfTheGradient.hxx @@ -48,24 +48,45 @@ public: DEFINE_STANDARD_ALLOC + //! initializes the fields of the function. The approximating + //! curve has the desired degree Deg. Standard_EXPORT AppDef_ParFunctionOfTheGradient(const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, const math_Vector& Parameters, const Standard_Integer Deg); + //! returns the number of variables of the function. It + //! corresponds to the number of MultiPoints. Standard_EXPORT Standard_Integer NbVariables() const; + //! this method computes the new approximation of the + //! MultiLine + //! SSP and calculates F = sum (||Pui - Bi*Pi||2) for each + //! point of the MultiLine. Standard_EXPORT Standard_Boolean Value (const math_Vector& X, Standard_Real& F); + //! returns the gradient G of the sum above for the + //! parameters Xi. Standard_EXPORT Standard_Boolean Gradient (const math_Vector& X, math_Vector& G); + //! returns the value F=sum(||Pui - Bi*Pi||)2. + //! returns the value G = grad(F) for the parameters Xi. Standard_EXPORT Standard_Boolean Values (const math_Vector& X, Standard_Real& F, math_Vector& G); + //! returns the new parameters of the MultiLine. Standard_EXPORT const math_Vector& NewParameters() const; + //! returns the MultiCurve approximating the set after + //! computing the value F or Grad(F). Standard_EXPORT const AppParCurves_MultiCurve& CurveValue(); + //! returns the distance between the MultiPoint of range + //! IPoint and the curve CurveIndex. Standard_EXPORT Standard_Real Error (const Standard_Integer IPoint, const Standard_Integer CurveIndex) const; + //! returns the maximum distance between the points + //! and the MultiCurve. Standard_EXPORT Standard_Real MaxError3d() const; + //! returns the maximum distance between the points + //! and the MultiCurve. Standard_EXPORT Standard_Real MaxError2d() const; Standard_EXPORT AppParCurves_Constraint FirstConstraint (const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, const Standard_Integer FirstPoint) const; @@ -78,6 +99,8 @@ public: protected: + //! this method is used each time Value or Gradient is + //! needed. Standard_EXPORT void Perform (const math_Vector& X); diff --git a/src/AppDef/AppDef_ParLeastSquareOfMyGradientOfCompute.hxx b/src/AppDef/AppDef_ParLeastSquareOfMyGradientOfCompute.hxx index b26db72965..2841640d69 100644 --- a/src/AppDef/AppDef_ParLeastSquareOfMyGradientOfCompute.hxx +++ b/src/AppDef/AppDef_ParLeastSquareOfMyGradientOfCompute.hxx @@ -52,46 +52,120 @@ public: DEFINE_STANDARD_ALLOC + //! given a MultiLine, this algorithm computes the least + //! square resolution using the Householder-QR method. + //! If the first and/or the last point is a constraint + //! point, the value of the tangency or curvature is + //! computed in the resolution. + //! NbPol is the number of control points wanted + //! for the approximating curves. + //! The system to solve is the following: + //! A X = B. + //! Where A is the Bernstein matrix computed with the + //! parameters, B the points coordinates and X the poles + //! solutions. + //! The matrix A is the same for each coordinate x, y and z + //! and is also the same for each MultiLine point because + //! they are approximated in parallel(so with the same + //! parameter, only the vector B changes). Standard_EXPORT AppDef_ParLeastSquareOfMyGradientOfCompute(const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const AppParCurves_Constraint FirstCons, const AppParCurves_Constraint LastCons, const math_Vector& Parameters, const Standard_Integer NbPol); + //! Initializes the fields of the object. Standard_EXPORT AppDef_ParLeastSquareOfMyGradientOfCompute(const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const AppParCurves_Constraint FirstCons, const AppParCurves_Constraint LastCons, const Standard_Integer NbPol); + //! given a MultiLine, this algorithm computes the least + //! square resolution using the Householder-QR method. + //! If the first and/or the last point is a constraint + //! point, the value of the tangency or curvature is + //! computed in the resolution. + //! Deg is the degree wanted for the approximating curves. + //! The system to solve is the following: + //! A X = B. + //! Where A is the BSpline functions matrix computed with + //! , B the points coordinates and X the poles + //! solutions. + //! The matrix A is the same for each coordinate x, y and z + //! and is also the same for each MultiLine point because + //! they are approximated in parallel(so with the same + //! parameter, only the vector B changes). Standard_EXPORT AppDef_ParLeastSquareOfMyGradientOfCompute(const AppDef_MultiLine& SSP, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const AppParCurves_Constraint FirstCons, const AppParCurves_Constraint LastCons, const math_Vector& Parameters, const Standard_Integer NbPol); + //! Initializes the fields of the object. Standard_EXPORT AppDef_ParLeastSquareOfMyGradientOfCompute(const AppDef_MultiLine& SSP, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const AppParCurves_Constraint FirstCons, const AppParCurves_Constraint LastCons, const Standard_Integer NbPol); + //! Is used after having initialized the fields. + //! The case "CurvaturePoint" is not treated in this method. Standard_EXPORT void Perform (const math_Vector& Parameters); + //! Is used after having initialized the fields. Standard_EXPORT void Perform (const math_Vector& Parameters, const Standard_Real l1, const Standard_Real l2); + //! Is used after having initialized the fields. + //! is the tangent vector at the first point. + //! is the tangent vector at the last point. Standard_EXPORT void Perform (const math_Vector& Parameters, const math_Vector& V1t, const math_Vector& V2t, const Standard_Real l1, const Standard_Real l2); + //! Is used after having initialized the fields. + //! is the tangent vector at the first point. + //! is the tangent vector at the last point. + //! is the tangent vector at the first point. + //! is the tangent vector at the last point. Standard_EXPORT void Perform (const math_Vector& Parameters, const math_Vector& V1t, const math_Vector& V2t, const math_Vector& V1c, const math_Vector& V2c, const Standard_Real l1, const Standard_Real l2); + //! returns True if all has been correctly done. Standard_EXPORT Standard_Boolean IsDone() const; + //! returns the result of the approximation, i.e. all the + //! Curves. + //! An exception is raised if NotDone. Standard_EXPORT AppParCurves_MultiCurve BezierValue(); + //! returns the result of the approximation, i.e. all the + //! Curves. + //! An exception is raised if NotDone. Standard_EXPORT const AppParCurves_MultiBSpCurve& BSplineValue(); + //! returns the function matrix used to approximate the + //! set. Standard_EXPORT const math_Matrix& FunctionMatrix() const; + //! returns the derivative function matrix used + //! to approximate the set. Standard_EXPORT const math_Matrix& DerivativeFunctionMatrix() const; + //! returns the maximum errors between the MultiLine + //! and the approximation curves. F is the sum of the square + //! distances. Grad is the derivative vector of the + //! function F. Standard_EXPORT void ErrorGradient (math_Vector& Grad, Standard_Real& F, Standard_Real& MaxE3d, Standard_Real& MaxE2d); + //! returns the distances between the points of the + //! multiline and the approximation curves. Standard_EXPORT const math_Matrix& Distance(); + //! returns the maximum errors between the MultiLine + //! and the approximation curves. F is the sum of the square + //! distances. Standard_EXPORT void Error (Standard_Real& F, Standard_Real& MaxE3d, Standard_Real& MaxE2d); + //! returns the value (P2 - P1)/ V1 if the first point + //! was a tangency point. Standard_EXPORT Standard_Real FirstLambda() const; + //! returns the value (PN - PN-1)/ VN if the last point + //! was a tangency point. Standard_EXPORT Standard_Real LastLambda() const; + //! returns the matrix of points value. Standard_EXPORT const math_Matrix& Points() const; + //! returns the matrix of resulting control points value. Standard_EXPORT const math_Matrix& Poles() const; + //! Returns the indexes of the first non null values of + //! A and DA. + //! The values are non null from Index(ieme point) +1 + //! to Index(ieme point) + degree +1. Standard_EXPORT const math_IntegerVector& KIndex() const; @@ -100,24 +174,33 @@ public: protected: + //! is used by the constuctors above. Standard_EXPORT void Init (const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint); + //! returns the number of second member columns. + //! Is used internally to initialize the fields. Standard_EXPORT Standard_Integer NbBColumns (const AppDef_MultiLine& SSP) const; + //! returns the first point beeing fitted. Standard_EXPORT Standard_Integer TheFirstPoint (const AppParCurves_Constraint FirstCons, const Standard_Integer FirstPoint) const; + //! returns the last point beeing fitted. Standard_EXPORT Standard_Integer TheLastPoint (const AppParCurves_Constraint LastCons, const Standard_Integer LastPoint) const; + //! Affects the fields in the case of a constraint point. Standard_EXPORT void Affect (const AppDef_MultiLine& SSP, const Standard_Integer Index, AppParCurves_Constraint& Cons, math_Vector& Vt, math_Vector& Vc); Standard_EXPORT void ComputeFunction (const math_Vector& Parameters); Standard_EXPORT void SearchIndex (math_IntegerVector& Index); + //! computes internal matrixes for the resolution Standard_EXPORT void MakeTAA (math_Vector& TheA, math_Vector& TheB); + //! computes internal matrixes for the resolution Standard_EXPORT void MakeTAA (math_Vector& TheA); + //! computes internal matrixes for the resolution Standard_EXPORT void MakeTAA (math_Vector& TheA, math_Matrix& TheB); diff --git a/src/AppDef/AppDef_ParLeastSquareOfMyGradientbisOfBSplineCompute.hxx b/src/AppDef/AppDef_ParLeastSquareOfMyGradientbisOfBSplineCompute.hxx index 3faee51fa5..699914e2ef 100644 --- a/src/AppDef/AppDef_ParLeastSquareOfMyGradientbisOfBSplineCompute.hxx +++ b/src/AppDef/AppDef_ParLeastSquareOfMyGradientbisOfBSplineCompute.hxx @@ -52,46 +52,120 @@ public: DEFINE_STANDARD_ALLOC + //! given a MultiLine, this algorithm computes the least + //! square resolution using the Householder-QR method. + //! If the first and/or the last point is a constraint + //! point, the value of the tangency or curvature is + //! computed in the resolution. + //! NbPol is the number of control points wanted + //! for the approximating curves. + //! The system to solve is the following: + //! A X = B. + //! Where A is the Bernstein matrix computed with the + //! parameters, B the points coordinates and X the poles + //! solutions. + //! The matrix A is the same for each coordinate x, y and z + //! and is also the same for each MultiLine point because + //! they are approximated in parallel(so with the same + //! parameter, only the vector B changes). Standard_EXPORT AppDef_ParLeastSquareOfMyGradientbisOfBSplineCompute(const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const AppParCurves_Constraint FirstCons, const AppParCurves_Constraint LastCons, const math_Vector& Parameters, const Standard_Integer NbPol); + //! Initializes the fields of the object. Standard_EXPORT AppDef_ParLeastSquareOfMyGradientbisOfBSplineCompute(const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const AppParCurves_Constraint FirstCons, const AppParCurves_Constraint LastCons, const Standard_Integer NbPol); + //! given a MultiLine, this algorithm computes the least + //! square resolution using the Householder-QR method. + //! If the first and/or the last point is a constraint + //! point, the value of the tangency or curvature is + //! computed in the resolution. + //! Deg is the degree wanted for the approximating curves. + //! The system to solve is the following: + //! A X = B. + //! Where A is the BSpline functions matrix computed with + //! , B the points coordinates and X the poles + //! solutions. + //! The matrix A is the same for each coordinate x, y and z + //! and is also the same for each MultiLine point because + //! they are approximated in parallel(so with the same + //! parameter, only the vector B changes). Standard_EXPORT AppDef_ParLeastSquareOfMyGradientbisOfBSplineCompute(const AppDef_MultiLine& SSP, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const AppParCurves_Constraint FirstCons, const AppParCurves_Constraint LastCons, const math_Vector& Parameters, const Standard_Integer NbPol); + //! Initializes the fields of the object. Standard_EXPORT AppDef_ParLeastSquareOfMyGradientbisOfBSplineCompute(const AppDef_MultiLine& SSP, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const AppParCurves_Constraint FirstCons, const AppParCurves_Constraint LastCons, const Standard_Integer NbPol); + //! Is used after having initialized the fields. + //! The case "CurvaturePoint" is not treated in this method. Standard_EXPORT void Perform (const math_Vector& Parameters); + //! Is used after having initialized the fields. Standard_EXPORT void Perform (const math_Vector& Parameters, const Standard_Real l1, const Standard_Real l2); + //! Is used after having initialized the fields. + //! is the tangent vector at the first point. + //! is the tangent vector at the last point. Standard_EXPORT void Perform (const math_Vector& Parameters, const math_Vector& V1t, const math_Vector& V2t, const Standard_Real l1, const Standard_Real l2); + //! Is used after having initialized the fields. + //! is the tangent vector at the first point. + //! is the tangent vector at the last point. + //! is the tangent vector at the first point. + //! is the tangent vector at the last point. Standard_EXPORT void Perform (const math_Vector& Parameters, const math_Vector& V1t, const math_Vector& V2t, const math_Vector& V1c, const math_Vector& V2c, const Standard_Real l1, const Standard_Real l2); + //! returns True if all has been correctly done. Standard_EXPORT Standard_Boolean IsDone() const; + //! returns the result of the approximation, i.e. all the + //! Curves. + //! An exception is raised if NotDone. Standard_EXPORT AppParCurves_MultiCurve BezierValue(); + //! returns the result of the approximation, i.e. all the + //! Curves. + //! An exception is raised if NotDone. Standard_EXPORT const AppParCurves_MultiBSpCurve& BSplineValue(); + //! returns the function matrix used to approximate the + //! set. Standard_EXPORT const math_Matrix& FunctionMatrix() const; + //! returns the derivative function matrix used + //! to approximate the set. Standard_EXPORT const math_Matrix& DerivativeFunctionMatrix() const; + //! returns the maximum errors between the MultiLine + //! and the approximation curves. F is the sum of the square + //! distances. Grad is the derivative vector of the + //! function F. Standard_EXPORT void ErrorGradient (math_Vector& Grad, Standard_Real& F, Standard_Real& MaxE3d, Standard_Real& MaxE2d); + //! returns the distances between the points of the + //! multiline and the approximation curves. Standard_EXPORT const math_Matrix& Distance(); + //! returns the maximum errors between the MultiLine + //! and the approximation curves. F is the sum of the square + //! distances. Standard_EXPORT void Error (Standard_Real& F, Standard_Real& MaxE3d, Standard_Real& MaxE2d); + //! returns the value (P2 - P1)/ V1 if the first point + //! was a tangency point. Standard_EXPORT Standard_Real FirstLambda() const; + //! returns the value (PN - PN-1)/ VN if the last point + //! was a tangency point. Standard_EXPORT Standard_Real LastLambda() const; + //! returns the matrix of points value. Standard_EXPORT const math_Matrix& Points() const; + //! returns the matrix of resulting control points value. Standard_EXPORT const math_Matrix& Poles() const; + //! Returns the indexes of the first non null values of + //! A and DA. + //! The values are non null from Index(ieme point) +1 + //! to Index(ieme point) + degree +1. Standard_EXPORT const math_IntegerVector& KIndex() const; @@ -100,24 +174,33 @@ public: protected: + //! is used by the constuctors above. Standard_EXPORT void Init (const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint); + //! returns the number of second member columns. + //! Is used internally to initialize the fields. Standard_EXPORT Standard_Integer NbBColumns (const AppDef_MultiLine& SSP) const; + //! returns the first point beeing fitted. Standard_EXPORT Standard_Integer TheFirstPoint (const AppParCurves_Constraint FirstCons, const Standard_Integer FirstPoint) const; + //! returns the last point beeing fitted. Standard_EXPORT Standard_Integer TheLastPoint (const AppParCurves_Constraint LastCons, const Standard_Integer LastPoint) const; + //! Affects the fields in the case of a constraint point. Standard_EXPORT void Affect (const AppDef_MultiLine& SSP, const Standard_Integer Index, AppParCurves_Constraint& Cons, math_Vector& Vt, math_Vector& Vc); Standard_EXPORT void ComputeFunction (const math_Vector& Parameters); Standard_EXPORT void SearchIndex (math_IntegerVector& Index); + //! computes internal matrixes for the resolution Standard_EXPORT void MakeTAA (math_Vector& TheA, math_Vector& TheB); + //! computes internal matrixes for the resolution Standard_EXPORT void MakeTAA (math_Vector& TheA); + //! computes internal matrixes for the resolution Standard_EXPORT void MakeTAA (math_Vector& TheA, math_Matrix& TheB); diff --git a/src/AppDef/AppDef_ParLeastSquareOfTheGradient.hxx b/src/AppDef/AppDef_ParLeastSquareOfTheGradient.hxx index 6b142dd963..fe92cd376f 100644 --- a/src/AppDef/AppDef_ParLeastSquareOfTheGradient.hxx +++ b/src/AppDef/AppDef_ParLeastSquareOfTheGradient.hxx @@ -52,46 +52,120 @@ public: DEFINE_STANDARD_ALLOC + //! given a MultiLine, this algorithm computes the least + //! square resolution using the Householder-QR method. + //! If the first and/or the last point is a constraint + //! point, the value of the tangency or curvature is + //! computed in the resolution. + //! NbPol is the number of control points wanted + //! for the approximating curves. + //! The system to solve is the following: + //! A X = B. + //! Where A is the Bernstein matrix computed with the + //! parameters, B the points coordinates and X the poles + //! solutions. + //! The matrix A is the same for each coordinate x, y and z + //! and is also the same for each MultiLine point because + //! they are approximated in parallel(so with the same + //! parameter, only the vector B changes). Standard_EXPORT AppDef_ParLeastSquareOfTheGradient(const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const AppParCurves_Constraint FirstCons, const AppParCurves_Constraint LastCons, const math_Vector& Parameters, const Standard_Integer NbPol); + //! Initializes the fields of the object. Standard_EXPORT AppDef_ParLeastSquareOfTheGradient(const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const AppParCurves_Constraint FirstCons, const AppParCurves_Constraint LastCons, const Standard_Integer NbPol); + //! given a MultiLine, this algorithm computes the least + //! square resolution using the Householder-QR method. + //! If the first and/or the last point is a constraint + //! point, the value of the tangency or curvature is + //! computed in the resolution. + //! Deg is the degree wanted for the approximating curves. + //! The system to solve is the following: + //! A X = B. + //! Where A is the BSpline functions matrix computed with + //! , B the points coordinates and X the poles + //! solutions. + //! The matrix A is the same for each coordinate x, y and z + //! and is also the same for each MultiLine point because + //! they are approximated in parallel(so with the same + //! parameter, only the vector B changes). Standard_EXPORT AppDef_ParLeastSquareOfTheGradient(const AppDef_MultiLine& SSP, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const AppParCurves_Constraint FirstCons, const AppParCurves_Constraint LastCons, const math_Vector& Parameters, const Standard_Integer NbPol); + //! Initializes the fields of the object. Standard_EXPORT AppDef_ParLeastSquareOfTheGradient(const AppDef_MultiLine& SSP, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const AppParCurves_Constraint FirstCons, const AppParCurves_Constraint LastCons, const Standard_Integer NbPol); + //! Is used after having initialized the fields. + //! The case "CurvaturePoint" is not treated in this method. Standard_EXPORT void Perform (const math_Vector& Parameters); + //! Is used after having initialized the fields. Standard_EXPORT void Perform (const math_Vector& Parameters, const Standard_Real l1, const Standard_Real l2); + //! Is used after having initialized the fields. + //! is the tangent vector at the first point. + //! is the tangent vector at the last point. Standard_EXPORT void Perform (const math_Vector& Parameters, const math_Vector& V1t, const math_Vector& V2t, const Standard_Real l1, const Standard_Real l2); + //! Is used after having initialized the fields. + //! is the tangent vector at the first point. + //! is the tangent vector at the last point. + //! is the tangent vector at the first point. + //! is the tangent vector at the last point. Standard_EXPORT void Perform (const math_Vector& Parameters, const math_Vector& V1t, const math_Vector& V2t, const math_Vector& V1c, const math_Vector& V2c, const Standard_Real l1, const Standard_Real l2); + //! returns True if all has been correctly done. Standard_EXPORT Standard_Boolean IsDone() const; + //! returns the result of the approximation, i.e. all the + //! Curves. + //! An exception is raised if NotDone. Standard_EXPORT AppParCurves_MultiCurve BezierValue(); + //! returns the result of the approximation, i.e. all the + //! Curves. + //! An exception is raised if NotDone. Standard_EXPORT const AppParCurves_MultiBSpCurve& BSplineValue(); + //! returns the function matrix used to approximate the + //! set. Standard_EXPORT const math_Matrix& FunctionMatrix() const; + //! returns the derivative function matrix used + //! to approximate the set. Standard_EXPORT const math_Matrix& DerivativeFunctionMatrix() const; + //! returns the maximum errors between the MultiLine + //! and the approximation curves. F is the sum of the square + //! distances. Grad is the derivative vector of the + //! function F. Standard_EXPORT void ErrorGradient (math_Vector& Grad, Standard_Real& F, Standard_Real& MaxE3d, Standard_Real& MaxE2d); + //! returns the distances between the points of the + //! multiline and the approximation curves. Standard_EXPORT const math_Matrix& Distance(); + //! returns the maximum errors between the MultiLine + //! and the approximation curves. F is the sum of the square + //! distances. Standard_EXPORT void Error (Standard_Real& F, Standard_Real& MaxE3d, Standard_Real& MaxE2d); + //! returns the value (P2 - P1)/ V1 if the first point + //! was a tangency point. Standard_EXPORT Standard_Real FirstLambda() const; + //! returns the value (PN - PN-1)/ VN if the last point + //! was a tangency point. Standard_EXPORT Standard_Real LastLambda() const; + //! returns the matrix of points value. Standard_EXPORT const math_Matrix& Points() const; + //! returns the matrix of resulting control points value. Standard_EXPORT const math_Matrix& Poles() const; + //! Returns the indexes of the first non null values of + //! A and DA. + //! The values are non null from Index(ieme point) +1 + //! to Index(ieme point) + degree +1. Standard_EXPORT const math_IntegerVector& KIndex() const; @@ -100,24 +174,33 @@ public: protected: + //! is used by the constuctors above. Standard_EXPORT void Init (const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint); + //! returns the number of second member columns. + //! Is used internally to initialize the fields. Standard_EXPORT Standard_Integer NbBColumns (const AppDef_MultiLine& SSP) const; + //! returns the first point beeing fitted. Standard_EXPORT Standard_Integer TheFirstPoint (const AppParCurves_Constraint FirstCons, const Standard_Integer FirstPoint) const; + //! returns the last point beeing fitted. Standard_EXPORT Standard_Integer TheLastPoint (const AppParCurves_Constraint LastCons, const Standard_Integer LastPoint) const; + //! Affects the fields in the case of a constraint point. Standard_EXPORT void Affect (const AppDef_MultiLine& SSP, const Standard_Integer Index, AppParCurves_Constraint& Cons, math_Vector& Vt, math_Vector& Vc); Standard_EXPORT void ComputeFunction (const math_Vector& Parameters); Standard_EXPORT void SearchIndex (math_IntegerVector& Index); + //! computes internal matrixes for the resolution Standard_EXPORT void MakeTAA (math_Vector& TheA, math_Vector& TheB); + //! computes internal matrixes for the resolution Standard_EXPORT void MakeTAA (math_Vector& TheA); + //! computes internal matrixes for the resolution Standard_EXPORT void MakeTAA (math_Vector& TheA, math_Matrix& TheB); diff --git a/src/AppDef/AppDef_ResConstraintOfMyGradientOfCompute.hxx b/src/AppDef/AppDef_ResConstraintOfMyGradientOfCompute.hxx index 10f1b6b582..1746bb4c3b 100644 --- a/src/AppDef/AppDef_ResConstraintOfMyGradientOfCompute.hxx +++ b/src/AppDef/AppDef_ResConstraintOfMyGradientOfCompute.hxx @@ -43,18 +43,35 @@ public: DEFINE_STANDARD_ALLOC + //! Given a MultiLine SSP with constraints points, this + //! algorithm finds the best curve solution to approximate it. + //! The poles from SCurv issued for example from the least + //! squares are used as a guess solution for the uzawa + //! algorithm. The tolerance used in the Uzawa algorithms + //! is Tolerance. + //! A is the Bernstein matrix associated to the MultiLine + //! and DA is the derivative bernstein matrix.(They can come + //! from an approximation with ParLeastSquare.) + //! The MultiCurve is modified. New MultiPoles are given. Standard_EXPORT AppDef_ResConstraintOfMyGradientOfCompute(const AppDef_MultiLine& SSP, AppParCurves_MultiCurve& SCurv, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& Constraints, const math_Matrix& Bern, const math_Matrix& DerivativeBern, const Standard_Real Tolerance = 1.0e-10); + //! returns True if all has been correctly done. Standard_EXPORT Standard_Boolean IsDone() const; + //! returns the maximum difference value between the curve + //! and the given points. Standard_EXPORT Standard_Real Error() const; Standard_EXPORT const math_Matrix& ConstraintMatrix() const; + //! returns the duale variables of the system. Standard_EXPORT const math_Vector& Duale() const; + //! Returns the derivative of the constraint matrix. Standard_EXPORT const math_Matrix& ConstraintDerivative (const AppDef_MultiLine& SSP, const math_Vector& Parameters, const Standard_Integer Deg, const math_Matrix& DA); + //! returns the Inverse of Cont*Transposed(Cont), where + //! Cont is the constraint matrix for the algorithm. Standard_EXPORT const math_Matrix& InverseMatrix() const; @@ -63,8 +80,10 @@ public: protected: + //! is used internally to create the fields. Standard_EXPORT Standard_Integer NbConstraints (const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints) const; + //! is internally used for the fields creation. Standard_EXPORT Standard_Integer NbColumns (const AppDef_MultiLine& SSP, const Standard_Integer Deg) const; diff --git a/src/AppDef/AppDef_ResConstraintOfMyGradientbisOfBSplineCompute.hxx b/src/AppDef/AppDef_ResConstraintOfMyGradientbisOfBSplineCompute.hxx index c7e8d87d10..064a5efc99 100644 --- a/src/AppDef/AppDef_ResConstraintOfMyGradientbisOfBSplineCompute.hxx +++ b/src/AppDef/AppDef_ResConstraintOfMyGradientbisOfBSplineCompute.hxx @@ -43,18 +43,35 @@ public: DEFINE_STANDARD_ALLOC + //! Given a MultiLine SSP with constraints points, this + //! algorithm finds the best curve solution to approximate it. + //! The poles from SCurv issued for example from the least + //! squares are used as a guess solution for the uzawa + //! algorithm. The tolerance used in the Uzawa algorithms + //! is Tolerance. + //! A is the Bernstein matrix associated to the MultiLine + //! and DA is the derivative bernstein matrix.(They can come + //! from an approximation with ParLeastSquare.) + //! The MultiCurve is modified. New MultiPoles are given. Standard_EXPORT AppDef_ResConstraintOfMyGradientbisOfBSplineCompute(const AppDef_MultiLine& SSP, AppParCurves_MultiCurve& SCurv, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& Constraints, const math_Matrix& Bern, const math_Matrix& DerivativeBern, const Standard_Real Tolerance = 1.0e-10); + //! returns True if all has been correctly done. Standard_EXPORT Standard_Boolean IsDone() const; + //! returns the maximum difference value between the curve + //! and the given points. Standard_EXPORT Standard_Real Error() const; Standard_EXPORT const math_Matrix& ConstraintMatrix() const; + //! returns the duale variables of the system. Standard_EXPORT const math_Vector& Duale() const; + //! Returns the derivative of the constraint matrix. Standard_EXPORT const math_Matrix& ConstraintDerivative (const AppDef_MultiLine& SSP, const math_Vector& Parameters, const Standard_Integer Deg, const math_Matrix& DA); + //! returns the Inverse of Cont*Transposed(Cont), where + //! Cont is the constraint matrix for the algorithm. Standard_EXPORT const math_Matrix& InverseMatrix() const; @@ -63,8 +80,10 @@ public: protected: + //! is used internally to create the fields. Standard_EXPORT Standard_Integer NbConstraints (const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints) const; + //! is internally used for the fields creation. Standard_EXPORT Standard_Integer NbColumns (const AppDef_MultiLine& SSP, const Standard_Integer Deg) const; diff --git a/src/AppDef/AppDef_ResConstraintOfTheGradient.hxx b/src/AppDef/AppDef_ResConstraintOfTheGradient.hxx index 3d726a642f..67fef3b891 100644 --- a/src/AppDef/AppDef_ResConstraintOfTheGradient.hxx +++ b/src/AppDef/AppDef_ResConstraintOfTheGradient.hxx @@ -43,18 +43,35 @@ public: DEFINE_STANDARD_ALLOC + //! Given a MultiLine SSP with constraints points, this + //! algorithm finds the best curve solution to approximate it. + //! The poles from SCurv issued for example from the least + //! squares are used as a guess solution for the uzawa + //! algorithm. The tolerance used in the Uzawa algorithms + //! is Tolerance. + //! A is the Bernstein matrix associated to the MultiLine + //! and DA is the derivative bernstein matrix.(They can come + //! from an approximation with ParLeastSquare.) + //! The MultiCurve is modified. New MultiPoles are given. Standard_EXPORT AppDef_ResConstraintOfTheGradient(const AppDef_MultiLine& SSP, AppParCurves_MultiCurve& SCurv, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& Constraints, const math_Matrix& Bern, const math_Matrix& DerivativeBern, const Standard_Real Tolerance = 1.0e-10); + //! returns True if all has been correctly done. Standard_EXPORT Standard_Boolean IsDone() const; + //! returns the maximum difference value between the curve + //! and the given points. Standard_EXPORT Standard_Real Error() const; Standard_EXPORT const math_Matrix& ConstraintMatrix() const; + //! returns the duale variables of the system. Standard_EXPORT const math_Vector& Duale() const; + //! Returns the derivative of the constraint matrix. Standard_EXPORT const math_Matrix& ConstraintDerivative (const AppDef_MultiLine& SSP, const math_Vector& Parameters, const Standard_Integer Deg, const math_Matrix& DA); + //! returns the Inverse of Cont*Transposed(Cont), where + //! Cont is the constraint matrix for the algorithm. Standard_EXPORT const math_Matrix& InverseMatrix() const; @@ -63,8 +80,10 @@ public: protected: + //! is used internally to create the fields. Standard_EXPORT Standard_Integer NbConstraints (const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints) const; + //! is internally used for the fields creation. Standard_EXPORT Standard_Integer NbColumns (const AppDef_MultiLine& SSP, const Standard_Integer Deg) const; diff --git a/src/AppDef/AppDef_TheFunction.hxx b/src/AppDef/AppDef_TheFunction.hxx index 1d99c450f5..48c1284b62 100644 --- a/src/AppDef/AppDef_TheFunction.hxx +++ b/src/AppDef/AppDef_TheFunction.hxx @@ -48,24 +48,45 @@ public: DEFINE_STANDARD_ALLOC + //! initializes the fields of the function. The approximating + //! curve has the desired degree Deg. Standard_EXPORT AppDef_TheFunction(const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, const math_Vector& Parameters, const Standard_Integer Deg); + //! returns the number of variables of the function. It + //! corresponds to the number of MultiPoints. Standard_EXPORT Standard_Integer NbVariables() const; + //! this method computes the new approximation of the + //! MultiLine + //! SSP and calculates F = sum (||Pui - Bi*Pi||2) for each + //! point of the MultiLine. Standard_EXPORT Standard_Boolean Value (const math_Vector& X, Standard_Real& F); + //! returns the gradient G of the sum above for the + //! parameters Xi. Standard_EXPORT Standard_Boolean Gradient (const math_Vector& X, math_Vector& G); + //! returns the value F=sum(||Pui - Bi*Pi||)2. + //! returns the value G = grad(F) for the parameters Xi. Standard_EXPORT Standard_Boolean Values (const math_Vector& X, Standard_Real& F, math_Vector& G); + //! returns the new parameters of the MultiLine. Standard_EXPORT const math_Vector& NewParameters() const; + //! returns the MultiCurve approximating the set after + //! computing the value F or Grad(F). Standard_EXPORT const AppParCurves_MultiCurve& CurveValue(); + //! returns the distance between the MultiPoint of range + //! IPoint and the curve CurveIndex. Standard_EXPORT Standard_Real Error (const Standard_Integer IPoint, const Standard_Integer CurveIndex) const; + //! returns the maximum distance between the points + //! and the MultiCurve. Standard_EXPORT Standard_Real MaxError3d() const; + //! returns the maximum distance between the points + //! and the MultiCurve. Standard_EXPORT Standard_Real MaxError2d() const; Standard_EXPORT AppParCurves_Constraint FirstConstraint (const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, const Standard_Integer FirstPoint) const; @@ -78,6 +99,8 @@ public: protected: + //! this method is used each time Value or Gradient is + //! needed. Standard_EXPORT void Perform (const math_Vector& X); diff --git a/src/AppDef/AppDef_TheGradient.hxx b/src/AppDef/AppDef_TheGradient.hxx index 8406f5ba15..a7d2520eac 100644 --- a/src/AppDef/AppDef_TheGradient.hxx +++ b/src/AppDef/AppDef_TheGradient.hxx @@ -46,18 +46,37 @@ public: DEFINE_STANDARD_ALLOC + //! Tries to minimize the sum (square(||Qui - Bi*Pi||)) + //! where Pui describe the approximating Bezier curves'Poles + //! and Qi the MultiLine points with a parameter ui. + //! In this algorithm, the parameters ui are the unknowns. + //! The tolerance required on this sum is given by Tol. + //! The desired degree of the resulting curve is Deg. Standard_EXPORT AppDef_TheGradient(const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, math_Vector& Parameters, const Standard_Integer Deg, const Standard_Real Tol3d, const Standard_Real Tol2d, const Standard_Integer NbIterations = 200); + //! returns True if all has been correctly done. Standard_EXPORT Standard_Boolean IsDone() const; + //! returns all the Bezier curves approximating the + //! MultiLine SSP after minimization of the parameter. Standard_EXPORT AppParCurves_MultiCurve Value() const; + //! returns the difference between the old and the new + //! approximation. + //! An exception is raised if NotDone. + //! An exception is raised if Index<1 or Index>NbParameters. Standard_EXPORT Standard_Real Error (const Standard_Integer Index) const; + //! returns the maximum difference between the old and the + //! new approximation. Standard_EXPORT Standard_Real MaxError3d() const; + //! returns the maximum difference between the old and the + //! new approximation. Standard_EXPORT Standard_Real MaxError2d() const; + //! returns the average error between the old and the + //! new approximation. Standard_EXPORT Standard_Real AverageError() const; diff --git a/src/AppDef/AppDef_TheLeastSquares.hxx b/src/AppDef/AppDef_TheLeastSquares.hxx index 76b8b536f0..6791003fdb 100644 --- a/src/AppDef/AppDef_TheLeastSquares.hxx +++ b/src/AppDef/AppDef_TheLeastSquares.hxx @@ -52,46 +52,120 @@ public: DEFINE_STANDARD_ALLOC + //! given a MultiLine, this algorithm computes the least + //! square resolution using the Householder-QR method. + //! If the first and/or the last point is a constraint + //! point, the value of the tangency or curvature is + //! computed in the resolution. + //! NbPol is the number of control points wanted + //! for the approximating curves. + //! The system to solve is the following: + //! A X = B. + //! Where A is the Bernstein matrix computed with the + //! parameters, B the points coordinates and X the poles + //! solutions. + //! The matrix A is the same for each coordinate x, y and z + //! and is also the same for each MultiLine point because + //! they are approximated in parallel(so with the same + //! parameter, only the vector B changes). Standard_EXPORT AppDef_TheLeastSquares(const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const AppParCurves_Constraint FirstCons, const AppParCurves_Constraint LastCons, const math_Vector& Parameters, const Standard_Integer NbPol); + //! Initializes the fields of the object. Standard_EXPORT AppDef_TheLeastSquares(const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const AppParCurves_Constraint FirstCons, const AppParCurves_Constraint LastCons, const Standard_Integer NbPol); + //! given a MultiLine, this algorithm computes the least + //! square resolution using the Householder-QR method. + //! If the first and/or the last point is a constraint + //! point, the value of the tangency or curvature is + //! computed in the resolution. + //! Deg is the degree wanted for the approximating curves. + //! The system to solve is the following: + //! A X = B. + //! Where A is the BSpline functions matrix computed with + //! , B the points coordinates and X the poles + //! solutions. + //! The matrix A is the same for each coordinate x, y and z + //! and is also the same for each MultiLine point because + //! they are approximated in parallel(so with the same + //! parameter, only the vector B changes). Standard_EXPORT AppDef_TheLeastSquares(const AppDef_MultiLine& SSP, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const AppParCurves_Constraint FirstCons, const AppParCurves_Constraint LastCons, const math_Vector& Parameters, const Standard_Integer NbPol); + //! Initializes the fields of the object. Standard_EXPORT AppDef_TheLeastSquares(const AppDef_MultiLine& SSP, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const AppParCurves_Constraint FirstCons, const AppParCurves_Constraint LastCons, const Standard_Integer NbPol); + //! Is used after having initialized the fields. + //! The case "CurvaturePoint" is not treated in this method. Standard_EXPORT void Perform (const math_Vector& Parameters); + //! Is used after having initialized the fields. Standard_EXPORT void Perform (const math_Vector& Parameters, const Standard_Real l1, const Standard_Real l2); + //! Is used after having initialized the fields. + //! is the tangent vector at the first point. + //! is the tangent vector at the last point. Standard_EXPORT void Perform (const math_Vector& Parameters, const math_Vector& V1t, const math_Vector& V2t, const Standard_Real l1, const Standard_Real l2); + //! Is used after having initialized the fields. + //! is the tangent vector at the first point. + //! is the tangent vector at the last point. + //! is the tangent vector at the first point. + //! is the tangent vector at the last point. Standard_EXPORT void Perform (const math_Vector& Parameters, const math_Vector& V1t, const math_Vector& V2t, const math_Vector& V1c, const math_Vector& V2c, const Standard_Real l1, const Standard_Real l2); + //! returns True if all has been correctly done. Standard_EXPORT Standard_Boolean IsDone() const; + //! returns the result of the approximation, i.e. all the + //! Curves. + //! An exception is raised if NotDone. Standard_EXPORT AppParCurves_MultiCurve BezierValue(); + //! returns the result of the approximation, i.e. all the + //! Curves. + //! An exception is raised if NotDone. Standard_EXPORT const AppParCurves_MultiBSpCurve& BSplineValue(); + //! returns the function matrix used to approximate the + //! set. Standard_EXPORT const math_Matrix& FunctionMatrix() const; + //! returns the derivative function matrix used + //! to approximate the set. Standard_EXPORT const math_Matrix& DerivativeFunctionMatrix() const; + //! returns the maximum errors between the MultiLine + //! and the approximation curves. F is the sum of the square + //! distances. Grad is the derivative vector of the + //! function F. Standard_EXPORT void ErrorGradient (math_Vector& Grad, Standard_Real& F, Standard_Real& MaxE3d, Standard_Real& MaxE2d); + //! returns the distances between the points of the + //! multiline and the approximation curves. Standard_EXPORT const math_Matrix& Distance(); + //! returns the maximum errors between the MultiLine + //! and the approximation curves. F is the sum of the square + //! distances. Standard_EXPORT void Error (Standard_Real& F, Standard_Real& MaxE3d, Standard_Real& MaxE2d); + //! returns the value (P2 - P1)/ V1 if the first point + //! was a tangency point. Standard_EXPORT Standard_Real FirstLambda() const; + //! returns the value (PN - PN-1)/ VN if the last point + //! was a tangency point. Standard_EXPORT Standard_Real LastLambda() const; + //! returns the matrix of points value. Standard_EXPORT const math_Matrix& Points() const; + //! returns the matrix of resulting control points value. Standard_EXPORT const math_Matrix& Poles() const; + //! Returns the indexes of the first non null values of + //! A and DA. + //! The values are non null from Index(ieme point) +1 + //! to Index(ieme point) + degree +1. Standard_EXPORT const math_IntegerVector& KIndex() const; @@ -100,24 +174,33 @@ public: protected: + //! is used by the constuctors above. Standard_EXPORT void Init (const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint); + //! returns the number of second member columns. + //! Is used internally to initialize the fields. Standard_EXPORT Standard_Integer NbBColumns (const AppDef_MultiLine& SSP) const; + //! returns the first point beeing fitted. Standard_EXPORT Standard_Integer TheFirstPoint (const AppParCurves_Constraint FirstCons, const Standard_Integer FirstPoint) const; + //! returns the last point beeing fitted. Standard_EXPORT Standard_Integer TheLastPoint (const AppParCurves_Constraint LastCons, const Standard_Integer LastPoint) const; + //! Affects the fields in the case of a constraint point. Standard_EXPORT void Affect (const AppDef_MultiLine& SSP, const Standard_Integer Index, AppParCurves_Constraint& Cons, math_Vector& Vt, math_Vector& Vc); Standard_EXPORT void ComputeFunction (const math_Vector& Parameters); Standard_EXPORT void SearchIndex (math_IntegerVector& Index); + //! computes internal matrixes for the resolution Standard_EXPORT void MakeTAA (math_Vector& TheA, math_Vector& TheB); + //! computes internal matrixes for the resolution Standard_EXPORT void MakeTAA (math_Vector& TheA); + //! computes internal matrixes for the resolution Standard_EXPORT void MakeTAA (math_Vector& TheA, math_Matrix& TheB); diff --git a/src/AppDef/AppDef_TheResol.hxx b/src/AppDef/AppDef_TheResol.hxx index 996ac8601b..51f60bb1a8 100644 --- a/src/AppDef/AppDef_TheResol.hxx +++ b/src/AppDef/AppDef_TheResol.hxx @@ -43,18 +43,35 @@ public: DEFINE_STANDARD_ALLOC + //! Given a MultiLine SSP with constraints points, this + //! algorithm finds the best curve solution to approximate it. + //! The poles from SCurv issued for example from the least + //! squares are used as a guess solution for the uzawa + //! algorithm. The tolerance used in the Uzawa algorithms + //! is Tolerance. + //! A is the Bernstein matrix associated to the MultiLine + //! and DA is the derivative bernstein matrix.(They can come + //! from an approximation with ParLeastSquare.) + //! The MultiCurve is modified. New MultiPoles are given. Standard_EXPORT AppDef_TheResol(const AppDef_MultiLine& SSP, AppParCurves_MultiCurve& SCurv, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& Constraints, const math_Matrix& Bern, const math_Matrix& DerivativeBern, const Standard_Real Tolerance = 1.0e-10); + //! returns True if all has been correctly done. Standard_EXPORT Standard_Boolean IsDone() const; + //! returns the maximum difference value between the curve + //! and the given points. Standard_EXPORT Standard_Real Error() const; Standard_EXPORT const math_Matrix& ConstraintMatrix() const; + //! returns the duale variables of the system. Standard_EXPORT const math_Vector& Duale() const; + //! Returns the derivative of the constraint matrix. Standard_EXPORT const math_Matrix& ConstraintDerivative (const AppDef_MultiLine& SSP, const math_Vector& Parameters, const Standard_Integer Deg, const math_Matrix& DA); + //! returns the Inverse of Cont*Transposed(Cont), where + //! Cont is the constraint matrix for the algorithm. Standard_EXPORT const math_Matrix& InverseMatrix() const; @@ -63,8 +80,10 @@ public: protected: + //! is used internally to create the fields. Standard_EXPORT Standard_Integer NbConstraints (const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints) const; + //! is internally used for the fields creation. Standard_EXPORT Standard_Integer NbColumns (const AppDef_MultiLine& SSP, const Standard_Integer Deg) const; diff --git a/src/Approx/Approx_FitAndDivide.hxx b/src/Approx/Approx_FitAndDivide.hxx index 5751905678..81a55658b7 100644 --- a/src/Approx/Approx_FitAndDivide.hxx +++ b/src/Approx/Approx_FitAndDivide.hxx @@ -40,26 +40,43 @@ public: DEFINE_STANDARD_ALLOC + //! The MultiLine will be approximated until tolerances + //! will be reached. + //! The approximation will be done from degreemin to degreemax + //! with a cutting if the corresponding boolean is True. Standard_EXPORT Approx_FitAndDivide(const AppCont_Function& Line, const Standard_Integer degreemin = 3, const Standard_Integer degreemax = 8, const Standard_Real Tolerance3d = 1.0e-5, const Standard_Real Tolerance2d = 1.0e-5, const Standard_Boolean cutting = Standard_False, const AppParCurves_Constraint FirstC = AppParCurves_TangencyPoint, const AppParCurves_Constraint LastC = AppParCurves_TangencyPoint); + //! Initializes the fields of the algorithm. Standard_EXPORT Approx_FitAndDivide(const Standard_Integer degreemin = 3, const Standard_Integer degreemax = 8, const Standard_Real Tolerance3d = 1.0e-05, const Standard_Real Tolerance2d = 1.0e-05, const Standard_Boolean cutting = Standard_False, const AppParCurves_Constraint FirstC = AppParCurves_TangencyPoint, const AppParCurves_Constraint LastC = AppParCurves_TangencyPoint); + //! runs the algorithm after having initialized the fields. Standard_EXPORT void Perform (const AppCont_Function& Line); + //! changes the degrees of the approximation. Standard_EXPORT void SetDegrees (const Standard_Integer degreemin, const Standard_Integer degreemax); + //! Changes the tolerances of the approximation. Standard_EXPORT void SetTolerances (const Standard_Real Tolerance3d, const Standard_Real Tolerance2d); + //! Changes the constraints of the approximation. Standard_EXPORT void SetConstraints (const AppParCurves_Constraint FirstC, const AppParCurves_Constraint LastC); + //! returns False if at a moment of the approximation, + //! the status NoApproximation has been sent by the user + //! when more points were needed. Standard_EXPORT Standard_Boolean IsAllApproximated() const; + //! returns False if the status NoPointsAdded has been sent. Standard_EXPORT Standard_Boolean IsToleranceReached() const; + //! returns the tolerances 2d and 3d of the MultiCurve. Standard_EXPORT void Error (const Standard_Integer Index, Standard_Real& tol3d, Standard_Real& tol2d) const; + //! Returns the number of MultiCurve doing the approximation + //! of the MultiLine. Standard_EXPORT Standard_Integer NbMultiCurves() const; + //! returns the approximation MultiCurve of range . Standard_EXPORT AppParCurves_MultiCurve Value (const Standard_Integer Index = 1) const; Standard_EXPORT void Parameters (const Standard_Integer Index, Standard_Real& firstp, Standard_Real& lastp) const; @@ -76,6 +93,7 @@ protected: private: + //! is internally used by the algorithms. Standard_EXPORT Standard_Boolean Compute (const AppCont_Function& Line, const Standard_Real Ufirst, const Standard_Real Ulast, Standard_Real& TheTol3d, Standard_Real& TheTol2d); diff --git a/src/Approx/Approx_FitAndDivide2d.hxx b/src/Approx/Approx_FitAndDivide2d.hxx index 7d92659d70..646f45aba3 100644 --- a/src/Approx/Approx_FitAndDivide2d.hxx +++ b/src/Approx/Approx_FitAndDivide2d.hxx @@ -40,26 +40,43 @@ public: DEFINE_STANDARD_ALLOC + //! The MultiLine will be approximated until tolerances + //! will be reached. + //! The approximation will be done from degreemin to degreemax + //! with a cutting if the corresponding boolean is True. Standard_EXPORT Approx_FitAndDivide2d(const AppCont_Function& Line, const Standard_Integer degreemin = 3, const Standard_Integer degreemax = 8, const Standard_Real Tolerance3d = 1.0e-5, const Standard_Real Tolerance2d = 1.0e-5, const Standard_Boolean cutting = Standard_False, const AppParCurves_Constraint FirstC = AppParCurves_TangencyPoint, const AppParCurves_Constraint LastC = AppParCurves_TangencyPoint); + //! Initializes the fields of the algorithm. Standard_EXPORT Approx_FitAndDivide2d(const Standard_Integer degreemin = 3, const Standard_Integer degreemax = 8, const Standard_Real Tolerance3d = 1.0e-05, const Standard_Real Tolerance2d = 1.0e-05, const Standard_Boolean cutting = Standard_False, const AppParCurves_Constraint FirstC = AppParCurves_TangencyPoint, const AppParCurves_Constraint LastC = AppParCurves_TangencyPoint); + //! runs the algorithm after having initialized the fields. Standard_EXPORT void Perform (const AppCont_Function& Line); + //! changes the degrees of the approximation. Standard_EXPORT void SetDegrees (const Standard_Integer degreemin, const Standard_Integer degreemax); + //! Changes the tolerances of the approximation. Standard_EXPORT void SetTolerances (const Standard_Real Tolerance3d, const Standard_Real Tolerance2d); + //! Changes the constraints of the approximation. Standard_EXPORT void SetConstraints (const AppParCurves_Constraint FirstC, const AppParCurves_Constraint LastC); + //! returns False if at a moment of the approximation, + //! the status NoApproximation has been sent by the user + //! when more points were needed. Standard_EXPORT Standard_Boolean IsAllApproximated() const; + //! returns False if the status NoPointsAdded has been sent. Standard_EXPORT Standard_Boolean IsToleranceReached() const; + //! returns the tolerances 2d and 3d of the MultiCurve. Standard_EXPORT void Error (const Standard_Integer Index, Standard_Real& tol3d, Standard_Real& tol2d) const; + //! Returns the number of MultiCurve doing the approximation + //! of the MultiLine. Standard_EXPORT Standard_Integer NbMultiCurves() const; + //! returns the approximation MultiCurve of range . Standard_EXPORT AppParCurves_MultiCurve Value (const Standard_Integer Index = 1) const; Standard_EXPORT void Parameters (const Standard_Integer Index, Standard_Real& firstp, Standard_Real& lastp) const; @@ -76,6 +93,7 @@ protected: private: + //! is internally used by the algorithms. Standard_EXPORT Standard_Boolean Compute (const AppCont_Function& Line, const Standard_Real Ufirst, const Standard_Real Ulast, Standard_Real& TheTol3d, Standard_Real& TheTol2d); diff --git a/src/BRepAdaptor/BRepAdaptor_HCompCurve.hxx b/src/BRepAdaptor/BRepAdaptor_HCompCurve.hxx index 271a374895..b584ad49d0 100644 --- a/src/BRepAdaptor/BRepAdaptor_HCompCurve.hxx +++ b/src/BRepAdaptor/BRepAdaptor_HCompCurve.hxx @@ -39,16 +39,24 @@ class BRepAdaptor_HCompCurve : public Adaptor3d_HCurve public: + //! Creates an empty GenHCurve. Standard_EXPORT BRepAdaptor_HCompCurve(); + //! Creates a GenHCurve from a Curve Standard_EXPORT BRepAdaptor_HCompCurve(const BRepAdaptor_CompCurve& C); + //! Sets the field of the GenHCurve. Standard_EXPORT void Set (const BRepAdaptor_CompCurve& C); + //! Returns the curve used to create the GenHCurve. + //! This is redefined from HCurve, cannot be inline. Standard_EXPORT const Adaptor3d_Curve& Curve() const; + //! Returns the curve used to create the GenHCurve. + //! This is redefined from HCurve, cannot be inline. Standard_EXPORT Adaptor3d_Curve& GetCurve(); + //! Returns the curve used to create the GenHCurve. BRepAdaptor_CompCurve& ChangeCurve(); diff --git a/src/BRepAdaptor/BRepAdaptor_HCurve.hxx b/src/BRepAdaptor/BRepAdaptor_HCurve.hxx index 2f1a19f9f1..a68c385393 100644 --- a/src/BRepAdaptor/BRepAdaptor_HCurve.hxx +++ b/src/BRepAdaptor/BRepAdaptor_HCurve.hxx @@ -39,16 +39,24 @@ class BRepAdaptor_HCurve : public Adaptor3d_HCurve public: + //! Creates an empty GenHCurve. Standard_EXPORT BRepAdaptor_HCurve(); + //! Creates a GenHCurve from a Curve Standard_EXPORT BRepAdaptor_HCurve(const BRepAdaptor_Curve& C); + //! Sets the field of the GenHCurve. Standard_EXPORT void Set (const BRepAdaptor_Curve& C); + //! Returns the curve used to create the GenHCurve. + //! This is redefined from HCurve, cannot be inline. Standard_EXPORT const Adaptor3d_Curve& Curve() const; + //! Returns the curve used to create the GenHCurve. + //! This is redefined from HCurve, cannot be inline. Standard_EXPORT Adaptor3d_Curve& GetCurve(); + //! Returns the curve used to create the GenHCurve. BRepAdaptor_Curve& ChangeCurve(); diff --git a/src/BRepAdaptor/BRepAdaptor_HCurve2d.hxx b/src/BRepAdaptor/BRepAdaptor_HCurve2d.hxx index ade0b2d8ae..229a4b4755 100644 --- a/src/BRepAdaptor/BRepAdaptor_HCurve2d.hxx +++ b/src/BRepAdaptor/BRepAdaptor_HCurve2d.hxx @@ -39,14 +39,20 @@ class BRepAdaptor_HCurve2d : public Adaptor2d_HCurve2d public: + //! Creates an empty GenHCurve2d. Standard_EXPORT BRepAdaptor_HCurve2d(); + //! Creates a GenHCurve2d from a Curve Standard_EXPORT BRepAdaptor_HCurve2d(const BRepAdaptor_Curve2d& C); + //! Sets the field of the GenHCurve2d. Standard_EXPORT void Set (const BRepAdaptor_Curve2d& C); + //! Returns the curve used to create the GenHCurve2d. + //! This is redefined from HCurve2d, cannot be inline. Standard_EXPORT const Adaptor2d_Curve2d& Curve2d() const; + //! Returns the curve used to create the GenHCurve. BRepAdaptor_Curve2d& ChangeCurve2d(); diff --git a/src/BRepAdaptor/BRepAdaptor_HSurface.hxx b/src/BRepAdaptor/BRepAdaptor_HSurface.hxx index db88aa253a..604d8d4660 100644 --- a/src/BRepAdaptor/BRepAdaptor_HSurface.hxx +++ b/src/BRepAdaptor/BRepAdaptor_HSurface.hxx @@ -39,14 +39,20 @@ class BRepAdaptor_HSurface : public Adaptor3d_HSurface public: + //! Creates an empty GenHSurface. Standard_EXPORT BRepAdaptor_HSurface(); + //! Creates a GenHSurface from a Surface. Standard_EXPORT BRepAdaptor_HSurface(const BRepAdaptor_Surface& S); + //! Sets the field of the GenHSurface. Standard_EXPORT void Set (const BRepAdaptor_Surface& S); + //! Returns a reference to the Surface inside the HSurface. + //! This is redefined from HSurface, cannot be inline. Standard_EXPORT const Adaptor3d_Surface& Surface() const; + //! Returns the surface used to create the GenHSurface. BRepAdaptor_Surface& ChangeSurface(); diff --git a/src/BRepApprox/BRepApprox_BSpParFunctionOfMyBSplGradientOfTheComputeLineOfApprox.hxx b/src/BRepApprox/BRepApprox_BSpParFunctionOfMyBSplGradientOfTheComputeLineOfApprox.hxx index 35f64c2bb2..e4ac5c7593 100644 --- a/src/BRepApprox/BRepApprox_BSpParFunctionOfMyBSplGradientOfTheComputeLineOfApprox.hxx +++ b/src/BRepApprox/BRepApprox_BSpParFunctionOfMyBSplGradientOfTheComputeLineOfApprox.hxx @@ -51,30 +51,59 @@ public: DEFINE_STANDARD_ALLOC + //! initializes the fields of the function. The approximating + //! curve has control points. Standard_EXPORT BRepApprox_BSpParFunctionOfMyBSplGradientOfTheComputeLineOfApprox(const BRepApprox_TheMultiLineOfApprox& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, const math_Vector& Parameters, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const Standard_Integer NbPol); + //! returns the number of variables of the function. It + //! corresponds to the number of MultiPoints. Standard_EXPORT Standard_Integer NbVariables() const; + //! this method computes the new approximation of the + //! MultiLine + //! SSP and calculates F = sum (||Pui - Bi*Pi||2) for each + //! point of the MultiLine. Standard_EXPORT Standard_Boolean Value (const math_Vector& X, Standard_Real& F); + //! returns the gradient G of the sum above for the + //! parameters Xi. Standard_EXPORT Standard_Boolean Gradient (const math_Vector& X, math_Vector& G); + //! returns the value F=sum(||Pui - Bi*Pi||)2. + //! returns the value G = grad(F) for the parameters Xi. Standard_EXPORT Standard_Boolean Values (const math_Vector& X, Standard_Real& F, math_Vector& G); + //! returns the new parameters of the MultiLine. Standard_EXPORT const math_Vector& NewParameters() const; + //! returns the MultiBSpCurve approximating the set after + //! computing the value F or Grad(F). Standard_EXPORT AppParCurves_MultiBSpCurve CurveValue(); + //! returns the distance between the MultiPoint of range + //! IPoint and the curve CurveIndex. Standard_EXPORT Standard_Real Error (const Standard_Integer IPoint, const Standard_Integer CurveIndex); + //! returns the maximum distance between the points + //! and the MultiBSpCurve. Standard_EXPORT Standard_Real MaxError3d() const; + //! returns the maximum distance between the points + //! and the MultiBSpCurve. Standard_EXPORT Standard_Real MaxError2d() const; + //! returns the function matrix used to approximate the + //! multiline. Standard_EXPORT const math_Matrix& FunctionMatrix() const; + //! returns the derivative function matrix used to approximate the + //! multiline. Standard_EXPORT const math_Matrix& DerivativeFunctionMatrix() const; + //! Returns the indexes of the first non null values of + //! A and DA. + //! The values are non null from Index(ieme point) +1 + //! to Index(ieme point) + degree +1. Standard_EXPORT const math_IntegerVector& Index() const; Standard_EXPORT AppParCurves_Constraint FirstConstraint (const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, const Standard_Integer FirstPoint) const; @@ -91,6 +120,8 @@ public: protected: + //! this method is used each time Value or Gradient is + //! needed. Standard_EXPORT void Perform (const math_Vector& X); diff --git a/src/BRepApprox/BRepApprox_BSpParLeastSquareOfMyBSplGradientOfTheComputeLineOfApprox.hxx b/src/BRepApprox/BRepApprox_BSpParLeastSquareOfMyBSplGradientOfTheComputeLineOfApprox.hxx index bbc06229ce..bb1f99dc9f 100644 --- a/src/BRepApprox/BRepApprox_BSpParLeastSquareOfMyBSplGradientOfTheComputeLineOfApprox.hxx +++ b/src/BRepApprox/BRepApprox_BSpParLeastSquareOfMyBSplGradientOfTheComputeLineOfApprox.hxx @@ -52,46 +52,120 @@ public: DEFINE_STANDARD_ALLOC + //! given a MultiLine, this algorithm computes the least + //! square resolution using the Householder-QR method. + //! If the first and/or the last point is a constraint + //! point, the value of the tangency or curvature is + //! computed in the resolution. + //! NbPol is the number of control points wanted + //! for the approximating curves. + //! The system to solve is the following: + //! A X = B. + //! Where A is the Bernstein matrix computed with the + //! parameters, B the points coordinates and X the poles + //! solutions. + //! The matrix A is the same for each coordinate x, y and z + //! and is also the same for each MultiLine point because + //! they are approximated in parallel(so with the same + //! parameter, only the vector B changes). Standard_EXPORT BRepApprox_BSpParLeastSquareOfMyBSplGradientOfTheComputeLineOfApprox(const BRepApprox_TheMultiLineOfApprox& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const AppParCurves_Constraint FirstCons, const AppParCurves_Constraint LastCons, const math_Vector& Parameters, const Standard_Integer NbPol); + //! Initializes the fields of the object. Standard_EXPORT BRepApprox_BSpParLeastSquareOfMyBSplGradientOfTheComputeLineOfApprox(const BRepApprox_TheMultiLineOfApprox& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const AppParCurves_Constraint FirstCons, const AppParCurves_Constraint LastCons, const Standard_Integer NbPol); + //! given a MultiLine, this algorithm computes the least + //! square resolution using the Householder-QR method. + //! If the first and/or the last point is a constraint + //! point, the value of the tangency or curvature is + //! computed in the resolution. + //! Deg is the degree wanted for the approximating curves. + //! The system to solve is the following: + //! A X = B. + //! Where A is the BSpline functions matrix computed with + //! , B the points coordinates and X the poles + //! solutions. + //! The matrix A is the same for each coordinate x, y and z + //! and is also the same for each MultiLine point because + //! they are approximated in parallel(so with the same + //! parameter, only the vector B changes). Standard_EXPORT BRepApprox_BSpParLeastSquareOfMyBSplGradientOfTheComputeLineOfApprox(const BRepApprox_TheMultiLineOfApprox& SSP, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const AppParCurves_Constraint FirstCons, const AppParCurves_Constraint LastCons, const math_Vector& Parameters, const Standard_Integer NbPol); + //! Initializes the fields of the object. Standard_EXPORT BRepApprox_BSpParLeastSquareOfMyBSplGradientOfTheComputeLineOfApprox(const BRepApprox_TheMultiLineOfApprox& SSP, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const AppParCurves_Constraint FirstCons, const AppParCurves_Constraint LastCons, const Standard_Integer NbPol); + //! Is used after having initialized the fields. + //! The case "CurvaturePoint" is not treated in this method. Standard_EXPORT void Perform (const math_Vector& Parameters); + //! Is used after having initialized the fields. Standard_EXPORT void Perform (const math_Vector& Parameters, const Standard_Real l1, const Standard_Real l2); + //! Is used after having initialized the fields. + //! is the tangent vector at the first point. + //! is the tangent vector at the last point. Standard_EXPORT void Perform (const math_Vector& Parameters, const math_Vector& V1t, const math_Vector& V2t, const Standard_Real l1, const Standard_Real l2); + //! Is used after having initialized the fields. + //! is the tangent vector at the first point. + //! is the tangent vector at the last point. + //! is the tangent vector at the first point. + //! is the tangent vector at the last point. Standard_EXPORT void Perform (const math_Vector& Parameters, const math_Vector& V1t, const math_Vector& V2t, const math_Vector& V1c, const math_Vector& V2c, const Standard_Real l1, const Standard_Real l2); + //! returns True if all has been correctly done. Standard_EXPORT Standard_Boolean IsDone() const; + //! returns the result of the approximation, i.e. all the + //! Curves. + //! An exception is raised if NotDone. Standard_EXPORT AppParCurves_MultiCurve BezierValue(); + //! returns the result of the approximation, i.e. all the + //! Curves. + //! An exception is raised if NotDone. Standard_EXPORT const AppParCurves_MultiBSpCurve& BSplineValue(); + //! returns the function matrix used to approximate the + //! set. Standard_EXPORT const math_Matrix& FunctionMatrix() const; + //! returns the derivative function matrix used + //! to approximate the set. Standard_EXPORT const math_Matrix& DerivativeFunctionMatrix() const; + //! returns the maximum errors between the MultiLine + //! and the approximation curves. F is the sum of the square + //! distances. Grad is the derivative vector of the + //! function F. Standard_EXPORT void ErrorGradient (math_Vector& Grad, Standard_Real& F, Standard_Real& MaxE3d, Standard_Real& MaxE2d); + //! returns the distances between the points of the + //! multiline and the approximation curves. Standard_EXPORT const math_Matrix& Distance(); + //! returns the maximum errors between the MultiLine + //! and the approximation curves. F is the sum of the square + //! distances. Standard_EXPORT void Error (Standard_Real& F, Standard_Real& MaxE3d, Standard_Real& MaxE2d); + //! returns the value (P2 - P1)/ V1 if the first point + //! was a tangency point. Standard_EXPORT Standard_Real FirstLambda() const; + //! returns the value (PN - PN-1)/ VN if the last point + //! was a tangency point. Standard_EXPORT Standard_Real LastLambda() const; + //! returns the matrix of points value. Standard_EXPORT const math_Matrix& Points() const; + //! returns the matrix of resulting control points value. Standard_EXPORT const math_Matrix& Poles() const; + //! Returns the indexes of the first non null values of + //! A and DA. + //! The values are non null from Index(ieme point) +1 + //! to Index(ieme point) + degree +1. Standard_EXPORT const math_IntegerVector& KIndex() const; @@ -100,24 +174,33 @@ public: protected: + //! is used by the constuctors above. Standard_EXPORT void Init (const BRepApprox_TheMultiLineOfApprox& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint); + //! returns the number of second member columns. + //! Is used internally to initialize the fields. Standard_EXPORT Standard_Integer NbBColumns (const BRepApprox_TheMultiLineOfApprox& SSP) const; + //! returns the first point beeing fitted. Standard_EXPORT Standard_Integer TheFirstPoint (const AppParCurves_Constraint FirstCons, const Standard_Integer FirstPoint) const; + //! returns the last point beeing fitted. Standard_EXPORT Standard_Integer TheLastPoint (const AppParCurves_Constraint LastCons, const Standard_Integer LastPoint) const; + //! Affects the fields in the case of a constraint point. Standard_EXPORT void Affect (const BRepApprox_TheMultiLineOfApprox& SSP, const Standard_Integer Index, AppParCurves_Constraint& Cons, math_Vector& Vt, math_Vector& Vc); Standard_EXPORT void ComputeFunction (const math_Vector& Parameters); Standard_EXPORT void SearchIndex (math_IntegerVector& Index); + //! computes internal matrixes for the resolution Standard_EXPORT void MakeTAA (math_Vector& TheA, math_Vector& TheB); + //! computes internal matrixes for the resolution Standard_EXPORT void MakeTAA (math_Vector& TheA); + //! computes internal matrixes for the resolution Standard_EXPORT void MakeTAA (math_Vector& TheA, math_Matrix& TheB); diff --git a/src/BRepApprox/BRepApprox_MyBSplGradientOfTheComputeLineOfApprox.hxx b/src/BRepApprox/BRepApprox_MyBSplGradientOfTheComputeLineOfApprox.hxx index b5d44ce509..1282328066 100644 --- a/src/BRepApprox/BRepApprox_MyBSplGradientOfTheComputeLineOfApprox.hxx +++ b/src/BRepApprox/BRepApprox_MyBSplGradientOfTheComputeLineOfApprox.hxx @@ -47,20 +47,45 @@ public: DEFINE_STANDARD_ALLOC + //! Tries to minimize the sum (square(||Qui - Bi*Pi||)) + //! where Pui describe the approximating BSpline curves'Poles + //! and Qi the MultiLine points with a parameter ui. + //! In this algorithm, the parameters ui are the unknowns. + //! The tolerance required on this sum is given by Tol. + //! The desired degree of the resulting curve is Deg. Standard_EXPORT BRepApprox_MyBSplGradientOfTheComputeLineOfApprox(const BRepApprox_TheMultiLineOfApprox& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, math_Vector& Parameters, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const Standard_Integer Deg, const Standard_Real Tol3d, const Standard_Real Tol2d, const Standard_Integer NbIterations = 1); + //! Tries to minimize the sum (square(||Qui - Bi*Pi||)) + //! where Pui describe the approximating BSpline curves'Poles + //! and Qi the MultiLine points with a parameter ui. + //! In this algorithm, the parameters ui are the unknowns. + //! The tolerance required on this sum is given by Tol. + //! The desired degree of the resulting curve is Deg. Standard_EXPORT BRepApprox_MyBSplGradientOfTheComputeLineOfApprox(const BRepApprox_TheMultiLineOfApprox& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, math_Vector& Parameters, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const Standard_Integer Deg, const Standard_Real Tol3d, const Standard_Real Tol2d, const Standard_Integer NbIterations, const Standard_Real lambda1, const Standard_Real lambda2); + //! returns True if all has been correctly done. Standard_EXPORT Standard_Boolean IsDone() const; + //! returns all the BSpline curves approximating the + //! MultiLine SSP after minimization of the parameter. Standard_EXPORT AppParCurves_MultiBSpCurve Value() const; + //! returns the difference between the old and the new + //! approximation. + //! An exception is raised if NotDone. + //! An exception is raised if Index<1 or Index>NbParameters. Standard_EXPORT Standard_Real Error (const Standard_Integer Index) const; + //! returns the maximum difference between the old and the + //! new approximation. Standard_EXPORT Standard_Real MaxError3d() const; + //! returns the maximum difference between the old and the + //! new approximation. Standard_EXPORT Standard_Real MaxError2d() const; + //! returns the average error between the old and the + //! new approximation. Standard_EXPORT Standard_Real AverageError() const; diff --git a/src/BRepApprox/BRepApprox_MyGradientOfTheComputeLineBezierOfApprox.hxx b/src/BRepApprox/BRepApprox_MyGradientOfTheComputeLineBezierOfApprox.hxx index 49759b8eb6..6bef091928 100644 --- a/src/BRepApprox/BRepApprox_MyGradientOfTheComputeLineBezierOfApprox.hxx +++ b/src/BRepApprox/BRepApprox_MyGradientOfTheComputeLineBezierOfApprox.hxx @@ -46,18 +46,37 @@ public: DEFINE_STANDARD_ALLOC + //! Tries to minimize the sum (square(||Qui - Bi*Pi||)) + //! where Pui describe the approximating Bezier curves'Poles + //! and Qi the MultiLine points with a parameter ui. + //! In this algorithm, the parameters ui are the unknowns. + //! The tolerance required on this sum is given by Tol. + //! The desired degree of the resulting curve is Deg. Standard_EXPORT BRepApprox_MyGradientOfTheComputeLineBezierOfApprox(const BRepApprox_TheMultiLineOfApprox& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, math_Vector& Parameters, const Standard_Integer Deg, const Standard_Real Tol3d, const Standard_Real Tol2d, const Standard_Integer NbIterations = 200); + //! returns True if all has been correctly done. Standard_EXPORT Standard_Boolean IsDone() const; + //! returns all the Bezier curves approximating the + //! MultiLine SSP after minimization of the parameter. Standard_EXPORT AppParCurves_MultiCurve Value() const; + //! returns the difference between the old and the new + //! approximation. + //! An exception is raised if NotDone. + //! An exception is raised if Index<1 or Index>NbParameters. Standard_EXPORT Standard_Real Error (const Standard_Integer Index) const; + //! returns the maximum difference between the old and the + //! new approximation. Standard_EXPORT Standard_Real MaxError3d() const; + //! returns the maximum difference between the old and the + //! new approximation. Standard_EXPORT Standard_Real MaxError2d() const; + //! returns the average error between the old and the + //! new approximation. Standard_EXPORT Standard_Real AverageError() const; diff --git a/src/BRepApprox/BRepApprox_MyGradientbisOfTheComputeLineOfApprox.hxx b/src/BRepApprox/BRepApprox_MyGradientbisOfTheComputeLineOfApprox.hxx index 2af3606fb5..2b1cea6722 100644 --- a/src/BRepApprox/BRepApprox_MyGradientbisOfTheComputeLineOfApprox.hxx +++ b/src/BRepApprox/BRepApprox_MyGradientbisOfTheComputeLineOfApprox.hxx @@ -46,18 +46,37 @@ public: DEFINE_STANDARD_ALLOC + //! Tries to minimize the sum (square(||Qui - Bi*Pi||)) + //! where Pui describe the approximating Bezier curves'Poles + //! and Qi the MultiLine points with a parameter ui. + //! In this algorithm, the parameters ui are the unknowns. + //! The tolerance required on this sum is given by Tol. + //! The desired degree of the resulting curve is Deg. Standard_EXPORT BRepApprox_MyGradientbisOfTheComputeLineOfApprox(const BRepApprox_TheMultiLineOfApprox& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, math_Vector& Parameters, const Standard_Integer Deg, const Standard_Real Tol3d, const Standard_Real Tol2d, const Standard_Integer NbIterations = 200); + //! returns True if all has been correctly done. Standard_EXPORT Standard_Boolean IsDone() const; + //! returns all the Bezier curves approximating the + //! MultiLine SSP after minimization of the parameter. Standard_EXPORT AppParCurves_MultiCurve Value() const; + //! returns the difference between the old and the new + //! approximation. + //! An exception is raised if NotDone. + //! An exception is raised if Index<1 or Index>NbParameters. Standard_EXPORT Standard_Real Error (const Standard_Integer Index) const; + //! returns the maximum difference between the old and the + //! new approximation. Standard_EXPORT Standard_Real MaxError3d() const; + //! returns the maximum difference between the old and the + //! new approximation. Standard_EXPORT Standard_Real MaxError2d() const; + //! returns the average error between the old and the + //! new approximation. Standard_EXPORT Standard_Real AverageError() const; diff --git a/src/BRepApprox/BRepApprox_ParFunctionOfMyGradientOfTheComputeLineBezierOfApprox.hxx b/src/BRepApprox/BRepApprox_ParFunctionOfMyGradientOfTheComputeLineBezierOfApprox.hxx index a125f0a93c..34a69fd526 100644 --- a/src/BRepApprox/BRepApprox_ParFunctionOfMyGradientOfTheComputeLineBezierOfApprox.hxx +++ b/src/BRepApprox/BRepApprox_ParFunctionOfMyGradientOfTheComputeLineBezierOfApprox.hxx @@ -48,24 +48,45 @@ public: DEFINE_STANDARD_ALLOC + //! initializes the fields of the function. The approximating + //! curve has the desired degree Deg. Standard_EXPORT BRepApprox_ParFunctionOfMyGradientOfTheComputeLineBezierOfApprox(const BRepApprox_TheMultiLineOfApprox& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, const math_Vector& Parameters, const Standard_Integer Deg); + //! returns the number of variables of the function. It + //! corresponds to the number of MultiPoints. Standard_EXPORT Standard_Integer NbVariables() const; + //! this method computes the new approximation of the + //! MultiLine + //! SSP and calculates F = sum (||Pui - Bi*Pi||2) for each + //! point of the MultiLine. Standard_EXPORT Standard_Boolean Value (const math_Vector& X, Standard_Real& F); + //! returns the gradient G of the sum above for the + //! parameters Xi. Standard_EXPORT Standard_Boolean Gradient (const math_Vector& X, math_Vector& G); + //! returns the value F=sum(||Pui - Bi*Pi||)2. + //! returns the value G = grad(F) for the parameters Xi. Standard_EXPORT Standard_Boolean Values (const math_Vector& X, Standard_Real& F, math_Vector& G); + //! returns the new parameters of the MultiLine. Standard_EXPORT const math_Vector& NewParameters() const; + //! returns the MultiCurve approximating the set after + //! computing the value F or Grad(F). Standard_EXPORT const AppParCurves_MultiCurve& CurveValue(); + //! returns the distance between the MultiPoint of range + //! IPoint and the curve CurveIndex. Standard_EXPORT Standard_Real Error (const Standard_Integer IPoint, const Standard_Integer CurveIndex) const; + //! returns the maximum distance between the points + //! and the MultiCurve. Standard_EXPORT Standard_Real MaxError3d() const; + //! returns the maximum distance between the points + //! and the MultiCurve. Standard_EXPORT Standard_Real MaxError2d() const; Standard_EXPORT AppParCurves_Constraint FirstConstraint (const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, const Standard_Integer FirstPoint) const; @@ -78,6 +99,8 @@ public: protected: + //! this method is used each time Value or Gradient is + //! needed. Standard_EXPORT void Perform (const math_Vector& X); diff --git a/src/BRepApprox/BRepApprox_ParFunctionOfMyGradientbisOfTheComputeLineOfApprox.hxx b/src/BRepApprox/BRepApprox_ParFunctionOfMyGradientbisOfTheComputeLineOfApprox.hxx index ffc35d1ac0..2e7db5c870 100644 --- a/src/BRepApprox/BRepApprox_ParFunctionOfMyGradientbisOfTheComputeLineOfApprox.hxx +++ b/src/BRepApprox/BRepApprox_ParFunctionOfMyGradientbisOfTheComputeLineOfApprox.hxx @@ -48,24 +48,45 @@ public: DEFINE_STANDARD_ALLOC + //! initializes the fields of the function. The approximating + //! curve has the desired degree Deg. Standard_EXPORT BRepApprox_ParFunctionOfMyGradientbisOfTheComputeLineOfApprox(const BRepApprox_TheMultiLineOfApprox& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, const math_Vector& Parameters, const Standard_Integer Deg); + //! returns the number of variables of the function. It + //! corresponds to the number of MultiPoints. Standard_EXPORT Standard_Integer NbVariables() const; + //! this method computes the new approximation of the + //! MultiLine + //! SSP and calculates F = sum (||Pui - Bi*Pi||2) for each + //! point of the MultiLine. Standard_EXPORT Standard_Boolean Value (const math_Vector& X, Standard_Real& F); + //! returns the gradient G of the sum above for the + //! parameters Xi. Standard_EXPORT Standard_Boolean Gradient (const math_Vector& X, math_Vector& G); + //! returns the value F=sum(||Pui - Bi*Pi||)2. + //! returns the value G = grad(F) for the parameters Xi. Standard_EXPORT Standard_Boolean Values (const math_Vector& X, Standard_Real& F, math_Vector& G); + //! returns the new parameters of the MultiLine. Standard_EXPORT const math_Vector& NewParameters() const; + //! returns the MultiCurve approximating the set after + //! computing the value F or Grad(F). Standard_EXPORT const AppParCurves_MultiCurve& CurveValue(); + //! returns the distance between the MultiPoint of range + //! IPoint and the curve CurveIndex. Standard_EXPORT Standard_Real Error (const Standard_Integer IPoint, const Standard_Integer CurveIndex) const; + //! returns the maximum distance between the points + //! and the MultiCurve. Standard_EXPORT Standard_Real MaxError3d() const; + //! returns the maximum distance between the points + //! and the MultiCurve. Standard_EXPORT Standard_Real MaxError2d() const; Standard_EXPORT AppParCurves_Constraint FirstConstraint (const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, const Standard_Integer FirstPoint) const; @@ -78,6 +99,8 @@ public: protected: + //! this method is used each time Value or Gradient is + //! needed. Standard_EXPORT void Perform (const math_Vector& X); diff --git a/src/BRepApprox/BRepApprox_ParLeastSquareOfMyGradientOfTheComputeLineBezierOfApprox.hxx b/src/BRepApprox/BRepApprox_ParLeastSquareOfMyGradientOfTheComputeLineBezierOfApprox.hxx index 8103a0aa6b..5f81231745 100644 --- a/src/BRepApprox/BRepApprox_ParLeastSquareOfMyGradientOfTheComputeLineBezierOfApprox.hxx +++ b/src/BRepApprox/BRepApprox_ParLeastSquareOfMyGradientOfTheComputeLineBezierOfApprox.hxx @@ -52,46 +52,120 @@ public: DEFINE_STANDARD_ALLOC + //! given a MultiLine, this algorithm computes the least + //! square resolution using the Householder-QR method. + //! If the first and/or the last point is a constraint + //! point, the value of the tangency or curvature is + //! computed in the resolution. + //! NbPol is the number of control points wanted + //! for the approximating curves. + //! The system to solve is the following: + //! A X = B. + //! Where A is the Bernstein matrix computed with the + //! parameters, B the points coordinates and X the poles + //! solutions. + //! The matrix A is the same for each coordinate x, y and z + //! and is also the same for each MultiLine point because + //! they are approximated in parallel(so with the same + //! parameter, only the vector B changes). Standard_EXPORT BRepApprox_ParLeastSquareOfMyGradientOfTheComputeLineBezierOfApprox(const BRepApprox_TheMultiLineOfApprox& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const AppParCurves_Constraint FirstCons, const AppParCurves_Constraint LastCons, const math_Vector& Parameters, const Standard_Integer NbPol); + //! Initializes the fields of the object. Standard_EXPORT BRepApprox_ParLeastSquareOfMyGradientOfTheComputeLineBezierOfApprox(const BRepApprox_TheMultiLineOfApprox& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const AppParCurves_Constraint FirstCons, const AppParCurves_Constraint LastCons, const Standard_Integer NbPol); + //! given a MultiLine, this algorithm computes the least + //! square resolution using the Householder-QR method. + //! If the first and/or the last point is a constraint + //! point, the value of the tangency or curvature is + //! computed in the resolution. + //! Deg is the degree wanted for the approximating curves. + //! The system to solve is the following: + //! A X = B. + //! Where A is the BSpline functions matrix computed with + //! , B the points coordinates and X the poles + //! solutions. + //! The matrix A is the same for each coordinate x, y and z + //! and is also the same for each MultiLine point because + //! they are approximated in parallel(so with the same + //! parameter, only the vector B changes). Standard_EXPORT BRepApprox_ParLeastSquareOfMyGradientOfTheComputeLineBezierOfApprox(const BRepApprox_TheMultiLineOfApprox& SSP, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const AppParCurves_Constraint FirstCons, const AppParCurves_Constraint LastCons, const math_Vector& Parameters, const Standard_Integer NbPol); + //! Initializes the fields of the object. Standard_EXPORT BRepApprox_ParLeastSquareOfMyGradientOfTheComputeLineBezierOfApprox(const BRepApprox_TheMultiLineOfApprox& SSP, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const AppParCurves_Constraint FirstCons, const AppParCurves_Constraint LastCons, const Standard_Integer NbPol); + //! Is used after having initialized the fields. + //! The case "CurvaturePoint" is not treated in this method. Standard_EXPORT void Perform (const math_Vector& Parameters); + //! Is used after having initialized the fields. Standard_EXPORT void Perform (const math_Vector& Parameters, const Standard_Real l1, const Standard_Real l2); + //! Is used after having initialized the fields. + //! is the tangent vector at the first point. + //! is the tangent vector at the last point. Standard_EXPORT void Perform (const math_Vector& Parameters, const math_Vector& V1t, const math_Vector& V2t, const Standard_Real l1, const Standard_Real l2); + //! Is used after having initialized the fields. + //! is the tangent vector at the first point. + //! is the tangent vector at the last point. + //! is the tangent vector at the first point. + //! is the tangent vector at the last point. Standard_EXPORT void Perform (const math_Vector& Parameters, const math_Vector& V1t, const math_Vector& V2t, const math_Vector& V1c, const math_Vector& V2c, const Standard_Real l1, const Standard_Real l2); + //! returns True if all has been correctly done. Standard_EXPORT Standard_Boolean IsDone() const; + //! returns the result of the approximation, i.e. all the + //! Curves. + //! An exception is raised if NotDone. Standard_EXPORT AppParCurves_MultiCurve BezierValue(); + //! returns the result of the approximation, i.e. all the + //! Curves. + //! An exception is raised if NotDone. Standard_EXPORT const AppParCurves_MultiBSpCurve& BSplineValue(); + //! returns the function matrix used to approximate the + //! set. Standard_EXPORT const math_Matrix& FunctionMatrix() const; + //! returns the derivative function matrix used + //! to approximate the set. Standard_EXPORT const math_Matrix& DerivativeFunctionMatrix() const; + //! returns the maximum errors between the MultiLine + //! and the approximation curves. F is the sum of the square + //! distances. Grad is the derivative vector of the + //! function F. Standard_EXPORT void ErrorGradient (math_Vector& Grad, Standard_Real& F, Standard_Real& MaxE3d, Standard_Real& MaxE2d); + //! returns the distances between the points of the + //! multiline and the approximation curves. Standard_EXPORT const math_Matrix& Distance(); + //! returns the maximum errors between the MultiLine + //! and the approximation curves. F is the sum of the square + //! distances. Standard_EXPORT void Error (Standard_Real& F, Standard_Real& MaxE3d, Standard_Real& MaxE2d); + //! returns the value (P2 - P1)/ V1 if the first point + //! was a tangency point. Standard_EXPORT Standard_Real FirstLambda() const; + //! returns the value (PN - PN-1)/ VN if the last point + //! was a tangency point. Standard_EXPORT Standard_Real LastLambda() const; + //! returns the matrix of points value. Standard_EXPORT const math_Matrix& Points() const; + //! returns the matrix of resulting control points value. Standard_EXPORT const math_Matrix& Poles() const; + //! Returns the indexes of the first non null values of + //! A and DA. + //! The values are non null from Index(ieme point) +1 + //! to Index(ieme point) + degree +1. Standard_EXPORT const math_IntegerVector& KIndex() const; @@ -100,24 +174,33 @@ public: protected: + //! is used by the constuctors above. Standard_EXPORT void Init (const BRepApprox_TheMultiLineOfApprox& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint); + //! returns the number of second member columns. + //! Is used internally to initialize the fields. Standard_EXPORT Standard_Integer NbBColumns (const BRepApprox_TheMultiLineOfApprox& SSP) const; + //! returns the first point beeing fitted. Standard_EXPORT Standard_Integer TheFirstPoint (const AppParCurves_Constraint FirstCons, const Standard_Integer FirstPoint) const; + //! returns the last point beeing fitted. Standard_EXPORT Standard_Integer TheLastPoint (const AppParCurves_Constraint LastCons, const Standard_Integer LastPoint) const; + //! Affects the fields in the case of a constraint point. Standard_EXPORT void Affect (const BRepApprox_TheMultiLineOfApprox& SSP, const Standard_Integer Index, AppParCurves_Constraint& Cons, math_Vector& Vt, math_Vector& Vc); Standard_EXPORT void ComputeFunction (const math_Vector& Parameters); Standard_EXPORT void SearchIndex (math_IntegerVector& Index); + //! computes internal matrixes for the resolution Standard_EXPORT void MakeTAA (math_Vector& TheA, math_Vector& TheB); + //! computes internal matrixes for the resolution Standard_EXPORT void MakeTAA (math_Vector& TheA); + //! computes internal matrixes for the resolution Standard_EXPORT void MakeTAA (math_Vector& TheA, math_Matrix& TheB); diff --git a/src/BRepApprox/BRepApprox_ParLeastSquareOfMyGradientbisOfTheComputeLineOfApprox.hxx b/src/BRepApprox/BRepApprox_ParLeastSquareOfMyGradientbisOfTheComputeLineOfApprox.hxx index 17d0c85207..77a35026e3 100644 --- a/src/BRepApprox/BRepApprox_ParLeastSquareOfMyGradientbisOfTheComputeLineOfApprox.hxx +++ b/src/BRepApprox/BRepApprox_ParLeastSquareOfMyGradientbisOfTheComputeLineOfApprox.hxx @@ -52,46 +52,120 @@ public: DEFINE_STANDARD_ALLOC + //! given a MultiLine, this algorithm computes the least + //! square resolution using the Householder-QR method. + //! If the first and/or the last point is a constraint + //! point, the value of the tangency or curvature is + //! computed in the resolution. + //! NbPol is the number of control points wanted + //! for the approximating curves. + //! The system to solve is the following: + //! A X = B. + //! Where A is the Bernstein matrix computed with the + //! parameters, B the points coordinates and X the poles + //! solutions. + //! The matrix A is the same for each coordinate x, y and z + //! and is also the same for each MultiLine point because + //! they are approximated in parallel(so with the same + //! parameter, only the vector B changes). Standard_EXPORT BRepApprox_ParLeastSquareOfMyGradientbisOfTheComputeLineOfApprox(const BRepApprox_TheMultiLineOfApprox& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const AppParCurves_Constraint FirstCons, const AppParCurves_Constraint LastCons, const math_Vector& Parameters, const Standard_Integer NbPol); + //! Initializes the fields of the object. Standard_EXPORT BRepApprox_ParLeastSquareOfMyGradientbisOfTheComputeLineOfApprox(const BRepApprox_TheMultiLineOfApprox& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const AppParCurves_Constraint FirstCons, const AppParCurves_Constraint LastCons, const Standard_Integer NbPol); + //! given a MultiLine, this algorithm computes the least + //! square resolution using the Householder-QR method. + //! If the first and/or the last point is a constraint + //! point, the value of the tangency or curvature is + //! computed in the resolution. + //! Deg is the degree wanted for the approximating curves. + //! The system to solve is the following: + //! A X = B. + //! Where A is the BSpline functions matrix computed with + //! , B the points coordinates and X the poles + //! solutions. + //! The matrix A is the same for each coordinate x, y and z + //! and is also the same for each MultiLine point because + //! they are approximated in parallel(so with the same + //! parameter, only the vector B changes). Standard_EXPORT BRepApprox_ParLeastSquareOfMyGradientbisOfTheComputeLineOfApprox(const BRepApprox_TheMultiLineOfApprox& SSP, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const AppParCurves_Constraint FirstCons, const AppParCurves_Constraint LastCons, const math_Vector& Parameters, const Standard_Integer NbPol); + //! Initializes the fields of the object. Standard_EXPORT BRepApprox_ParLeastSquareOfMyGradientbisOfTheComputeLineOfApprox(const BRepApprox_TheMultiLineOfApprox& SSP, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const AppParCurves_Constraint FirstCons, const AppParCurves_Constraint LastCons, const Standard_Integer NbPol); + //! Is used after having initialized the fields. + //! The case "CurvaturePoint" is not treated in this method. Standard_EXPORT void Perform (const math_Vector& Parameters); + //! Is used after having initialized the fields. Standard_EXPORT void Perform (const math_Vector& Parameters, const Standard_Real l1, const Standard_Real l2); + //! Is used after having initialized the fields. + //! is the tangent vector at the first point. + //! is the tangent vector at the last point. Standard_EXPORT void Perform (const math_Vector& Parameters, const math_Vector& V1t, const math_Vector& V2t, const Standard_Real l1, const Standard_Real l2); + //! Is used after having initialized the fields. + //! is the tangent vector at the first point. + //! is the tangent vector at the last point. + //! is the tangent vector at the first point. + //! is the tangent vector at the last point. Standard_EXPORT void Perform (const math_Vector& Parameters, const math_Vector& V1t, const math_Vector& V2t, const math_Vector& V1c, const math_Vector& V2c, const Standard_Real l1, const Standard_Real l2); + //! returns True if all has been correctly done. Standard_EXPORT Standard_Boolean IsDone() const; + //! returns the result of the approximation, i.e. all the + //! Curves. + //! An exception is raised if NotDone. Standard_EXPORT AppParCurves_MultiCurve BezierValue(); + //! returns the result of the approximation, i.e. all the + //! Curves. + //! An exception is raised if NotDone. Standard_EXPORT const AppParCurves_MultiBSpCurve& BSplineValue(); + //! returns the function matrix used to approximate the + //! set. Standard_EXPORT const math_Matrix& FunctionMatrix() const; + //! returns the derivative function matrix used + //! to approximate the set. Standard_EXPORT const math_Matrix& DerivativeFunctionMatrix() const; + //! returns the maximum errors between the MultiLine + //! and the approximation curves. F is the sum of the square + //! distances. Grad is the derivative vector of the + //! function F. Standard_EXPORT void ErrorGradient (math_Vector& Grad, Standard_Real& F, Standard_Real& MaxE3d, Standard_Real& MaxE2d); + //! returns the distances between the points of the + //! multiline and the approximation curves. Standard_EXPORT const math_Matrix& Distance(); + //! returns the maximum errors between the MultiLine + //! and the approximation curves. F is the sum of the square + //! distances. Standard_EXPORT void Error (Standard_Real& F, Standard_Real& MaxE3d, Standard_Real& MaxE2d); + //! returns the value (P2 - P1)/ V1 if the first point + //! was a tangency point. Standard_EXPORT Standard_Real FirstLambda() const; + //! returns the value (PN - PN-1)/ VN if the last point + //! was a tangency point. Standard_EXPORT Standard_Real LastLambda() const; + //! returns the matrix of points value. Standard_EXPORT const math_Matrix& Points() const; + //! returns the matrix of resulting control points value. Standard_EXPORT const math_Matrix& Poles() const; + //! Returns the indexes of the first non null values of + //! A and DA. + //! The values are non null from Index(ieme point) +1 + //! to Index(ieme point) + degree +1. Standard_EXPORT const math_IntegerVector& KIndex() const; @@ -100,24 +174,33 @@ public: protected: + //! is used by the constuctors above. Standard_EXPORT void Init (const BRepApprox_TheMultiLineOfApprox& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint); + //! returns the number of second member columns. + //! Is used internally to initialize the fields. Standard_EXPORT Standard_Integer NbBColumns (const BRepApprox_TheMultiLineOfApprox& SSP) const; + //! returns the first point beeing fitted. Standard_EXPORT Standard_Integer TheFirstPoint (const AppParCurves_Constraint FirstCons, const Standard_Integer FirstPoint) const; + //! returns the last point beeing fitted. Standard_EXPORT Standard_Integer TheLastPoint (const AppParCurves_Constraint LastCons, const Standard_Integer LastPoint) const; + //! Affects the fields in the case of a constraint point. Standard_EXPORT void Affect (const BRepApprox_TheMultiLineOfApprox& SSP, const Standard_Integer Index, AppParCurves_Constraint& Cons, math_Vector& Vt, math_Vector& Vc); Standard_EXPORT void ComputeFunction (const math_Vector& Parameters); Standard_EXPORT void SearchIndex (math_IntegerVector& Index); + //! computes internal matrixes for the resolution Standard_EXPORT void MakeTAA (math_Vector& TheA, math_Vector& TheB); + //! computes internal matrixes for the resolution Standard_EXPORT void MakeTAA (math_Vector& TheA); + //! computes internal matrixes for the resolution Standard_EXPORT void MakeTAA (math_Vector& TheA, math_Matrix& TheB); diff --git a/src/BRepApprox/BRepApprox_ResConstraintOfMyGradientOfTheComputeLineBezierOfApprox.hxx b/src/BRepApprox/BRepApprox_ResConstraintOfMyGradientOfTheComputeLineBezierOfApprox.hxx index 2a48942a72..a0f5431fbf 100644 --- a/src/BRepApprox/BRepApprox_ResConstraintOfMyGradientOfTheComputeLineBezierOfApprox.hxx +++ b/src/BRepApprox/BRepApprox_ResConstraintOfMyGradientOfTheComputeLineBezierOfApprox.hxx @@ -43,18 +43,35 @@ public: DEFINE_STANDARD_ALLOC + //! Given a MultiLine SSP with constraints points, this + //! algorithm finds the best curve solution to approximate it. + //! The poles from SCurv issued for example from the least + //! squares are used as a guess solution for the uzawa + //! algorithm. The tolerance used in the Uzawa algorithms + //! is Tolerance. + //! A is the Bernstein matrix associated to the MultiLine + //! and DA is the derivative bernstein matrix.(They can come + //! from an approximation with ParLeastSquare.) + //! The MultiCurve is modified. New MultiPoles are given. Standard_EXPORT BRepApprox_ResConstraintOfMyGradientOfTheComputeLineBezierOfApprox(const BRepApprox_TheMultiLineOfApprox& SSP, AppParCurves_MultiCurve& SCurv, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& Constraints, const math_Matrix& Bern, const math_Matrix& DerivativeBern, const Standard_Real Tolerance = 1.0e-10); + //! returns True if all has been correctly done. Standard_EXPORT Standard_Boolean IsDone() const; + //! returns the maximum difference value between the curve + //! and the given points. Standard_EXPORT Standard_Real Error() const; Standard_EXPORT const math_Matrix& ConstraintMatrix() const; + //! returns the duale variables of the system. Standard_EXPORT const math_Vector& Duale() const; + //! Returns the derivative of the constraint matrix. Standard_EXPORT const math_Matrix& ConstraintDerivative (const BRepApprox_TheMultiLineOfApprox& SSP, const math_Vector& Parameters, const Standard_Integer Deg, const math_Matrix& DA); + //! returns the Inverse of Cont*Transposed(Cont), where + //! Cont is the constraint matrix for the algorithm. Standard_EXPORT const math_Matrix& InverseMatrix() const; @@ -63,8 +80,10 @@ public: protected: + //! is used internally to create the fields. Standard_EXPORT Standard_Integer NbConstraints (const BRepApprox_TheMultiLineOfApprox& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints) const; + //! is internally used for the fields creation. Standard_EXPORT Standard_Integer NbColumns (const BRepApprox_TheMultiLineOfApprox& SSP, const Standard_Integer Deg) const; diff --git a/src/BRepApprox/BRepApprox_ResConstraintOfMyGradientbisOfTheComputeLineOfApprox.hxx b/src/BRepApprox/BRepApprox_ResConstraintOfMyGradientbisOfTheComputeLineOfApprox.hxx index 82f00d667d..fa86057a89 100644 --- a/src/BRepApprox/BRepApprox_ResConstraintOfMyGradientbisOfTheComputeLineOfApprox.hxx +++ b/src/BRepApprox/BRepApprox_ResConstraintOfMyGradientbisOfTheComputeLineOfApprox.hxx @@ -43,18 +43,35 @@ public: DEFINE_STANDARD_ALLOC + //! Given a MultiLine SSP with constraints points, this + //! algorithm finds the best curve solution to approximate it. + //! The poles from SCurv issued for example from the least + //! squares are used as a guess solution for the uzawa + //! algorithm. The tolerance used in the Uzawa algorithms + //! is Tolerance. + //! A is the Bernstein matrix associated to the MultiLine + //! and DA is the derivative bernstein matrix.(They can come + //! from an approximation with ParLeastSquare.) + //! The MultiCurve is modified. New MultiPoles are given. Standard_EXPORT BRepApprox_ResConstraintOfMyGradientbisOfTheComputeLineOfApprox(const BRepApprox_TheMultiLineOfApprox& SSP, AppParCurves_MultiCurve& SCurv, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& Constraints, const math_Matrix& Bern, const math_Matrix& DerivativeBern, const Standard_Real Tolerance = 1.0e-10); + //! returns True if all has been correctly done. Standard_EXPORT Standard_Boolean IsDone() const; + //! returns the maximum difference value between the curve + //! and the given points. Standard_EXPORT Standard_Real Error() const; Standard_EXPORT const math_Matrix& ConstraintMatrix() const; + //! returns the duale variables of the system. Standard_EXPORT const math_Vector& Duale() const; + //! Returns the derivative of the constraint matrix. Standard_EXPORT const math_Matrix& ConstraintDerivative (const BRepApprox_TheMultiLineOfApprox& SSP, const math_Vector& Parameters, const Standard_Integer Deg, const math_Matrix& DA); + //! returns the Inverse of Cont*Transposed(Cont), where + //! Cont is the constraint matrix for the algorithm. Standard_EXPORT const math_Matrix& InverseMatrix() const; @@ -63,8 +80,10 @@ public: protected: + //! is used internally to create the fields. Standard_EXPORT Standard_Integer NbConstraints (const BRepApprox_TheMultiLineOfApprox& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints) const; + //! is internally used for the fields creation. Standard_EXPORT Standard_Integer NbColumns (const BRepApprox_TheMultiLineOfApprox& SSP, const Standard_Integer Deg) const; diff --git a/src/BRepApprox/BRepApprox_TheComputeLineBezierOfApprox.hxx b/src/BRepApprox/BRepApprox_TheComputeLineBezierOfApprox.hxx index 3a7e3e853e..331323eb04 100644 --- a/src/BRepApprox/BRepApprox_TheComputeLineBezierOfApprox.hxx +++ b/src/BRepApprox/BRepApprox_TheComputeLineBezierOfApprox.hxx @@ -54,40 +54,72 @@ public: DEFINE_STANDARD_ALLOC + //! The MultiLine will be approximated until tolerances + //! will be reached. + //! The approximation will be done from degreemin to degreemax + //! with a cutting if the corresponding boolean is True. + //! If is True, the computation will be done with + //! no iteration at all. Standard_EXPORT BRepApprox_TheComputeLineBezierOfApprox(const BRepApprox_TheMultiLineOfApprox& Line, const Standard_Integer degreemin = 4, const Standard_Integer degreemax = 8, const Standard_Real Tolerance3d = 1.0e-3, const Standard_Real Tolerance2d = 1.0e-6, const Standard_Integer NbIterations = 5, const Standard_Boolean cutting = Standard_True, const Approx_ParametrizationType parametrization = Approx_ChordLength, const Standard_Boolean Squares = Standard_False); + //! The MultiLine will be approximated until tolerances + //! will be reached. + //! The approximation will be done from degreemin to degreemax + //! with a cutting if the corresponding boolean is True. + //! If is True, the computation will be done with + //! no iteration at all. Standard_EXPORT BRepApprox_TheComputeLineBezierOfApprox(const BRepApprox_TheMultiLineOfApprox& Line, const math_Vector& Parameters, const Standard_Integer degreemin = 4, const Standard_Integer degreemax = 8, const Standard_Real Tolerance3d = 1.0e-03, const Standard_Real Tolerance2d = 1.0e-06, const Standard_Integer NbIterations = 5, const Standard_Boolean cutting = Standard_True, const Standard_Boolean Squares = Standard_False); + //! Initializes the fields of the algorithm. Standard_EXPORT BRepApprox_TheComputeLineBezierOfApprox(const math_Vector& Parameters, const Standard_Integer degreemin = 4, const Standard_Integer degreemax = 8, const Standard_Real Tolerance3d = 1.0e-03, const Standard_Real Tolerance2d = 1.0e-06, const Standard_Integer NbIterations = 5, const Standard_Boolean cutting = Standard_True, const Standard_Boolean Squares = Standard_False); + //! Initializes the fields of the algorithm. Standard_EXPORT BRepApprox_TheComputeLineBezierOfApprox(const Standard_Integer degreemin = 4, const Standard_Integer degreemax = 8, const Standard_Real Tolerance3d = 1.0e-03, const Standard_Real Tolerance2d = 1.0e-06, const Standard_Integer NbIterations = 5, const Standard_Boolean cutting = Standard_True, const Approx_ParametrizationType parametrization = Approx_ChordLength, const Standard_Boolean Squares = Standard_False); + //! Initializes the fields of the algorithm. Standard_EXPORT void Init (const Standard_Integer degreemin = 4, const Standard_Integer degreemax = 8, const Standard_Real Tolerance3d = 1.0e-03, const Standard_Real Tolerance2d = 1.0e-06, const Standard_Integer NbIterations = 5, const Standard_Boolean cutting = Standard_True, const Approx_ParametrizationType parametrization = Approx_ChordLength, const Standard_Boolean Squares = Standard_False); + //! runs the algorithm after having initialized the fields. Standard_EXPORT void Perform (const BRepApprox_TheMultiLineOfApprox& Line); + //! changes the degrees of the approximation. Standard_EXPORT void SetDegrees (const Standard_Integer degreemin, const Standard_Integer degreemax); + //! Changes the tolerances of the approximation. Standard_EXPORT void SetTolerances (const Standard_Real Tolerance3d, const Standard_Real Tolerance2d); + //! changes the first and the last constraint points. Standard_EXPORT void SetConstraints (const AppParCurves_Constraint firstC, const AppParCurves_Constraint lastC); + //! returns False if at a moment of the approximation, + //! the status NoApproximation has been sent by the user + //! when more points were needed. Standard_EXPORT Standard_Boolean IsAllApproximated() const; + //! returns False if the status NoPointsAdded has been sent. Standard_EXPORT Standard_Boolean IsToleranceReached() const; + //! returns the tolerances 2d and 3d of the MultiCurve. Standard_EXPORT void Error (const Standard_Integer Index, Standard_Real& tol3d, Standard_Real& tol2d) const; + //! Returns the number of MultiCurve doing the approximation + //! of the MultiLine. Standard_EXPORT Standard_Integer NbMultiCurves() const; + //! returns the result of the approximation. Standard_EXPORT const AppParCurves_MultiCurve& Value (const Standard_Integer Index = 1) const; + //! returns the result of the approximation. Standard_EXPORT AppParCurves_MultiCurve& ChangeValue (const Standard_Integer Index = 1); + //! returns the result of the approximation. Standard_EXPORT const AppParCurves_MultiBSpCurve& SplineValue(); + //! returns the type of parametrization Standard_EXPORT void Parametrization (Approx_ParametrizationType& partype) const; + //! returns the new parameters of the approximation + //! corresponding to the points of the multicurve . Standard_EXPORT const TColStd_Array1OfReal& Parameters (const Standard_Integer Index = 1) const; @@ -102,10 +134,13 @@ protected: private: + //! is internally used in the algorithm. Standard_EXPORT Standard_Boolean Compute (const BRepApprox_TheMultiLineOfApprox& Line, const Standard_Integer fpt, const Standard_Integer lpt, math_Vector& Para, Standard_Real& TheTol3d, Standard_Real& TheTol2d); + //! is internally used in the algorithm. Standard_EXPORT Standard_Boolean ComputeCurve (const BRepApprox_TheMultiLineOfApprox& Line, const Standard_Integer firspt, const Standard_Integer lastpt); + //! computes new parameters between firstP and lastP. Standard_EXPORT void Parameters (const BRepApprox_TheMultiLineOfApprox& Line, const Standard_Integer firstP, const Standard_Integer LastP, math_Vector& TheParameters) const; Standard_EXPORT Standard_Real SearchFirstLambda (const BRepApprox_TheMultiLineOfApprox& Line, const math_Vector& Para, const math_Vector& V, const Standard_Integer index) const; diff --git a/src/BRepApprox/BRepApprox_TheComputeLineOfApprox.hxx b/src/BRepApprox/BRepApprox_TheComputeLineOfApprox.hxx index b48f01c07e..9e8787544e 100644 --- a/src/BRepApprox/BRepApprox_TheComputeLineOfApprox.hxx +++ b/src/BRepApprox/BRepApprox_TheComputeLineOfApprox.hxx @@ -56,44 +56,86 @@ public: DEFINE_STANDARD_ALLOC + //! The MultiLine will be approximated until tolerances + //! will be reached. + //! The approximation will be done from degreemin to degreemax + //! with a cutting if the corresponding boolean is True. + //! If is True, the computation will be done with + //! no iteration at all. + //! + //! The multiplicities of the internal knots is set by + //! default. Standard_EXPORT BRepApprox_TheComputeLineOfApprox(const BRepApprox_TheMultiLineOfApprox& Line, const Standard_Integer degreemin = 4, const Standard_Integer degreemax = 8, const Standard_Real Tolerance3d = 1.0e-3, const Standard_Real Tolerance2d = 1.0e-6, const Standard_Integer NbIterations = 5, const Standard_Boolean cutting = Standard_True, const Approx_ParametrizationType parametrization = Approx_ChordLength, const Standard_Boolean Squares = Standard_False); + //! The MultiLine will be approximated until tolerances + //! will be reached. + //! The approximation will be done from degreemin to degreemax + //! with a cutting if the corresponding boolean is True. + //! If is True, the computation will be done with + //! no iteration at all. Standard_EXPORT BRepApprox_TheComputeLineOfApprox(const BRepApprox_TheMultiLineOfApprox& Line, const math_Vector& Parameters, const Standard_Integer degreemin = 4, const Standard_Integer degreemax = 8, const Standard_Real Tolerance3d = 1.0e-03, const Standard_Real Tolerance2d = 1.0e-06, const Standard_Integer NbIterations = 5, const Standard_Boolean cutting = Standard_True, const Standard_Boolean Squares = Standard_False); + //! Initializes the fields of the algorithm. Standard_EXPORT BRepApprox_TheComputeLineOfApprox(const math_Vector& Parameters, const Standard_Integer degreemin = 4, const Standard_Integer degreemax = 8, const Standard_Real Tolerance3d = 1.0e-03, const Standard_Real Tolerance2d = 1.0e-06, const Standard_Integer NbIterations = 5, const Standard_Boolean cutting = Standard_True, const Standard_Boolean Squares = Standard_False); + //! Initializes the fields of the algorithm. Standard_EXPORT BRepApprox_TheComputeLineOfApprox(const Standard_Integer degreemin = 4, const Standard_Integer degreemax = 8, const Standard_Real Tolerance3d = 1.0e-03, const Standard_Real Tolerance2d = 1.0e-06, const Standard_Integer NbIterations = 5, const Standard_Boolean cutting = Standard_True, const Approx_ParametrizationType parametrization = Approx_ChordLength, const Standard_Boolean Squares = Standard_False); + //! Constructs an interpolation of the MultiLine + //! The result will be a C2 curve of degree 3. Standard_EXPORT void Interpol (const BRepApprox_TheMultiLineOfApprox& Line); + //! Initializes the fields of the algorithm. Standard_EXPORT void Init (const Standard_Integer degreemin = 4, const Standard_Integer degreemax = 8, const Standard_Real Tolerance3d = 1.0e-03, const Standard_Real Tolerance2d = 1.0e-06, const Standard_Integer NbIterations = 5, const Standard_Boolean cutting = Standard_True, const Approx_ParametrizationType parametrization = Approx_ChordLength, const Standard_Boolean Squares = Standard_False); + //! runs the algorithm after having initialized the fields. Standard_EXPORT void Perform (const BRepApprox_TheMultiLineOfApprox& Line); + //! The approximation will begin with the + //! set of parameters . Standard_EXPORT void SetParameters (const math_Vector& ThePar); + //! The approximation will be done with the + //! set of knots . The multiplicities will be set + //! with the degree and the desired continuity. Standard_EXPORT void SetKnots (const TColStd_Array1OfReal& Knots); + //! The approximation will be done with the + //! set of knots and the multiplicities . Standard_EXPORT void SetKnotsAndMultiplicities (const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults); + //! changes the degrees of the approximation. Standard_EXPORT void SetDegrees (const Standard_Integer degreemin, const Standard_Integer degreemax); + //! Changes the tolerances of the approximation. Standard_EXPORT void SetTolerances (const Standard_Real Tolerance3d, const Standard_Real Tolerance2d); + //! sets the continuity of the spline. + //! if C = 2, the spline will be C2. Standard_EXPORT void SetContinuity (const Standard_Integer C); + //! changes the first and the last constraint points. Standard_EXPORT void SetConstraints (const AppParCurves_Constraint firstC, const AppParCurves_Constraint lastC); + //! returns False if at a moment of the approximation, + //! the status NoApproximation has been sent by the user + //! when more points were needed. Standard_EXPORT Standard_Boolean IsAllApproximated() const; + //! returns False if the status NoPointsAdded has been sent. Standard_EXPORT Standard_Boolean IsToleranceReached() const; + //! returns the tolerances 2d and 3d of the MultiBSpCurve. Standard_EXPORT void Error (Standard_Real& tol3d, Standard_Real& tol2d) const; + //! returns the result of the approximation. Standard_EXPORT const AppParCurves_MultiBSpCurve& Value() const; + //! returns the result of the approximation. Standard_EXPORT AppParCurves_MultiBSpCurve& ChangeValue(); + //! returns the new parameters of the approximation + //! corresponding to the points of the MultiBSpCurve. Standard_EXPORT const TColStd_Array1OfReal& Parameters() const; @@ -108,10 +150,13 @@ protected: private: + //! is internally used in the algorithm. Standard_EXPORT Standard_Boolean Compute (const BRepApprox_TheMultiLineOfApprox& Line, const Standard_Integer fpt, const Standard_Integer lpt, math_Vector& Para, const TColStd_Array1OfReal& Knots, TColStd_Array1OfInteger& Mults); + //! is internally used in the algorithm. Standard_EXPORT Standard_Boolean ComputeCurve (const BRepApprox_TheMultiLineOfApprox& Line, const Standard_Integer firspt, const Standard_Integer lastpt); + //! computes new parameters between firstP and lastP. Standard_EXPORT void Parameters (const BRepApprox_TheMultiLineOfApprox& Line, const Standard_Integer firstP, const Standard_Integer LastP, math_Vector& TheParameters) const; Standard_EXPORT Standard_Real SearchFirstLambda (const BRepApprox_TheMultiLineOfApprox& Line, const math_Vector& Para, const TColStd_Array1OfReal& Knots, const math_Vector& V, const Standard_Integer index) const; diff --git a/src/BRepApprox/BRepApprox_TheFunctionOfTheInt2SOfThePrmPrmSvSurfacesOfApprox.hxx b/src/BRepApprox/BRepApprox_TheFunctionOfTheInt2SOfThePrmPrmSvSurfacesOfApprox.hxx index b1e532d084..8f652cdab6 100644 --- a/src/BRepApprox/BRepApprox_TheFunctionOfTheInt2SOfThePrmPrmSvSurfacesOfApprox.hxx +++ b/src/BRepApprox/BRepApprox_TheFunctionOfTheInt2SOfThePrmPrmSvSurfacesOfApprox.hxx @@ -48,6 +48,7 @@ public: DEFINE_STANDARD_ALLOC + //! Raises Construction Error Standard_EXPORT BRepApprox_TheFunctionOfTheInt2SOfThePrmPrmSvSurfacesOfApprox(); Standard_EXPORT BRepApprox_TheFunctionOfTheInt2SOfThePrmPrmSvSurfacesOfApprox(const BRepAdaptor_Surface& S1, const BRepAdaptor_Surface& S2); @@ -64,6 +65,7 @@ public: Standard_EXPORT void ComputeParameters (const IntImp_ConstIsoparametric ChoixIso, const TColStd_Array1OfReal& Param, math_Vector& UVap, math_Vector& BornInf, math_Vector& BornSup, math_Vector& Tolerance); + //! returns somme des fi*fi Standard_Real Root() const; gp_Pnt Point() const; diff --git a/src/BRepApprox/BRepApprox_TheImpPrmSvSurfacesOfApprox.hxx b/src/BRepApprox/BRepApprox_TheImpPrmSvSurfacesOfApprox.hxx index 6e4f176702..d711bc0f28 100644 --- a/src/BRepApprox/BRepApprox_TheImpPrmSvSurfacesOfApprox.hxx +++ b/src/BRepApprox/BRepApprox_TheImpPrmSvSurfacesOfApprox.hxx @@ -52,6 +52,7 @@ public: Standard_EXPORT BRepApprox_TheImpPrmSvSurfacesOfApprox(const IntSurf_Quadric& Surf1, const BRepAdaptor_Surface& Surf2); + //! returns True if Tg,Tguv1 Tguv2 can be computed. Standard_EXPORT Standard_Boolean Compute (Standard_Real& u1, Standard_Real& v1, Standard_Real& u2, Standard_Real& v2, gp_Pnt& Pt, gp_Vec& Tg, gp_Vec2d& Tguv1, gp_Vec2d& Tguv2); Standard_EXPORT void Pnt (const Standard_Real u1, const Standard_Real v1, const Standard_Real u2, const Standard_Real v2, gp_Pnt& P); diff --git a/src/BRepApprox/BRepApprox_TheInt2SOfThePrmPrmSvSurfacesOfApprox.hxx b/src/BRepApprox/BRepApprox_TheInt2SOfThePrmPrmSvSurfacesOfApprox.hxx index 087c49825e..e2e8417037 100644 --- a/src/BRepApprox/BRepApprox_TheInt2SOfThePrmPrmSvSurfacesOfApprox.hxx +++ b/src/BRepApprox/BRepApprox_TheInt2SOfThePrmPrmSvSurfacesOfApprox.hxx @@ -50,32 +50,68 @@ public: DEFINE_STANDARD_ALLOC + //! Raises Construction Error Standard_EXPORT BRepApprox_TheInt2SOfThePrmPrmSvSurfacesOfApprox(); + //! compute the solution point with the close point Standard_EXPORT BRepApprox_TheInt2SOfThePrmPrmSvSurfacesOfApprox(const TColStd_Array1OfReal& Param, const BRepAdaptor_Surface& S1, const BRepAdaptor_Surface& S2, const Standard_Real TolTangency); + //! initialize the parameters to compute the solution point + //! it 's possible to write to optimize: + //! IntImp_Int2S inter(S1,S2,Func,TolTangency); + //! math_FunctionSetRoot rsnld(inter.Function()); + //! while ...{ + //! Param(1)=... + //! Param(2)=... + //! param(3)=... + //! inter.Perform(Param,rsnld); + //! } Standard_EXPORT BRepApprox_TheInt2SOfThePrmPrmSvSurfacesOfApprox(const BRepAdaptor_Surface& S1, const BRepAdaptor_Surface& S2, const Standard_Real TolTangency); + //! returns the best constant isoparametric to find + //! the next intersection's point +stores the solution + //! point (the solution point is found with the close point + //! to intersect the isoparametric with the other patch; + //! the choice of the isoparametic is calculated) Standard_EXPORT IntImp_ConstIsoparametric Perform (const TColStd_Array1OfReal& Param, math_FunctionSetRoot& Rsnld); + //! returns the best constant isoparametric to find + //! the next intersection's point +stores the solution + //! point (the solution point is found with the close point + //! to intersect the isoparametric with the other patch; + //! the choice of the isoparametic is given by ChoixIso) Standard_EXPORT IntImp_ConstIsoparametric Perform (const TColStd_Array1OfReal& Param, math_FunctionSetRoot& Rsnld, const IntImp_ConstIsoparametric ChoixIso); + //! Returns TRUE if the creation completed without failure. Standard_Boolean IsDone() const; + //! Returns TRUE when there is no solution to the problem. Standard_Boolean IsEmpty() const; + //! Returns the intersection point. const IntSurf_PntOn2S& Point() const; + //! Returns True if the surfaces are tangent at the + //! intersection point. Standard_Boolean IsTangent() const; + //! Returns the tangent at the intersection line. const gp_Dir& Direction() const; + //! Returns the tangent at the intersection line in the + //! parametric space of the first surface. const gp_Dir2d& DirectionOnS1() const; + //! Returns the tangent at the intersection line in the + //! parametric space of the second surface. const gp_Dir2d& DirectionOnS2() const; + //! return the math function which + //! is used to compute the intersection BRepApprox_TheFunctionOfTheInt2SOfThePrmPrmSvSurfacesOfApprox& Function(); + //! return the intersection point which is + //! enable for changing. IntSurf_PntOn2S& ChangePoint(); diff --git a/src/BRepApprox/BRepApprox_TheMultiLineOfApprox.hxx b/src/BRepApprox/BRepApprox_TheMultiLineOfApprox.hxx index 7bbdd0cc80..8df99ddb03 100644 --- a/src/BRepApprox/BRepApprox_TheMultiLineOfApprox.hxx +++ b/src/BRepApprox/BRepApprox_TheMultiLineOfApprox.hxx @@ -42,34 +42,59 @@ public: DEFINE_STANDARD_ALLOC + //! The class SvSurfaces is used when the + //! approximation algorithm needs some extra points on + //! the line . A New line is then created which + //! shares the same surfaces and functions. + //! + //! SvSurfaces is a deferred class which allows + //! several implementations of this algorithm with + //! different surfaces (bi-parametric ones, or + //! implicit and biparametric ones) Standard_EXPORT BRepApprox_TheMultiLineOfApprox(const Handle(BRepApprox_ApproxLine)& line, const Standard_Address PtrSvSurfaces, const Standard_Integer NbP3d, const Standard_Integer NbP2d, const Standard_Real xo, const Standard_Real ax, const Standard_Real yo, const Standard_Real ay, const Standard_Real zo, const Standard_Real az, const Standard_Real u1o, const Standard_Real a1u, const Standard_Real v1o, const Standard_Real a1v, const Standard_Real u2o, const Standard_Real a2u, const Standard_Real v2o, const Standard_Real a2v, const Standard_Boolean P2DOnFirst, const Standard_Integer IndMin = 0, const Standard_Integer IndMax = 0); + //! No Extra points will be added on the current line Standard_EXPORT BRepApprox_TheMultiLineOfApprox(const Handle(BRepApprox_ApproxLine)& line, const Standard_Integer NbP3d, const Standard_Integer NbP2d, const Standard_Real xo, const Standard_Real ax, const Standard_Real yo, const Standard_Real ay, const Standard_Real zo, const Standard_Real az, const Standard_Real u1o, const Standard_Real a1u, const Standard_Real v1o, const Standard_Real a1v, const Standard_Real u2o, const Standard_Real a2u, const Standard_Real v2o, const Standard_Real a2v, const Standard_Boolean P2DOnFirst, const Standard_Integer IndMin = 0, const Standard_Integer IndMax = 0); Standard_EXPORT Standard_Integer FirstPoint() const; Standard_EXPORT Standard_Integer LastPoint() const; + //! Returns the number of 2d points of a TheLine. Standard_EXPORT Standard_Integer NbP2d() const; + //! Returns the number of 3d points of a TheLine. Standard_EXPORT Standard_Integer NbP3d() const; Standard_EXPORT Approx_Status WhatStatus() const; + //! returns the 3d points of the multipoint + //! when only 3d points exist. Standard_EXPORT void Value (const Standard_Integer MPointIndex, TColgp_Array1OfPnt& tabPt) const; + //! returns the 2d points of the multipoint + //! when only 2d points exist. Standard_EXPORT void Value (const Standard_Integer MPointIndex, TColgp_Array1OfPnt2d& tabPt2d) const; + //! returns the 3d and 2d points of the multipoint + //! . Standard_EXPORT void Value (const Standard_Integer MPointIndex, TColgp_Array1OfPnt& tabPt, TColgp_Array1OfPnt2d& tabPt2d) const; + //! returns the 3d points of the multipoint + //! when only 3d points exist. Standard_EXPORT Standard_Boolean Tangency (const Standard_Integer MPointIndex, TColgp_Array1OfVec& tabV) const; + //! returns the 2d tangency points of the multipoint + //! only when 2d points exist. Standard_EXPORT Standard_Boolean Tangency (const Standard_Integer MPointIndex, TColgp_Array1OfVec2d& tabV2d) const; + //! returns the 3d and 2d points of the multipoint + //! . Standard_EXPORT Standard_Boolean Tangency (const Standard_Integer MPointIndex, TColgp_Array1OfVec& tabV, TColgp_Array1OfVec2d& tabV2d) const; Standard_EXPORT BRepApprox_TheMultiLineOfApprox MakeMLBetween (const Standard_Integer Low, const Standard_Integer High, const Standard_Integer NbPointsToInsert) const; + //! Dump of the current multi-line. Standard_EXPORT void Dump() const; diff --git a/src/BRepApprox/BRepApprox_TheMultiLineToolOfApprox.hxx b/src/BRepApprox/BRepApprox_TheMultiLineToolOfApprox.hxx index 6c9f9b35d6..4cceba14bf 100644 --- a/src/BRepApprox/BRepApprox_TheMultiLineToolOfApprox.hxx +++ b/src/BRepApprox/BRepApprox_TheMultiLineToolOfApprox.hxx @@ -41,36 +41,60 @@ public: DEFINE_STANDARD_ALLOC + //! Returns the number of multipoints of the TheMultiLine. static Standard_Integer FirstPoint (const BRepApprox_TheMultiLineOfApprox& ML); + //! Returns the number of multipoints of the TheMultiLine. static Standard_Integer LastPoint (const BRepApprox_TheMultiLineOfApprox& ML); + //! Returns the number of 2d points of a TheMultiLine. static Standard_Integer NbP2d (const BRepApprox_TheMultiLineOfApprox& ML); + //! Returns the number of 3d points of a TheMultiLine. static Standard_Integer NbP3d (const BRepApprox_TheMultiLineOfApprox& ML); + //! returns the 3d points of the multipoint + //! when only 3d points exist. static void Value (const BRepApprox_TheMultiLineOfApprox& ML, const Standard_Integer MPointIndex, TColgp_Array1OfPnt& tabPt); + //! returns the 2d points of the multipoint + //! when only 2d points exist. static void Value (const BRepApprox_TheMultiLineOfApprox& ML, const Standard_Integer MPointIndex, TColgp_Array1OfPnt2d& tabPt2d); + //! returns the 3d and 2d points of the multipoint + //! . static void Value (const BRepApprox_TheMultiLineOfApprox& ML, const Standard_Integer MPointIndex, TColgp_Array1OfPnt& tabPt, TColgp_Array1OfPnt2d& tabPt2d); + //! returns the 3d points of the multipoint + //! when only 3d points exist. static Standard_Boolean Tangency (const BRepApprox_TheMultiLineOfApprox& ML, const Standard_Integer MPointIndex, TColgp_Array1OfVec& tabV); + //! returns the 2d tangency points of the multipoint + //! only when 2d points exist. static Standard_Boolean Tangency (const BRepApprox_TheMultiLineOfApprox& ML, const Standard_Integer MPointIndex, TColgp_Array1OfVec2d& tabV2d); + //! returns the 3d and 2d points of the multipoint + //! . static Standard_Boolean Tangency (const BRepApprox_TheMultiLineOfApprox& ML, const Standard_Integer MPointIndex, TColgp_Array1OfVec& tabV, TColgp_Array1OfVec2d& tabV2d); + //! returns the 3d curvature of the multipoint + //! when only 3d points exist. static Standard_Boolean Curvature (const BRepApprox_TheMultiLineOfApprox& ML, const Standard_Integer MPointIndex, TColgp_Array1OfVec& tabV); + //! returns the 2d curvature points of the multipoint + //! only when 2d points exist. static Standard_Boolean Curvature (const BRepApprox_TheMultiLineOfApprox& ML, const Standard_Integer MPointIndex, TColgp_Array1OfVec2d& tabV2d); + //! returns the 3d and 2d curvature of the multipoint + //! . static Standard_Boolean Curvature (const BRepApprox_TheMultiLineOfApprox& ML, const Standard_Integer MPointIndex, TColgp_Array1OfVec& tabV, TColgp_Array1OfVec2d& tabV2d); + //! Is called if WhatStatus returned "PointsAdded". static BRepApprox_TheMultiLineOfApprox MakeMLBetween (const BRepApprox_TheMultiLineOfApprox& ML, const Standard_Integer I1, const Standard_Integer I2, const Standard_Integer NbPMin); static Approx_Status WhatStatus (const BRepApprox_TheMultiLineOfApprox& ML, const Standard_Integer I1, const Standard_Integer I2); + //! Dump of the current multi-line. Standard_EXPORT static void Dump (const BRepApprox_TheMultiLineOfApprox& ML); diff --git a/src/BRepApprox/BRepApprox_ThePrmPrmSvSurfacesOfApprox.hxx b/src/BRepApprox/BRepApprox_ThePrmPrmSvSurfacesOfApprox.hxx index dc7efe1ae8..76a35d6d16 100644 --- a/src/BRepApprox/BRepApprox_ThePrmPrmSvSurfacesOfApprox.hxx +++ b/src/BRepApprox/BRepApprox_ThePrmPrmSvSurfacesOfApprox.hxx @@ -49,6 +49,7 @@ public: Standard_EXPORT BRepApprox_ThePrmPrmSvSurfacesOfApprox(const BRepAdaptor_Surface& Surf1, const BRepAdaptor_Surface& Surf2); + //! returns True if Tg,Tguv1 Tguv2 can be computed. Standard_EXPORT Standard_Boolean Compute (Standard_Real& u1, Standard_Real& v1, Standard_Real& u2, Standard_Real& v2, gp_Pnt& Pt, gp_Vec& Tg, gp_Vec2d& Tguv1, gp_Vec2d& Tguv2); Standard_EXPORT void Pnt (const Standard_Real u1, const Standard_Real v1, const Standard_Real u2, const Standard_Real v2, gp_Pnt& P); diff --git a/src/BRepApprox/BRepApprox_TheZerImpFuncOfTheImpPrmSvSurfacesOfApprox.hxx b/src/BRepApprox/BRepApprox_TheZerImpFuncOfTheImpPrmSvSurfacesOfApprox.hxx index c045382650..e863ce2a29 100644 --- a/src/BRepApprox/BRepApprox_TheZerImpFuncOfTheImpPrmSvSurfacesOfApprox.hxx +++ b/src/BRepApprox/BRepApprox_TheZerImpFuncOfTheImpPrmSvSurfacesOfApprox.hxx @@ -73,6 +73,8 @@ public: Standard_Real Root() const; + //! Returns the value Tol so that if Abs(Func.Root()).

is + //! the original length of the segment on used to + //! compute intersections. is the tolerance + //! attached to the line segment in intersections. Standard_EXPORT void Reset (const gp_Lin2d& L, const Standard_Real P, const Standard_Real Tol); + //! Updates the classification process with the edge + //! from the boundary. Standard_EXPORT void Compare (const BRepClass_Edge& E, const TopAbs_Orientation Or); + //! Returns the current value of the parameter. Standard_Real Parameter() const; + //! Returns the intersecting algorithm. BRepClass_Intersector& Intersector(); + //! Returns 0 if the last compared edge had no + //! relevant intersection. Else returns the index of + //! this intersection in the last intersection + //! algorithm. Standard_Integer ClosestIntersection() const; + //! Returns the current state of the point. TopAbs_State State() const; + //! Returns the Standard_True if the closest intersection point + //! represents head or end of the edge. Returns Standard_False + //! otherwise. Standard_Boolean IsHeadOrEnd() const; diff --git a/src/BRepClass/BRepClass_FClassifier.hxx b/src/BRepClass/BRepClass_FClassifier.hxx index a0823b3c76..359d8f9db2 100644 --- a/src/BRepClass/BRepClass_FClassifier.hxx +++ b/src/BRepClass/BRepClass_FClassifier.hxx @@ -43,22 +43,39 @@ public: DEFINE_STANDARD_ALLOC + //! Empty constructor, undefined algorithm. Standard_EXPORT BRepClass_FClassifier(); + //! Creates an algorithm to classify the Point P with + //! Tolerance on the face described by . Standard_EXPORT BRepClass_FClassifier(BRepClass_FaceExplorer& F, const gp_Pnt2d& P, const Standard_Real Tol); + //! Classify the Point P with Tolerance on the + //! face described by . Standard_EXPORT void Perform (BRepClass_FaceExplorer& F, const gp_Pnt2d& P, const Standard_Real Tol); + //! Returns the result of the classification. Standard_EXPORT TopAbs_State State() const; + //! Returns True when the state was computed by a + //! rejection. The state is OUT. Standard_Boolean Rejected() const; + //! Returns True if the face contains no wire. The + //! state is IN. Standard_Boolean NoWires() const; + //! Returns the Edge used to determine the + //! classification. When the State is ON this is the + //! Edge containing the point. Standard_EXPORT const BRepClass_Edge& Edge() const; + //! Returns the parameter on Edge() used to determine the + //! classification. Standard_EXPORT Standard_Real EdgeParameter() const; + //! Returns the position of the point on the edge + //! returned by Edge. IntRes2d_Position Position() const; diff --git a/src/BRepClass/BRepClass_FacePassiveClassifier.hxx b/src/BRepClass/BRepClass_FacePassiveClassifier.hxx index 38ac550631..9063f70326 100644 --- a/src/BRepClass/BRepClass_FacePassiveClassifier.hxx +++ b/src/BRepClass/BRepClass_FacePassiveClassifier.hxx @@ -43,20 +43,38 @@ public: DEFINE_STANDARD_ALLOC + //! Creates an undefined classifier. Standard_EXPORT BRepClass_FacePassiveClassifier(); + //! Starts a classification process. The point to + //! classify is the origin of the line .

is + //! the original length of the segment on used to + //! compute intersections. is the tolerance + //! attached to the line segment in intersections. Standard_EXPORT void Reset (const gp_Lin2d& L, const Standard_Real P, const Standard_Real Tol); + //! Updates the classification process with the edge + //! from the boundary. Standard_EXPORT void Compare (const BRepClass_Edge& E, const TopAbs_Orientation Or); + //! Returns the current value of the parameter. Standard_Real Parameter() const; + //! Returns the intersecting algorithm. BRepClass_Intersector& Intersector(); + //! Returns 0 if the last compared edge had no + //! relevant intersection. Else returns the index of + //! this intersection in the last intersection + //! algorithm. Standard_Integer ClosestIntersection() const; + //! Returns the current state of the point. TopAbs_State State() const; + //! Returns the Standard_True if the closest intersection point + //! represents head or end of the edge. Returns Standard_False + //! otherwise. Standard_Boolean IsHeadOrEnd() const; diff --git a/src/BRepClass3d/BRepClass3d_SolidPassiveClassifier.hxx b/src/BRepClass3d/BRepClass3d_SolidPassiveClassifier.hxx index a60d135ead..5692219e64 100644 --- a/src/BRepClass3d/BRepClass3d_SolidPassiveClassifier.hxx +++ b/src/BRepClass3d/BRepClass3d_SolidPassiveClassifier.hxx @@ -42,18 +42,30 @@ public: DEFINE_STANDARD_ALLOC + //! Creates an undefined classifier. Standard_EXPORT BRepClass3d_SolidPassiveClassifier(); + //! Starts a classification process. The point to + //! classify is the origin of the line .

is + //! the original length of the segment on used to + //! compute intersections. is the tolerance + //! attached to the intersections. Standard_EXPORT void Reset (const gp_Lin& L, const Standard_Real P, const Standard_Real Tol); + //! Updates the classification process with the face + //! from the boundary. Standard_EXPORT void Compare (const TopoDS_Face& F, const TopAbs_Orientation Or); + //! Returns the current value of the parameter. Standard_Real Parameter() const; + //! Returns True if an intersection is computed. Standard_EXPORT Standard_Boolean HasIntersection() const; + //! Returns the intersecting algorithm. BRepClass3d_Intersector3d& Intersector(); + //! Returns the current state of the point. TopAbs_State State() const; diff --git a/src/BRepFill/BRepFill_ComputeCLine.hxx b/src/BRepFill/BRepFill_ComputeCLine.hxx index 028e423607..2b438001d5 100644 --- a/src/BRepFill/BRepFill_ComputeCLine.hxx +++ b/src/BRepFill/BRepFill_ComputeCLine.hxx @@ -40,26 +40,43 @@ public: DEFINE_STANDARD_ALLOC + //! The MultiLine will be approximated until tolerances + //! will be reached. + //! The approximation will be done from degreemin to degreemax + //! with a cutting if the corresponding boolean is True. Standard_EXPORT BRepFill_ComputeCLine(const BRepFill_MultiLine& Line, const Standard_Integer degreemin = 3, const Standard_Integer degreemax = 8, const Standard_Real Tolerance3d = 1.0e-5, const Standard_Real Tolerance2d = 1.0e-5, const Standard_Boolean cutting = Standard_False, const AppParCurves_Constraint FirstC = AppParCurves_TangencyPoint, const AppParCurves_Constraint LastC = AppParCurves_TangencyPoint); + //! Initializes the fields of the algorithm. Standard_EXPORT BRepFill_ComputeCLine(const Standard_Integer degreemin = 3, const Standard_Integer degreemax = 8, const Standard_Real Tolerance3d = 1.0e-05, const Standard_Real Tolerance2d = 1.0e-05, const Standard_Boolean cutting = Standard_False, const AppParCurves_Constraint FirstC = AppParCurves_TangencyPoint, const AppParCurves_Constraint LastC = AppParCurves_TangencyPoint); + //! runs the algorithm after having initialized the fields. Standard_EXPORT void Perform (const BRepFill_MultiLine& Line); + //! changes the degrees of the approximation. Standard_EXPORT void SetDegrees (const Standard_Integer degreemin, const Standard_Integer degreemax); + //! Changes the tolerances of the approximation. Standard_EXPORT void SetTolerances (const Standard_Real Tolerance3d, const Standard_Real Tolerance2d); + //! Changes the constraints of the approximation. Standard_EXPORT void SetConstraints (const AppParCurves_Constraint FirstC, const AppParCurves_Constraint LastC); + //! returns False if at a moment of the approximation, + //! the status NoApproximation has been sent by the user + //! when more points were needed. Standard_EXPORT Standard_Boolean IsAllApproximated() const; + //! returns False if the status NoPointsAdded has been sent. Standard_EXPORT Standard_Boolean IsToleranceReached() const; + //! returns the tolerances 2d and 3d of the MultiCurve. Standard_EXPORT void Error (const Standard_Integer Index, Standard_Real& tol3d, Standard_Real& tol2d) const; + //! Returns the number of MultiCurve doing the approximation + //! of the MultiLine. Standard_EXPORT Standard_Integer NbMultiCurves() const; + //! returns the approximation MultiCurve of range . Standard_EXPORT AppParCurves_MultiCurve Value (const Standard_Integer Index = 1) const; Standard_EXPORT void Parameters (const Standard_Integer Index, Standard_Real& firstp, Standard_Real& lastp) const; @@ -76,6 +93,7 @@ protected: private: + //! is internally used by the algorithms. Standard_EXPORT Standard_Boolean Compute (const BRepFill_MultiLine& Line, const Standard_Real Ufirst, const Standard_Real Ulast, Standard_Real& TheTol3d, Standard_Real& TheTol2d); diff --git a/src/BRepLProp/BRepLProp_CLProps.hxx b/src/BRepLProp/BRepLProp_CLProps.hxx index a0c85fdab4..7503ed5ddc 100644 --- a/src/BRepLProp/BRepLProp_CLProps.hxx +++ b/src/BRepLProp/BRepLProp_CLProps.hxx @@ -48,32 +48,68 @@ public: DEFINE_STANDARD_ALLOC + //! Initializes the local properties of the curve + //! The current point and the derivatives are + //! computed at the same time, which allows an + //! optimization of the computation time. + //! indicates the maximum number of derivations to + //! be done (0, 1, 2 or 3). For example, to compute + //! only the tangent, N should be equal to 1. + //! is the linear tolerance (it is used to test + //! if a vector is null). Standard_EXPORT BRepLProp_CLProps(const BRepAdaptor_Curve& C, const Standard_Integer N, const Standard_Real Resolution); + //! Same as previous constructor but here the parameter is + //! set to the value . + //! All the computations done will be related to and . Standard_EXPORT BRepLProp_CLProps(const BRepAdaptor_Curve& C, const Standard_Real U, const Standard_Integer N, const Standard_Real Resolution); + //! Same as previous constructor but here the parameter is + //! set to the value and the curve is set + //! with SetCurve. + //! the curve can have a empty constructor + //! All the computations done will be related to and + //! when the functions "set" will be done. Standard_EXPORT BRepLProp_CLProps(const Standard_Integer N, const Standard_Real Resolution); + //! Initializes the local properties of the curve + //! for the parameter value . Standard_EXPORT void SetParameter (const Standard_Real U); + //! Initializes the local properties of the curve + //! for the new curve. Standard_EXPORT void SetCurve (const BRepAdaptor_Curve& C); + //! Returns the Point. Standard_EXPORT const gp_Pnt& Value() const; + //! Returns the first derivative. + //! The derivative is computed if it has not been yet. Standard_EXPORT const gp_Vec& D1(); + //! Returns the second derivative. + //! The derivative is computed if it has not been yet. Standard_EXPORT const gp_Vec& D2(); + //! Returns the third derivative. + //! The derivative is computed if it has not been yet. Standard_EXPORT const gp_Vec& D3(); + //! Returns True if the tangent is defined. + //! For example, the tangent is not defined if the + //! three first derivatives are all null. Standard_EXPORT Standard_Boolean IsTangentDefined(); + //! output the tangent direction Standard_EXPORT void Tangent (gp_Dir& D); + //! Returns the curvature. Standard_EXPORT Standard_Real Curvature(); + //! Returns the normal direction . Standard_EXPORT void Normal (gp_Dir& N); + //! Returns the centre of curvature

. Standard_EXPORT void CentreOfCurvature (gp_Pnt& P); diff --git a/src/BRepLProp/BRepLProp_SLProps.hxx b/src/BRepLProp/BRepLProp_SLProps.hxx index 3b0a1ebc7b..ff836adf1a 100644 --- a/src/BRepLProp/BRepLProp_SLProps.hxx +++ b/src/BRepLProp/BRepLProp_SLProps.hxx @@ -48,52 +48,101 @@ public: DEFINE_STANDARD_ALLOC + //! Initializes the local properties of the surface + //! for the parameter values (, ). + //! The current point and the derivatives are + //! computed at the same time, which allows an + //! optimization of the computation time. + //! indicates the maximum number of derivations to + //! be done (0, 1, or 2). For example, to compute + //! only the tangent, N should be equal to 1. + //! is the linear tolerance (it is used to test + //! if a vector is null). Standard_EXPORT BRepLProp_SLProps(const BRepAdaptor_Surface& S, const Standard_Real U, const Standard_Real V, const Standard_Integer N, const Standard_Real Resolution); + //! idem as previous constructor but without setting the value + //! of parameters and . Standard_EXPORT BRepLProp_SLProps(const BRepAdaptor_Surface& S, const Standard_Integer N, const Standard_Real Resolution); + //! idem as previous constructor but without setting the value + //! of parameters and and the surface. + //! the surface can have an empty constructor. Standard_EXPORT BRepLProp_SLProps(const Standard_Integer N, const Standard_Real Resolution); + //! Initializes the local properties of the surface S + //! for the new surface. Standard_EXPORT void SetSurface (const BRepAdaptor_Surface& S); + //! Initializes the local properties of the surface S + //! for the new parameter values (, ). Standard_EXPORT void SetParameters (const Standard_Real U, const Standard_Real V); + //! Returns the point. Standard_EXPORT const gp_Pnt& Value() const; + //! Returns the first U derivative. + //! The derivative is computed if it has not been yet. Standard_EXPORT const gp_Vec& D1U(); + //! Returns the first V derivative. + //! The derivative is computed if it has not been yet. Standard_EXPORT const gp_Vec& D1V(); + //! Returns the second U derivatives + //! The derivative is computed if it has not been yet. Standard_EXPORT const gp_Vec& D2U(); + //! Returns the second V derivative. + //! The derivative is computed if it has not been yet. Standard_EXPORT const gp_Vec& D2V(); + //! Returns the second UV cross-derivative. + //! The derivative is computed if it has not been yet. Standard_EXPORT const gp_Vec& DUV(); + //! returns True if the U tangent is defined. + //! For example, the tangent is not defined if the + //! two first U derivatives are null. Standard_EXPORT Standard_Boolean IsTangentUDefined(); + //! Returns the tangent direction on the iso-V. Standard_EXPORT void TangentU (gp_Dir& D); + //! returns if the V tangent is defined. + //! For example, the tangent is not defined if the + //! two first V derivatives are null. Standard_EXPORT Standard_Boolean IsTangentVDefined(); + //! Returns the tangent direction on the iso-V. Standard_EXPORT void TangentV (gp_Dir& D); + //! Tells if the normal is defined. Standard_EXPORT Standard_Boolean IsNormalDefined(); + //! Returns the normal direction. Standard_EXPORT const gp_Dir& Normal(); + //! returns True if the curvature is defined. Standard_EXPORT Standard_Boolean IsCurvatureDefined(); + //! returns True if the point is umbilic (i.e. if the + //! curvature is constant). Standard_EXPORT Standard_Boolean IsUmbilic(); + //! Returns the maximum curvature Standard_EXPORT Standard_Real MaxCurvature(); + //! Returns the minimum curvature Standard_EXPORT Standard_Real MinCurvature(); + //! Returns the direction of the maximum and minimum curvature + //! and Standard_EXPORT void CurvatureDirections (gp_Dir& MaxD, gp_Dir& MinD); + //! Returns the mean curvature. Standard_EXPORT Standard_Real MeanCurvature(); + //! Returns the Gaussian curvature Standard_EXPORT Standard_Real GaussianCurvature(); diff --git a/src/BiTgte/BiTgte_HCurveOnEdge.hxx b/src/BiTgte/BiTgte_HCurveOnEdge.hxx index 40bd192b72..3a342d7456 100644 --- a/src/BiTgte/BiTgte_HCurveOnEdge.hxx +++ b/src/BiTgte/BiTgte_HCurveOnEdge.hxx @@ -39,16 +39,24 @@ class BiTgte_HCurveOnEdge : public Adaptor3d_HCurve public: + //! Creates an empty GenHCurve. Standard_EXPORT BiTgte_HCurveOnEdge(); + //! Creates a GenHCurve from a Curve Standard_EXPORT BiTgte_HCurveOnEdge(const BiTgte_CurveOnEdge& C); + //! Sets the field of the GenHCurve. Standard_EXPORT void Set (const BiTgte_CurveOnEdge& C); + //! Returns the curve used to create the GenHCurve. + //! This is redefined from HCurve, cannot be inline. Standard_EXPORT const Adaptor3d_Curve& Curve() const; + //! Returns the curve used to create the GenHCurve. + //! This is redefined from HCurve, cannot be inline. Standard_EXPORT Adaptor3d_Curve& GetCurve(); + //! Returns the curve used to create the GenHCurve. BiTgte_CurveOnEdge& ChangeCurve(); diff --git a/src/BiTgte/BiTgte_HCurveOnVertex.hxx b/src/BiTgte/BiTgte_HCurveOnVertex.hxx index e0da42b1f1..dd11d7f813 100644 --- a/src/BiTgte/BiTgte_HCurveOnVertex.hxx +++ b/src/BiTgte/BiTgte_HCurveOnVertex.hxx @@ -39,16 +39,24 @@ class BiTgte_HCurveOnVertex : public Adaptor3d_HCurve public: + //! Creates an empty GenHCurve. Standard_EXPORT BiTgte_HCurveOnVertex(); + //! Creates a GenHCurve from a Curve Standard_EXPORT BiTgte_HCurveOnVertex(const BiTgte_CurveOnVertex& C); + //! Sets the field of the GenHCurve. Standard_EXPORT void Set (const BiTgte_CurveOnVertex& C); + //! Returns the curve used to create the GenHCurve. + //! This is redefined from HCurve, cannot be inline. Standard_EXPORT const Adaptor3d_Curve& Curve() const; + //! Returns the curve used to create the GenHCurve. + //! This is redefined from HCurve, cannot be inline. Standard_EXPORT Adaptor3d_Curve& GetCurve(); + //! Returns the curve used to create the GenHCurve. BiTgte_CurveOnVertex& ChangeCurve(); diff --git a/src/Bnd/Bnd_B2d.hxx b/src/Bnd/Bnd_B2d.hxx index f546ae180c..42b4908178 100644 --- a/src/Bnd/Bnd_B2d.hxx +++ b/src/Bnd/Bnd_B2d.hxx @@ -38,50 +38,93 @@ public: DEFINE_STANDARD_ALLOC + //! Empty constructor. Bnd_B2d(); + //! Constructor. Bnd_B2d(const gp_XY& theCenter, const gp_XY& theHSize); + //! Returns True if the box is void (non-initialized). Standard_Boolean IsVoid() const; + //! Reset the box data. void Clear(); + //! Update the box by a point. Standard_EXPORT void Add (const gp_XY& thePnt); + //! Update the box by a point. Standard_EXPORT void Add (const gp_Pnt2d& thePnt); + //! Update the box by another box. void Add (const Bnd_B2d& theBox); + //! Query a box corner: (Center - HSize). You must make sure that + //! the box is NOT VOID (see IsVoid()), otherwise the method returns + //! irrelevant result. gp_XY CornerMin() const; + //! Query a box corner: (Center + HSize). You must make sure that + //! the box is NOT VOID (see IsVoid()), otherwise the method returns + //! irrelevant result. gp_XY CornerMax() const; + //! Query the square diagonal. If the box is VOID (see method IsVoid()) + //! then a very big real value is returned. Standard_Real SquareExtent() const; + //! Extend the Box by the absolute value of theDiff. void Enlarge (const Standard_Real theDiff); + //! Limit the Box by the internals of theOtherBox. + //! Returns True if the limitation takes place, otherwise False + //! indicating that the boxes do not intersect. Standard_EXPORT Standard_Boolean Limit (const Bnd_B2d& theOtherBox); + //! Transform the bounding box with the given transformation. + //! The resulting box will be larger if theTrsf contains rotation. Standard_EXPORT Bnd_B2d Transformed (const gp_Trsf2d& theTrsf) const; + //! Check the given point for the inclusion in the Box. + //! Returns True if the point is outside. Standard_Boolean IsOut (const gp_XY& thePnt) const; + //! Check a circle for the intersection with the current box. + //! Returns True if there is no intersection between boxes. Standard_EXPORT Standard_Boolean IsOut (const gp_XY& theCenter, const Standard_Real theRadius, const Standard_Boolean isCircleHollow = Standard_False) const; + //! Check the given box for the intersection with the current box. + //! Returns True if there is no intersection between boxes. Standard_Boolean IsOut (const Bnd_B2d& theOtherBox) const; + //! Check the given box oriented by the given transformation + //! for the intersection with the current box. + //! Returns True if there is no intersection between boxes. Standard_EXPORT Standard_Boolean IsOut (const Bnd_B2d& theOtherBox, const gp_Trsf2d& theTrsf) const; + //! Check the given Line for the intersection with the current box. + //! Returns True if there is no intersection. Standard_EXPORT Standard_Boolean IsOut (const gp_Ax2d& theLine) const; + //! Check the Segment defined by the couple of input points + //! for the intersection with the current box. + //! Returns True if there is no intersection. Standard_EXPORT Standard_Boolean IsOut (const gp_XY& theP0, const gp_XY& theP1) const; + //! Check that the box 'this' is inside the given box 'theBox'. Returns + //! True if 'this' box is fully inside 'theBox'. Standard_Boolean IsIn (const Bnd_B2d& theBox) const; + //! Check that the box 'this' is inside the given box 'theBox' + //! transformed by 'theTrsf'. Returns True if 'this' box is fully + //! inside the transformed 'theBox'. Standard_EXPORT Standard_Boolean IsIn (const Bnd_B2d& theBox, const gp_Trsf2d& theTrsf) const; + //! Set the Center coordinates void SetCenter (const gp_XY& theCenter); + //! Set the HSize (half-diagonal) coordinates. + //! All components of theHSize must be non-negative. void SetHSize (const gp_XY& theHSize); diff --git a/src/Bnd/Bnd_B2f.hxx b/src/Bnd/Bnd_B2f.hxx index b8b4d2923f..6ff24f3fda 100644 --- a/src/Bnd/Bnd_B2f.hxx +++ b/src/Bnd/Bnd_B2f.hxx @@ -39,50 +39,93 @@ public: DEFINE_STANDARD_ALLOC + //! Empty constructor. Bnd_B2f(); + //! Constructor. Bnd_B2f(const gp_XY& theCenter, const gp_XY& theHSize); + //! Returns True if the box is void (non-initialized). Standard_Boolean IsVoid() const; + //! Reset the box data. void Clear(); + //! Update the box by a point. Standard_EXPORT void Add (const gp_XY& thePnt); + //! Update the box by a point. Standard_EXPORT void Add (const gp_Pnt2d& thePnt); + //! Update the box by another box. void Add (const Bnd_B2f& theBox); + //! Query a box corner: (Center - HSize). You must make sure that + //! the box is NOT VOID (see IsVoid()), otherwise the method returns + //! irrelevant result. gp_XY CornerMin() const; + //! Query a box corner: (Center + HSize). You must make sure that + //! the box is NOT VOID (see IsVoid()), otherwise the method returns + //! irrelevant result. gp_XY CornerMax() const; + //! Query the square diagonal. If the box is VOID (see method IsVoid()) + //! then a very big real value is returned. Standard_Real SquareExtent() const; + //! Extend the Box by the absolute value of theDiff. void Enlarge (const Standard_Real theDiff); + //! Limit the Box by the internals of theOtherBox. + //! Returns True if the limitation takes place, otherwise False + //! indicating that the boxes do not intersect. Standard_EXPORT Standard_Boolean Limit (const Bnd_B2f& theOtherBox); + //! Transform the bounding box with the given transformation. + //! The resulting box will be larger if theTrsf contains rotation. Standard_EXPORT Bnd_B2f Transformed (const gp_Trsf2d& theTrsf) const; + //! Check the given point for the inclusion in the Box. + //! Returns True if the point is outside. Standard_Boolean IsOut (const gp_XY& thePnt) const; + //! Check a circle for the intersection with the current box. + //! Returns True if there is no intersection between boxes. Standard_EXPORT Standard_Boolean IsOut (const gp_XY& theCenter, const Standard_Real theRadius, const Standard_Boolean isCircleHollow = Standard_False) const; + //! Check the given box for the intersection with the current box. + //! Returns True if there is no intersection between boxes. Standard_Boolean IsOut (const Bnd_B2f& theOtherBox) const; + //! Check the given box oriented by the given transformation + //! for the intersection with the current box. + //! Returns True if there is no intersection between boxes. Standard_EXPORT Standard_Boolean IsOut (const Bnd_B2f& theOtherBox, const gp_Trsf2d& theTrsf) const; + //! Check the given Line for the intersection with the current box. + //! Returns True if there is no intersection. Standard_EXPORT Standard_Boolean IsOut (const gp_Ax2d& theLine) const; + //! Check the Segment defined by the couple of input points + //! for the intersection with the current box. + //! Returns True if there is no intersection. Standard_EXPORT Standard_Boolean IsOut (const gp_XY& theP0, const gp_XY& theP1) const; + //! Check that the box 'this' is inside the given box 'theBox'. Returns + //! True if 'this' box is fully inside 'theBox'. Standard_Boolean IsIn (const Bnd_B2f& theBox) const; + //! Check that the box 'this' is inside the given box 'theBox' + //! transformed by 'theTrsf'. Returns True if 'this' box is fully + //! inside the transformed 'theBox'. Standard_EXPORT Standard_Boolean IsIn (const Bnd_B2f& theBox, const gp_Trsf2d& theTrsf) const; + //! Set the Center coordinates void SetCenter (const gp_XY& theCenter); + //! Set the HSize (half-diagonal) coordinates. + //! All components of theHSize must be non-negative. void SetHSize (const gp_XY& theHSize); diff --git a/src/Bnd/Bnd_B3d.hxx b/src/Bnd/Bnd_B3d.hxx index c4e4e1e043..feab75b17b 100644 --- a/src/Bnd/Bnd_B3d.hxx +++ b/src/Bnd/Bnd_B3d.hxx @@ -39,50 +39,99 @@ public: DEFINE_STANDARD_ALLOC + //! Empty constructor. Bnd_B3d(); + //! Constructor. Bnd_B3d(const gp_XYZ& theCenter, const gp_XYZ& theHSize); + //! Returns True if the box is void (non-initialized). Standard_Boolean IsVoid() const; + //! Reset the box data. void Clear(); + //! Update the box by a point. Standard_EXPORT void Add (const gp_XYZ& thePnt); + //! Update the box by a point. void Add (const gp_Pnt& thePnt); + //! Update the box by another box. void Add (const Bnd_B3d& theBox); + //! Query the lower corner: (Center - HSize). You must make sure that + //! the box is NOT VOID (see IsVoid()), otherwise the method returns + //! irrelevant result. gp_XYZ CornerMin() const; + //! Query the upper corner: (Center + HSize). You must make sure that + //! the box is NOT VOID (see IsVoid()), otherwise the method returns + //! irrelevant result. gp_XYZ CornerMax() const; + //! Query the square diagonal. If the box is VOID (see method IsVoid()) + //! then a very big real value is returned. Standard_Real SquareExtent() const; + //! Extend the Box by the absolute value of theDiff. void Enlarge (const Standard_Real theDiff); + //! Limit the Box by the internals of theOtherBox. + //! Returns True if the limitation takes place, otherwise False + //! indicating that the boxes do not intersect. Standard_EXPORT Standard_Boolean Limit (const Bnd_B3d& theOtherBox); + //! Transform the bounding box with the given transformation. + //! The resulting box will be larger if theTrsf contains rotation. Standard_EXPORT Bnd_B3d Transformed (const gp_Trsf& theTrsf) const; + //! Check the given point for the inclusion in the Box. + //! Returns True if the point is outside. Standard_Boolean IsOut (const gp_XYZ& thePnt) const; + //! Check a sphere for the intersection with the current box. + //! Returns True if there is no intersection between boxes. If the + //! parameter 'IsSphereHollow' is True, then the intersection is not + //! reported for a box that is completely inside the sphere (otherwise + //! this method would report an intersection). Standard_EXPORT Standard_Boolean IsOut (const gp_XYZ& theCenter, const Standard_Real theRadius, const Standard_Boolean isSphereHollow = Standard_False) const; + //! Check the given box for the intersection with the current box. + //! Returns True if there is no intersection between boxes. Standard_Boolean IsOut (const Bnd_B3d& theOtherBox) const; + //! Check the given box oriented by the given transformation + //! for the intersection with the current box. + //! Returns True if there is no intersection between boxes. Standard_EXPORT Standard_Boolean IsOut (const Bnd_B3d& theOtherBox, const gp_Trsf& theTrsf) const; + //! Check the given Line for the intersection with the current box. + //! Returns True if there is no intersection. + //! isRay==True means intersection check with the positive half-line + //! theOverthickness is the addition to the size of the current box + //! (may be negative). If positive, it can be treated as the thickness + //! of the line 'theLine' or the radius of the cylinder along 'theLine' Standard_EXPORT Standard_Boolean IsOut (const gp_Ax1& theLine, const Standard_Boolean isRay = Standard_False, const Standard_Real theOverthickness = 0.0) const; + //! Check the given Plane for the intersection with the current box. + //! Returns True if there is no intersection. Standard_EXPORT Standard_Boolean IsOut (const gp_Ax3& thePlane) const; + //! Check that the box 'this' is inside the given box 'theBox'. Returns + //! True if 'this' box is fully inside 'theBox'. Standard_Boolean IsIn (const Bnd_B3d& theBox) const; + //! Check that the box 'this' is inside the given box 'theBox' + //! transformed by 'theTrsf'. Returns True if 'this' box is fully + //! inside the transformed 'theBox'. Standard_EXPORT Standard_Boolean IsIn (const Bnd_B3d& theBox, const gp_Trsf& theTrsf) const; + //! Set the Center coordinates void SetCenter (const gp_XYZ& theCenter); + //! Set the HSize (half-diagonal) coordinates. + //! All components of theHSize must be non-negative. void SetHSize (const gp_XYZ& theHSize); diff --git a/src/Bnd/Bnd_B3f.hxx b/src/Bnd/Bnd_B3f.hxx index cb1f49ad39..f0a86a2438 100644 --- a/src/Bnd/Bnd_B3f.hxx +++ b/src/Bnd/Bnd_B3f.hxx @@ -40,50 +40,99 @@ public: DEFINE_STANDARD_ALLOC + //! Empty constructor. Bnd_B3f(); + //! Constructor. Bnd_B3f(const gp_XYZ& theCenter, const gp_XYZ& theHSize); + //! Returns True if the box is void (non-initialized). Standard_Boolean IsVoid() const; + //! Reset the box data. void Clear(); + //! Update the box by a point. Standard_EXPORT void Add (const gp_XYZ& thePnt); + //! Update the box by a point. void Add (const gp_Pnt& thePnt); + //! Update the box by another box. void Add (const Bnd_B3f& theBox); + //! Query the lower corner: (Center - HSize). You must make sure that + //! the box is NOT VOID (see IsVoid()), otherwise the method returns + //! irrelevant result. gp_XYZ CornerMin() const; + //! Query the upper corner: (Center + HSize). You must make sure that + //! the box is NOT VOID (see IsVoid()), otherwise the method returns + //! irrelevant result. gp_XYZ CornerMax() const; + //! Query the square diagonal. If the box is VOID (see method IsVoid()) + //! then a very big real value is returned. Standard_Real SquareExtent() const; + //! Extend the Box by the absolute value of theDiff. void Enlarge (const Standard_Real theDiff); + //! Limit the Box by the internals of theOtherBox. + //! Returns True if the limitation takes place, otherwise False + //! indicating that the boxes do not intersect. Standard_EXPORT Standard_Boolean Limit (const Bnd_B3f& theOtherBox); + //! Transform the bounding box with the given transformation. + //! The resulting box will be larger if theTrsf contains rotation. Standard_EXPORT Bnd_B3f Transformed (const gp_Trsf& theTrsf) const; + //! Check the given point for the inclusion in the Box. + //! Returns True if the point is outside. Standard_Boolean IsOut (const gp_XYZ& thePnt) const; + //! Check a sphere for the intersection with the current box. + //! Returns True if there is no intersection between boxes. If the + //! parameter 'IsSphereHollow' is True, then the intersection is not + //! reported for a box that is completely inside the sphere (otherwise + //! this method would report an intersection). Standard_EXPORT Standard_Boolean IsOut (const gp_XYZ& theCenter, const Standard_Real theRadius, const Standard_Boolean isSphereHollow = Standard_False) const; + //! Check the given box for the intersection with the current box. + //! Returns True if there is no intersection between boxes. Standard_Boolean IsOut (const Bnd_B3f& theOtherBox) const; + //! Check the given box oriented by the given transformation + //! for the intersection with the current box. + //! Returns True if there is no intersection between boxes. Standard_EXPORT Standard_Boolean IsOut (const Bnd_B3f& theOtherBox, const gp_Trsf& theTrsf) const; + //! Check the given Line for the intersection with the current box. + //! Returns True if there is no intersection. + //! isRay==True means intersection check with the positive half-line + //! theOverthickness is the addition to the size of the current box + //! (may be negative). If positive, it can be treated as the thickness + //! of the line 'theLine' or the radius of the cylinder along 'theLine' Standard_EXPORT Standard_Boolean IsOut (const gp_Ax1& theLine, const Standard_Boolean isRay = Standard_False, const Standard_Real theOverthickness = 0.0) const; + //! Check the given Plane for the intersection with the current box. + //! Returns True if there is no intersection. Standard_EXPORT Standard_Boolean IsOut (const gp_Ax3& thePlane) const; + //! Check that the box 'this' is inside the given box 'theBox'. Returns + //! True if 'this' box is fully inside 'theBox'. Standard_Boolean IsIn (const Bnd_B3f& theBox) const; + //! Check that the box 'this' is inside the given box 'theBox' + //! transformed by 'theTrsf'. Returns True if 'this' box is fully + //! inside the transformed 'theBox'. Standard_EXPORT Standard_Boolean IsIn (const Bnd_B3f& theBox, const gp_Trsf& theTrsf) const; + //! Set the Center coordinates void SetCenter (const gp_XYZ& theCenter); + //! Set the HSize (half-diagonal) coordinates. + //! All components of theHSize must be non-negative. void SetHSize (const gp_XYZ& theHSize); diff --git a/src/ChFiDS/ChFiDS_HElSpine.hxx b/src/ChFiDS/ChFiDS_HElSpine.hxx index fa999cca91..5745682d1d 100644 --- a/src/ChFiDS/ChFiDS_HElSpine.hxx +++ b/src/ChFiDS/ChFiDS_HElSpine.hxx @@ -39,16 +39,24 @@ class ChFiDS_HElSpine : public Adaptor3d_HCurve public: + //! Creates an empty GenHCurve. Standard_EXPORT ChFiDS_HElSpine(); + //! Creates a GenHCurve from a Curve Standard_EXPORT ChFiDS_HElSpine(const ChFiDS_ElSpine& C); + //! Sets the field of the GenHCurve. Standard_EXPORT void Set (const ChFiDS_ElSpine& C); + //! Returns the curve used to create the GenHCurve. + //! This is redefined from HCurve, cannot be inline. Standard_EXPORT const Adaptor3d_Curve& Curve() const; + //! Returns the curve used to create the GenHCurve. + //! This is redefined from HCurve, cannot be inline. Standard_EXPORT Adaptor3d_Curve& GetCurve(); + //! Returns the curve used to create the GenHCurve. ChFiDS_ElSpine& ChangeCurve(); diff --git a/src/Contap/Contap_SequenceOfIWLineOfTheIWalking.hxx b/src/Contap/Contap_SequenceOfIWLineOfTheIWalking.hxx index d5128aa027..7ace1d6acc 100644 --- a/src/Contap/Contap_SequenceOfIWLineOfTheIWalking.hxx +++ b/src/Contap/Contap_SequenceOfIWLineOfTheIWalking.hxx @@ -37,60 +37,209 @@ public: DEFINE_STANDARD_ALLOC + //! Constructs an empty sequence. + //! Use: + //! - the function Append or Prepend to add an item or + //! a collection of items at the end, or at the beginning of the sequence, + //! - the function InsertAfter or InsertBefore to add an + //! item or a collection of items at any position in the sequence, + //! - operator() or the function SetValue to assign a + //! new value to an item of the sequence, + //! - operator() to read an item of the sequence, + //! - the function Remove to remove an item at any + //! position in the sequence. + //! Warning + //! To copy a sequence, you must explicitly call the + //! assignment operator (operator=). Contap_SequenceOfIWLineOfTheIWalking(); + //! Creation by copy of existing Sequence. Standard_EXPORT Contap_SequenceOfIWLineOfTheIWalking(const Contap_SequenceOfIWLineOfTheIWalking& Other); + //! Removes all element(s) of the sequence + //! Example: + //! before + //! me = (A B C) + //! after + //! me = () Standard_EXPORT void Clear(); ~Contap_SequenceOfIWLineOfTheIWalking() { Clear(); } + //! Copies the contents of the sequence Other into this sequence. + //! If this sequence is not empty, it is automatically cleared before the copy. Standard_EXPORT const Contap_SequenceOfIWLineOfTheIWalking& Assign (const Contap_SequenceOfIWLineOfTheIWalking& Other); const Contap_SequenceOfIWLineOfTheIWalking& operator = (const Contap_SequenceOfIWLineOfTheIWalking& Other) { return Assign(Other); } + //! Appends at the end of . + //! Example: + //! before + //! me = (A B C) + //! after + //! me = (A B C T) Standard_EXPORT void Append (const Handle(Contap_TheIWLineOfTheIWalking)& T); + //! Concatenates at the end of . + //! is cleared. + //! Example: + //! before + //! me = (A B C) + //! S = (D E F) + //! after + //! me = (A B C D E F) + //! S = () void Append (Contap_SequenceOfIWLineOfTheIWalking& S); + //! Add at the beginning of . + //! Example: + //! before + //! me = (A B C) + //! after + //! me = (T A B C ) Standard_EXPORT void Prepend (const Handle(Contap_TheIWLineOfTheIWalking)& T); + //! Concatenates at the beginning of . + //! is cleared. + //! Example: + //! before + //! me = (A B C) S = (D E F) + //! after me = (D E F A B C) + //! S = () void Prepend (Contap_SequenceOfIWLineOfTheIWalking& S); + //! Inserts in before the position . + //! Raises an exception if the index is out of bounds. + //! Example: + //! before + //! me = (A B D), Index = 3, T = C + //! after + //! me = (A B C D ) void InsertBefore (const Standard_Integer Index, const Handle(Contap_TheIWLineOfTheIWalking)& T); + //! Inserts the sequence in before + //! the position . is cleared. + //! Raises an exception if the index is out of bounds + //! Example: + //! before + //! me = (A B F), Index = 3, S = (C D E) + //! after + //! me = (A B C D E F) + //! S = () void InsertBefore (const Standard_Integer Index, Contap_SequenceOfIWLineOfTheIWalking& S); + //! Inserts in after the position . + //! Raises an exception if the index is out of bound + //! Example: + //! before + //! me = (A B C), Index = 3, T = D + //! after + //! me = (A B C D) Standard_EXPORT void InsertAfter (const Standard_Integer Index, const Handle(Contap_TheIWLineOfTheIWalking)& T); + //! Inserts the sequence in after the + //! position . is cleared. + //! Raises an exception if the index is out of bound. + //! Example: + //! before + //! me = (A B C), Index = 3, S = (D E F) + //! after + //! me = (A B C D E F) + //! S = () void InsertAfter (const Standard_Integer Index, Contap_SequenceOfIWLineOfTheIWalking& S); + //! Returns the first element of the sequence + //! Raises an exception if the sequence is empty. + //! Example: + //! before + //! me = (A B C) + //! after + //! me = (A B C) + //! returns A Standard_EXPORT const Handle(Contap_TheIWLineOfTheIWalking)& First() const; + //! Returns the last element of the sequence + //! Raises an exception if the sequence is empty. + //! Example: + //! before + //! me = (A B C) + //! after + //! me = (A B C) + //! returns C Standard_EXPORT const Handle(Contap_TheIWLineOfTheIWalking)& Last() const; + //! Keeps in the items 1 to -1 and + //! puts in the items to the end. + //! Example: + //! before + //! me = (A B C D) ,Index = 3 + //! after + //! me = (A B) + //! Sub = (C D) void Split (const Standard_Integer Index, Contap_SequenceOfIWLineOfTheIWalking& Sub); + //! Returns the Item at position in . + //! Raises an exception if the index is out of bound + //! Example: + //! before + //! me = (A B C), Index = 1 + //! after + //! me = (A B C) + //! returns + //! A Standard_EXPORT const Handle(Contap_TheIWLineOfTheIWalking)& Value (const Standard_Integer Index) const; const Handle(Contap_TheIWLineOfTheIWalking)& operator() (const Standard_Integer Index) const { return Value(Index); } + //! Changes the item at position + //! Raises an exception if the index is out of bound + //! Example: + //! before + //! me = (A B C), Index = 1, Item = D + //! after + //! me = (D B C) Standard_EXPORT void SetValue (const Standard_Integer Index, const Handle(Contap_TheIWLineOfTheIWalking)& I); + //! Returns the Item at position in + //! . This method may be used to modify + //! : S.Value(Index) = Item. + //! Raises an exception if the index is out of bound + //! Example: + //! before + //! me = (A B C), Index = 1 + //! after + //! me = (A B C) + //! returns + //! A Standard_EXPORT Handle(Contap_TheIWLineOfTheIWalking)& ChangeValue (const Standard_Integer Index); Handle(Contap_TheIWLineOfTheIWalking)& operator() (const Standard_Integer Index) { return ChangeValue(Index); } + //! Removes from the item at position . + //! Raises an exception if the index is out of bounds + //! Example: + //! before + //! me = (A B C), Index = 3 + //! after + //! me = (A B) Standard_EXPORT void Remove (const Standard_Integer Index); + //! Removes from all the items of + //! positions between and . + //! Raises an exception if the indices are out of bounds. + //! Example: + //! before + //! me = (A B C D E F), FromIndex = 1 ToIndex = 3 + //! after + //! me = (D E F) Standard_EXPORT void Remove (const Standard_Integer FromIndex, const Standard_Integer ToIndex); diff --git a/src/Contap/Contap_SequenceOfPathPointOfTheSearch.hxx b/src/Contap/Contap_SequenceOfPathPointOfTheSearch.hxx index e546228f1b..d25d1b4427 100644 --- a/src/Contap/Contap_SequenceOfPathPointOfTheSearch.hxx +++ b/src/Contap/Contap_SequenceOfPathPointOfTheSearch.hxx @@ -37,60 +37,209 @@ public: DEFINE_STANDARD_ALLOC + //! Constructs an empty sequence. + //! Use: + //! - the function Append or Prepend to add an item or + //! a collection of items at the end, or at the beginning of the sequence, + //! - the function InsertAfter or InsertBefore to add an + //! item or a collection of items at any position in the sequence, + //! - operator() or the function SetValue to assign a + //! new value to an item of the sequence, + //! - operator() to read an item of the sequence, + //! - the function Remove to remove an item at any + //! position in the sequence. + //! Warning + //! To copy a sequence, you must explicitly call the + //! assignment operator (operator=). Contap_SequenceOfPathPointOfTheSearch(); + //! Creation by copy of existing Sequence. Standard_EXPORT Contap_SequenceOfPathPointOfTheSearch(const Contap_SequenceOfPathPointOfTheSearch& Other); + //! Removes all element(s) of the sequence + //! Example: + //! before + //! me = (A B C) + //! after + //! me = () Standard_EXPORT void Clear(); ~Contap_SequenceOfPathPointOfTheSearch() { Clear(); } + //! Copies the contents of the sequence Other into this sequence. + //! If this sequence is not empty, it is automatically cleared before the copy. Standard_EXPORT const Contap_SequenceOfPathPointOfTheSearch& Assign (const Contap_SequenceOfPathPointOfTheSearch& Other); const Contap_SequenceOfPathPointOfTheSearch& operator = (const Contap_SequenceOfPathPointOfTheSearch& Other) { return Assign(Other); } + //! Appends at the end of . + //! Example: + //! before + //! me = (A B C) + //! after + //! me = (A B C T) Standard_EXPORT void Append (const Contap_ThePathPointOfTheSearch& T); + //! Concatenates at the end of . + //! is cleared. + //! Example: + //! before + //! me = (A B C) + //! S = (D E F) + //! after + //! me = (A B C D E F) + //! S = () void Append (Contap_SequenceOfPathPointOfTheSearch& S); + //! Add at the beginning of . + //! Example: + //! before + //! me = (A B C) + //! after + //! me = (T A B C ) Standard_EXPORT void Prepend (const Contap_ThePathPointOfTheSearch& T); + //! Concatenates at the beginning of . + //! is cleared. + //! Example: + //! before + //! me = (A B C) S = (D E F) + //! after me = (D E F A B C) + //! S = () void Prepend (Contap_SequenceOfPathPointOfTheSearch& S); + //! Inserts in before the position . + //! Raises an exception if the index is out of bounds. + //! Example: + //! before + //! me = (A B D), Index = 3, T = C + //! after + //! me = (A B C D ) void InsertBefore (const Standard_Integer Index, const Contap_ThePathPointOfTheSearch& T); + //! Inserts the sequence in before + //! the position . is cleared. + //! Raises an exception if the index is out of bounds + //! Example: + //! before + //! me = (A B F), Index = 3, S = (C D E) + //! after + //! me = (A B C D E F) + //! S = () void InsertBefore (const Standard_Integer Index, Contap_SequenceOfPathPointOfTheSearch& S); + //! Inserts in after the position . + //! Raises an exception if the index is out of bound + //! Example: + //! before + //! me = (A B C), Index = 3, T = D + //! after + //! me = (A B C D) Standard_EXPORT void InsertAfter (const Standard_Integer Index, const Contap_ThePathPointOfTheSearch& T); + //! Inserts the sequence in after the + //! position . is cleared. + //! Raises an exception if the index is out of bound. + //! Example: + //! before + //! me = (A B C), Index = 3, S = (D E F) + //! after + //! me = (A B C D E F) + //! S = () void InsertAfter (const Standard_Integer Index, Contap_SequenceOfPathPointOfTheSearch& S); + //! Returns the first element of the sequence + //! Raises an exception if the sequence is empty. + //! Example: + //! before + //! me = (A B C) + //! after + //! me = (A B C) + //! returns A Standard_EXPORT const Contap_ThePathPointOfTheSearch& First() const; + //! Returns the last element of the sequence + //! Raises an exception if the sequence is empty. + //! Example: + //! before + //! me = (A B C) + //! after + //! me = (A B C) + //! returns C Standard_EXPORT const Contap_ThePathPointOfTheSearch& Last() const; + //! Keeps in the items 1 to -1 and + //! puts in the items to the end. + //! Example: + //! before + //! me = (A B C D) ,Index = 3 + //! after + //! me = (A B) + //! Sub = (C D) void Split (const Standard_Integer Index, Contap_SequenceOfPathPointOfTheSearch& Sub); + //! Returns the Item at position in . + //! Raises an exception if the index is out of bound + //! Example: + //! before + //! me = (A B C), Index = 1 + //! after + //! me = (A B C) + //! returns + //! A Standard_EXPORT const Contap_ThePathPointOfTheSearch& Value (const Standard_Integer Index) const; const Contap_ThePathPointOfTheSearch& operator() (const Standard_Integer Index) const { return Value(Index); } + //! Changes the item at position + //! Raises an exception if the index is out of bound + //! Example: + //! before + //! me = (A B C), Index = 1, Item = D + //! after + //! me = (D B C) Standard_EXPORT void SetValue (const Standard_Integer Index, const Contap_ThePathPointOfTheSearch& I); + //! Returns the Item at position in + //! . This method may be used to modify + //! : S.Value(Index) = Item. + //! Raises an exception if the index is out of bound + //! Example: + //! before + //! me = (A B C), Index = 1 + //! after + //! me = (A B C) + //! returns + //! A Standard_EXPORT Contap_ThePathPointOfTheSearch& ChangeValue (const Standard_Integer Index); Contap_ThePathPointOfTheSearch& operator() (const Standard_Integer Index) { return ChangeValue(Index); } + //! Removes from the item at position . + //! Raises an exception if the index is out of bounds + //! Example: + //! before + //! me = (A B C), Index = 3 + //! after + //! me = (A B) Standard_EXPORT void Remove (const Standard_Integer Index); + //! Removes from all the items of + //! positions between and . + //! Raises an exception if the indices are out of bounds. + //! Example: + //! before + //! me = (A B C D E F), FromIndex = 1 ToIndex = 3 + //! after + //! me = (D E F) Standard_EXPORT void Remove (const Standard_Integer FromIndex, const Standard_Integer ToIndex); diff --git a/src/Contap/Contap_SequenceOfSegmentOfTheSearch.hxx b/src/Contap/Contap_SequenceOfSegmentOfTheSearch.hxx index 7c757191b3..0748b30e2f 100644 --- a/src/Contap/Contap_SequenceOfSegmentOfTheSearch.hxx +++ b/src/Contap/Contap_SequenceOfSegmentOfTheSearch.hxx @@ -37,60 +37,209 @@ public: DEFINE_STANDARD_ALLOC + //! Constructs an empty sequence. + //! Use: + //! - the function Append or Prepend to add an item or + //! a collection of items at the end, or at the beginning of the sequence, + //! - the function InsertAfter or InsertBefore to add an + //! item or a collection of items at any position in the sequence, + //! - operator() or the function SetValue to assign a + //! new value to an item of the sequence, + //! - operator() to read an item of the sequence, + //! - the function Remove to remove an item at any + //! position in the sequence. + //! Warning + //! To copy a sequence, you must explicitly call the + //! assignment operator (operator=). Contap_SequenceOfSegmentOfTheSearch(); + //! Creation by copy of existing Sequence. Standard_EXPORT Contap_SequenceOfSegmentOfTheSearch(const Contap_SequenceOfSegmentOfTheSearch& Other); + //! Removes all element(s) of the sequence + //! Example: + //! before + //! me = (A B C) + //! after + //! me = () Standard_EXPORT void Clear(); ~Contap_SequenceOfSegmentOfTheSearch() { Clear(); } + //! Copies the contents of the sequence Other into this sequence. + //! If this sequence is not empty, it is automatically cleared before the copy. Standard_EXPORT const Contap_SequenceOfSegmentOfTheSearch& Assign (const Contap_SequenceOfSegmentOfTheSearch& Other); const Contap_SequenceOfSegmentOfTheSearch& operator = (const Contap_SequenceOfSegmentOfTheSearch& Other) { return Assign(Other); } + //! Appends at the end of . + //! Example: + //! before + //! me = (A B C) + //! after + //! me = (A B C T) Standard_EXPORT void Append (const Contap_TheSegmentOfTheSearch& T); + //! Concatenates at the end of . + //! is cleared. + //! Example: + //! before + //! me = (A B C) + //! S = (D E F) + //! after + //! me = (A B C D E F) + //! S = () void Append (Contap_SequenceOfSegmentOfTheSearch& S); + //! Add at the beginning of . + //! Example: + //! before + //! me = (A B C) + //! after + //! me = (T A B C ) Standard_EXPORT void Prepend (const Contap_TheSegmentOfTheSearch& T); + //! Concatenates at the beginning of . + //! is cleared. + //! Example: + //! before + //! me = (A B C) S = (D E F) + //! after me = (D E F A B C) + //! S = () void Prepend (Contap_SequenceOfSegmentOfTheSearch& S); + //! Inserts in before the position . + //! Raises an exception if the index is out of bounds. + //! Example: + //! before + //! me = (A B D), Index = 3, T = C + //! after + //! me = (A B C D ) void InsertBefore (const Standard_Integer Index, const Contap_TheSegmentOfTheSearch& T); + //! Inserts the sequence in before + //! the position . is cleared. + //! Raises an exception if the index is out of bounds + //! Example: + //! before + //! me = (A B F), Index = 3, S = (C D E) + //! after + //! me = (A B C D E F) + //! S = () void InsertBefore (const Standard_Integer Index, Contap_SequenceOfSegmentOfTheSearch& S); + //! Inserts in after the position . + //! Raises an exception if the index is out of bound + //! Example: + //! before + //! me = (A B C), Index = 3, T = D + //! after + //! me = (A B C D) Standard_EXPORT void InsertAfter (const Standard_Integer Index, const Contap_TheSegmentOfTheSearch& T); + //! Inserts the sequence in after the + //! position . is cleared. + //! Raises an exception if the index is out of bound. + //! Example: + //! before + //! me = (A B C), Index = 3, S = (D E F) + //! after + //! me = (A B C D E F) + //! S = () void InsertAfter (const Standard_Integer Index, Contap_SequenceOfSegmentOfTheSearch& S); + //! Returns the first element of the sequence + //! Raises an exception if the sequence is empty. + //! Example: + //! before + //! me = (A B C) + //! after + //! me = (A B C) + //! returns A Standard_EXPORT const Contap_TheSegmentOfTheSearch& First() const; + //! Returns the last element of the sequence + //! Raises an exception if the sequence is empty. + //! Example: + //! before + //! me = (A B C) + //! after + //! me = (A B C) + //! returns C Standard_EXPORT const Contap_TheSegmentOfTheSearch& Last() const; + //! Keeps in the items 1 to -1 and + //! puts in the items to the end. + //! Example: + //! before + //! me = (A B C D) ,Index = 3 + //! after + //! me = (A B) + //! Sub = (C D) void Split (const Standard_Integer Index, Contap_SequenceOfSegmentOfTheSearch& Sub); + //! Returns the Item at position in . + //! Raises an exception if the index is out of bound + //! Example: + //! before + //! me = (A B C), Index = 1 + //! after + //! me = (A B C) + //! returns + //! A Standard_EXPORT const Contap_TheSegmentOfTheSearch& Value (const Standard_Integer Index) const; const Contap_TheSegmentOfTheSearch& operator() (const Standard_Integer Index) const { return Value(Index); } + //! Changes the item at position + //! Raises an exception if the index is out of bound + //! Example: + //! before + //! me = (A B C), Index = 1, Item = D + //! after + //! me = (D B C) Standard_EXPORT void SetValue (const Standard_Integer Index, const Contap_TheSegmentOfTheSearch& I); + //! Returns the Item at position in + //! . This method may be used to modify + //! : S.Value(Index) = Item. + //! Raises an exception if the index is out of bound + //! Example: + //! before + //! me = (A B C), Index = 1 + //! after + //! me = (A B C) + //! returns + //! A Standard_EXPORT Contap_TheSegmentOfTheSearch& ChangeValue (const Standard_Integer Index); Contap_TheSegmentOfTheSearch& operator() (const Standard_Integer Index) { return ChangeValue(Index); } + //! Removes from the item at position . + //! Raises an exception if the index is out of bounds + //! Example: + //! before + //! me = (A B C), Index = 3 + //! after + //! me = (A B) Standard_EXPORT void Remove (const Standard_Integer Index); + //! Removes from all the items of + //! positions between and . + //! Raises an exception if the indices are out of bounds. + //! Example: + //! before + //! me = (A B C D E F), FromIndex = 1 ToIndex = 3 + //! after + //! me = (D E F) Standard_EXPORT void Remove (const Standard_Integer FromIndex, const Standard_Integer ToIndex); diff --git a/src/Contap/Contap_TheIWLineOfTheIWalking.hxx b/src/Contap/Contap_TheIWLineOfTheIWalking.hxx index dd1faa389d..bcce1d7631 100644 --- a/src/Contap/Contap_TheIWLineOfTheIWalking.hxx +++ b/src/Contap/Contap_TheIWLineOfTheIWalking.hxx @@ -47,10 +47,13 @@ public: Standard_EXPORT Contap_TheIWLineOfTheIWalking(const IntSurf_Allocator& theAllocator = 0); + //! reverse the points in the line. Hasfirst, HasLast are kept. Standard_EXPORT void Reverse(); + //! Cut the line at the point of rank Index. void Cut (const Standard_Integer Index); + //! Add a point in the line. void AddPoint (const IntSurf_PntOn2S& P); void AddStatusFirst (const Standard_Boolean Closed, const Standard_Boolean HasFirst); @@ -63,6 +66,8 @@ public: void AddStatusLast (const Standard_Boolean HasLast, const Standard_Integer Index, const IntSurf_PathPoint& P); + //! associer a l 'indice du point sur la ligne l'indice du point + //! passant dans l'iterateur de depart void AddIndexPassing (const Standard_Integer Index); void SetTangentVector (const gp_Vec& V, const Standard_Integer Index); @@ -71,28 +76,62 @@ public: void SetTangencyAtEnd (const Standard_Boolean IsTangent); + //! Returns the number of points of the line (including first + //! point and end point : see HasLastPoint and HasFirstPoint). Standard_Integer NbPoints() const; + //! Returns the point of range Index. + //! If index <= 0 or Index > NbPoints, an exception is raised. const IntSurf_PntOn2S& Value (const Standard_Integer Index) const; + //! Returns the LineOn2S contained in the walking line. const Handle(IntSurf_LineOn2S)& Line() const; + //! Returns True if the line is closed. Standard_Boolean IsClosed() const; + //! Returns True if the first point of the line is a + //! marching point . when is HasFirstPoint==False ,the line + //! begins on the natural bound of the surface.the line can be + //! too long Standard_Boolean HasFirstPoint() const; + //! Returns True if the end point of the line is a + //! marching point (Point from IntWS). + //! when is HasFirstPoint==False ,the line ends + //! on the natural bound of the surface.the line can be + //! too long. Standard_Boolean HasLastPoint() const; + //! Returns the first point of the line when it is a + //! marching point. + //! An exception is raised if HasFirstPoint returns False. const IntSurf_PathPoint& FirstPoint() const; + //! Returns the Index of first point of the line when it is a + //! marching point.This index is the index in the + //! PointStartIterator. + //! An exception is raised if HasFirstPoint returns False. Standard_Integer FirstPointIndex() const; + //! Returns the last point of the line when it is a + //! marching point. + //! An exception is raised if HasLastPoint returns False. const IntSurf_PathPoint& LastPoint() const; + //! Returns the index of last point of the line when it is a + //! marching point.This index is the index in the + //! PointStartIterator. + //! An exception is raised if HasLastPoint returns False. Standard_Integer LastPointIndex() const; + //! returns the number of points belonging to Pnts1 which are + //! passing point. Standard_Integer NbPassingPoint() const; + //! returns the index of the point belonging to the line which + //! is associated to the passing point belonging to Pnts1 + //! an exception is raised if Index > NbPassingPoint() void PassingPoint (const Standard_Integer Index, Standard_Integer& IndexLine, Standard_Integer& IndexPnts) const; const gp_Vec& TangentVector (Standard_Integer& Index) const; diff --git a/src/Contap/Contap_TheIWalking.hxx b/src/Contap/Contap_TheIWalking.hxx index a6bd731ccd..11267f76fc 100644 --- a/src/Contap/Contap_TheIWalking.hxx +++ b/src/Contap/Contap_TheIWalking.hxx @@ -59,22 +59,52 @@ public: DEFINE_STANDARD_ALLOC + //! Deflection is the maximum deflection admitted between two + //! consecutive points on a resulting polyline. + //! Step is the maximum increment admitted between two + //! consecutive points (in 2d space). + //! Epsilon is the tolerance beyond which 2 points + //! are confused. Standard_EXPORT Contap_TheIWalking(const Standard_Real Epsilon, const Standard_Real Deflection, const Standard_Real Step); + //! Deflection is the maximum deflection admitted between two + //! consecutive points on a resulting polyline. + //! Step is the maximum increment admitted between two + //! consecutive points (in 2d space). + //! Epsilon is the tolerance beyond which 2 points + //! are confused void SetTolerance (const Standard_Real Epsilon, const Standard_Real Deflection, const Standard_Real Step); + //! Searches a set of polylines starting on a point of Pnts1 + //! or Pnts2. + //! Each point on a resulting polyline verifies F(u,v)=0 Standard_EXPORT void Perform (const IntSurf_SequenceOfPathPoint& Pnts1, const IntSurf_SequenceOfInteriorPoint& Pnts2, Contap_SurfFunction& Func, const Handle(Adaptor3d_HSurface)& S, const Standard_Boolean Reversed = Standard_False); + //! Searches a set of polylines starting on a point of Pnts1. + //! Each point on a resulting polyline verifies F(u,v)=0 Standard_EXPORT void Perform (const IntSurf_SequenceOfPathPoint& Pnts1, Contap_SurfFunction& Func, const Handle(Adaptor3d_HSurface)& S, const Standard_Boolean Reversed = Standard_False); + //! Returns true if the calculus was successful. Standard_Boolean IsDone() const; + //! Returns the number of resulting polylines. + //! An exception is raised if IsDone returns False. Standard_Integer NbLines() const; + //! Returns the polyline of range Index. + //! An exception is raised if IsDone is False. + //! An exception is raised if Index<=0 or Index>NbLines. const Handle(Contap_TheIWLineOfTheIWalking)& Value (const Standard_Integer Index) const; + //! Returns the number of points belonging to Pnts on which no + //! line starts or ends. + //! An exception is raised if IsDone returns False. Standard_Integer NbSinglePnts() const; + //! Returns the point of range Index . + //! An exception is raised if IsDone returns False. + //! An exception is raised if Index<=0 or + //! Index > NbSinglePnts. const IntSurf_PathPoint& SinglePnt (const Standard_Integer Index) const; @@ -105,6 +135,7 @@ protected: Standard_EXPORT void MakeWalkingPoint (const Standard_Integer Case, const Standard_Real U, const Standard_Real V, Contap_SurfFunction& Section, IntSurf_PntOn2S& Psol); + //! Clears up internal containers Standard_EXPORT void Clear(); diff --git a/src/Contap/Contap_TheSearch.hxx b/src/Contap/Contap_TheSearch.hxx index 26f3a4964b..e17bbe5efb 100644 --- a/src/Contap/Contap_TheSearch.hxx +++ b/src/Contap/Contap_TheSearch.hxx @@ -51,20 +51,44 @@ public: DEFINE_STANDARD_ALLOC + //! Empty constructor. Standard_EXPORT Contap_TheSearch(); + //! Algorithm to find the points and parts of curves of Domain + //! (domain of of restriction of a surface) which verify + //! F = 0. + //! TolBoundary defines if a curve is on Q. + //! TolTangency defines if a point is on Q. Standard_EXPORT void Perform (Contap_ArcFunction& F, const Handle(Adaptor3d_TopolTool)& Domain, const Standard_Real TolBoundary, const Standard_Real TolTangency, const Standard_Boolean RecheckOnRegularity = Standard_False); + //! Returns True if the calculus was successful. Standard_Boolean IsDone() const; + //! Returns true if all arc of the Arcs are solution (inside + //! the surface). + //! An exception is raised if IsDone returns False. Standard_Boolean AllArcSolution() const; + //! Returns the number of resulting points. + //! An exception is raised if IsDone returns False (NotDone). Standard_Integer NbPoints() const; + //! Returns the resulting point of range Index. + //! The exception NotDone is raised if IsDone() returns + //! False. + //! The exception OutOfRange is raised if + //! Index <= 0 or Index > NbPoints. const Contap_ThePathPointOfTheSearch& Point (const Standard_Integer Index) const; + //! Returns the number of the resulting segments. + //! An exception is raised if IsDone returns False (NotDone). Standard_Integer NbSegments() const; + //! Returns the resulting segment of range Index. + //! The exception NotDone is raised if IsDone() returns + //! False. + //! The exception OutOfRange is raised if + //! Index <= 0 or Index > NbPoints. const Contap_TheSegmentOfTheSearch& Segment (const Standard_Integer Index) const; diff --git a/src/Contap/Contap_TheSearchInside.hxx b/src/Contap/Contap_TheSearchInside.hxx index 1d88ecfb4f..0b069372fd 100644 --- a/src/Contap/Contap_TheSearchInside.hxx +++ b/src/Contap/Contap_TheSearchInside.hxx @@ -53,8 +53,16 @@ public: Standard_Boolean IsDone() const; + //! Returns the number of points. + //! The exception NotDone if raised if IsDone + //! returns False. Standard_Integer NbPoints() const; + //! Returns the point of range Index. + //! The exception NotDone if raised if IsDone + //! returns False. + //! The exception OutOfRange if raised if + //! Index <= 0 or Index > NbPoints. const IntSurf_InteriorPoint& Value (const Standard_Integer Index) const; diff --git a/src/Contap/Contap_TheSegmentOfTheSearch.hxx b/src/Contap/Contap_TheSegmentOfTheSearch.hxx index 4d88320d61..409255b306 100644 --- a/src/Contap/Contap_TheSegmentOfTheSearch.hxx +++ b/src/Contap/Contap_TheSegmentOfTheSearch.hxx @@ -37,20 +37,32 @@ public: DEFINE_STANDARD_ALLOC + //! Empty constructor. Standard_EXPORT Contap_TheSegmentOfTheSearch(); + //! Defines the concerned arc. void SetValue (const Handle(Adaptor2d_HCurve2d)& A); + //! Defines the first point or the last point, + //! depending on the value of the boolean First. Standard_EXPORT void SetLimitPoint (const Contap_ThePathPointOfTheSearch& V, const Standard_Boolean First); + //! Returns the geometric curve on the surface 's domain + //! which is solution. const Handle(Adaptor2d_HCurve2d)& Curve() const; + //! Returns True if there is a vertex (ThePathPoint) defining + //! the lowest valid parameter on the arc. Standard_Boolean HasFirstPoint() const; + //! Returns the first point. const Contap_ThePathPointOfTheSearch& FirstPoint() const; + //! Returns True if there is a vertex (ThePathPoint) defining + //! the greatest valid parameter on the arc. Standard_Boolean HasLastPoint() const; + //! Returns the last point. const Contap_ThePathPointOfTheSearch& LastPoint() const; diff --git a/src/Dico/Dico_DictionaryOfInteger.hxx b/src/Dico/Dico_DictionaryOfInteger.hxx index d51f38c0f5..4546d6ad14 100644 --- a/src/Dico/Dico_DictionaryOfInteger.hxx +++ b/src/Dico/Dico_DictionaryOfInteger.hxx @@ -42,40 +42,87 @@ class Dico_DictionaryOfInteger : public MMgt_TShared public: + //! Creates a Dictionary cell. + //! A Dictionary is always created then handled by its first cell + //! After creating a Dictionary, user can call methods HasItem, + //! Item, SetItem ... (internal cells and entries are also + //! defined as objects from the same class) + //! Also iteration can be made, by an Iterator on this Dictionary Standard_EXPORT Dico_DictionaryOfInteger(); + //! Returns True if an Item is bound to a Name in the Dictionnary + //! : if True, commands exact matching + //! if False, accept completion, only if ONE AND ONLY ONE + //! Dictionnary Entry has as beginning of its name Standard_EXPORT Standard_Boolean HasItem (const Standard_CString name, const Standard_Boolean exact = Standard_False) const; + //! Works as above method but accepts a String from TCollection Standard_EXPORT Standard_Boolean HasItem (const TCollection_AsciiString& name, const Standard_Boolean exact = Standard_True) const; + //! Returns item bound to a name in the Dictionnary + //! : same as for HasItem Standard_EXPORT const Standard_Integer& Item (const Standard_CString name, const Standard_Boolean exact = Standard_True) const; + //! Works as above method but accepts a String from TCollection Standard_EXPORT const Standard_Integer& Item (const TCollection_AsciiString& name, const Standard_Boolean exact = Standard_True) const; + //! Gathers HasItem and Item, in a less regular but faster way + //! If return is True, is returned too, else it is not + //! : same as for HasItem Standard_EXPORT Standard_Boolean GetItem (const Standard_CString name, Standard_Integer& anitem, const Standard_Boolean exact = Standard_True) const; + //! Works as above method but accepts a String from TCollection Standard_EXPORT Standard_Boolean GetItem (const TCollection_AsciiString& name, Standard_Integer& anitem, const Standard_Boolean exact = Standard_True) const; + //! Binds an item to a dictionnary entry + //! If is already known in the dictionary, its value + //! is changed. Else, the dictionary entry is created. + //! If is given False, completion is tried, it is accepted + //! If it gives a UNIQUE entry : hence this one will be modified + //! Else, new entry is created with the exact name given Standard_EXPORT void SetItem (const Standard_CString name, const Standard_Integer& anitem, const Standard_Boolean exact = Standard_True); + //! Works as above method but accepts a String from TCollection Standard_EXPORT void SetItem (const TCollection_AsciiString& name, const Standard_Integer& anitem, const Standard_Boolean exact = Standard_True); + //! Returns the Item AS AN ADDRESS which corresponds to a Name, + //! in order to be changed or set. + //! If this name is not yet recorded, the Dictionary creates it. + //! is returned True if the Item is recorded in the + //! Dictionary, False else, in that case the Item is reserved and + //! the name is noted as beeing valued now. Standard_EXPORT Standard_Integer& NewItem (const Standard_CString name, Standard_Boolean& isvalued, const Standard_Boolean exact = Standard_True); + //! Works as above method but accepts a String from TCollection Standard_EXPORT Standard_Integer& NewItem (const TCollection_AsciiString& name, Standard_Boolean& isvalued, const Standard_Boolean exact = Standard_True); + //! Removes a dictionary entry given by its name then Returns True + //! If the entry does not exists, Does nothing then Returns False + //! : as for HasItem, if completion works, the found entry + //! is removed (else returned value is False) + //! commands cleaning dictionary (to recover memory space) + //! For an isolated call, it is recommanded to give it at True + //! For a sequence of calls, rather give False, then call Clean Standard_EXPORT Standard_Boolean RemoveItem (const Standard_CString name, const Standard_Boolean cln = Standard_True, const Standard_Boolean exact = Standard_True); + //! Works as above method but accepts a String from TCollection Standard_EXPORT Standard_Boolean RemoveItem (const TCollection_AsciiString& name, const Standard_Boolean cln = Standard_True, const Standard_Boolean exact = Standard_True); + //! Deletes physically in one step the entries which were removed + //! (can be used for a more efficient Memory Management : first + //! Remove several Items ( = False), then Clean the Memory) Standard_EXPORT void Clean(); + //! Returns True if no Item is recorded Standard_EXPORT Standard_Boolean IsEmpty() const; + //! Clears all the Dictionary : all recorded Items are removed Standard_EXPORT void Clear(); + //! Copies the Dictionary as a Tree, without Copying the Items Standard_EXPORT Handle(Dico_DictionaryOfInteger) Copy() const; + //! Internal routine used for completion (returns True if success) Standard_EXPORT Standard_Boolean Complete (Handle(Dico_DictionaryOfInteger)& acell) const; @@ -92,38 +139,57 @@ protected: private: + //! Defines cell's character (internal use, to build dict. tree) Standard_EXPORT void SetChar (const Standard_Character car); + //! Returns True if this cell has a subcell Standard_EXPORT Standard_Boolean HasSub() const; + //! Returns subcell Standard_EXPORT Handle(Dico_DictionaryOfInteger) Sub() const; + //! Returns True if this cell has a next cell Standard_EXPORT Standard_Boolean HasNext() const; + //! Returns next cell Standard_EXPORT Handle(Dico_DictionaryOfInteger) Next() const; + //! Defines subcell Standard_EXPORT void SetSub (const Handle(Dico_DictionaryOfInteger)& acell); + //! Defines next cell Standard_EXPORT void SetNext (const Handle(Dico_DictionaryOfInteger)& acell); + //! Internal method used to get an entry from a given name Standard_EXPORT void SearchCell (const Standard_CString name, const Standard_Size lmax, const Standard_Character car, const Standard_Size level, Handle(Dico_DictionaryOfInteger)& acell, Standard_Size& reslev, Standard_Integer& stat) const; + //! Internal method used to create a new entry for a name Standard_EXPORT void NewCell (const Standard_CString name, const Standard_Size namlen, Handle(Dico_DictionaryOfInteger)& acell, const Standard_Size reslev, const Standard_Integer stat); + //! Returns True if a cell has an associated item value Standard_EXPORT Standard_Boolean HasIt() const; + //! Returns item value associated to a cell Standard_EXPORT const Standard_Integer& It() const; + //! Returns item address associated to a cell Standard_EXPORT Standard_Integer& ItAdr(); + //! Binds an item value to a cell Standard_EXPORT void SetIt (const Standard_Integer& anitem); + //! Declares a cell as Valued : used by NewItem (when an Item + //! is created if it did not exist and is returned) Standard_EXPORT void DeclIt(); + //! Removes item bound to a cell (cancels effect of DeclIt) Standard_EXPORT void RemoveIt(); + //! Returns cell's character as a node feature Standard_EXPORT Standard_Character CellChar() const; + //! Performs Copy from an original to + //! Called by Copy Standard_EXPORT void GetCopied (const Handle(Dico_DictionaryOfInteger)& fromcell); Standard_Character thecars[4]; diff --git a/src/Dico/Dico_DictionaryOfTransient.hxx b/src/Dico/Dico_DictionaryOfTransient.hxx index f3b783466d..9801615ef6 100644 --- a/src/Dico/Dico_DictionaryOfTransient.hxx +++ b/src/Dico/Dico_DictionaryOfTransient.hxx @@ -43,40 +43,87 @@ class Dico_DictionaryOfTransient : public MMgt_TShared public: + //! Creates a Dictionary cell. + //! A Dictionary is always created then handled by its first cell + //! After creating a Dictionary, user can call methods HasItem, + //! Item, SetItem ... (internal cells and entries are also + //! defined as objects from the same class) + //! Also iteration can be made, by an Iterator on this Dictionary Standard_EXPORT Dico_DictionaryOfTransient(); + //! Returns True if an Item is bound to a Name in the Dictionnary + //! : if True, commands exact matching + //! if False, accept completion, only if ONE AND ONLY ONE + //! Dictionnary Entry has as beginning of its name Standard_EXPORT Standard_Boolean HasItem (const Standard_CString name, const Standard_Boolean exact = Standard_False) const; + //! Works as above method but accepts a String from TCollection Standard_EXPORT Standard_Boolean HasItem (const TCollection_AsciiString& name, const Standard_Boolean exact = Standard_True) const; + //! Returns item bound to a name in the Dictionnary + //! : same as for HasItem Standard_EXPORT const Handle(Standard_Transient)& Item (const Standard_CString name, const Standard_Boolean exact = Standard_True) const; + //! Works as above method but accepts a String from TCollection Standard_EXPORT const Handle(Standard_Transient)& Item (const TCollection_AsciiString& name, const Standard_Boolean exact = Standard_True) const; + //! Gathers HasItem and Item, in a less regular but faster way + //! If return is True, is returned too, else it is not + //! : same as for HasItem Standard_EXPORT Standard_Boolean GetItem (const Standard_CString name, Handle(Standard_Transient)& anitem, const Standard_Boolean exact = Standard_True) const; + //! Works as above method but accepts a String from TCollection Standard_EXPORT Standard_Boolean GetItem (const TCollection_AsciiString& name, Handle(Standard_Transient)& anitem, const Standard_Boolean exact = Standard_True) const; + //! Binds an item to a dictionnary entry + //! If is already known in the dictionary, its value + //! is changed. Else, the dictionary entry is created. + //! If is given False, completion is tried, it is accepted + //! If it gives a UNIQUE entry : hence this one will be modified + //! Else, new entry is created with the exact name given Standard_EXPORT void SetItem (const Standard_CString name, const Handle(Standard_Transient)& anitem, const Standard_Boolean exact = Standard_True); + //! Works as above method but accepts a String from TCollection Standard_EXPORT void SetItem (const TCollection_AsciiString& name, const Handle(Standard_Transient)& anitem, const Standard_Boolean exact = Standard_True); + //! Returns the Item AS AN ADDRESS which corresponds to a Name, + //! in order to be changed or set. + //! If this name is not yet recorded, the Dictionary creates it. + //! is returned True if the Item is recorded in the + //! Dictionary, False else, in that case the Item is reserved and + //! the name is noted as beeing valued now. Standard_EXPORT Handle(Standard_Transient)& NewItem (const Standard_CString name, Standard_Boolean& isvalued, const Standard_Boolean exact = Standard_True); + //! Works as above method but accepts a String from TCollection Standard_EXPORT Handle(Standard_Transient)& NewItem (const TCollection_AsciiString& name, Standard_Boolean& isvalued, const Standard_Boolean exact = Standard_True); + //! Removes a dictionary entry given by its name then Returns True + //! If the entry does not exists, Does nothing then Returns False + //! : as for HasItem, if completion works, the found entry + //! is removed (else returned value is False) + //! commands cleaning dictionary (to recover memory space) + //! For an isolated call, it is recommanded to give it at True + //! For a sequence of calls, rather give False, then call Clean Standard_EXPORT Standard_Boolean RemoveItem (const Standard_CString name, const Standard_Boolean cln = Standard_True, const Standard_Boolean exact = Standard_True); + //! Works as above method but accepts a String from TCollection Standard_EXPORT Standard_Boolean RemoveItem (const TCollection_AsciiString& name, const Standard_Boolean cln = Standard_True, const Standard_Boolean exact = Standard_True); + //! Deletes physically in one step the entries which were removed + //! (can be used for a more efficient Memory Management : first + //! Remove several Items ( = False), then Clean the Memory) Standard_EXPORT void Clean(); + //! Returns True if no Item is recorded Standard_EXPORT Standard_Boolean IsEmpty() const; + //! Clears all the Dictionary : all recorded Items are removed Standard_EXPORT void Clear(); + //! Copies the Dictionary as a Tree, without Copying the Items Standard_EXPORT Handle(Dico_DictionaryOfTransient) Copy() const; + //! Internal routine used for completion (returns True if success) Standard_EXPORT Standard_Boolean Complete (Handle(Dico_DictionaryOfTransient)& acell) const; @@ -93,38 +140,57 @@ protected: private: + //! Defines cell's character (internal use, to build dict. tree) Standard_EXPORT void SetChar (const Standard_Character car); + //! Returns True if this cell has a subcell Standard_EXPORT Standard_Boolean HasSub() const; + //! Returns subcell Standard_EXPORT Handle(Dico_DictionaryOfTransient) Sub() const; + //! Returns True if this cell has a next cell Standard_EXPORT Standard_Boolean HasNext() const; + //! Returns next cell Standard_EXPORT Handle(Dico_DictionaryOfTransient) Next() const; + //! Defines subcell Standard_EXPORT void SetSub (const Handle(Dico_DictionaryOfTransient)& acell); + //! Defines next cell Standard_EXPORT void SetNext (const Handle(Dico_DictionaryOfTransient)& acell); + //! Internal method used to get an entry from a given name Standard_EXPORT void SearchCell (const Standard_CString name, const Standard_Size lmax, const Standard_Character car, const Standard_Size level, Handle(Dico_DictionaryOfTransient)& acell, Standard_Size& reslev, Standard_Integer& stat) const; + //! Internal method used to create a new entry for a name Standard_EXPORT void NewCell (const Standard_CString name, const Standard_Size namlen, Handle(Dico_DictionaryOfTransient)& acell, const Standard_Size reslev, const Standard_Integer stat); + //! Returns True if a cell has an associated item value Standard_EXPORT Standard_Boolean HasIt() const; + //! Returns item value associated to a cell Standard_EXPORT const Handle(Standard_Transient)& It() const; + //! Returns item address associated to a cell Standard_EXPORT Handle(Standard_Transient)& ItAdr(); + //! Binds an item value to a cell Standard_EXPORT void SetIt (const Handle(Standard_Transient)& anitem); + //! Declares a cell as Valued : used by NewItem (when an Item + //! is created if it did not exist and is returned) Standard_EXPORT void DeclIt(); + //! Removes item bound to a cell (cancels effect of DeclIt) Standard_EXPORT void RemoveIt(); + //! Returns cell's character as a node feature Standard_EXPORT Standard_Character CellChar() const; + //! Performs Copy from an original to + //! Called by Copy Standard_EXPORT void GetCopied (const Handle(Dico_DictionaryOfTransient)& fromcell); Standard_Character thecars[4]; diff --git a/src/Dico/Dico_IteratorOfDictionaryOfInteger.hxx b/src/Dico/Dico_IteratorOfDictionaryOfInteger.hxx index 684995dda8..4bd8fd92d6 100644 --- a/src/Dico/Dico_IteratorOfDictionaryOfInteger.hxx +++ b/src/Dico/Dico_IteratorOfDictionaryOfInteger.hxx @@ -39,20 +39,32 @@ public: DEFINE_STANDARD_ALLOC + //! Creates an iterator which will work on all the dictionary Standard_EXPORT Dico_IteratorOfDictionaryOfInteger(const Handle(Dico_DictionaryOfInteger)& acell); + //! Creates an iterator which will consider only entries + //! which name begin by the string given as basename (subpart) Standard_EXPORT Dico_IteratorOfDictionaryOfInteger(const Handle(Dico_DictionaryOfInteger)& acell, const Standard_CString basename); + //! Creates an iterator which will consider only entries + //! which name begin by the string given as basename (subpart) + //! Same as above, but basename is String instead of CString Standard_EXPORT Dico_IteratorOfDictionaryOfInteger(const Handle(Dico_DictionaryOfInteger)& acell, const TCollection_AsciiString& basename); + //! Allows to Start a new Iteration from beginning Standard_EXPORT void Start(); + //! Returns True if there are more entries to return Standard_EXPORT Standard_Boolean More(); + //! Go to the next entry + //! (if there is not, Value will raise an exception) Standard_EXPORT void Next(); + //! Returns item value of current entry Standard_EXPORT const Standard_Integer& Value() const; + //! Returns name of current entry Standard_EXPORT TCollection_AsciiString Name() const; @@ -67,6 +79,7 @@ protected: private: + //! Appends a new value to the Iteration Stack Standard_EXPORT void AppendStack (const Handle(Dico_DictionaryOfInteger)& val); diff --git a/src/Dico/Dico_IteratorOfDictionaryOfTransient.hxx b/src/Dico/Dico_IteratorOfDictionaryOfTransient.hxx index 64d80e66c3..20608bf571 100644 --- a/src/Dico/Dico_IteratorOfDictionaryOfTransient.hxx +++ b/src/Dico/Dico_IteratorOfDictionaryOfTransient.hxx @@ -40,20 +40,32 @@ public: DEFINE_STANDARD_ALLOC + //! Creates an iterator which will work on all the dictionary Standard_EXPORT Dico_IteratorOfDictionaryOfTransient(const Handle(Dico_DictionaryOfTransient)& acell); + //! Creates an iterator which will consider only entries + //! which name begin by the string given as basename (subpart) Standard_EXPORT Dico_IteratorOfDictionaryOfTransient(const Handle(Dico_DictionaryOfTransient)& acell, const Standard_CString basename); + //! Creates an iterator which will consider only entries + //! which name begin by the string given as basename (subpart) + //! Same as above, but basename is String instead of CString Standard_EXPORT Dico_IteratorOfDictionaryOfTransient(const Handle(Dico_DictionaryOfTransient)& acell, const TCollection_AsciiString& basename); + //! Allows to Start a new Iteration from beginning Standard_EXPORT void Start(); + //! Returns True if there are more entries to return Standard_EXPORT Standard_Boolean More(); + //! Go to the next entry + //! (if there is not, Value will raise an exception) Standard_EXPORT void Next(); + //! Returns item value of current entry Standard_EXPORT const Handle(Standard_Transient)& Value() const; + //! Returns name of current entry Standard_EXPORT TCollection_AsciiString Name() const; @@ -68,6 +80,7 @@ protected: private: + //! Appends a new value to the Iteration Stack Standard_EXPORT void AppendStack (const Handle(Dico_DictionaryOfTransient)& val); diff --git a/src/Dico/Dico_StackItemOfDictionaryOfInteger.hxx b/src/Dico/Dico_StackItemOfDictionaryOfInteger.hxx index 00c8222200..1d6b367a28 100644 --- a/src/Dico/Dico_StackItemOfDictionaryOfInteger.hxx +++ b/src/Dico/Dico_StackItemOfDictionaryOfInteger.hxx @@ -36,14 +36,19 @@ class Dico_StackItemOfDictionaryOfInteger : public MMgt_TShared public: + //! Creates a StackItem with no Previous one Standard_EXPORT Dico_StackItemOfDictionaryOfInteger(); + //! Creates a StackItem with a Previous one Standard_EXPORT Dico_StackItemOfDictionaryOfInteger(const Handle(Dico_StackItemOfDictionaryOfInteger)& previous); + //! Returns the Previous Item (is Null if no Previous defined) Standard_EXPORT Handle(Dico_StackItemOfDictionaryOfInteger) Previous() const; + //! Returns the Dictionary Cell corresponding to an Item Standard_EXPORT Handle(Dico_DictionaryOfInteger) Value() const; + //! Sets a new Dictionary Cell as Value of an Item Standard_EXPORT void SetValue (const Handle(Dico_DictionaryOfInteger)& cval); diff --git a/src/Dico/Dico_StackItemOfDictionaryOfTransient.hxx b/src/Dico/Dico_StackItemOfDictionaryOfTransient.hxx index d07dd47ee4..13829a0365 100644 --- a/src/Dico/Dico_StackItemOfDictionaryOfTransient.hxx +++ b/src/Dico/Dico_StackItemOfDictionaryOfTransient.hxx @@ -36,14 +36,19 @@ class Dico_StackItemOfDictionaryOfTransient : public MMgt_TShared public: + //! Creates a StackItem with no Previous one Standard_EXPORT Dico_StackItemOfDictionaryOfTransient(); + //! Creates a StackItem with a Previous one Standard_EXPORT Dico_StackItemOfDictionaryOfTransient(const Handle(Dico_StackItemOfDictionaryOfTransient)& previous); + //! Returns the Previous Item (is Null if no Previous defined) Standard_EXPORT Handle(Dico_StackItemOfDictionaryOfTransient) Previous() const; + //! Returns the Dictionary Cell corresponding to an Item Standard_EXPORT Handle(Dico_DictionaryOfTransient) Value() const; + //! Sets a new Dictionary Cell as Value of an Item Standard_EXPORT void SetValue (const Handle(Dico_DictionaryOfTransient)& cval); diff --git a/src/Extrema/Extrema_CCLocFOfLocECC.hxx b/src/Extrema/Extrema_CCLocFOfLocECC.hxx index 6db628304d..9dad65b4b0 100644 --- a/src/Extrema/Extrema_CCLocFOfLocECC.hxx +++ b/src/Extrema/Extrema_CCLocFOfLocECC.hxx @@ -62,26 +62,40 @@ public: virtual Standard_Integer NbEquations() const Standard_OVERRIDE; + //! Calculate Fi(U,V). Standard_EXPORT virtual Standard_Boolean Value (const math_Vector& UV, math_Vector& F) Standard_OVERRIDE; + //! Calculate Fi'(U,V). Standard_EXPORT Standard_Boolean Derivatives (const math_Vector& UV, math_Matrix& DF); + //! Calculate Fi(U,V) and Fi'(U,V). Standard_EXPORT Standard_Boolean Values (const math_Vector& UV, math_Vector& F, math_Matrix& DF); + //! Save the found extremum. Standard_EXPORT virtual Standard_Integer GetStateNumber() Standard_OVERRIDE; + //! Return the number of found extrema. Standard_Integer NbExt() const; + //! Return the value of the Nth distance. Standard_Real SquareDistance (const Standard_Integer N) const; + //! Return the points of the Nth extreme distance. Standard_EXPORT void Points (const Standard_Integer N, Extrema_POnCurv& P1, Extrema_POnCurv& P2) const; + //! Returns a pointer to the curve specified in the constructor + //! or in SetCurve() method. Standard_Address CurvePtr (const Standard_Integer theRank) const; + //! Returns a tolerance specified in the constructor + //! or in SetTolerance() method. Standard_Real Tolerance() const; + //! Determines of boundaries of subinterval for find of root. Standard_EXPORT void SubIntervalInitialize (const math_Vector& theUfirst, const math_Vector& theUlast); + //! Computes a Tol value. If 1st derivative of curve + //! |D1|th extremum square distance. Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N) const; + //! Returns the number of extremum distances. Standard_EXPORT Standard_Integer NbExt() const; + //! Returns True if the th extremum distance is a + //! minimum. Standard_EXPORT Standard_Boolean IsMin (const Standard_Integer N) const; + //! Returns the point of the th extremum distance. Standard_EXPORT const Extrema_POnCurv& Point (const Standard_Integer N) const; + //! if the curve is a trimmed curve, + //! dist1 is a square distance between

and the point + //! of parameter FirstParameter and + //! dist2 is a square distance between

and the point + //! of parameter LastParameter . Standard_EXPORT void TrimmedSquareDistances (Standard_Real& dist1, Standard_Real& dist2, gp_Pnt& P1, gp_Pnt& P2) const; diff --git a/src/Extrema/Extrema_ELPCOfLocateExtPC2d.hxx b/src/Extrema/Extrema_ELPCOfLocateExtPC2d.hxx index eeb993142a..53ddfe8976 100644 --- a/src/Extrema/Extrema_ELPCOfLocateExtPC2d.hxx +++ b/src/Extrema/Extrema_ELPCOfLocateExtPC2d.hxx @@ -55,24 +55,55 @@ public: Standard_EXPORT Extrema_ELPCOfLocateExtPC2d(); + //! It calculates all the distances. + //! The function F(u)=distance(P,C(u)) has an extremum + //! when g(u)=dF/du=0. The algorithm searchs all the + //! zeros inside the definition range of the curve. + //! Zeros are searched between uinf and usup. + //! Tol is used to decide to stop the + //! iterations according to the following condition: + //! if n is the number of iterations, + //! the algorithm stops when abs(F(Un)-F(Un-1)) < Tol. Standard_EXPORT Extrema_ELPCOfLocateExtPC2d(const gp_Pnt2d& P, const Adaptor2d_Curve2d& C, const Standard_Real Uinf, const Standard_Real Usup, const Standard_Real TolF = 1.0e-10); + //! It calculates all the distances. + //! The function F(u)=distance(P,C(u)) has an extremum + //! when g(u)=dF/du=0. The algorithm searchs all the + //! zeros inside the definition range of the curve. + //! Tol is used to decide to stop the + //! iterations according to the following condition: + //! if n is the number of iterations, + //! the algorithm stops when abs(F(Un)-F(Un-1)) < Tol. Standard_EXPORT Extrema_ELPCOfLocateExtPC2d(const gp_Pnt2d& P, const Adaptor2d_Curve2d& C, const Standard_Real TolF = 1.0e-10); + //! initializes the fields of the algorithm. Standard_EXPORT void Initialize (const Adaptor2d_Curve2d& C, const Standard_Real Uinf, const Standard_Real Usup, const Standard_Real TolF = 1.0e-10); + //! An exception is raised if the fields have not been + //! initialized. Standard_EXPORT void Perform (const gp_Pnt2d& P); + //! True if the distances are found. Standard_EXPORT Standard_Boolean IsDone() const; + //! Returns the value of the th extremum square distance. Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N) const; + //! Returns the number of extremum distances. Standard_EXPORT Standard_Integer NbExt() const; + //! Returns True if the th extremum distance is a + //! minimum. Standard_EXPORT Standard_Boolean IsMin (const Standard_Integer N) const; + //! Returns the point of the th extremum distance. Standard_EXPORT const Extrema_POnCurv2d& Point (const Standard_Integer N) const; + //! if the curve is a trimmed curve, + //! dist1 is a square distance between

and the point + //! of parameter FirstParameter and + //! dist2 is a square distance between

and the point + //! of parameter LastParameter . Standard_EXPORT void TrimmedSquareDistances (Standard_Real& dist1, Standard_Real& dist2, gp_Pnt2d& P1, gp_Pnt2d& P2) const; diff --git a/src/Extrema/Extrema_EPCOfELPCOfLocateExtPC.hxx b/src/Extrema/Extrema_EPCOfELPCOfLocateExtPC.hxx index 61971f2f2a..490e12c2ef 100644 --- a/src/Extrema/Extrema_EPCOfELPCOfLocateExtPC.hxx +++ b/src/Extrema/Extrema_EPCOfELPCOfLocateExtPC.hxx @@ -47,28 +47,62 @@ public: Standard_EXPORT Extrema_EPCOfELPCOfLocateExtPC(); + //! It calculates all the distances. + //! The function F(u)=distance(P,C(u)) has an extremum + //! when g(u)=dF/du=0. The algorithm searchs all the + //! zeros inside the definition range of the curve. + //! NbU is used to locate the close points to + //! find the zeros. + //! Tol and TolU are used to decide to stop the + //! iterations according to the following condition: + //! if n is the number of iterations, + //! abs(Un-Un-1) < TolU and abs(F(Un)-F(Un-1)) < Tol. Standard_EXPORT Extrema_EPCOfELPCOfLocateExtPC(const gp_Pnt& P, const Adaptor3d_Curve& C, const Standard_Integer NbU, const Standard_Real TolU, const Standard_Real TolF); + //! It calculates all the distances. + //! The function F(u)=distance(P,C(u)) has an extremum + //! when g(u)=dF/du=0. The algorithm searchs all the + //! zeros inside the definition range of the curve. + //! NbU is used to locate the close points to + //! find the zeros. + //! Zeros are searched between umin and usup. + //! Tol and TolU are used to decide to stop the + //! iterations according to the following condition: + //! if n is the number of iterations, + //! abs(Un-Un-1) < TolU and abs(F(Un)-F(Un-1)) < Tol. Standard_EXPORT Extrema_EPCOfELPCOfLocateExtPC(const gp_Pnt& P, const Adaptor3d_Curve& C, const Standard_Integer NbU, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real TolU, const Standard_Real TolF); + //! sets the fields of the algorithm. Standard_EXPORT void Initialize (const Adaptor3d_Curve& C, const Standard_Integer NbU, const Standard_Real TolU, const Standard_Real TolF); + //! sets the fields of the algorithm. Standard_EXPORT void Initialize (const Adaptor3d_Curve& C, const Standard_Integer NbU, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real TolU, const Standard_Real TolF); + //! sets the fields of the algorithm. Standard_EXPORT void Initialize (const Adaptor3d_Curve& C); + //! sets the fields of the algorithm. Standard_EXPORT void Initialize (const Standard_Integer NbU, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real TolU, const Standard_Real TolF); + //! the algorithm is done with the point P. + //! An exception is raised if the fields have not + //! been initialized. Standard_EXPORT void Perform (const gp_Pnt& P); + //! True if the distances are found. Standard_EXPORT Standard_Boolean IsDone() const; + //! Returns the number of extremum distances. Standard_EXPORT Standard_Integer NbExt() const; + //! Returns the value of the Nth extremum square distance. Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N) const; + //! Returns True if the Nth extremum distance is a + //! minimum. Standard_EXPORT Standard_Boolean IsMin (const Standard_Integer N) const; + //! Returns the point of the Nth extremum distance. Standard_EXPORT const Extrema_POnCurv& Point (const Standard_Integer N) const; diff --git a/src/Extrema/Extrema_EPCOfELPCOfLocateExtPC2d.hxx b/src/Extrema/Extrema_EPCOfELPCOfLocateExtPC2d.hxx index 5e8b69fd0a..ea3c8bc91a 100644 --- a/src/Extrema/Extrema_EPCOfELPCOfLocateExtPC2d.hxx +++ b/src/Extrema/Extrema_EPCOfELPCOfLocateExtPC2d.hxx @@ -47,28 +47,62 @@ public: Standard_EXPORT Extrema_EPCOfELPCOfLocateExtPC2d(); + //! It calculates all the distances. + //! The function F(u)=distance(P,C(u)) has an extremum + //! when g(u)=dF/du=0. The algorithm searchs all the + //! zeros inside the definition range of the curve. + //! NbU is used to locate the close points to + //! find the zeros. + //! Tol and TolU are used to decide to stop the + //! iterations according to the following condition: + //! if n is the number of iterations, + //! abs(Un-Un-1) < TolU and abs(F(Un)-F(Un-1)) < Tol. Standard_EXPORT Extrema_EPCOfELPCOfLocateExtPC2d(const gp_Pnt2d& P, const Adaptor2d_Curve2d& C, const Standard_Integer NbU, const Standard_Real TolU, const Standard_Real TolF); + //! It calculates all the distances. + //! The function F(u)=distance(P,C(u)) has an extremum + //! when g(u)=dF/du=0. The algorithm searchs all the + //! zeros inside the definition range of the curve. + //! NbU is used to locate the close points to + //! find the zeros. + //! Zeros are searched between umin and usup. + //! Tol and TolU are used to decide to stop the + //! iterations according to the following condition: + //! if n is the number of iterations, + //! abs(Un-Un-1) < TolU and abs(F(Un)-F(Un-1)) < Tol. Standard_EXPORT Extrema_EPCOfELPCOfLocateExtPC2d(const gp_Pnt2d& P, const Adaptor2d_Curve2d& C, const Standard_Integer NbU, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real TolU, const Standard_Real TolF); + //! sets the fields of the algorithm. Standard_EXPORT void Initialize (const Adaptor2d_Curve2d& C, const Standard_Integer NbU, const Standard_Real TolU, const Standard_Real TolF); + //! sets the fields of the algorithm. Standard_EXPORT void Initialize (const Adaptor2d_Curve2d& C, const Standard_Integer NbU, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real TolU, const Standard_Real TolF); + //! sets the fields of the algorithm. Standard_EXPORT void Initialize (const Adaptor2d_Curve2d& C); + //! sets the fields of the algorithm. Standard_EXPORT void Initialize (const Standard_Integer NbU, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real TolU, const Standard_Real TolF); + //! the algorithm is done with the point P. + //! An exception is raised if the fields have not + //! been initialized. Standard_EXPORT void Perform (const gp_Pnt2d& P); + //! True if the distances are found. Standard_EXPORT Standard_Boolean IsDone() const; + //! Returns the number of extremum distances. Standard_EXPORT Standard_Integer NbExt() const; + //! Returns the value of the Nth extremum square distance. Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N) const; + //! Returns True if the Nth extremum distance is a + //! minimum. Standard_EXPORT Standard_Boolean IsMin (const Standard_Integer N) const; + //! Returns the point of the Nth extremum distance. Standard_EXPORT const Extrema_POnCurv2d& Point (const Standard_Integer N) const; diff --git a/src/Extrema/Extrema_EPCOfExtPC.hxx b/src/Extrema/Extrema_EPCOfExtPC.hxx index 501677e842..2ffad69f28 100644 --- a/src/Extrema/Extrema_EPCOfExtPC.hxx +++ b/src/Extrema/Extrema_EPCOfExtPC.hxx @@ -47,28 +47,62 @@ public: Standard_EXPORT Extrema_EPCOfExtPC(); + //! It calculates all the distances. + //! The function F(u)=distance(P,C(u)) has an extremum + //! when g(u)=dF/du=0. The algorithm searchs all the + //! zeros inside the definition range of the curve. + //! NbU is used to locate the close points to + //! find the zeros. + //! Tol and TolU are used to decide to stop the + //! iterations according to the following condition: + //! if n is the number of iterations, + //! abs(Un-Un-1) < TolU and abs(F(Un)-F(Un-1)) < Tol. Standard_EXPORT Extrema_EPCOfExtPC(const gp_Pnt& P, const Adaptor3d_Curve& C, const Standard_Integer NbU, const Standard_Real TolU, const Standard_Real TolF); + //! It calculates all the distances. + //! The function F(u)=distance(P,C(u)) has an extremum + //! when g(u)=dF/du=0. The algorithm searchs all the + //! zeros inside the definition range of the curve. + //! NbU is used to locate the close points to + //! find the zeros. + //! Zeros are searched between umin and usup. + //! Tol and TolU are used to decide to stop the + //! iterations according to the following condition: + //! if n is the number of iterations, + //! abs(Un-Un-1) < TolU and abs(F(Un)-F(Un-1)) < Tol. Standard_EXPORT Extrema_EPCOfExtPC(const gp_Pnt& P, const Adaptor3d_Curve& C, const Standard_Integer NbU, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real TolU, const Standard_Real TolF); + //! sets the fields of the algorithm. Standard_EXPORT void Initialize (const Adaptor3d_Curve& C, const Standard_Integer NbU, const Standard_Real TolU, const Standard_Real TolF); + //! sets the fields of the algorithm. Standard_EXPORT void Initialize (const Adaptor3d_Curve& C, const Standard_Integer NbU, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real TolU, const Standard_Real TolF); + //! sets the fields of the algorithm. Standard_EXPORT void Initialize (const Adaptor3d_Curve& C); + //! sets the fields of the algorithm. Standard_EXPORT void Initialize (const Standard_Integer NbU, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real TolU, const Standard_Real TolF); + //! the algorithm is done with the point P. + //! An exception is raised if the fields have not + //! been initialized. Standard_EXPORT void Perform (const gp_Pnt& P); + //! True if the distances are found. Standard_EXPORT Standard_Boolean IsDone() const; + //! Returns the number of extremum distances. Standard_EXPORT Standard_Integer NbExt() const; + //! Returns the value of the Nth extremum square distance. Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N) const; + //! Returns True if the Nth extremum distance is a + //! minimum. Standard_EXPORT Standard_Boolean IsMin (const Standard_Integer N) const; + //! Returns the point of the Nth extremum distance. Standard_EXPORT const Extrema_POnCurv& Point (const Standard_Integer N) const; diff --git a/src/Extrema/Extrema_EPCOfExtPC2d.hxx b/src/Extrema/Extrema_EPCOfExtPC2d.hxx index 8f793737ab..47dafa0819 100644 --- a/src/Extrema/Extrema_EPCOfExtPC2d.hxx +++ b/src/Extrema/Extrema_EPCOfExtPC2d.hxx @@ -47,28 +47,62 @@ public: Standard_EXPORT Extrema_EPCOfExtPC2d(); + //! It calculates all the distances. + //! The function F(u)=distance(P,C(u)) has an extremum + //! when g(u)=dF/du=0. The algorithm searchs all the + //! zeros inside the definition range of the curve. + //! NbU is used to locate the close points to + //! find the zeros. + //! Tol and TolU are used to decide to stop the + //! iterations according to the following condition: + //! if n is the number of iterations, + //! abs(Un-Un-1) < TolU and abs(F(Un)-F(Un-1)) < Tol. Standard_EXPORT Extrema_EPCOfExtPC2d(const gp_Pnt2d& P, const Adaptor2d_Curve2d& C, const Standard_Integer NbU, const Standard_Real TolU, const Standard_Real TolF); + //! It calculates all the distances. + //! The function F(u)=distance(P,C(u)) has an extremum + //! when g(u)=dF/du=0. The algorithm searchs all the + //! zeros inside the definition range of the curve. + //! NbU is used to locate the close points to + //! find the zeros. + //! Zeros are searched between umin and usup. + //! Tol and TolU are used to decide to stop the + //! iterations according to the following condition: + //! if n is the number of iterations, + //! abs(Un-Un-1) < TolU and abs(F(Un)-F(Un-1)) < Tol. Standard_EXPORT Extrema_EPCOfExtPC2d(const gp_Pnt2d& P, const Adaptor2d_Curve2d& C, const Standard_Integer NbU, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real TolU, const Standard_Real TolF); + //! sets the fields of the algorithm. Standard_EXPORT void Initialize (const Adaptor2d_Curve2d& C, const Standard_Integer NbU, const Standard_Real TolU, const Standard_Real TolF); + //! sets the fields of the algorithm. Standard_EXPORT void Initialize (const Adaptor2d_Curve2d& C, const Standard_Integer NbU, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real TolU, const Standard_Real TolF); + //! sets the fields of the algorithm. Standard_EXPORT void Initialize (const Adaptor2d_Curve2d& C); + //! sets the fields of the algorithm. Standard_EXPORT void Initialize (const Standard_Integer NbU, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real TolU, const Standard_Real TolF); + //! the algorithm is done with the point P. + //! An exception is raised if the fields have not + //! been initialized. Standard_EXPORT void Perform (const gp_Pnt2d& P); + //! True if the distances are found. Standard_EXPORT Standard_Boolean IsDone() const; + //! Returns the number of extremum distances. Standard_EXPORT Standard_Integer NbExt() const; + //! Returns the value of the Nth extremum square distance. Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N) const; + //! Returns True if the Nth extremum distance is a + //! minimum. Standard_EXPORT Standard_Boolean IsMin (const Standard_Integer N) const; + //! Returns the point of the Nth extremum distance. Standard_EXPORT const Extrema_POnCurv2d& Point (const Standard_Integer N) const; diff --git a/src/Extrema/Extrema_ExtPC.hxx b/src/Extrema/Extrema_ExtPC.hxx index 3c8e2d1e13..f5edcdd862 100644 --- a/src/Extrema/Extrema_ExtPC.hxx +++ b/src/Extrema/Extrema_ExtPC.hxx @@ -55,24 +55,55 @@ public: Standard_EXPORT Extrema_ExtPC(); + //! It calculates all the distances. + //! The function F(u)=distance(P,C(u)) has an extremum + //! when g(u)=dF/du=0. The algorithm searchs all the + //! zeros inside the definition range of the curve. + //! Zeros are searched between uinf and usup. + //! Tol is used to decide to stop the + //! iterations according to the following condition: + //! if n is the number of iterations, + //! the algorithm stops when abs(F(Un)-F(Un-1)) < Tol. Standard_EXPORT Extrema_ExtPC(const gp_Pnt& P, const Adaptor3d_Curve& C, const Standard_Real Uinf, const Standard_Real Usup, const Standard_Real TolF = 1.0e-10); + //! It calculates all the distances. + //! The function F(u)=distance(P,C(u)) has an extremum + //! when g(u)=dF/du=0. The algorithm searchs all the + //! zeros inside the definition range of the curve. + //! Tol is used to decide to stop the + //! iterations according to the following condition: + //! if n is the number of iterations, + //! the algorithm stops when abs(F(Un)-F(Un-1)) < Tol. Standard_EXPORT Extrema_ExtPC(const gp_Pnt& P, const Adaptor3d_Curve& C, const Standard_Real TolF = 1.0e-10); + //! initializes the fields of the algorithm. Standard_EXPORT void Initialize (const Adaptor3d_Curve& C, const Standard_Real Uinf, const Standard_Real Usup, const Standard_Real TolF = 1.0e-10); + //! An exception is raised if the fields have not been + //! initialized. Standard_EXPORT void Perform (const gp_Pnt& P); + //! True if the distances are found. Standard_EXPORT Standard_Boolean IsDone() const; + //! Returns the value of the th extremum square distance. Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N) const; + //! Returns the number of extremum distances. Standard_EXPORT Standard_Integer NbExt() const; + //! Returns True if the th extremum distance is a + //! minimum. Standard_EXPORT Standard_Boolean IsMin (const Standard_Integer N) const; + //! Returns the point of the th extremum distance. Standard_EXPORT const Extrema_POnCurv& Point (const Standard_Integer N) const; + //! if the curve is a trimmed curve, + //! dist1 is a square distance between

and the point + //! of parameter FirstParameter and + //! dist2 is a square distance between

and the point + //! of parameter LastParameter . Standard_EXPORT void TrimmedSquareDistances (Standard_Real& dist1, Standard_Real& dist2, gp_Pnt& P1, gp_Pnt& P2) const; diff --git a/src/Extrema/Extrema_ExtPC2d.hxx b/src/Extrema/Extrema_ExtPC2d.hxx index 15c3637ac7..8c82ddfa6d 100644 --- a/src/Extrema/Extrema_ExtPC2d.hxx +++ b/src/Extrema/Extrema_ExtPC2d.hxx @@ -55,24 +55,55 @@ public: Standard_EXPORT Extrema_ExtPC2d(); + //! It calculates all the distances. + //! The function F(u)=distance(P,C(u)) has an extremum + //! when g(u)=dF/du=0. The algorithm searchs all the + //! zeros inside the definition range of the curve. + //! Zeros are searched between uinf and usup. + //! Tol is used to decide to stop the + //! iterations according to the following condition: + //! if n is the number of iterations, + //! the algorithm stops when abs(F(Un)-F(Un-1)) < Tol. Standard_EXPORT Extrema_ExtPC2d(const gp_Pnt2d& P, const Adaptor2d_Curve2d& C, const Standard_Real Uinf, const Standard_Real Usup, const Standard_Real TolF = 1.0e-10); + //! It calculates all the distances. + //! The function F(u)=distance(P,C(u)) has an extremum + //! when g(u)=dF/du=0. The algorithm searchs all the + //! zeros inside the definition range of the curve. + //! Tol is used to decide to stop the + //! iterations according to the following condition: + //! if n is the number of iterations, + //! the algorithm stops when abs(F(Un)-F(Un-1)) < Tol. Standard_EXPORT Extrema_ExtPC2d(const gp_Pnt2d& P, const Adaptor2d_Curve2d& C, const Standard_Real TolF = 1.0e-10); + //! initializes the fields of the algorithm. Standard_EXPORT void Initialize (const Adaptor2d_Curve2d& C, const Standard_Real Uinf, const Standard_Real Usup, const Standard_Real TolF = 1.0e-10); + //! An exception is raised if the fields have not been + //! initialized. Standard_EXPORT void Perform (const gp_Pnt2d& P); + //! True if the distances are found. Standard_EXPORT Standard_Boolean IsDone() const; + //! Returns the value of the th extremum square distance. Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N) const; + //! Returns the number of extremum distances. Standard_EXPORT Standard_Integer NbExt() const; + //! Returns True if the th extremum distance is a + //! minimum. Standard_EXPORT Standard_Boolean IsMin (const Standard_Integer N) const; + //! Returns the point of the th extremum distance. Standard_EXPORT const Extrema_POnCurv2d& Point (const Standard_Integer N) const; + //! if the curve is a trimmed curve, + //! dist1 is a square distance between

and the point + //! of parameter FirstParameter and + //! dist2 is a square distance between

and the point + //! of parameter LastParameter . Standard_EXPORT void TrimmedSquareDistances (Standard_Real& dist1, Standard_Real& dist2, gp_Pnt2d& P1, gp_Pnt2d& P2) const; diff --git a/src/Extrema/Extrema_LocECC.hxx b/src/Extrema/Extrema_LocECC.hxx index d3c4a9267d..0dbf490777 100644 --- a/src/Extrema/Extrema_LocECC.hxx +++ b/src/Extrema/Extrema_LocECC.hxx @@ -43,12 +43,22 @@ public: DEFINE_STANDARD_ALLOC + //! Calculates the distance with a close point. The + //! close point is defined by a parameter value on each + //! curve. + //! The function F(u,v)=distance(C1(u),C2(v)) has an + //! extremun when gradient(f)=0. The algorithm searchs + //! the zero near the close point. Standard_EXPORT Extrema_LocECC(const Adaptor3d_Curve& C1, const Adaptor3d_Curve& C2, const Standard_Real U0, const Standard_Real V0, const Standard_Real TolU, const Standard_Real TolV); + //! Returns True if the distance is found. Standard_EXPORT Standard_Boolean IsDone() const; + //! Returns the value of the extremum square distance. Standard_EXPORT Standard_Real SquareDistance() const; + //! Returns the points of the extremum distance. + //! P1 is on the first curve, P2 on the second one. Standard_EXPORT void Point (Extrema_POnCurv& P1, Extrema_POnCurv& P2) const; diff --git a/src/Extrema/Extrema_LocECC2d.hxx b/src/Extrema/Extrema_LocECC2d.hxx index 8c8fb08748..0674cd36bc 100644 --- a/src/Extrema/Extrema_LocECC2d.hxx +++ b/src/Extrema/Extrema_LocECC2d.hxx @@ -43,12 +43,22 @@ public: DEFINE_STANDARD_ALLOC + //! Calculates the distance with a close point. The + //! close point is defined by a parameter value on each + //! curve. + //! The function F(u,v)=distance(C1(u),C2(v)) has an + //! extremun when gradient(f)=0. The algorithm searchs + //! the zero near the close point. Standard_EXPORT Extrema_LocECC2d(const Adaptor2d_Curve2d& C1, const Adaptor2d_Curve2d& C2, const Standard_Real U0, const Standard_Real V0, const Standard_Real TolU, const Standard_Real TolV); + //! Returns True if the distance is found. Standard_EXPORT Standard_Boolean IsDone() const; + //! Returns the value of the extremum square distance. Standard_EXPORT Standard_Real SquareDistance() const; + //! Returns the points of the extremum distance. + //! P1 is on the first curve, P2 on the second one. Standard_EXPORT void Point (Extrema_POnCurv2d& P1, Extrema_POnCurv2d& P2) const; diff --git a/src/Extrema/Extrema_LocEPCOfLocateExtPC.hxx b/src/Extrema/Extrema_LocEPCOfLocateExtPC.hxx index ddcc8bf56f..ab7f2e6a06 100644 --- a/src/Extrema/Extrema_LocEPCOfLocateExtPC.hxx +++ b/src/Extrema/Extrema_LocEPCOfLocateExtPC.hxx @@ -46,20 +46,47 @@ public: Standard_EXPORT Extrema_LocEPCOfLocateExtPC(); + //! Calculates the distance with a close point. + //! The close point is defined by the parameter value + //! U0. + //! The function F(u)=distance(P,C(u)) has an extremum + //! when g(u)=dF/du=0. The algorithm searchs a zero + //! near the close point. + //! TolU is used to decide to stop the iterations. + //! At the nth iteration, the criteria is: + //! abs(Un - Un-1) < TolU. Standard_EXPORT Extrema_LocEPCOfLocateExtPC(const gp_Pnt& P, const Adaptor3d_Curve& C, const Standard_Real U0, const Standard_Real TolU); + //! Calculates the distance with a close point. + //! The close point is defined by the parameter value + //! U0. + //! The function F(u)=distance(P,C(u)) has an extremum + //! when g(u)=dF/du=0. The algorithm searchs a zero + //! near the close point. + //! Zeros are searched between Umin et Usup. + //! TolU is used to decide to stop the iterations. + //! At the nth iteration, the criteria is: + //! abs(Un - Un-1) < TolU. Standard_EXPORT Extrema_LocEPCOfLocateExtPC(const gp_Pnt& P, const Adaptor3d_Curve& C, const Standard_Real U0, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real TolU); + //! sets the fields of the algorithm. Standard_EXPORT void Initialize (const Adaptor3d_Curve& C, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real TolU); + //! the algorithm is done with the point P. + //! An exception is raised if the fields have not + //! been initialized. Standard_EXPORT void Perform (const gp_Pnt& P, const Standard_Real U0); + //! Returns True if the distance is found. Standard_EXPORT Standard_Boolean IsDone() const; + //! Returns the value of the extremum square distance. Standard_EXPORT Standard_Real SquareDistance() const; + //! Returns True if the extremum distance is a minimum. Standard_EXPORT Standard_Boolean IsMin() const; + //! Returns the point of the extremum distance. Standard_EXPORT const Extrema_POnCurv& Point() const; diff --git a/src/Extrema/Extrema_LocEPCOfLocateExtPC2d.hxx b/src/Extrema/Extrema_LocEPCOfLocateExtPC2d.hxx index 886173047b..27c5ae0615 100644 --- a/src/Extrema/Extrema_LocEPCOfLocateExtPC2d.hxx +++ b/src/Extrema/Extrema_LocEPCOfLocateExtPC2d.hxx @@ -46,20 +46,47 @@ public: Standard_EXPORT Extrema_LocEPCOfLocateExtPC2d(); + //! Calculates the distance with a close point. + //! The close point is defined by the parameter value + //! U0. + //! The function F(u)=distance(P,C(u)) has an extremum + //! when g(u)=dF/du=0. The algorithm searchs a zero + //! near the close point. + //! TolU is used to decide to stop the iterations. + //! At the nth iteration, the criteria is: + //! abs(Un - Un-1) < TolU. Standard_EXPORT Extrema_LocEPCOfLocateExtPC2d(const gp_Pnt2d& P, const Adaptor2d_Curve2d& C, const Standard_Real U0, const Standard_Real TolU); + //! Calculates the distance with a close point. + //! The close point is defined by the parameter value + //! U0. + //! The function F(u)=distance(P,C(u)) has an extremum + //! when g(u)=dF/du=0. The algorithm searchs a zero + //! near the close point. + //! Zeros are searched between Umin et Usup. + //! TolU is used to decide to stop the iterations. + //! At the nth iteration, the criteria is: + //! abs(Un - Un-1) < TolU. Standard_EXPORT Extrema_LocEPCOfLocateExtPC2d(const gp_Pnt2d& P, const Adaptor2d_Curve2d& C, const Standard_Real U0, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real TolU); + //! sets the fields of the algorithm. Standard_EXPORT void Initialize (const Adaptor2d_Curve2d& C, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real TolU); + //! the algorithm is done with the point P. + //! An exception is raised if the fields have not + //! been initialized. Standard_EXPORT void Perform (const gp_Pnt2d& P, const Standard_Real U0); + //! Returns True if the distance is found. Standard_EXPORT Standard_Boolean IsDone() const; + //! Returns the value of the extremum square distance. Standard_EXPORT Standard_Real SquareDistance() const; + //! Returns True if the extremum distance is a minimum. Standard_EXPORT Standard_Boolean IsMin() const; + //! Returns the point of the extremum distance. Standard_EXPORT const Extrema_POnCurv2d& Point() const; diff --git a/src/Extrema/Extrema_LocateExtPC.hxx b/src/Extrema/Extrema_LocateExtPC.hxx index 806bc31df8..673bf1d870 100644 --- a/src/Extrema/Extrema_LocateExtPC.hxx +++ b/src/Extrema/Extrema_LocateExtPC.hxx @@ -54,20 +54,44 @@ public: Standard_EXPORT Extrema_LocateExtPC(); + //! Calculates the distance with a close point. + //! The close point is defined by the parameter value + //! U0. + //! The function F(u)=distance(P,C(u)) has an extremum + //! when g(u)=dF/du=0. The algorithm searchs a zero + //! near the close point. + //! TolF is used to decide to stop the iterations. + //! At the nth iteration, the criteria is: + //! abs(Un - Un-1) < TolF. Standard_EXPORT Extrema_LocateExtPC(const gp_Pnt& P, const Adaptor3d_Curve& C, const Standard_Real U0, const Standard_Real TolF); + //! Calculates the distance with a close point. + //! The close point is defined by the parameter value + //! U0. + //! The function F(u)=distance(P,C(u)) has an extremum + //! when g(u)=dF/du=0. The algorithm searchs a zero + //! near the close point. + //! Zeros are searched between Umin et Usup. + //! TolF is used to decide to stop the iterations. + //! At the nth iteration, the criteria is: + //! abs(Un - Un-1) < TolF. Standard_EXPORT Extrema_LocateExtPC(const gp_Pnt& P, const Adaptor3d_Curve& C, const Standard_Real U0, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real TolF); + //! sets the fields of the algorithm. Standard_EXPORT void Initialize (const Adaptor3d_Curve& C, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real TolF); Standard_EXPORT void Perform (const gp_Pnt& P, const Standard_Real U0); + //! Returns True if the distance is found. Standard_EXPORT Standard_Boolean IsDone() const; + //! Returns the value of the extremum square distance. Standard_EXPORT Standard_Real SquareDistance() const; + //! Returns True if the extremum distance is a minimum. Standard_EXPORT Standard_Boolean IsMin() const; + //! Returns the point of the extremum distance. Standard_EXPORT const Extrema_POnCurv& Point() const; diff --git a/src/Extrema/Extrema_LocateExtPC2d.hxx b/src/Extrema/Extrema_LocateExtPC2d.hxx index 39c6c62f77..73e6cd1cbb 100644 --- a/src/Extrema/Extrema_LocateExtPC2d.hxx +++ b/src/Extrema/Extrema_LocateExtPC2d.hxx @@ -54,20 +54,44 @@ public: Standard_EXPORT Extrema_LocateExtPC2d(); + //! Calculates the distance with a close point. + //! The close point is defined by the parameter value + //! U0. + //! The function F(u)=distance(P,C(u)) has an extremum + //! when g(u)=dF/du=0. The algorithm searchs a zero + //! near the close point. + //! TolF is used to decide to stop the iterations. + //! At the nth iteration, the criteria is: + //! abs(Un - Un-1) < TolF. Standard_EXPORT Extrema_LocateExtPC2d(const gp_Pnt2d& P, const Adaptor2d_Curve2d& C, const Standard_Real U0, const Standard_Real TolF); + //! Calculates the distance with a close point. + //! The close point is defined by the parameter value + //! U0. + //! The function F(u)=distance(P,C(u)) has an extremum + //! when g(u)=dF/du=0. The algorithm searchs a zero + //! near the close point. + //! Zeros are searched between Umin et Usup. + //! TolF is used to decide to stop the iterations. + //! At the nth iteration, the criteria is: + //! abs(Un - Un-1) < TolF. Standard_EXPORT Extrema_LocateExtPC2d(const gp_Pnt2d& P, const Adaptor2d_Curve2d& C, const Standard_Real U0, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real TolF); + //! sets the fields of the algorithm. Standard_EXPORT void Initialize (const Adaptor2d_Curve2d& C, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real TolF); Standard_EXPORT void Perform (const gp_Pnt2d& P, const Standard_Real U0); + //! Returns True if the distance is found. Standard_EXPORT Standard_Boolean IsDone() const; + //! Returns the value of the extremum square distance. Standard_EXPORT Standard_Real SquareDistance() const; + //! Returns True if the extremum distance is a minimum. Standard_EXPORT Standard_Boolean IsMin() const; + //! Returns the point of the extremum distance. Standard_EXPORT const Extrema_POnCurv2d& Point() const; diff --git a/src/Extrema/Extrema_PCFOfEPCOfELPCOfLocateExtPC.hxx b/src/Extrema/Extrema_PCFOfEPCOfELPCOfLocateExtPC.hxx index 2ad1f6c0cb..ae3d71ff8b 100644 --- a/src/Extrema/Extrema_PCFOfEPCOfELPCOfLocateExtPC.hxx +++ b/src/Extrema/Extrema_PCFOfEPCOfELPCOfLocateExtPC.hxx @@ -53,28 +53,41 @@ public: Standard_EXPORT Extrema_PCFOfEPCOfELPCOfLocateExtPC(const gp_Pnt& P, const Adaptor3d_Curve& C); + //! sets the field mycurve of the function. Standard_EXPORT void Initialize (const Adaptor3d_Curve& C); + //! sets the field P of the function. Standard_EXPORT void SetPoint (const gp_Pnt& P); + //! Calculation of F(U). Standard_EXPORT Standard_Boolean Value (const Standard_Real U, Standard_Real& F); + //! Calculation of F'(U). Standard_EXPORT Standard_Boolean Derivative (const Standard_Real U, Standard_Real& DF); + //! Calculation of F(U) and F'(U). Standard_EXPORT Standard_Boolean Values (const Standard_Real U, Standard_Real& F, Standard_Real& DF); + //! Save the found extremum. Standard_EXPORT virtual Standard_Integer GetStateNumber() Standard_OVERRIDE; + //! Return the nunber of found extrema. Standard_EXPORT Standard_Integer NbExt() const; + //! Returns the Nth distance. Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N) const; + //! Shows if the Nth distance is a minimum. Standard_EXPORT Standard_Boolean IsMin (const Standard_Integer N) const; + //! Returns the Nth extremum. Standard_EXPORT const Extrema_POnCurv& Point (const Standard_Integer N) const; + //! Determines boundaries of subinterval for find of root. Standard_EXPORT void SubIntervalInitialize (const Standard_Real theUfirst, const Standard_Real theUlast); + //! Computes a Tol value. If 1st derivative of curve + //! |D1| + //! Example: + //! before + //! me = (A B C) + //! after + //! me = () Standard_EXPORT void Clear(); ~Extrema_SeqPCOfPCFOfEPCOfELPCOfLocateExtPC() { Clear(); } + //! Copies the contents of the sequence Other into this sequence. + //! If this sequence is not empty, it is automatically cleared before the copy. Standard_EXPORT const Extrema_SeqPCOfPCFOfEPCOfELPCOfLocateExtPC& Assign (const Extrema_SeqPCOfPCFOfEPCOfELPCOfLocateExtPC& Other); const Extrema_SeqPCOfPCFOfEPCOfELPCOfLocateExtPC& operator = (const Extrema_SeqPCOfPCFOfEPCOfELPCOfLocateExtPC& Other) { return Assign(Other); } + //! Appends at the end of . + //! Example: + //! before + //! me = (A B C) + //! after + //! me = (A B C T) Standard_EXPORT void Append (const Extrema_POnCurv& T); + //! Concatenates at the end of . + //! is cleared. + //! Example: + //! before + //! me = (A B C) + //! S = (D E F) + //! after + //! me = (A B C D E F) + //! S = () void Append (Extrema_SeqPCOfPCFOfEPCOfELPCOfLocateExtPC& S); + //! Add at the beginning of . + //! Example: + //! before + //! me = (A B C) + //! after + //! me = (T A B C ) Standard_EXPORT void Prepend (const Extrema_POnCurv& T); + //! Concatenates at the beginning of . + //! is cleared. + //! Example: + //! before + //! me = (A B C) S = (D E F) + //! after me = (D E F A B C) + //! S = () void Prepend (Extrema_SeqPCOfPCFOfEPCOfELPCOfLocateExtPC& S); + //! Inserts in before the position . + //! Raises an exception if the index is out of bounds. + //! Example: + //! before + //! me = (A B D), Index = 3, T = C + //! after + //! me = (A B C D ) void InsertBefore (const Standard_Integer Index, const Extrema_POnCurv& T); + //! Inserts the sequence in before + //! the position . is cleared. + //! Raises an exception if the index is out of bounds + //! Example: + //! before + //! me = (A B F), Index = 3, S = (C D E) + //! after + //! me = (A B C D E F) + //! S = () void InsertBefore (const Standard_Integer Index, Extrema_SeqPCOfPCFOfEPCOfELPCOfLocateExtPC& S); + //! Inserts in after the position . + //! Raises an exception if the index is out of bound + //! Example: + //! before + //! me = (A B C), Index = 3, T = D + //! after + //! me = (A B C D) Standard_EXPORT void InsertAfter (const Standard_Integer Index, const Extrema_POnCurv& T); + //! Inserts the sequence in after the + //! position . is cleared. + //! Raises an exception if the index is out of bound. + //! Example: + //! before + //! me = (A B C), Index = 3, S = (D E F) + //! after + //! me = (A B C D E F) + //! S = () void InsertAfter (const Standard_Integer Index, Extrema_SeqPCOfPCFOfEPCOfELPCOfLocateExtPC& S); + //! Returns the first element of the sequence + //! Raises an exception if the sequence is empty. + //! Example: + //! before + //! me = (A B C) + //! after + //! me = (A B C) + //! returns A Standard_EXPORT const Extrema_POnCurv& First() const; + //! Returns the last element of the sequence + //! Raises an exception if the sequence is empty. + //! Example: + //! before + //! me = (A B C) + //! after + //! me = (A B C) + //! returns C Standard_EXPORT const Extrema_POnCurv& Last() const; + //! Keeps in the items 1 to -1 and + //! puts in the items to the end. + //! Example: + //! before + //! me = (A B C D) ,Index = 3 + //! after + //! me = (A B) + //! Sub = (C D) void Split (const Standard_Integer Index, Extrema_SeqPCOfPCFOfEPCOfELPCOfLocateExtPC& Sub); + //! Returns the Item at position in . + //! Raises an exception if the index is out of bound + //! Example: + //! before + //! me = (A B C), Index = 1 + //! after + //! me = (A B C) + //! returns + //! A Standard_EXPORT const Extrema_POnCurv& Value (const Standard_Integer Index) const; const Extrema_POnCurv& operator() (const Standard_Integer Index) const { return Value(Index); } + //! Changes the item at position + //! Raises an exception if the index is out of bound + //! Example: + //! before + //! me = (A B C), Index = 1, Item = D + //! after + //! me = (D B C) Standard_EXPORT void SetValue (const Standard_Integer Index, const Extrema_POnCurv& I); + //! Returns the Item at position in + //! . This method may be used to modify + //! : S.Value(Index) = Item. + //! Raises an exception if the index is out of bound + //! Example: + //! before + //! me = (A B C), Index = 1 + //! after + //! me = (A B C) + //! returns + //! A Standard_EXPORT Extrema_POnCurv& ChangeValue (const Standard_Integer Index); Extrema_POnCurv& operator() (const Standard_Integer Index) { return ChangeValue(Index); } + //! Removes from the item at position . + //! Raises an exception if the index is out of bounds + //! Example: + //! before + //! me = (A B C), Index = 3 + //! after + //! me = (A B) Standard_EXPORT void Remove (const Standard_Integer Index); + //! Removes from all the items of + //! positions between and . + //! Raises an exception if the indices are out of bounds. + //! Example: + //! before + //! me = (A B C D E F), FromIndex = 1 ToIndex = 3 + //! after + //! me = (D E F) Standard_EXPORT void Remove (const Standard_Integer FromIndex, const Standard_Integer ToIndex); diff --git a/src/Extrema/Extrema_SeqPCOfPCFOfEPCOfELPCOfLocateExtPC2d.hxx b/src/Extrema/Extrema_SeqPCOfPCFOfEPCOfELPCOfLocateExtPC2d.hxx index 546e2a502d..b7b205ce12 100644 --- a/src/Extrema/Extrema_SeqPCOfPCFOfEPCOfELPCOfLocateExtPC2d.hxx +++ b/src/Extrema/Extrema_SeqPCOfPCFOfEPCOfELPCOfLocateExtPC2d.hxx @@ -37,60 +37,209 @@ public: DEFINE_STANDARD_ALLOC + //! Constructs an empty sequence. + //! Use: + //! - the function Append or Prepend to add an item or + //! a collection of items at the end, or at the beginning of the sequence, + //! - the function InsertAfter or InsertBefore to add an + //! item or a collection of items at any position in the sequence, + //! - operator() or the function SetValue to assign a + //! new value to an item of the sequence, + //! - operator() to read an item of the sequence, + //! - the function Remove to remove an item at any + //! position in the sequence. + //! Warning + //! To copy a sequence, you must explicitly call the + //! assignment operator (operator=). Extrema_SeqPCOfPCFOfEPCOfELPCOfLocateExtPC2d(); + //! Creation by copy of existing Sequence. Standard_EXPORT Extrema_SeqPCOfPCFOfEPCOfELPCOfLocateExtPC2d(const Extrema_SeqPCOfPCFOfEPCOfELPCOfLocateExtPC2d& Other); + //! Removes all element(s) of the sequence + //! Example: + //! before + //! me = (A B C) + //! after + //! me = () Standard_EXPORT void Clear(); ~Extrema_SeqPCOfPCFOfEPCOfELPCOfLocateExtPC2d() { Clear(); } + //! Copies the contents of the sequence Other into this sequence. + //! If this sequence is not empty, it is automatically cleared before the copy. Standard_EXPORT const Extrema_SeqPCOfPCFOfEPCOfELPCOfLocateExtPC2d& Assign (const Extrema_SeqPCOfPCFOfEPCOfELPCOfLocateExtPC2d& Other); const Extrema_SeqPCOfPCFOfEPCOfELPCOfLocateExtPC2d& operator = (const Extrema_SeqPCOfPCFOfEPCOfELPCOfLocateExtPC2d& Other) { return Assign(Other); } + //! Appends at the end of . + //! Example: + //! before + //! me = (A B C) + //! after + //! me = (A B C T) Standard_EXPORT void Append (const Extrema_POnCurv2d& T); + //! Concatenates at the end of . + //! is cleared. + //! Example: + //! before + //! me = (A B C) + //! S = (D E F) + //! after + //! me = (A B C D E F) + //! S = () void Append (Extrema_SeqPCOfPCFOfEPCOfELPCOfLocateExtPC2d& S); + //! Add at the beginning of . + //! Example: + //! before + //! me = (A B C) + //! after + //! me = (T A B C ) Standard_EXPORT void Prepend (const Extrema_POnCurv2d& T); + //! Concatenates at the beginning of . + //! is cleared. + //! Example: + //! before + //! me = (A B C) S = (D E F) + //! after me = (D E F A B C) + //! S = () void Prepend (Extrema_SeqPCOfPCFOfEPCOfELPCOfLocateExtPC2d& S); + //! Inserts in before the position . + //! Raises an exception if the index is out of bounds. + //! Example: + //! before + //! me = (A B D), Index = 3, T = C + //! after + //! me = (A B C D ) void InsertBefore (const Standard_Integer Index, const Extrema_POnCurv2d& T); + //! Inserts the sequence in before + //! the position . is cleared. + //! Raises an exception if the index is out of bounds + //! Example: + //! before + //! me = (A B F), Index = 3, S = (C D E) + //! after + //! me = (A B C D E F) + //! S = () void InsertBefore (const Standard_Integer Index, Extrema_SeqPCOfPCFOfEPCOfELPCOfLocateExtPC2d& S); + //! Inserts in after the position . + //! Raises an exception if the index is out of bound + //! Example: + //! before + //! me = (A B C), Index = 3, T = D + //! after + //! me = (A B C D) Standard_EXPORT void InsertAfter (const Standard_Integer Index, const Extrema_POnCurv2d& T); + //! Inserts the sequence in after the + //! position . is cleared. + //! Raises an exception if the index is out of bound. + //! Example: + //! before + //! me = (A B C), Index = 3, S = (D E F) + //! after + //! me = (A B C D E F) + //! S = () void InsertAfter (const Standard_Integer Index, Extrema_SeqPCOfPCFOfEPCOfELPCOfLocateExtPC2d& S); + //! Returns the first element of the sequence + //! Raises an exception if the sequence is empty. + //! Example: + //! before + //! me = (A B C) + //! after + //! me = (A B C) + //! returns A Standard_EXPORT const Extrema_POnCurv2d& First() const; + //! Returns the last element of the sequence + //! Raises an exception if the sequence is empty. + //! Example: + //! before + //! me = (A B C) + //! after + //! me = (A B C) + //! returns C Standard_EXPORT const Extrema_POnCurv2d& Last() const; + //! Keeps in the items 1 to -1 and + //! puts in the items to the end. + //! Example: + //! before + //! me = (A B C D) ,Index = 3 + //! after + //! me = (A B) + //! Sub = (C D) void Split (const Standard_Integer Index, Extrema_SeqPCOfPCFOfEPCOfELPCOfLocateExtPC2d& Sub); + //! Returns the Item at position in . + //! Raises an exception if the index is out of bound + //! Example: + //! before + //! me = (A B C), Index = 1 + //! after + //! me = (A B C) + //! returns + //! A Standard_EXPORT const Extrema_POnCurv2d& Value (const Standard_Integer Index) const; const Extrema_POnCurv2d& operator() (const Standard_Integer Index) const { return Value(Index); } + //! Changes the item at position + //! Raises an exception if the index is out of bound + //! Example: + //! before + //! me = (A B C), Index = 1, Item = D + //! after + //! me = (D B C) Standard_EXPORT void SetValue (const Standard_Integer Index, const Extrema_POnCurv2d& I); + //! Returns the Item at position in + //! . This method may be used to modify + //! : S.Value(Index) = Item. + //! Raises an exception if the index is out of bound + //! Example: + //! before + //! me = (A B C), Index = 1 + //! after + //! me = (A B C) + //! returns + //! A Standard_EXPORT Extrema_POnCurv2d& ChangeValue (const Standard_Integer Index); Extrema_POnCurv2d& operator() (const Standard_Integer Index) { return ChangeValue(Index); } + //! Removes from the item at position . + //! Raises an exception if the index is out of bounds + //! Example: + //! before + //! me = (A B C), Index = 3 + //! after + //! me = (A B) Standard_EXPORT void Remove (const Standard_Integer Index); + //! Removes from all the items of + //! positions between and . + //! Raises an exception if the indices are out of bounds. + //! Example: + //! before + //! me = (A B C D E F), FromIndex = 1 ToIndex = 3 + //! after + //! me = (D E F) Standard_EXPORT void Remove (const Standard_Integer FromIndex, const Standard_Integer ToIndex); diff --git a/src/Extrema/Extrema_SeqPCOfPCFOfEPCOfExtPC.hxx b/src/Extrema/Extrema_SeqPCOfPCFOfEPCOfExtPC.hxx index 6feacfa98d..f777b46e7a 100644 --- a/src/Extrema/Extrema_SeqPCOfPCFOfEPCOfExtPC.hxx +++ b/src/Extrema/Extrema_SeqPCOfPCFOfEPCOfExtPC.hxx @@ -37,60 +37,209 @@ public: DEFINE_STANDARD_ALLOC + //! Constructs an empty sequence. + //! Use: + //! - the function Append or Prepend to add an item or + //! a collection of items at the end, or at the beginning of the sequence, + //! - the function InsertAfter or InsertBefore to add an + //! item or a collection of items at any position in the sequence, + //! - operator() or the function SetValue to assign a + //! new value to an item of the sequence, + //! - operator() to read an item of the sequence, + //! - the function Remove to remove an item at any + //! position in the sequence. + //! Warning + //! To copy a sequence, you must explicitly call the + //! assignment operator (operator=). Extrema_SeqPCOfPCFOfEPCOfExtPC(); + //! Creation by copy of existing Sequence. Standard_EXPORT Extrema_SeqPCOfPCFOfEPCOfExtPC(const Extrema_SeqPCOfPCFOfEPCOfExtPC& Other); + //! Removes all element(s) of the sequence + //! Example: + //! before + //! me = (A B C) + //! after + //! me = () Standard_EXPORT void Clear(); ~Extrema_SeqPCOfPCFOfEPCOfExtPC() { Clear(); } + //! Copies the contents of the sequence Other into this sequence. + //! If this sequence is not empty, it is automatically cleared before the copy. Standard_EXPORT const Extrema_SeqPCOfPCFOfEPCOfExtPC& Assign (const Extrema_SeqPCOfPCFOfEPCOfExtPC& Other); const Extrema_SeqPCOfPCFOfEPCOfExtPC& operator = (const Extrema_SeqPCOfPCFOfEPCOfExtPC& Other) { return Assign(Other); } + //! Appends at the end of . + //! Example: + //! before + //! me = (A B C) + //! after + //! me = (A B C T) Standard_EXPORT void Append (const Extrema_POnCurv& T); + //! Concatenates at the end of . + //! is cleared. + //! Example: + //! before + //! me = (A B C) + //! S = (D E F) + //! after + //! me = (A B C D E F) + //! S = () void Append (Extrema_SeqPCOfPCFOfEPCOfExtPC& S); + //! Add at the beginning of . + //! Example: + //! before + //! me = (A B C) + //! after + //! me = (T A B C ) Standard_EXPORT void Prepend (const Extrema_POnCurv& T); + //! Concatenates at the beginning of . + //! is cleared. + //! Example: + //! before + //! me = (A B C) S = (D E F) + //! after me = (D E F A B C) + //! S = () void Prepend (Extrema_SeqPCOfPCFOfEPCOfExtPC& S); + //! Inserts in before the position . + //! Raises an exception if the index is out of bounds. + //! Example: + //! before + //! me = (A B D), Index = 3, T = C + //! after + //! me = (A B C D ) void InsertBefore (const Standard_Integer Index, const Extrema_POnCurv& T); + //! Inserts the sequence in before + //! the position . is cleared. + //! Raises an exception if the index is out of bounds + //! Example: + //! before + //! me = (A B F), Index = 3, S = (C D E) + //! after + //! me = (A B C D E F) + //! S = () void InsertBefore (const Standard_Integer Index, Extrema_SeqPCOfPCFOfEPCOfExtPC& S); + //! Inserts in after the position . + //! Raises an exception if the index is out of bound + //! Example: + //! before + //! me = (A B C), Index = 3, T = D + //! after + //! me = (A B C D) Standard_EXPORT void InsertAfter (const Standard_Integer Index, const Extrema_POnCurv& T); + //! Inserts the sequence in after the + //! position . is cleared. + //! Raises an exception if the index is out of bound. + //! Example: + //! before + //! me = (A B C), Index = 3, S = (D E F) + //! after + //! me = (A B C D E F) + //! S = () void InsertAfter (const Standard_Integer Index, Extrema_SeqPCOfPCFOfEPCOfExtPC& S); + //! Returns the first element of the sequence + //! Raises an exception if the sequence is empty. + //! Example: + //! before + //! me = (A B C) + //! after + //! me = (A B C) + //! returns A Standard_EXPORT const Extrema_POnCurv& First() const; + //! Returns the last element of the sequence + //! Raises an exception if the sequence is empty. + //! Example: + //! before + //! me = (A B C) + //! after + //! me = (A B C) + //! returns C Standard_EXPORT const Extrema_POnCurv& Last() const; + //! Keeps in the items 1 to -1 and + //! puts in the items to the end. + //! Example: + //! before + //! me = (A B C D) ,Index = 3 + //! after + //! me = (A B) + //! Sub = (C D) void Split (const Standard_Integer Index, Extrema_SeqPCOfPCFOfEPCOfExtPC& Sub); + //! Returns the Item at position in . + //! Raises an exception if the index is out of bound + //! Example: + //! before + //! me = (A B C), Index = 1 + //! after + //! me = (A B C) + //! returns + //! A Standard_EXPORT const Extrema_POnCurv& Value (const Standard_Integer Index) const; const Extrema_POnCurv& operator() (const Standard_Integer Index) const { return Value(Index); } + //! Changes the item at position + //! Raises an exception if the index is out of bound + //! Example: + //! before + //! me = (A B C), Index = 1, Item = D + //! after + //! me = (D B C) Standard_EXPORT void SetValue (const Standard_Integer Index, const Extrema_POnCurv& I); + //! Returns the Item at position in + //! . This method may be used to modify + //! : S.Value(Index) = Item. + //! Raises an exception if the index is out of bound + //! Example: + //! before + //! me = (A B C), Index = 1 + //! after + //! me = (A B C) + //! returns + //! A Standard_EXPORT Extrema_POnCurv& ChangeValue (const Standard_Integer Index); Extrema_POnCurv& operator() (const Standard_Integer Index) { return ChangeValue(Index); } + //! Removes from the item at position . + //! Raises an exception if the index is out of bounds + //! Example: + //! before + //! me = (A B C), Index = 3 + //! after + //! me = (A B) Standard_EXPORT void Remove (const Standard_Integer Index); + //! Removes from all the items of + //! positions between and . + //! Raises an exception if the indices are out of bounds. + //! Example: + //! before + //! me = (A B C D E F), FromIndex = 1 ToIndex = 3 + //! after + //! me = (D E F) Standard_EXPORT void Remove (const Standard_Integer FromIndex, const Standard_Integer ToIndex); diff --git a/src/Extrema/Extrema_SeqPCOfPCFOfEPCOfExtPC2d.hxx b/src/Extrema/Extrema_SeqPCOfPCFOfEPCOfExtPC2d.hxx index 6c6708c0f1..7cf5e77603 100644 --- a/src/Extrema/Extrema_SeqPCOfPCFOfEPCOfExtPC2d.hxx +++ b/src/Extrema/Extrema_SeqPCOfPCFOfEPCOfExtPC2d.hxx @@ -37,60 +37,209 @@ public: DEFINE_STANDARD_ALLOC + //! Constructs an empty sequence. + //! Use: + //! - the function Append or Prepend to add an item or + //! a collection of items at the end, or at the beginning of the sequence, + //! - the function InsertAfter or InsertBefore to add an + //! item or a collection of items at any position in the sequence, + //! - operator() or the function SetValue to assign a + //! new value to an item of the sequence, + //! - operator() to read an item of the sequence, + //! - the function Remove to remove an item at any + //! position in the sequence. + //! Warning + //! To copy a sequence, you must explicitly call the + //! assignment operator (operator=). Extrema_SeqPCOfPCFOfEPCOfExtPC2d(); + //! Creation by copy of existing Sequence. Standard_EXPORT Extrema_SeqPCOfPCFOfEPCOfExtPC2d(const Extrema_SeqPCOfPCFOfEPCOfExtPC2d& Other); + //! Removes all element(s) of the sequence + //! Example: + //! before + //! me = (A B C) + //! after + //! me = () Standard_EXPORT void Clear(); ~Extrema_SeqPCOfPCFOfEPCOfExtPC2d() { Clear(); } + //! Copies the contents of the sequence Other into this sequence. + //! If this sequence is not empty, it is automatically cleared before the copy. Standard_EXPORT const Extrema_SeqPCOfPCFOfEPCOfExtPC2d& Assign (const Extrema_SeqPCOfPCFOfEPCOfExtPC2d& Other); const Extrema_SeqPCOfPCFOfEPCOfExtPC2d& operator = (const Extrema_SeqPCOfPCFOfEPCOfExtPC2d& Other) { return Assign(Other); } + //! Appends at the end of . + //! Example: + //! before + //! me = (A B C) + //! after + //! me = (A B C T) Standard_EXPORT void Append (const Extrema_POnCurv2d& T); + //! Concatenates at the end of . + //! is cleared. + //! Example: + //! before + //! me = (A B C) + //! S = (D E F) + //! after + //! me = (A B C D E F) + //! S = () void Append (Extrema_SeqPCOfPCFOfEPCOfExtPC2d& S); + //! Add at the beginning of . + //! Example: + //! before + //! me = (A B C) + //! after + //! me = (T A B C ) Standard_EXPORT void Prepend (const Extrema_POnCurv2d& T); + //! Concatenates at the beginning of . + //! is cleared. + //! Example: + //! before + //! me = (A B C) S = (D E F) + //! after me = (D E F A B C) + //! S = () void Prepend (Extrema_SeqPCOfPCFOfEPCOfExtPC2d& S); + //! Inserts in before the position . + //! Raises an exception if the index is out of bounds. + //! Example: + //! before + //! me = (A B D), Index = 3, T = C + //! after + //! me = (A B C D ) void InsertBefore (const Standard_Integer Index, const Extrema_POnCurv2d& T); + //! Inserts the sequence in before + //! the position . is cleared. + //! Raises an exception if the index is out of bounds + //! Example: + //! before + //! me = (A B F), Index = 3, S = (C D E) + //! after + //! me = (A B C D E F) + //! S = () void InsertBefore (const Standard_Integer Index, Extrema_SeqPCOfPCFOfEPCOfExtPC2d& S); + //! Inserts in after the position . + //! Raises an exception if the index is out of bound + //! Example: + //! before + //! me = (A B C), Index = 3, T = D + //! after + //! me = (A B C D) Standard_EXPORT void InsertAfter (const Standard_Integer Index, const Extrema_POnCurv2d& T); + //! Inserts the sequence in after the + //! position . is cleared. + //! Raises an exception if the index is out of bound. + //! Example: + //! before + //! me = (A B C), Index = 3, S = (D E F) + //! after + //! me = (A B C D E F) + //! S = () void InsertAfter (const Standard_Integer Index, Extrema_SeqPCOfPCFOfEPCOfExtPC2d& S); + //! Returns the first element of the sequence + //! Raises an exception if the sequence is empty. + //! Example: + //! before + //! me = (A B C) + //! after + //! me = (A B C) + //! returns A Standard_EXPORT const Extrema_POnCurv2d& First() const; + //! Returns the last element of the sequence + //! Raises an exception if the sequence is empty. + //! Example: + //! before + //! me = (A B C) + //! after + //! me = (A B C) + //! returns C Standard_EXPORT const Extrema_POnCurv2d& Last() const; + //! Keeps in the items 1 to -1 and + //! puts in the items to the end. + //! Example: + //! before + //! me = (A B C D) ,Index = 3 + //! after + //! me = (A B) + //! Sub = (C D) void Split (const Standard_Integer Index, Extrema_SeqPCOfPCFOfEPCOfExtPC2d& Sub); + //! Returns the Item at position in . + //! Raises an exception if the index is out of bound + //! Example: + //! before + //! me = (A B C), Index = 1 + //! after + //! me = (A B C) + //! returns + //! A Standard_EXPORT const Extrema_POnCurv2d& Value (const Standard_Integer Index) const; const Extrema_POnCurv2d& operator() (const Standard_Integer Index) const { return Value(Index); } + //! Changes the item at position + //! Raises an exception if the index is out of bound + //! Example: + //! before + //! me = (A B C), Index = 1, Item = D + //! after + //! me = (D B C) Standard_EXPORT void SetValue (const Standard_Integer Index, const Extrema_POnCurv2d& I); + //! Returns the Item at position in + //! . This method may be used to modify + //! : S.Value(Index) = Item. + //! Raises an exception if the index is out of bound + //! Example: + //! before + //! me = (A B C), Index = 1 + //! after + //! me = (A B C) + //! returns + //! A Standard_EXPORT Extrema_POnCurv2d& ChangeValue (const Standard_Integer Index); Extrema_POnCurv2d& operator() (const Standard_Integer Index) { return ChangeValue(Index); } + //! Removes from the item at position . + //! Raises an exception if the index is out of bounds + //! Example: + //! before + //! me = (A B C), Index = 3 + //! after + //! me = (A B) Standard_EXPORT void Remove (const Standard_Integer Index); + //! Removes from all the items of + //! positions between and . + //! Raises an exception if the indices are out of bounds. + //! Example: + //! before + //! me = (A B C D E F), FromIndex = 1 ToIndex = 3 + //! after + //! me = (D E F) Standard_EXPORT void Remove (const Standard_Integer FromIndex, const Standard_Integer ToIndex); diff --git a/src/Extrema/Extrema_SeqPCOfPCLocFOfLocEPCOfLocateExtPC.hxx b/src/Extrema/Extrema_SeqPCOfPCLocFOfLocEPCOfLocateExtPC.hxx index 7bf501fac4..347bae2ee4 100644 --- a/src/Extrema/Extrema_SeqPCOfPCLocFOfLocEPCOfLocateExtPC.hxx +++ b/src/Extrema/Extrema_SeqPCOfPCLocFOfLocEPCOfLocateExtPC.hxx @@ -37,60 +37,209 @@ public: DEFINE_STANDARD_ALLOC + //! Constructs an empty sequence. + //! Use: + //! - the function Append or Prepend to add an item or + //! a collection of items at the end, or at the beginning of the sequence, + //! - the function InsertAfter or InsertBefore to add an + //! item or a collection of items at any position in the sequence, + //! - operator() or the function SetValue to assign a + //! new value to an item of the sequence, + //! - operator() to read an item of the sequence, + //! - the function Remove to remove an item at any + //! position in the sequence. + //! Warning + //! To copy a sequence, you must explicitly call the + //! assignment operator (operator=). Extrema_SeqPCOfPCLocFOfLocEPCOfLocateExtPC(); + //! Creation by copy of existing Sequence. Standard_EXPORT Extrema_SeqPCOfPCLocFOfLocEPCOfLocateExtPC(const Extrema_SeqPCOfPCLocFOfLocEPCOfLocateExtPC& Other); + //! Removes all element(s) of the sequence + //! Example: + //! before + //! me = (A B C) + //! after + //! me = () Standard_EXPORT void Clear(); ~Extrema_SeqPCOfPCLocFOfLocEPCOfLocateExtPC() { Clear(); } + //! Copies the contents of the sequence Other into this sequence. + //! If this sequence is not empty, it is automatically cleared before the copy. Standard_EXPORT const Extrema_SeqPCOfPCLocFOfLocEPCOfLocateExtPC& Assign (const Extrema_SeqPCOfPCLocFOfLocEPCOfLocateExtPC& Other); const Extrema_SeqPCOfPCLocFOfLocEPCOfLocateExtPC& operator = (const Extrema_SeqPCOfPCLocFOfLocEPCOfLocateExtPC& Other) { return Assign(Other); } + //! Appends at the end of . + //! Example: + //! before + //! me = (A B C) + //! after + //! me = (A B C T) Standard_EXPORT void Append (const Extrema_POnCurv& T); + //! Concatenates at the end of . + //! is cleared. + //! Example: + //! before + //! me = (A B C) + //! S = (D E F) + //! after + //! me = (A B C D E F) + //! S = () void Append (Extrema_SeqPCOfPCLocFOfLocEPCOfLocateExtPC& S); + //! Add at the beginning of . + //! Example: + //! before + //! me = (A B C) + //! after + //! me = (T A B C ) Standard_EXPORT void Prepend (const Extrema_POnCurv& T); + //! Concatenates at the beginning of . + //! is cleared. + //! Example: + //! before + //! me = (A B C) S = (D E F) + //! after me = (D E F A B C) + //! S = () void Prepend (Extrema_SeqPCOfPCLocFOfLocEPCOfLocateExtPC& S); + //! Inserts in before the position . + //! Raises an exception if the index is out of bounds. + //! Example: + //! before + //! me = (A B D), Index = 3, T = C + //! after + //! me = (A B C D ) void InsertBefore (const Standard_Integer Index, const Extrema_POnCurv& T); + //! Inserts the sequence in before + //! the position . is cleared. + //! Raises an exception if the index is out of bounds + //! Example: + //! before + //! me = (A B F), Index = 3, S = (C D E) + //! after + //! me = (A B C D E F) + //! S = () void InsertBefore (const Standard_Integer Index, Extrema_SeqPCOfPCLocFOfLocEPCOfLocateExtPC& S); + //! Inserts in after the position . + //! Raises an exception if the index is out of bound + //! Example: + //! before + //! me = (A B C), Index = 3, T = D + //! after + //! me = (A B C D) Standard_EXPORT void InsertAfter (const Standard_Integer Index, const Extrema_POnCurv& T); + //! Inserts the sequence in after the + //! position . is cleared. + //! Raises an exception if the index is out of bound. + //! Example: + //! before + //! me = (A B C), Index = 3, S = (D E F) + //! after + //! me = (A B C D E F) + //! S = () void InsertAfter (const Standard_Integer Index, Extrema_SeqPCOfPCLocFOfLocEPCOfLocateExtPC& S); + //! Returns the first element of the sequence + //! Raises an exception if the sequence is empty. + //! Example: + //! before + //! me = (A B C) + //! after + //! me = (A B C) + //! returns A Standard_EXPORT const Extrema_POnCurv& First() const; + //! Returns the last element of the sequence + //! Raises an exception if the sequence is empty. + //! Example: + //! before + //! me = (A B C) + //! after + //! me = (A B C) + //! returns C Standard_EXPORT const Extrema_POnCurv& Last() const; + //! Keeps in the items 1 to -1 and + //! puts in the items to the end. + //! Example: + //! before + //! me = (A B C D) ,Index = 3 + //! after + //! me = (A B) + //! Sub = (C D) void Split (const Standard_Integer Index, Extrema_SeqPCOfPCLocFOfLocEPCOfLocateExtPC& Sub); + //! Returns the Item at position in . + //! Raises an exception if the index is out of bound + //! Example: + //! before + //! me = (A B C), Index = 1 + //! after + //! me = (A B C) + //! returns + //! A Standard_EXPORT const Extrema_POnCurv& Value (const Standard_Integer Index) const; const Extrema_POnCurv& operator() (const Standard_Integer Index) const { return Value(Index); } + //! Changes the item at position + //! Raises an exception if the index is out of bound + //! Example: + //! before + //! me = (A B C), Index = 1, Item = D + //! after + //! me = (D B C) Standard_EXPORT void SetValue (const Standard_Integer Index, const Extrema_POnCurv& I); + //! Returns the Item at position in + //! . This method may be used to modify + //! : S.Value(Index) = Item. + //! Raises an exception if the index is out of bound + //! Example: + //! before + //! me = (A B C), Index = 1 + //! after + //! me = (A B C) + //! returns + //! A Standard_EXPORT Extrema_POnCurv& ChangeValue (const Standard_Integer Index); Extrema_POnCurv& operator() (const Standard_Integer Index) { return ChangeValue(Index); } + //! Removes from the item at position . + //! Raises an exception if the index is out of bounds + //! Example: + //! before + //! me = (A B C), Index = 3 + //! after + //! me = (A B) Standard_EXPORT void Remove (const Standard_Integer Index); + //! Removes from all the items of + //! positions between and . + //! Raises an exception if the indices are out of bounds. + //! Example: + //! before + //! me = (A B C D E F), FromIndex = 1 ToIndex = 3 + //! after + //! me = (D E F) Standard_EXPORT void Remove (const Standard_Integer FromIndex, const Standard_Integer ToIndex); diff --git a/src/Extrema/Extrema_SeqPCOfPCLocFOfLocEPCOfLocateExtPC2d.hxx b/src/Extrema/Extrema_SeqPCOfPCLocFOfLocEPCOfLocateExtPC2d.hxx index 2edc4788b0..60d0d04103 100644 --- a/src/Extrema/Extrema_SeqPCOfPCLocFOfLocEPCOfLocateExtPC2d.hxx +++ b/src/Extrema/Extrema_SeqPCOfPCLocFOfLocEPCOfLocateExtPC2d.hxx @@ -37,60 +37,209 @@ public: DEFINE_STANDARD_ALLOC + //! Constructs an empty sequence. + //! Use: + //! - the function Append or Prepend to add an item or + //! a collection of items at the end, or at the beginning of the sequence, + //! - the function InsertAfter or InsertBefore to add an + //! item or a collection of items at any position in the sequence, + //! - operator() or the function SetValue to assign a + //! new value to an item of the sequence, + //! - operator() to read an item of the sequence, + //! - the function Remove to remove an item at any + //! position in the sequence. + //! Warning + //! To copy a sequence, you must explicitly call the + //! assignment operator (operator=). Extrema_SeqPCOfPCLocFOfLocEPCOfLocateExtPC2d(); + //! Creation by copy of existing Sequence. Standard_EXPORT Extrema_SeqPCOfPCLocFOfLocEPCOfLocateExtPC2d(const Extrema_SeqPCOfPCLocFOfLocEPCOfLocateExtPC2d& Other); + //! Removes all element(s) of the sequence + //! Example: + //! before + //! me = (A B C) + //! after + //! me = () Standard_EXPORT void Clear(); ~Extrema_SeqPCOfPCLocFOfLocEPCOfLocateExtPC2d() { Clear(); } + //! Copies the contents of the sequence Other into this sequence. + //! If this sequence is not empty, it is automatically cleared before the copy. Standard_EXPORT const Extrema_SeqPCOfPCLocFOfLocEPCOfLocateExtPC2d& Assign (const Extrema_SeqPCOfPCLocFOfLocEPCOfLocateExtPC2d& Other); const Extrema_SeqPCOfPCLocFOfLocEPCOfLocateExtPC2d& operator = (const Extrema_SeqPCOfPCLocFOfLocEPCOfLocateExtPC2d& Other) { return Assign(Other); } + //! Appends at the end of . + //! Example: + //! before + //! me = (A B C) + //! after + //! me = (A B C T) Standard_EXPORT void Append (const Extrema_POnCurv2d& T); + //! Concatenates at the end of . + //! is cleared. + //! Example: + //! before + //! me = (A B C) + //! S = (D E F) + //! after + //! me = (A B C D E F) + //! S = () void Append (Extrema_SeqPCOfPCLocFOfLocEPCOfLocateExtPC2d& S); + //! Add at the beginning of . + //! Example: + //! before + //! me = (A B C) + //! after + //! me = (T A B C ) Standard_EXPORT void Prepend (const Extrema_POnCurv2d& T); + //! Concatenates at the beginning of . + //! is cleared. + //! Example: + //! before + //! me = (A B C) S = (D E F) + //! after me = (D E F A B C) + //! S = () void Prepend (Extrema_SeqPCOfPCLocFOfLocEPCOfLocateExtPC2d& S); + //! Inserts in before the position . + //! Raises an exception if the index is out of bounds. + //! Example: + //! before + //! me = (A B D), Index = 3, T = C + //! after + //! me = (A B C D ) void InsertBefore (const Standard_Integer Index, const Extrema_POnCurv2d& T); + //! Inserts the sequence in before + //! the position . is cleared. + //! Raises an exception if the index is out of bounds + //! Example: + //! before + //! me = (A B F), Index = 3, S = (C D E) + //! after + //! me = (A B C D E F) + //! S = () void InsertBefore (const Standard_Integer Index, Extrema_SeqPCOfPCLocFOfLocEPCOfLocateExtPC2d& S); + //! Inserts in after the position . + //! Raises an exception if the index is out of bound + //! Example: + //! before + //! me = (A B C), Index = 3, T = D + //! after + //! me = (A B C D) Standard_EXPORT void InsertAfter (const Standard_Integer Index, const Extrema_POnCurv2d& T); + //! Inserts the sequence in after the + //! position . is cleared. + //! Raises an exception if the index is out of bound. + //! Example: + //! before + //! me = (A B C), Index = 3, S = (D E F) + //! after + //! me = (A B C D E F) + //! S = () void InsertAfter (const Standard_Integer Index, Extrema_SeqPCOfPCLocFOfLocEPCOfLocateExtPC2d& S); + //! Returns the first element of the sequence + //! Raises an exception if the sequence is empty. + //! Example: + //! before + //! me = (A B C) + //! after + //! me = (A B C) + //! returns A Standard_EXPORT const Extrema_POnCurv2d& First() const; + //! Returns the last element of the sequence + //! Raises an exception if the sequence is empty. + //! Example: + //! before + //! me = (A B C) + //! after + //! me = (A B C) + //! returns C Standard_EXPORT const Extrema_POnCurv2d& Last() const; + //! Keeps in the items 1 to -1 and + //! puts in the items to the end. + //! Example: + //! before + //! me = (A B C D) ,Index = 3 + //! after + //! me = (A B) + //! Sub = (C D) void Split (const Standard_Integer Index, Extrema_SeqPCOfPCLocFOfLocEPCOfLocateExtPC2d& Sub); + //! Returns the Item at position in . + //! Raises an exception if the index is out of bound + //! Example: + //! before + //! me = (A B C), Index = 1 + //! after + //! me = (A B C) + //! returns + //! A Standard_EXPORT const Extrema_POnCurv2d& Value (const Standard_Integer Index) const; const Extrema_POnCurv2d& operator() (const Standard_Integer Index) const { return Value(Index); } + //! Changes the item at position + //! Raises an exception if the index is out of bound + //! Example: + //! before + //! me = (A B C), Index = 1, Item = D + //! after + //! me = (D B C) Standard_EXPORT void SetValue (const Standard_Integer Index, const Extrema_POnCurv2d& I); + //! Returns the Item at position in + //! . This method may be used to modify + //! : S.Value(Index) = Item. + //! Raises an exception if the index is out of bound + //! Example: + //! before + //! me = (A B C), Index = 1 + //! after + //! me = (A B C) + //! returns + //! A Standard_EXPORT Extrema_POnCurv2d& ChangeValue (const Standard_Integer Index); Extrema_POnCurv2d& operator() (const Standard_Integer Index) { return ChangeValue(Index); } + //! Removes from the item at position . + //! Raises an exception if the index is out of bounds + //! Example: + //! before + //! me = (A B C), Index = 3 + //! after + //! me = (A B) Standard_EXPORT void Remove (const Standard_Integer Index); + //! Removes from all the items of + //! positions between and . + //! Raises an exception if the indices are out of bounds. + //! Example: + //! before + //! me = (A B C D E F), FromIndex = 1 ToIndex = 3 + //! after + //! me = (D E F) Standard_EXPORT void Remove (const Standard_Integer FromIndex, const Standard_Integer ToIndex); diff --git a/src/Extrema/Extrema_SeqPOnCOfCCLocFOfLocECC.hxx b/src/Extrema/Extrema_SeqPOnCOfCCLocFOfLocECC.hxx index dbf3fa1321..d117ea9c59 100644 --- a/src/Extrema/Extrema_SeqPOnCOfCCLocFOfLocECC.hxx +++ b/src/Extrema/Extrema_SeqPOnCOfCCLocFOfLocECC.hxx @@ -37,60 +37,209 @@ public: DEFINE_STANDARD_ALLOC + //! Constructs an empty sequence. + //! Use: + //! - the function Append or Prepend to add an item or + //! a collection of items at the end, or at the beginning of the sequence, + //! - the function InsertAfter or InsertBefore to add an + //! item or a collection of items at any position in the sequence, + //! - operator() or the function SetValue to assign a + //! new value to an item of the sequence, + //! - operator() to read an item of the sequence, + //! - the function Remove to remove an item at any + //! position in the sequence. + //! Warning + //! To copy a sequence, you must explicitly call the + //! assignment operator (operator=). Extrema_SeqPOnCOfCCLocFOfLocECC(); + //! Creation by copy of existing Sequence. Standard_EXPORT Extrema_SeqPOnCOfCCLocFOfLocECC(const Extrema_SeqPOnCOfCCLocFOfLocECC& Other); + //! Removes all element(s) of the sequence + //! Example: + //! before + //! me = (A B C) + //! after + //! me = () Standard_EXPORT void Clear(); ~Extrema_SeqPOnCOfCCLocFOfLocECC() { Clear(); } + //! Copies the contents of the sequence Other into this sequence. + //! If this sequence is not empty, it is automatically cleared before the copy. Standard_EXPORT const Extrema_SeqPOnCOfCCLocFOfLocECC& Assign (const Extrema_SeqPOnCOfCCLocFOfLocECC& Other); const Extrema_SeqPOnCOfCCLocFOfLocECC& operator = (const Extrema_SeqPOnCOfCCLocFOfLocECC& Other) { return Assign(Other); } + //! Appends at the end of . + //! Example: + //! before + //! me = (A B C) + //! after + //! me = (A B C T) Standard_EXPORT void Append (const Extrema_POnCurv& T); + //! Concatenates at the end of . + //! is cleared. + //! Example: + //! before + //! me = (A B C) + //! S = (D E F) + //! after + //! me = (A B C D E F) + //! S = () void Append (Extrema_SeqPOnCOfCCLocFOfLocECC& S); + //! Add at the beginning of . + //! Example: + //! before + //! me = (A B C) + //! after + //! me = (T A B C ) Standard_EXPORT void Prepend (const Extrema_POnCurv& T); + //! Concatenates at the beginning of . + //! is cleared. + //! Example: + //! before + //! me = (A B C) S = (D E F) + //! after me = (D E F A B C) + //! S = () void Prepend (Extrema_SeqPOnCOfCCLocFOfLocECC& S); + //! Inserts in before the position . + //! Raises an exception if the index is out of bounds. + //! Example: + //! before + //! me = (A B D), Index = 3, T = C + //! after + //! me = (A B C D ) void InsertBefore (const Standard_Integer Index, const Extrema_POnCurv& T); + //! Inserts the sequence in before + //! the position . is cleared. + //! Raises an exception if the index is out of bounds + //! Example: + //! before + //! me = (A B F), Index = 3, S = (C D E) + //! after + //! me = (A B C D E F) + //! S = () void InsertBefore (const Standard_Integer Index, Extrema_SeqPOnCOfCCLocFOfLocECC& S); + //! Inserts in after the position . + //! Raises an exception if the index is out of bound + //! Example: + //! before + //! me = (A B C), Index = 3, T = D + //! after + //! me = (A B C D) Standard_EXPORT void InsertAfter (const Standard_Integer Index, const Extrema_POnCurv& T); + //! Inserts the sequence in after the + //! position . is cleared. + //! Raises an exception if the index is out of bound. + //! Example: + //! before + //! me = (A B C), Index = 3, S = (D E F) + //! after + //! me = (A B C D E F) + //! S = () void InsertAfter (const Standard_Integer Index, Extrema_SeqPOnCOfCCLocFOfLocECC& S); + //! Returns the first element of the sequence + //! Raises an exception if the sequence is empty. + //! Example: + //! before + //! me = (A B C) + //! after + //! me = (A B C) + //! returns A Standard_EXPORT const Extrema_POnCurv& First() const; + //! Returns the last element of the sequence + //! Raises an exception if the sequence is empty. + //! Example: + //! before + //! me = (A B C) + //! after + //! me = (A B C) + //! returns C Standard_EXPORT const Extrema_POnCurv& Last() const; + //! Keeps in the items 1 to -1 and + //! puts in the items to the end. + //! Example: + //! before + //! me = (A B C D) ,Index = 3 + //! after + //! me = (A B) + //! Sub = (C D) void Split (const Standard_Integer Index, Extrema_SeqPOnCOfCCLocFOfLocECC& Sub); + //! Returns the Item at position in . + //! Raises an exception if the index is out of bound + //! Example: + //! before + //! me = (A B C), Index = 1 + //! after + //! me = (A B C) + //! returns + //! A Standard_EXPORT const Extrema_POnCurv& Value (const Standard_Integer Index) const; const Extrema_POnCurv& operator() (const Standard_Integer Index) const { return Value(Index); } + //! Changes the item at position + //! Raises an exception if the index is out of bound + //! Example: + //! before + //! me = (A B C), Index = 1, Item = D + //! after + //! me = (D B C) Standard_EXPORT void SetValue (const Standard_Integer Index, const Extrema_POnCurv& I); + //! Returns the Item at position in + //! . This method may be used to modify + //! : S.Value(Index) = Item. + //! Raises an exception if the index is out of bound + //! Example: + //! before + //! me = (A B C), Index = 1 + //! after + //! me = (A B C) + //! returns + //! A Standard_EXPORT Extrema_POnCurv& ChangeValue (const Standard_Integer Index); Extrema_POnCurv& operator() (const Standard_Integer Index) { return ChangeValue(Index); } + //! Removes from the item at position . + //! Raises an exception if the index is out of bounds + //! Example: + //! before + //! me = (A B C), Index = 3 + //! after + //! me = (A B) Standard_EXPORT void Remove (const Standard_Integer Index); + //! Removes from all the items of + //! positions between and . + //! Raises an exception if the indices are out of bounds. + //! Example: + //! before + //! me = (A B C D E F), FromIndex = 1 ToIndex = 3 + //! after + //! me = (D E F) Standard_EXPORT void Remove (const Standard_Integer FromIndex, const Standard_Integer ToIndex); diff --git a/src/Extrema/Extrema_SeqPOnCOfCCLocFOfLocECC2d.hxx b/src/Extrema/Extrema_SeqPOnCOfCCLocFOfLocECC2d.hxx index 52652a0c1c..ace2231d15 100644 --- a/src/Extrema/Extrema_SeqPOnCOfCCLocFOfLocECC2d.hxx +++ b/src/Extrema/Extrema_SeqPOnCOfCCLocFOfLocECC2d.hxx @@ -37,60 +37,209 @@ public: DEFINE_STANDARD_ALLOC + //! Constructs an empty sequence. + //! Use: + //! - the function Append or Prepend to add an item or + //! a collection of items at the end, or at the beginning of the sequence, + //! - the function InsertAfter or InsertBefore to add an + //! item or a collection of items at any position in the sequence, + //! - operator() or the function SetValue to assign a + //! new value to an item of the sequence, + //! - operator() to read an item of the sequence, + //! - the function Remove to remove an item at any + //! position in the sequence. + //! Warning + //! To copy a sequence, you must explicitly call the + //! assignment operator (operator=). Extrema_SeqPOnCOfCCLocFOfLocECC2d(); + //! Creation by copy of existing Sequence. Standard_EXPORT Extrema_SeqPOnCOfCCLocFOfLocECC2d(const Extrema_SeqPOnCOfCCLocFOfLocECC2d& Other); + //! Removes all element(s) of the sequence + //! Example: + //! before + //! me = (A B C) + //! after + //! me = () Standard_EXPORT void Clear(); ~Extrema_SeqPOnCOfCCLocFOfLocECC2d() { Clear(); } + //! Copies the contents of the sequence Other into this sequence. + //! If this sequence is not empty, it is automatically cleared before the copy. Standard_EXPORT const Extrema_SeqPOnCOfCCLocFOfLocECC2d& Assign (const Extrema_SeqPOnCOfCCLocFOfLocECC2d& Other); const Extrema_SeqPOnCOfCCLocFOfLocECC2d& operator = (const Extrema_SeqPOnCOfCCLocFOfLocECC2d& Other) { return Assign(Other); } + //! Appends at the end of . + //! Example: + //! before + //! me = (A B C) + //! after + //! me = (A B C T) Standard_EXPORT void Append (const Extrema_POnCurv2d& T); + //! Concatenates at the end of . + //! is cleared. + //! Example: + //! before + //! me = (A B C) + //! S = (D E F) + //! after + //! me = (A B C D E F) + //! S = () void Append (Extrema_SeqPOnCOfCCLocFOfLocECC2d& S); + //! Add at the beginning of . + //! Example: + //! before + //! me = (A B C) + //! after + //! me = (T A B C ) Standard_EXPORT void Prepend (const Extrema_POnCurv2d& T); + //! Concatenates at the beginning of . + //! is cleared. + //! Example: + //! before + //! me = (A B C) S = (D E F) + //! after me = (D E F A B C) + //! S = () void Prepend (Extrema_SeqPOnCOfCCLocFOfLocECC2d& S); + //! Inserts in before the position . + //! Raises an exception if the index is out of bounds. + //! Example: + //! before + //! me = (A B D), Index = 3, T = C + //! after + //! me = (A B C D ) void InsertBefore (const Standard_Integer Index, const Extrema_POnCurv2d& T); + //! Inserts the sequence in before + //! the position . is cleared. + //! Raises an exception if the index is out of bounds + //! Example: + //! before + //! me = (A B F), Index = 3, S = (C D E) + //! after + //! me = (A B C D E F) + //! S = () void InsertBefore (const Standard_Integer Index, Extrema_SeqPOnCOfCCLocFOfLocECC2d& S); + //! Inserts in after the position . + //! Raises an exception if the index is out of bound + //! Example: + //! before + //! me = (A B C), Index = 3, T = D + //! after + //! me = (A B C D) Standard_EXPORT void InsertAfter (const Standard_Integer Index, const Extrema_POnCurv2d& T); + //! Inserts the sequence in after the + //! position . is cleared. + //! Raises an exception if the index is out of bound. + //! Example: + //! before + //! me = (A B C), Index = 3, S = (D E F) + //! after + //! me = (A B C D E F) + //! S = () void InsertAfter (const Standard_Integer Index, Extrema_SeqPOnCOfCCLocFOfLocECC2d& S); + //! Returns the first element of the sequence + //! Raises an exception if the sequence is empty. + //! Example: + //! before + //! me = (A B C) + //! after + //! me = (A B C) + //! returns A Standard_EXPORT const Extrema_POnCurv2d& First() const; + //! Returns the last element of the sequence + //! Raises an exception if the sequence is empty. + //! Example: + //! before + //! me = (A B C) + //! after + //! me = (A B C) + //! returns C Standard_EXPORT const Extrema_POnCurv2d& Last() const; + //! Keeps in the items 1 to -1 and + //! puts in the items to the end. + //! Example: + //! before + //! me = (A B C D) ,Index = 3 + //! after + //! me = (A B) + //! Sub = (C D) void Split (const Standard_Integer Index, Extrema_SeqPOnCOfCCLocFOfLocECC2d& Sub); + //! Returns the Item at position in . + //! Raises an exception if the index is out of bound + //! Example: + //! before + //! me = (A B C), Index = 1 + //! after + //! me = (A B C) + //! returns + //! A Standard_EXPORT const Extrema_POnCurv2d& Value (const Standard_Integer Index) const; const Extrema_POnCurv2d& operator() (const Standard_Integer Index) const { return Value(Index); } + //! Changes the item at position + //! Raises an exception if the index is out of bound + //! Example: + //! before + //! me = (A B C), Index = 1, Item = D + //! after + //! me = (D B C) Standard_EXPORT void SetValue (const Standard_Integer Index, const Extrema_POnCurv2d& I); + //! Returns the Item at position in + //! . This method may be used to modify + //! : S.Value(Index) = Item. + //! Raises an exception if the index is out of bound + //! Example: + //! before + //! me = (A B C), Index = 1 + //! after + //! me = (A B C) + //! returns + //! A Standard_EXPORT Extrema_POnCurv2d& ChangeValue (const Standard_Integer Index); Extrema_POnCurv2d& operator() (const Standard_Integer Index) { return ChangeValue(Index); } + //! Removes from the item at position . + //! Raises an exception if the index is out of bounds + //! Example: + //! before + //! me = (A B C), Index = 3 + //! after + //! me = (A B) Standard_EXPORT void Remove (const Standard_Integer Index); + //! Removes from all the items of + //! positions between and . + //! Raises an exception if the indices are out of bounds. + //! Example: + //! before + //! me = (A B C D E F), FromIndex = 1 ToIndex = 3 + //! after + //! me = (D E F) Standard_EXPORT void Remove (const Standard_Integer FromIndex, const Standard_Integer ToIndex); diff --git a/src/Geom2dAdaptor/Geom2dAdaptor_GHCurve.hxx b/src/Geom2dAdaptor/Geom2dAdaptor_GHCurve.hxx index e45dabec01..c073388d5f 100644 --- a/src/Geom2dAdaptor/Geom2dAdaptor_GHCurve.hxx +++ b/src/Geom2dAdaptor/Geom2dAdaptor_GHCurve.hxx @@ -39,14 +39,20 @@ class Geom2dAdaptor_GHCurve : public Adaptor2d_HCurve2d public: + //! Creates an empty GenHCurve2d. Standard_EXPORT Geom2dAdaptor_GHCurve(); + //! Creates a GenHCurve2d from a Curve Standard_EXPORT Geom2dAdaptor_GHCurve(const Geom2dAdaptor_Curve& C); + //! Sets the field of the GenHCurve2d. Standard_EXPORT void Set (const Geom2dAdaptor_Curve& C); + //! Returns the curve used to create the GenHCurve2d. + //! This is redefined from HCurve2d, cannot be inline. Standard_EXPORT const Adaptor2d_Curve2d& Curve2d() const; + //! Returns the curve used to create the GenHCurve. Geom2dAdaptor_Curve& ChangeCurve2d(); diff --git a/src/Geom2dHatch/Geom2dHatch_Classifier.hxx b/src/Geom2dHatch/Geom2dHatch_Classifier.hxx index 3de6ce01a3..025c184775 100644 --- a/src/Geom2dHatch/Geom2dHatch_Classifier.hxx +++ b/src/Geom2dHatch/Geom2dHatch_Classifier.hxx @@ -43,22 +43,39 @@ public: DEFINE_STANDARD_ALLOC + //! Empty constructor, undefined algorithm. Standard_EXPORT Geom2dHatch_Classifier(); + //! Creates an algorithm to classify the Point P with + //! Tolerance on the face described by . Standard_EXPORT Geom2dHatch_Classifier(Geom2dHatch_Elements& F, const gp_Pnt2d& P, const Standard_Real Tol); + //! Classify the Point P with Tolerance on the + //! face described by . Standard_EXPORT void Perform (Geom2dHatch_Elements& F, const gp_Pnt2d& P, const Standard_Real Tol); + //! Returns the result of the classification. Standard_EXPORT TopAbs_State State() const; + //! Returns True when the state was computed by a + //! rejection. The state is OUT. Standard_Boolean Rejected() const; + //! Returns True if the face contains no wire. The + //! state is IN. Standard_Boolean NoWires() const; + //! Returns the Edge used to determine the + //! classification. When the State is ON this is the + //! Edge containing the point. Standard_EXPORT const Geom2dAdaptor_Curve& Edge() const; + //! Returns the parameter on Edge() used to determine the + //! classification. Standard_EXPORT Standard_Real EdgeParameter() const; + //! Returns the position of the point on the edge + //! returned by Edge. IntRes2d_Position Position() const; diff --git a/src/Geom2dHatch/Geom2dHatch_FClass2dOfClassifier.hxx b/src/Geom2dHatch/Geom2dHatch_FClass2dOfClassifier.hxx index 27af41457a..f4e25ee368 100644 --- a/src/Geom2dHatch/Geom2dHatch_FClass2dOfClassifier.hxx +++ b/src/Geom2dHatch/Geom2dHatch_FClass2dOfClassifier.hxx @@ -43,20 +43,38 @@ public: DEFINE_STANDARD_ALLOC + //! Creates an undefined classifier. Standard_EXPORT Geom2dHatch_FClass2dOfClassifier(); + //! Starts a classification process. The point to + //! classify is the origin of the line .

is + //! the original length of the segment on used to + //! compute intersections. is the tolerance + //! attached to the line segment in intersections. Standard_EXPORT void Reset (const gp_Lin2d& L, const Standard_Real P, const Standard_Real Tol); + //! Updates the classification process with the edge + //! from the boundary. Standard_EXPORT void Compare (const Geom2dAdaptor_Curve& E, const TopAbs_Orientation Or); + //! Returns the current value of the parameter. Standard_Real Parameter() const; + //! Returns the intersecting algorithm. Geom2dHatch_Intersector& Intersector(); + //! Returns 0 if the last compared edge had no + //! relevant intersection. Else returns the index of + //! this intersection in the last intersection + //! algorithm. Standard_Integer ClosestIntersection() const; + //! Returns the current state of the point. TopAbs_State State() const; + //! Returns the Standard_True if the closest intersection point + //! represents head or end of the edge. Returns Standard_False + //! otherwise. Standard_Boolean IsHeadOrEnd() const; diff --git a/src/Geom2dInt/Geom2dInt_GInter.hxx b/src/Geom2dInt/Geom2dInt_GInter.hxx index ee17129f30..8b3892a3dc 100644 --- a/src/Geom2dInt/Geom2dInt_GInter.hxx +++ b/src/Geom2dInt/Geom2dInt_GInter.hxx @@ -53,32 +53,46 @@ public: DEFINE_STANDARD_ALLOC + //! Empty constructor. Geom2dInt_GInter(); + //! Self Intersection of a curve Geom2dInt_GInter(const Adaptor2d_Curve2d& C, const Standard_Real TolConf, const Standard_Real Tol); + //! Self Intersection of a curve with a domain. Geom2dInt_GInter(const Adaptor2d_Curve2d& C, const IntRes2d_Domain& D, const Standard_Real TolConf, const Standard_Real Tol); + //! Intersection between 2 curves. Geom2dInt_GInter(const Adaptor2d_Curve2d& C1, const Adaptor2d_Curve2d& C2, const Standard_Real TolConf, const Standard_Real Tol); + //! Intersection between 2 curves. Geom2dInt_GInter(const Adaptor2d_Curve2d& C1, const IntRes2d_Domain& D1, const Adaptor2d_Curve2d& C2, const Standard_Real TolConf, const Standard_Real Tol); + //! Intersection between 2 curves. Geom2dInt_GInter(const Adaptor2d_Curve2d& C1, const Adaptor2d_Curve2d& C2, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol); + //! Intersection between 2 curves. Geom2dInt_GInter(const Adaptor2d_Curve2d& C1, const IntRes2d_Domain& D1, const Adaptor2d_Curve2d& C2, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol); + //! Intersection between 2 curves. Standard_EXPORT void Perform (const Adaptor2d_Curve2d& C1, const IntRes2d_Domain& D1, const Adaptor2d_Curve2d& C2, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol); + //! Intersection between 2 curves. void Perform (const Adaptor2d_Curve2d& C1, const Adaptor2d_Curve2d& C2, const Standard_Real TolConf, const Standard_Real Tol); + //! Intersection between 2 curves. Standard_EXPORT void Perform (const Adaptor2d_Curve2d& C1, const IntRes2d_Domain& D1, const Standard_Real TolConf, const Standard_Real Tol); + //! Intersection between 2 curves. Standard_EXPORT void Perform (const Adaptor2d_Curve2d& C1, const Standard_Real TolConf, const Standard_Real Tol); + //! Intersection between 2 curves. void Perform (const Adaptor2d_Curve2d& C1, const IntRes2d_Domain& D1, const Adaptor2d_Curve2d& C2, const Standard_Real TolConf, const Standard_Real Tol); + //! Intersection between 2 curves. void Perform (const Adaptor2d_Curve2d& C1, const Adaptor2d_Curve2d& C2, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol); + //! Create a domain from a curve Standard_EXPORT IntRes2d_Domain ComputeDomain (const Adaptor2d_Curve2d& C1, const Standard_Real TolDomain) const; @@ -93,10 +107,13 @@ protected: private: + //! Intersection between 2 curves. Standard_EXPORT void InternalPerform (const Adaptor2d_Curve2d& C1, const IntRes2d_Domain& D1, const Adaptor2d_Curve2d& C2, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol, const Standard_Boolean Composite); + //! Part of InternalCompositePerform function Standard_EXPORT void InternalCompositePerform_noRecurs (const Standard_Integer NbInterC1, const Adaptor2d_Curve2d& C1, const Standard_Integer NumInterC1, const TColStd_Array1OfReal& Tab1, const IntRes2d_Domain& D1, const Standard_Integer NbInterC2, const Adaptor2d_Curve2d& C2, const Standard_Integer NumInterC2, const TColStd_Array1OfReal& Tab2, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol); + //! Intersection between 2 curves. Standard_EXPORT void InternalCompositePerform (const Adaptor2d_Curve2d& C1, const IntRes2d_Domain& D1, const Standard_Integer N1, const Standard_Integer NB1, const TColStd_Array1OfReal& Tab1, const Adaptor2d_Curve2d& C2, const IntRes2d_Domain& D2, const Standard_Integer N2, const Standard_Integer NB2, const TColStd_Array1OfReal& Tab2, const Standard_Real TolConf, const Standard_Real Tol, const Standard_Boolean Composite); diff --git a/src/Geom2dInt/Geom2dInt_IntConicCurveOfGInter.hxx b/src/Geom2dInt/Geom2dInt_IntConicCurveOfGInter.hxx index 0e47e6cd49..a4caae5b8e 100644 --- a/src/Geom2dInt/Geom2dInt_IntConicCurveOfGInter.hxx +++ b/src/Geom2dInt/Geom2dInt_IntConicCurveOfGInter.hxx @@ -47,26 +47,39 @@ public: DEFINE_STANDARD_ALLOC + //! Empty constructor. Standard_EXPORT Geom2dInt_IntConicCurveOfGInter(); + //! Intersection between a line and a parametric curve. Standard_EXPORT Geom2dInt_IntConicCurveOfGInter(const gp_Lin2d& L, const IntRes2d_Domain& D1, const Adaptor2d_Curve2d& PCurve, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol); + //! Intersection between a line and a parametric curve. Standard_EXPORT Geom2dInt_IntConicCurveOfGInter(const gp_Circ2d& C, const IntRes2d_Domain& D1, const Adaptor2d_Curve2d& PCurve, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol); + //! Intersection between an ellipse and a parametric curve. Standard_EXPORT Geom2dInt_IntConicCurveOfGInter(const gp_Elips2d& E, const IntRes2d_Domain& D1, const Adaptor2d_Curve2d& PCurve, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol); + //! Intersection between a parabola and a parametric curve. Standard_EXPORT Geom2dInt_IntConicCurveOfGInter(const gp_Parab2d& Prb, const IntRes2d_Domain& D1, const Adaptor2d_Curve2d& PCurve, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol); + //! Intersection between the main branch of an hyperbola + //! and a parametric curve. Standard_EXPORT Geom2dInt_IntConicCurveOfGInter(const gp_Hypr2d& H, const IntRes2d_Domain& D1, const Adaptor2d_Curve2d& PCurve, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol); + //! Intersection between a line and a parametric curve. Standard_EXPORT void Perform (const gp_Lin2d& L, const IntRes2d_Domain& D1, const Adaptor2d_Curve2d& PCurve, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol); + //! Intersection between a line and a parametric curve. Standard_EXPORT void Perform (const gp_Circ2d& C, const IntRes2d_Domain& D1, const Adaptor2d_Curve2d& PCurve, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol); + //! Intersection between an ellipse and a parametric curve. Standard_EXPORT void Perform (const gp_Elips2d& E, const IntRes2d_Domain& D1, const Adaptor2d_Curve2d& PCurve, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol); + //! Intersection between a parabola and a parametric curve. Standard_EXPORT void Perform (const gp_Parab2d& Prb, const IntRes2d_Domain& D1, const Adaptor2d_Curve2d& PCurve, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol); + //! Intersection between the main branch of an hyperbola + //! and a parametric curve. Standard_EXPORT void Perform (const gp_Hypr2d& H, const IntRes2d_Domain& D1, const Adaptor2d_Curve2d& PCurve, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol); diff --git a/src/Geom2dInt/Geom2dInt_MyImpParToolOfTheIntersectorOfTheIntConicCurveOfGInter.hxx b/src/Geom2dInt/Geom2dInt_MyImpParToolOfTheIntersectorOfTheIntConicCurveOfGInter.hxx index 5999ee9327..25cf921a80 100644 --- a/src/Geom2dInt/Geom2dInt_MyImpParToolOfTheIntersectorOfTheIntConicCurveOfGInter.hxx +++ b/src/Geom2dInt/Geom2dInt_MyImpParToolOfTheIntersectorOfTheIntConicCurveOfGInter.hxx @@ -39,12 +39,19 @@ public: DEFINE_STANDARD_ALLOC + //! Constructor of the class. Standard_EXPORT Geom2dInt_MyImpParToolOfTheIntersectorOfTheIntConicCurveOfGInter(const IntCurve_IConicTool& IT, const Adaptor2d_Curve2d& PC); + //! Computes the value of the signed distance between + //! the implicit curve and the point at parameter Param + //! on the parametrised curve. Standard_EXPORT Standard_Boolean Value (const Standard_Real Param, Standard_Real& F) Standard_OVERRIDE; + //! Computes the derivative of the previous function at + //! parameter Param. Standard_EXPORT Standard_Boolean Derivative (const Standard_Real Param, Standard_Real& D) Standard_OVERRIDE; + //! Computes the value and the derivative of the function. Standard_EXPORT Standard_Boolean Values (const Standard_Real Param, Standard_Real& F, Standard_Real& D) Standard_OVERRIDE; diff --git a/src/Geom2dInt/Geom2dInt_PCLocFOfTheLocateExtPCOfTheProjPCurOfGInter.hxx b/src/Geom2dInt/Geom2dInt_PCLocFOfTheLocateExtPCOfTheProjPCurOfGInter.hxx index 7a3508e7df..c431350dda 100644 --- a/src/Geom2dInt/Geom2dInt_PCLocFOfTheLocateExtPCOfTheProjPCurOfGInter.hxx +++ b/src/Geom2dInt/Geom2dInt_PCLocFOfTheLocateExtPCOfTheProjPCurOfGInter.hxx @@ -53,28 +53,41 @@ public: Standard_EXPORT Geom2dInt_PCLocFOfTheLocateExtPCOfTheProjPCurOfGInter(const gp_Pnt2d& P, const Adaptor2d_Curve2d& C); + //! sets the field mycurve of the function. Standard_EXPORT void Initialize (const Adaptor2d_Curve2d& C); + //! sets the field P of the function. Standard_EXPORT void SetPoint (const gp_Pnt2d& P); + //! Calculation of F(U). Standard_EXPORT Standard_Boolean Value (const Standard_Real U, Standard_Real& F); + //! Calculation of F'(U). Standard_EXPORT Standard_Boolean Derivative (const Standard_Real U, Standard_Real& DF); + //! Calculation of F(U) and F'(U). Standard_EXPORT Standard_Boolean Values (const Standard_Real U, Standard_Real& F, Standard_Real& DF); + //! Save the found extremum. Standard_EXPORT virtual Standard_Integer GetStateNumber() Standard_OVERRIDE; + //! Return the nunber of found extrema. Standard_EXPORT Standard_Integer NbExt() const; + //! Returns the Nth distance. Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N) const; + //! Shows if the Nth distance is a minimum. Standard_EXPORT Standard_Boolean IsMin (const Standard_Integer N) const; + //! Returns the Nth extremum. Standard_EXPORT const Extrema_POnCurv2d& Point (const Standard_Integer N) const; + //! Determines boundaries of subinterval for find of root. Standard_EXPORT void SubIntervalInitialize (const Standard_Real theUfirst, const Standard_Real theUlast); + //! Computes a Tol value. If 1st derivative of curve + //! |D1| + //! Example: + //! before + //! me = (A B C) + //! after + //! me = () Standard_EXPORT void Clear(); ~Geom2dInt_SeqPCOfPCLocFOfTheLocateExtPCOfTheProjPCurOfGInter() { Clear(); } + //! Copies the contents of the sequence Other into this sequence. + //! If this sequence is not empty, it is automatically cleared before the copy. Standard_EXPORT const Geom2dInt_SeqPCOfPCLocFOfTheLocateExtPCOfTheProjPCurOfGInter& Assign (const Geom2dInt_SeqPCOfPCLocFOfTheLocateExtPCOfTheProjPCurOfGInter& Other); const Geom2dInt_SeqPCOfPCLocFOfTheLocateExtPCOfTheProjPCurOfGInter& operator = (const Geom2dInt_SeqPCOfPCLocFOfTheLocateExtPCOfTheProjPCurOfGInter& Other) { return Assign(Other); } + //! Appends at the end of . + //! Example: + //! before + //! me = (A B C) + //! after + //! me = (A B C T) Standard_EXPORT void Append (const Extrema_POnCurv2d& T); + //! Concatenates at the end of . + //! is cleared. + //! Example: + //! before + //! me = (A B C) + //! S = (D E F) + //! after + //! me = (A B C D E F) + //! S = () void Append (Geom2dInt_SeqPCOfPCLocFOfTheLocateExtPCOfTheProjPCurOfGInter& S); + //! Add at the beginning of . + //! Example: + //! before + //! me = (A B C) + //! after + //! me = (T A B C ) Standard_EXPORT void Prepend (const Extrema_POnCurv2d& T); + //! Concatenates at the beginning of . + //! is cleared. + //! Example: + //! before + //! me = (A B C) S = (D E F) + //! after me = (D E F A B C) + //! S = () void Prepend (Geom2dInt_SeqPCOfPCLocFOfTheLocateExtPCOfTheProjPCurOfGInter& S); + //! Inserts in before the position . + //! Raises an exception if the index is out of bounds. + //! Example: + //! before + //! me = (A B D), Index = 3, T = C + //! after + //! me = (A B C D ) void InsertBefore (const Standard_Integer Index, const Extrema_POnCurv2d& T); + //! Inserts the sequence in before + //! the position . is cleared. + //! Raises an exception if the index is out of bounds + //! Example: + //! before + //! me = (A B F), Index = 3, S = (C D E) + //! after + //! me = (A B C D E F) + //! S = () void InsertBefore (const Standard_Integer Index, Geom2dInt_SeqPCOfPCLocFOfTheLocateExtPCOfTheProjPCurOfGInter& S); + //! Inserts in after the position . + //! Raises an exception if the index is out of bound + //! Example: + //! before + //! me = (A B C), Index = 3, T = D + //! after + //! me = (A B C D) Standard_EXPORT void InsertAfter (const Standard_Integer Index, const Extrema_POnCurv2d& T); + //! Inserts the sequence in after the + //! position . is cleared. + //! Raises an exception if the index is out of bound. + //! Example: + //! before + //! me = (A B C), Index = 3, S = (D E F) + //! after + //! me = (A B C D E F) + //! S = () void InsertAfter (const Standard_Integer Index, Geom2dInt_SeqPCOfPCLocFOfTheLocateExtPCOfTheProjPCurOfGInter& S); + //! Returns the first element of the sequence + //! Raises an exception if the sequence is empty. + //! Example: + //! before + //! me = (A B C) + //! after + //! me = (A B C) + //! returns A Standard_EXPORT const Extrema_POnCurv2d& First() const; + //! Returns the last element of the sequence + //! Raises an exception if the sequence is empty. + //! Example: + //! before + //! me = (A B C) + //! after + //! me = (A B C) + //! returns C Standard_EXPORT const Extrema_POnCurv2d& Last() const; + //! Keeps in the items 1 to -1 and + //! puts in the items to the end. + //! Example: + //! before + //! me = (A B C D) ,Index = 3 + //! after + //! me = (A B) + //! Sub = (C D) void Split (const Standard_Integer Index, Geom2dInt_SeqPCOfPCLocFOfTheLocateExtPCOfTheProjPCurOfGInter& Sub); + //! Returns the Item at position in . + //! Raises an exception if the index is out of bound + //! Example: + //! before + //! me = (A B C), Index = 1 + //! after + //! me = (A B C) + //! returns + //! A Standard_EXPORT const Extrema_POnCurv2d& Value (const Standard_Integer Index) const; const Extrema_POnCurv2d& operator() (const Standard_Integer Index) const { return Value(Index); } + //! Changes the item at position + //! Raises an exception if the index is out of bound + //! Example: + //! before + //! me = (A B C), Index = 1, Item = D + //! after + //! me = (D B C) Standard_EXPORT void SetValue (const Standard_Integer Index, const Extrema_POnCurv2d& I); + //! Returns the Item at position in + //! . This method may be used to modify + //! : S.Value(Index) = Item. + //! Raises an exception if the index is out of bound + //! Example: + //! before + //! me = (A B C), Index = 1 + //! after + //! me = (A B C) + //! returns + //! A Standard_EXPORT Extrema_POnCurv2d& ChangeValue (const Standard_Integer Index); Extrema_POnCurv2d& operator() (const Standard_Integer Index) { return ChangeValue(Index); } + //! Removes from the item at position . + //! Raises an exception if the index is out of bounds + //! Example: + //! before + //! me = (A B C), Index = 3 + //! after + //! me = (A B) Standard_EXPORT void Remove (const Standard_Integer Index); + //! Removes from all the items of + //! positions between and . + //! Raises an exception if the indices are out of bounds. + //! Example: + //! before + //! me = (A B C D E F), FromIndex = 1 ToIndex = 3 + //! after + //! me = (D E F) Standard_EXPORT void Remove (const Standard_Integer FromIndex, const Standard_Integer ToIndex); diff --git a/src/Geom2dInt/Geom2dInt_TheCurveLocatorOfTheProjPCurOfGInter.hxx b/src/Geom2dInt/Geom2dInt_TheCurveLocatorOfTheProjPCurOfGInter.hxx index 6b0cff282e..a479f41a92 100644 --- a/src/Geom2dInt/Geom2dInt_TheCurveLocatorOfTheProjPCurOfGInter.hxx +++ b/src/Geom2dInt/Geom2dInt_TheCurveLocatorOfTheProjPCurOfGInter.hxx @@ -37,10 +37,21 @@ public: DEFINE_STANDARD_ALLOC + //! Among a set of points {C(ui),i=1,NbU}, locate the point + //! P=C(uj) such that: + //! distance(P,C) = Min{distance(P,C(ui))} Standard_EXPORT static void Locate (const gp_Pnt2d& P, const Adaptor2d_Curve2d& C, const Standard_Integer NbU, Extrema_POnCurv2d& Papp); + //! Among a set of points {C(ui),i=1,NbU}, locate the point + //! P=C(uj) such that: + //! distance(P,C) = Min{distance(P,C(ui))} + //! The research is done between umin and usup. Standard_EXPORT static void Locate (const gp_Pnt2d& P, const Adaptor2d_Curve2d& C, const Standard_Integer NbU, const Standard_Real Umin, const Standard_Real Usup, Extrema_POnCurv2d& Papp); + //! Among two sets of points {C1(ui),i=1,NbU} and + //! {C2(vj),j=1,NbV}, locate the two points P1=C1(uk) and + //! P2=C2(vl) such that: + //! distance(P1,P2) = Min {distance(C1(ui),C2(vj))}. Standard_EXPORT static void Locate (const Adaptor2d_Curve2d& C1, const Adaptor2d_Curve2d& C2, const Standard_Integer NbU, const Standard_Integer NbV, Extrema_POnCurv2d& Papp1, Extrema_POnCurv2d& Papp2); diff --git a/src/Geom2dInt/Geom2dInt_TheDistBetweenPCurvesOfTheIntPCurvePCurveOfGInter.hxx b/src/Geom2dInt/Geom2dInt_TheDistBetweenPCurvesOfTheIntPCurvePCurveOfGInter.hxx index c62c336dac..25721da15a 100644 --- a/src/Geom2dInt/Geom2dInt_TheDistBetweenPCurvesOfTheIntPCurvePCurveOfGInter.hxx +++ b/src/Geom2dInt/Geom2dInt_TheDistBetweenPCurvesOfTheIntPCurvePCurveOfGInter.hxx @@ -41,14 +41,28 @@ public: Standard_EXPORT Geom2dInt_TheDistBetweenPCurvesOfTheIntPCurvePCurveOfGInter(const Adaptor2d_Curve2d& curve1, const Adaptor2d_Curve2d& curve2); + //! returns 2. Standard_EXPORT Standard_Integer NbVariables() const; + //! returns 2. Standard_EXPORT Standard_Integer NbEquations() const; + //! computes the values of the Functions for the + //! variable . + //! returns True if the computation was done successfully, + //! False otherwise. Standard_EXPORT Standard_Boolean Value (const math_Vector& X, math_Vector& F); + //! returns the values of the derivatives for the + //! variable . + //! returns True if the computation was done successfully, + //! False otherwise. Standard_EXPORT Standard_Boolean Derivatives (const math_Vector& X, math_Matrix& D); + //! returns the values of the functions and the derivatives + //! for the variable . + //! returns True if the computation was done successfully, + //! False otherwise. Standard_EXPORT Standard_Boolean Values (const math_Vector& X, math_Vector& F, math_Matrix& D); diff --git a/src/Geom2dInt/Geom2dInt_TheIntConicCurveOfGInter.hxx b/src/Geom2dInt/Geom2dInt_TheIntConicCurveOfGInter.hxx index 1fda1b6794..544320b13d 100644 --- a/src/Geom2dInt/Geom2dInt_TheIntConicCurveOfGInter.hxx +++ b/src/Geom2dInt/Geom2dInt_TheIntConicCurveOfGInter.hxx @@ -45,26 +45,39 @@ public: DEFINE_STANDARD_ALLOC + //! Empty constructor. Geom2dInt_TheIntConicCurveOfGInter(); + //! Intersection between a line and a parametric curve. Geom2dInt_TheIntConicCurveOfGInter(const gp_Lin2d& L, const IntRes2d_Domain& D1, const Adaptor2d_Curve2d& PCurve, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol); + //! Intersection between a line and a parametric curve. Standard_EXPORT Geom2dInt_TheIntConicCurveOfGInter(const gp_Circ2d& C, const IntRes2d_Domain& D1, const Adaptor2d_Curve2d& PCurve, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol); + //! Intersection between an ellipse and a parametric curve. Standard_EXPORT Geom2dInt_TheIntConicCurveOfGInter(const gp_Elips2d& E, const IntRes2d_Domain& D1, const Adaptor2d_Curve2d& PCurve, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol); + //! Intersection between a parabola and a parametric curve. Standard_EXPORT Geom2dInt_TheIntConicCurveOfGInter(const gp_Parab2d& Prb, const IntRes2d_Domain& D1, const Adaptor2d_Curve2d& PCurve, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol); + //! Intersection between the main branch of an hyperbola + //! and a parametric curve. Standard_EXPORT Geom2dInt_TheIntConicCurveOfGInter(const gp_Hypr2d& H, const IntRes2d_Domain& D1, const Adaptor2d_Curve2d& PCurve, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol); + //! Intersection between a line and a parametric curve. void Perform (const gp_Lin2d& L, const IntRes2d_Domain& D1, const Adaptor2d_Curve2d& PCurve, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol); + //! Intersection between a line and a parametric curve. void Perform (const gp_Circ2d& C, const IntRes2d_Domain& D1, const Adaptor2d_Curve2d& PCurve, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol); + //! Intersection between an ellipse and a parametric curve. void Perform (const gp_Elips2d& E, const IntRes2d_Domain& D1, const Adaptor2d_Curve2d& PCurve, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol); + //! Intersection between a parabola and a parametric curve. void Perform (const gp_Parab2d& Prb, const IntRes2d_Domain& D1, const Adaptor2d_Curve2d& PCurve, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol); + //! Intersection between the main branch of an hyperbola + //! and a parametric curve. void Perform (const gp_Hypr2d& H, const IntRes2d_Domain& D1, const Adaptor2d_Curve2d& PCurve, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol); @@ -79,6 +92,8 @@ protected: private: + //! Intersection between a conic fom gp + //! and a parametric curve. void Perform (const IntCurve_IConicTool& ICurve, const IntRes2d_Domain& D1, const Adaptor2d_Curve2d& PCurve, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol); diff --git a/src/Geom2dInt/Geom2dInt_TheIntPCurvePCurveOfGInter.hxx b/src/Geom2dInt/Geom2dInt_TheIntPCurvePCurveOfGInter.hxx index fe3864805a..261684cc15 100644 --- a/src/Geom2dInt/Geom2dInt_TheIntPCurvePCurveOfGInter.hxx +++ b/src/Geom2dInt/Geom2dInt_TheIntPCurvePCurveOfGInter.hxx @@ -65,6 +65,11 @@ protected: private: + //! Method to find intersection between two curves + //! : returns false for case when some points of polygon + //! : were replaced on line and exact point of intersection was not found + //! : for case when point of intersection was found + //! : during prelimanary search for line (case of bad paramerization of Bspline for example). Standard_EXPORT Standard_Boolean findIntersect (const Adaptor2d_Curve2d& Curve1, const IntRes2d_Domain& Domain1, const Adaptor2d_Curve2d& Curve2, const IntRes2d_Domain& Domain2, const Standard_Real TolConf, const Standard_Real Tol, const Standard_Integer NbIter, const Standard_Real DeltaU, const Standard_Real DeltaV, const Geom2dInt_ThePolygon2dOfTheIntPCurvePCurveOfGInter& thePoly1, const Geom2dInt_ThePolygon2dOfTheIntPCurvePCurveOfGInter& thePoly2, const Standard_Boolean isFullRepresentation); diff --git a/src/Geom2dInt/Geom2dInt_TheIntersectorOfTheIntConicCurveOfGInter.hxx b/src/Geom2dInt/Geom2dInt_TheIntersectorOfTheIntConicCurveOfGInter.hxx index be88ad7e1b..7c112b3b0e 100644 --- a/src/Geom2dInt/Geom2dInt_TheIntersectorOfTheIntConicCurveOfGInter.hxx +++ b/src/Geom2dInt/Geom2dInt_TheIntersectorOfTheIntConicCurveOfGInter.hxx @@ -43,10 +43,21 @@ public: DEFINE_STANDARD_ALLOC + //! Empty constructor. Standard_EXPORT Geom2dInt_TheIntersectorOfTheIntConicCurveOfGInter(); + //! Intersection between an implicit curve and + //! a parametrised curve. + //! The exception ConstructionError is raised if the domain + //! of the parametrised curve does not verify HasFirstPoint + //! and HasLastPoint return True. Standard_EXPORT Geom2dInt_TheIntersectorOfTheIntConicCurveOfGInter(const IntCurve_IConicTool& ITool, const IntRes2d_Domain& Dom1, const Adaptor2d_Curve2d& PCurve, const IntRes2d_Domain& Dom2, const Standard_Real TolConf, const Standard_Real Tol); + //! Intersection between an implicit curve and + //! a parametrised curve. + //! The exception ConstructionError is raised if the domain + //! of the parametrised curve does not verify HasFirstPoint + //! and HasLastPoint return True. Standard_EXPORT void Perform (const IntCurve_IConicTool& ITool, const IntRes2d_Domain& Dom1, const Adaptor2d_Curve2d& PCurve, const IntRes2d_Domain& Dom2, const Standard_Real TolConf, const Standard_Real Tol); Standard_EXPORT Standard_Real FindU (const Standard_Real parameter, gp_Pnt2d& point, const Adaptor2d_Curve2d& TheParCurev, const IntCurve_IConicTool& TheImpTool) const; diff --git a/src/Geom2dInt/Geom2dInt_TheLocateExtPCOfTheProjPCurOfGInter.hxx b/src/Geom2dInt/Geom2dInt_TheLocateExtPCOfTheProjPCurOfGInter.hxx index 1d7d277909..29fe3eedfb 100644 --- a/src/Geom2dInt/Geom2dInt_TheLocateExtPCOfTheProjPCurOfGInter.hxx +++ b/src/Geom2dInt/Geom2dInt_TheLocateExtPCOfTheProjPCurOfGInter.hxx @@ -46,20 +46,47 @@ public: Standard_EXPORT Geom2dInt_TheLocateExtPCOfTheProjPCurOfGInter(); + //! Calculates the distance with a close point. + //! The close point is defined by the parameter value + //! U0. + //! The function F(u)=distance(P,C(u)) has an extremum + //! when g(u)=dF/du=0. The algorithm searchs a zero + //! near the close point. + //! TolU is used to decide to stop the iterations. + //! At the nth iteration, the criteria is: + //! abs(Un - Un-1) < TolU. Standard_EXPORT Geom2dInt_TheLocateExtPCOfTheProjPCurOfGInter(const gp_Pnt2d& P, const Adaptor2d_Curve2d& C, const Standard_Real U0, const Standard_Real TolU); + //! Calculates the distance with a close point. + //! The close point is defined by the parameter value + //! U0. + //! The function F(u)=distance(P,C(u)) has an extremum + //! when g(u)=dF/du=0. The algorithm searchs a zero + //! near the close point. + //! Zeros are searched between Umin et Usup. + //! TolU is used to decide to stop the iterations. + //! At the nth iteration, the criteria is: + //! abs(Un - Un-1) < TolU. Standard_EXPORT Geom2dInt_TheLocateExtPCOfTheProjPCurOfGInter(const gp_Pnt2d& P, const Adaptor2d_Curve2d& C, const Standard_Real U0, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real TolU); + //! sets the fields of the algorithm. Standard_EXPORT void Initialize (const Adaptor2d_Curve2d& C, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real TolU); + //! the algorithm is done with the point P. + //! An exception is raised if the fields have not + //! been initialized. Standard_EXPORT void Perform (const gp_Pnt2d& P, const Standard_Real U0); + //! Returns True if the distance is found. Standard_EXPORT Standard_Boolean IsDone() const; + //! Returns the value of the extremum square distance. Standard_EXPORT Standard_Real SquareDistance() const; + //! Returns True if the extremum distance is a minimum. Standard_EXPORT Standard_Boolean IsMin() const; + //! Returns the point of the extremum distance. Standard_EXPORT const Extrema_POnCurv2d& Point() const; diff --git a/src/Geom2dInt/Geom2dInt_ThePolygon2dOfTheIntPCurvePCurveOfGInter.hxx b/src/Geom2dInt/Geom2dInt_ThePolygon2dOfTheIntPCurvePCurveOfGInter.hxx index a5b9b363fd..09aa5abf8b 100644 --- a/src/Geom2dInt/Geom2dInt_ThePolygon2dOfTheIntPCurvePCurveOfGInter.hxx +++ b/src/Geom2dInt/Geom2dInt_ThePolygon2dOfTheIntPCurvePCurveOfGInter.hxx @@ -44,8 +44,14 @@ public: DEFINE_STANDARD_ALLOC + //! Compute a polygon on the domain of the curve. Standard_EXPORT Geom2dInt_ThePolygon2dOfTheIntPCurvePCurveOfGInter(const Adaptor2d_Curve2d& Curve, const Standard_Integer NbPnt, const IntRes2d_Domain& Domain, const Standard_Real Tol); + //! The current polygon is modified if most + //! of the points of the polygon are are + //! outside the box . In this + //! situation, bounds are computed to build + //! a polygon inside or near the OtherBox. Standard_EXPORT void ComputeWithBox (const Adaptor2d_Curve2d& Curve, const Bnd_Box2d& OtherBox); virtual Standard_Real DeflectionOverEstimation() const Standard_OVERRIDE; @@ -54,16 +60,24 @@ public: void Closed (const Standard_Boolean clos); + //! Give the number of Segments in the polyline. virtual Standard_Integer NbSegments() const Standard_OVERRIDE; + //! Returns the points of the segment in the Polygon. Standard_EXPORT virtual void Segment (const Standard_Integer theIndex, gp_Pnt2d& theBegin, gp_Pnt2d& theEnd) const Standard_OVERRIDE; + //! Returns the parameter (On the curve) + //! of the first point of the Polygon Standard_Real InfParameter() const; + //! Returns the parameter (On the curve) + //! of the last point of the Polygon Standard_Real SupParameter() const; Standard_EXPORT Standard_Boolean AutoIntersectionIsPossible() const; + //! Give an approximation of the parameter on the curve + //! according to the discretization of the Curve. Standard_EXPORT Standard_Real ApproxParamOnCurve (const Standard_Integer Index, const Standard_Real ParamOnLine) const; Standard_Integer CalculRegion (const Standard_Real x, const Standard_Real y, const Standard_Real x1, const Standard_Real x2, const Standard_Real y1, const Standard_Real y2) const; diff --git a/src/Geom2dInt/Geom2dInt_TheProjPCurOfGInter.hxx b/src/Geom2dInt/Geom2dInt_TheProjPCurOfGInter.hxx index 7309841875..63eb24a4b3 100644 --- a/src/Geom2dInt/Geom2dInt_TheProjPCurOfGInter.hxx +++ b/src/Geom2dInt/Geom2dInt_TheProjPCurOfGInter.hxx @@ -38,8 +38,33 @@ public: DEFINE_STANDARD_ALLOC + //! Returns the parameter V of the point on the + //! parametric curve corresponding to the Point Pnt. + //! The Correspondance between Pnt and the point P(V) + //! on the parametric curve must be coherent with the + //! way of determination of the signed distance + //! between a point and the implicit curve. + //! Tol is the tolerance on the distance between a point + //! and the parametrised curve. + //! In that case, no bounds are given. The research of + //! the rigth parameter has to be made on the natural + //! parametric domain of the curve. Standard_EXPORT static Standard_Real FindParameter (const Adaptor2d_Curve2d& C, const gp_Pnt2d& Pnt, const Standard_Real Tol); + //! Returns the parameter V of the point on the + //! parametric curve corresponding to the Point Pnt. + //! The Correspondance between Pnt and the point P(V) + //! on the parametric curve must be coherent with the + //! way of determination of the signed distance + //! between a point and the implicit curve. + //! Tol is the tolerance on the distance between a point + //! and the parametrised curve. + //! LowParameter and HighParameter give the + //! boundaries of the interval in wich the parameter + //! certainly lies. These parameters are given to + //! implement a more efficient algoritm. So, it is not + //! necessary to check that the returned value verifies + //! LowParameter <= Value <= HighParameter. Standard_EXPORT static Standard_Real FindParameter (const Adaptor2d_Curve2d& C, const gp_Pnt2d& Pnt, const Standard_Real LowParameter, const Standard_Real HighParameter, const Standard_Real Tol); diff --git a/src/Geom2dLProp/Geom2dLProp_CLProps2d.hxx b/src/Geom2dLProp/Geom2dLProp_CLProps2d.hxx index a2031a24c6..8d6752e83d 100644 --- a/src/Geom2dLProp/Geom2dLProp_CLProps2d.hxx +++ b/src/Geom2dLProp/Geom2dLProp_CLProps2d.hxx @@ -47,32 +47,68 @@ public: DEFINE_STANDARD_ALLOC + //! Initializes the local properties of the curve + //! The current point and the derivatives are + //! computed at the same time, which allows an + //! optimization of the computation time. + //! indicates the maximum number of derivations to + //! be done (0, 1, 2 or 3). For example, to compute + //! only the tangent, N should be equal to 1. + //! is the linear tolerance (it is used to test + //! if a vector is null). Standard_EXPORT Geom2dLProp_CLProps2d(const Handle(Geom2d_Curve)& C, const Standard_Integer N, const Standard_Real Resolution); + //! Same as previous constructor but here the parameter is + //! set to the value . + //! All the computations done will be related to and . Standard_EXPORT Geom2dLProp_CLProps2d(const Handle(Geom2d_Curve)& C, const Standard_Real U, const Standard_Integer N, const Standard_Real Resolution); + //! Same as previous constructor but here the parameter is + //! set to the value and the curve is set + //! with SetCurve. + //! the curve can have a empty constructor + //! All the computations done will be related to and + //! when the functions "set" will be done. Standard_EXPORT Geom2dLProp_CLProps2d(const Standard_Integer N, const Standard_Real Resolution); + //! Initializes the local properties of the curve + //! for the parameter value . Standard_EXPORT void SetParameter (const Standard_Real U); + //! Initializes the local properties of the curve + //! for the new curve. Standard_EXPORT void SetCurve (const Handle(Geom2d_Curve)& C); + //! Returns the Point. Standard_EXPORT const gp_Pnt2d& Value() const; + //! Returns the first derivative. + //! The derivative is computed if it has not been yet. Standard_EXPORT const gp_Vec2d& D1(); + //! Returns the second derivative. + //! The derivative is computed if it has not been yet. Standard_EXPORT const gp_Vec2d& D2(); + //! Returns the third derivative. + //! The derivative is computed if it has not been yet. Standard_EXPORT const gp_Vec2d& D3(); + //! Returns True if the tangent is defined. + //! For example, the tangent is not defined if the + //! three first derivatives are all null. Standard_EXPORT Standard_Boolean IsTangentDefined(); + //! output the tangent direction Standard_EXPORT void Tangent (gp_Dir2d& D); + //! Returns the curvature. Standard_EXPORT Standard_Real Curvature(); + //! Returns the normal direction . Standard_EXPORT void Normal (gp_Dir2d& N); + //! Returns the centre of curvature

. Standard_EXPORT void CentreOfCurvature (gp_Pnt2d& P); diff --git a/src/GeomAdaptor/GeomAdaptor_GHCurve.hxx b/src/GeomAdaptor/GeomAdaptor_GHCurve.hxx index 6f7091d32b..70a9493d77 100644 --- a/src/GeomAdaptor/GeomAdaptor_GHCurve.hxx +++ b/src/GeomAdaptor/GeomAdaptor_GHCurve.hxx @@ -39,16 +39,24 @@ class GeomAdaptor_GHCurve : public Adaptor3d_HCurve public: + //! Creates an empty GenHCurve. Standard_EXPORT GeomAdaptor_GHCurve(); + //! Creates a GenHCurve from a Curve Standard_EXPORT GeomAdaptor_GHCurve(const GeomAdaptor_Curve& C); + //! Sets the field of the GenHCurve. Standard_EXPORT void Set (const GeomAdaptor_Curve& C); + //! Returns the curve used to create the GenHCurve. + //! This is redefined from HCurve, cannot be inline. Standard_EXPORT const Adaptor3d_Curve& Curve() const; + //! Returns the curve used to create the GenHCurve. + //! This is redefined from HCurve, cannot be inline. Standard_EXPORT Adaptor3d_Curve& GetCurve(); + //! Returns the curve used to create the GenHCurve. GeomAdaptor_Curve& ChangeCurve(); diff --git a/src/GeomAdaptor/GeomAdaptor_GHSurface.hxx b/src/GeomAdaptor/GeomAdaptor_GHSurface.hxx index 70fd5e19f5..a77672de2d 100644 --- a/src/GeomAdaptor/GeomAdaptor_GHSurface.hxx +++ b/src/GeomAdaptor/GeomAdaptor_GHSurface.hxx @@ -39,14 +39,20 @@ class GeomAdaptor_GHSurface : public Adaptor3d_HSurface public: + //! Creates an empty GenHSurface. Standard_EXPORT GeomAdaptor_GHSurface(); + //! Creates a GenHSurface from a Surface. Standard_EXPORT GeomAdaptor_GHSurface(const GeomAdaptor_Surface& S); + //! Sets the field of the GenHSurface. Standard_EXPORT void Set (const GeomAdaptor_Surface& S); + //! Returns a reference to the Surface inside the HSurface. + //! This is redefined from HSurface, cannot be inline. Standard_EXPORT const Adaptor3d_Surface& Surface() const; + //! Returns the surface used to create the GenHSurface. GeomAdaptor_Surface& ChangeSurface(); diff --git a/src/GeomFill/GeomFill_AppSurf.hxx b/src/GeomFill/GeomFill_AppSurf.hxx index 2b941f03ce..3344ce73d6 100644 --- a/src/GeomFill/GeomFill_AppSurf.hxx +++ b/src/GeomFill/GeomFill_AppSurf.hxx @@ -59,16 +59,26 @@ public: Standard_EXPORT void Init (const Standard_Integer Degmin, const Standard_Integer Degmax, const Standard_Real Tol3d, const Standard_Real Tol2d, const Standard_Integer NbIt, const Standard_Boolean KnownParameters = Standard_False); + //! Define the type of parametrization used in the approximation Standard_EXPORT void SetParType (const Approx_ParametrizationType ParType); + //! Define the Continuity used in the approximation Standard_EXPORT void SetContinuity (const GeomAbs_Shape C); + //! define the Weights associed to the criterium used in + //! the optimization. + //! + //! if Wi <= 0 Standard_EXPORT void SetCriteriumWeight (const Standard_Real W1, const Standard_Real W2, const Standard_Real W3); + //! returns the type of parametrization used in the approximation Standard_EXPORT Approx_ParametrizationType ParType() const; + //! returns the Continuity used in the approximation Standard_EXPORT GeomAbs_Shape Continuity() const; + //! returns the Weights (as percent) associed to the criterium used in + //! the optimization. Standard_EXPORT void CriteriumWeight (Standard_Real& W1, Standard_Real& W2, Standard_Real& W3) const; Standard_EXPORT void Perform (const Handle(GeomFill_Line)& Lin, GeomFill_SectionGenerator& SecGen, const Standard_Boolean SpApprox = Standard_False); diff --git a/src/GeomFill/GeomFill_AppSweep.hxx b/src/GeomFill/GeomFill_AppSweep.hxx index a981807073..fe13656b9b 100644 --- a/src/GeomFill/GeomFill_AppSweep.hxx +++ b/src/GeomFill/GeomFill_AppSweep.hxx @@ -60,16 +60,26 @@ public: Standard_EXPORT void Init (const Standard_Integer Degmin, const Standard_Integer Degmax, const Standard_Real Tol3d, const Standard_Real Tol2d, const Standard_Integer NbIt, const Standard_Boolean KnownParameters = Standard_False); + //! Define the type of parametrization used in the approximation Standard_EXPORT void SetParType (const Approx_ParametrizationType ParType); + //! Define the Continuity used in the approximation Standard_EXPORT void SetContinuity (const GeomAbs_Shape C); + //! define the Weights associed to the criterium used in + //! the optimization. + //! + //! if Wi <= 0 Standard_EXPORT void SetCriteriumWeight (const Standard_Real W1, const Standard_Real W2, const Standard_Real W3); + //! returns the type of parametrization used in the approximation Standard_EXPORT Approx_ParametrizationType ParType() const; + //! returns the Continuity used in the approximation Standard_EXPORT GeomAbs_Shape Continuity() const; + //! returns the Weights (as percent) associed to the criterium used in + //! the optimization. Standard_EXPORT void CriteriumWeight (Standard_Real& W1, Standard_Real& W2, Standard_Real& W3) const; Standard_EXPORT void Perform (const Handle(GeomFill_Line)& Lin, GeomFill_SweepSectionGenerator& SecGen, const Standard_Boolean SpApprox = Standard_False); diff --git a/src/GeomInt/GeomInt_BSpParFunctionOfMyBSplGradientOfTheComputeLineOfWLApprox.hxx b/src/GeomInt/GeomInt_BSpParFunctionOfMyBSplGradientOfTheComputeLineOfWLApprox.hxx index cdc002d0b2..666b528f1d 100644 --- a/src/GeomInt/GeomInt_BSpParFunctionOfMyBSplGradientOfTheComputeLineOfWLApprox.hxx +++ b/src/GeomInt/GeomInt_BSpParFunctionOfMyBSplGradientOfTheComputeLineOfWLApprox.hxx @@ -51,30 +51,59 @@ public: DEFINE_STANDARD_ALLOC + //! initializes the fields of the function. The approximating + //! curve has control points. Standard_EXPORT GeomInt_BSpParFunctionOfMyBSplGradientOfTheComputeLineOfWLApprox(const GeomInt_TheMultiLineOfWLApprox& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, const math_Vector& Parameters, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const Standard_Integer NbPol); + //! returns the number of variables of the function. It + //! corresponds to the number of MultiPoints. Standard_EXPORT Standard_Integer NbVariables() const; + //! this method computes the new approximation of the + //! MultiLine + //! SSP and calculates F = sum (||Pui - Bi*Pi||2) for each + //! point of the MultiLine. Standard_EXPORT Standard_Boolean Value (const math_Vector& X, Standard_Real& F); + //! returns the gradient G of the sum above for the + //! parameters Xi. Standard_EXPORT Standard_Boolean Gradient (const math_Vector& X, math_Vector& G); + //! returns the value F=sum(||Pui - Bi*Pi||)2. + //! returns the value G = grad(F) for the parameters Xi. Standard_EXPORT Standard_Boolean Values (const math_Vector& X, Standard_Real& F, math_Vector& G); + //! returns the new parameters of the MultiLine. Standard_EXPORT const math_Vector& NewParameters() const; + //! returns the MultiBSpCurve approximating the set after + //! computing the value F or Grad(F). Standard_EXPORT AppParCurves_MultiBSpCurve CurveValue(); + //! returns the distance between the MultiPoint of range + //! IPoint and the curve CurveIndex. Standard_EXPORT Standard_Real Error (const Standard_Integer IPoint, const Standard_Integer CurveIndex); + //! returns the maximum distance between the points + //! and the MultiBSpCurve. Standard_EXPORT Standard_Real MaxError3d() const; + //! returns the maximum distance between the points + //! and the MultiBSpCurve. Standard_EXPORT Standard_Real MaxError2d() const; + //! returns the function matrix used to approximate the + //! multiline. Standard_EXPORT const math_Matrix& FunctionMatrix() const; + //! returns the derivative function matrix used to approximate the + //! multiline. Standard_EXPORT const math_Matrix& DerivativeFunctionMatrix() const; + //! Returns the indexes of the first non null values of + //! A and DA. + //! The values are non null from Index(ieme point) +1 + //! to Index(ieme point) + degree +1. Standard_EXPORT const math_IntegerVector& Index() const; Standard_EXPORT AppParCurves_Constraint FirstConstraint (const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, const Standard_Integer FirstPoint) const; @@ -91,6 +120,8 @@ public: protected: + //! this method is used each time Value or Gradient is + //! needed. Standard_EXPORT void Perform (const math_Vector& X); diff --git a/src/GeomInt/GeomInt_BSpParLeastSquareOfMyBSplGradientOfTheComputeLineOfWLApprox.hxx b/src/GeomInt/GeomInt_BSpParLeastSquareOfMyBSplGradientOfTheComputeLineOfWLApprox.hxx index b0faf17aaa..01f65ed239 100644 --- a/src/GeomInt/GeomInt_BSpParLeastSquareOfMyBSplGradientOfTheComputeLineOfWLApprox.hxx +++ b/src/GeomInt/GeomInt_BSpParLeastSquareOfMyBSplGradientOfTheComputeLineOfWLApprox.hxx @@ -52,46 +52,120 @@ public: DEFINE_STANDARD_ALLOC + //! given a MultiLine, this algorithm computes the least + //! square resolution using the Householder-QR method. + //! If the first and/or the last point is a constraint + //! point, the value of the tangency or curvature is + //! computed in the resolution. + //! NbPol is the number of control points wanted + //! for the approximating curves. + //! The system to solve is the following: + //! A X = B. + //! Where A is the Bernstein matrix computed with the + //! parameters, B the points coordinates and X the poles + //! solutions. + //! The matrix A is the same for each coordinate x, y and z + //! and is also the same for each MultiLine point because + //! they are approximated in parallel(so with the same + //! parameter, only the vector B changes). Standard_EXPORT GeomInt_BSpParLeastSquareOfMyBSplGradientOfTheComputeLineOfWLApprox(const GeomInt_TheMultiLineOfWLApprox& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const AppParCurves_Constraint FirstCons, const AppParCurves_Constraint LastCons, const math_Vector& Parameters, const Standard_Integer NbPol); + //! Initializes the fields of the object. Standard_EXPORT GeomInt_BSpParLeastSquareOfMyBSplGradientOfTheComputeLineOfWLApprox(const GeomInt_TheMultiLineOfWLApprox& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const AppParCurves_Constraint FirstCons, const AppParCurves_Constraint LastCons, const Standard_Integer NbPol); + //! given a MultiLine, this algorithm computes the least + //! square resolution using the Householder-QR method. + //! If the first and/or the last point is a constraint + //! point, the value of the tangency or curvature is + //! computed in the resolution. + //! Deg is the degree wanted for the approximating curves. + //! The system to solve is the following: + //! A X = B. + //! Where A is the BSpline functions matrix computed with + //! , B the points coordinates and X the poles + //! solutions. + //! The matrix A is the same for each coordinate x, y and z + //! and is also the same for each MultiLine point because + //! they are approximated in parallel(so with the same + //! parameter, only the vector B changes). Standard_EXPORT GeomInt_BSpParLeastSquareOfMyBSplGradientOfTheComputeLineOfWLApprox(const GeomInt_TheMultiLineOfWLApprox& SSP, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const AppParCurves_Constraint FirstCons, const AppParCurves_Constraint LastCons, const math_Vector& Parameters, const Standard_Integer NbPol); + //! Initializes the fields of the object. Standard_EXPORT GeomInt_BSpParLeastSquareOfMyBSplGradientOfTheComputeLineOfWLApprox(const GeomInt_TheMultiLineOfWLApprox& SSP, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const AppParCurves_Constraint FirstCons, const AppParCurves_Constraint LastCons, const Standard_Integer NbPol); + //! Is used after having initialized the fields. + //! The case "CurvaturePoint" is not treated in this method. Standard_EXPORT void Perform (const math_Vector& Parameters); + //! Is used after having initialized the fields. Standard_EXPORT void Perform (const math_Vector& Parameters, const Standard_Real l1, const Standard_Real l2); + //! Is used after having initialized the fields. + //! is the tangent vector at the first point. + //! is the tangent vector at the last point. Standard_EXPORT void Perform (const math_Vector& Parameters, const math_Vector& V1t, const math_Vector& V2t, const Standard_Real l1, const Standard_Real l2); + //! Is used after having initialized the fields. + //! is the tangent vector at the first point. + //! is the tangent vector at the last point. + //! is the tangent vector at the first point. + //! is the tangent vector at the last point. Standard_EXPORT void Perform (const math_Vector& Parameters, const math_Vector& V1t, const math_Vector& V2t, const math_Vector& V1c, const math_Vector& V2c, const Standard_Real l1, const Standard_Real l2); + //! returns True if all has been correctly done. Standard_EXPORT Standard_Boolean IsDone() const; + //! returns the result of the approximation, i.e. all the + //! Curves. + //! An exception is raised if NotDone. Standard_EXPORT AppParCurves_MultiCurve BezierValue(); + //! returns the result of the approximation, i.e. all the + //! Curves. + //! An exception is raised if NotDone. Standard_EXPORT const AppParCurves_MultiBSpCurve& BSplineValue(); + //! returns the function matrix used to approximate the + //! set. Standard_EXPORT const math_Matrix& FunctionMatrix() const; + //! returns the derivative function matrix used + //! to approximate the set. Standard_EXPORT const math_Matrix& DerivativeFunctionMatrix() const; + //! returns the maximum errors between the MultiLine + //! and the approximation curves. F is the sum of the square + //! distances. Grad is the derivative vector of the + //! function F. Standard_EXPORT void ErrorGradient (math_Vector& Grad, Standard_Real& F, Standard_Real& MaxE3d, Standard_Real& MaxE2d); + //! returns the distances between the points of the + //! multiline and the approximation curves. Standard_EXPORT const math_Matrix& Distance(); + //! returns the maximum errors between the MultiLine + //! and the approximation curves. F is the sum of the square + //! distances. Standard_EXPORT void Error (Standard_Real& F, Standard_Real& MaxE3d, Standard_Real& MaxE2d); + //! returns the value (P2 - P1)/ V1 if the first point + //! was a tangency point. Standard_EXPORT Standard_Real FirstLambda() const; + //! returns the value (PN - PN-1)/ VN if the last point + //! was a tangency point. Standard_EXPORT Standard_Real LastLambda() const; + //! returns the matrix of points value. Standard_EXPORT const math_Matrix& Points() const; + //! returns the matrix of resulting control points value. Standard_EXPORT const math_Matrix& Poles() const; + //! Returns the indexes of the first non null values of + //! A and DA. + //! The values are non null from Index(ieme point) +1 + //! to Index(ieme point) + degree +1. Standard_EXPORT const math_IntegerVector& KIndex() const; @@ -100,24 +174,33 @@ public: protected: + //! is used by the constuctors above. Standard_EXPORT void Init (const GeomInt_TheMultiLineOfWLApprox& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint); + //! returns the number of second member columns. + //! Is used internally to initialize the fields. Standard_EXPORT Standard_Integer NbBColumns (const GeomInt_TheMultiLineOfWLApprox& SSP) const; + //! returns the first point beeing fitted. Standard_EXPORT Standard_Integer TheFirstPoint (const AppParCurves_Constraint FirstCons, const Standard_Integer FirstPoint) const; + //! returns the last point beeing fitted. Standard_EXPORT Standard_Integer TheLastPoint (const AppParCurves_Constraint LastCons, const Standard_Integer LastPoint) const; + //! Affects the fields in the case of a constraint point. Standard_EXPORT void Affect (const GeomInt_TheMultiLineOfWLApprox& SSP, const Standard_Integer Index, AppParCurves_Constraint& Cons, math_Vector& Vt, math_Vector& Vc); Standard_EXPORT void ComputeFunction (const math_Vector& Parameters); Standard_EXPORT void SearchIndex (math_IntegerVector& Index); + //! computes internal matrixes for the resolution Standard_EXPORT void MakeTAA (math_Vector& TheA, math_Vector& TheB); + //! computes internal matrixes for the resolution Standard_EXPORT void MakeTAA (math_Vector& TheA); + //! computes internal matrixes for the resolution Standard_EXPORT void MakeTAA (math_Vector& TheA, math_Matrix& TheB); diff --git a/src/GeomInt/GeomInt_MyBSplGradientOfTheComputeLineOfWLApprox.hxx b/src/GeomInt/GeomInt_MyBSplGradientOfTheComputeLineOfWLApprox.hxx index 9f641a62d0..f011a6fb6a 100644 --- a/src/GeomInt/GeomInt_MyBSplGradientOfTheComputeLineOfWLApprox.hxx +++ b/src/GeomInt/GeomInt_MyBSplGradientOfTheComputeLineOfWLApprox.hxx @@ -47,20 +47,45 @@ public: DEFINE_STANDARD_ALLOC + //! Tries to minimize the sum (square(||Qui - Bi*Pi||)) + //! where Pui describe the approximating BSpline curves'Poles + //! and Qi the MultiLine points with a parameter ui. + //! In this algorithm, the parameters ui are the unknowns. + //! The tolerance required on this sum is given by Tol. + //! The desired degree of the resulting curve is Deg. Standard_EXPORT GeomInt_MyBSplGradientOfTheComputeLineOfWLApprox(const GeomInt_TheMultiLineOfWLApprox& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, math_Vector& Parameters, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const Standard_Integer Deg, const Standard_Real Tol3d, const Standard_Real Tol2d, const Standard_Integer NbIterations = 1); + //! Tries to minimize the sum (square(||Qui - Bi*Pi||)) + //! where Pui describe the approximating BSpline curves'Poles + //! and Qi the MultiLine points with a parameter ui. + //! In this algorithm, the parameters ui are the unknowns. + //! The tolerance required on this sum is given by Tol. + //! The desired degree of the resulting curve is Deg. Standard_EXPORT GeomInt_MyBSplGradientOfTheComputeLineOfWLApprox(const GeomInt_TheMultiLineOfWLApprox& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, math_Vector& Parameters, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const Standard_Integer Deg, const Standard_Real Tol3d, const Standard_Real Tol2d, const Standard_Integer NbIterations, const Standard_Real lambda1, const Standard_Real lambda2); + //! returns True if all has been correctly done. Standard_EXPORT Standard_Boolean IsDone() const; + //! returns all the BSpline curves approximating the + //! MultiLine SSP after minimization of the parameter. Standard_EXPORT AppParCurves_MultiBSpCurve Value() const; + //! returns the difference between the old and the new + //! approximation. + //! An exception is raised if NotDone. + //! An exception is raised if Index<1 or Index>NbParameters. Standard_EXPORT Standard_Real Error (const Standard_Integer Index) const; + //! returns the maximum difference between the old and the + //! new approximation. Standard_EXPORT Standard_Real MaxError3d() const; + //! returns the maximum difference between the old and the + //! new approximation. Standard_EXPORT Standard_Real MaxError2d() const; + //! returns the average error between the old and the + //! new approximation. Standard_EXPORT Standard_Real AverageError() const; diff --git a/src/GeomInt/GeomInt_MyGradientOfTheComputeLineBezierOfWLApprox.hxx b/src/GeomInt/GeomInt_MyGradientOfTheComputeLineBezierOfWLApprox.hxx index 16f6a5e2f2..bdcfe5f03f 100644 --- a/src/GeomInt/GeomInt_MyGradientOfTheComputeLineBezierOfWLApprox.hxx +++ b/src/GeomInt/GeomInt_MyGradientOfTheComputeLineBezierOfWLApprox.hxx @@ -46,18 +46,37 @@ public: DEFINE_STANDARD_ALLOC + //! Tries to minimize the sum (square(||Qui - Bi*Pi||)) + //! where Pui describe the approximating Bezier curves'Poles + //! and Qi the MultiLine points with a parameter ui. + //! In this algorithm, the parameters ui are the unknowns. + //! The tolerance required on this sum is given by Tol. + //! The desired degree of the resulting curve is Deg. Standard_EXPORT GeomInt_MyGradientOfTheComputeLineBezierOfWLApprox(const GeomInt_TheMultiLineOfWLApprox& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, math_Vector& Parameters, const Standard_Integer Deg, const Standard_Real Tol3d, const Standard_Real Tol2d, const Standard_Integer NbIterations = 200); + //! returns True if all has been correctly done. Standard_EXPORT Standard_Boolean IsDone() const; + //! returns all the Bezier curves approximating the + //! MultiLine SSP after minimization of the parameter. Standard_EXPORT AppParCurves_MultiCurve Value() const; + //! returns the difference between the old and the new + //! approximation. + //! An exception is raised if NotDone. + //! An exception is raised if Index<1 or Index>NbParameters. Standard_EXPORT Standard_Real Error (const Standard_Integer Index) const; + //! returns the maximum difference between the old and the + //! new approximation. Standard_EXPORT Standard_Real MaxError3d() const; + //! returns the maximum difference between the old and the + //! new approximation. Standard_EXPORT Standard_Real MaxError2d() const; + //! returns the average error between the old and the + //! new approximation. Standard_EXPORT Standard_Real AverageError() const; diff --git a/src/GeomInt/GeomInt_MyGradientbisOfTheComputeLineOfWLApprox.hxx b/src/GeomInt/GeomInt_MyGradientbisOfTheComputeLineOfWLApprox.hxx index 83081b2f5e..48673ce7fe 100644 --- a/src/GeomInt/GeomInt_MyGradientbisOfTheComputeLineOfWLApprox.hxx +++ b/src/GeomInt/GeomInt_MyGradientbisOfTheComputeLineOfWLApprox.hxx @@ -46,18 +46,37 @@ public: DEFINE_STANDARD_ALLOC + //! Tries to minimize the sum (square(||Qui - Bi*Pi||)) + //! where Pui describe the approximating Bezier curves'Poles + //! and Qi the MultiLine points with a parameter ui. + //! In this algorithm, the parameters ui are the unknowns. + //! The tolerance required on this sum is given by Tol. + //! The desired degree of the resulting curve is Deg. Standard_EXPORT GeomInt_MyGradientbisOfTheComputeLineOfWLApprox(const GeomInt_TheMultiLineOfWLApprox& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, math_Vector& Parameters, const Standard_Integer Deg, const Standard_Real Tol3d, const Standard_Real Tol2d, const Standard_Integer NbIterations = 200); + //! returns True if all has been correctly done. Standard_EXPORT Standard_Boolean IsDone() const; + //! returns all the Bezier curves approximating the + //! MultiLine SSP after minimization of the parameter. Standard_EXPORT AppParCurves_MultiCurve Value() const; + //! returns the difference between the old and the new + //! approximation. + //! An exception is raised if NotDone. + //! An exception is raised if Index<1 or Index>NbParameters. Standard_EXPORT Standard_Real Error (const Standard_Integer Index) const; + //! returns the maximum difference between the old and the + //! new approximation. Standard_EXPORT Standard_Real MaxError3d() const; + //! returns the maximum difference between the old and the + //! new approximation. Standard_EXPORT Standard_Real MaxError2d() const; + //! returns the average error between the old and the + //! new approximation. Standard_EXPORT Standard_Real AverageError() const; diff --git a/src/GeomInt/GeomInt_ParFunctionOfMyGradientOfTheComputeLineBezierOfWLApprox.hxx b/src/GeomInt/GeomInt_ParFunctionOfMyGradientOfTheComputeLineBezierOfWLApprox.hxx index f3709857d8..81db734bbc 100644 --- a/src/GeomInt/GeomInt_ParFunctionOfMyGradientOfTheComputeLineBezierOfWLApprox.hxx +++ b/src/GeomInt/GeomInt_ParFunctionOfMyGradientOfTheComputeLineBezierOfWLApprox.hxx @@ -48,24 +48,45 @@ public: DEFINE_STANDARD_ALLOC + //! initializes the fields of the function. The approximating + //! curve has the desired degree Deg. Standard_EXPORT GeomInt_ParFunctionOfMyGradientOfTheComputeLineBezierOfWLApprox(const GeomInt_TheMultiLineOfWLApprox& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, const math_Vector& Parameters, const Standard_Integer Deg); + //! returns the number of variables of the function. It + //! corresponds to the number of MultiPoints. Standard_EXPORT Standard_Integer NbVariables() const; + //! this method computes the new approximation of the + //! MultiLine + //! SSP and calculates F = sum (||Pui - Bi*Pi||2) for each + //! point of the MultiLine. Standard_EXPORT Standard_Boolean Value (const math_Vector& X, Standard_Real& F); + //! returns the gradient G of the sum above for the + //! parameters Xi. Standard_EXPORT Standard_Boolean Gradient (const math_Vector& X, math_Vector& G); + //! returns the value F=sum(||Pui - Bi*Pi||)2. + //! returns the value G = grad(F) for the parameters Xi. Standard_EXPORT Standard_Boolean Values (const math_Vector& X, Standard_Real& F, math_Vector& G); + //! returns the new parameters of the MultiLine. Standard_EXPORT const math_Vector& NewParameters() const; + //! returns the MultiCurve approximating the set after + //! computing the value F or Grad(F). Standard_EXPORT const AppParCurves_MultiCurve& CurveValue(); + //! returns the distance between the MultiPoint of range + //! IPoint and the curve CurveIndex. Standard_EXPORT Standard_Real Error (const Standard_Integer IPoint, const Standard_Integer CurveIndex) const; + //! returns the maximum distance between the points + //! and the MultiCurve. Standard_EXPORT Standard_Real MaxError3d() const; + //! returns the maximum distance between the points + //! and the MultiCurve. Standard_EXPORT Standard_Real MaxError2d() const; Standard_EXPORT AppParCurves_Constraint FirstConstraint (const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, const Standard_Integer FirstPoint) const; @@ -78,6 +99,8 @@ public: protected: + //! this method is used each time Value or Gradient is + //! needed. Standard_EXPORT void Perform (const math_Vector& X); diff --git a/src/GeomInt/GeomInt_ParFunctionOfMyGradientbisOfTheComputeLineOfWLApprox.hxx b/src/GeomInt/GeomInt_ParFunctionOfMyGradientbisOfTheComputeLineOfWLApprox.hxx index 9fcca20819..4ba5f81ef5 100644 --- a/src/GeomInt/GeomInt_ParFunctionOfMyGradientbisOfTheComputeLineOfWLApprox.hxx +++ b/src/GeomInt/GeomInt_ParFunctionOfMyGradientbisOfTheComputeLineOfWLApprox.hxx @@ -48,24 +48,45 @@ public: DEFINE_STANDARD_ALLOC + //! initializes the fields of the function. The approximating + //! curve has the desired degree Deg. Standard_EXPORT GeomInt_ParFunctionOfMyGradientbisOfTheComputeLineOfWLApprox(const GeomInt_TheMultiLineOfWLApprox& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, const math_Vector& Parameters, const Standard_Integer Deg); + //! returns the number of variables of the function. It + //! corresponds to the number of MultiPoints. Standard_EXPORT Standard_Integer NbVariables() const; + //! this method computes the new approximation of the + //! MultiLine + //! SSP and calculates F = sum (||Pui - Bi*Pi||2) for each + //! point of the MultiLine. Standard_EXPORT Standard_Boolean Value (const math_Vector& X, Standard_Real& F); + //! returns the gradient G of the sum above for the + //! parameters Xi. Standard_EXPORT Standard_Boolean Gradient (const math_Vector& X, math_Vector& G); + //! returns the value F=sum(||Pui - Bi*Pi||)2. + //! returns the value G = grad(F) for the parameters Xi. Standard_EXPORT Standard_Boolean Values (const math_Vector& X, Standard_Real& F, math_Vector& G); + //! returns the new parameters of the MultiLine. Standard_EXPORT const math_Vector& NewParameters() const; + //! returns the MultiCurve approximating the set after + //! computing the value F or Grad(F). Standard_EXPORT const AppParCurves_MultiCurve& CurveValue(); + //! returns the distance between the MultiPoint of range + //! IPoint and the curve CurveIndex. Standard_EXPORT Standard_Real Error (const Standard_Integer IPoint, const Standard_Integer CurveIndex) const; + //! returns the maximum distance between the points + //! and the MultiCurve. Standard_EXPORT Standard_Real MaxError3d() const; + //! returns the maximum distance between the points + //! and the MultiCurve. Standard_EXPORT Standard_Real MaxError2d() const; Standard_EXPORT AppParCurves_Constraint FirstConstraint (const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, const Standard_Integer FirstPoint) const; @@ -78,6 +99,8 @@ public: protected: + //! this method is used each time Value or Gradient is + //! needed. Standard_EXPORT void Perform (const math_Vector& X); diff --git a/src/GeomInt/GeomInt_ParLeastSquareOfMyGradientOfTheComputeLineBezierOfWLApprox.hxx b/src/GeomInt/GeomInt_ParLeastSquareOfMyGradientOfTheComputeLineBezierOfWLApprox.hxx index b87fe62214..0626eab43d 100644 --- a/src/GeomInt/GeomInt_ParLeastSquareOfMyGradientOfTheComputeLineBezierOfWLApprox.hxx +++ b/src/GeomInt/GeomInt_ParLeastSquareOfMyGradientOfTheComputeLineBezierOfWLApprox.hxx @@ -52,46 +52,120 @@ public: DEFINE_STANDARD_ALLOC + //! given a MultiLine, this algorithm computes the least + //! square resolution using the Householder-QR method. + //! If the first and/or the last point is a constraint + //! point, the value of the tangency or curvature is + //! computed in the resolution. + //! NbPol is the number of control points wanted + //! for the approximating curves. + //! The system to solve is the following: + //! A X = B. + //! Where A is the Bernstein matrix computed with the + //! parameters, B the points coordinates and X the poles + //! solutions. + //! The matrix A is the same for each coordinate x, y and z + //! and is also the same for each MultiLine point because + //! they are approximated in parallel(so with the same + //! parameter, only the vector B changes). Standard_EXPORT GeomInt_ParLeastSquareOfMyGradientOfTheComputeLineBezierOfWLApprox(const GeomInt_TheMultiLineOfWLApprox& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const AppParCurves_Constraint FirstCons, const AppParCurves_Constraint LastCons, const math_Vector& Parameters, const Standard_Integer NbPol); + //! Initializes the fields of the object. Standard_EXPORT GeomInt_ParLeastSquareOfMyGradientOfTheComputeLineBezierOfWLApprox(const GeomInt_TheMultiLineOfWLApprox& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const AppParCurves_Constraint FirstCons, const AppParCurves_Constraint LastCons, const Standard_Integer NbPol); + //! given a MultiLine, this algorithm computes the least + //! square resolution using the Householder-QR method. + //! If the first and/or the last point is a constraint + //! point, the value of the tangency or curvature is + //! computed in the resolution. + //! Deg is the degree wanted for the approximating curves. + //! The system to solve is the following: + //! A X = B. + //! Where A is the BSpline functions matrix computed with + //! , B the points coordinates and X the poles + //! solutions. + //! The matrix A is the same for each coordinate x, y and z + //! and is also the same for each MultiLine point because + //! they are approximated in parallel(so with the same + //! parameter, only the vector B changes). Standard_EXPORT GeomInt_ParLeastSquareOfMyGradientOfTheComputeLineBezierOfWLApprox(const GeomInt_TheMultiLineOfWLApprox& SSP, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const AppParCurves_Constraint FirstCons, const AppParCurves_Constraint LastCons, const math_Vector& Parameters, const Standard_Integer NbPol); + //! Initializes the fields of the object. Standard_EXPORT GeomInt_ParLeastSquareOfMyGradientOfTheComputeLineBezierOfWLApprox(const GeomInt_TheMultiLineOfWLApprox& SSP, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const AppParCurves_Constraint FirstCons, const AppParCurves_Constraint LastCons, const Standard_Integer NbPol); + //! Is used after having initialized the fields. + //! The case "CurvaturePoint" is not treated in this method. Standard_EXPORT void Perform (const math_Vector& Parameters); + //! Is used after having initialized the fields. Standard_EXPORT void Perform (const math_Vector& Parameters, const Standard_Real l1, const Standard_Real l2); + //! Is used after having initialized the fields. + //! is the tangent vector at the first point. + //! is the tangent vector at the last point. Standard_EXPORT void Perform (const math_Vector& Parameters, const math_Vector& V1t, const math_Vector& V2t, const Standard_Real l1, const Standard_Real l2); + //! Is used after having initialized the fields. + //! is the tangent vector at the first point. + //! is the tangent vector at the last point. + //! is the tangent vector at the first point. + //! is the tangent vector at the last point. Standard_EXPORT void Perform (const math_Vector& Parameters, const math_Vector& V1t, const math_Vector& V2t, const math_Vector& V1c, const math_Vector& V2c, const Standard_Real l1, const Standard_Real l2); + //! returns True if all has been correctly done. Standard_EXPORT Standard_Boolean IsDone() const; + //! returns the result of the approximation, i.e. all the + //! Curves. + //! An exception is raised if NotDone. Standard_EXPORT AppParCurves_MultiCurve BezierValue(); + //! returns the result of the approximation, i.e. all the + //! Curves. + //! An exception is raised if NotDone. Standard_EXPORT const AppParCurves_MultiBSpCurve& BSplineValue(); + //! returns the function matrix used to approximate the + //! set. Standard_EXPORT const math_Matrix& FunctionMatrix() const; + //! returns the derivative function matrix used + //! to approximate the set. Standard_EXPORT const math_Matrix& DerivativeFunctionMatrix() const; + //! returns the maximum errors between the MultiLine + //! and the approximation curves. F is the sum of the square + //! distances. Grad is the derivative vector of the + //! function F. Standard_EXPORT void ErrorGradient (math_Vector& Grad, Standard_Real& F, Standard_Real& MaxE3d, Standard_Real& MaxE2d); + //! returns the distances between the points of the + //! multiline and the approximation curves. Standard_EXPORT const math_Matrix& Distance(); + //! returns the maximum errors between the MultiLine + //! and the approximation curves. F is the sum of the square + //! distances. Standard_EXPORT void Error (Standard_Real& F, Standard_Real& MaxE3d, Standard_Real& MaxE2d); + //! returns the value (P2 - P1)/ V1 if the first point + //! was a tangency point. Standard_EXPORT Standard_Real FirstLambda() const; + //! returns the value (PN - PN-1)/ VN if the last point + //! was a tangency point. Standard_EXPORT Standard_Real LastLambda() const; + //! returns the matrix of points value. Standard_EXPORT const math_Matrix& Points() const; + //! returns the matrix of resulting control points value. Standard_EXPORT const math_Matrix& Poles() const; + //! Returns the indexes of the first non null values of + //! A and DA. + //! The values are non null from Index(ieme point) +1 + //! to Index(ieme point) + degree +1. Standard_EXPORT const math_IntegerVector& KIndex() const; @@ -100,24 +174,33 @@ public: protected: + //! is used by the constuctors above. Standard_EXPORT void Init (const GeomInt_TheMultiLineOfWLApprox& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint); + //! returns the number of second member columns. + //! Is used internally to initialize the fields. Standard_EXPORT Standard_Integer NbBColumns (const GeomInt_TheMultiLineOfWLApprox& SSP) const; + //! returns the first point beeing fitted. Standard_EXPORT Standard_Integer TheFirstPoint (const AppParCurves_Constraint FirstCons, const Standard_Integer FirstPoint) const; + //! returns the last point beeing fitted. Standard_EXPORT Standard_Integer TheLastPoint (const AppParCurves_Constraint LastCons, const Standard_Integer LastPoint) const; + //! Affects the fields in the case of a constraint point. Standard_EXPORT void Affect (const GeomInt_TheMultiLineOfWLApprox& SSP, const Standard_Integer Index, AppParCurves_Constraint& Cons, math_Vector& Vt, math_Vector& Vc); Standard_EXPORT void ComputeFunction (const math_Vector& Parameters); Standard_EXPORT void SearchIndex (math_IntegerVector& Index); + //! computes internal matrixes for the resolution Standard_EXPORT void MakeTAA (math_Vector& TheA, math_Vector& TheB); + //! computes internal matrixes for the resolution Standard_EXPORT void MakeTAA (math_Vector& TheA); + //! computes internal matrixes for the resolution Standard_EXPORT void MakeTAA (math_Vector& TheA, math_Matrix& TheB); diff --git a/src/GeomInt/GeomInt_ParLeastSquareOfMyGradientbisOfTheComputeLineOfWLApprox.hxx b/src/GeomInt/GeomInt_ParLeastSquareOfMyGradientbisOfTheComputeLineOfWLApprox.hxx index b38a66183d..89cf8a8ce2 100644 --- a/src/GeomInt/GeomInt_ParLeastSquareOfMyGradientbisOfTheComputeLineOfWLApprox.hxx +++ b/src/GeomInt/GeomInt_ParLeastSquareOfMyGradientbisOfTheComputeLineOfWLApprox.hxx @@ -52,46 +52,120 @@ public: DEFINE_STANDARD_ALLOC + //! given a MultiLine, this algorithm computes the least + //! square resolution using the Householder-QR method. + //! If the first and/or the last point is a constraint + //! point, the value of the tangency or curvature is + //! computed in the resolution. + //! NbPol is the number of control points wanted + //! for the approximating curves. + //! The system to solve is the following: + //! A X = B. + //! Where A is the Bernstein matrix computed with the + //! parameters, B the points coordinates and X the poles + //! solutions. + //! The matrix A is the same for each coordinate x, y and z + //! and is also the same for each MultiLine point because + //! they are approximated in parallel(so with the same + //! parameter, only the vector B changes). Standard_EXPORT GeomInt_ParLeastSquareOfMyGradientbisOfTheComputeLineOfWLApprox(const GeomInt_TheMultiLineOfWLApprox& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const AppParCurves_Constraint FirstCons, const AppParCurves_Constraint LastCons, const math_Vector& Parameters, const Standard_Integer NbPol); + //! Initializes the fields of the object. Standard_EXPORT GeomInt_ParLeastSquareOfMyGradientbisOfTheComputeLineOfWLApprox(const GeomInt_TheMultiLineOfWLApprox& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const AppParCurves_Constraint FirstCons, const AppParCurves_Constraint LastCons, const Standard_Integer NbPol); + //! given a MultiLine, this algorithm computes the least + //! square resolution using the Householder-QR method. + //! If the first and/or the last point is a constraint + //! point, the value of the tangency or curvature is + //! computed in the resolution. + //! Deg is the degree wanted for the approximating curves. + //! The system to solve is the following: + //! A X = B. + //! Where A is the BSpline functions matrix computed with + //! , B the points coordinates and X the poles + //! solutions. + //! The matrix A is the same for each coordinate x, y and z + //! and is also the same for each MultiLine point because + //! they are approximated in parallel(so with the same + //! parameter, only the vector B changes). Standard_EXPORT GeomInt_ParLeastSquareOfMyGradientbisOfTheComputeLineOfWLApprox(const GeomInt_TheMultiLineOfWLApprox& SSP, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const AppParCurves_Constraint FirstCons, const AppParCurves_Constraint LastCons, const math_Vector& Parameters, const Standard_Integer NbPol); + //! Initializes the fields of the object. Standard_EXPORT GeomInt_ParLeastSquareOfMyGradientbisOfTheComputeLineOfWLApprox(const GeomInt_TheMultiLineOfWLApprox& SSP, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const AppParCurves_Constraint FirstCons, const AppParCurves_Constraint LastCons, const Standard_Integer NbPol); + //! Is used after having initialized the fields. + //! The case "CurvaturePoint" is not treated in this method. Standard_EXPORT void Perform (const math_Vector& Parameters); + //! Is used after having initialized the fields. Standard_EXPORT void Perform (const math_Vector& Parameters, const Standard_Real l1, const Standard_Real l2); + //! Is used after having initialized the fields. + //! is the tangent vector at the first point. + //! is the tangent vector at the last point. Standard_EXPORT void Perform (const math_Vector& Parameters, const math_Vector& V1t, const math_Vector& V2t, const Standard_Real l1, const Standard_Real l2); + //! Is used after having initialized the fields. + //! is the tangent vector at the first point. + //! is the tangent vector at the last point. + //! is the tangent vector at the first point. + //! is the tangent vector at the last point. Standard_EXPORT void Perform (const math_Vector& Parameters, const math_Vector& V1t, const math_Vector& V2t, const math_Vector& V1c, const math_Vector& V2c, const Standard_Real l1, const Standard_Real l2); + //! returns True if all has been correctly done. Standard_EXPORT Standard_Boolean IsDone() const; + //! returns the result of the approximation, i.e. all the + //! Curves. + //! An exception is raised if NotDone. Standard_EXPORT AppParCurves_MultiCurve BezierValue(); + //! returns the result of the approximation, i.e. all the + //! Curves. + //! An exception is raised if NotDone. Standard_EXPORT const AppParCurves_MultiBSpCurve& BSplineValue(); + //! returns the function matrix used to approximate the + //! set. Standard_EXPORT const math_Matrix& FunctionMatrix() const; + //! returns the derivative function matrix used + //! to approximate the set. Standard_EXPORT const math_Matrix& DerivativeFunctionMatrix() const; + //! returns the maximum errors between the MultiLine + //! and the approximation curves. F is the sum of the square + //! distances. Grad is the derivative vector of the + //! function F. Standard_EXPORT void ErrorGradient (math_Vector& Grad, Standard_Real& F, Standard_Real& MaxE3d, Standard_Real& MaxE2d); + //! returns the distances between the points of the + //! multiline and the approximation curves. Standard_EXPORT const math_Matrix& Distance(); + //! returns the maximum errors between the MultiLine + //! and the approximation curves. F is the sum of the square + //! distances. Standard_EXPORT void Error (Standard_Real& F, Standard_Real& MaxE3d, Standard_Real& MaxE2d); + //! returns the value (P2 - P1)/ V1 if the first point + //! was a tangency point. Standard_EXPORT Standard_Real FirstLambda() const; + //! returns the value (PN - PN-1)/ VN if the last point + //! was a tangency point. Standard_EXPORT Standard_Real LastLambda() const; + //! returns the matrix of points value. Standard_EXPORT const math_Matrix& Points() const; + //! returns the matrix of resulting control points value. Standard_EXPORT const math_Matrix& Poles() const; + //! Returns the indexes of the first non null values of + //! A and DA. + //! The values are non null from Index(ieme point) +1 + //! to Index(ieme point) + degree +1. Standard_EXPORT const math_IntegerVector& KIndex() const; @@ -100,24 +174,33 @@ public: protected: + //! is used by the constuctors above. Standard_EXPORT void Init (const GeomInt_TheMultiLineOfWLApprox& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint); + //! returns the number of second member columns. + //! Is used internally to initialize the fields. Standard_EXPORT Standard_Integer NbBColumns (const GeomInt_TheMultiLineOfWLApprox& SSP) const; + //! returns the first point beeing fitted. Standard_EXPORT Standard_Integer TheFirstPoint (const AppParCurves_Constraint FirstCons, const Standard_Integer FirstPoint) const; + //! returns the last point beeing fitted. Standard_EXPORT Standard_Integer TheLastPoint (const AppParCurves_Constraint LastCons, const Standard_Integer LastPoint) const; + //! Affects the fields in the case of a constraint point. Standard_EXPORT void Affect (const GeomInt_TheMultiLineOfWLApprox& SSP, const Standard_Integer Index, AppParCurves_Constraint& Cons, math_Vector& Vt, math_Vector& Vc); Standard_EXPORT void ComputeFunction (const math_Vector& Parameters); Standard_EXPORT void SearchIndex (math_IntegerVector& Index); + //! computes internal matrixes for the resolution Standard_EXPORT void MakeTAA (math_Vector& TheA, math_Vector& TheB); + //! computes internal matrixes for the resolution Standard_EXPORT void MakeTAA (math_Vector& TheA); + //! computes internal matrixes for the resolution Standard_EXPORT void MakeTAA (math_Vector& TheA, math_Matrix& TheB); diff --git a/src/GeomInt/GeomInt_ResConstraintOfMyGradientOfTheComputeLineBezierOfWLApprox.hxx b/src/GeomInt/GeomInt_ResConstraintOfMyGradientOfTheComputeLineBezierOfWLApprox.hxx index ccbeb75b65..9c8be59fd2 100644 --- a/src/GeomInt/GeomInt_ResConstraintOfMyGradientOfTheComputeLineBezierOfWLApprox.hxx +++ b/src/GeomInt/GeomInt_ResConstraintOfMyGradientOfTheComputeLineBezierOfWLApprox.hxx @@ -43,18 +43,35 @@ public: DEFINE_STANDARD_ALLOC + //! Given a MultiLine SSP with constraints points, this + //! algorithm finds the best curve solution to approximate it. + //! The poles from SCurv issued for example from the least + //! squares are used as a guess solution for the uzawa + //! algorithm. The tolerance used in the Uzawa algorithms + //! is Tolerance. + //! A is the Bernstein matrix associated to the MultiLine + //! and DA is the derivative bernstein matrix.(They can come + //! from an approximation with ParLeastSquare.) + //! The MultiCurve is modified. New MultiPoles are given. Standard_EXPORT GeomInt_ResConstraintOfMyGradientOfTheComputeLineBezierOfWLApprox(const GeomInt_TheMultiLineOfWLApprox& SSP, AppParCurves_MultiCurve& SCurv, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& Constraints, const math_Matrix& Bern, const math_Matrix& DerivativeBern, const Standard_Real Tolerance = 1.0e-10); + //! returns True if all has been correctly done. Standard_EXPORT Standard_Boolean IsDone() const; + //! returns the maximum difference value between the curve + //! and the given points. Standard_EXPORT Standard_Real Error() const; Standard_EXPORT const math_Matrix& ConstraintMatrix() const; + //! returns the duale variables of the system. Standard_EXPORT const math_Vector& Duale() const; + //! Returns the derivative of the constraint matrix. Standard_EXPORT const math_Matrix& ConstraintDerivative (const GeomInt_TheMultiLineOfWLApprox& SSP, const math_Vector& Parameters, const Standard_Integer Deg, const math_Matrix& DA); + //! returns the Inverse of Cont*Transposed(Cont), where + //! Cont is the constraint matrix for the algorithm. Standard_EXPORT const math_Matrix& InverseMatrix() const; @@ -63,8 +80,10 @@ public: protected: + //! is used internally to create the fields. Standard_EXPORT Standard_Integer NbConstraints (const GeomInt_TheMultiLineOfWLApprox& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints) const; + //! is internally used for the fields creation. Standard_EXPORT Standard_Integer NbColumns (const GeomInt_TheMultiLineOfWLApprox& SSP, const Standard_Integer Deg) const; diff --git a/src/GeomInt/GeomInt_ResConstraintOfMyGradientbisOfTheComputeLineOfWLApprox.hxx b/src/GeomInt/GeomInt_ResConstraintOfMyGradientbisOfTheComputeLineOfWLApprox.hxx index e96bc880ec..e9398dcb73 100644 --- a/src/GeomInt/GeomInt_ResConstraintOfMyGradientbisOfTheComputeLineOfWLApprox.hxx +++ b/src/GeomInt/GeomInt_ResConstraintOfMyGradientbisOfTheComputeLineOfWLApprox.hxx @@ -43,18 +43,35 @@ public: DEFINE_STANDARD_ALLOC + //! Given a MultiLine SSP with constraints points, this + //! algorithm finds the best curve solution to approximate it. + //! The poles from SCurv issued for example from the least + //! squares are used as a guess solution for the uzawa + //! algorithm. The tolerance used in the Uzawa algorithms + //! is Tolerance. + //! A is the Bernstein matrix associated to the MultiLine + //! and DA is the derivative bernstein matrix.(They can come + //! from an approximation with ParLeastSquare.) + //! The MultiCurve is modified. New MultiPoles are given. Standard_EXPORT GeomInt_ResConstraintOfMyGradientbisOfTheComputeLineOfWLApprox(const GeomInt_TheMultiLineOfWLApprox& SSP, AppParCurves_MultiCurve& SCurv, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& Constraints, const math_Matrix& Bern, const math_Matrix& DerivativeBern, const Standard_Real Tolerance = 1.0e-10); + //! returns True if all has been correctly done. Standard_EXPORT Standard_Boolean IsDone() const; + //! returns the maximum difference value between the curve + //! and the given points. Standard_EXPORT Standard_Real Error() const; Standard_EXPORT const math_Matrix& ConstraintMatrix() const; + //! returns the duale variables of the system. Standard_EXPORT const math_Vector& Duale() const; + //! Returns the derivative of the constraint matrix. Standard_EXPORT const math_Matrix& ConstraintDerivative (const GeomInt_TheMultiLineOfWLApprox& SSP, const math_Vector& Parameters, const Standard_Integer Deg, const math_Matrix& DA); + //! returns the Inverse of Cont*Transposed(Cont), where + //! Cont is the constraint matrix for the algorithm. Standard_EXPORT const math_Matrix& InverseMatrix() const; @@ -63,8 +80,10 @@ public: protected: + //! is used internally to create the fields. Standard_EXPORT Standard_Integer NbConstraints (const GeomInt_TheMultiLineOfWLApprox& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints) const; + //! is internally used for the fields creation. Standard_EXPORT Standard_Integer NbColumns (const GeomInt_TheMultiLineOfWLApprox& SSP, const Standard_Integer Deg) const; diff --git a/src/GeomInt/GeomInt_TheComputeLineBezierOfWLApprox.hxx b/src/GeomInt/GeomInt_TheComputeLineBezierOfWLApprox.hxx index c34938c288..aa296ca796 100644 --- a/src/GeomInt/GeomInt_TheComputeLineBezierOfWLApprox.hxx +++ b/src/GeomInt/GeomInt_TheComputeLineBezierOfWLApprox.hxx @@ -54,40 +54,72 @@ public: DEFINE_STANDARD_ALLOC + //! The MultiLine will be approximated until tolerances + //! will be reached. + //! The approximation will be done from degreemin to degreemax + //! with a cutting if the corresponding boolean is True. + //! If is True, the computation will be done with + //! no iteration at all. Standard_EXPORT GeomInt_TheComputeLineBezierOfWLApprox(const GeomInt_TheMultiLineOfWLApprox& Line, const Standard_Integer degreemin = 4, const Standard_Integer degreemax = 8, const Standard_Real Tolerance3d = 1.0e-3, const Standard_Real Tolerance2d = 1.0e-6, const Standard_Integer NbIterations = 5, const Standard_Boolean cutting = Standard_True, const Approx_ParametrizationType parametrization = Approx_ChordLength, const Standard_Boolean Squares = Standard_False); + //! The MultiLine will be approximated until tolerances + //! will be reached. + //! The approximation will be done from degreemin to degreemax + //! with a cutting if the corresponding boolean is True. + //! If is True, the computation will be done with + //! no iteration at all. Standard_EXPORT GeomInt_TheComputeLineBezierOfWLApprox(const GeomInt_TheMultiLineOfWLApprox& Line, const math_Vector& Parameters, const Standard_Integer degreemin = 4, const Standard_Integer degreemax = 8, const Standard_Real Tolerance3d = 1.0e-03, const Standard_Real Tolerance2d = 1.0e-06, const Standard_Integer NbIterations = 5, const Standard_Boolean cutting = Standard_True, const Standard_Boolean Squares = Standard_False); + //! Initializes the fields of the algorithm. Standard_EXPORT GeomInt_TheComputeLineBezierOfWLApprox(const math_Vector& Parameters, const Standard_Integer degreemin = 4, const Standard_Integer degreemax = 8, const Standard_Real Tolerance3d = 1.0e-03, const Standard_Real Tolerance2d = 1.0e-06, const Standard_Integer NbIterations = 5, const Standard_Boolean cutting = Standard_True, const Standard_Boolean Squares = Standard_False); + //! Initializes the fields of the algorithm. Standard_EXPORT GeomInt_TheComputeLineBezierOfWLApprox(const Standard_Integer degreemin = 4, const Standard_Integer degreemax = 8, const Standard_Real Tolerance3d = 1.0e-03, const Standard_Real Tolerance2d = 1.0e-06, const Standard_Integer NbIterations = 5, const Standard_Boolean cutting = Standard_True, const Approx_ParametrizationType parametrization = Approx_ChordLength, const Standard_Boolean Squares = Standard_False); + //! Initializes the fields of the algorithm. Standard_EXPORT void Init (const Standard_Integer degreemin = 4, const Standard_Integer degreemax = 8, const Standard_Real Tolerance3d = 1.0e-03, const Standard_Real Tolerance2d = 1.0e-06, const Standard_Integer NbIterations = 5, const Standard_Boolean cutting = Standard_True, const Approx_ParametrizationType parametrization = Approx_ChordLength, const Standard_Boolean Squares = Standard_False); + //! runs the algorithm after having initialized the fields. Standard_EXPORT void Perform (const GeomInt_TheMultiLineOfWLApprox& Line); + //! changes the degrees of the approximation. Standard_EXPORT void SetDegrees (const Standard_Integer degreemin, const Standard_Integer degreemax); + //! Changes the tolerances of the approximation. Standard_EXPORT void SetTolerances (const Standard_Real Tolerance3d, const Standard_Real Tolerance2d); + //! changes the first and the last constraint points. Standard_EXPORT void SetConstraints (const AppParCurves_Constraint firstC, const AppParCurves_Constraint lastC); + //! returns False if at a moment of the approximation, + //! the status NoApproximation has been sent by the user + //! when more points were needed. Standard_EXPORT Standard_Boolean IsAllApproximated() const; + //! returns False if the status NoPointsAdded has been sent. Standard_EXPORT Standard_Boolean IsToleranceReached() const; + //! returns the tolerances 2d and 3d of the MultiCurve. Standard_EXPORT void Error (const Standard_Integer Index, Standard_Real& tol3d, Standard_Real& tol2d) const; + //! Returns the number of MultiCurve doing the approximation + //! of the MultiLine. Standard_EXPORT Standard_Integer NbMultiCurves() const; + //! returns the result of the approximation. Standard_EXPORT const AppParCurves_MultiCurve& Value (const Standard_Integer Index = 1) const; + //! returns the result of the approximation. Standard_EXPORT AppParCurves_MultiCurve& ChangeValue (const Standard_Integer Index = 1); + //! returns the result of the approximation. Standard_EXPORT const AppParCurves_MultiBSpCurve& SplineValue(); + //! returns the type of parametrization Standard_EXPORT void Parametrization (Approx_ParametrizationType& partype) const; + //! returns the new parameters of the approximation + //! corresponding to the points of the multicurve . Standard_EXPORT const TColStd_Array1OfReal& Parameters (const Standard_Integer Index = 1) const; @@ -102,10 +134,13 @@ protected: private: + //! is internally used in the algorithm. Standard_EXPORT Standard_Boolean Compute (const GeomInt_TheMultiLineOfWLApprox& Line, const Standard_Integer fpt, const Standard_Integer lpt, math_Vector& Para, Standard_Real& TheTol3d, Standard_Real& TheTol2d); + //! is internally used in the algorithm. Standard_EXPORT Standard_Boolean ComputeCurve (const GeomInt_TheMultiLineOfWLApprox& Line, const Standard_Integer firspt, const Standard_Integer lastpt); + //! computes new parameters between firstP and lastP. Standard_EXPORT void Parameters (const GeomInt_TheMultiLineOfWLApprox& Line, const Standard_Integer firstP, const Standard_Integer LastP, math_Vector& TheParameters) const; Standard_EXPORT Standard_Real SearchFirstLambda (const GeomInt_TheMultiLineOfWLApprox& Line, const math_Vector& Para, const math_Vector& V, const Standard_Integer index) const; diff --git a/src/GeomInt/GeomInt_TheComputeLineOfWLApprox.hxx b/src/GeomInt/GeomInt_TheComputeLineOfWLApprox.hxx index 54053861ce..b3a6e971e4 100644 --- a/src/GeomInt/GeomInt_TheComputeLineOfWLApprox.hxx +++ b/src/GeomInt/GeomInt_TheComputeLineOfWLApprox.hxx @@ -56,44 +56,86 @@ public: DEFINE_STANDARD_ALLOC + //! The MultiLine will be approximated until tolerances + //! will be reached. + //! The approximation will be done from degreemin to degreemax + //! with a cutting if the corresponding boolean is True. + //! If is True, the computation will be done with + //! no iteration at all. + //! + //! The multiplicities of the internal knots is set by + //! default. Standard_EXPORT GeomInt_TheComputeLineOfWLApprox(const GeomInt_TheMultiLineOfWLApprox& Line, const Standard_Integer degreemin = 4, const Standard_Integer degreemax = 8, const Standard_Real Tolerance3d = 1.0e-3, const Standard_Real Tolerance2d = 1.0e-6, const Standard_Integer NbIterations = 5, const Standard_Boolean cutting = Standard_True, const Approx_ParametrizationType parametrization = Approx_ChordLength, const Standard_Boolean Squares = Standard_False); + //! The MultiLine will be approximated until tolerances + //! will be reached. + //! The approximation will be done from degreemin to degreemax + //! with a cutting if the corresponding boolean is True. + //! If is True, the computation will be done with + //! no iteration at all. Standard_EXPORT GeomInt_TheComputeLineOfWLApprox(const GeomInt_TheMultiLineOfWLApprox& Line, const math_Vector& Parameters, const Standard_Integer degreemin = 4, const Standard_Integer degreemax = 8, const Standard_Real Tolerance3d = 1.0e-03, const Standard_Real Tolerance2d = 1.0e-06, const Standard_Integer NbIterations = 5, const Standard_Boolean cutting = Standard_True, const Standard_Boolean Squares = Standard_False); + //! Initializes the fields of the algorithm. Standard_EXPORT GeomInt_TheComputeLineOfWLApprox(const math_Vector& Parameters, const Standard_Integer degreemin = 4, const Standard_Integer degreemax = 8, const Standard_Real Tolerance3d = 1.0e-03, const Standard_Real Tolerance2d = 1.0e-06, const Standard_Integer NbIterations = 5, const Standard_Boolean cutting = Standard_True, const Standard_Boolean Squares = Standard_False); + //! Initializes the fields of the algorithm. Standard_EXPORT GeomInt_TheComputeLineOfWLApprox(const Standard_Integer degreemin = 4, const Standard_Integer degreemax = 8, const Standard_Real Tolerance3d = 1.0e-03, const Standard_Real Tolerance2d = 1.0e-06, const Standard_Integer NbIterations = 5, const Standard_Boolean cutting = Standard_True, const Approx_ParametrizationType parametrization = Approx_ChordLength, const Standard_Boolean Squares = Standard_False); + //! Constructs an interpolation of the MultiLine + //! The result will be a C2 curve of degree 3. Standard_EXPORT void Interpol (const GeomInt_TheMultiLineOfWLApprox& Line); + //! Initializes the fields of the algorithm. Standard_EXPORT void Init (const Standard_Integer degreemin = 4, const Standard_Integer degreemax = 8, const Standard_Real Tolerance3d = 1.0e-03, const Standard_Real Tolerance2d = 1.0e-06, const Standard_Integer NbIterations = 5, const Standard_Boolean cutting = Standard_True, const Approx_ParametrizationType parametrization = Approx_ChordLength, const Standard_Boolean Squares = Standard_False); + //! runs the algorithm after having initialized the fields. Standard_EXPORT void Perform (const GeomInt_TheMultiLineOfWLApprox& Line); + //! The approximation will begin with the + //! set of parameters . Standard_EXPORT void SetParameters (const math_Vector& ThePar); + //! The approximation will be done with the + //! set of knots . The multiplicities will be set + //! with the degree and the desired continuity. Standard_EXPORT void SetKnots (const TColStd_Array1OfReal& Knots); + //! The approximation will be done with the + //! set of knots and the multiplicities . Standard_EXPORT void SetKnotsAndMultiplicities (const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults); + //! changes the degrees of the approximation. Standard_EXPORT void SetDegrees (const Standard_Integer degreemin, const Standard_Integer degreemax); + //! Changes the tolerances of the approximation. Standard_EXPORT void SetTolerances (const Standard_Real Tolerance3d, const Standard_Real Tolerance2d); + //! sets the continuity of the spline. + //! if C = 2, the spline will be C2. Standard_EXPORT void SetContinuity (const Standard_Integer C); + //! changes the first and the last constraint points. Standard_EXPORT void SetConstraints (const AppParCurves_Constraint firstC, const AppParCurves_Constraint lastC); + //! returns False if at a moment of the approximation, + //! the status NoApproximation has been sent by the user + //! when more points were needed. Standard_EXPORT Standard_Boolean IsAllApproximated() const; + //! returns False if the status NoPointsAdded has been sent. Standard_EXPORT Standard_Boolean IsToleranceReached() const; + //! returns the tolerances 2d and 3d of the MultiBSpCurve. Standard_EXPORT void Error (Standard_Real& tol3d, Standard_Real& tol2d) const; + //! returns the result of the approximation. Standard_EXPORT const AppParCurves_MultiBSpCurve& Value() const; + //! returns the result of the approximation. Standard_EXPORT AppParCurves_MultiBSpCurve& ChangeValue(); + //! returns the new parameters of the approximation + //! corresponding to the points of the MultiBSpCurve. Standard_EXPORT const TColStd_Array1OfReal& Parameters() const; @@ -108,10 +150,13 @@ protected: private: + //! is internally used in the algorithm. Standard_EXPORT Standard_Boolean Compute (const GeomInt_TheMultiLineOfWLApprox& Line, const Standard_Integer fpt, const Standard_Integer lpt, math_Vector& Para, const TColStd_Array1OfReal& Knots, TColStd_Array1OfInteger& Mults); + //! is internally used in the algorithm. Standard_EXPORT Standard_Boolean ComputeCurve (const GeomInt_TheMultiLineOfWLApprox& Line, const Standard_Integer firspt, const Standard_Integer lastpt); + //! computes new parameters between firstP and lastP. Standard_EXPORT void Parameters (const GeomInt_TheMultiLineOfWLApprox& Line, const Standard_Integer firstP, const Standard_Integer LastP, math_Vector& TheParameters) const; Standard_EXPORT Standard_Real SearchFirstLambda (const GeomInt_TheMultiLineOfWLApprox& Line, const math_Vector& Para, const TColStd_Array1OfReal& Knots, const math_Vector& V, const Standard_Integer index) const; diff --git a/src/GeomInt/GeomInt_TheFunctionOfTheInt2SOfThePrmPrmSvSurfacesOfWLApprox.hxx b/src/GeomInt/GeomInt_TheFunctionOfTheInt2SOfThePrmPrmSvSurfacesOfWLApprox.hxx index 2be9d939dd..bafa4a00e8 100644 --- a/src/GeomInt/GeomInt_TheFunctionOfTheInt2SOfThePrmPrmSvSurfacesOfWLApprox.hxx +++ b/src/GeomInt/GeomInt_TheFunctionOfTheInt2SOfThePrmPrmSvSurfacesOfWLApprox.hxx @@ -48,6 +48,7 @@ public: DEFINE_STANDARD_ALLOC + //! Raises Construction Error Standard_EXPORT GeomInt_TheFunctionOfTheInt2SOfThePrmPrmSvSurfacesOfWLApprox(); Standard_EXPORT GeomInt_TheFunctionOfTheInt2SOfThePrmPrmSvSurfacesOfWLApprox(const Handle(Adaptor3d_HSurface)& S1, const Handle(Adaptor3d_HSurface)& S2); @@ -64,6 +65,7 @@ public: Standard_EXPORT void ComputeParameters (const IntImp_ConstIsoparametric ChoixIso, const TColStd_Array1OfReal& Param, math_Vector& UVap, math_Vector& BornInf, math_Vector& BornSup, math_Vector& Tolerance); + //! returns somme des fi*fi Standard_Real Root() const; gp_Pnt Point() const; diff --git a/src/GeomInt/GeomInt_TheImpPrmSvSurfacesOfWLApprox.hxx b/src/GeomInt/GeomInt_TheImpPrmSvSurfacesOfWLApprox.hxx index 7fef1f8005..6fd664e90d 100644 --- a/src/GeomInt/GeomInt_TheImpPrmSvSurfacesOfWLApprox.hxx +++ b/src/GeomInt/GeomInt_TheImpPrmSvSurfacesOfWLApprox.hxx @@ -52,6 +52,7 @@ public: Standard_EXPORT GeomInt_TheImpPrmSvSurfacesOfWLApprox(const IntSurf_Quadric& Surf1, const Handle(Adaptor3d_HSurface)& Surf2); + //! returns True if Tg,Tguv1 Tguv2 can be computed. Standard_EXPORT Standard_Boolean Compute (Standard_Real& u1, Standard_Real& v1, Standard_Real& u2, Standard_Real& v2, gp_Pnt& Pt, gp_Vec& Tg, gp_Vec2d& Tguv1, gp_Vec2d& Tguv2); Standard_EXPORT void Pnt (const Standard_Real u1, const Standard_Real v1, const Standard_Real u2, const Standard_Real v2, gp_Pnt& P); diff --git a/src/GeomInt/GeomInt_TheInt2SOfThePrmPrmSvSurfacesOfWLApprox.hxx b/src/GeomInt/GeomInt_TheInt2SOfThePrmPrmSvSurfacesOfWLApprox.hxx index 3196633e10..049152c1c3 100644 --- a/src/GeomInt/GeomInt_TheInt2SOfThePrmPrmSvSurfacesOfWLApprox.hxx +++ b/src/GeomInt/GeomInt_TheInt2SOfThePrmPrmSvSurfacesOfWLApprox.hxx @@ -50,32 +50,68 @@ public: DEFINE_STANDARD_ALLOC + //! Raises Construction Error Standard_EXPORT GeomInt_TheInt2SOfThePrmPrmSvSurfacesOfWLApprox(); + //! compute the solution point with the close point Standard_EXPORT GeomInt_TheInt2SOfThePrmPrmSvSurfacesOfWLApprox(const TColStd_Array1OfReal& Param, const Handle(Adaptor3d_HSurface)& S1, const Handle(Adaptor3d_HSurface)& S2, const Standard_Real TolTangency); + //! initialize the parameters to compute the solution point + //! it 's possible to write to optimize: + //! IntImp_Int2S inter(S1,S2,Func,TolTangency); + //! math_FunctionSetRoot rsnld(inter.Function()); + //! while ...{ + //! Param(1)=... + //! Param(2)=... + //! param(3)=... + //! inter.Perform(Param,rsnld); + //! } Standard_EXPORT GeomInt_TheInt2SOfThePrmPrmSvSurfacesOfWLApprox(const Handle(Adaptor3d_HSurface)& S1, const Handle(Adaptor3d_HSurface)& S2, const Standard_Real TolTangency); + //! returns the best constant isoparametric to find + //! the next intersection's point +stores the solution + //! point (the solution point is found with the close point + //! to intersect the isoparametric with the other patch; + //! the choice of the isoparametic is calculated) Standard_EXPORT IntImp_ConstIsoparametric Perform (const TColStd_Array1OfReal& Param, math_FunctionSetRoot& Rsnld); + //! returns the best constant isoparametric to find + //! the next intersection's point +stores the solution + //! point (the solution point is found with the close point + //! to intersect the isoparametric with the other patch; + //! the choice of the isoparametic is given by ChoixIso) Standard_EXPORT IntImp_ConstIsoparametric Perform (const TColStd_Array1OfReal& Param, math_FunctionSetRoot& Rsnld, const IntImp_ConstIsoparametric ChoixIso); + //! Returns TRUE if the creation completed without failure. Standard_Boolean IsDone() const; + //! Returns TRUE when there is no solution to the problem. Standard_Boolean IsEmpty() const; + //! Returns the intersection point. const IntSurf_PntOn2S& Point() const; + //! Returns True if the surfaces are tangent at the + //! intersection point. Standard_Boolean IsTangent() const; + //! Returns the tangent at the intersection line. const gp_Dir& Direction() const; + //! Returns the tangent at the intersection line in the + //! parametric space of the first surface. const gp_Dir2d& DirectionOnS1() const; + //! Returns the tangent at the intersection line in the + //! parametric space of the second surface. const gp_Dir2d& DirectionOnS2() const; + //! return the math function which + //! is used to compute the intersection GeomInt_TheFunctionOfTheInt2SOfThePrmPrmSvSurfacesOfWLApprox& Function(); + //! return the intersection point which is + //! enable for changing. IntSurf_PntOn2S& ChangePoint(); diff --git a/src/GeomInt/GeomInt_TheMultiLineOfWLApprox.hxx b/src/GeomInt/GeomInt_TheMultiLineOfWLApprox.hxx index 04f1645d06..3582728aa1 100644 --- a/src/GeomInt/GeomInt_TheMultiLineOfWLApprox.hxx +++ b/src/GeomInt/GeomInt_TheMultiLineOfWLApprox.hxx @@ -42,34 +42,59 @@ public: DEFINE_STANDARD_ALLOC + //! The class SvSurfaces is used when the + //! approximation algorithm needs some extra points on + //! the line . A New line is then created which + //! shares the same surfaces and functions. + //! + //! SvSurfaces is a deferred class which allows + //! several implementations of this algorithm with + //! different surfaces (bi-parametric ones, or + //! implicit and biparametric ones) Standard_EXPORT GeomInt_TheMultiLineOfWLApprox(const Handle(IntPatch_WLine)& line, const Standard_Address PtrSvSurfaces, const Standard_Integer NbP3d, const Standard_Integer NbP2d, const Standard_Real xo, const Standard_Real ax, const Standard_Real yo, const Standard_Real ay, const Standard_Real zo, const Standard_Real az, const Standard_Real u1o, const Standard_Real a1u, const Standard_Real v1o, const Standard_Real a1v, const Standard_Real u2o, const Standard_Real a2u, const Standard_Real v2o, const Standard_Real a2v, const Standard_Boolean P2DOnFirst, const Standard_Integer IndMin = 0, const Standard_Integer IndMax = 0); + //! No Extra points will be added on the current line Standard_EXPORT GeomInt_TheMultiLineOfWLApprox(const Handle(IntPatch_WLine)& line, const Standard_Integer NbP3d, const Standard_Integer NbP2d, const Standard_Real xo, const Standard_Real ax, const Standard_Real yo, const Standard_Real ay, const Standard_Real zo, const Standard_Real az, const Standard_Real u1o, const Standard_Real a1u, const Standard_Real v1o, const Standard_Real a1v, const Standard_Real u2o, const Standard_Real a2u, const Standard_Real v2o, const Standard_Real a2v, const Standard_Boolean P2DOnFirst, const Standard_Integer IndMin = 0, const Standard_Integer IndMax = 0); Standard_EXPORT Standard_Integer FirstPoint() const; Standard_EXPORT Standard_Integer LastPoint() const; + //! Returns the number of 2d points of a TheLine. Standard_EXPORT Standard_Integer NbP2d() const; + //! Returns the number of 3d points of a TheLine. Standard_EXPORT Standard_Integer NbP3d() const; Standard_EXPORT Approx_Status WhatStatus() const; + //! returns the 3d points of the multipoint + //! when only 3d points exist. Standard_EXPORT void Value (const Standard_Integer MPointIndex, TColgp_Array1OfPnt& tabPt) const; + //! returns the 2d points of the multipoint + //! when only 2d points exist. Standard_EXPORT void Value (const Standard_Integer MPointIndex, TColgp_Array1OfPnt2d& tabPt2d) const; + //! returns the 3d and 2d points of the multipoint + //! . Standard_EXPORT void Value (const Standard_Integer MPointIndex, TColgp_Array1OfPnt& tabPt, TColgp_Array1OfPnt2d& tabPt2d) const; + //! returns the 3d points of the multipoint + //! when only 3d points exist. Standard_EXPORT Standard_Boolean Tangency (const Standard_Integer MPointIndex, TColgp_Array1OfVec& tabV) const; + //! returns the 2d tangency points of the multipoint + //! only when 2d points exist. Standard_EXPORT Standard_Boolean Tangency (const Standard_Integer MPointIndex, TColgp_Array1OfVec2d& tabV2d) const; + //! returns the 3d and 2d points of the multipoint + //! . Standard_EXPORT Standard_Boolean Tangency (const Standard_Integer MPointIndex, TColgp_Array1OfVec& tabV, TColgp_Array1OfVec2d& tabV2d) const; Standard_EXPORT GeomInt_TheMultiLineOfWLApprox MakeMLBetween (const Standard_Integer Low, const Standard_Integer High, const Standard_Integer NbPointsToInsert) const; + //! Dump of the current multi-line. Standard_EXPORT void Dump() const; diff --git a/src/GeomInt/GeomInt_TheMultiLineToolOfWLApprox.hxx b/src/GeomInt/GeomInt_TheMultiLineToolOfWLApprox.hxx index b66384c73c..565c1e2717 100644 --- a/src/GeomInt/GeomInt_TheMultiLineToolOfWLApprox.hxx +++ b/src/GeomInt/GeomInt_TheMultiLineToolOfWLApprox.hxx @@ -41,36 +41,60 @@ public: DEFINE_STANDARD_ALLOC + //! Returns the number of multipoints of the TheMultiLine. static Standard_Integer FirstPoint (const GeomInt_TheMultiLineOfWLApprox& ML); + //! Returns the number of multipoints of the TheMultiLine. static Standard_Integer LastPoint (const GeomInt_TheMultiLineOfWLApprox& ML); + //! Returns the number of 2d points of a TheMultiLine. static Standard_Integer NbP2d (const GeomInt_TheMultiLineOfWLApprox& ML); + //! Returns the number of 3d points of a TheMultiLine. static Standard_Integer NbP3d (const GeomInt_TheMultiLineOfWLApprox& ML); + //! returns the 3d points of the multipoint + //! when only 3d points exist. static void Value (const GeomInt_TheMultiLineOfWLApprox& ML, const Standard_Integer MPointIndex, TColgp_Array1OfPnt& tabPt); + //! returns the 2d points of the multipoint + //! when only 2d points exist. static void Value (const GeomInt_TheMultiLineOfWLApprox& ML, const Standard_Integer MPointIndex, TColgp_Array1OfPnt2d& tabPt2d); + //! returns the 3d and 2d points of the multipoint + //! . static void Value (const GeomInt_TheMultiLineOfWLApprox& ML, const Standard_Integer MPointIndex, TColgp_Array1OfPnt& tabPt, TColgp_Array1OfPnt2d& tabPt2d); + //! returns the 3d points of the multipoint + //! when only 3d points exist. static Standard_Boolean Tangency (const GeomInt_TheMultiLineOfWLApprox& ML, const Standard_Integer MPointIndex, TColgp_Array1OfVec& tabV); + //! returns the 2d tangency points of the multipoint + //! only when 2d points exist. static Standard_Boolean Tangency (const GeomInt_TheMultiLineOfWLApprox& ML, const Standard_Integer MPointIndex, TColgp_Array1OfVec2d& tabV2d); + //! returns the 3d and 2d points of the multipoint + //! . static Standard_Boolean Tangency (const GeomInt_TheMultiLineOfWLApprox& ML, const Standard_Integer MPointIndex, TColgp_Array1OfVec& tabV, TColgp_Array1OfVec2d& tabV2d); + //! returns the 3d curvature of the multipoint + //! when only 3d points exist. static Standard_Boolean Curvature (const GeomInt_TheMultiLineOfWLApprox& ML, const Standard_Integer MPointIndex, TColgp_Array1OfVec& tabV); + //! returns the 2d curvature points of the multipoint + //! only when 2d points exist. static Standard_Boolean Curvature (const GeomInt_TheMultiLineOfWLApprox& ML, const Standard_Integer MPointIndex, TColgp_Array1OfVec2d& tabV2d); + //! returns the 3d and 2d curvature of the multipoint + //! . static Standard_Boolean Curvature (const GeomInt_TheMultiLineOfWLApprox& ML, const Standard_Integer MPointIndex, TColgp_Array1OfVec& tabV, TColgp_Array1OfVec2d& tabV2d); + //! Is called if WhatStatus returned "PointsAdded". static GeomInt_TheMultiLineOfWLApprox MakeMLBetween (const GeomInt_TheMultiLineOfWLApprox& ML, const Standard_Integer I1, const Standard_Integer I2, const Standard_Integer NbPMin); static Approx_Status WhatStatus (const GeomInt_TheMultiLineOfWLApprox& ML, const Standard_Integer I1, const Standard_Integer I2); + //! Dump of the current multi-line. Standard_EXPORT static void Dump (const GeomInt_TheMultiLineOfWLApprox& ML); diff --git a/src/GeomInt/GeomInt_ThePrmPrmSvSurfacesOfWLApprox.hxx b/src/GeomInt/GeomInt_ThePrmPrmSvSurfacesOfWLApprox.hxx index 2b919d2d50..1c7cfe91d1 100644 --- a/src/GeomInt/GeomInt_ThePrmPrmSvSurfacesOfWLApprox.hxx +++ b/src/GeomInt/GeomInt_ThePrmPrmSvSurfacesOfWLApprox.hxx @@ -49,6 +49,7 @@ public: Standard_EXPORT GeomInt_ThePrmPrmSvSurfacesOfWLApprox(const Handle(Adaptor3d_HSurface)& Surf1, const Handle(Adaptor3d_HSurface)& Surf2); + //! returns True if Tg,Tguv1 Tguv2 can be computed. Standard_EXPORT Standard_Boolean Compute (Standard_Real& u1, Standard_Real& v1, Standard_Real& u2, Standard_Real& v2, gp_Pnt& Pt, gp_Vec& Tg, gp_Vec2d& Tguv1, gp_Vec2d& Tguv2); Standard_EXPORT void Pnt (const Standard_Real u1, const Standard_Real v1, const Standard_Real u2, const Standard_Real v2, gp_Pnt& P); diff --git a/src/GeomInt/GeomInt_TheZerImpFuncOfTheImpPrmSvSurfacesOfWLApprox.hxx b/src/GeomInt/GeomInt_TheZerImpFuncOfTheImpPrmSvSurfacesOfWLApprox.hxx index d2daf569f7..de973e31a5 100644 --- a/src/GeomInt/GeomInt_TheZerImpFuncOfTheImpPrmSvSurfacesOfWLApprox.hxx +++ b/src/GeomInt/GeomInt_TheZerImpFuncOfTheImpPrmSvSurfacesOfWLApprox.hxx @@ -73,6 +73,8 @@ public: Standard_Real Root() const; + //! Returns the value Tol so that if Abs(Func.Root()) + //! The current point and the derivatives are + //! computed at the same time, which allows an + //! optimization of the computation time. + //! indicates the maximum number of derivations to + //! be done (0, 1, 2 or 3). For example, to compute + //! only the tangent, N should be equal to 1. + //! is the linear tolerance (it is used to test + //! if a vector is null). Standard_EXPORT GeomLProp_CLProps(const Handle(Geom_Curve)& C, const Standard_Integer N, const Standard_Real Resolution); + //! Same as previous constructor but here the parameter is + //! set to the value . + //! All the computations done will be related to and . Standard_EXPORT GeomLProp_CLProps(const Handle(Geom_Curve)& C, const Standard_Real U, const Standard_Integer N, const Standard_Real Resolution); + //! Same as previous constructor but here the parameter is + //! set to the value and the curve is set + //! with SetCurve. + //! the curve can have a empty constructor + //! All the computations done will be related to and + //! when the functions "set" will be done. Standard_EXPORT GeomLProp_CLProps(const Standard_Integer N, const Standard_Real Resolution); + //! Initializes the local properties of the curve + //! for the parameter value . Standard_EXPORT void SetParameter (const Standard_Real U); + //! Initializes the local properties of the curve + //! for the new curve. Standard_EXPORT void SetCurve (const Handle(Geom_Curve)& C); + //! Returns the Point. Standard_EXPORT const gp_Pnt& Value() const; + //! Returns the first derivative. + //! The derivative is computed if it has not been yet. Standard_EXPORT const gp_Vec& D1(); + //! Returns the second derivative. + //! The derivative is computed if it has not been yet. Standard_EXPORT const gp_Vec& D2(); + //! Returns the third derivative. + //! The derivative is computed if it has not been yet. Standard_EXPORT const gp_Vec& D3(); + //! Returns True if the tangent is defined. + //! For example, the tangent is not defined if the + //! three first derivatives are all null. Standard_EXPORT Standard_Boolean IsTangentDefined(); + //! output the tangent direction Standard_EXPORT void Tangent (gp_Dir& D); + //! Returns the curvature. Standard_EXPORT Standard_Real Curvature(); + //! Returns the normal direction . Standard_EXPORT void Normal (gp_Dir& N); + //! Returns the centre of curvature

. Standard_EXPORT void CentreOfCurvature (gp_Pnt& P); diff --git a/src/GeomLProp/GeomLProp_SLProps.hxx b/src/GeomLProp/GeomLProp_SLProps.hxx index cc0ca81c13..3817b1d746 100644 --- a/src/GeomLProp/GeomLProp_SLProps.hxx +++ b/src/GeomLProp/GeomLProp_SLProps.hxx @@ -47,52 +47,101 @@ public: DEFINE_STANDARD_ALLOC + //! Initializes the local properties of the surface + //! for the parameter values (, ). + //! The current point and the derivatives are + //! computed at the same time, which allows an + //! optimization of the computation time. + //! indicates the maximum number of derivations to + //! be done (0, 1, or 2). For example, to compute + //! only the tangent, N should be equal to 1. + //! is the linear tolerance (it is used to test + //! if a vector is null). Standard_EXPORT GeomLProp_SLProps(const Handle(Geom_Surface)& S, const Standard_Real U, const Standard_Real V, const Standard_Integer N, const Standard_Real Resolution); + //! idem as previous constructor but without setting the value + //! of parameters and . Standard_EXPORT GeomLProp_SLProps(const Handle(Geom_Surface)& S, const Standard_Integer N, const Standard_Real Resolution); + //! idem as previous constructor but without setting the value + //! of parameters and and the surface. + //! the surface can have an empty constructor. Standard_EXPORT GeomLProp_SLProps(const Standard_Integer N, const Standard_Real Resolution); + //! Initializes the local properties of the surface S + //! for the new surface. Standard_EXPORT void SetSurface (const Handle(Geom_Surface)& S); + //! Initializes the local properties of the surface S + //! for the new parameter values (, ). Standard_EXPORT void SetParameters (const Standard_Real U, const Standard_Real V); + //! Returns the point. Standard_EXPORT const gp_Pnt& Value() const; + //! Returns the first U derivative. + //! The derivative is computed if it has not been yet. Standard_EXPORT const gp_Vec& D1U(); + //! Returns the first V derivative. + //! The derivative is computed if it has not been yet. Standard_EXPORT const gp_Vec& D1V(); + //! Returns the second U derivatives + //! The derivative is computed if it has not been yet. Standard_EXPORT const gp_Vec& D2U(); + //! Returns the second V derivative. + //! The derivative is computed if it has not been yet. Standard_EXPORT const gp_Vec& D2V(); + //! Returns the second UV cross-derivative. + //! The derivative is computed if it has not been yet. Standard_EXPORT const gp_Vec& DUV(); + //! returns True if the U tangent is defined. + //! For example, the tangent is not defined if the + //! two first U derivatives are null. Standard_EXPORT Standard_Boolean IsTangentUDefined(); + //! Returns the tangent direction on the iso-V. Standard_EXPORT void TangentU (gp_Dir& D); + //! returns if the V tangent is defined. + //! For example, the tangent is not defined if the + //! two first V derivatives are null. Standard_EXPORT Standard_Boolean IsTangentVDefined(); + //! Returns the tangent direction on the iso-V. Standard_EXPORT void TangentV (gp_Dir& D); + //! Tells if the normal is defined. Standard_EXPORT Standard_Boolean IsNormalDefined(); + //! Returns the normal direction. Standard_EXPORT const gp_Dir& Normal(); + //! returns True if the curvature is defined. Standard_EXPORT Standard_Boolean IsCurvatureDefined(); + //! returns True if the point is umbilic (i.e. if the + //! curvature is constant). Standard_EXPORT Standard_Boolean IsUmbilic(); + //! Returns the maximum curvature Standard_EXPORT Standard_Real MaxCurvature(); + //! Returns the minimum curvature Standard_EXPORT Standard_Real MinCurvature(); + //! Returns the direction of the maximum and minimum curvature + //! and Standard_EXPORT void CurvatureDirections (gp_Dir& MaxD, gp_Dir& MinD); + //! Returns the mean curvature. Standard_EXPORT Standard_Real MeanCurvature(); + //! Returns the Gaussian curvature Standard_EXPORT Standard_Real GaussianCurvature(); diff --git a/src/HLRBRep/HLRBRep_CInter.hxx b/src/HLRBRep/HLRBRep_CInter.hxx index 4ccb779f57..ace29d5a4c 100644 --- a/src/HLRBRep/HLRBRep_CInter.hxx +++ b/src/HLRBRep/HLRBRep_CInter.hxx @@ -53,32 +53,46 @@ public: DEFINE_STANDARD_ALLOC + //! Empty constructor. HLRBRep_CInter(); + //! Self Intersection of a curve HLRBRep_CInter(const Standard_Address& C, const Standard_Real TolConf, const Standard_Real Tol); + //! Self Intersection of a curve with a domain. HLRBRep_CInter(const Standard_Address& C, const IntRes2d_Domain& D, const Standard_Real TolConf, const Standard_Real Tol); + //! Intersection between 2 curves. HLRBRep_CInter(const Standard_Address& C1, const Standard_Address& C2, const Standard_Real TolConf, const Standard_Real Tol); + //! Intersection between 2 curves. HLRBRep_CInter(const Standard_Address& C1, const IntRes2d_Domain& D1, const Standard_Address& C2, const Standard_Real TolConf, const Standard_Real Tol); + //! Intersection between 2 curves. HLRBRep_CInter(const Standard_Address& C1, const Standard_Address& C2, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol); + //! Intersection between 2 curves. HLRBRep_CInter(const Standard_Address& C1, const IntRes2d_Domain& D1, const Standard_Address& C2, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol); + //! Intersection between 2 curves. Standard_EXPORT void Perform (const Standard_Address& C1, const IntRes2d_Domain& D1, const Standard_Address& C2, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol); + //! Intersection between 2 curves. void Perform (const Standard_Address& C1, const Standard_Address& C2, const Standard_Real TolConf, const Standard_Real Tol); + //! Intersection between 2 curves. Standard_EXPORT void Perform (const Standard_Address& C1, const IntRes2d_Domain& D1, const Standard_Real TolConf, const Standard_Real Tol); + //! Intersection between 2 curves. Standard_EXPORT void Perform (const Standard_Address& C1, const Standard_Real TolConf, const Standard_Real Tol); + //! Intersection between 2 curves. void Perform (const Standard_Address& C1, const IntRes2d_Domain& D1, const Standard_Address& C2, const Standard_Real TolConf, const Standard_Real Tol); + //! Intersection between 2 curves. void Perform (const Standard_Address& C1, const Standard_Address& C2, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol); + //! Create a domain from a curve Standard_EXPORT IntRes2d_Domain ComputeDomain (const Standard_Address& C1, const Standard_Real TolDomain) const; @@ -93,10 +107,13 @@ protected: private: + //! Intersection between 2 curves. Standard_EXPORT void InternalPerform (const Standard_Address& C1, const IntRes2d_Domain& D1, const Standard_Address& C2, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol, const Standard_Boolean Composite); + //! Part of InternalCompositePerform function Standard_EXPORT void InternalCompositePerform_noRecurs (const Standard_Integer NbInterC1, const Standard_Address& C1, const Standard_Integer NumInterC1, const TColStd_Array1OfReal& Tab1, const IntRes2d_Domain& D1, const Standard_Integer NbInterC2, const Standard_Address& C2, const Standard_Integer NumInterC2, const TColStd_Array1OfReal& Tab2, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol); + //! Intersection between 2 curves. Standard_EXPORT void InternalCompositePerform (const Standard_Address& C1, const IntRes2d_Domain& D1, const Standard_Integer N1, const Standard_Integer NB1, const TColStd_Array1OfReal& Tab1, const Standard_Address& C2, const IntRes2d_Domain& D2, const Standard_Integer N2, const Standard_Integer NB2, const TColStd_Array1OfReal& Tab2, const Standard_Real TolConf, const Standard_Real Tol, const Standard_Boolean Composite); diff --git a/src/HLRBRep/HLRBRep_CLProps.hxx b/src/HLRBRep/HLRBRep_CLProps.hxx index e0029c38f9..422d68142e 100644 --- a/src/HLRBRep/HLRBRep_CLProps.hxx +++ b/src/HLRBRep/HLRBRep_CLProps.hxx @@ -47,32 +47,68 @@ public: DEFINE_STANDARD_ALLOC + //! Initializes the local properties of the curve + //! The current point and the derivatives are + //! computed at the same time, which allows an + //! optimization of the computation time. + //! indicates the maximum number of derivations to + //! be done (0, 1, 2 or 3). For example, to compute + //! only the tangent, N should be equal to 1. + //! is the linear tolerance (it is used to test + //! if a vector is null). Standard_EXPORT HLRBRep_CLProps(const Standard_Address& C, const Standard_Integer N, const Standard_Real Resolution); + //! Same as previous constructor but here the parameter is + //! set to the value . + //! All the computations done will be related to and . Standard_EXPORT HLRBRep_CLProps(const Standard_Address& C, const Standard_Real U, const Standard_Integer N, const Standard_Real Resolution); + //! Same as previous constructor but here the parameter is + //! set to the value and the curve is set + //! with SetCurve. + //! the curve can have a empty constructor + //! All the computations done will be related to and + //! when the functions "set" will be done. Standard_EXPORT HLRBRep_CLProps(const Standard_Integer N, const Standard_Real Resolution); + //! Initializes the local properties of the curve + //! for the parameter value . Standard_EXPORT void SetParameter (const Standard_Real U); + //! Initializes the local properties of the curve + //! for the new curve. Standard_EXPORT void SetCurve (const Standard_Address& C); + //! Returns the Point. Standard_EXPORT const gp_Pnt2d& Value() const; + //! Returns the first derivative. + //! The derivative is computed if it has not been yet. Standard_EXPORT const gp_Vec2d& D1(); + //! Returns the second derivative. + //! The derivative is computed if it has not been yet. Standard_EXPORT const gp_Vec2d& D2(); + //! Returns the third derivative. + //! The derivative is computed if it has not been yet. Standard_EXPORT const gp_Vec2d& D3(); + //! Returns True if the tangent is defined. + //! For example, the tangent is not defined if the + //! three first derivatives are all null. Standard_EXPORT Standard_Boolean IsTangentDefined(); + //! output the tangent direction Standard_EXPORT void Tangent (gp_Dir2d& D); + //! Returns the curvature. Standard_EXPORT Standard_Real Curvature(); + //! Returns the normal direction . Standard_EXPORT void Normal (gp_Dir2d& N); + //! Returns the centre of curvature

. Standard_EXPORT void CentreOfCurvature (gp_Pnt2d& P); diff --git a/src/HLRBRep/HLRBRep_IntConicCurveOfCInter.hxx b/src/HLRBRep/HLRBRep_IntConicCurveOfCInter.hxx index 0a05609c08..28930fad76 100644 --- a/src/HLRBRep/HLRBRep_IntConicCurveOfCInter.hxx +++ b/src/HLRBRep/HLRBRep_IntConicCurveOfCInter.hxx @@ -47,26 +47,39 @@ public: DEFINE_STANDARD_ALLOC + //! Empty constructor. Standard_EXPORT HLRBRep_IntConicCurveOfCInter(); + //! Intersection between a line and a parametric curve. Standard_EXPORT HLRBRep_IntConicCurveOfCInter(const gp_Lin2d& L, const IntRes2d_Domain& D1, const Standard_Address& PCurve, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol); + //! Intersection between a line and a parametric curve. Standard_EXPORT HLRBRep_IntConicCurveOfCInter(const gp_Circ2d& C, const IntRes2d_Domain& D1, const Standard_Address& PCurve, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol); + //! Intersection between an ellipse and a parametric curve. Standard_EXPORT HLRBRep_IntConicCurveOfCInter(const gp_Elips2d& E, const IntRes2d_Domain& D1, const Standard_Address& PCurve, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol); + //! Intersection between a parabola and a parametric curve. Standard_EXPORT HLRBRep_IntConicCurveOfCInter(const gp_Parab2d& Prb, const IntRes2d_Domain& D1, const Standard_Address& PCurve, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol); + //! Intersection between the main branch of an hyperbola + //! and a parametric curve. Standard_EXPORT HLRBRep_IntConicCurveOfCInter(const gp_Hypr2d& H, const IntRes2d_Domain& D1, const Standard_Address& PCurve, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol); + //! Intersection between a line and a parametric curve. Standard_EXPORT void Perform (const gp_Lin2d& L, const IntRes2d_Domain& D1, const Standard_Address& PCurve, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol); + //! Intersection between a line and a parametric curve. Standard_EXPORT void Perform (const gp_Circ2d& C, const IntRes2d_Domain& D1, const Standard_Address& PCurve, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol); + //! Intersection between an ellipse and a parametric curve. Standard_EXPORT void Perform (const gp_Elips2d& E, const IntRes2d_Domain& D1, const Standard_Address& PCurve, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol); + //! Intersection between a parabola and a parametric curve. Standard_EXPORT void Perform (const gp_Parab2d& Prb, const IntRes2d_Domain& D1, const Standard_Address& PCurve, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol); + //! Intersection between the main branch of an hyperbola + //! and a parametric curve. Standard_EXPORT void Perform (const gp_Hypr2d& H, const IntRes2d_Domain& D1, const Standard_Address& PCurve, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol); diff --git a/src/HLRBRep/HLRBRep_InterCSurf.hxx b/src/HLRBRep/HLRBRep_InterCSurf.hxx index 3ffc7906a3..49b2b202b3 100644 --- a/src/HLRBRep/HLRBRep_InterCSurf.hxx +++ b/src/HLRBRep/HLRBRep_InterCSurf.hxx @@ -55,16 +55,33 @@ public: DEFINE_STANDARD_ALLOC + //! Empty Constructor Standard_EXPORT HLRBRep_InterCSurf(); + //! Compute the Intersection between the curve and the + //! surface Standard_EXPORT void Perform (const gp_Lin& Curve, const Standard_Address& Surface); + //! Compute the Intersection between the curve and + //! the surface. The Curve is already sampled and + //! its polygon : is given. Standard_EXPORT void Perform (const gp_Lin& Curve, const HLRBRep_ThePolygonOfInterCSurf& Polygon, const Standard_Address& Surface); + //! Compute the Intersection between the curve and + //! the surface. The Curve is already sampled and + //! its polygon : is given. The Surface is + //! also sampled and is given. Standard_EXPORT void Perform (const gp_Lin& Curve, const HLRBRep_ThePolygonOfInterCSurf& ThePolygon, const Standard_Address& Surface, const HLRBRep_ThePolyhedronOfInterCSurf& Polyhedron); + //! Compute the Intersection between the curve and + //! the surface. The Curve is already sampled and + //! its polygon : is given. The Surface is + //! also sampled and is given. Standard_EXPORT void Perform (const gp_Lin& Curve, const HLRBRep_ThePolygonOfInterCSurf& ThePolygon, const Standard_Address& Surface, const HLRBRep_ThePolyhedronOfInterCSurf& Polyhedron, Bnd_BoundSortBox& BndBSB); + //! Compute the Intersection between the curve and + //! the surface. The Surface is already sampled and + //! its polyhedron : is given. Standard_EXPORT void Perform (const gp_Lin& Curve, const Standard_Address& Surface, const HLRBRep_ThePolyhedronOfInterCSurf& Polyhedron); @@ -73,6 +90,8 @@ public: protected: + //! Compute the Intersection between the curve and the + //! surface Standard_EXPORT void Perform (const gp_Lin& Curve, const Standard_Address& Surface, const Standard_Real U0, const Standard_Real V0, const Standard_Real U1, const Standard_Real V1); Standard_EXPORT void InternalPerformCurveQuadric (const gp_Lin& Curve, const Standard_Address& Surface); diff --git a/src/HLRBRep/HLRBRep_MyImpParToolOfTheIntersectorOfTheIntConicCurveOfCInter.hxx b/src/HLRBRep/HLRBRep_MyImpParToolOfTheIntersectorOfTheIntConicCurveOfCInter.hxx index 09beaba84c..2b8b5c4d5e 100644 --- a/src/HLRBRep/HLRBRep_MyImpParToolOfTheIntersectorOfTheIntConicCurveOfCInter.hxx +++ b/src/HLRBRep/HLRBRep_MyImpParToolOfTheIntersectorOfTheIntConicCurveOfCInter.hxx @@ -38,12 +38,19 @@ public: DEFINE_STANDARD_ALLOC + //! Constructor of the class. Standard_EXPORT HLRBRep_MyImpParToolOfTheIntersectorOfTheIntConicCurveOfCInter(const IntCurve_IConicTool& IT, const Standard_Address& PC); + //! Computes the value of the signed distance between + //! the implicit curve and the point at parameter Param + //! on the parametrised curve. Standard_EXPORT Standard_Boolean Value (const Standard_Real Param, Standard_Real& F) Standard_OVERRIDE; + //! Computes the derivative of the previous function at + //! parameter Param. Standard_EXPORT Standard_Boolean Derivative (const Standard_Real Param, Standard_Real& D) Standard_OVERRIDE; + //! Computes the value and the derivative of the function. Standard_EXPORT Standard_Boolean Values (const Standard_Real Param, Standard_Real& F, Standard_Real& D) Standard_OVERRIDE; diff --git a/src/HLRBRep/HLRBRep_PCLocFOfTheLocateExtPCOfTheProjPCurOfCInter.hxx b/src/HLRBRep/HLRBRep_PCLocFOfTheLocateExtPCOfTheProjPCurOfCInter.hxx index 650eb8a304..261ae03b77 100644 --- a/src/HLRBRep/HLRBRep_PCLocFOfTheLocateExtPCOfTheProjPCurOfCInter.hxx +++ b/src/HLRBRep/HLRBRep_PCLocFOfTheLocateExtPCOfTheProjPCurOfCInter.hxx @@ -52,28 +52,41 @@ public: Standard_EXPORT HLRBRep_PCLocFOfTheLocateExtPCOfTheProjPCurOfCInter(const gp_Pnt2d& P, const Standard_Address& C); + //! sets the field mycurve of the function. Standard_EXPORT void Initialize (const Standard_Address& C); + //! sets the field P of the function. Standard_EXPORT void SetPoint (const gp_Pnt2d& P); + //! Calculation of F(U). Standard_EXPORT Standard_Boolean Value (const Standard_Real U, Standard_Real& F); + //! Calculation of F'(U). Standard_EXPORT Standard_Boolean Derivative (const Standard_Real U, Standard_Real& DF); + //! Calculation of F(U) and F'(U). Standard_EXPORT Standard_Boolean Values (const Standard_Real U, Standard_Real& F, Standard_Real& DF); + //! Save the found extremum. Standard_EXPORT virtual Standard_Integer GetStateNumber() Standard_OVERRIDE; + //! Return the nunber of found extrema. Standard_EXPORT Standard_Integer NbExt() const; + //! Returns the Nth distance. Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N) const; + //! Shows if the Nth distance is a minimum. Standard_EXPORT Standard_Boolean IsMin (const Standard_Integer N) const; + //! Returns the Nth extremum. Standard_EXPORT const Extrema_POnCurv2d& Point (const Standard_Integer N) const; + //! Determines boundaries of subinterval for find of root. Standard_EXPORT void SubIntervalInitialize (const Standard_Real theUfirst, const Standard_Real theUlast); + //! Computes a Tol value. If 1st derivative of curve + //! |D1| + //! for the parameter values (, ). + //! The current point and the derivatives are + //! computed at the same time, which allows an + //! optimization of the computation time. + //! indicates the maximum number of derivations to + //! be done (0, 1, or 2). For example, to compute + //! only the tangent, N should be equal to 1. + //! is the linear tolerance (it is used to test + //! if a vector is null). Standard_EXPORT HLRBRep_SLProps(const Standard_Address& S, const Standard_Real U, const Standard_Real V, const Standard_Integer N, const Standard_Real Resolution); + //! idem as previous constructor but without setting the value + //! of parameters and . Standard_EXPORT HLRBRep_SLProps(const Standard_Address& S, const Standard_Integer N, const Standard_Real Resolution); + //! idem as previous constructor but without setting the value + //! of parameters and and the surface. + //! the surface can have an empty constructor. Standard_EXPORT HLRBRep_SLProps(const Standard_Integer N, const Standard_Real Resolution); + //! Initializes the local properties of the surface S + //! for the new surface. Standard_EXPORT void SetSurface (const Standard_Address& S); + //! Initializes the local properties of the surface S + //! for the new parameter values (, ). Standard_EXPORT void SetParameters (const Standard_Real U, const Standard_Real V); + //! Returns the point. Standard_EXPORT const gp_Pnt& Value() const; + //! Returns the first U derivative. + //! The derivative is computed if it has not been yet. Standard_EXPORT const gp_Vec& D1U(); + //! Returns the first V derivative. + //! The derivative is computed if it has not been yet. Standard_EXPORT const gp_Vec& D1V(); + //! Returns the second U derivatives + //! The derivative is computed if it has not been yet. Standard_EXPORT const gp_Vec& D2U(); + //! Returns the second V derivative. + //! The derivative is computed if it has not been yet. Standard_EXPORT const gp_Vec& D2V(); + //! Returns the second UV cross-derivative. + //! The derivative is computed if it has not been yet. Standard_EXPORT const gp_Vec& DUV(); + //! returns True if the U tangent is defined. + //! For example, the tangent is not defined if the + //! two first U derivatives are null. Standard_EXPORT Standard_Boolean IsTangentUDefined(); + //! Returns the tangent direction on the iso-V. Standard_EXPORT void TangentU (gp_Dir& D); + //! returns if the V tangent is defined. + //! For example, the tangent is not defined if the + //! two first V derivatives are null. Standard_EXPORT Standard_Boolean IsTangentVDefined(); + //! Returns the tangent direction on the iso-V. Standard_EXPORT void TangentV (gp_Dir& D); + //! Tells if the normal is defined. Standard_EXPORT Standard_Boolean IsNormalDefined(); + //! Returns the normal direction. Standard_EXPORT const gp_Dir& Normal(); + //! returns True if the curvature is defined. Standard_EXPORT Standard_Boolean IsCurvatureDefined(); + //! returns True if the point is umbilic (i.e. if the + //! curvature is constant). Standard_EXPORT Standard_Boolean IsUmbilic(); + //! Returns the maximum curvature Standard_EXPORT Standard_Real MaxCurvature(); + //! Returns the minimum curvature Standard_EXPORT Standard_Real MinCurvature(); + //! Returns the direction of the maximum and minimum curvature + //! and Standard_EXPORT void CurvatureDirections (gp_Dir& MaxD, gp_Dir& MinD); + //! Returns the mean curvature. Standard_EXPORT Standard_Real MeanCurvature(); + //! Returns the Gaussian curvature Standard_EXPORT Standard_Real GaussianCurvature(); diff --git a/src/HLRBRep/HLRBRep_SeqPCOfPCLocFOfTheLocateExtPCOfTheProjPCurOfCInter.hxx b/src/HLRBRep/HLRBRep_SeqPCOfPCLocFOfTheLocateExtPCOfTheProjPCurOfCInter.hxx index a35e55d1d8..dc36b5da21 100644 --- a/src/HLRBRep/HLRBRep_SeqPCOfPCLocFOfTheLocateExtPCOfTheProjPCurOfCInter.hxx +++ b/src/HLRBRep/HLRBRep_SeqPCOfPCLocFOfTheLocateExtPCOfTheProjPCurOfCInter.hxx @@ -37,60 +37,209 @@ public: DEFINE_STANDARD_ALLOC + //! Constructs an empty sequence. + //! Use: + //! - the function Append or Prepend to add an item or + //! a collection of items at the end, or at the beginning of the sequence, + //! - the function InsertAfter or InsertBefore to add an + //! item or a collection of items at any position in the sequence, + //! - operator() or the function SetValue to assign a + //! new value to an item of the sequence, + //! - operator() to read an item of the sequence, + //! - the function Remove to remove an item at any + //! position in the sequence. + //! Warning + //! To copy a sequence, you must explicitly call the + //! assignment operator (operator=). HLRBRep_SeqPCOfPCLocFOfTheLocateExtPCOfTheProjPCurOfCInter(); + //! Creation by copy of existing Sequence. Standard_EXPORT HLRBRep_SeqPCOfPCLocFOfTheLocateExtPCOfTheProjPCurOfCInter(const HLRBRep_SeqPCOfPCLocFOfTheLocateExtPCOfTheProjPCurOfCInter& Other); + //! Removes all element(s) of the sequence + //! Example: + //! before + //! me = (A B C) + //! after + //! me = () Standard_EXPORT void Clear(); ~HLRBRep_SeqPCOfPCLocFOfTheLocateExtPCOfTheProjPCurOfCInter() { Clear(); } + //! Copies the contents of the sequence Other into this sequence. + //! If this sequence is not empty, it is automatically cleared before the copy. Standard_EXPORT const HLRBRep_SeqPCOfPCLocFOfTheLocateExtPCOfTheProjPCurOfCInter& Assign (const HLRBRep_SeqPCOfPCLocFOfTheLocateExtPCOfTheProjPCurOfCInter& Other); const HLRBRep_SeqPCOfPCLocFOfTheLocateExtPCOfTheProjPCurOfCInter& operator = (const HLRBRep_SeqPCOfPCLocFOfTheLocateExtPCOfTheProjPCurOfCInter& Other) { return Assign(Other); } + //! Appends at the end of . + //! Example: + //! before + //! me = (A B C) + //! after + //! me = (A B C T) Standard_EXPORT void Append (const Extrema_POnCurv2d& T); + //! Concatenates at the end of . + //! is cleared. + //! Example: + //! before + //! me = (A B C) + //! S = (D E F) + //! after + //! me = (A B C D E F) + //! S = () void Append (HLRBRep_SeqPCOfPCLocFOfTheLocateExtPCOfTheProjPCurOfCInter& S); + //! Add at the beginning of . + //! Example: + //! before + //! me = (A B C) + //! after + //! me = (T A B C ) Standard_EXPORT void Prepend (const Extrema_POnCurv2d& T); + //! Concatenates at the beginning of . + //! is cleared. + //! Example: + //! before + //! me = (A B C) S = (D E F) + //! after me = (D E F A B C) + //! S = () void Prepend (HLRBRep_SeqPCOfPCLocFOfTheLocateExtPCOfTheProjPCurOfCInter& S); + //! Inserts in before the position . + //! Raises an exception if the index is out of bounds. + //! Example: + //! before + //! me = (A B D), Index = 3, T = C + //! after + //! me = (A B C D ) void InsertBefore (const Standard_Integer Index, const Extrema_POnCurv2d& T); + //! Inserts the sequence in before + //! the position . is cleared. + //! Raises an exception if the index is out of bounds + //! Example: + //! before + //! me = (A B F), Index = 3, S = (C D E) + //! after + //! me = (A B C D E F) + //! S = () void InsertBefore (const Standard_Integer Index, HLRBRep_SeqPCOfPCLocFOfTheLocateExtPCOfTheProjPCurOfCInter& S); + //! Inserts in after the position . + //! Raises an exception if the index is out of bound + //! Example: + //! before + //! me = (A B C), Index = 3, T = D + //! after + //! me = (A B C D) Standard_EXPORT void InsertAfter (const Standard_Integer Index, const Extrema_POnCurv2d& T); + //! Inserts the sequence in after the + //! position . is cleared. + //! Raises an exception if the index is out of bound. + //! Example: + //! before + //! me = (A B C), Index = 3, S = (D E F) + //! after + //! me = (A B C D E F) + //! S = () void InsertAfter (const Standard_Integer Index, HLRBRep_SeqPCOfPCLocFOfTheLocateExtPCOfTheProjPCurOfCInter& S); + //! Returns the first element of the sequence + //! Raises an exception if the sequence is empty. + //! Example: + //! before + //! me = (A B C) + //! after + //! me = (A B C) + //! returns A Standard_EXPORT const Extrema_POnCurv2d& First() const; + //! Returns the last element of the sequence + //! Raises an exception if the sequence is empty. + //! Example: + //! before + //! me = (A B C) + //! after + //! me = (A B C) + //! returns C Standard_EXPORT const Extrema_POnCurv2d& Last() const; + //! Keeps in the items 1 to -1 and + //! puts in the items to the end. + //! Example: + //! before + //! me = (A B C D) ,Index = 3 + //! after + //! me = (A B) + //! Sub = (C D) void Split (const Standard_Integer Index, HLRBRep_SeqPCOfPCLocFOfTheLocateExtPCOfTheProjPCurOfCInter& Sub); + //! Returns the Item at position in . + //! Raises an exception if the index is out of bound + //! Example: + //! before + //! me = (A B C), Index = 1 + //! after + //! me = (A B C) + //! returns + //! A Standard_EXPORT const Extrema_POnCurv2d& Value (const Standard_Integer Index) const; const Extrema_POnCurv2d& operator() (const Standard_Integer Index) const { return Value(Index); } + //! Changes the item at position + //! Raises an exception if the index is out of bound + //! Example: + //! before + //! me = (A B C), Index = 1, Item = D + //! after + //! me = (D B C) Standard_EXPORT void SetValue (const Standard_Integer Index, const Extrema_POnCurv2d& I); + //! Returns the Item at position in + //! . This method may be used to modify + //! : S.Value(Index) = Item. + //! Raises an exception if the index is out of bound + //! Example: + //! before + //! me = (A B C), Index = 1 + //! after + //! me = (A B C) + //! returns + //! A Standard_EXPORT Extrema_POnCurv2d& ChangeValue (const Standard_Integer Index); Extrema_POnCurv2d& operator() (const Standard_Integer Index) { return ChangeValue(Index); } + //! Removes from the item at position . + //! Raises an exception if the index is out of bounds + //! Example: + //! before + //! me = (A B C), Index = 3 + //! after + //! me = (A B) Standard_EXPORT void Remove (const Standard_Integer Index); + //! Removes from all the items of + //! positions between and . + //! Raises an exception if the indices are out of bounds. + //! Example: + //! before + //! me = (A B C D E F), FromIndex = 1 ToIndex = 3 + //! after + //! me = (D E F) Standard_EXPORT void Remove (const Standard_Integer FromIndex, const Standard_Integer ToIndex); diff --git a/src/HLRBRep/HLRBRep_TheCurveLocatorOfTheProjPCurOfCInter.hxx b/src/HLRBRep/HLRBRep_TheCurveLocatorOfTheProjPCurOfCInter.hxx index 0ab0a1c366..6a1fc8779f 100644 --- a/src/HLRBRep/HLRBRep_TheCurveLocatorOfTheProjPCurOfCInter.hxx +++ b/src/HLRBRep/HLRBRep_TheCurveLocatorOfTheProjPCurOfCInter.hxx @@ -37,10 +37,21 @@ public: DEFINE_STANDARD_ALLOC + //! Among a set of points {C(ui),i=1,NbU}, locate the point + //! P=C(uj) such that: + //! distance(P,C) = Min{distance(P,C(ui))} Standard_EXPORT static void Locate (const gp_Pnt2d& P, const Standard_Address& C, const Standard_Integer NbU, Extrema_POnCurv2d& Papp); + //! Among a set of points {C(ui),i=1,NbU}, locate the point + //! P=C(uj) such that: + //! distance(P,C) = Min{distance(P,C(ui))} + //! The research is done between umin and usup. Standard_EXPORT static void Locate (const gp_Pnt2d& P, const Standard_Address& C, const Standard_Integer NbU, const Standard_Real Umin, const Standard_Real Usup, Extrema_POnCurv2d& Papp); + //! Among two sets of points {C1(ui),i=1,NbU} and + //! {C2(vj),j=1,NbV}, locate the two points P1=C1(uk) and + //! P2=C2(vl) such that: + //! distance(P1,P2) = Min {distance(C1(ui),C2(vj))}. Standard_EXPORT static void Locate (const Standard_Address& C1, const Standard_Address& C2, const Standard_Integer NbU, const Standard_Integer NbV, Extrema_POnCurv2d& Papp1, Extrema_POnCurv2d& Papp2); diff --git a/src/HLRBRep/HLRBRep_TheDistBetweenPCurvesOfTheIntPCurvePCurveOfCInter.hxx b/src/HLRBRep/HLRBRep_TheDistBetweenPCurvesOfTheIntPCurvePCurveOfCInter.hxx index 96e7458c5a..cc7af050fc 100644 --- a/src/HLRBRep/HLRBRep_TheDistBetweenPCurvesOfTheIntPCurvePCurveOfCInter.hxx +++ b/src/HLRBRep/HLRBRep_TheDistBetweenPCurvesOfTheIntPCurvePCurveOfCInter.hxx @@ -40,14 +40,28 @@ public: Standard_EXPORT HLRBRep_TheDistBetweenPCurvesOfTheIntPCurvePCurveOfCInter(const Standard_Address& curve1, const Standard_Address& curve2); + //! returns 2. Standard_EXPORT Standard_Integer NbVariables() const; + //! returns 2. Standard_EXPORT Standard_Integer NbEquations() const; + //! computes the values of the Functions for the + //! variable . + //! returns True if the computation was done successfully, + //! False otherwise. Standard_EXPORT Standard_Boolean Value (const math_Vector& X, math_Vector& F); + //! returns the values of the derivatives for the + //! variable . + //! returns True if the computation was done successfully, + //! False otherwise. Standard_EXPORT Standard_Boolean Derivatives (const math_Vector& X, math_Matrix& D); + //! returns the values of the functions and the derivatives + //! for the variable . + //! returns True if the computation was done successfully, + //! False otherwise. Standard_EXPORT Standard_Boolean Values (const math_Vector& X, math_Vector& F, math_Matrix& D); diff --git a/src/HLRBRep/HLRBRep_TheExactInterCSurf.hxx b/src/HLRBRep/HLRBRep_TheExactInterCSurf.hxx index e0f338aa3a..7cbb3db484 100644 --- a/src/HLRBRep/HLRBRep_TheExactInterCSurf.hxx +++ b/src/HLRBRep/HLRBRep_TheExactInterCSurf.hxx @@ -43,22 +43,54 @@ public: DEFINE_STANDARD_ALLOC + //! compute the solution point with the close point + //! MarginCoef is the coefficient for extension of UV bounds. + //! Ex., UFirst -= MarginCoef*(ULast-UFirst) Standard_EXPORT HLRBRep_TheExactInterCSurf(const Standard_Real U, const Standard_Real V, const Standard_Real W, const HLRBRep_TheCSFunctionOfInterCSurf& F, const Standard_Real TolTangency, const Standard_Real MarginCoef = 0.0); + //! initialize the parameters to compute the solution Standard_EXPORT HLRBRep_TheExactInterCSurf(const HLRBRep_TheCSFunctionOfInterCSurf& F, const Standard_Real TolTangency); + //! compute the solution + //! it's possible to write to optimize: + //! IntImp_IntCS inter(S1,C1,Toltangency) + //! math_FunctionSetRoot rsnld(Inter.function()) + //! while ...{ + //! u=... + //! v=... + //! w=... + //! inter.Perform(u,v,w,rsnld) + //! } + //! or + //! IntImp_IntCS inter(Toltangency) + //! inter.SetSurface(S); + //! math_FunctionSetRoot rsnld(Inter.function()) + //! while ...{ + //! C=... + //! inter.SetCurve(C); + //! u=... + //! v=... + //! w=... + //! inter.Perform(u,v,w,rsnld) + //! } Standard_EXPORT void Perform (const Standard_Real U, const Standard_Real V, const Standard_Real W, math_FunctionSetRoot& Rsnld, const Standard_Real u0, const Standard_Real v0, const Standard_Real u1, const Standard_Real v1, const Standard_Real w0, const Standard_Real w1); + //! Returns TRUE if the creation completed without failure. Standard_EXPORT Standard_Boolean IsDone() const; Standard_EXPORT Standard_Boolean IsEmpty() const; + //! returns the intersection point + //! The exception NotDone is raised if IsDone is false. + //! The exception DomainError is raised if IsEmpty is true. Standard_EXPORT const gp_Pnt& Point() const; Standard_EXPORT Standard_Real ParameterOnCurve() const; Standard_EXPORT void ParameterOnSurface (Standard_Real& U, Standard_Real& V) const; + //! return the math function which + //! is used to compute the intersection Standard_EXPORT HLRBRep_TheCSFunctionOfInterCSurf& Function(); diff --git a/src/HLRBRep/HLRBRep_TheIntConicCurveOfCInter.hxx b/src/HLRBRep/HLRBRep_TheIntConicCurveOfCInter.hxx index fad7ee2212..636da739ea 100644 --- a/src/HLRBRep/HLRBRep_TheIntConicCurveOfCInter.hxx +++ b/src/HLRBRep/HLRBRep_TheIntConicCurveOfCInter.hxx @@ -45,26 +45,39 @@ public: DEFINE_STANDARD_ALLOC + //! Empty constructor. HLRBRep_TheIntConicCurveOfCInter(); + //! Intersection between a line and a parametric curve. HLRBRep_TheIntConicCurveOfCInter(const gp_Lin2d& L, const IntRes2d_Domain& D1, const Standard_Address& PCurve, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol); + //! Intersection between a line and a parametric curve. Standard_EXPORT HLRBRep_TheIntConicCurveOfCInter(const gp_Circ2d& C, const IntRes2d_Domain& D1, const Standard_Address& PCurve, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol); + //! Intersection between an ellipse and a parametric curve. Standard_EXPORT HLRBRep_TheIntConicCurveOfCInter(const gp_Elips2d& E, const IntRes2d_Domain& D1, const Standard_Address& PCurve, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol); + //! Intersection between a parabola and a parametric curve. Standard_EXPORT HLRBRep_TheIntConicCurveOfCInter(const gp_Parab2d& Prb, const IntRes2d_Domain& D1, const Standard_Address& PCurve, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol); + //! Intersection between the main branch of an hyperbola + //! and a parametric curve. Standard_EXPORT HLRBRep_TheIntConicCurveOfCInter(const gp_Hypr2d& H, const IntRes2d_Domain& D1, const Standard_Address& PCurve, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol); + //! Intersection between a line and a parametric curve. void Perform (const gp_Lin2d& L, const IntRes2d_Domain& D1, const Standard_Address& PCurve, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol); + //! Intersection between a line and a parametric curve. void Perform (const gp_Circ2d& C, const IntRes2d_Domain& D1, const Standard_Address& PCurve, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol); + //! Intersection between an ellipse and a parametric curve. void Perform (const gp_Elips2d& E, const IntRes2d_Domain& D1, const Standard_Address& PCurve, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol); + //! Intersection between a parabola and a parametric curve. void Perform (const gp_Parab2d& Prb, const IntRes2d_Domain& D1, const Standard_Address& PCurve, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol); + //! Intersection between the main branch of an hyperbola + //! and a parametric curve. void Perform (const gp_Hypr2d& H, const IntRes2d_Domain& D1, const Standard_Address& PCurve, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol); @@ -79,6 +92,8 @@ protected: private: + //! Intersection between a conic fom gp + //! and a parametric curve. void Perform (const IntCurve_IConicTool& ICurve, const IntRes2d_Domain& D1, const Standard_Address& PCurve, const IntRes2d_Domain& D2, const Standard_Real TolConf, const Standard_Real Tol); diff --git a/src/HLRBRep/HLRBRep_TheIntPCurvePCurveOfCInter.hxx b/src/HLRBRep/HLRBRep_TheIntPCurvePCurveOfCInter.hxx index a1c1598a7b..89af5bd1a9 100644 --- a/src/HLRBRep/HLRBRep_TheIntPCurvePCurveOfCInter.hxx +++ b/src/HLRBRep/HLRBRep_TheIntPCurvePCurveOfCInter.hxx @@ -65,6 +65,11 @@ protected: private: + //! Method to find intersection between two curves + //! : returns false for case when some points of polygon + //! : were replaced on line and exact point of intersection was not found + //! : for case when point of intersection was found + //! : during prelimanary search for line (case of bad paramerization of Bspline for example). Standard_EXPORT Standard_Boolean findIntersect (const Standard_Address& Curve1, const IntRes2d_Domain& Domain1, const Standard_Address& Curve2, const IntRes2d_Domain& Domain2, const Standard_Real TolConf, const Standard_Real Tol, const Standard_Integer NbIter, const Standard_Real DeltaU, const Standard_Real DeltaV, const HLRBRep_ThePolygon2dOfTheIntPCurvePCurveOfCInter& thePoly1, const HLRBRep_ThePolygon2dOfTheIntPCurvePCurveOfCInter& thePoly2, const Standard_Boolean isFullRepresentation); diff --git a/src/HLRBRep/HLRBRep_TheInterferenceOfInterCSurf.hxx b/src/HLRBRep/HLRBRep_TheInterferenceOfInterCSurf.hxx index 699384405c..bfc8a94045 100644 --- a/src/HLRBRep/HLRBRep_TheInterferenceOfInterCSurf.hxx +++ b/src/HLRBRep/HLRBRep_TheInterferenceOfInterCSurf.hxx @@ -44,34 +44,64 @@ public: DEFINE_STANDARD_ALLOC + //! Constructs an empty interference between Polygon and + //! Polyhedron. Standard_EXPORT HLRBRep_TheInterferenceOfInterCSurf(); + //! Constructs and computes an interference between the Polygon + //! and the Polyhedron. Standard_EXPORT HLRBRep_TheInterferenceOfInterCSurf(const HLRBRep_ThePolygonOfInterCSurf& thePolyg, const HLRBRep_ThePolyhedronOfInterCSurf& thePolyh); + //! Constructs and computes an interference between the + //! Straight Line and the Polyhedron. Standard_EXPORT HLRBRep_TheInterferenceOfInterCSurf(const gp_Lin& theLin, const HLRBRep_ThePolyhedronOfInterCSurf& thePolyh); + //! Constructs and computes an interference between the + //! Straight Lines and the Polyhedron. Standard_EXPORT HLRBRep_TheInterferenceOfInterCSurf(const Intf_Array1OfLin& theLins, const HLRBRep_ThePolyhedronOfInterCSurf& thePolyh); + //! Computes an interference between the Polygon and the + //! Polyhedron. Standard_EXPORT void Perform (const HLRBRep_ThePolygonOfInterCSurf& thePolyg, const HLRBRep_ThePolyhedronOfInterCSurf& thePolyh); + //! Computes an interference between the Straight Line and the + //! Polyhedron. Standard_EXPORT void Perform (const gp_Lin& theLin, const HLRBRep_ThePolyhedronOfInterCSurf& thePolyh); + //! Computes an interference between the Straight Lines and + //! the Polyhedron. Standard_EXPORT void Perform (const Intf_Array1OfLin& theLins, const HLRBRep_ThePolyhedronOfInterCSurf& thePolyh); + //! Constructs and computes an interference between the Polygon + //! and the Polyhedron. Standard_EXPORT HLRBRep_TheInterferenceOfInterCSurf(const HLRBRep_ThePolygonOfInterCSurf& thePolyg, const HLRBRep_ThePolyhedronOfInterCSurf& thePolyh, Bnd_BoundSortBox& theBoundSB); + //! Constructs and computes an interference between the + //! Straight Line and the Polyhedron. Standard_EXPORT HLRBRep_TheInterferenceOfInterCSurf(const gp_Lin& theLin, const HLRBRep_ThePolyhedronOfInterCSurf& thePolyh, Bnd_BoundSortBox& theBoundSB); + //! Constructs and computes an interference between the + //! Straight Lines and the Polyhedron. Standard_EXPORT HLRBRep_TheInterferenceOfInterCSurf(const Intf_Array1OfLin& theLins, const HLRBRep_ThePolyhedronOfInterCSurf& thePolyh, Bnd_BoundSortBox& theBoundSB); + //! Computes an interference between the Polygon and the + //! Polyhedron. Standard_EXPORT void Perform (const HLRBRep_ThePolygonOfInterCSurf& thePolyg, const HLRBRep_ThePolyhedronOfInterCSurf& thePolyh, Bnd_BoundSortBox& theBoundSB); + //! Computes an interference between the Straight Line and the + //! Polyhedron. Standard_EXPORT void Perform (const gp_Lin& theLin, const HLRBRep_ThePolyhedronOfInterCSurf& thePolyh, Bnd_BoundSortBox& theBoundSB); + //! Computes an interference between the Straight Lines and + //! the Polyhedron. Standard_EXPORT void Perform (const Intf_Array1OfLin& theLins, const HLRBRep_ThePolyhedronOfInterCSurf& thePolyh, Bnd_BoundSortBox& theBoundSB); + //! Compares the boundings between the segment of and + //! the facets of . Standard_EXPORT void Interference (const HLRBRep_ThePolygonOfInterCSurf& thePolyg, const HLRBRep_ThePolyhedronOfInterCSurf& thePolyh, Bnd_BoundSortBox& theBoundSB); + //! Compares the boundings between the segment of and + //! the facets of . Standard_EXPORT void Interference (const HLRBRep_ThePolygonOfInterCSurf& thePolyg, const HLRBRep_ThePolyhedronOfInterCSurf& thePolyh); @@ -86,8 +116,12 @@ protected: private: + //! Computes the intersection between the segment + //! and the triangle of . Standard_EXPORT void Intersect (const gp_Pnt& BegO, const gp_Pnt& EndO, const Standard_Boolean Infinite, const Standard_Integer TTri, const HLRBRep_ThePolyhedronOfInterCSurf& thePolyh); + //! Computes the intersection between the segment + //! and the triangle of . Standard_EXPORT void Intersect (const gp_Pnt& BegO, const gp_Pnt& EndO, const Standard_Boolean Infinite, const Standard_Integer TTri, const HLRBRep_ThePolyhedronOfInterCSurf& thePolyh, const gp_XYZ& TriNormal, const Standard_Real TriDp, const Standard_Real dBegTri, const Standard_Real dEndTri); diff --git a/src/HLRBRep/HLRBRep_TheIntersectorOfTheIntConicCurveOfCInter.hxx b/src/HLRBRep/HLRBRep_TheIntersectorOfTheIntConicCurveOfCInter.hxx index 704138c66b..ac664bb3bb 100644 --- a/src/HLRBRep/HLRBRep_TheIntersectorOfTheIntConicCurveOfCInter.hxx +++ b/src/HLRBRep/HLRBRep_TheIntersectorOfTheIntConicCurveOfCInter.hxx @@ -43,10 +43,21 @@ public: DEFINE_STANDARD_ALLOC + //! Empty constructor. Standard_EXPORT HLRBRep_TheIntersectorOfTheIntConicCurveOfCInter(); + //! Intersection between an implicit curve and + //! a parametrised curve. + //! The exception ConstructionError is raised if the domain + //! of the parametrised curve does not verify HasFirstPoint + //! and HasLastPoint return True. Standard_EXPORT HLRBRep_TheIntersectorOfTheIntConicCurveOfCInter(const IntCurve_IConicTool& ITool, const IntRes2d_Domain& Dom1, const Standard_Address& PCurve, const IntRes2d_Domain& Dom2, const Standard_Real TolConf, const Standard_Real Tol); + //! Intersection between an implicit curve and + //! a parametrised curve. + //! The exception ConstructionError is raised if the domain + //! of the parametrised curve does not verify HasFirstPoint + //! and HasLastPoint return True. Standard_EXPORT void Perform (const IntCurve_IConicTool& ITool, const IntRes2d_Domain& Dom1, const Standard_Address& PCurve, const IntRes2d_Domain& Dom2, const Standard_Real TolConf, const Standard_Real Tol); Standard_EXPORT Standard_Real FindU (const Standard_Real parameter, gp_Pnt2d& point, const Standard_Address& TheParCurev, const IntCurve_IConicTool& TheImpTool) const; diff --git a/src/HLRBRep/HLRBRep_TheLocateExtPCOfTheProjPCurOfCInter.hxx b/src/HLRBRep/HLRBRep_TheLocateExtPCOfTheProjPCurOfCInter.hxx index d6bcf5832d..1128e73ec9 100644 --- a/src/HLRBRep/HLRBRep_TheLocateExtPCOfTheProjPCurOfCInter.hxx +++ b/src/HLRBRep/HLRBRep_TheLocateExtPCOfTheProjPCurOfCInter.hxx @@ -46,20 +46,47 @@ public: Standard_EXPORT HLRBRep_TheLocateExtPCOfTheProjPCurOfCInter(); + //! Calculates the distance with a close point. + //! The close point is defined by the parameter value + //! U0. + //! The function F(u)=distance(P,C(u)) has an extremum + //! when g(u)=dF/du=0. The algorithm searchs a zero + //! near the close point. + //! TolU is used to decide to stop the iterations. + //! At the nth iteration, the criteria is: + //! abs(Un - Un-1) < TolU. Standard_EXPORT HLRBRep_TheLocateExtPCOfTheProjPCurOfCInter(const gp_Pnt2d& P, const Standard_Address& C, const Standard_Real U0, const Standard_Real TolU); + //! Calculates the distance with a close point. + //! The close point is defined by the parameter value + //! U0. + //! The function F(u)=distance(P,C(u)) has an extremum + //! when g(u)=dF/du=0. The algorithm searchs a zero + //! near the close point. + //! Zeros are searched between Umin et Usup. + //! TolU is used to decide to stop the iterations. + //! At the nth iteration, the criteria is: + //! abs(Un - Un-1) < TolU. Standard_EXPORT HLRBRep_TheLocateExtPCOfTheProjPCurOfCInter(const gp_Pnt2d& P, const Standard_Address& C, const Standard_Real U0, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real TolU); + //! sets the fields of the algorithm. Standard_EXPORT void Initialize (const Standard_Address& C, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real TolU); + //! the algorithm is done with the point P. + //! An exception is raised if the fields have not + //! been initialized. Standard_EXPORT void Perform (const gp_Pnt2d& P, const Standard_Real U0); + //! Returns True if the distance is found. Standard_EXPORT Standard_Boolean IsDone() const; + //! Returns the value of the extremum square distance. Standard_EXPORT Standard_Real SquareDistance() const; + //! Returns True if the extremum distance is a minimum. Standard_EXPORT Standard_Boolean IsMin() const; + //! Returns the point of the extremum distance. Standard_EXPORT const Extrema_POnCurv2d& Point() const; diff --git a/src/HLRBRep/HLRBRep_ThePolygon2dOfTheIntPCurvePCurveOfCInter.hxx b/src/HLRBRep/HLRBRep_ThePolygon2dOfTheIntPCurvePCurveOfCInter.hxx index bedc4c5620..c9f1cc5d3b 100644 --- a/src/HLRBRep/HLRBRep_ThePolygon2dOfTheIntPCurvePCurveOfCInter.hxx +++ b/src/HLRBRep/HLRBRep_ThePolygon2dOfTheIntPCurvePCurveOfCInter.hxx @@ -44,8 +44,14 @@ public: DEFINE_STANDARD_ALLOC + //! Compute a polygon on the domain of the curve. Standard_EXPORT HLRBRep_ThePolygon2dOfTheIntPCurvePCurveOfCInter(const Standard_Address& Curve, const Standard_Integer NbPnt, const IntRes2d_Domain& Domain, const Standard_Real Tol); + //! The current polygon is modified if most + //! of the points of the polygon are are + //! outside the box . In this + //! situation, bounds are computed to build + //! a polygon inside or near the OtherBox. Standard_EXPORT void ComputeWithBox (const Standard_Address& Curve, const Bnd_Box2d& OtherBox); virtual Standard_Real DeflectionOverEstimation() const Standard_OVERRIDE; @@ -54,16 +60,24 @@ public: void Closed (const Standard_Boolean clos); + //! Give the number of Segments in the polyline. virtual Standard_Integer NbSegments() const Standard_OVERRIDE; + //! Returns the points of the segment in the Polygon. Standard_EXPORT virtual void Segment (const Standard_Integer theIndex, gp_Pnt2d& theBegin, gp_Pnt2d& theEnd) const Standard_OVERRIDE; + //! Returns the parameter (On the curve) + //! of the first point of the Polygon Standard_Real InfParameter() const; + //! Returns the parameter (On the curve) + //! of the last point of the Polygon Standard_Real SupParameter() const; Standard_EXPORT Standard_Boolean AutoIntersectionIsPossible() const; + //! Give an approximation of the parameter on the curve + //! according to the discretization of the Curve. Standard_EXPORT Standard_Real ApproxParamOnCurve (const Standard_Integer Index, const Standard_Real ParamOnLine) const; Standard_Integer CalculRegion (const Standard_Real x, const Standard_Real y, const Standard_Real x1, const Standard_Real x2, const Standard_Real y1, const Standard_Real y2) const; diff --git a/src/HLRBRep/HLRBRep_ThePolygonOfInterCSurf.hxx b/src/HLRBRep/HLRBRep_ThePolygonOfInterCSurf.hxx index d305727d35..404e023142 100644 --- a/src/HLRBRep/HLRBRep_ThePolygonOfInterCSurf.hxx +++ b/src/HLRBRep/HLRBRep_ThePolygonOfInterCSurf.hxx @@ -49,6 +49,7 @@ public: Standard_EXPORT HLRBRep_ThePolygonOfInterCSurf(const gp_Lin& Curve, const TColStd_Array1OfReal& Upars); + //! Give the bounding box of the polygon. const Bnd_Box& Bounding() const; Standard_Real DeflectionOverEstimation() const; @@ -59,16 +60,25 @@ public: Standard_Boolean Closed() const; + //! Give the number of Segments in the polyline. Standard_Integer NbSegments() const; + //! Give the point of range Index in the Polygon. const gp_Pnt& BeginOfSeg (const Standard_Integer Index) const; + //! Give the point of range Index in the Polygon. const gp_Pnt& EndOfSeg (const Standard_Integer Index) const; + //! Returns the parameter (On the curve) + //! of the first point of the Polygon Standard_Real InfParameter() const; + //! Returns the parameter (On the curve) + //! of the last point of the Polygon Standard_Real SupParameter() const; + //! Give an approximation of the parameter on the curve + //! according to the discretization of the Curve. Standard_EXPORT Standard_Real ApproxParamOnCurve (const Standard_Integer Index, const Standard_Real ParamOnLine) const; Standard_EXPORT void Dump() const; diff --git a/src/HLRBRep/HLRBRep_ThePolygonToolOfInterCSurf.hxx b/src/HLRBRep/HLRBRep_ThePolygonToolOfInterCSurf.hxx index 82ce4897f3..1301ec04c3 100644 --- a/src/HLRBRep/HLRBRep_ThePolygonToolOfInterCSurf.hxx +++ b/src/HLRBRep/HLRBRep_ThePolygonToolOfInterCSurf.hxx @@ -38,6 +38,7 @@ public: DEFINE_STANDARD_ALLOC + //! Give the bounding box of the polygon. static const Bnd_Box& Bounding (const HLRBRep_ThePolygonOfInterCSurf& thePolygon); static Standard_Real DeflectionOverEstimation (const HLRBRep_ThePolygonOfInterCSurf& thePolygon); @@ -46,8 +47,10 @@ public: static Standard_Integer NbSegments (const HLRBRep_ThePolygonOfInterCSurf& thePolygon); + //! Give the point of range Index in the Polygon. static const gp_Pnt& BeginOfSeg (const HLRBRep_ThePolygonOfInterCSurf& thePolygon, const Standard_Integer Index); + //! Give the point of range Index in the Polygon. static const gp_Pnt& EndOfSeg (const HLRBRep_ThePolygonOfInterCSurf& thePolygon, const Standard_Integer Index); Standard_EXPORT static void Dump (const HLRBRep_ThePolygonOfInterCSurf& thePolygon); diff --git a/src/HLRBRep/HLRBRep_ThePolyhedronOfInterCSurf.hxx b/src/HLRBRep/HLRBRep_ThePolyhedronOfInterCSurf.hxx index bc4e3fb8d1..1462b16af4 100644 --- a/src/HLRBRep/HLRBRep_ThePolyhedronOfInterCSurf.hxx +++ b/src/HLRBRep/HLRBRep_ThePolyhedronOfInterCSurf.hxx @@ -65,28 +65,50 @@ public: Standard_EXPORT void VMaxSingularity (const Standard_Boolean Sing); + //! get the size of the discretization. Standard_EXPORT void Size (Standard_Integer& nbdu, Standard_Integer& nbdv) const; + //! Give the number of triangles in this double array of Standard_EXPORT Standard_Integer NbTriangles() const; + //! Give the 3 points of the triangle of addresse Index in + //! the double array of triangles. Standard_EXPORT void Triangle (const Standard_Integer Index, Standard_Integer& P1, Standard_Integer& P2, Standard_Integer& P3) const; + //! Give the addresse Tricon of the triangle connexe to the + //! triangle of address Triang by the edge Pivot Pedge and + //! the third point of this connexe triangle. When we are + //! on a free edge TriCon==0 but the function return the + //! value of the triangle in the other side of Pivot on + //! the free edge. Used to turn around a vertex. Standard_EXPORT Standard_Integer TriConnex (const Standard_Integer Triang, const Standard_Integer Pivot, const Standard_Integer Pedge, Standard_Integer& TriCon, Standard_Integer& OtherP) const; + //! Give the number of point in the double array of + //! triangles ((nbdu+1)*(nbdv+1)). Standard_EXPORT Standard_Integer NbPoints() const; + //! Set the value of a field of the double array of + //! points. Standard_EXPORT void Point (const gp_Pnt& thePnt, const Standard_Integer lig, const Standard_Integer col, const Standard_Real U, const Standard_Real V); + //! Give the point of index i in the MaTriangle. Standard_EXPORT const gp_Pnt& Point (const Standard_Integer Index, Standard_Real& U, Standard_Real& V) const; + //! Give the point of index i in the MaTriangle. Standard_EXPORT const gp_Pnt& Point (const Standard_Integer Index) const; + //! Give the point of index i in the MaTriangle. Standard_EXPORT void Point (const Standard_Integer Index, gp_Pnt& P) const; + //! Give the bounding box of the MaTriangle. Standard_EXPORT const Bnd_Box& Bounding() const; + //! Compute the array of boxes. The box corresponding + //! to the triangle . Standard_EXPORT void FillBounding(); + //! Give the array of boxes. The box corresponding + //! to the triangle . Standard_EXPORT const Handle(Bnd_HArray1OfBox)& ComponentsBounding() const; Standard_EXPORT Standard_Real DeflectionOverEstimation() const; @@ -99,14 +121,21 @@ public: Standard_EXPORT Standard_Boolean HasVMaxSingularity() const; + //! Give the plane equation of the triangle of addresse Triang. Standard_EXPORT void PlaneEquation (const Standard_Integer Triang, gp_XYZ& NormalVector, Standard_Real& PolarDistance) const; + //! Give the plane equation of the triangle of addresse Triang. Standard_EXPORT Standard_Boolean Contain (const Standard_Integer Triang, const gp_Pnt& ThePnt) const; Standard_EXPORT void Parameters (const Standard_Integer Index, Standard_Real& U, Standard_Real& V) const; + //! This method returns true if the edge based on points with + //! indices Index1 and Index2 represents a boundary edge. It is + //! necessary to take into account the boundary deflection for + //! this edge. Standard_EXPORT Standard_Boolean IsOnBound (const Standard_Integer Index1, const Standard_Integer Index2) const; + //! This method returns a border deflection. Standard_Real GetBorderDeflection() const; Standard_EXPORT void Dump() const; @@ -127,6 +156,8 @@ protected: private: + //! This method computes and returns a deflection of isoline + //! of given parameter on Surface. Standard_EXPORT Standard_Real ComputeBorderDeflection (const Standard_Address& Surface, const Standard_Real Parameter, const Standard_Real PMin, const Standard_Real PMax, const Standard_Boolean isUIso) const; diff --git a/src/HLRBRep/HLRBRep_ThePolyhedronToolOfInterCSurf.hxx b/src/HLRBRep/HLRBRep_ThePolyhedronToolOfInterCSurf.hxx index 646ba2ee82..4c6c349f3d 100644 --- a/src/HLRBRep/HLRBRep_ThePolyhedronToolOfInterCSurf.hxx +++ b/src/HLRBRep/HLRBRep_ThePolyhedronToolOfInterCSurf.hxx @@ -39,22 +39,41 @@ public: DEFINE_STANDARD_ALLOC + //! Give the bounding box of the PolyhedronTool. static const Bnd_Box& Bounding (const HLRBRep_ThePolyhedronOfInterCSurf& thePolyh); + //! Give the array of boxes. The box corresponding + //! to the triangle . static const Handle(Bnd_HArray1OfBox)& ComponentsBounding (const HLRBRep_ThePolyhedronOfInterCSurf& thePolyh); + //! Give the tolerance of the polygon. static Standard_Real DeflectionOverEstimation (const HLRBRep_ThePolyhedronOfInterCSurf& thePolyh); + //! Give the number of triangles in this polyedral surface. static Standard_Integer NbTriangles (const HLRBRep_ThePolyhedronOfInterCSurf& thePolyh); + //! Give the indices of the 3 points of the triangle of + //! address Index in the PolyhedronTool. static void Triangle (const HLRBRep_ThePolyhedronOfInterCSurf& thePolyh, const Standard_Integer Index, Standard_Integer& P1, Standard_Integer& P2, Standard_Integer& P3); + //! Give the point of index i in the polyedral surface. static const gp_Pnt& Point (const HLRBRep_ThePolyhedronOfInterCSurf& thePolyh, const Standard_Integer Index); + //! Give the addresse Tricon of the triangle connexe to + //! the triangle of address Triang by the edge Pivot Pedge + //! and the third point of this connexe triangle. When we + //! are on a free edge TriCon==0 but the function return + //! the value of the triangle in the other side of Pivot + //! on the free edge. Used to turn around a vertex. static Standard_Integer TriConnex (const HLRBRep_ThePolyhedronOfInterCSurf& thePolyh, const Standard_Integer Triang, const Standard_Integer Pivot, const Standard_Integer Pedge, Standard_Integer& TriCon, Standard_Integer& OtherP); + //! This method returns true if the edge based on points with + //! indices Index1 and Index2 represents a boundary edge. It is + //! necessary to take into account the boundary deflection for + //! this edge. static Standard_Boolean IsOnBound (const HLRBRep_ThePolyhedronOfInterCSurf& thePolyh, const Standard_Integer Index1, const Standard_Integer Index2); + //! This method returns a border deflection of the polyhedron. static Standard_Real GetBorderDeflection (const HLRBRep_ThePolyhedronOfInterCSurf& thePolyh); Standard_EXPORT static void Dump (const HLRBRep_ThePolyhedronOfInterCSurf& thePolyh); diff --git a/src/HLRBRep/HLRBRep_TheProjPCurOfCInter.hxx b/src/HLRBRep/HLRBRep_TheProjPCurOfCInter.hxx index 5236a7b03c..5abd30b812 100644 --- a/src/HLRBRep/HLRBRep_TheProjPCurOfCInter.hxx +++ b/src/HLRBRep/HLRBRep_TheProjPCurOfCInter.hxx @@ -38,8 +38,33 @@ public: DEFINE_STANDARD_ALLOC + //! Returns the parameter V of the point on the + //! parametric curve corresponding to the Point Pnt. + //! The Correspondance between Pnt and the point P(V) + //! on the parametric curve must be coherent with the + //! way of determination of the signed distance + //! between a point and the implicit curve. + //! Tol is the tolerance on the distance between a point + //! and the parametrised curve. + //! In that case, no bounds are given. The research of + //! the rigth parameter has to be made on the natural + //! parametric domain of the curve. Standard_EXPORT static Standard_Real FindParameter (const Standard_Address& C, const gp_Pnt2d& Pnt, const Standard_Real Tol); + //! Returns the parameter V of the point on the + //! parametric curve corresponding to the Point Pnt. + //! The Correspondance between Pnt and the point P(V) + //! on the parametric curve must be coherent with the + //! way of determination of the signed distance + //! between a point and the implicit curve. + //! Tol is the tolerance on the distance between a point + //! and the parametrised curve. + //! LowParameter and HighParameter give the + //! boundaries of the interval in wich the parameter + //! certainly lies. These parameters are given to + //! implement a more efficient algoritm. So, it is not + //! necessary to check that the returned value verifies + //! LowParameter <= Value <= HighParameter. Standard_EXPORT static Standard_Real FindParameter (const Standard_Address& C, const gp_Pnt2d& Pnt, const Standard_Real LowParameter, const Standard_Real HighParameter, const Standard_Real Tol); diff --git a/src/HLRBRep/HLRBRep_TheQuadCurvExactInterCSurf.hxx b/src/HLRBRep/HLRBRep_TheQuadCurvExactInterCSurf.hxx index 9f3c56ea9b..ae08524ee0 100644 --- a/src/HLRBRep/HLRBRep_TheQuadCurvExactInterCSurf.hxx +++ b/src/HLRBRep/HLRBRep_TheQuadCurvExactInterCSurf.hxx @@ -40,6 +40,8 @@ public: DEFINE_STANDARD_ALLOC + //! Provides the signed distance function : Q(w) + //! and its first derivative dQ(w)/dw Standard_EXPORT HLRBRep_TheQuadCurvExactInterCSurf(const Standard_Address& S, const gp_Lin& C); Standard_EXPORT Standard_Boolean IsDone() const; @@ -50,6 +52,8 @@ public: Standard_EXPORT Standard_Integer NbIntervals() const; + //! U1 and U2 are the parameters of + //! a segment on the curve. Standard_EXPORT void Intervals (const Standard_Integer Index, Standard_Real& U1, Standard_Real& U2) const; diff --git a/src/HLRBRep/HLRBRep_TheQuadCurvFuncOfTheQuadCurvExactInterCSurf.hxx b/src/HLRBRep/HLRBRep_TheQuadCurvFuncOfTheQuadCurvExactInterCSurf.hxx index 46140bc144..fcc5974121 100644 --- a/src/HLRBRep/HLRBRep_TheQuadCurvFuncOfTheQuadCurvExactInterCSurf.hxx +++ b/src/HLRBRep/HLRBRep_TheQuadCurvFuncOfTheQuadCurvExactInterCSurf.hxx @@ -39,12 +39,22 @@ public: DEFINE_STANDARD_ALLOC + //! Create the function. Standard_EXPORT HLRBRep_TheQuadCurvFuncOfTheQuadCurvExactInterCSurf(const IntSurf_Quadric& Q, const gp_Lin& C); + //! Computes the value of the signed distance between + //! the implicit surface and the point at parameter + //! Param on the parametrised curve. + //! Value always returns True. Standard_EXPORT Standard_Boolean Value (const Standard_Real Param, Standard_Real& F) Standard_OVERRIDE; + //! Computes the derivative of the previous function at + //! parameter Param. + //! Derivative always returns True. Standard_EXPORT Standard_Boolean Derivative (const Standard_Real Param, Standard_Real& D) Standard_OVERRIDE; + //! Computes the value and the derivative of the function. + //! returns True. Standard_EXPORT Standard_Boolean Values (const Standard_Real Param, Standard_Real& F, Standard_Real& D) Standard_OVERRIDE; diff --git a/src/IGESData/IGESData_FileRecognizer.hxx b/src/IGESData/IGESData_FileRecognizer.hxx index 26b5cc45ad..39b2842725 100644 --- a/src/IGESData/IGESData_FileRecognizer.hxx +++ b/src/IGESData/IGESData_FileRecognizer.hxx @@ -37,10 +37,21 @@ class IGESData_FileRecognizer : public Standard_Transient public: + //! Evaluates if recognition has a result, returns it if yes + //! In case of success, Returns True and puts result in "res" + //! In case of Failure, simply Returns False + //! Works by calling deferred method Eval, and in case of failure, + //! looks for Added Recognizers to work Standard_EXPORT Standard_Boolean Evaluate (const IGESData_IGESType& akey, Handle(IGESData_IGESEntity)& res); + //! Returns result of last recognition (call of Evaluate) Standard_EXPORT Handle(IGESData_IGESEntity) Result() const; + //! Adds a new Recognizer to the Compound, at the end + //! Several calls to Add work by adding in the order of calls : + //! Hence, when Eval has failed to recognize, Evaluate will call + //! Evaluate from the first added Recognizer if there is one, + //! and to the second if there is still no result, and so on Standard_EXPORT void Add (const Handle(IGESData_FileRecognizer)& reco); @@ -51,12 +62,21 @@ public: protected: + //! Assumes that no result has yet been recognized Standard_EXPORT IGESData_FileRecognizer(); + //! Records the result of the recognition. Called by specific + //! method Eval to record a result : after calling it, Eval has + //! finished and can return Standard_EXPORT void SetOK (const Handle(IGESData_IGESEntity)& aresult); + //! Records that recognition gives no result Standard_EXPORT void SetKO(); + //! THIS METHOD DEFINES THE RECOGNITION PROTOCOL, it is proper to + //! each precise type of Recognizer + //! For a suitable type of akey, it calls SetOK(result) where + //! result is an empty result of appropriate type, then returns Standard_EXPORT virtual void Eval (const IGESData_IGESType& akey) = 0; diff --git a/src/IGESData/IGESData_GlobalNodeOfSpecificLib.hxx b/src/IGESData/IGESData_GlobalNodeOfSpecificLib.hxx index c53bce6cad..ce9e406d00 100644 --- a/src/IGESData/IGESData_GlobalNodeOfSpecificLib.hxx +++ b/src/IGESData/IGESData_GlobalNodeOfSpecificLib.hxx @@ -38,14 +38,23 @@ class IGESData_GlobalNodeOfSpecificLib : public Standard_Transient public: + //! Creates an empty GlobalNode, with no Next Standard_EXPORT IGESData_GlobalNodeOfSpecificLib(); + //! Adds a Module bound with a Protocol to the list : does + //! nothing if already in the list, THAT IS, Same Type (exact + //! match) and Same State (that is, IsEqual is not required) + //! Once added, stores its attached Protocol in correspondance Standard_EXPORT void Add (const Handle(IGESData_SpecificModule)& amodule, const Handle(IGESData_Protocol)& aprotocol); + //! Returns the Module stored in a given GlobalNode Standard_EXPORT const Handle(IGESData_SpecificModule)& Module() const; + //! Returns the attached Protocol stored in a given GlobalNode Standard_EXPORT const Handle(IGESData_Protocol)& Protocol() const; + //! Returns the Next GlobalNode. If none is defined, returned + //! value is a Null Handle Standard_EXPORT const Handle(IGESData_GlobalNodeOfSpecificLib)& Next() const; diff --git a/src/IGESData/IGESData_GlobalNodeOfWriterLib.hxx b/src/IGESData/IGESData_GlobalNodeOfWriterLib.hxx index 47e07f6ced..e970c59fb9 100644 --- a/src/IGESData/IGESData_GlobalNodeOfWriterLib.hxx +++ b/src/IGESData/IGESData_GlobalNodeOfWriterLib.hxx @@ -38,14 +38,23 @@ class IGESData_GlobalNodeOfWriterLib : public Standard_Transient public: + //! Creates an empty GlobalNode, with no Next Standard_EXPORT IGESData_GlobalNodeOfWriterLib(); + //! Adds a Module bound with a Protocol to the list : does + //! nothing if already in the list, THAT IS, Same Type (exact + //! match) and Same State (that is, IsEqual is not required) + //! Once added, stores its attached Protocol in correspondance Standard_EXPORT void Add (const Handle(IGESData_ReadWriteModule)& amodule, const Handle(IGESData_Protocol)& aprotocol); + //! Returns the Module stored in a given GlobalNode Standard_EXPORT const Handle(IGESData_ReadWriteModule)& Module() const; + //! Returns the attached Protocol stored in a given GlobalNode Standard_EXPORT const Handle(IGESData_Protocol)& Protocol() const; + //! Returns the Next GlobalNode. If none is defined, returned + //! value is a Null Handle Standard_EXPORT const Handle(IGESData_GlobalNodeOfWriterLib)& Next() const; diff --git a/src/IGESData/IGESData_NodeOfSpecificLib.hxx b/src/IGESData/IGESData_NodeOfSpecificLib.hxx index ade2434062..89b2aeba70 100644 --- a/src/IGESData/IGESData_NodeOfSpecificLib.hxx +++ b/src/IGESData/IGESData_NodeOfSpecificLib.hxx @@ -38,14 +38,21 @@ class IGESData_NodeOfSpecificLib : public MMgt_TShared public: + //! Creates an empty Node, with no Next Standard_EXPORT IGESData_NodeOfSpecificLib(); + //! Adds a couple (Module,Protocol), that is, stores it into + //! itself if not yet done, else creates a Next Node to do it Standard_EXPORT void AddNode (const Handle(IGESData_GlobalNodeOfSpecificLib)& anode); + //! Returns the Module designated by a precise Node Standard_EXPORT const Handle(IGESData_SpecificModule)& Module() const; + //! Returns the Protocol designated by a precise Node Standard_EXPORT const Handle(IGESData_Protocol)& Protocol() const; + //! Returns the Next Node. If none was defined, returned value + //! is a Null Handle Standard_EXPORT const Handle(IGESData_NodeOfSpecificLib)& Next() const; diff --git a/src/IGESData/IGESData_NodeOfWriterLib.hxx b/src/IGESData/IGESData_NodeOfWriterLib.hxx index 2e4a508539..5b71ac5c3f 100644 --- a/src/IGESData/IGESData_NodeOfWriterLib.hxx +++ b/src/IGESData/IGESData_NodeOfWriterLib.hxx @@ -38,14 +38,21 @@ class IGESData_NodeOfWriterLib : public MMgt_TShared public: + //! Creates an empty Node, with no Next Standard_EXPORT IGESData_NodeOfWriterLib(); + //! Adds a couple (Module,Protocol), that is, stores it into + //! itself if not yet done, else creates a Next Node to do it Standard_EXPORT void AddNode (const Handle(IGESData_GlobalNodeOfWriterLib)& anode); + //! Returns the Module designated by a precise Node Standard_EXPORT const Handle(IGESData_ReadWriteModule)& Module() const; + //! Returns the Protocol designated by a precise Node Standard_EXPORT const Handle(IGESData_Protocol)& Protocol() const; + //! Returns the Next Node. If none was defined, returned value + //! is a Null Handle Standard_EXPORT const Handle(IGESData_NodeOfWriterLib)& Next() const; diff --git a/src/IGESData/IGESData_SpecificLib.hxx b/src/IGESData/IGESData_SpecificLib.hxx index d4051f5662..99454e5adb 100644 --- a/src/IGESData/IGESData_SpecificLib.hxx +++ b/src/IGESData/IGESData_SpecificLib.hxx @@ -40,28 +40,56 @@ public: DEFINE_STANDARD_ALLOC + //! Adds a couple (Module-Protocol) into the global definition set + //! for this class of Library. Standard_EXPORT static void SetGlobal (const Handle(IGESData_SpecificModule)& amodule, const Handle(IGESData_Protocol)& aprotocol); + //! Creates a Library which complies with a Protocol, that is : + //! Same class (criterium IsInstance) + //! This creation gets the Modules from the global set, those + //! which are bound to the given Protocol and its Resources Standard_EXPORT IGESData_SpecificLib(const Handle(IGESData_Protocol)& aprotocol); + //! Creates an empty Library : it will later by filled by method + //! AddProtocol Standard_EXPORT IGESData_SpecificLib(); + //! Adds a couple (Module-Protocol) to the Library, given the + //! class of a Protocol. Takes Resources into account. + //! (if is not of type TheProtocol, it is not added) Standard_EXPORT void AddProtocol (const Handle(Standard_Transient)& aprotocol); + //! Clears the list of Modules of a library (can be used to + //! redefine the order of Modules before action : Clear then + //! refill the Library by calls to AddProtocol) Standard_EXPORT void Clear(); + //! Sets a library to be defined with the complete Global list + //! (all the couples Protocol/Modules recorded in it) Standard_EXPORT void SetComplete(); + //! Selects a Module from the Library, given an Object. + //! Returns True if Select has succeeded, False else. + //! Also Returns (as arguments) the selected Module and the Case + //! Number determined by the associated Protocol. + //! If Select has failed, is Null Handle and CN is zero. + //! (Select can work on any criterium, such as Object DynamicType) Standard_EXPORT Standard_Boolean Select (const Handle(IGESData_IGESEntity)& obj, Handle(IGESData_SpecificModule)& module, Standard_Integer& CN) const; + //! Starts Iteration on the Modules (sets it on the first one) Standard_EXPORT void Start(); + //! Returns True if there are more Modules to iterate on Standard_EXPORT Standard_Boolean More() const; + //! Iterates by getting the next Module in the list + //! If there is none, the exception will be raised by Value Standard_EXPORT void Next(); + //! Returns the current Module in the Iteration Standard_EXPORT const Handle(IGESData_SpecificModule)& Module() const; + //! Returns the current Protocol in the Iteration Standard_EXPORT const Handle(IGESData_Protocol)& Protocol() const; diff --git a/src/IGESData/IGESData_WriterLib.hxx b/src/IGESData/IGESData_WriterLib.hxx index edf9232d57..d4f394f611 100644 --- a/src/IGESData/IGESData_WriterLib.hxx +++ b/src/IGESData/IGESData_WriterLib.hxx @@ -40,28 +40,56 @@ public: DEFINE_STANDARD_ALLOC + //! Adds a couple (Module-Protocol) into the global definition set + //! for this class of Library. Standard_EXPORT static void SetGlobal (const Handle(IGESData_ReadWriteModule)& amodule, const Handle(IGESData_Protocol)& aprotocol); + //! Creates a Library which complies with a Protocol, that is : + //! Same class (criterium IsInstance) + //! This creation gets the Modules from the global set, those + //! which are bound to the given Protocol and its Resources Standard_EXPORT IGESData_WriterLib(const Handle(IGESData_Protocol)& aprotocol); + //! Creates an empty Library : it will later by filled by method + //! AddProtocol Standard_EXPORT IGESData_WriterLib(); + //! Adds a couple (Module-Protocol) to the Library, given the + //! class of a Protocol. Takes Resources into account. + //! (if is not of type TheProtocol, it is not added) Standard_EXPORT void AddProtocol (const Handle(Standard_Transient)& aprotocol); + //! Clears the list of Modules of a library (can be used to + //! redefine the order of Modules before action : Clear then + //! refill the Library by calls to AddProtocol) Standard_EXPORT void Clear(); + //! Sets a library to be defined with the complete Global list + //! (all the couples Protocol/Modules recorded in it) Standard_EXPORT void SetComplete(); + //! Selects a Module from the Library, given an Object. + //! Returns True if Select has succeeded, False else. + //! Also Returns (as arguments) the selected Module and the Case + //! Number determined by the associated Protocol. + //! If Select has failed, is Null Handle and CN is zero. + //! (Select can work on any criterium, such as Object DynamicType) Standard_EXPORT Standard_Boolean Select (const Handle(IGESData_IGESEntity)& obj, Handle(IGESData_ReadWriteModule)& module, Standard_Integer& CN) const; + //! Starts Iteration on the Modules (sets it on the first one) Standard_EXPORT void Start(); + //! Returns True if there are more Modules to iterate on Standard_EXPORT Standard_Boolean More() const; + //! Iterates by getting the next Module in the list + //! If there is none, the exception will be raised by Value Standard_EXPORT void Next(); + //! Returns the current Module in the Iteration Standard_EXPORT const Handle(IGESData_ReadWriteModule)& Module() const; + //! Returns the current Protocol in the Iteration Standard_EXPORT const Handle(IGESData_Protocol)& Protocol() const; diff --git a/src/IGESSelect/IGESSelect_FileModifier.hxx b/src/IGESSelect/IGESSelect_FileModifier.hxx index 5efe8aa8f0..cd01b98145 100644 --- a/src/IGESSelect/IGESSelect_FileModifier.hxx +++ b/src/IGESSelect/IGESSelect_FileModifier.hxx @@ -35,6 +35,14 @@ class IGESSelect_FileModifier : public IFSelect_GeneralModifier public: + //! Perform the action specific to each class of File Modifier + //! is the ContextWrite, which brings : the model, the + //! protocol, the file name, plus the object AppliedModifiers + //! (not used here) and the CheckList + //! Remark that the model has to be casted for specific access + //! + //! is the Writer and is specific to each norm, on which + //! to act Standard_EXPORT virtual void Perform (IFSelect_ContextWrite& ctx, IGESData_IGESWriter& writer) const = 0; @@ -45,6 +53,8 @@ public: protected: + //! Sets a File Modifier to keep the graph of dependences + //! unchanges (because it works on the model already produced) Standard_EXPORT IGESSelect_FileModifier(); diff --git a/src/IGESSelect/IGESSelect_ModelModifier.hxx b/src/IGESSelect/IGESSelect_ModelModifier.hxx index 8cd4974744..b2680e5033 100644 --- a/src/IGESSelect/IGESSelect_ModelModifier.hxx +++ b/src/IGESSelect/IGESSelect_ModelModifier.hxx @@ -40,10 +40,21 @@ class IGESSelect_ModelModifier : public IFSelect_Modifier public: + //! The inherited Perform does the required cast (and refuses to + //! go further if cast has failed) then calls the instantiated + //! Performing Standard_EXPORT void Perform (IFSelect_ContextModif& ctx, const Handle(Interface_InterfaceModel)& target, const Handle(Interface_Protocol)& protocol, Interface_CopyTool& TC) const; + //! Specific Perform with Protocol. It is defined to let the + //! Protocol unused and to call Performing without Protocol + //! (most current case). It can be redefined if specific action + //! requires Protocol. Standard_EXPORT virtual void PerformProtocol (IFSelect_ContextModif& ctx, const Handle(IGESData_IGESModel)& target, const Handle(IGESData_Protocol)& proto, Interface_CopyTool& TC) const; + //! Specific Perform, without Protocol. If Performing with + //! Protocol is redefined, Performing without Protocol must + //! though be defined to do nothing (not called, but demanded + //! by the linker) Standard_EXPORT virtual void Performing (IFSelect_ContextModif& ctx, const Handle(IGESData_IGESModel)& target, Interface_CopyTool& TC) const = 0; @@ -54,6 +65,8 @@ public: protected: + //! Calls inherited Initialize, transmits to it the information + //! Standard_EXPORT IGESSelect_ModelModifier(const Standard_Boolean maychangegraph); diff --git a/src/IntCurve/IntCurve_IntImpConicParConic.hxx b/src/IntCurve/IntCurve_IntImpConicParConic.hxx index c6d909eb85..02249c5e0f 100644 --- a/src/IntCurve/IntCurve_IntImpConicParConic.hxx +++ b/src/IntCurve/IntCurve_IntImpConicParConic.hxx @@ -43,10 +43,21 @@ public: DEFINE_STANDARD_ALLOC + //! Empty constructor. Standard_EXPORT IntCurve_IntImpConicParConic(); + //! Intersection between an implicit curve and + //! a parametrised curve. + //! The exception ConstructionError is raised if the domain + //! of the parametrised curve does not verify HasFirstPoint + //! and HasLastPoint return True. Standard_EXPORT IntCurve_IntImpConicParConic(const IntCurve_IConicTool& ITool, const IntRes2d_Domain& Dom1, const IntCurve_PConic& PCurve, const IntRes2d_Domain& Dom2, const Standard_Real TolConf, const Standard_Real Tol); + //! Intersection between an implicit curve and + //! a parametrised curve. + //! The exception ConstructionError is raised if the domain + //! of the parametrised curve does not verify HasFirstPoint + //! and HasLastPoint return True. Standard_EXPORT void Perform (const IntCurve_IConicTool& ITool, const IntRes2d_Domain& Dom1, const IntCurve_PConic& PCurve, const IntRes2d_Domain& Dom2, const Standard_Real TolConf, const Standard_Real Tol); Standard_EXPORT Standard_Real FindU (const Standard_Real parameter, gp_Pnt2d& point, const IntCurve_PConic& TheParCurev, const IntCurve_IConicTool& TheImpTool) const; diff --git a/src/IntCurve/IntCurve_MyImpParToolOfIntImpConicParConic.hxx b/src/IntCurve/IntCurve_MyImpParToolOfIntImpConicParConic.hxx index 7cdfe16e06..ffcd25ac64 100644 --- a/src/IntCurve/IntCurve_MyImpParToolOfIntImpConicParConic.hxx +++ b/src/IntCurve/IntCurve_MyImpParToolOfIntImpConicParConic.hxx @@ -39,12 +39,19 @@ public: DEFINE_STANDARD_ALLOC + //! Constructor of the class. Standard_EXPORT IntCurve_MyImpParToolOfIntImpConicParConic(const IntCurve_IConicTool& IT, const IntCurve_PConic& PC); + //! Computes the value of the signed distance between + //! the implicit curve and the point at parameter Param + //! on the parametrised curve. Standard_EXPORT Standard_Boolean Value (const Standard_Real Param, Standard_Real& F) Standard_OVERRIDE; + //! Computes the derivative of the previous function at + //! parameter Param. Standard_EXPORT Standard_Boolean Derivative (const Standard_Real Param, Standard_Real& D) Standard_OVERRIDE; + //! Computes the value and the derivative of the function. Standard_EXPORT Standard_Boolean Values (const Standard_Real Param, Standard_Real& F, Standard_Real& D) Standard_OVERRIDE; diff --git a/src/IntCurveSurface/IntCurveSurface_HInter.hxx b/src/IntCurveSurface/IntCurveSurface_HInter.hxx index f284f0665f..e4e949f389 100644 --- a/src/IntCurveSurface/IntCurveSurface_HInter.hxx +++ b/src/IntCurveSurface/IntCurveSurface_HInter.hxx @@ -56,16 +56,33 @@ public: DEFINE_STANDARD_ALLOC + //! Empty Constructor Standard_EXPORT IntCurveSurface_HInter(); + //! Compute the Intersection between the curve and the + //! surface Standard_EXPORT void Perform (const Handle(Adaptor3d_HCurve)& Curve, const Handle(Adaptor3d_HSurface)& Surface); + //! Compute the Intersection between the curve and + //! the surface. The Curve is already sampled and + //! its polygon : is given. Standard_EXPORT void Perform (const Handle(Adaptor3d_HCurve)& Curve, const IntCurveSurface_ThePolygonOfHInter& Polygon, const Handle(Adaptor3d_HSurface)& Surface); + //! Compute the Intersection between the curve and + //! the surface. The Curve is already sampled and + //! its polygon : is given. The Surface is + //! also sampled and is given. Standard_EXPORT void Perform (const Handle(Adaptor3d_HCurve)& Curve, const IntCurveSurface_ThePolygonOfHInter& ThePolygon, const Handle(Adaptor3d_HSurface)& Surface, const IntCurveSurface_ThePolyhedronOfHInter& Polyhedron); + //! Compute the Intersection between the curve and + //! the surface. The Curve is already sampled and + //! its polygon : is given. The Surface is + //! also sampled and is given. Standard_EXPORT void Perform (const Handle(Adaptor3d_HCurve)& Curve, const IntCurveSurface_ThePolygonOfHInter& ThePolygon, const Handle(Adaptor3d_HSurface)& Surface, const IntCurveSurface_ThePolyhedronOfHInter& Polyhedron, Bnd_BoundSortBox& BndBSB); + //! Compute the Intersection between the curve and + //! the surface. The Surface is already sampled and + //! its polyhedron : is given. Standard_EXPORT void Perform (const Handle(Adaptor3d_HCurve)& Curve, const Handle(Adaptor3d_HSurface)& Surface, const IntCurveSurface_ThePolyhedronOfHInter& Polyhedron); @@ -74,6 +91,8 @@ public: protected: + //! Compute the Intersection between the curve and the + //! surface Standard_EXPORT void Perform (const Handle(Adaptor3d_HCurve)& Curve, const Handle(Adaptor3d_HSurface)& Surface, const Standard_Real U0, const Standard_Real V0, const Standard_Real U1, const Standard_Real V1); Standard_EXPORT void InternalPerformCurveQuadric (const Handle(Adaptor3d_HCurve)& Curve, const Handle(Adaptor3d_HSurface)& Surface); diff --git a/src/IntCurveSurface/IntCurveSurface_TheExactHInter.hxx b/src/IntCurveSurface/IntCurveSurface_TheExactHInter.hxx index d64d908512..c6168a841a 100644 --- a/src/IntCurveSurface/IntCurveSurface_TheExactHInter.hxx +++ b/src/IntCurveSurface/IntCurveSurface_TheExactHInter.hxx @@ -43,22 +43,54 @@ public: DEFINE_STANDARD_ALLOC + //! compute the solution point with the close point + //! MarginCoef is the coefficient for extension of UV bounds. + //! Ex., UFirst -= MarginCoef*(ULast-UFirst) Standard_EXPORT IntCurveSurface_TheExactHInter(const Standard_Real U, const Standard_Real V, const Standard_Real W, const IntCurveSurface_TheCSFunctionOfHInter& F, const Standard_Real TolTangency, const Standard_Real MarginCoef = 0.0); + //! initialize the parameters to compute the solution Standard_EXPORT IntCurveSurface_TheExactHInter(const IntCurveSurface_TheCSFunctionOfHInter& F, const Standard_Real TolTangency); + //! compute the solution + //! it's possible to write to optimize: + //! IntImp_IntCS inter(S1,C1,Toltangency) + //! math_FunctionSetRoot rsnld(Inter.function()) + //! while ...{ + //! u=... + //! v=... + //! w=... + //! inter.Perform(u,v,w,rsnld) + //! } + //! or + //! IntImp_IntCS inter(Toltangency) + //! inter.SetSurface(S); + //! math_FunctionSetRoot rsnld(Inter.function()) + //! while ...{ + //! C=... + //! inter.SetCurve(C); + //! u=... + //! v=... + //! w=... + //! inter.Perform(u,v,w,rsnld) + //! } Standard_EXPORT void Perform (const Standard_Real U, const Standard_Real V, const Standard_Real W, math_FunctionSetRoot& Rsnld, const Standard_Real u0, const Standard_Real v0, const Standard_Real u1, const Standard_Real v1, const Standard_Real w0, const Standard_Real w1); + //! Returns TRUE if the creation completed without failure. Standard_EXPORT Standard_Boolean IsDone() const; Standard_EXPORT Standard_Boolean IsEmpty() const; + //! returns the intersection point + //! The exception NotDone is raised if IsDone is false. + //! The exception DomainError is raised if IsEmpty is true. Standard_EXPORT const gp_Pnt& Point() const; Standard_EXPORT Standard_Real ParameterOnCurve() const; Standard_EXPORT void ParameterOnSurface (Standard_Real& U, Standard_Real& V) const; + //! return the math function which + //! is used to compute the intersection Standard_EXPORT IntCurveSurface_TheCSFunctionOfHInter& Function(); diff --git a/src/IntCurveSurface/IntCurveSurface_TheHCurveTool.hxx b/src/IntCurveSurface/IntCurveSurface_TheHCurveTool.hxx index cc773c448d..ed954b5a09 100644 --- a/src/IntCurveSurface/IntCurveSurface_TheHCurveTool.hxx +++ b/src/IntCurveSurface/IntCurveSurface_TheHCurveTool.hxx @@ -59,8 +59,15 @@ public: static GeomAbs_Shape Continuity (const Handle(Adaptor3d_HCurve)& C); + //! Returns the number of intervals for continuity + //! . May be one if Continuity(myclass) >= static Standard_Integer NbIntervals (const Handle(Adaptor3d_HCurve)& C, const GeomAbs_Shape S); + //! Stores in the parameters bounding the intervals + //! of continuity . + //! + //! The array must provide enough room to accomodate + //! for the parameters. i.e. T.Length() > NbIntervals() static void Intervals (const Handle(Adaptor3d_HCurve)& C, TColStd_Array1OfReal& T, const GeomAbs_Shape S); static Standard_Boolean IsClosed (const Handle(Adaptor3d_HCurve)& C); @@ -69,20 +76,47 @@ public: static Standard_Real Period (const Handle(Adaptor3d_HCurve)& C); + //! Computes the point of parameter U on the curve. static gp_Pnt Value (const Handle(Adaptor3d_HCurve)& C, const Standard_Real U); + //! Computes the point of parameter U on the curve. static void D0 (const Handle(Adaptor3d_HCurve)& C, const Standard_Real U, gp_Pnt& P); + //! Computes the point of parameter U on the curve with its + //! first derivative. + //! Raised if the continuity of the current interval + //! is not C1. static void D1 (const Handle(Adaptor3d_HCurve)& C, const Standard_Real U, gp_Pnt& P, gp_Vec& V); + + //! Returns the point P of parameter U, the first and second + //! derivatives V1 and V2. + //! Raised if the continuity of the current interval + //! is not C2. static void D2 (const Handle(Adaptor3d_HCurve)& C, const Standard_Real U, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2); + + //! Returns the point P of parameter U, the first, the second + //! and the third derivative. + //! Raised if the continuity of the current interval + //! is not C3. static void D3 (const Handle(Adaptor3d_HCurve)& C, const Standard_Real U, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2, gp_Vec& V3); + + //! The returned vector gives the value of the derivative for the + //! order of derivation N. + //! Raised if the continuity of the current interval + //! is not CN. + //! Raised if N < 1. static gp_Vec DN (const Handle(Adaptor3d_HCurve)& C, const Standard_Real U, const Standard_Integer N); + //! Returns the parametric resolution corresponding + //! to the real space resolution . static Standard_Real Resolution (const Handle(Adaptor3d_HCurve)& C, const Standard_Real R3d); + //! Returns the type of the curve in the current + //! interval : Line, Circle, Ellipse, Hyperbola, + //! Parabola, BezierCurve, BSplineCurve, OtherCurve. static GeomAbs_CurveType GetType (const Handle(Adaptor3d_HCurve)& C); static gp_Lin Line (const Handle(Adaptor3d_HCurve)& C); diff --git a/src/IntCurveSurface/IntCurveSurface_TheInterferenceOfHInter.hxx b/src/IntCurveSurface/IntCurveSurface_TheInterferenceOfHInter.hxx index b44560024d..710b4a294e 100644 --- a/src/IntCurveSurface/IntCurveSurface_TheInterferenceOfHInter.hxx +++ b/src/IntCurveSurface/IntCurveSurface_TheInterferenceOfHInter.hxx @@ -44,34 +44,64 @@ public: DEFINE_STANDARD_ALLOC + //! Constructs an empty interference between Polygon and + //! Polyhedron. Standard_EXPORT IntCurveSurface_TheInterferenceOfHInter(); + //! Constructs and computes an interference between the Polygon + //! and the Polyhedron. Standard_EXPORT IntCurveSurface_TheInterferenceOfHInter(const IntCurveSurface_ThePolygonOfHInter& thePolyg, const IntCurveSurface_ThePolyhedronOfHInter& thePolyh); + //! Constructs and computes an interference between the + //! Straight Line and the Polyhedron. Standard_EXPORT IntCurveSurface_TheInterferenceOfHInter(const gp_Lin& theLin, const IntCurveSurface_ThePolyhedronOfHInter& thePolyh); + //! Constructs and computes an interference between the + //! Straight Lines and the Polyhedron. Standard_EXPORT IntCurveSurface_TheInterferenceOfHInter(const Intf_Array1OfLin& theLins, const IntCurveSurface_ThePolyhedronOfHInter& thePolyh); + //! Computes an interference between the Polygon and the + //! Polyhedron. Standard_EXPORT void Perform (const IntCurveSurface_ThePolygonOfHInter& thePolyg, const IntCurveSurface_ThePolyhedronOfHInter& thePolyh); + //! Computes an interference between the Straight Line and the + //! Polyhedron. Standard_EXPORT void Perform (const gp_Lin& theLin, const IntCurveSurface_ThePolyhedronOfHInter& thePolyh); + //! Computes an interference between the Straight Lines and + //! the Polyhedron. Standard_EXPORT void Perform (const Intf_Array1OfLin& theLins, const IntCurveSurface_ThePolyhedronOfHInter& thePolyh); + //! Constructs and computes an interference between the Polygon + //! and the Polyhedron. Standard_EXPORT IntCurveSurface_TheInterferenceOfHInter(const IntCurveSurface_ThePolygonOfHInter& thePolyg, const IntCurveSurface_ThePolyhedronOfHInter& thePolyh, Bnd_BoundSortBox& theBoundSB); + //! Constructs and computes an interference between the + //! Straight Line and the Polyhedron. Standard_EXPORT IntCurveSurface_TheInterferenceOfHInter(const gp_Lin& theLin, const IntCurveSurface_ThePolyhedronOfHInter& thePolyh, Bnd_BoundSortBox& theBoundSB); + //! Constructs and computes an interference between the + //! Straight Lines and the Polyhedron. Standard_EXPORT IntCurveSurface_TheInterferenceOfHInter(const Intf_Array1OfLin& theLins, const IntCurveSurface_ThePolyhedronOfHInter& thePolyh, Bnd_BoundSortBox& theBoundSB); + //! Computes an interference between the Polygon and the + //! Polyhedron. Standard_EXPORT void Perform (const IntCurveSurface_ThePolygonOfHInter& thePolyg, const IntCurveSurface_ThePolyhedronOfHInter& thePolyh, Bnd_BoundSortBox& theBoundSB); + //! Computes an interference between the Straight Line and the + //! Polyhedron. Standard_EXPORT void Perform (const gp_Lin& theLin, const IntCurveSurface_ThePolyhedronOfHInter& thePolyh, Bnd_BoundSortBox& theBoundSB); + //! Computes an interference between the Straight Lines and + //! the Polyhedron. Standard_EXPORT void Perform (const Intf_Array1OfLin& theLins, const IntCurveSurface_ThePolyhedronOfHInter& thePolyh, Bnd_BoundSortBox& theBoundSB); + //! Compares the boundings between the segment of and + //! the facets of . Standard_EXPORT void Interference (const IntCurveSurface_ThePolygonOfHInter& thePolyg, const IntCurveSurface_ThePolyhedronOfHInter& thePolyh, Bnd_BoundSortBox& theBoundSB); + //! Compares the boundings between the segment of and + //! the facets of . Standard_EXPORT void Interference (const IntCurveSurface_ThePolygonOfHInter& thePolyg, const IntCurveSurface_ThePolyhedronOfHInter& thePolyh); @@ -86,8 +116,12 @@ protected: private: + //! Computes the intersection between the segment + //! and the triangle of . Standard_EXPORT void Intersect (const gp_Pnt& BegO, const gp_Pnt& EndO, const Standard_Boolean Infinite, const Standard_Integer TTri, const IntCurveSurface_ThePolyhedronOfHInter& thePolyh); + //! Computes the intersection between the segment + //! and the triangle of . Standard_EXPORT void Intersect (const gp_Pnt& BegO, const gp_Pnt& EndO, const Standard_Boolean Infinite, const Standard_Integer TTri, const IntCurveSurface_ThePolyhedronOfHInter& thePolyh, const gp_XYZ& TriNormal, const Standard_Real TriDp, const Standard_Real dBegTri, const Standard_Real dEndTri); diff --git a/src/IntCurveSurface/IntCurveSurface_ThePolygonOfHInter.hxx b/src/IntCurveSurface/IntCurveSurface_ThePolygonOfHInter.hxx index e77ea52db3..59311806b3 100644 --- a/src/IntCurveSurface/IntCurveSurface_ThePolygonOfHInter.hxx +++ b/src/IntCurveSurface/IntCurveSurface_ThePolygonOfHInter.hxx @@ -49,6 +49,7 @@ public: Standard_EXPORT IntCurveSurface_ThePolygonOfHInter(const Handle(Adaptor3d_HCurve)& Curve, const TColStd_Array1OfReal& Upars); + //! Give the bounding box of the polygon. const Bnd_Box& Bounding() const; Standard_Real DeflectionOverEstimation() const; @@ -59,16 +60,25 @@ public: Standard_Boolean Closed() const; + //! Give the number of Segments in the polyline. Standard_Integer NbSegments() const; + //! Give the point of range Index in the Polygon. const gp_Pnt& BeginOfSeg (const Standard_Integer Index) const; + //! Give the point of range Index in the Polygon. const gp_Pnt& EndOfSeg (const Standard_Integer Index) const; + //! Returns the parameter (On the curve) + //! of the first point of the Polygon Standard_Real InfParameter() const; + //! Returns the parameter (On the curve) + //! of the last point of the Polygon Standard_Real SupParameter() const; + //! Give an approximation of the parameter on the curve + //! according to the discretization of the Curve. Standard_EXPORT Standard_Real ApproxParamOnCurve (const Standard_Integer Index, const Standard_Real ParamOnLine) const; Standard_EXPORT void Dump() const; diff --git a/src/IntCurveSurface/IntCurveSurface_ThePolygonToolOfHInter.hxx b/src/IntCurveSurface/IntCurveSurface_ThePolygonToolOfHInter.hxx index d771bfb992..671e912585 100644 --- a/src/IntCurveSurface/IntCurveSurface_ThePolygonToolOfHInter.hxx +++ b/src/IntCurveSurface/IntCurveSurface_ThePolygonToolOfHInter.hxx @@ -38,6 +38,7 @@ public: DEFINE_STANDARD_ALLOC + //! Give the bounding box of the polygon. static const Bnd_Box& Bounding (const IntCurveSurface_ThePolygonOfHInter& thePolygon); static Standard_Real DeflectionOverEstimation (const IntCurveSurface_ThePolygonOfHInter& thePolygon); @@ -46,8 +47,10 @@ public: static Standard_Integer NbSegments (const IntCurveSurface_ThePolygonOfHInter& thePolygon); + //! Give the point of range Index in the Polygon. static const gp_Pnt& BeginOfSeg (const IntCurveSurface_ThePolygonOfHInter& thePolygon, const Standard_Integer Index); + //! Give the point of range Index in the Polygon. static const gp_Pnt& EndOfSeg (const IntCurveSurface_ThePolygonOfHInter& thePolygon, const Standard_Integer Index); Standard_EXPORT static void Dump (const IntCurveSurface_ThePolygonOfHInter& thePolygon); diff --git a/src/IntCurveSurface/IntCurveSurface_ThePolyhedronOfHInter.hxx b/src/IntCurveSurface/IntCurveSurface_ThePolyhedronOfHInter.hxx index 394634899f..2d1e8e86f7 100644 --- a/src/IntCurveSurface/IntCurveSurface_ThePolyhedronOfHInter.hxx +++ b/src/IntCurveSurface/IntCurveSurface_ThePolyhedronOfHInter.hxx @@ -66,28 +66,50 @@ public: Standard_EXPORT void VMaxSingularity (const Standard_Boolean Sing); + //! get the size of the discretization. Standard_EXPORT void Size (Standard_Integer& nbdu, Standard_Integer& nbdv) const; + //! Give the number of triangles in this double array of Standard_EXPORT Standard_Integer NbTriangles() const; + //! Give the 3 points of the triangle of addresse Index in + //! the double array of triangles. Standard_EXPORT void Triangle (const Standard_Integer Index, Standard_Integer& P1, Standard_Integer& P2, Standard_Integer& P3) const; + //! Give the addresse Tricon of the triangle connexe to the + //! triangle of address Triang by the edge Pivot Pedge and + //! the third point of this connexe triangle. When we are + //! on a free edge TriCon==0 but the function return the + //! value of the triangle in the other side of Pivot on + //! the free edge. Used to turn around a vertex. Standard_EXPORT Standard_Integer TriConnex (const Standard_Integer Triang, const Standard_Integer Pivot, const Standard_Integer Pedge, Standard_Integer& TriCon, Standard_Integer& OtherP) const; + //! Give the number of point in the double array of + //! triangles ((nbdu+1)*(nbdv+1)). Standard_EXPORT Standard_Integer NbPoints() const; + //! Set the value of a field of the double array of + //! points. Standard_EXPORT void Point (const gp_Pnt& thePnt, const Standard_Integer lig, const Standard_Integer col, const Standard_Real U, const Standard_Real V); + //! Give the point of index i in the MaTriangle. Standard_EXPORT const gp_Pnt& Point (const Standard_Integer Index, Standard_Real& U, Standard_Real& V) const; + //! Give the point of index i in the MaTriangle. Standard_EXPORT const gp_Pnt& Point (const Standard_Integer Index) const; + //! Give the point of index i in the MaTriangle. Standard_EXPORT void Point (const Standard_Integer Index, gp_Pnt& P) const; + //! Give the bounding box of the MaTriangle. Standard_EXPORT const Bnd_Box& Bounding() const; + //! Compute the array of boxes. The box corresponding + //! to the triangle . Standard_EXPORT void FillBounding(); + //! Give the array of boxes. The box corresponding + //! to the triangle . Standard_EXPORT const Handle(Bnd_HArray1OfBox)& ComponentsBounding() const; Standard_EXPORT Standard_Real DeflectionOverEstimation() const; @@ -100,14 +122,21 @@ public: Standard_EXPORT Standard_Boolean HasVMaxSingularity() const; + //! Give the plane equation of the triangle of addresse Triang. Standard_EXPORT void PlaneEquation (const Standard_Integer Triang, gp_XYZ& NormalVector, Standard_Real& PolarDistance) const; + //! Give the plane equation of the triangle of addresse Triang. Standard_EXPORT Standard_Boolean Contain (const Standard_Integer Triang, const gp_Pnt& ThePnt) const; Standard_EXPORT void Parameters (const Standard_Integer Index, Standard_Real& U, Standard_Real& V) const; + //! This method returns true if the edge based on points with + //! indices Index1 and Index2 represents a boundary edge. It is + //! necessary to take into account the boundary deflection for + //! this edge. Standard_EXPORT Standard_Boolean IsOnBound (const Standard_Integer Index1, const Standard_Integer Index2) const; + //! This method returns a border deflection. Standard_Real GetBorderDeflection() const; Standard_EXPORT void Dump() const; @@ -128,6 +157,8 @@ protected: private: + //! This method computes and returns a deflection of isoline + //! of given parameter on Surface. Standard_EXPORT Standard_Real ComputeBorderDeflection (const Handle(Adaptor3d_HSurface)& Surface, const Standard_Real Parameter, const Standard_Real PMin, const Standard_Real PMax, const Standard_Boolean isUIso) const; diff --git a/src/IntCurveSurface/IntCurveSurface_ThePolyhedronToolOfHInter.hxx b/src/IntCurveSurface/IntCurveSurface_ThePolyhedronToolOfHInter.hxx index 370a049247..c2ebce93b1 100644 --- a/src/IntCurveSurface/IntCurveSurface_ThePolyhedronToolOfHInter.hxx +++ b/src/IntCurveSurface/IntCurveSurface_ThePolyhedronToolOfHInter.hxx @@ -39,22 +39,41 @@ public: DEFINE_STANDARD_ALLOC + //! Give the bounding box of the PolyhedronTool. static const Bnd_Box& Bounding (const IntCurveSurface_ThePolyhedronOfHInter& thePolyh); + //! Give the array of boxes. The box corresponding + //! to the triangle . static const Handle(Bnd_HArray1OfBox)& ComponentsBounding (const IntCurveSurface_ThePolyhedronOfHInter& thePolyh); + //! Give the tolerance of the polygon. static Standard_Real DeflectionOverEstimation (const IntCurveSurface_ThePolyhedronOfHInter& thePolyh); + //! Give the number of triangles in this polyedral surface. static Standard_Integer NbTriangles (const IntCurveSurface_ThePolyhedronOfHInter& thePolyh); + //! Give the indices of the 3 points of the triangle of + //! address Index in the PolyhedronTool. static void Triangle (const IntCurveSurface_ThePolyhedronOfHInter& thePolyh, const Standard_Integer Index, Standard_Integer& P1, Standard_Integer& P2, Standard_Integer& P3); + //! Give the point of index i in the polyedral surface. static const gp_Pnt& Point (const IntCurveSurface_ThePolyhedronOfHInter& thePolyh, const Standard_Integer Index); + //! Give the addresse Tricon of the triangle connexe to + //! the triangle of address Triang by the edge Pivot Pedge + //! and the third point of this connexe triangle. When we + //! are on a free edge TriCon==0 but the function return + //! the value of the triangle in the other side of Pivot + //! on the free edge. Used to turn around a vertex. static Standard_Integer TriConnex (const IntCurveSurface_ThePolyhedronOfHInter& thePolyh, const Standard_Integer Triang, const Standard_Integer Pivot, const Standard_Integer Pedge, Standard_Integer& TriCon, Standard_Integer& OtherP); + //! This method returns true if the edge based on points with + //! indices Index1 and Index2 represents a boundary edge. It is + //! necessary to take into account the boundary deflection for + //! this edge. static Standard_Boolean IsOnBound (const IntCurveSurface_ThePolyhedronOfHInter& thePolyh, const Standard_Integer Index1, const Standard_Integer Index2); + //! This method returns a border deflection of the polyhedron. static Standard_Real GetBorderDeflection (const IntCurveSurface_ThePolyhedronOfHInter& thePolyh); Standard_EXPORT static void Dump (const IntCurveSurface_ThePolyhedronOfHInter& thePolyh); diff --git a/src/IntCurveSurface/IntCurveSurface_TheQuadCurvExactHInter.hxx b/src/IntCurveSurface/IntCurveSurface_TheQuadCurvExactHInter.hxx index d5ba68eb29..67aeb09d94 100644 --- a/src/IntCurveSurface/IntCurveSurface_TheQuadCurvExactHInter.hxx +++ b/src/IntCurveSurface/IntCurveSurface_TheQuadCurvExactHInter.hxx @@ -40,6 +40,8 @@ public: DEFINE_STANDARD_ALLOC + //! Provides the signed distance function : Q(w) + //! and its first derivative dQ(w)/dw Standard_EXPORT IntCurveSurface_TheQuadCurvExactHInter(const Handle(Adaptor3d_HSurface)& S, const Handle(Adaptor3d_HCurve)& C); Standard_EXPORT Standard_Boolean IsDone() const; @@ -50,6 +52,8 @@ public: Standard_EXPORT Standard_Integer NbIntervals() const; + //! U1 and U2 are the parameters of + //! a segment on the curve. Standard_EXPORT void Intervals (const Standard_Integer Index, Standard_Real& U1, Standard_Real& U2) const; diff --git a/src/IntCurveSurface/IntCurveSurface_TheQuadCurvFuncOfTheQuadCurvExactHInter.hxx b/src/IntCurveSurface/IntCurveSurface_TheQuadCurvFuncOfTheQuadCurvExactHInter.hxx index bfb323caa1..89eaced154 100644 --- a/src/IntCurveSurface/IntCurveSurface_TheQuadCurvFuncOfTheQuadCurvExactHInter.hxx +++ b/src/IntCurveSurface/IntCurveSurface_TheQuadCurvFuncOfTheQuadCurvExactHInter.hxx @@ -38,12 +38,22 @@ public: DEFINE_STANDARD_ALLOC + //! Create the function. Standard_EXPORT IntCurveSurface_TheQuadCurvFuncOfTheQuadCurvExactHInter(const IntSurf_Quadric& Q, const Handle(Adaptor3d_HCurve)& C); + //! Computes the value of the signed distance between + //! the implicit surface and the point at parameter + //! Param on the parametrised curve. + //! Value always returns True. Standard_EXPORT Standard_Boolean Value (const Standard_Real Param, Standard_Real& F) Standard_OVERRIDE; + //! Computes the derivative of the previous function at + //! parameter Param. + //! Derivative always returns True. Standard_EXPORT Standard_Boolean Derivative (const Standard_Real Param, Standard_Real& D) Standard_OVERRIDE; + //! Computes the value and the derivative of the function. + //! returns True. Standard_EXPORT Standard_Boolean Values (const Standard_Real Param, Standard_Real& F, Standard_Real& D) Standard_OVERRIDE; diff --git a/src/IntPatch/IntPatch_CurvIntSurf.hxx b/src/IntPatch/IntPatch_CurvIntSurf.hxx index 6b8de765b1..918f747bee 100644 --- a/src/IntPatch/IntPatch_CurvIntSurf.hxx +++ b/src/IntPatch/IntPatch_CurvIntSurf.hxx @@ -43,22 +43,54 @@ public: DEFINE_STANDARD_ALLOC + //! compute the solution point with the close point + //! MarginCoef is the coefficient for extension of UV bounds. + //! Ex., UFirst -= MarginCoef*(ULast-UFirst) Standard_EXPORT IntPatch_CurvIntSurf(const Standard_Real U, const Standard_Real V, const Standard_Real W, const IntPatch_CSFunction& F, const Standard_Real TolTangency, const Standard_Real MarginCoef = 0.0); + //! initialize the parameters to compute the solution Standard_EXPORT IntPatch_CurvIntSurf(const IntPatch_CSFunction& F, const Standard_Real TolTangency); + //! compute the solution + //! it's possible to write to optimize: + //! IntImp_IntCS inter(S1,C1,Toltangency) + //! math_FunctionSetRoot rsnld(Inter.function()) + //! while ...{ + //! u=... + //! v=... + //! w=... + //! inter.Perform(u,v,w,rsnld) + //! } + //! or + //! IntImp_IntCS inter(Toltangency) + //! inter.SetSurface(S); + //! math_FunctionSetRoot rsnld(Inter.function()) + //! while ...{ + //! C=... + //! inter.SetCurve(C); + //! u=... + //! v=... + //! w=... + //! inter.Perform(u,v,w,rsnld) + //! } Standard_EXPORT void Perform (const Standard_Real U, const Standard_Real V, const Standard_Real W, math_FunctionSetRoot& Rsnld, const Standard_Real u0, const Standard_Real v0, const Standard_Real u1, const Standard_Real v1, const Standard_Real w0, const Standard_Real w1); + //! Returns TRUE if the creation completed without failure. Standard_EXPORT Standard_Boolean IsDone() const; Standard_EXPORT Standard_Boolean IsEmpty() const; + //! returns the intersection point + //! The exception NotDone is raised if IsDone is false. + //! The exception DomainError is raised if IsEmpty is true. Standard_EXPORT const gp_Pnt& Point() const; Standard_EXPORT Standard_Real ParameterOnCurve() const; Standard_EXPORT void ParameterOnSurface (Standard_Real& U, Standard_Real& V) const; + //! return the math function which + //! is used to compute the intersection Standard_EXPORT IntPatch_CSFunction& Function(); diff --git a/src/IntPatch/IntPatch_SequenceOfIWLineOfTheIWalking.hxx b/src/IntPatch/IntPatch_SequenceOfIWLineOfTheIWalking.hxx index 0bc1f60701..a769feddd6 100644 --- a/src/IntPatch/IntPatch_SequenceOfIWLineOfTheIWalking.hxx +++ b/src/IntPatch/IntPatch_SequenceOfIWLineOfTheIWalking.hxx @@ -37,60 +37,209 @@ public: DEFINE_STANDARD_ALLOC + //! Constructs an empty sequence. + //! Use: + //! - the function Append or Prepend to add an item or + //! a collection of items at the end, or at the beginning of the sequence, + //! - the function InsertAfter or InsertBefore to add an + //! item or a collection of items at any position in the sequence, + //! - operator() or the function SetValue to assign a + //! new value to an item of the sequence, + //! - operator() to read an item of the sequence, + //! - the function Remove to remove an item at any + //! position in the sequence. + //! Warning + //! To copy a sequence, you must explicitly call the + //! assignment operator (operator=). IntPatch_SequenceOfIWLineOfTheIWalking(); + //! Creation by copy of existing Sequence. Standard_EXPORT IntPatch_SequenceOfIWLineOfTheIWalking(const IntPatch_SequenceOfIWLineOfTheIWalking& Other); + //! Removes all element(s) of the sequence + //! Example: + //! before + //! me = (A B C) + //! after + //! me = () Standard_EXPORT void Clear(); ~IntPatch_SequenceOfIWLineOfTheIWalking() { Clear(); } + //! Copies the contents of the sequence Other into this sequence. + //! If this sequence is not empty, it is automatically cleared before the copy. Standard_EXPORT const IntPatch_SequenceOfIWLineOfTheIWalking& Assign (const IntPatch_SequenceOfIWLineOfTheIWalking& Other); const IntPatch_SequenceOfIWLineOfTheIWalking& operator = (const IntPatch_SequenceOfIWLineOfTheIWalking& Other) { return Assign(Other); } + //! Appends at the end of . + //! Example: + //! before + //! me = (A B C) + //! after + //! me = (A B C T) Standard_EXPORT void Append (const Handle(IntPatch_TheIWLineOfTheIWalking)& T); + //! Concatenates at the end of . + //! is cleared. + //! Example: + //! before + //! me = (A B C) + //! S = (D E F) + //! after + //! me = (A B C D E F) + //! S = () void Append (IntPatch_SequenceOfIWLineOfTheIWalking& S); + //! Add at the beginning of . + //! Example: + //! before + //! me = (A B C) + //! after + //! me = (T A B C ) Standard_EXPORT void Prepend (const Handle(IntPatch_TheIWLineOfTheIWalking)& T); + //! Concatenates at the beginning of . + //! is cleared. + //! Example: + //! before + //! me = (A B C) S = (D E F) + //! after me = (D E F A B C) + //! S = () void Prepend (IntPatch_SequenceOfIWLineOfTheIWalking& S); + //! Inserts in before the position . + //! Raises an exception if the index is out of bounds. + //! Example: + //! before + //! me = (A B D), Index = 3, T = C + //! after + //! me = (A B C D ) void InsertBefore (const Standard_Integer Index, const Handle(IntPatch_TheIWLineOfTheIWalking)& T); + //! Inserts the sequence in before + //! the position . is cleared. + //! Raises an exception if the index is out of bounds + //! Example: + //! before + //! me = (A B F), Index = 3, S = (C D E) + //! after + //! me = (A B C D E F) + //! S = () void InsertBefore (const Standard_Integer Index, IntPatch_SequenceOfIWLineOfTheIWalking& S); + //! Inserts in after the position . + //! Raises an exception if the index is out of bound + //! Example: + //! before + //! me = (A B C), Index = 3, T = D + //! after + //! me = (A B C D) Standard_EXPORT void InsertAfter (const Standard_Integer Index, const Handle(IntPatch_TheIWLineOfTheIWalking)& T); + //! Inserts the sequence in after the + //! position . is cleared. + //! Raises an exception if the index is out of bound. + //! Example: + //! before + //! me = (A B C), Index = 3, S = (D E F) + //! after + //! me = (A B C D E F) + //! S = () void InsertAfter (const Standard_Integer Index, IntPatch_SequenceOfIWLineOfTheIWalking& S); + //! Returns the first element of the sequence + //! Raises an exception if the sequence is empty. + //! Example: + //! before + //! me = (A B C) + //! after + //! me = (A B C) + //! returns A Standard_EXPORT const Handle(IntPatch_TheIWLineOfTheIWalking)& First() const; + //! Returns the last element of the sequence + //! Raises an exception if the sequence is empty. + //! Example: + //! before + //! me = (A B C) + //! after + //! me = (A B C) + //! returns C Standard_EXPORT const Handle(IntPatch_TheIWLineOfTheIWalking)& Last() const; + //! Keeps in the items 1 to -1 and + //! puts in the items to the end. + //! Example: + //! before + //! me = (A B C D) ,Index = 3 + //! after + //! me = (A B) + //! Sub = (C D) void Split (const Standard_Integer Index, IntPatch_SequenceOfIWLineOfTheIWalking& Sub); + //! Returns the Item at position in . + //! Raises an exception if the index is out of bound + //! Example: + //! before + //! me = (A B C), Index = 1 + //! after + //! me = (A B C) + //! returns + //! A Standard_EXPORT const Handle(IntPatch_TheIWLineOfTheIWalking)& Value (const Standard_Integer Index) const; const Handle(IntPatch_TheIWLineOfTheIWalking)& operator() (const Standard_Integer Index) const { return Value(Index); } + //! Changes the item at position + //! Raises an exception if the index is out of bound + //! Example: + //! before + //! me = (A B C), Index = 1, Item = D + //! after + //! me = (D B C) Standard_EXPORT void SetValue (const Standard_Integer Index, const Handle(IntPatch_TheIWLineOfTheIWalking)& I); + //! Returns the Item at position in + //! . This method may be used to modify + //! : S.Value(Index) = Item. + //! Raises an exception if the index is out of bound + //! Example: + //! before + //! me = (A B C), Index = 1 + //! after + //! me = (A B C) + //! returns + //! A Standard_EXPORT Handle(IntPatch_TheIWLineOfTheIWalking)& ChangeValue (const Standard_Integer Index); Handle(IntPatch_TheIWLineOfTheIWalking)& operator() (const Standard_Integer Index) { return ChangeValue(Index); } + //! Removes from the item at position . + //! Raises an exception if the index is out of bounds + //! Example: + //! before + //! me = (A B C), Index = 3 + //! after + //! me = (A B) Standard_EXPORT void Remove (const Standard_Integer Index); + //! Removes from all the items of + //! positions between and . + //! Raises an exception if the indices are out of bounds. + //! Example: + //! before + //! me = (A B C D E F), FromIndex = 1 ToIndex = 3 + //! after + //! me = (D E F) Standard_EXPORT void Remove (const Standard_Integer FromIndex, const Standard_Integer ToIndex); diff --git a/src/IntPatch/IntPatch_SequenceOfPathPointOfTheSOnBounds.hxx b/src/IntPatch/IntPatch_SequenceOfPathPointOfTheSOnBounds.hxx index bd1a78d595..2e72da36b4 100644 --- a/src/IntPatch/IntPatch_SequenceOfPathPointOfTheSOnBounds.hxx +++ b/src/IntPatch/IntPatch_SequenceOfPathPointOfTheSOnBounds.hxx @@ -37,60 +37,209 @@ public: DEFINE_STANDARD_ALLOC + //! Constructs an empty sequence. + //! Use: + //! - the function Append or Prepend to add an item or + //! a collection of items at the end, or at the beginning of the sequence, + //! - the function InsertAfter or InsertBefore to add an + //! item or a collection of items at any position in the sequence, + //! - operator() or the function SetValue to assign a + //! new value to an item of the sequence, + //! - operator() to read an item of the sequence, + //! - the function Remove to remove an item at any + //! position in the sequence. + //! Warning + //! To copy a sequence, you must explicitly call the + //! assignment operator (operator=). IntPatch_SequenceOfPathPointOfTheSOnBounds(); + //! Creation by copy of existing Sequence. Standard_EXPORT IntPatch_SequenceOfPathPointOfTheSOnBounds(const IntPatch_SequenceOfPathPointOfTheSOnBounds& Other); + //! Removes all element(s) of the sequence + //! Example: + //! before + //! me = (A B C) + //! after + //! me = () Standard_EXPORT void Clear(); ~IntPatch_SequenceOfPathPointOfTheSOnBounds() { Clear(); } + //! Copies the contents of the sequence Other into this sequence. + //! If this sequence is not empty, it is automatically cleared before the copy. Standard_EXPORT const IntPatch_SequenceOfPathPointOfTheSOnBounds& Assign (const IntPatch_SequenceOfPathPointOfTheSOnBounds& Other); const IntPatch_SequenceOfPathPointOfTheSOnBounds& operator = (const IntPatch_SequenceOfPathPointOfTheSOnBounds& Other) { return Assign(Other); } + //! Appends at the end of . + //! Example: + //! before + //! me = (A B C) + //! after + //! me = (A B C T) Standard_EXPORT void Append (const IntPatch_ThePathPointOfTheSOnBounds& T); + //! Concatenates at the end of . + //! is cleared. + //! Example: + //! before + //! me = (A B C) + //! S = (D E F) + //! after + //! me = (A B C D E F) + //! S = () void Append (IntPatch_SequenceOfPathPointOfTheSOnBounds& S); + //! Add at the beginning of . + //! Example: + //! before + //! me = (A B C) + //! after + //! me = (T A B C ) Standard_EXPORT void Prepend (const IntPatch_ThePathPointOfTheSOnBounds& T); + //! Concatenates at the beginning of . + //! is cleared. + //! Example: + //! before + //! me = (A B C) S = (D E F) + //! after me = (D E F A B C) + //! S = () void Prepend (IntPatch_SequenceOfPathPointOfTheSOnBounds& S); + //! Inserts in before the position . + //! Raises an exception if the index is out of bounds. + //! Example: + //! before + //! me = (A B D), Index = 3, T = C + //! after + //! me = (A B C D ) void InsertBefore (const Standard_Integer Index, const IntPatch_ThePathPointOfTheSOnBounds& T); + //! Inserts the sequence in before + //! the position . is cleared. + //! Raises an exception if the index is out of bounds + //! Example: + //! before + //! me = (A B F), Index = 3, S = (C D E) + //! after + //! me = (A B C D E F) + //! S = () void InsertBefore (const Standard_Integer Index, IntPatch_SequenceOfPathPointOfTheSOnBounds& S); + //! Inserts in after the position . + //! Raises an exception if the index is out of bound + //! Example: + //! before + //! me = (A B C), Index = 3, T = D + //! after + //! me = (A B C D) Standard_EXPORT void InsertAfter (const Standard_Integer Index, const IntPatch_ThePathPointOfTheSOnBounds& T); + //! Inserts the sequence in after the + //! position . is cleared. + //! Raises an exception if the index is out of bound. + //! Example: + //! before + //! me = (A B C), Index = 3, S = (D E F) + //! after + //! me = (A B C D E F) + //! S = () void InsertAfter (const Standard_Integer Index, IntPatch_SequenceOfPathPointOfTheSOnBounds& S); + //! Returns the first element of the sequence + //! Raises an exception if the sequence is empty. + //! Example: + //! before + //! me = (A B C) + //! after + //! me = (A B C) + //! returns A Standard_EXPORT const IntPatch_ThePathPointOfTheSOnBounds& First() const; + //! Returns the last element of the sequence + //! Raises an exception if the sequence is empty. + //! Example: + //! before + //! me = (A B C) + //! after + //! me = (A B C) + //! returns C Standard_EXPORT const IntPatch_ThePathPointOfTheSOnBounds& Last() const; + //! Keeps in the items 1 to -1 and + //! puts in the items to the end. + //! Example: + //! before + //! me = (A B C D) ,Index = 3 + //! after + //! me = (A B) + //! Sub = (C D) void Split (const Standard_Integer Index, IntPatch_SequenceOfPathPointOfTheSOnBounds& Sub); + //! Returns the Item at position in . + //! Raises an exception if the index is out of bound + //! Example: + //! before + //! me = (A B C), Index = 1 + //! after + //! me = (A B C) + //! returns + //! A Standard_EXPORT const IntPatch_ThePathPointOfTheSOnBounds& Value (const Standard_Integer Index) const; const IntPatch_ThePathPointOfTheSOnBounds& operator() (const Standard_Integer Index) const { return Value(Index); } + //! Changes the item at position + //! Raises an exception if the index is out of bound + //! Example: + //! before + //! me = (A B C), Index = 1, Item = D + //! after + //! me = (D B C) Standard_EXPORT void SetValue (const Standard_Integer Index, const IntPatch_ThePathPointOfTheSOnBounds& I); + //! Returns the Item at position in + //! . This method may be used to modify + //! : S.Value(Index) = Item. + //! Raises an exception if the index is out of bound + //! Example: + //! before + //! me = (A B C), Index = 1 + //! after + //! me = (A B C) + //! returns + //! A Standard_EXPORT IntPatch_ThePathPointOfTheSOnBounds& ChangeValue (const Standard_Integer Index); IntPatch_ThePathPointOfTheSOnBounds& operator() (const Standard_Integer Index) { return ChangeValue(Index); } + //! Removes from the item at position . + //! Raises an exception if the index is out of bounds + //! Example: + //! before + //! me = (A B C), Index = 3 + //! after + //! me = (A B) Standard_EXPORT void Remove (const Standard_Integer Index); + //! Removes from all the items of + //! positions between and . + //! Raises an exception if the indices are out of bounds. + //! Example: + //! before + //! me = (A B C D E F), FromIndex = 1 ToIndex = 3 + //! after + //! me = (D E F) Standard_EXPORT void Remove (const Standard_Integer FromIndex, const Standard_Integer ToIndex); diff --git a/src/IntPatch/IntPatch_SequenceOfSegmentOfTheSOnBounds.hxx b/src/IntPatch/IntPatch_SequenceOfSegmentOfTheSOnBounds.hxx index 5b68923477..e12e5923e1 100644 --- a/src/IntPatch/IntPatch_SequenceOfSegmentOfTheSOnBounds.hxx +++ b/src/IntPatch/IntPatch_SequenceOfSegmentOfTheSOnBounds.hxx @@ -37,60 +37,209 @@ public: DEFINE_STANDARD_ALLOC + //! Constructs an empty sequence. + //! Use: + //! - the function Append or Prepend to add an item or + //! a collection of items at the end, or at the beginning of the sequence, + //! - the function InsertAfter or InsertBefore to add an + //! item or a collection of items at any position in the sequence, + //! - operator() or the function SetValue to assign a + //! new value to an item of the sequence, + //! - operator() to read an item of the sequence, + //! - the function Remove to remove an item at any + //! position in the sequence. + //! Warning + //! To copy a sequence, you must explicitly call the + //! assignment operator (operator=). IntPatch_SequenceOfSegmentOfTheSOnBounds(); + //! Creation by copy of existing Sequence. Standard_EXPORT IntPatch_SequenceOfSegmentOfTheSOnBounds(const IntPatch_SequenceOfSegmentOfTheSOnBounds& Other); + //! Removes all element(s) of the sequence + //! Example: + //! before + //! me = (A B C) + //! after + //! me = () Standard_EXPORT void Clear(); ~IntPatch_SequenceOfSegmentOfTheSOnBounds() { Clear(); } + //! Copies the contents of the sequence Other into this sequence. + //! If this sequence is not empty, it is automatically cleared before the copy. Standard_EXPORT const IntPatch_SequenceOfSegmentOfTheSOnBounds& Assign (const IntPatch_SequenceOfSegmentOfTheSOnBounds& Other); const IntPatch_SequenceOfSegmentOfTheSOnBounds& operator = (const IntPatch_SequenceOfSegmentOfTheSOnBounds& Other) { return Assign(Other); } + //! Appends at the end of . + //! Example: + //! before + //! me = (A B C) + //! after + //! me = (A B C T) Standard_EXPORT void Append (const IntPatch_TheSegmentOfTheSOnBounds& T); + //! Concatenates at the end of . + //! is cleared. + //! Example: + //! before + //! me = (A B C) + //! S = (D E F) + //! after + //! me = (A B C D E F) + //! S = () void Append (IntPatch_SequenceOfSegmentOfTheSOnBounds& S); + //! Add at the beginning of . + //! Example: + //! before + //! me = (A B C) + //! after + //! me = (T A B C ) Standard_EXPORT void Prepend (const IntPatch_TheSegmentOfTheSOnBounds& T); + //! Concatenates at the beginning of . + //! is cleared. + //! Example: + //! before + //! me = (A B C) S = (D E F) + //! after me = (D E F A B C) + //! S = () void Prepend (IntPatch_SequenceOfSegmentOfTheSOnBounds& S); + //! Inserts in before the position . + //! Raises an exception if the index is out of bounds. + //! Example: + //! before + //! me = (A B D), Index = 3, T = C + //! after + //! me = (A B C D ) void InsertBefore (const Standard_Integer Index, const IntPatch_TheSegmentOfTheSOnBounds& T); + //! Inserts the sequence in before + //! the position . is cleared. + //! Raises an exception if the index is out of bounds + //! Example: + //! before + //! me = (A B F), Index = 3, S = (C D E) + //! after + //! me = (A B C D E F) + //! S = () void InsertBefore (const Standard_Integer Index, IntPatch_SequenceOfSegmentOfTheSOnBounds& S); + //! Inserts in after the position . + //! Raises an exception if the index is out of bound + //! Example: + //! before + //! me = (A B C), Index = 3, T = D + //! after + //! me = (A B C D) Standard_EXPORT void InsertAfter (const Standard_Integer Index, const IntPatch_TheSegmentOfTheSOnBounds& T); + //! Inserts the sequence in after the + //! position . is cleared. + //! Raises an exception if the index is out of bound. + //! Example: + //! before + //! me = (A B C), Index = 3, S = (D E F) + //! after + //! me = (A B C D E F) + //! S = () void InsertAfter (const Standard_Integer Index, IntPatch_SequenceOfSegmentOfTheSOnBounds& S); + //! Returns the first element of the sequence + //! Raises an exception if the sequence is empty. + //! Example: + //! before + //! me = (A B C) + //! after + //! me = (A B C) + //! returns A Standard_EXPORT const IntPatch_TheSegmentOfTheSOnBounds& First() const; + //! Returns the last element of the sequence + //! Raises an exception if the sequence is empty. + //! Example: + //! before + //! me = (A B C) + //! after + //! me = (A B C) + //! returns C Standard_EXPORT const IntPatch_TheSegmentOfTheSOnBounds& Last() const; + //! Keeps in the items 1 to -1 and + //! puts in the items to the end. + //! Example: + //! before + //! me = (A B C D) ,Index = 3 + //! after + //! me = (A B) + //! Sub = (C D) void Split (const Standard_Integer Index, IntPatch_SequenceOfSegmentOfTheSOnBounds& Sub); + //! Returns the Item at position in . + //! Raises an exception if the index is out of bound + //! Example: + //! before + //! me = (A B C), Index = 1 + //! after + //! me = (A B C) + //! returns + //! A Standard_EXPORT const IntPatch_TheSegmentOfTheSOnBounds& Value (const Standard_Integer Index) const; const IntPatch_TheSegmentOfTheSOnBounds& operator() (const Standard_Integer Index) const { return Value(Index); } + //! Changes the item at position + //! Raises an exception if the index is out of bound + //! Example: + //! before + //! me = (A B C), Index = 1, Item = D + //! after + //! me = (D B C) Standard_EXPORT void SetValue (const Standard_Integer Index, const IntPatch_TheSegmentOfTheSOnBounds& I); + //! Returns the Item at position in + //! . This method may be used to modify + //! : S.Value(Index) = Item. + //! Raises an exception if the index is out of bound + //! Example: + //! before + //! me = (A B C), Index = 1 + //! after + //! me = (A B C) + //! returns + //! A Standard_EXPORT IntPatch_TheSegmentOfTheSOnBounds& ChangeValue (const Standard_Integer Index); IntPatch_TheSegmentOfTheSOnBounds& operator() (const Standard_Integer Index) { return ChangeValue(Index); } + //! Removes from the item at position . + //! Raises an exception if the index is out of bounds + //! Example: + //! before + //! me = (A B C), Index = 3 + //! after + //! me = (A B) Standard_EXPORT void Remove (const Standard_Integer Index); + //! Removes from all the items of + //! positions between and . + //! Raises an exception if the indices are out of bounds. + //! Example: + //! before + //! me = (A B C D E F), FromIndex = 1 ToIndex = 3 + //! after + //! me = (D E F) Standard_EXPORT void Remove (const Standard_Integer FromIndex, const Standard_Integer ToIndex); diff --git a/src/IntPatch/IntPatch_TheIWLineOfTheIWalking.hxx b/src/IntPatch/IntPatch_TheIWLineOfTheIWalking.hxx index 68c93daa8d..23113f9f4b 100644 --- a/src/IntPatch/IntPatch_TheIWLineOfTheIWalking.hxx +++ b/src/IntPatch/IntPatch_TheIWLineOfTheIWalking.hxx @@ -47,10 +47,13 @@ public: Standard_EXPORT IntPatch_TheIWLineOfTheIWalking(const IntSurf_Allocator& theAllocator = 0); + //! reverse the points in the line. Hasfirst, HasLast are kept. Standard_EXPORT void Reverse(); + //! Cut the line at the point of rank Index. void Cut (const Standard_Integer Index); + //! Add a point in the line. void AddPoint (const IntSurf_PntOn2S& P); void AddStatusFirst (const Standard_Boolean Closed, const Standard_Boolean HasFirst); @@ -63,6 +66,8 @@ public: void AddStatusLast (const Standard_Boolean HasLast, const Standard_Integer Index, const IntSurf_PathPoint& P); + //! associer a l 'indice du point sur la ligne l'indice du point + //! passant dans l'iterateur de depart void AddIndexPassing (const Standard_Integer Index); void SetTangentVector (const gp_Vec& V, const Standard_Integer Index); @@ -71,28 +76,62 @@ public: void SetTangencyAtEnd (const Standard_Boolean IsTangent); + //! Returns the number of points of the line (including first + //! point and end point : see HasLastPoint and HasFirstPoint). Standard_Integer NbPoints() const; + //! Returns the point of range Index. + //! If index <= 0 or Index > NbPoints, an exception is raised. const IntSurf_PntOn2S& Value (const Standard_Integer Index) const; + //! Returns the LineOn2S contained in the walking line. const Handle(IntSurf_LineOn2S)& Line() const; + //! Returns True if the line is closed. Standard_Boolean IsClosed() const; + //! Returns True if the first point of the line is a + //! marching point . when is HasFirstPoint==False ,the line + //! begins on the natural bound of the surface.the line can be + //! too long Standard_Boolean HasFirstPoint() const; + //! Returns True if the end point of the line is a + //! marching point (Point from IntWS). + //! when is HasFirstPoint==False ,the line ends + //! on the natural bound of the surface.the line can be + //! too long. Standard_Boolean HasLastPoint() const; + //! Returns the first point of the line when it is a + //! marching point. + //! An exception is raised if HasFirstPoint returns False. const IntSurf_PathPoint& FirstPoint() const; + //! Returns the Index of first point of the line when it is a + //! marching point.This index is the index in the + //! PointStartIterator. + //! An exception is raised if HasFirstPoint returns False. Standard_Integer FirstPointIndex() const; + //! Returns the last point of the line when it is a + //! marching point. + //! An exception is raised if HasLastPoint returns False. const IntSurf_PathPoint& LastPoint() const; + //! Returns the index of last point of the line when it is a + //! marching point.This index is the index in the + //! PointStartIterator. + //! An exception is raised if HasLastPoint returns False. Standard_Integer LastPointIndex() const; + //! returns the number of points belonging to Pnts1 which are + //! passing point. Standard_Integer NbPassingPoint() const; + //! returns the index of the point belonging to the line which + //! is associated to the passing point belonging to Pnts1 + //! an exception is raised if Index > NbPassingPoint() void PassingPoint (const Standard_Integer Index, Standard_Integer& IndexLine, Standard_Integer& IndexPnts) const; const gp_Vec& TangentVector (Standard_Integer& Index) const; diff --git a/src/IntPatch/IntPatch_TheIWalking.hxx b/src/IntPatch/IntPatch_TheIWalking.hxx index e794191eda..716185b414 100644 --- a/src/IntPatch/IntPatch_TheIWalking.hxx +++ b/src/IntPatch/IntPatch_TheIWalking.hxx @@ -59,22 +59,52 @@ public: DEFINE_STANDARD_ALLOC + //! Deflection is the maximum deflection admitted between two + //! consecutive points on a resulting polyline. + //! Step is the maximum increment admitted between two + //! consecutive points (in 2d space). + //! Epsilon is the tolerance beyond which 2 points + //! are confused. Standard_EXPORT IntPatch_TheIWalking(const Standard_Real Epsilon, const Standard_Real Deflection, const Standard_Real Step); + //! Deflection is the maximum deflection admitted between two + //! consecutive points on a resulting polyline. + //! Step is the maximum increment admitted between two + //! consecutive points (in 2d space). + //! Epsilon is the tolerance beyond which 2 points + //! are confused void SetTolerance (const Standard_Real Epsilon, const Standard_Real Deflection, const Standard_Real Step); + //! Searches a set of polylines starting on a point of Pnts1 + //! or Pnts2. + //! Each point on a resulting polyline verifies F(u,v)=0 Standard_EXPORT void Perform (const IntSurf_SequenceOfPathPoint& Pnts1, const IntSurf_SequenceOfInteriorPoint& Pnts2, IntPatch_TheSurfFunction& Func, const Handle(Adaptor3d_HSurface)& S, const Standard_Boolean Reversed = Standard_False); + //! Searches a set of polylines starting on a point of Pnts1. + //! Each point on a resulting polyline verifies F(u,v)=0 Standard_EXPORT void Perform (const IntSurf_SequenceOfPathPoint& Pnts1, IntPatch_TheSurfFunction& Func, const Handle(Adaptor3d_HSurface)& S, const Standard_Boolean Reversed = Standard_False); + //! Returns true if the calculus was successful. Standard_Boolean IsDone() const; + //! Returns the number of resulting polylines. + //! An exception is raised if IsDone returns False. Standard_Integer NbLines() const; + //! Returns the polyline of range Index. + //! An exception is raised if IsDone is False. + //! An exception is raised if Index<=0 or Index>NbLines. const Handle(IntPatch_TheIWLineOfTheIWalking)& Value (const Standard_Integer Index) const; + //! Returns the number of points belonging to Pnts on which no + //! line starts or ends. + //! An exception is raised if IsDone returns False. Standard_Integer NbSinglePnts() const; + //! Returns the point of range Index . + //! An exception is raised if IsDone returns False. + //! An exception is raised if Index<=0 or + //! Index > NbSinglePnts. const IntSurf_PathPoint& SinglePnt (const Standard_Integer Index) const; @@ -105,6 +135,7 @@ protected: Standard_EXPORT void MakeWalkingPoint (const Standard_Integer Case, const Standard_Real U, const Standard_Real V, IntPatch_TheSurfFunction& Section, IntSurf_PntOn2S& Psol); + //! Clears up internal containers Standard_EXPORT void Clear(); diff --git a/src/IntPatch/IntPatch_TheSOnBounds.hxx b/src/IntPatch/IntPatch_TheSOnBounds.hxx index ad42e7441a..38a9fbce9d 100644 --- a/src/IntPatch/IntPatch_TheSOnBounds.hxx +++ b/src/IntPatch/IntPatch_TheSOnBounds.hxx @@ -51,20 +51,44 @@ public: DEFINE_STANDARD_ALLOC + //! Empty constructor. Standard_EXPORT IntPatch_TheSOnBounds(); + //! Algorithm to find the points and parts of curves of Domain + //! (domain of of restriction of a surface) which verify + //! F = 0. + //! TolBoundary defines if a curve is on Q. + //! TolTangency defines if a point is on Q. Standard_EXPORT void Perform (IntPatch_ArcFunction& F, const Handle(Adaptor3d_TopolTool)& Domain, const Standard_Real TolBoundary, const Standard_Real TolTangency, const Standard_Boolean RecheckOnRegularity = Standard_False); + //! Returns True if the calculus was successful. Standard_Boolean IsDone() const; + //! Returns true if all arc of the Arcs are solution (inside + //! the surface). + //! An exception is raised if IsDone returns False. Standard_Boolean AllArcSolution() const; + //! Returns the number of resulting points. + //! An exception is raised if IsDone returns False (NotDone). Standard_Integer NbPoints() const; + //! Returns the resulting point of range Index. + //! The exception NotDone is raised if IsDone() returns + //! False. + //! The exception OutOfRange is raised if + //! Index <= 0 or Index > NbPoints. const IntPatch_ThePathPointOfTheSOnBounds& Point (const Standard_Integer Index) const; + //! Returns the number of the resulting segments. + //! An exception is raised if IsDone returns False (NotDone). Standard_Integer NbSegments() const; + //! Returns the resulting segment of range Index. + //! The exception NotDone is raised if IsDone() returns + //! False. + //! The exception OutOfRange is raised if + //! Index <= 0 or Index > NbPoints. const IntPatch_TheSegmentOfTheSOnBounds& Segment (const Standard_Integer Index) const; diff --git a/src/IntPatch/IntPatch_TheSearchInside.hxx b/src/IntPatch/IntPatch_TheSearchInside.hxx index 7a9c765979..1e69fd3fa4 100644 --- a/src/IntPatch/IntPatch_TheSearchInside.hxx +++ b/src/IntPatch/IntPatch_TheSearchInside.hxx @@ -53,8 +53,16 @@ public: Standard_Boolean IsDone() const; + //! Returns the number of points. + //! The exception NotDone if raised if IsDone + //! returns False. Standard_Integer NbPoints() const; + //! Returns the point of range Index. + //! The exception NotDone if raised if IsDone + //! returns False. + //! The exception OutOfRange if raised if + //! Index <= 0 or Index > NbPoints. const IntSurf_InteriorPoint& Value (const Standard_Integer Index) const; diff --git a/src/IntPatch/IntPatch_TheSegmentOfTheSOnBounds.hxx b/src/IntPatch/IntPatch_TheSegmentOfTheSOnBounds.hxx index 23a06e82d2..3ebd144e0f 100644 --- a/src/IntPatch/IntPatch_TheSegmentOfTheSOnBounds.hxx +++ b/src/IntPatch/IntPatch_TheSegmentOfTheSOnBounds.hxx @@ -37,20 +37,32 @@ public: DEFINE_STANDARD_ALLOC + //! Empty constructor. Standard_EXPORT IntPatch_TheSegmentOfTheSOnBounds(); + //! Defines the concerned arc. void SetValue (const Handle(Adaptor2d_HCurve2d)& A); + //! Defines the first point or the last point, + //! depending on the value of the boolean First. Standard_EXPORT void SetLimitPoint (const IntPatch_ThePathPointOfTheSOnBounds& V, const Standard_Boolean First); + //! Returns the geometric curve on the surface 's domain + //! which is solution. const Handle(Adaptor2d_HCurve2d)& Curve() const; + //! Returns True if there is a vertex (ThePathPoint) defining + //! the lowest valid parameter on the arc. Standard_Boolean HasFirstPoint() const; + //! Returns the first point. const IntPatch_ThePathPointOfTheSOnBounds& FirstPoint() const; + //! Returns True if there is a vertex (ThePathPoint) defining + //! the greatest valid parameter on the arc. Standard_Boolean HasLastPoint() const; + //! Returns the last point. const IntPatch_ThePathPointOfTheSOnBounds& LastPoint() const; diff --git a/src/IntPatch/IntPatch_TheSurfFunction.hxx b/src/IntPatch/IntPatch_TheSurfFunction.hxx index f0841e88b3..49f1403084 100644 --- a/src/IntPatch/IntPatch_TheSurfFunction.hxx +++ b/src/IntPatch/IntPatch_TheSurfFunction.hxx @@ -73,6 +73,8 @@ public: Standard_Real Root() const; + //! Returns the value Tol so that if Abs(Func.Root()). Standard_Integer Length() const; Standard_EXPORT void Append (const Standard_Integer& Value); + + //! Sets the th element of the array to + //! . Standard_EXPORT void SetValue (const Standard_Integer Index, const Standard_Integer& Value); + + //! Returns the value of the th element of the + //! array. Standard_EXPORT const Standard_Integer& Value (const Standard_Integer Index) const; const Standard_Integer& operator () (const Standard_Integer Index) const { return Value(Index); } + + //! Returns the value of the th element of the + //! array. Standard_EXPORT Standard_Integer& ChangeValue (const Standard_Integer Index); Standard_Integer& operator () (const Standard_Integer Index) { return ChangeValue(Index); } + + //! Applys the == operator on each array item Standard_EXPORT Standard_Boolean IsEqual (const IntTools_CArray1OfInteger& Other) const; Standard_Boolean operator == (const IntTools_CArray1OfInteger& Other) const { @@ -86,6 +123,8 @@ protected: private: + + //! Prohibits the creator by copy Standard_EXPORT IntTools_CArray1OfInteger(const IntTools_CArray1OfInteger& AnArray); diff --git a/src/IntTools/IntTools_CArray1OfReal.hxx b/src/IntTools/IntTools_CArray1OfReal.hxx index 9e4cfbdaae..5c386f1b06 100644 --- a/src/IntTools/IntTools_CArray1OfReal.hxx +++ b/src/IntTools/IntTools_CArray1OfReal.hxx @@ -37,38 +37,75 @@ public: DEFINE_STANDARD_ALLOC + + //! Creates an array of given Length. Standard_EXPORT IntTools_CArray1OfReal(const Standard_Integer Length = 0); + + //! Creates an array sharing datas with an other. + //! Example: + //! Item tab[100]; + //! CArray1OfItem thetab (tab[0],100); + //! + //! CArray1OfItem aArray1(100); + //! CArray1OfItem anSharedArray1(aArray1.ChangeValue(0),aArray1.Length()); + //! + //! Warning: + //! The validity of length are under the responsability + //! of the user. + //! The sahred array must have a valid address during the life of + //! the Array1. Standard_EXPORT IntTools_CArray1OfReal(const Standard_Real& Item, const Standard_Integer Length); + + //! Initializes the array with a given value. Standard_EXPORT void Init (const Standard_Real& V); + + //! destroy current content and realloc the new size + //! does nothing if Length() == theLength Standard_EXPORT void Resize (const Standard_Integer theNewLength); + + //! Frees the allocated area corresponding to the + //! array. Standard_EXPORT void Destroy(); ~IntTools_CArray1OfReal() { Destroy(); } + + //! Returns the number of elements of . Standard_Integer Length() const; Standard_EXPORT void Append (const Standard_Real& Value); + + //! Sets the th element of the array to + //! . Standard_EXPORT void SetValue (const Standard_Integer Index, const Standard_Real& Value); + + //! Returns the value of the th element of the + //! array. Standard_EXPORT const Standard_Real& Value (const Standard_Integer Index) const; const Standard_Real& operator () (const Standard_Integer Index) const { return Value(Index); } + + //! Returns the value of the th element of the + //! array. Standard_EXPORT Standard_Real& ChangeValue (const Standard_Integer Index); Standard_Real& operator () (const Standard_Integer Index) { return ChangeValue(Index); } + + //! Applys the == operator on each array item Standard_EXPORT Standard_Boolean IsEqual (const IntTools_CArray1OfReal& Other) const; Standard_Boolean operator == (const IntTools_CArray1OfReal& Other) const { @@ -87,6 +124,8 @@ protected: private: + + //! Prohibits the creator by copy Standard_EXPORT IntTools_CArray1OfReal(const IntTools_CArray1OfReal& AnArray); diff --git a/src/IntWalk/IntWalk_TheFunctionOfTheInt2S.hxx b/src/IntWalk/IntWalk_TheFunctionOfTheInt2S.hxx index 5a471eda33..b2b262d8e6 100644 --- a/src/IntWalk/IntWalk_TheFunctionOfTheInt2S.hxx +++ b/src/IntWalk/IntWalk_TheFunctionOfTheInt2S.hxx @@ -48,6 +48,7 @@ public: DEFINE_STANDARD_ALLOC + //! Raises Construction Error Standard_EXPORT IntWalk_TheFunctionOfTheInt2S(); Standard_EXPORT IntWalk_TheFunctionOfTheInt2S(const Handle(Adaptor3d_HSurface)& S1, const Handle(Adaptor3d_HSurface)& S2); @@ -64,6 +65,7 @@ public: Standard_EXPORT void ComputeParameters (const IntImp_ConstIsoparametric ChoixIso, const TColStd_Array1OfReal& Param, math_Vector& UVap, math_Vector& BornInf, math_Vector& BornSup, math_Vector& Tolerance); + //! returns somme des fi*fi Standard_Real Root() const; gp_Pnt Point() const; diff --git a/src/IntWalk/IntWalk_TheInt2S.hxx b/src/IntWalk/IntWalk_TheInt2S.hxx index a907cdad93..ca5af2279e 100644 --- a/src/IntWalk/IntWalk_TheInt2S.hxx +++ b/src/IntWalk/IntWalk_TheInt2S.hxx @@ -50,32 +50,68 @@ public: DEFINE_STANDARD_ALLOC + //! Raises Construction Error Standard_EXPORT IntWalk_TheInt2S(); + //! compute the solution point with the close point Standard_EXPORT IntWalk_TheInt2S(const TColStd_Array1OfReal& Param, const Handle(Adaptor3d_HSurface)& S1, const Handle(Adaptor3d_HSurface)& S2, const Standard_Real TolTangency); + //! initialize the parameters to compute the solution point + //! it 's possible to write to optimize: + //! IntImp_Int2S inter(S1,S2,Func,TolTangency); + //! math_FunctionSetRoot rsnld(inter.Function()); + //! while ...{ + //! Param(1)=... + //! Param(2)=... + //! param(3)=... + //! inter.Perform(Param,rsnld); + //! } Standard_EXPORT IntWalk_TheInt2S(const Handle(Adaptor3d_HSurface)& S1, const Handle(Adaptor3d_HSurface)& S2, const Standard_Real TolTangency); + //! returns the best constant isoparametric to find + //! the next intersection's point +stores the solution + //! point (the solution point is found with the close point + //! to intersect the isoparametric with the other patch; + //! the choice of the isoparametic is calculated) Standard_EXPORT IntImp_ConstIsoparametric Perform (const TColStd_Array1OfReal& Param, math_FunctionSetRoot& Rsnld); + //! returns the best constant isoparametric to find + //! the next intersection's point +stores the solution + //! point (the solution point is found with the close point + //! to intersect the isoparametric with the other patch; + //! the choice of the isoparametic is given by ChoixIso) Standard_EXPORT IntImp_ConstIsoparametric Perform (const TColStd_Array1OfReal& Param, math_FunctionSetRoot& Rsnld, const IntImp_ConstIsoparametric ChoixIso); + //! Returns TRUE if the creation completed without failure. Standard_Boolean IsDone() const; + //! Returns TRUE when there is no solution to the problem. Standard_Boolean IsEmpty() const; + //! Returns the intersection point. const IntSurf_PntOn2S& Point() const; + //! Returns True if the surfaces are tangent at the + //! intersection point. Standard_Boolean IsTangent() const; + //! Returns the tangent at the intersection line. const gp_Dir& Direction() const; + //! Returns the tangent at the intersection line in the + //! parametric space of the first surface. const gp_Dir2d& DirectionOnS1() const; + //! Returns the tangent at the intersection line in the + //! parametric space of the second surface. const gp_Dir2d& DirectionOnS2() const; + //! return the math function which + //! is used to compute the intersection IntWalk_TheFunctionOfTheInt2S& Function(); + //! return the intersection point which is + //! enable for changing. IntSurf_PntOn2S& ChangePoint(); diff --git a/src/Interface/Interface_GeneralLib.hxx b/src/Interface/Interface_GeneralLib.hxx index 2511129adf..c7c0bf5112 100644 --- a/src/Interface/Interface_GeneralLib.hxx +++ b/src/Interface/Interface_GeneralLib.hxx @@ -39,28 +39,56 @@ public: DEFINE_STANDARD_ALLOC + //! Adds a couple (Module-Protocol) into the global definition set + //! for this class of Library. Standard_EXPORT static void SetGlobal (const Handle(Interface_GeneralModule)& amodule, const Handle(Interface_Protocol)& aprotocol); + //! Creates a Library which complies with a Protocol, that is : + //! Same class (criterium IsInstance) + //! This creation gets the Modules from the global set, those + //! which are bound to the given Protocol and its Resources Standard_EXPORT Interface_GeneralLib(const Handle(Interface_Protocol)& aprotocol); + //! Creates an empty Library : it will later by filled by method + //! AddProtocol Standard_EXPORT Interface_GeneralLib(); + //! Adds a couple (Module-Protocol) to the Library, given the + //! class of a Protocol. Takes Resources into account. + //! (if is not of type TheProtocol, it is not added) Standard_EXPORT void AddProtocol (const Handle(Standard_Transient)& aprotocol); + //! Clears the list of Modules of a library (can be used to + //! redefine the order of Modules before action : Clear then + //! refill the Library by calls to AddProtocol) Standard_EXPORT void Clear(); + //! Sets a library to be defined with the complete Global list + //! (all the couples Protocol/Modules recorded in it) Standard_EXPORT void SetComplete(); + //! Selects a Module from the Library, given an Object. + //! Returns True if Select has succeeded, False else. + //! Also Returns (as arguments) the selected Module and the Case + //! Number determined by the associated Protocol. + //! If Select has failed, is Null Handle and CN is zero. + //! (Select can work on any criterium, such as Object DynamicType) Standard_EXPORT Standard_Boolean Select (const Handle(Standard_Transient)& obj, Handle(Interface_GeneralModule)& module, Standard_Integer& CN) const; + //! Starts Iteration on the Modules (sets it on the first one) Standard_EXPORT void Start(); + //! Returns True if there are more Modules to iterate on Standard_EXPORT Standard_Boolean More() const; + //! Iterates by getting the next Module in the list + //! If there is none, the exception will be raised by Value Standard_EXPORT void Next(); + //! Returns the current Module in the Iteration Standard_EXPORT const Handle(Interface_GeneralModule)& Module() const; + //! Returns the current Protocol in the Iteration Standard_EXPORT const Handle(Interface_Protocol)& Protocol() const; diff --git a/src/Interface/Interface_GlobalNodeOfGeneralLib.hxx b/src/Interface/Interface_GlobalNodeOfGeneralLib.hxx index ef09ac7a59..ba35ef8ff9 100644 --- a/src/Interface/Interface_GlobalNodeOfGeneralLib.hxx +++ b/src/Interface/Interface_GlobalNodeOfGeneralLib.hxx @@ -38,14 +38,23 @@ class Interface_GlobalNodeOfGeneralLib : public Standard_Transient public: + //! Creates an empty GlobalNode, with no Next Standard_EXPORT Interface_GlobalNodeOfGeneralLib(); + //! Adds a Module bound with a Protocol to the list : does + //! nothing if already in the list, THAT IS, Same Type (exact + //! match) and Same State (that is, IsEqual is not required) + //! Once added, stores its attached Protocol in correspondance Standard_EXPORT void Add (const Handle(Interface_GeneralModule)& amodule, const Handle(Interface_Protocol)& aprotocol); + //! Returns the Module stored in a given GlobalNode Standard_EXPORT const Handle(Interface_GeneralModule)& Module() const; + //! Returns the attached Protocol stored in a given GlobalNode Standard_EXPORT const Handle(Interface_Protocol)& Protocol() const; + //! Returns the Next GlobalNode. If none is defined, returned + //! value is a Null Handle Standard_EXPORT const Handle(Interface_GlobalNodeOfGeneralLib)& Next() const; diff --git a/src/Interface/Interface_GlobalNodeOfReaderLib.hxx b/src/Interface/Interface_GlobalNodeOfReaderLib.hxx index 42f5d1dcbf..b9a5905fc7 100644 --- a/src/Interface/Interface_GlobalNodeOfReaderLib.hxx +++ b/src/Interface/Interface_GlobalNodeOfReaderLib.hxx @@ -38,14 +38,23 @@ class Interface_GlobalNodeOfReaderLib : public Standard_Transient public: + //! Creates an empty GlobalNode, with no Next Standard_EXPORT Interface_GlobalNodeOfReaderLib(); + //! Adds a Module bound with a Protocol to the list : does + //! nothing if already in the list, THAT IS, Same Type (exact + //! match) and Same State (that is, IsEqual is not required) + //! Once added, stores its attached Protocol in correspondance Standard_EXPORT void Add (const Handle(Interface_ReaderModule)& amodule, const Handle(Interface_Protocol)& aprotocol); + //! Returns the Module stored in a given GlobalNode Standard_EXPORT const Handle(Interface_ReaderModule)& Module() const; + //! Returns the attached Protocol stored in a given GlobalNode Standard_EXPORT const Handle(Interface_Protocol)& Protocol() const; + //! Returns the Next GlobalNode. If none is defined, returned + //! value is a Null Handle Standard_EXPORT const Handle(Interface_GlobalNodeOfReaderLib)& Next() const; diff --git a/src/Interface/Interface_NodeOfGeneralLib.hxx b/src/Interface/Interface_NodeOfGeneralLib.hxx index ff6e4ab515..c9910f282b 100644 --- a/src/Interface/Interface_NodeOfGeneralLib.hxx +++ b/src/Interface/Interface_NodeOfGeneralLib.hxx @@ -38,14 +38,21 @@ class Interface_NodeOfGeneralLib : public MMgt_TShared public: + //! Creates an empty Node, with no Next Standard_EXPORT Interface_NodeOfGeneralLib(); + //! Adds a couple (Module,Protocol), that is, stores it into + //! itself if not yet done, else creates a Next Node to do it Standard_EXPORT void AddNode (const Handle(Interface_GlobalNodeOfGeneralLib)& anode); + //! Returns the Module designated by a precise Node Standard_EXPORT const Handle(Interface_GeneralModule)& Module() const; + //! Returns the Protocol designated by a precise Node Standard_EXPORT const Handle(Interface_Protocol)& Protocol() const; + //! Returns the Next Node. If none was defined, returned value + //! is a Null Handle Standard_EXPORT const Handle(Interface_NodeOfGeneralLib)& Next() const; diff --git a/src/Interface/Interface_NodeOfReaderLib.hxx b/src/Interface/Interface_NodeOfReaderLib.hxx index e637337f84..64c4e1a3bb 100644 --- a/src/Interface/Interface_NodeOfReaderLib.hxx +++ b/src/Interface/Interface_NodeOfReaderLib.hxx @@ -38,14 +38,21 @@ class Interface_NodeOfReaderLib : public MMgt_TShared public: + //! Creates an empty Node, with no Next Standard_EXPORT Interface_NodeOfReaderLib(); + //! Adds a couple (Module,Protocol), that is, stores it into + //! itself if not yet done, else creates a Next Node to do it Standard_EXPORT void AddNode (const Handle(Interface_GlobalNodeOfReaderLib)& anode); + //! Returns the Module designated by a precise Node Standard_EXPORT const Handle(Interface_ReaderModule)& Module() const; + //! Returns the Protocol designated by a precise Node Standard_EXPORT const Handle(Interface_Protocol)& Protocol() const; + //! Returns the Next Node. If none was defined, returned value + //! is a Null Handle Standard_EXPORT const Handle(Interface_NodeOfReaderLib)& Next() const; diff --git a/src/Interface/Interface_ReaderLib.hxx b/src/Interface/Interface_ReaderLib.hxx index f709bc2cb6..7d982d8e0b 100644 --- a/src/Interface/Interface_ReaderLib.hxx +++ b/src/Interface/Interface_ReaderLib.hxx @@ -39,28 +39,56 @@ public: DEFINE_STANDARD_ALLOC + //! Adds a couple (Module-Protocol) into the global definition set + //! for this class of Library. Standard_EXPORT static void SetGlobal (const Handle(Interface_ReaderModule)& amodule, const Handle(Interface_Protocol)& aprotocol); + //! Creates a Library which complies with a Protocol, that is : + //! Same class (criterium IsInstance) + //! This creation gets the Modules from the global set, those + //! which are bound to the given Protocol and its Resources Standard_EXPORT Interface_ReaderLib(const Handle(Interface_Protocol)& aprotocol); + //! Creates an empty Library : it will later by filled by method + //! AddProtocol Standard_EXPORT Interface_ReaderLib(); + //! Adds a couple (Module-Protocol) to the Library, given the + //! class of a Protocol. Takes Resources into account. + //! (if is not of type TheProtocol, it is not added) Standard_EXPORT void AddProtocol (const Handle(Standard_Transient)& aprotocol); + //! Clears the list of Modules of a library (can be used to + //! redefine the order of Modules before action : Clear then + //! refill the Library by calls to AddProtocol) Standard_EXPORT void Clear(); + //! Sets a library to be defined with the complete Global list + //! (all the couples Protocol/Modules recorded in it) Standard_EXPORT void SetComplete(); + //! Selects a Module from the Library, given an Object. + //! Returns True if Select has succeeded, False else. + //! Also Returns (as arguments) the selected Module and the Case + //! Number determined by the associated Protocol. + //! If Select has failed, is Null Handle and CN is zero. + //! (Select can work on any criterium, such as Object DynamicType) Standard_EXPORT Standard_Boolean Select (const Handle(Standard_Transient)& obj, Handle(Interface_ReaderModule)& module, Standard_Integer& CN) const; + //! Starts Iteration on the Modules (sets it on the first one) Standard_EXPORT void Start(); + //! Returns True if there are more Modules to iterate on Standard_EXPORT Standard_Boolean More() const; + //! Iterates by getting the next Module in the list + //! If there is none, the exception will be raised by Value Standard_EXPORT void Next(); + //! Returns the current Module in the Iteration Standard_EXPORT const Handle(Interface_ReaderModule)& Module() const; + //! Returns the current Protocol in the Iteration Standard_EXPORT const Handle(Interface_Protocol)& Protocol() const; diff --git a/src/LProp3d/LProp3d_CLProps.hxx b/src/LProp3d/LProp3d_CLProps.hxx index 80d7dfbf82..4a11aeaa29 100644 --- a/src/LProp3d/LProp3d_CLProps.hxx +++ b/src/LProp3d/LProp3d_CLProps.hxx @@ -46,32 +46,68 @@ public: DEFINE_STANDARD_ALLOC + //! Initializes the local properties of the curve + //! The current point and the derivatives are + //! computed at the same time, which allows an + //! optimization of the computation time. + //! indicates the maximum number of derivations to + //! be done (0, 1, 2 or 3). For example, to compute + //! only the tangent, N should be equal to 1. + //! is the linear tolerance (it is used to test + //! if a vector is null). Standard_EXPORT LProp3d_CLProps(const Handle(Adaptor3d_HCurve)& C, const Standard_Integer N, const Standard_Real Resolution); + //! Same as previous constructor but here the parameter is + //! set to the value . + //! All the computations done will be related to and . Standard_EXPORT LProp3d_CLProps(const Handle(Adaptor3d_HCurve)& C, const Standard_Real U, const Standard_Integer N, const Standard_Real Resolution); + //! Same as previous constructor but here the parameter is + //! set to the value and the curve is set + //! with SetCurve. + //! the curve can have a empty constructor + //! All the computations done will be related to and + //! when the functions "set" will be done. Standard_EXPORT LProp3d_CLProps(const Standard_Integer N, const Standard_Real Resolution); + //! Initializes the local properties of the curve + //! for the parameter value . Standard_EXPORT void SetParameter (const Standard_Real U); + //! Initializes the local properties of the curve + //! for the new curve. Standard_EXPORT void SetCurve (const Handle(Adaptor3d_HCurve)& C); + //! Returns the Point. Standard_EXPORT const gp_Pnt& Value() const; + //! Returns the first derivative. + //! The derivative is computed if it has not been yet. Standard_EXPORT const gp_Vec& D1(); + //! Returns the second derivative. + //! The derivative is computed if it has not been yet. Standard_EXPORT const gp_Vec& D2(); + //! Returns the third derivative. + //! The derivative is computed if it has not been yet. Standard_EXPORT const gp_Vec& D3(); + //! Returns True if the tangent is defined. + //! For example, the tangent is not defined if the + //! three first derivatives are all null. Standard_EXPORT Standard_Boolean IsTangentDefined(); + //! output the tangent direction Standard_EXPORT void Tangent (gp_Dir& D); + //! Returns the curvature. Standard_EXPORT Standard_Real Curvature(); + //! Returns the normal direction . Standard_EXPORT void Normal (gp_Dir& N); + //! Returns the centre of curvature

. Standard_EXPORT void CentreOfCurvature (gp_Pnt& P); diff --git a/src/LProp3d/LProp3d_SLProps.hxx b/src/LProp3d/LProp3d_SLProps.hxx index 967a02caef..6e950ee8fc 100644 --- a/src/LProp3d/LProp3d_SLProps.hxx +++ b/src/LProp3d/LProp3d_SLProps.hxx @@ -46,52 +46,101 @@ public: DEFINE_STANDARD_ALLOC + //! Initializes the local properties of the surface + //! for the parameter values (, ). + //! The current point and the derivatives are + //! computed at the same time, which allows an + //! optimization of the computation time. + //! indicates the maximum number of derivations to + //! be done (0, 1, or 2). For example, to compute + //! only the tangent, N should be equal to 1. + //! is the linear tolerance (it is used to test + //! if a vector is null). Standard_EXPORT LProp3d_SLProps(const Handle(Adaptor3d_HSurface)& S, const Standard_Real U, const Standard_Real V, const Standard_Integer N, const Standard_Real Resolution); + //! idem as previous constructor but without setting the value + //! of parameters and . Standard_EXPORT LProp3d_SLProps(const Handle(Adaptor3d_HSurface)& S, const Standard_Integer N, const Standard_Real Resolution); + //! idem as previous constructor but without setting the value + //! of parameters and and the surface. + //! the surface can have an empty constructor. Standard_EXPORT LProp3d_SLProps(const Standard_Integer N, const Standard_Real Resolution); + //! Initializes the local properties of the surface S + //! for the new surface. Standard_EXPORT void SetSurface (const Handle(Adaptor3d_HSurface)& S); + //! Initializes the local properties of the surface S + //! for the new parameter values (, ). Standard_EXPORT void SetParameters (const Standard_Real U, const Standard_Real V); + //! Returns the point. Standard_EXPORT const gp_Pnt& Value() const; + //! Returns the first U derivative. + //! The derivative is computed if it has not been yet. Standard_EXPORT const gp_Vec& D1U(); + //! Returns the first V derivative. + //! The derivative is computed if it has not been yet. Standard_EXPORT const gp_Vec& D1V(); + //! Returns the second U derivatives + //! The derivative is computed if it has not been yet. Standard_EXPORT const gp_Vec& D2U(); + //! Returns the second V derivative. + //! The derivative is computed if it has not been yet. Standard_EXPORT const gp_Vec& D2V(); + //! Returns the second UV cross-derivative. + //! The derivative is computed if it has not been yet. Standard_EXPORT const gp_Vec& DUV(); + //! returns True if the U tangent is defined. + //! For example, the tangent is not defined if the + //! two first U derivatives are null. Standard_EXPORT Standard_Boolean IsTangentUDefined(); + //! Returns the tangent direction on the iso-V. Standard_EXPORT void TangentU (gp_Dir& D); + //! returns if the V tangent is defined. + //! For example, the tangent is not defined if the + //! two first V derivatives are null. Standard_EXPORT Standard_Boolean IsTangentVDefined(); + //! Returns the tangent direction on the iso-V. Standard_EXPORT void TangentV (gp_Dir& D); + //! Tells if the normal is defined. Standard_EXPORT Standard_Boolean IsNormalDefined(); + //! Returns the normal direction. Standard_EXPORT const gp_Dir& Normal(); + //! returns True if the curvature is defined. Standard_EXPORT Standard_Boolean IsCurvatureDefined(); + //! returns True if the point is umbilic (i.e. if the + //! curvature is constant). Standard_EXPORT Standard_Boolean IsUmbilic(); + //! Returns the maximum curvature Standard_EXPORT Standard_Real MaxCurvature(); + //! Returns the minimum curvature Standard_EXPORT Standard_Real MinCurvature(); + //! Returns the direction of the maximum and minimum curvature + //! and Standard_EXPORT void CurvatureDirections (gp_Dir& MaxD, gp_Dir& MinD); + //! Returns the mean curvature. Standard_EXPORT Standard_Real MeanCurvature(); + //! Returns the Gaussian curvature Standard_EXPORT Standard_Real GaussianCurvature(); diff --git a/src/ProjLib/ProjLib_HCompProjectedCurve.hxx b/src/ProjLib/ProjLib_HCompProjectedCurve.hxx index 07541e5e3a..d9273cd1ee 100644 --- a/src/ProjLib/ProjLib_HCompProjectedCurve.hxx +++ b/src/ProjLib/ProjLib_HCompProjectedCurve.hxx @@ -39,14 +39,20 @@ class ProjLib_HCompProjectedCurve : public Adaptor2d_HCurve2d public: + //! Creates an empty GenHCurve2d. Standard_EXPORT ProjLib_HCompProjectedCurve(); + //! Creates a GenHCurve2d from a Curve Standard_EXPORT ProjLib_HCompProjectedCurve(const ProjLib_CompProjectedCurve& C); + //! Sets the field of the GenHCurve2d. Standard_EXPORT void Set (const ProjLib_CompProjectedCurve& C); + //! Returns the curve used to create the GenHCurve2d. + //! This is redefined from HCurve2d, cannot be inline. Standard_EXPORT const Adaptor2d_Curve2d& Curve2d() const; + //! Returns the curve used to create the GenHCurve. ProjLib_CompProjectedCurve& ChangeCurve2d(); diff --git a/src/ProjLib/ProjLib_HProjectedCurve.hxx b/src/ProjLib/ProjLib_HProjectedCurve.hxx index 13bd92709e..5940e621de 100644 --- a/src/ProjLib/ProjLib_HProjectedCurve.hxx +++ b/src/ProjLib/ProjLib_HProjectedCurve.hxx @@ -39,14 +39,20 @@ class ProjLib_HProjectedCurve : public Adaptor2d_HCurve2d public: + //! Creates an empty GenHCurve2d. Standard_EXPORT ProjLib_HProjectedCurve(); + //! Creates a GenHCurve2d from a Curve Standard_EXPORT ProjLib_HProjectedCurve(const ProjLib_ProjectedCurve& C); + //! Sets the field of the GenHCurve2d. Standard_EXPORT void Set (const ProjLib_ProjectedCurve& C); + //! Returns the curve used to create the GenHCurve2d. + //! This is redefined from HCurve2d, cannot be inline. Standard_EXPORT const Adaptor2d_Curve2d& Curve2d() const; + //! Returns the curve used to create the GenHCurve. ProjLib_ProjectedCurve& ChangeCurve2d(); diff --git a/src/STEPCAFControl/STEPCAFControl_DictionaryOfExternFile.hxx b/src/STEPCAFControl/STEPCAFControl_DictionaryOfExternFile.hxx index 48b1cb5686..36d2c9ba08 100644 --- a/src/STEPCAFControl/STEPCAFControl_DictionaryOfExternFile.hxx +++ b/src/STEPCAFControl/STEPCAFControl_DictionaryOfExternFile.hxx @@ -42,40 +42,87 @@ class STEPCAFControl_DictionaryOfExternFile : public MMgt_TShared public: + //! Creates a Dictionary cell. + //! A Dictionary is always created then handled by its first cell + //! After creating a Dictionary, user can call methods HasItem, + //! Item, SetItem ... (internal cells and entries are also + //! defined as objects from the same class) + //! Also iteration can be made, by an Iterator on this Dictionary Standard_EXPORT STEPCAFControl_DictionaryOfExternFile(); + //! Returns True if an Item is bound to a Name in the Dictionnary + //! : if True, commands exact matching + //! if False, accept completion, only if ONE AND ONLY ONE + //! Dictionnary Entry has as beginning of its name Standard_EXPORT Standard_Boolean HasItem (const Standard_CString name, const Standard_Boolean exact = Standard_False) const; + //! Works as above method but accepts a String from TCollection Standard_EXPORT Standard_Boolean HasItem (const TCollection_AsciiString& name, const Standard_Boolean exact = Standard_True) const; + //! Returns item bound to a name in the Dictionnary + //! : same as for HasItem Standard_EXPORT const Handle(STEPCAFControl_ExternFile)& Item (const Standard_CString name, const Standard_Boolean exact = Standard_True) const; + //! Works as above method but accepts a String from TCollection Standard_EXPORT const Handle(STEPCAFControl_ExternFile)& Item (const TCollection_AsciiString& name, const Standard_Boolean exact = Standard_True) const; + //! Gathers HasItem and Item, in a less regular but faster way + //! If return is True, is returned too, else it is not + //! : same as for HasItem Standard_EXPORT Standard_Boolean GetItem (const Standard_CString name, Handle(STEPCAFControl_ExternFile)& anitem, const Standard_Boolean exact = Standard_True) const; + //! Works as above method but accepts a String from TCollection Standard_EXPORT Standard_Boolean GetItem (const TCollection_AsciiString& name, Handle(STEPCAFControl_ExternFile)& anitem, const Standard_Boolean exact = Standard_True) const; + //! Binds an item to a dictionnary entry + //! If is already known in the dictionary, its value + //! is changed. Else, the dictionary entry is created. + //! If is given False, completion is tried, it is accepted + //! If it gives a UNIQUE entry : hence this one will be modified + //! Else, new entry is created with the exact name given Standard_EXPORT void SetItem (const Standard_CString name, const Handle(STEPCAFControl_ExternFile)& anitem, const Standard_Boolean exact = Standard_True); + //! Works as above method but accepts a String from TCollection Standard_EXPORT void SetItem (const TCollection_AsciiString& name, const Handle(STEPCAFControl_ExternFile)& anitem, const Standard_Boolean exact = Standard_True); + //! Returns the Item AS AN ADDRESS which corresponds to a Name, + //! in order to be changed or set. + //! If this name is not yet recorded, the Dictionary creates it. + //! is returned True if the Item is recorded in the + //! Dictionary, False else, in that case the Item is reserved and + //! the name is noted as beeing valued now. Standard_EXPORT Handle(STEPCAFControl_ExternFile)& NewItem (const Standard_CString name, Standard_Boolean& isvalued, const Standard_Boolean exact = Standard_True); + //! Works as above method but accepts a String from TCollection Standard_EXPORT Handle(STEPCAFControl_ExternFile)& NewItem (const TCollection_AsciiString& name, Standard_Boolean& isvalued, const Standard_Boolean exact = Standard_True); + //! Removes a dictionary entry given by its name then Returns True + //! If the entry does not exists, Does nothing then Returns False + //! : as for HasItem, if completion works, the found entry + //! is removed (else returned value is False) + //! commands cleaning dictionary (to recover memory space) + //! For an isolated call, it is recommanded to give it at True + //! For a sequence of calls, rather give False, then call Clean Standard_EXPORT Standard_Boolean RemoveItem (const Standard_CString name, const Standard_Boolean cln = Standard_True, const Standard_Boolean exact = Standard_True); + //! Works as above method but accepts a String from TCollection Standard_EXPORT Standard_Boolean RemoveItem (const TCollection_AsciiString& name, const Standard_Boolean cln = Standard_True, const Standard_Boolean exact = Standard_True); + //! Deletes physically in one step the entries which were removed + //! (can be used for a more efficient Memory Management : first + //! Remove several Items ( = False), then Clean the Memory) Standard_EXPORT void Clean(); + //! Returns True if no Item is recorded Standard_EXPORT Standard_Boolean IsEmpty() const; + //! Clears all the Dictionary : all recorded Items are removed Standard_EXPORT void Clear(); + //! Copies the Dictionary as a Tree, without Copying the Items Standard_EXPORT Handle(STEPCAFControl_DictionaryOfExternFile) Copy() const; + //! Internal routine used for completion (returns True if success) Standard_EXPORT Standard_Boolean Complete (Handle(STEPCAFControl_DictionaryOfExternFile)& acell) const; @@ -92,38 +139,57 @@ protected: private: + //! Defines cell's character (internal use, to build dict. tree) Standard_EXPORT void SetChar (const Standard_Character car); + //! Returns True if this cell has a subcell Standard_EXPORT Standard_Boolean HasSub() const; + //! Returns subcell Standard_EXPORT Handle(STEPCAFControl_DictionaryOfExternFile) Sub() const; + //! Returns True if this cell has a next cell Standard_EXPORT Standard_Boolean HasNext() const; + //! Returns next cell Standard_EXPORT Handle(STEPCAFControl_DictionaryOfExternFile) Next() const; + //! Defines subcell Standard_EXPORT void SetSub (const Handle(STEPCAFControl_DictionaryOfExternFile)& acell); + //! Defines next cell Standard_EXPORT void SetNext (const Handle(STEPCAFControl_DictionaryOfExternFile)& acell); + //! Internal method used to get an entry from a given name Standard_EXPORT void SearchCell (const Standard_CString name, const Standard_Size lmax, const Standard_Character car, const Standard_Size level, Handle(STEPCAFControl_DictionaryOfExternFile)& acell, Standard_Size& reslev, Standard_Integer& stat) const; + //! Internal method used to create a new entry for a name Standard_EXPORT void NewCell (const Standard_CString name, const Standard_Size namlen, Handle(STEPCAFControl_DictionaryOfExternFile)& acell, const Standard_Size reslev, const Standard_Integer stat); + //! Returns True if a cell has an associated item value Standard_EXPORT Standard_Boolean HasIt() const; + //! Returns item value associated to a cell Standard_EXPORT const Handle(STEPCAFControl_ExternFile)& It() const; + //! Returns item address associated to a cell Standard_EXPORT Handle(STEPCAFControl_ExternFile)& ItAdr(); + //! Binds an item value to a cell Standard_EXPORT void SetIt (const Handle(STEPCAFControl_ExternFile)& anitem); + //! Declares a cell as Valued : used by NewItem (when an Item + //! is created if it did not exist and is returned) Standard_EXPORT void DeclIt(); + //! Removes item bound to a cell (cancels effect of DeclIt) Standard_EXPORT void RemoveIt(); + //! Returns cell's character as a node feature Standard_EXPORT Standard_Character CellChar() const; + //! Performs Copy from an original to + //! Called by Copy Standard_EXPORT void GetCopied (const Handle(STEPCAFControl_DictionaryOfExternFile)& fromcell); Standard_Character thecars[4]; diff --git a/src/STEPCAFControl/STEPCAFControl_IteratorOfDictionaryOfExternFile.hxx b/src/STEPCAFControl/STEPCAFControl_IteratorOfDictionaryOfExternFile.hxx index a1f24a5364..f3eda980a2 100644 --- a/src/STEPCAFControl/STEPCAFControl_IteratorOfDictionaryOfExternFile.hxx +++ b/src/STEPCAFControl/STEPCAFControl_IteratorOfDictionaryOfExternFile.hxx @@ -39,20 +39,32 @@ public: DEFINE_STANDARD_ALLOC + //! Creates an iterator which will work on all the dictionary Standard_EXPORT STEPCAFControl_IteratorOfDictionaryOfExternFile(const Handle(STEPCAFControl_DictionaryOfExternFile)& acell); + //! Creates an iterator which will consider only entries + //! which name begin by the string given as basename (subpart) Standard_EXPORT STEPCAFControl_IteratorOfDictionaryOfExternFile(const Handle(STEPCAFControl_DictionaryOfExternFile)& acell, const Standard_CString basename); + //! Creates an iterator which will consider only entries + //! which name begin by the string given as basename (subpart) + //! Same as above, but basename is String instead of CString Standard_EXPORT STEPCAFControl_IteratorOfDictionaryOfExternFile(const Handle(STEPCAFControl_DictionaryOfExternFile)& acell, const TCollection_AsciiString& basename); + //! Allows to Start a new Iteration from beginning Standard_EXPORT void Start(); + //! Returns True if there are more entries to return Standard_EXPORT Standard_Boolean More(); + //! Go to the next entry + //! (if there is not, Value will raise an exception) Standard_EXPORT void Next(); + //! Returns item value of current entry Standard_EXPORT const Handle(STEPCAFControl_ExternFile)& Value() const; + //! Returns name of current entry Standard_EXPORT TCollection_AsciiString Name() const; @@ -67,6 +79,7 @@ protected: private: + //! Appends a new value to the Iteration Stack Standard_EXPORT void AppendStack (const Handle(STEPCAFControl_DictionaryOfExternFile)& val); diff --git a/src/STEPCAFControl/STEPCAFControl_StackItemOfDictionaryOfExternFile.hxx b/src/STEPCAFControl/STEPCAFControl_StackItemOfDictionaryOfExternFile.hxx index 1ab2b1a385..f153fb3399 100644 --- a/src/STEPCAFControl/STEPCAFControl_StackItemOfDictionaryOfExternFile.hxx +++ b/src/STEPCAFControl/STEPCAFControl_StackItemOfDictionaryOfExternFile.hxx @@ -35,14 +35,19 @@ class STEPCAFControl_StackItemOfDictionaryOfExternFile : public MMgt_TShared public: + //! Creates a StackItem with no Previous one Standard_EXPORT STEPCAFControl_StackItemOfDictionaryOfExternFile(); + //! Creates a StackItem with a Previous one Standard_EXPORT STEPCAFControl_StackItemOfDictionaryOfExternFile(const Handle(STEPCAFControl_StackItemOfDictionaryOfExternFile)& previous); + //! Returns the Previous Item (is Null if no Previous defined) Standard_EXPORT Handle(STEPCAFControl_StackItemOfDictionaryOfExternFile) Previous() const; + //! Returns the Dictionary Cell corresponding to an Item Standard_EXPORT Handle(STEPCAFControl_DictionaryOfExternFile) Value() const; + //! Sets a new Dictionary Cell as Value of an Item Standard_EXPORT void SetValue (const Handle(STEPCAFControl_DictionaryOfExternFile)& cval); diff --git a/src/ShapeProcess/ShapeProcess_DictionaryOfOperator.hxx b/src/ShapeProcess/ShapeProcess_DictionaryOfOperator.hxx index 570676ce47..189c07bef6 100644 --- a/src/ShapeProcess/ShapeProcess_DictionaryOfOperator.hxx +++ b/src/ShapeProcess/ShapeProcess_DictionaryOfOperator.hxx @@ -42,40 +42,87 @@ class ShapeProcess_DictionaryOfOperator : public MMgt_TShared public: + //! Creates a Dictionary cell. + //! A Dictionary is always created then handled by its first cell + //! After creating a Dictionary, user can call methods HasItem, + //! Item, SetItem ... (internal cells and entries are also + //! defined as objects from the same class) + //! Also iteration can be made, by an Iterator on this Dictionary Standard_EXPORT ShapeProcess_DictionaryOfOperator(); + //! Returns True if an Item is bound to a Name in the Dictionnary + //! : if True, commands exact matching + //! if False, accept completion, only if ONE AND ONLY ONE + //! Dictionnary Entry has as beginning of its name Standard_EXPORT Standard_Boolean HasItem (const Standard_CString name, const Standard_Boolean exact = Standard_False) const; + //! Works as above method but accepts a String from TCollection Standard_EXPORT Standard_Boolean HasItem (const TCollection_AsciiString& name, const Standard_Boolean exact = Standard_True) const; + //! Returns item bound to a name in the Dictionnary + //! : same as for HasItem Standard_EXPORT const Handle(ShapeProcess_Operator)& Item (const Standard_CString name, const Standard_Boolean exact = Standard_True) const; + //! Works as above method but accepts a String from TCollection Standard_EXPORT const Handle(ShapeProcess_Operator)& Item (const TCollection_AsciiString& name, const Standard_Boolean exact = Standard_True) const; + //! Gathers HasItem and Item, in a less regular but faster way + //! If return is True, is returned too, else it is not + //! : same as for HasItem Standard_EXPORT Standard_Boolean GetItem (const Standard_CString name, Handle(ShapeProcess_Operator)& anitem, const Standard_Boolean exact = Standard_True) const; + //! Works as above method but accepts a String from TCollection Standard_EXPORT Standard_Boolean GetItem (const TCollection_AsciiString& name, Handle(ShapeProcess_Operator)& anitem, const Standard_Boolean exact = Standard_True) const; + //! Binds an item to a dictionnary entry + //! If is already known in the dictionary, its value + //! is changed. Else, the dictionary entry is created. + //! If is given False, completion is tried, it is accepted + //! If it gives a UNIQUE entry : hence this one will be modified + //! Else, new entry is created with the exact name given Standard_EXPORT void SetItem (const Standard_CString name, const Handle(ShapeProcess_Operator)& anitem, const Standard_Boolean exact = Standard_True); + //! Works as above method but accepts a String from TCollection Standard_EXPORT void SetItem (const TCollection_AsciiString& name, const Handle(ShapeProcess_Operator)& anitem, const Standard_Boolean exact = Standard_True); + //! Returns the Item AS AN ADDRESS which corresponds to a Name, + //! in order to be changed or set. + //! If this name is not yet recorded, the Dictionary creates it. + //! is returned True if the Item is recorded in the + //! Dictionary, False else, in that case the Item is reserved and + //! the name is noted as beeing valued now. Standard_EXPORT Handle(ShapeProcess_Operator)& NewItem (const Standard_CString name, Standard_Boolean& isvalued, const Standard_Boolean exact = Standard_True); + //! Works as above method but accepts a String from TCollection Standard_EXPORT Handle(ShapeProcess_Operator)& NewItem (const TCollection_AsciiString& name, Standard_Boolean& isvalued, const Standard_Boolean exact = Standard_True); + //! Removes a dictionary entry given by its name then Returns True + //! If the entry does not exists, Does nothing then Returns False + //! : as for HasItem, if completion works, the found entry + //! is removed (else returned value is False) + //! commands cleaning dictionary (to recover memory space) + //! For an isolated call, it is recommanded to give it at True + //! For a sequence of calls, rather give False, then call Clean Standard_EXPORT Standard_Boolean RemoveItem (const Standard_CString name, const Standard_Boolean cln = Standard_True, const Standard_Boolean exact = Standard_True); + //! Works as above method but accepts a String from TCollection Standard_EXPORT Standard_Boolean RemoveItem (const TCollection_AsciiString& name, const Standard_Boolean cln = Standard_True, const Standard_Boolean exact = Standard_True); + //! Deletes physically in one step the entries which were removed + //! (can be used for a more efficient Memory Management : first + //! Remove several Items ( = False), then Clean the Memory) Standard_EXPORT void Clean(); + //! Returns True if no Item is recorded Standard_EXPORT Standard_Boolean IsEmpty() const; + //! Clears all the Dictionary : all recorded Items are removed Standard_EXPORT void Clear(); + //! Copies the Dictionary as a Tree, without Copying the Items Standard_EXPORT Handle(ShapeProcess_DictionaryOfOperator) Copy() const; + //! Internal routine used for completion (returns True if success) Standard_EXPORT Standard_Boolean Complete (Handle(ShapeProcess_DictionaryOfOperator)& acell) const; @@ -92,38 +139,57 @@ protected: private: + //! Defines cell's character (internal use, to build dict. tree) Standard_EXPORT void SetChar (const Standard_Character car); + //! Returns True if this cell has a subcell Standard_EXPORT Standard_Boolean HasSub() const; + //! Returns subcell Standard_EXPORT Handle(ShapeProcess_DictionaryOfOperator) Sub() const; + //! Returns True if this cell has a next cell Standard_EXPORT Standard_Boolean HasNext() const; + //! Returns next cell Standard_EXPORT Handle(ShapeProcess_DictionaryOfOperator) Next() const; + //! Defines subcell Standard_EXPORT void SetSub (const Handle(ShapeProcess_DictionaryOfOperator)& acell); + //! Defines next cell Standard_EXPORT void SetNext (const Handle(ShapeProcess_DictionaryOfOperator)& acell); + //! Internal method used to get an entry from a given name Standard_EXPORT void SearchCell (const Standard_CString name, const Standard_Size lmax, const Standard_Character car, const Standard_Size level, Handle(ShapeProcess_DictionaryOfOperator)& acell, Standard_Size& reslev, Standard_Integer& stat) const; + //! Internal method used to create a new entry for a name Standard_EXPORT void NewCell (const Standard_CString name, const Standard_Size namlen, Handle(ShapeProcess_DictionaryOfOperator)& acell, const Standard_Size reslev, const Standard_Integer stat); + //! Returns True if a cell has an associated item value Standard_EXPORT Standard_Boolean HasIt() const; + //! Returns item value associated to a cell Standard_EXPORT const Handle(ShapeProcess_Operator)& It() const; + //! Returns item address associated to a cell Standard_EXPORT Handle(ShapeProcess_Operator)& ItAdr(); + //! Binds an item value to a cell Standard_EXPORT void SetIt (const Handle(ShapeProcess_Operator)& anitem); + //! Declares a cell as Valued : used by NewItem (when an Item + //! is created if it did not exist and is returned) Standard_EXPORT void DeclIt(); + //! Removes item bound to a cell (cancels effect of DeclIt) Standard_EXPORT void RemoveIt(); + //! Returns cell's character as a node feature Standard_EXPORT Standard_Character CellChar() const; + //! Performs Copy from an original to + //! Called by Copy Standard_EXPORT void GetCopied (const Handle(ShapeProcess_DictionaryOfOperator)& fromcell); Standard_Character thecars[4]; diff --git a/src/ShapeProcess/ShapeProcess_IteratorOfDictionaryOfOperator.hxx b/src/ShapeProcess/ShapeProcess_IteratorOfDictionaryOfOperator.hxx index 1b11c4cb68..5fd914b36b 100644 --- a/src/ShapeProcess/ShapeProcess_IteratorOfDictionaryOfOperator.hxx +++ b/src/ShapeProcess/ShapeProcess_IteratorOfDictionaryOfOperator.hxx @@ -39,20 +39,32 @@ public: DEFINE_STANDARD_ALLOC + //! Creates an iterator which will work on all the dictionary Standard_EXPORT ShapeProcess_IteratorOfDictionaryOfOperator(const Handle(ShapeProcess_DictionaryOfOperator)& acell); + //! Creates an iterator which will consider only entries + //! which name begin by the string given as basename (subpart) Standard_EXPORT ShapeProcess_IteratorOfDictionaryOfOperator(const Handle(ShapeProcess_DictionaryOfOperator)& acell, const Standard_CString basename); + //! Creates an iterator which will consider only entries + //! which name begin by the string given as basename (subpart) + //! Same as above, but basename is String instead of CString Standard_EXPORT ShapeProcess_IteratorOfDictionaryOfOperator(const Handle(ShapeProcess_DictionaryOfOperator)& acell, const TCollection_AsciiString& basename); + //! Allows to Start a new Iteration from beginning Standard_EXPORT void Start(); + //! Returns True if there are more entries to return Standard_EXPORT Standard_Boolean More(); + //! Go to the next entry + //! (if there is not, Value will raise an exception) Standard_EXPORT void Next(); + //! Returns item value of current entry Standard_EXPORT const Handle(ShapeProcess_Operator)& Value() const; + //! Returns name of current entry Standard_EXPORT TCollection_AsciiString Name() const; @@ -67,6 +79,7 @@ protected: private: + //! Appends a new value to the Iteration Stack Standard_EXPORT void AppendStack (const Handle(ShapeProcess_DictionaryOfOperator)& val); diff --git a/src/ShapeProcess/ShapeProcess_StackItemOfDictionaryOfOperator.hxx b/src/ShapeProcess/ShapeProcess_StackItemOfDictionaryOfOperator.hxx index e84ce89b8e..9d9fb4afd7 100644 --- a/src/ShapeProcess/ShapeProcess_StackItemOfDictionaryOfOperator.hxx +++ b/src/ShapeProcess/ShapeProcess_StackItemOfDictionaryOfOperator.hxx @@ -35,14 +35,19 @@ class ShapeProcess_StackItemOfDictionaryOfOperator : public MMgt_TShared public: + //! Creates a StackItem with no Previous one Standard_EXPORT ShapeProcess_StackItemOfDictionaryOfOperator(); + //! Creates a StackItem with a Previous one Standard_EXPORT ShapeProcess_StackItemOfDictionaryOfOperator(const Handle(ShapeProcess_StackItemOfDictionaryOfOperator)& previous); + //! Returns the Previous Item (is Null if no Previous defined) Standard_EXPORT Handle(ShapeProcess_StackItemOfDictionaryOfOperator) Previous() const; + //! Returns the Dictionary Cell corresponding to an Item Standard_EXPORT Handle(ShapeProcess_DictionaryOfOperator) Value() const; + //! Sets a new Dictionary Cell as Value of an Item Standard_EXPORT void SetValue (const Handle(ShapeProcess_DictionaryOfOperator)& cval); diff --git a/src/StepData/StepData_FileRecognizer.hxx b/src/StepData/StepData_FileRecognizer.hxx index 5027e60d4e..dfb76af1a1 100644 --- a/src/StepData/StepData_FileRecognizer.hxx +++ b/src/StepData/StepData_FileRecognizer.hxx @@ -37,10 +37,21 @@ class StepData_FileRecognizer : public Standard_Transient public: + //! Evaluates if recognition has a result, returns it if yes + //! In case of success, Returns True and puts result in "res" + //! In case of Failure, simply Returns False + //! Works by calling deferred method Eval, and in case of failure, + //! looks for Added Recognizers to work Standard_EXPORT Standard_Boolean Evaluate (const TCollection_AsciiString& akey, Handle(Standard_Transient)& res); + //! Returns result of last recognition (call of Evaluate) Standard_EXPORT Handle(Standard_Transient) Result() const; + //! Adds a new Recognizer to the Compound, at the end + //! Several calls to Add work by adding in the order of calls : + //! Hence, when Eval has failed to recognize, Evaluate will call + //! Evaluate from the first added Recognizer if there is one, + //! and to the second if there is still no result, and so on Standard_EXPORT void Add (const Handle(StepData_FileRecognizer)& reco); @@ -51,12 +62,21 @@ public: protected: + //! Assumes that no result has yet been recognized Standard_EXPORT StepData_FileRecognizer(); + //! Records the result of the recognition. Called by specific + //! method Eval to record a result : after calling it, Eval has + //! finished and can return Standard_EXPORT void SetOK (const Handle(Standard_Transient)& aresult); + //! Records that recognition gives no result Standard_EXPORT void SetKO(); + //! THIS METHOD DEFINES THE RECOGNITION PROTOCOL, it is proper to + //! each precise type of Recognizer + //! For a suitable type of akey, it calls SetOK(result) where + //! result is an empty result of appropriate type, then returns Standard_EXPORT virtual void Eval (const TCollection_AsciiString& akey) = 0; diff --git a/src/StepData/StepData_GlobalNodeOfWriterLib.hxx b/src/StepData/StepData_GlobalNodeOfWriterLib.hxx index 5ea7c747fd..ef1f05f2f0 100644 --- a/src/StepData/StepData_GlobalNodeOfWriterLib.hxx +++ b/src/StepData/StepData_GlobalNodeOfWriterLib.hxx @@ -38,14 +38,23 @@ class StepData_GlobalNodeOfWriterLib : public Standard_Transient public: + //! Creates an empty GlobalNode, with no Next Standard_EXPORT StepData_GlobalNodeOfWriterLib(); + //! Adds a Module bound with a Protocol to the list : does + //! nothing if already in the list, THAT IS, Same Type (exact + //! match) and Same State (that is, IsEqual is not required) + //! Once added, stores its attached Protocol in correspondance Standard_EXPORT void Add (const Handle(StepData_ReadWriteModule)& amodule, const Handle(StepData_Protocol)& aprotocol); + //! Returns the Module stored in a given GlobalNode Standard_EXPORT const Handle(StepData_ReadWriteModule)& Module() const; + //! Returns the attached Protocol stored in a given GlobalNode Standard_EXPORT const Handle(StepData_Protocol)& Protocol() const; + //! Returns the Next GlobalNode. If none is defined, returned + //! value is a Null Handle Standard_EXPORT const Handle(StepData_GlobalNodeOfWriterLib)& Next() const; diff --git a/src/StepData/StepData_NodeOfWriterLib.hxx b/src/StepData/StepData_NodeOfWriterLib.hxx index 7ff26a75f7..cef2c02ecf 100644 --- a/src/StepData/StepData_NodeOfWriterLib.hxx +++ b/src/StepData/StepData_NodeOfWriterLib.hxx @@ -38,14 +38,21 @@ class StepData_NodeOfWriterLib : public MMgt_TShared public: + //! Creates an empty Node, with no Next Standard_EXPORT StepData_NodeOfWriterLib(); + //! Adds a couple (Module,Protocol), that is, stores it into + //! itself if not yet done, else creates a Next Node to do it Standard_EXPORT void AddNode (const Handle(StepData_GlobalNodeOfWriterLib)& anode); + //! Returns the Module designated by a precise Node Standard_EXPORT const Handle(StepData_ReadWriteModule)& Module() const; + //! Returns the Protocol designated by a precise Node Standard_EXPORT const Handle(StepData_Protocol)& Protocol() const; + //! Returns the Next Node. If none was defined, returned value + //! is a Null Handle Standard_EXPORT const Handle(StepData_NodeOfWriterLib)& Next() const; diff --git a/src/StepData/StepData_WriterLib.hxx b/src/StepData/StepData_WriterLib.hxx index a760b9f52d..6f0501e9ae 100644 --- a/src/StepData/StepData_WriterLib.hxx +++ b/src/StepData/StepData_WriterLib.hxx @@ -39,28 +39,56 @@ public: DEFINE_STANDARD_ALLOC + //! Adds a couple (Module-Protocol) into the global definition set + //! for this class of Library. Standard_EXPORT static void SetGlobal (const Handle(StepData_ReadWriteModule)& amodule, const Handle(StepData_Protocol)& aprotocol); + //! Creates a Library which complies with a Protocol, that is : + //! Same class (criterium IsInstance) + //! This creation gets the Modules from the global set, those + //! which are bound to the given Protocol and its Resources Standard_EXPORT StepData_WriterLib(const Handle(StepData_Protocol)& aprotocol); + //! Creates an empty Library : it will later by filled by method + //! AddProtocol Standard_EXPORT StepData_WriterLib(); + //! Adds a couple (Module-Protocol) to the Library, given the + //! class of a Protocol. Takes Resources into account. + //! (if is not of type TheProtocol, it is not added) Standard_EXPORT void AddProtocol (const Handle(Standard_Transient)& aprotocol); + //! Clears the list of Modules of a library (can be used to + //! redefine the order of Modules before action : Clear then + //! refill the Library by calls to AddProtocol) Standard_EXPORT void Clear(); + //! Sets a library to be defined with the complete Global list + //! (all the couples Protocol/Modules recorded in it) Standard_EXPORT void SetComplete(); + //! Selects a Module from the Library, given an Object. + //! Returns True if Select has succeeded, False else. + //! Also Returns (as arguments) the selected Module and the Case + //! Number determined by the associated Protocol. + //! If Select has failed, is Null Handle and CN is zero. + //! (Select can work on any criterium, such as Object DynamicType) Standard_EXPORT Standard_Boolean Select (const Handle(Standard_Transient)& obj, Handle(StepData_ReadWriteModule)& module, Standard_Integer& CN) const; + //! Starts Iteration on the Modules (sets it on the first one) Standard_EXPORT void Start(); + //! Returns True if there are more Modules to iterate on Standard_EXPORT Standard_Boolean More() const; + //! Iterates by getting the next Module in the list + //! If there is none, the exception will be raised by Value Standard_EXPORT void Next(); + //! Returns the current Module in the Iteration Standard_EXPORT const Handle(StepData_ReadWriteModule)& Module() const; + //! Returns the current Protocol in the Iteration Standard_EXPORT const Handle(StepData_Protocol)& Protocol() const; diff --git a/src/StepSelect/StepSelect_FileModifier.hxx b/src/StepSelect/StepSelect_FileModifier.hxx index 9d0e092f7c..71a92e5546 100644 --- a/src/StepSelect/StepSelect_FileModifier.hxx +++ b/src/StepSelect/StepSelect_FileModifier.hxx @@ -35,6 +35,14 @@ class StepSelect_FileModifier : public IFSelect_GeneralModifier public: + //! Perform the action specific to each class of File Modifier + //! is the ContextWrite, which brings : the model, the + //! protocol, the file name, plus the object AppliedModifiers + //! (not used here) and the CheckList + //! Remark that the model has to be casted for specific access + //! + //! is the Writer and is specific to each norm, on which + //! to act Standard_EXPORT virtual void Perform (IFSelect_ContextWrite& ctx, StepData_StepWriter& writer) const = 0; @@ -45,6 +53,8 @@ public: protected: + //! Sets a File Modifier to keep the graph of dependences + //! unchanges (because it works on the model already produced) Standard_EXPORT StepSelect_FileModifier(); diff --git a/src/StepSelect/StepSelect_ModelModifier.hxx b/src/StepSelect/StepSelect_ModelModifier.hxx index 911e19574d..302260f10a 100644 --- a/src/StepSelect/StepSelect_ModelModifier.hxx +++ b/src/StepSelect/StepSelect_ModelModifier.hxx @@ -40,10 +40,21 @@ class StepSelect_ModelModifier : public IFSelect_Modifier public: + //! The inherited Perform does the required cast (and refuses to + //! go further if cast has failed) then calls the instantiated + //! Performing Standard_EXPORT void Perform (IFSelect_ContextModif& ctx, const Handle(Interface_InterfaceModel)& target, const Handle(Interface_Protocol)& protocol, Interface_CopyTool& TC) const; + //! Specific Perform with Protocol. It is defined to let the + //! Protocol unused and to call Performing without Protocol + //! (most current case). It can be redefined if specific action + //! requires Protocol. Standard_EXPORT virtual void PerformProtocol (IFSelect_ContextModif& ctx, const Handle(StepData_StepModel)& target, const Handle(StepData_Protocol)& proto, Interface_CopyTool& TC) const; + //! Specific Perform, without Protocol. If Performing with + //! Protocol is redefined, Performing without Protocol must + //! though be defined to do nothing (not called, but demanded + //! by the linker) Standard_EXPORT virtual void Performing (IFSelect_ContextModif& ctx, const Handle(StepData_StepModel)& target, Interface_CopyTool& TC) const = 0; @@ -54,6 +65,8 @@ public: protected: + //! Calls inherited Initialize, transmits to it the information + //! Standard_EXPORT StepSelect_ModelModifier(const Standard_Boolean maychangegraph); diff --git a/src/Transfer/Transfer_ActorOfProcessForFinder.hxx b/src/Transfer/Transfer_ActorOfProcessForFinder.hxx index 07c4800070..9bf8ee8788 100644 --- a/src/Transfer/Transfer_ActorOfProcessForFinder.hxx +++ b/src/Transfer/Transfer_ActorOfProcessForFinder.hxx @@ -47,20 +47,51 @@ public: Standard_EXPORT Transfer_ActorOfProcessForFinder(); + //! Prerequesite for Transfer : the method Transfer is + //! called on a starting object only if Recognize has + //! returned True on it + //! This allows to define a list of Actors, each one + //! processing a definite kind of data + //! TransferProcess calls Recognize on each one before + //! calling Transfer. But even if Recognize has returned + //! True, Transfer can reject by returning a Null Binder + //! (afterwards rejection), the next actor is then invoked + //! + //! The provided default returns True, can be redefined Standard_EXPORT virtual Standard_Boolean Recognize (const Handle(Transfer_Finder)& start); + //! Specific action of Transfer. The Result is stored in + //! the returned Binder, or a Null Handle for "No result" + //! (Default defined as doing nothing; should be deffered) + //! "mutable" allows the Actor to record intermediate + //! information, in addition to those of TransferProcess Standard_EXPORT virtual Handle(Transfer_Binder) Transferring (const Handle(Transfer_Finder)& start, const Handle(Transfer_ProcessForFinder)& TP); + //! Prepares and Returns a Binder for a Transient Result + //! Returns a Null Handle if is itself Null Standard_EXPORT Handle(Transfer_SimpleBinderOfTransient) TransientResult (const Handle(Standard_Transient)& res) const; + //! Returns a Binder for No Result, i.e. a Null Handle Standard_EXPORT Handle(Transfer_Binder) NullResult() const; + //! If is True, commands an Actor to be set at the + //! end of the list of Actors (see SetNext) + //! If it is False (creation default), each add Actor is + //! set at the beginning of the list + //! This allows to define default Actors (which are Last) Standard_EXPORT void SetLast (const Standard_Boolean mode = Standard_True); + //! Returns the Last status (see SetLast). Standard_EXPORT Standard_Boolean IsLast() const; + //! Defines a Next Actor : it can then be asked to work if + //! produces no result for a given type of Object. + //! If Next is already set and is not "Last", calls + //! SetNext on it. If Next defined and "Last", the new + //! actor is added before it in the list Standard_EXPORT void SetNext (const Handle(Transfer_ActorOfProcessForFinder)& next); + //! Returns the Actor defined as Next, or a Null Handle Standard_EXPORT Handle(Transfer_ActorOfProcessForFinder) Next() const; diff --git a/src/Transfer/Transfer_ActorOfProcessForTransient.hxx b/src/Transfer/Transfer_ActorOfProcessForTransient.hxx index f24bf06c5b..09b90ab676 100644 --- a/src/Transfer/Transfer_ActorOfProcessForTransient.hxx +++ b/src/Transfer/Transfer_ActorOfProcessForTransient.hxx @@ -46,20 +46,51 @@ public: Standard_EXPORT Transfer_ActorOfProcessForTransient(); + //! Prerequesite for Transfer : the method Transfer is + //! called on a starting object only if Recognize has + //! returned True on it + //! This allows to define a list of Actors, each one + //! processing a definite kind of data + //! TransferProcess calls Recognize on each one before + //! calling Transfer. But even if Recognize has returned + //! True, Transfer can reject by returning a Null Binder + //! (afterwards rejection), the next actor is then invoked + //! + //! The provided default returns True, can be redefined Standard_EXPORT virtual Standard_Boolean Recognize (const Handle(Standard_Transient)& start); + //! Specific action of Transfer. The Result is stored in + //! the returned Binder, or a Null Handle for "No result" + //! (Default defined as doing nothing; should be deffered) + //! "mutable" allows the Actor to record intermediate + //! information, in addition to those of TransferProcess Standard_EXPORT virtual Handle(Transfer_Binder) Transferring (const Handle(Standard_Transient)& start, const Handle(Transfer_ProcessForTransient)& TP); + //! Prepares and Returns a Binder for a Transient Result + //! Returns a Null Handle if is itself Null Standard_EXPORT Handle(Transfer_SimpleBinderOfTransient) TransientResult (const Handle(Standard_Transient)& res) const; + //! Returns a Binder for No Result, i.e. a Null Handle Standard_EXPORT Handle(Transfer_Binder) NullResult() const; + //! If is True, commands an Actor to be set at the + //! end of the list of Actors (see SetNext) + //! If it is False (creation default), each add Actor is + //! set at the beginning of the list + //! This allows to define default Actors (which are Last) Standard_EXPORT void SetLast (const Standard_Boolean mode = Standard_True); + //! Returns the Last status (see SetLast). Standard_EXPORT Standard_Boolean IsLast() const; + //! Defines a Next Actor : it can then be asked to work if + //! produces no result for a given type of Object. + //! If Next is already set and is not "Last", calls + //! SetNext on it. If Next defined and "Last", the new + //! actor is added before it in the list Standard_EXPORT void SetNext (const Handle(Transfer_ActorOfProcessForTransient)& next); + //! Returns the Actor defined as Next, or a Null Handle Standard_EXPORT Handle(Transfer_ActorOfProcessForTransient) Next() const; diff --git a/src/Transfer/Transfer_IteratorOfProcessForFinder.hxx b/src/Transfer/Transfer_IteratorOfProcessForFinder.hxx index 565703d3a2..1e9a23f33f 100644 --- a/src/Transfer/Transfer_IteratorOfProcessForFinder.hxx +++ b/src/Transfer/Transfer_IteratorOfProcessForFinder.hxx @@ -42,16 +42,33 @@ public: DEFINE_STANDARD_ALLOC + //! Creates an empty Iterator + //! if withstarts is True, each Binder to be iterated will + //! be associated to its corresponding Starting Object Standard_EXPORT Transfer_IteratorOfProcessForFinder(const Standard_Boolean withstarts); + //! Adds a Binder to the iteration list (construction) + //! with no corresponding Starting Object + //! (note that Result is brought by Binder) Standard_EXPORT void Add (const Handle(Transfer_Binder)& binder); + //! Adds a Binder to the iteration list, associated with + //! its corresponding Starting Object "start" + //! Starting Object is ignored if not required at + //! Creation time Standard_EXPORT void Add (const Handle(Transfer_Binder)& binder, const Handle(Transfer_Finder)& start); + //! After having added all items, keeps or rejects items + //! which are attached to starting data given by + //! = True (D) : keeps. = False : rejects + //! Does nothing if was False Standard_EXPORT void Filter (const Handle(Transfer_HSequenceOfFinder)& list, const Standard_Boolean keep = Standard_True); + //! Returns True if Starting Object is available + //! (defined at Creation Time) Standard_EXPORT Standard_Boolean HasStarting() const; + //! Returns corresponding Starting Object Standard_EXPORT const Handle(Transfer_Finder)& Starting() const; diff --git a/src/Transfer/Transfer_IteratorOfProcessForTransient.hxx b/src/Transfer/Transfer_IteratorOfProcessForTransient.hxx index 744c57f951..90510f56ab 100644 --- a/src/Transfer/Transfer_IteratorOfProcessForTransient.hxx +++ b/src/Transfer/Transfer_IteratorOfProcessForTransient.hxx @@ -42,16 +42,33 @@ public: DEFINE_STANDARD_ALLOC + //! Creates an empty Iterator + //! if withstarts is True, each Binder to be iterated will + //! be associated to its corresponding Starting Object Standard_EXPORT Transfer_IteratorOfProcessForTransient(const Standard_Boolean withstarts); + //! Adds a Binder to the iteration list (construction) + //! with no corresponding Starting Object + //! (note that Result is brought by Binder) Standard_EXPORT void Add (const Handle(Transfer_Binder)& binder); + //! Adds a Binder to the iteration list, associated with + //! its corresponding Starting Object "start" + //! Starting Object is ignored if not required at + //! Creation time Standard_EXPORT void Add (const Handle(Transfer_Binder)& binder, const Handle(Standard_Transient)& start); + //! After having added all items, keeps or rejects items + //! which are attached to starting data given by + //! = True (D) : keeps. = False : rejects + //! Does nothing if was False Standard_EXPORT void Filter (const Handle(TColStd_HSequenceOfTransient)& list, const Standard_Boolean keep = Standard_True); + //! Returns True if Starting Object is available + //! (defined at Creation Time) Standard_EXPORT Standard_Boolean HasStarting() const; + //! Returns corresponding Starting Object Standard_EXPORT const Handle(Standard_Transient)& Starting() const; diff --git a/src/Transfer/Transfer_ProcessForFinder.hxx b/src/Transfer/Transfer_ProcessForFinder.hxx index da574e1b5a..3903b4eb02 100644 --- a/src/Transfer/Transfer_ProcessForFinder.hxx +++ b/src/Transfer/Transfer_ProcessForFinder.hxx @@ -55,134 +55,356 @@ class Transfer_ProcessForFinder : public MMgt_TShared public: + //! Sets TransferProcess at initial state. Gives an Initial size + //! (indicative) for the Map when known (default is 10000). + //! Sets default trace file as a printer and default trace level + //! (see Message_TraceFile). Standard_EXPORT Transfer_ProcessForFinder(const Standard_Integer nb = 10000); + //! Sets TransferProcess at initial state. Gives an Initial size + //! (indicative) for the Map when known (default is 10000). + //! Sets a specified printer. Standard_EXPORT Transfer_ProcessForFinder(const Handle(Message_Messenger)& printer, const Standard_Integer nb = 10000); + //! Resets a TransferProcess as ready for a completely new work. + //! Clears general data (roots) and the Map Standard_EXPORT void Clear(); + //! Rebuilds the Map and the roots to really remove Unbound items + //! Because Unbind keeps the entity in place, even if not bound + //! Hence, working by checking new items is meaningless if a + //! formerly unbound item is rebound Standard_EXPORT void Clean(); + //! Resizes the Map as required (if a new reliable value has been + //! determined). Acts only if is greater than actual NbMapped Standard_EXPORT void Resize (const Standard_Integer nb); + //! Defines an Actor, which is used for automatic Transfer + //! If already defined, the new Actor is cumulated + //! (see SetNext from Actor) Standard_EXPORT void SetActor (const Handle(Transfer_ActorOfProcessForFinder)& actor); + //! Returns the defined Actor. Returns a Null Handle if + //! not set. Standard_EXPORT Handle(Transfer_ActorOfProcessForFinder) Actor() const; + //! Returns the Binder which is linked with a starting Object + //! It can either bring a Result (Transfer done) or none (for a + //! pre-binding). + //! If no Binder is linked with , returns a Null Handle + //! Considers a category number, by default 0 Standard_EXPORT Handle(Transfer_Binder) Find (const Handle(Transfer_Finder)& start) const; + //! Returns True if a Result (whatever its form) is Bound with + //! a starting Object. I.e., if a Binder with a Result set, + //! is linked with it + //! Considers a category number, by default 0 Standard_EXPORT Standard_Boolean IsBound (const Handle(Transfer_Finder)& start) const; + //! Returns True if the result of the transfer of an object is + //! already used in other ones. If it is, Rebind cannot change it. + //! Considers a category number, by default 0 Standard_EXPORT Standard_Boolean IsAlreadyUsed (const Handle(Transfer_Finder)& start) const; + //! Creates a Link a starting Object with a Binder. This Binder + //! can either bring a Result (effective Binding) or none (it can + //! be set later : pre-binding). + //! Considers a category number, by default 0 Standard_EXPORT void Bind (const Handle(Transfer_Finder)& start, const Handle(Transfer_Binder)& binder); + //! Changes the Binder linked with a starting Object for its + //! unitary transfer. This it can be useful when the exact form + //! of the result is known once the transfer is widely engaged. + //! This can be done only on first transfer. + //! Considers a category number, by default 0 Standard_EXPORT void Rebind (const Handle(Transfer_Finder)& start, const Handle(Transfer_Binder)& binder); + //! Removes the Binder linked with a starting object + //! If this Binder brings a non-empty Check, it is replaced by + //! a VoidBinder. Also removes from the list of Roots as required. + //! Returns True if done, False if was not bound + //! Considers a category number, by default 0 Standard_EXPORT Standard_Boolean Unbind (const Handle(Transfer_Finder)& start); + //! Returns a Binder for a starting entity, as follows : + //! Tries to Find the already bound one + //! If none found, creates a VoidBinder and Binds it Standard_EXPORT Handle(Transfer_Binder) FindElseBind (const Handle(Transfer_Finder)& start); + //! Sets Messenger used for outputting messages. Standard_EXPORT void SetMessenger (const Handle(Message_Messenger)& messenger); + //! Returns Messenger used for outputting messages. + //! The returned object is guaranteed to be non-null; + //! default is Message::Messenger(). Standard_EXPORT Handle(Message_Messenger) Messenger() const; + //! Sets trace level used for outputting messages: + //! = 0 : no trace at all + //! = 1 : handled exceptions and calls to AddError + //! = 2 : also calls to AddWarning + //! = 3 : also traces new Roots + //! (uses method ErrorTrace). + //! Default is 1 : Errors traced Standard_EXPORT void SetTraceLevel (const Standard_Integer tracelev); + //! Returns trace level used for outputting messages. Standard_EXPORT Standard_Integer TraceLevel() const; + //! New name for AddFail (Msg) Standard_EXPORT void SendFail (const Handle(Transfer_Finder)& start, const Message_Msg& amsg); + //! New name for AddWarning (Msg) Standard_EXPORT void SendWarning (const Handle(Transfer_Finder)& start, const Message_Msg& amsg); + //! Adds an information message + //! Trace is filled if trace level is at least 3 Standard_EXPORT void SendMsg (const Handle(Transfer_Finder)& start, const Message_Msg& amsg); + //! Adds an Error message to a starting entity (to the check of + //! its Binder of category 0, as a Fail) Standard_EXPORT void AddFail (const Handle(Transfer_Finder)& start, const Standard_CString mess, const Standard_CString orig = ""); + //! (other name of AddFail, maintained for compatibility) Standard_EXPORT void AddError (const Handle(Transfer_Finder)& start, const Standard_CString mess, const Standard_CString orig = ""); + //! Adds an Error Message to a starting entity from the definition + //! of a Msg (Original+Value) Standard_EXPORT void AddFail (const Handle(Transfer_Finder)& start, const Message_Msg& amsg); + //! Adds a Warning message to a starting entity (to the check of + //! its Binder of category 0) Standard_EXPORT void AddWarning (const Handle(Transfer_Finder)& start, const Standard_CString mess, const Standard_CString orig = ""); + //! Adds a Warning Message to a starting entity from the definition + //! of a Msg (Original+Value) Standard_EXPORT void AddWarning (const Handle(Transfer_Finder)& start, const Message_Msg& amsg); Standard_EXPORT void Mend (const Handle(Transfer_Finder)& start, const Standard_CString pref = ""); + //! Returns the Check attached to a starting entity. If + //! is unknown, returns an empty Check + //! Adds a case name to a starting entity + //! Adds a case value to a starting entity + //! Returns the complete case list for an entity. Null Handle if empty + //! In the list of mapped items (between 1 and NbMapped), + //! searches for the first item which follows (not included) + //! and which has an attribute named + //! Attributes are brought by Binders + //! Hence, allows such an iteration + //! + //! for (num = TP->NextItemWithAttribute(name,0); + //! num > 0; + //! num = TP->NextItemWithAttribute(name,num) { + //! .. process mapped item + //! } + //! Returns the type of an Attribute attached to binders + //! If this name gives no Attribute, returns ParamVoid + //! If this name gives several different types, returns ParamMisc + //! Else, returns the effective type (ParamInteger, ParamReal, + //! ParamIdent, or ParamText) + //! Returns the list of recorded Attribute Names, as a Dictionary + //! of Integer : each value gives the count of items which bring + //! this attribute name + //! By default, considers all the attribute names + //! If is given, considers only the attribute names + //! which begin by Standard_EXPORT Handle(Interface_Check) Check (const Handle(Transfer_Finder)& start) const; + //! Binds a starting object with a Transient Result. + //! Uses a SimpleBinderOfTransient to work. If there is already + //! one but with no Result set, sets its Result. + //! Considers a category number, by default 0 Standard_EXPORT void BindTransient (const Handle(Transfer_Finder)& start, const Handle(Standard_Transient)& res); + //! Returns the Result of the Transfer of an object as a + //! Transient Result. + //! Returns a Null Handle if there is no Transient Result + //! Considers a category number, by default 0 + //! Warning : Supposes that Binding is done with a SimpleBinderOfTransient Standard_EXPORT const Handle(Standard_Transient)& FindTransient (const Handle(Transfer_Finder)& start) const; + //! Prepares an object to be bound with several results. + //! If no Binder is yet attached to , a MultipleBinder + //! is created, empty. If a Binder is already set, it must + //! accept Multiple Binding. + //! Considers a category number, by default 0 Standard_EXPORT void BindMultiple (const Handle(Transfer_Finder)& start); + //! Adds an item to a list of results bound to a starting object. + //! Considers a category number, by default 0, for all results Standard_EXPORT void AddMultiple (const Handle(Transfer_Finder)& start, const Handle(Standard_Transient)& res); + //! Searches for a transient result attached to a starting object, + //! according to its type, by criterium IsKind(atype) + //! + //! In case of multiple result, explores the list and gives in + //! the first transient result IsKind(atype) + //! Returns True and fills if found + //! Else, returns False ( is not touched, not even nullified) + //! + //! This syntactic form avoids to do DownCast : if a result is + //! found with the good type, it is loaded in and can be + //! immediately used, well initialised Standard_EXPORT Standard_Boolean FindTypedTransient (const Handle(Transfer_Finder)& start, const Handle(Standard_Type)& atype, Handle(Standard_Transient)& val) const; + //! Searches for a transient result recorded in a Binder, whatever + //! this Binder is recorded or not in + //! + //! This is strictly equivalent to the class method GetTypedResult + //! from class SimpleBinderOfTransient, but is just lighter to call + //! + //! Apart from this, works as FindTypedTransient Standard_EXPORT Standard_Boolean GetTypedTransient (const Handle(Transfer_Binder)& binder, const Handle(Standard_Type)& atype, Handle(Standard_Transient)& val) const; + //! Returns the maximum possible value for Map Index + //! (no result can be bound with a value greater than it) Standard_EXPORT Standard_Integer NbMapped() const; + //! Returns the Starting Object bound to an Index, Standard_EXPORT const Handle(Transfer_Finder)& Mapped (const Standard_Integer num) const; + //! Returns the Index value bound to a Starting Object, 0 if none Standard_EXPORT Standard_Integer MapIndex (const Handle(Transfer_Finder)& start) const; + //! Returns the Binder bound to an Index + //! Considers a category number, by default 0 Standard_EXPORT Handle(Transfer_Binder) MapItem (const Standard_Integer num) const; + //! Declares (and its Result) as Root. This status will be + //! later exploited by RootResult, see below (Result can be + //! produced at any time) Standard_EXPORT void SetRoot (const Handle(Transfer_Finder)& start); + //! Enable (if True) or Disables (if False) Root + //! Management. If it is set, Transfers are considered as stacked + //! (a first Transfer commands other Transfers, and so on) and + //! the Transfers commanded by an external caller are "Root". + //! Remark : SetRoot can be called whatever this status, on every + //! object. + //! Default is set to True. Standard_EXPORT void SetRootManagement (const Standard_Boolean stat); + //! Returns the count of recorded Roots Standard_EXPORT Standard_Integer NbRoots() const; + //! Returns a Root Entity given its number in the list (1-NbRoots) Standard_EXPORT const Handle(Transfer_Finder)& Root (const Standard_Integer num) const; + //! Returns the Binder bound with a Root Entity given its number + //! Considers a category number, by default 0 Standard_EXPORT Handle(Transfer_Binder) RootItem (const Standard_Integer num) const; + //! Returns the index in the list of roots for a starting item, + //! or 0 if it is not recorded as a root Standard_EXPORT Standard_Integer RootIndex (const Handle(Transfer_Finder)& start) const; + //! Returns Nesting Level of Transfers (managed by methods + //! TranscriptWith & Co). Starts to zero. If no automatic Transfer + //! is used, it remains to zero. Zero means Root Level. Standard_EXPORT Standard_Integer NestingLevel() const; + //! Resets Nesting Level of Transfers to Zero (Root Level), + //! whatever its current value. Standard_EXPORT void ResetNestingLevel(); + //! Tells if has been recognized as good candidate for + //! Transfer. i.e. queries the Actor and its Nexts Standard_EXPORT Standard_Boolean Recognize (const Handle(Transfer_Finder)& start) const; + //! Performs the Transfer of a Starting Object, by calling + //! the method TransferProduct (see below). + //! Mapping and Roots are managed : nothing is done if a Result is + //! already Bound, an exception is raised in case of error. Standard_EXPORT Handle(Transfer_Binder) Transferring (const Handle(Transfer_Finder)& start); + //! Same as Transferring but does not return the Binder. + //! Simply returns True in case of success (for user call) Standard_EXPORT Standard_Boolean Transfer (const Handle(Transfer_Finder)& start); + //! Allows controls if exceptions will be handled + //! Transfer Operations + //! False : they are not handled with try {} catch {} + //! True : they are + //! Default is False: no handling performed Standard_EXPORT void SetErrorHandle (const Standard_Boolean err); + //! Returns error handling flag Standard_EXPORT Standard_Boolean ErrorHandle() const; + //! Method called when trace is asked + //! Calls PrintTrace to display information relevant for starting + //! objects (which can be redefined) + //! is Nesting Level of Transfer (0 = root) + //! controls the way the trace is done : + //! 0 neutral, 1 for Error, 2 for Warning message, 3 for new Root Standard_EXPORT void StartTrace (const Handle(Transfer_Binder)& binder, const Handle(Transfer_Finder)& start, const Standard_Integer level, const Standard_Integer mode) const; + //! Prints a short information on a starting object. By default + //! prints its Dynamic Type. Can be redefined Standard_EXPORT virtual void PrintTrace (const Handle(Transfer_Finder)& start, const Handle(Message_Messenger)& S) const; + //! Returns True if we are surely in a DeadLoop. Evaluation is not + //! exact, it is a "majorant" which must be computed fast. + //! This "majorant" is : greater than NbMapped. Standard_EXPORT Standard_Boolean IsLooping (const Standard_Integer alevel) const; + //! Returns, as an iterator, the log of root transfer, i.e. the + //! created objects and Binders bound to starting roots + //! If withstart is given True, Starting Objets are also returned Standard_EXPORT Transfer_IteratorOfProcessForFinder RootResult (const Standard_Boolean withstart = Standard_False) const; + //! Returns, as an Iterator, the entire log of transfer (list of + //! created objects and Binders which can bring errors) + //! If withstart is given True, Starting Objets are also returned Standard_EXPORT Transfer_IteratorOfProcessForFinder CompleteResult (const Standard_Boolean withstart = Standard_False) const; + //! Returns Binders which are neither "Done" nor "Initial", + //! that is Error,Loop or Run (abnormal states at end of Transfer) + //! Starting Objects are given in correspondance in the iterator Standard_EXPORT Transfer_IteratorOfProcessForFinder AbnormalResult() const; + //! Returns a CheckList as a list of Check : each one is for a + //! starting entity which have either check (warning or fail) + //! messages are attached, or are in abnormal state : that case + //! gives a specific message + //! If is True, checks with Warnings only are ignored Standard_EXPORT Interface_CheckIterator CheckList (const Standard_Boolean erronly) const; + //! Returns, as an Iterator, the log of transfer for one object + //! = 0 : this object only + //! and if is a scope owner (else, is ignored) : + //! = 1 : object plus its immediate scoped ones + //! = 2 : object plus all its scoped ones Standard_EXPORT Transfer_IteratorOfProcessForFinder ResultOne (const Handle(Transfer_Finder)& start, const Standard_Integer level, const Standard_Boolean withstart = Standard_False) const; + //! Returns a CheckList for one starting object + //! interpreted as by ResultOne + //! If is True, checks with Warnings only are ignored Standard_EXPORT Interface_CheckIterator CheckListOne (const Handle(Transfer_Finder)& start, const Standard_Integer level, const Standard_Boolean erronly) const; + //! Returns True if no check message is attached to a starting + //! object. interpreted as by ResultOne + //! If is True, checks with Warnings only are ignored Standard_EXPORT Standard_Boolean IsCheckListEmpty (const Handle(Transfer_Finder)& start, const Standard_Integer level, const Standard_Boolean erronly) const; + //! Removes Results attached to (== Unbinds) a given object and, + //! according : + //! = 0 : only it + //! = 1 : it plus its immediately owned sub-results(scope) + //! = 2 : it plus all its owned sub-results(scope) Standard_EXPORT void RemoveResult (const Handle(Transfer_Finder)& start, const Standard_Integer level, const Standard_Boolean compute = Standard_True); + //! Computes a number to be associated to a starting object in + //! a check or a check-list + //! By default, returns 0; can be redefined Standard_EXPORT virtual Standard_Integer CheckNum (const Handle(Transfer_Finder)& start) const; + //! Sets Progress indicator Standard_EXPORT void SetProgress (const Handle(Message_ProgressIndicator)& theProgress); + //! Gets Progress indicator Standard_EXPORT Handle(Message_ProgressIndicator) GetProgress() const; @@ -198,8 +420,18 @@ protected: private: + //! Same as Find but stores the last access to the map, for a + //! faster access on next calls (as Bind does too) + //! Considers a category number, by default 0 + //! C++ : return const & Standard_EXPORT Handle(Transfer_Binder) FindAndMask (const Handle(Transfer_Finder)& start); + //! Internal action of Transfer, called by Transferring, with or + //! without ErrorHandle. It invokes the Actor to work (set by + //! SetActor), and tries its Nexts if no result is produced, + //! until a Non Null Binder is produced. + //! But keep in mind that a Null Binder can allways be returned + //! if a Starting Entity has not been recognized at all. Standard_EXPORT Handle(Transfer_Binder) TransferProduct (const Handle(Transfer_Finder)& start); Standard_Boolean theerrh; diff --git a/src/Transfer/Transfer_ProcessForTransient.hxx b/src/Transfer/Transfer_ProcessForTransient.hxx index 4d5a42c8dc..d632ba5b18 100644 --- a/src/Transfer/Transfer_ProcessForTransient.hxx +++ b/src/Transfer/Transfer_ProcessForTransient.hxx @@ -59,134 +59,356 @@ class Transfer_ProcessForTransient : public MMgt_TShared public: + //! Sets TransferProcess at initial state. Gives an Initial size + //! (indicative) for the Map when known (default is 10000). + //! Sets default trace file as a printer and default trace level + //! (see Message_TraceFile). Standard_EXPORT Transfer_ProcessForTransient(const Standard_Integer nb = 10000); + //! Sets TransferProcess at initial state. Gives an Initial size + //! (indicative) for the Map when known (default is 10000). + //! Sets a specified printer. Standard_EXPORT Transfer_ProcessForTransient(const Handle(Message_Messenger)& printer, const Standard_Integer nb = 10000); + //! Resets a TransferProcess as ready for a completely new work. + //! Clears general data (roots) and the Map Standard_EXPORT void Clear(); + //! Rebuilds the Map and the roots to really remove Unbound items + //! Because Unbind keeps the entity in place, even if not bound + //! Hence, working by checking new items is meaningless if a + //! formerly unbound item is rebound Standard_EXPORT void Clean(); + //! Resizes the Map as required (if a new reliable value has been + //! determined). Acts only if is greater than actual NbMapped Standard_EXPORT void Resize (const Standard_Integer nb); + //! Defines an Actor, which is used for automatic Transfer + //! If already defined, the new Actor is cumulated + //! (see SetNext from Actor) Standard_EXPORT void SetActor (const Handle(Transfer_ActorOfProcessForTransient)& actor); + //! Returns the defined Actor. Returns a Null Handle if + //! not set. Standard_EXPORT Handle(Transfer_ActorOfProcessForTransient) Actor() const; + //! Returns the Binder which is linked with a starting Object + //! It can either bring a Result (Transfer done) or none (for a + //! pre-binding). + //! If no Binder is linked with , returns a Null Handle + //! Considers a category number, by default 0 Standard_EXPORT Handle(Transfer_Binder) Find (const Handle(Standard_Transient)& start) const; + //! Returns True if a Result (whatever its form) is Bound with + //! a starting Object. I.e., if a Binder with a Result set, + //! is linked with it + //! Considers a category number, by default 0 Standard_EXPORT Standard_Boolean IsBound (const Handle(Standard_Transient)& start) const; + //! Returns True if the result of the transfer of an object is + //! already used in other ones. If it is, Rebind cannot change it. + //! Considers a category number, by default 0 Standard_EXPORT Standard_Boolean IsAlreadyUsed (const Handle(Standard_Transient)& start) const; + //! Creates a Link a starting Object with a Binder. This Binder + //! can either bring a Result (effective Binding) or none (it can + //! be set later : pre-binding). + //! Considers a category number, by default 0 Standard_EXPORT void Bind (const Handle(Standard_Transient)& start, const Handle(Transfer_Binder)& binder); + //! Changes the Binder linked with a starting Object for its + //! unitary transfer. This it can be useful when the exact form + //! of the result is known once the transfer is widely engaged. + //! This can be done only on first transfer. + //! Considers a category number, by default 0 Standard_EXPORT void Rebind (const Handle(Standard_Transient)& start, const Handle(Transfer_Binder)& binder); + //! Removes the Binder linked with a starting object + //! If this Binder brings a non-empty Check, it is replaced by + //! a VoidBinder. Also removes from the list of Roots as required. + //! Returns True if done, False if was not bound + //! Considers a category number, by default 0 Standard_EXPORT Standard_Boolean Unbind (const Handle(Standard_Transient)& start); + //! Returns a Binder for a starting entity, as follows : + //! Tries to Find the already bound one + //! If none found, creates a VoidBinder and Binds it Standard_EXPORT Handle(Transfer_Binder) FindElseBind (const Handle(Standard_Transient)& start); + //! Sets Messenger used for outputting messages. Standard_EXPORT void SetMessenger (const Handle(Message_Messenger)& messenger); + //! Returns Messenger used for outputting messages. + //! The returned object is guaranteed to be non-null; + //! default is Message::Messenger(). Standard_EXPORT Handle(Message_Messenger) Messenger() const; + //! Sets trace level used for outputting messages: + //! = 0 : no trace at all + //! = 1 : handled exceptions and calls to AddError + //! = 2 : also calls to AddWarning + //! = 3 : also traces new Roots + //! (uses method ErrorTrace). + //! Default is 1 : Errors traced Standard_EXPORT void SetTraceLevel (const Standard_Integer tracelev); + //! Returns trace level used for outputting messages. Standard_EXPORT Standard_Integer TraceLevel() const; + //! New name for AddFail (Msg) Standard_EXPORT void SendFail (const Handle(Standard_Transient)& start, const Message_Msg& amsg); + //! New name for AddWarning (Msg) Standard_EXPORT void SendWarning (const Handle(Standard_Transient)& start, const Message_Msg& amsg); + //! Adds an information message + //! Trace is filled if trace level is at least 3 Standard_EXPORT void SendMsg (const Handle(Standard_Transient)& start, const Message_Msg& amsg); + //! Adds an Error message to a starting entity (to the check of + //! its Binder of category 0, as a Fail) Standard_EXPORT void AddFail (const Handle(Standard_Transient)& start, const Standard_CString mess, const Standard_CString orig = ""); + //! (other name of AddFail, maintained for compatibility) Standard_EXPORT void AddError (const Handle(Standard_Transient)& start, const Standard_CString mess, const Standard_CString orig = ""); + //! Adds an Error Message to a starting entity from the definition + //! of a Msg (Original+Value) Standard_EXPORT void AddFail (const Handle(Standard_Transient)& start, const Message_Msg& amsg); + //! Adds a Warning message to a starting entity (to the check of + //! its Binder of category 0) Standard_EXPORT void AddWarning (const Handle(Standard_Transient)& start, const Standard_CString mess, const Standard_CString orig = ""); + //! Adds a Warning Message to a starting entity from the definition + //! of a Msg (Original+Value) Standard_EXPORT void AddWarning (const Handle(Standard_Transient)& start, const Message_Msg& amsg); Standard_EXPORT void Mend (const Handle(Standard_Transient)& start, const Standard_CString pref = ""); + //! Returns the Check attached to a starting entity. If + //! is unknown, returns an empty Check + //! Adds a case name to a starting entity + //! Adds a case value to a starting entity + //! Returns the complete case list for an entity. Null Handle if empty + //! In the list of mapped items (between 1 and NbMapped), + //! searches for the first item which follows (not included) + //! and which has an attribute named + //! Attributes are brought by Binders + //! Hence, allows such an iteration + //! + //! for (num = TP->NextItemWithAttribute(name,0); + //! num > 0; + //! num = TP->NextItemWithAttribute(name,num) { + //! .. process mapped item + //! } + //! Returns the type of an Attribute attached to binders + //! If this name gives no Attribute, returns ParamVoid + //! If this name gives several different types, returns ParamMisc + //! Else, returns the effective type (ParamInteger, ParamReal, + //! ParamIdent, or ParamText) + //! Returns the list of recorded Attribute Names, as a Dictionary + //! of Integer : each value gives the count of items which bring + //! this attribute name + //! By default, considers all the attribute names + //! If is given, considers only the attribute names + //! which begin by Standard_EXPORT Handle(Interface_Check) Check (const Handle(Standard_Transient)& start) const; + //! Binds a starting object with a Transient Result. + //! Uses a SimpleBinderOfTransient to work. If there is already + //! one but with no Result set, sets its Result. + //! Considers a category number, by default 0 Standard_EXPORT void BindTransient (const Handle(Standard_Transient)& start, const Handle(Standard_Transient)& res); + //! Returns the Result of the Transfer of an object as a + //! Transient Result. + //! Returns a Null Handle if there is no Transient Result + //! Considers a category number, by default 0 + //! Warning : Supposes that Binding is done with a SimpleBinderOfTransient Standard_EXPORT const Handle(Standard_Transient)& FindTransient (const Handle(Standard_Transient)& start) const; + //! Prepares an object to be bound with several results. + //! If no Binder is yet attached to , a MultipleBinder + //! is created, empty. If a Binder is already set, it must + //! accept Multiple Binding. + //! Considers a category number, by default 0 Standard_EXPORT void BindMultiple (const Handle(Standard_Transient)& start); + //! Adds an item to a list of results bound to a starting object. + //! Considers a category number, by default 0, for all results Standard_EXPORT void AddMultiple (const Handle(Standard_Transient)& start, const Handle(Standard_Transient)& res); + //! Searches for a transient result attached to a starting object, + //! according to its type, by criterium IsKind(atype) + //! + //! In case of multiple result, explores the list and gives in + //! the first transient result IsKind(atype) + //! Returns True and fills if found + //! Else, returns False ( is not touched, not even nullified) + //! + //! This syntactic form avoids to do DownCast : if a result is + //! found with the good type, it is loaded in and can be + //! immediately used, well initialised Standard_EXPORT Standard_Boolean FindTypedTransient (const Handle(Standard_Transient)& start, const Handle(Standard_Type)& atype, Handle(Standard_Transient)& val) const; + //! Searches for a transient result recorded in a Binder, whatever + //! this Binder is recorded or not in + //! + //! This is strictly equivalent to the class method GetTypedResult + //! from class SimpleBinderOfTransient, but is just lighter to call + //! + //! Apart from this, works as FindTypedTransient Standard_EXPORT Standard_Boolean GetTypedTransient (const Handle(Transfer_Binder)& binder, const Handle(Standard_Type)& atype, Handle(Standard_Transient)& val) const; + //! Returns the maximum possible value for Map Index + //! (no result can be bound with a value greater than it) Standard_EXPORT Standard_Integer NbMapped() const; + //! Returns the Starting Object bound to an Index, Standard_EXPORT const Handle(Standard_Transient)& Mapped (const Standard_Integer num) const; + //! Returns the Index value bound to a Starting Object, 0 if none Standard_EXPORT Standard_Integer MapIndex (const Handle(Standard_Transient)& start) const; + //! Returns the Binder bound to an Index + //! Considers a category number, by default 0 Standard_EXPORT Handle(Transfer_Binder) MapItem (const Standard_Integer num) const; + //! Declares (and its Result) as Root. This status will be + //! later exploited by RootResult, see below (Result can be + //! produced at any time) Standard_EXPORT void SetRoot (const Handle(Standard_Transient)& start); + //! Enable (if True) or Disables (if False) Root + //! Management. If it is set, Transfers are considered as stacked + //! (a first Transfer commands other Transfers, and so on) and + //! the Transfers commanded by an external caller are "Root". + //! Remark : SetRoot can be called whatever this status, on every + //! object. + //! Default is set to True. Standard_EXPORT void SetRootManagement (const Standard_Boolean stat); + //! Returns the count of recorded Roots Standard_EXPORT Standard_Integer NbRoots() const; + //! Returns a Root Entity given its number in the list (1-NbRoots) Standard_EXPORT const Handle(Standard_Transient)& Root (const Standard_Integer num) const; + //! Returns the Binder bound with a Root Entity given its number + //! Considers a category number, by default 0 Standard_EXPORT Handle(Transfer_Binder) RootItem (const Standard_Integer num) const; + //! Returns the index in the list of roots for a starting item, + //! or 0 if it is not recorded as a root Standard_EXPORT Standard_Integer RootIndex (const Handle(Standard_Transient)& start) const; + //! Returns Nesting Level of Transfers (managed by methods + //! TranscriptWith & Co). Starts to zero. If no automatic Transfer + //! is used, it remains to zero. Zero means Root Level. Standard_EXPORT Standard_Integer NestingLevel() const; + //! Resets Nesting Level of Transfers to Zero (Root Level), + //! whatever its current value. Standard_EXPORT void ResetNestingLevel(); + //! Tells if has been recognized as good candidate for + //! Transfer. i.e. queries the Actor and its Nexts Standard_EXPORT Standard_Boolean Recognize (const Handle(Standard_Transient)& start) const; + //! Performs the Transfer of a Starting Object, by calling + //! the method TransferProduct (see below). + //! Mapping and Roots are managed : nothing is done if a Result is + //! already Bound, an exception is raised in case of error. Standard_EXPORT Handle(Transfer_Binder) Transferring (const Handle(Standard_Transient)& start); + //! Same as Transferring but does not return the Binder. + //! Simply returns True in case of success (for user call) Standard_EXPORT Standard_Boolean Transfer (const Handle(Standard_Transient)& start); + //! Allows controls if exceptions will be handled + //! Transfer Operations + //! False : they are not handled with try {} catch {} + //! True : they are + //! Default is False: no handling performed Standard_EXPORT void SetErrorHandle (const Standard_Boolean err); + //! Returns error handling flag Standard_EXPORT Standard_Boolean ErrorHandle() const; + //! Method called when trace is asked + //! Calls PrintTrace to display information relevant for starting + //! objects (which can be redefined) + //! is Nesting Level of Transfer (0 = root) + //! controls the way the trace is done : + //! 0 neutral, 1 for Error, 2 for Warning message, 3 for new Root Standard_EXPORT void StartTrace (const Handle(Transfer_Binder)& binder, const Handle(Standard_Transient)& start, const Standard_Integer level, const Standard_Integer mode) const; + //! Prints a short information on a starting object. By default + //! prints its Dynamic Type. Can be redefined Standard_EXPORT virtual void PrintTrace (const Handle(Standard_Transient)& start, const Handle(Message_Messenger)& S) const; + //! Returns True if we are surely in a DeadLoop. Evaluation is not + //! exact, it is a "majorant" which must be computed fast. + //! This "majorant" is : greater than NbMapped. Standard_EXPORT Standard_Boolean IsLooping (const Standard_Integer alevel) const; + //! Returns, as an iterator, the log of root transfer, i.e. the + //! created objects and Binders bound to starting roots + //! If withstart is given True, Starting Objets are also returned Standard_EXPORT Transfer_IteratorOfProcessForTransient RootResult (const Standard_Boolean withstart = Standard_False) const; + //! Returns, as an Iterator, the entire log of transfer (list of + //! created objects and Binders which can bring errors) + //! If withstart is given True, Starting Objets are also returned Standard_EXPORT Transfer_IteratorOfProcessForTransient CompleteResult (const Standard_Boolean withstart = Standard_False) const; + //! Returns Binders which are neither "Done" nor "Initial", + //! that is Error,Loop or Run (abnormal states at end of Transfer) + //! Starting Objects are given in correspondance in the iterator Standard_EXPORT Transfer_IteratorOfProcessForTransient AbnormalResult() const; + //! Returns a CheckList as a list of Check : each one is for a + //! starting entity which have either check (warning or fail) + //! messages are attached, or are in abnormal state : that case + //! gives a specific message + //! If is True, checks with Warnings only are ignored Standard_EXPORT Interface_CheckIterator CheckList (const Standard_Boolean erronly) const; + //! Returns, as an Iterator, the log of transfer for one object + //! = 0 : this object only + //! and if is a scope owner (else, is ignored) : + //! = 1 : object plus its immediate scoped ones + //! = 2 : object plus all its scoped ones Standard_EXPORT Transfer_IteratorOfProcessForTransient ResultOne (const Handle(Standard_Transient)& start, const Standard_Integer level, const Standard_Boolean withstart = Standard_False) const; + //! Returns a CheckList for one starting object + //! interpreted as by ResultOne + //! If is True, checks with Warnings only are ignored Standard_EXPORT Interface_CheckIterator CheckListOne (const Handle(Standard_Transient)& start, const Standard_Integer level, const Standard_Boolean erronly) const; + //! Returns True if no check message is attached to a starting + //! object. interpreted as by ResultOne + //! If is True, checks with Warnings only are ignored Standard_EXPORT Standard_Boolean IsCheckListEmpty (const Handle(Standard_Transient)& start, const Standard_Integer level, const Standard_Boolean erronly) const; + //! Removes Results attached to (== Unbinds) a given object and, + //! according : + //! = 0 : only it + //! = 1 : it plus its immediately owned sub-results(scope) + //! = 2 : it plus all its owned sub-results(scope) Standard_EXPORT void RemoveResult (const Handle(Standard_Transient)& start, const Standard_Integer level, const Standard_Boolean compute = Standard_True); + //! Computes a number to be associated to a starting object in + //! a check or a check-list + //! By default, returns 0; can be redefined Standard_EXPORT virtual Standard_Integer CheckNum (const Handle(Standard_Transient)& start) const; + //! Sets Progress indicator Standard_EXPORT void SetProgress (const Handle(Message_ProgressIndicator)& theProgress); + //! Gets Progress indicator Standard_EXPORT Handle(Message_ProgressIndicator) GetProgress() const; @@ -202,8 +424,18 @@ protected: private: + //! Same as Find but stores the last access to the map, for a + //! faster access on next calls (as Bind does too) + //! Considers a category number, by default 0 + //! C++ : return const & Standard_EXPORT Handle(Transfer_Binder) FindAndMask (const Handle(Standard_Transient)& start); + //! Internal action of Transfer, called by Transferring, with or + //! without ErrorHandle. It invokes the Actor to work (set by + //! SetActor), and tries its Nexts if no result is produced, + //! until a Non Null Binder is produced. + //! But keep in mind that a Null Binder can allways be returned + //! if a Starting Entity has not been recognized at all. Standard_EXPORT Handle(Transfer_Binder) TransferProduct (const Handle(Standard_Transient)& start); Standard_Boolean theerrh; diff --git a/src/Transfer/Transfer_TransferMapOfProcessForFinder.hxx b/src/Transfer/Transfer_TransferMapOfProcessForFinder.hxx index d635e3f49e..afb14d9187 100644 --- a/src/Transfer/Transfer_TransferMapOfProcessForFinder.hxx +++ b/src/Transfer/Transfer_TransferMapOfProcessForFinder.hxx @@ -42,52 +42,105 @@ public: DEFINE_STANDARD_ALLOC + //! Constructs an IndexedDataMap with NbBuckets + //! (defaulted to 1) buckets. + //! Note that the map will be automatically redimensioned + //! during its use if the number of entries becomes too large. + //! Use: + //! - the function Add to add an entry (key, item, index) in the map, + //! - operator() to read an item from an index, or to + //! assign a new value to this item, + //! - the function FindFromKey or ChangeFromKey to + //! read an item from a key, or to assign a new value to this item, + //! - the function RemoveLast to remove the last entry from the map, + //! - and other available edition and querying functions. Standard_EXPORT Transfer_TransferMapOfProcessForFinder(const Standard_Integer NbBuckets = 1); + //! Replace the content of this map by the content of + //! the map . Standard_EXPORT Transfer_TransferMapOfProcessForFinder& Assign (const Transfer_TransferMapOfProcessForFinder& Other); Transfer_TransferMapOfProcessForFinder& operator = (const Transfer_TransferMapOfProcessForFinder& Other) { return Assign(Other); } + //! Changes the number of buckets of to be + //! . The entries (key + item + index) already + //! stored in this map are maintained. Standard_EXPORT void ReSize (const Standard_Integer NbBuckets); + //! Removes all keys in the map. Standard_EXPORT void Clear(); ~Transfer_TransferMapOfProcessForFinder() { Clear(); } + //! Adds the Key to the Map . Returns the + //! index of the Key. The key is new in the map if + //! Extent has been incremented. The Item is + //! stored with the key. If the key was already in the + //! map the previous item is not replaced by . Standard_EXPORT Standard_Integer Add (const Handle(Transfer_Finder)& K, const Handle(Transfer_Binder)& I); + //! Substitutes the Key at index with . + //! must be a valid index, must be a new key. + //! becomes the Item stored with . + //! Trigger: Raises OutOfRange if I < 1 or I > Extent. + //! Raises DomainError if Contains(K). Standard_EXPORT void Substitute (const Standard_Integer I, const Handle(Transfer_Finder)& K, const Handle(Transfer_Binder)& T); + //! Removes the last key entered in the map, i.e the + //! key of index Extent(). + //! I must be a valid index and K must be a new key. + //! Exceptions + //! - Standard_OutOfRange if the index I is less than 1 or + //! greater than the number of entries in this map. + //! - Standard_DomainError if the key K is already in this map. Standard_EXPORT void RemoveLast(); + //! Returns True if the key is stored in the map . Standard_EXPORT Standard_Boolean Contains (const Handle(Transfer_Finder)& K) const; + //! Returns the Key of index . + //! Exceptions + //! Standard_OutOfRange if I is less than 1 or greater than + //! the number of entries in this map. Standard_EXPORT const Handle(Transfer_Finder)& FindKey (const Standard_Integer I) const; + //! Returns the Item of index . Standard_EXPORT const Handle(Transfer_Binder)& FindFromIndex (const Standard_Integer I) const; const Handle(Transfer_Binder)& operator () (const Standard_Integer I) const { return FindFromIndex(I); } + //! Returns the Item of index . The Item can be + //! modified with the syntax aMap(Index) = newItem. Standard_EXPORT Handle(Transfer_Binder)& ChangeFromIndex (const Standard_Integer I); Handle(Transfer_Binder)& operator () (const Standard_Integer I) { return ChangeFromIndex(I); } + //! Returns the index of the key . + //! Returns 0 if K is not in the map. Standard_EXPORT Standard_Integer FindIndex (const Handle(Transfer_Finder)& K) const; + //! Returns the Item of the key + //! Trigger: Raises NoSuchObject if K is not in the map. Standard_EXPORT const Handle(Transfer_Binder)& FindFromKey (const Handle(Transfer_Finder)& K) const; + //! Returns the Item of the key + //! Trigger: Raises NoSuchObject if K is not in the map. Standard_EXPORT Handle(Transfer_Binder)& ChangeFromKey (const Handle(Transfer_Finder)& K); + //! Returns the address of Item of the key + //! or NULL if K is not in the map. Standard_EXPORT Standard_Address FindFromKey1 (const Handle(Transfer_Finder)& K) const; + //! Returns the address of Item of the key + //! or NULL if K is not in the map. Standard_EXPORT Standard_Address ChangeFromKey1 (const Handle(Transfer_Finder)& K); @@ -102,6 +155,10 @@ protected: private: + //! As copying Map is an expensive operation it is + //! incorrect to do it implicitly. This constructor + //! will raise an error if the Map is not empty. To copy the + //! content of a Map use the Assign method (operator =). Standard_EXPORT Transfer_TransferMapOfProcessForFinder(const Transfer_TransferMapOfProcessForFinder& Other); diff --git a/src/Transfer/Transfer_TransferMapOfProcessForTransient.hxx b/src/Transfer/Transfer_TransferMapOfProcessForTransient.hxx index ffc873d77d..e89625c624 100644 --- a/src/Transfer/Transfer_TransferMapOfProcessForTransient.hxx +++ b/src/Transfer/Transfer_TransferMapOfProcessForTransient.hxx @@ -42,52 +42,105 @@ public: DEFINE_STANDARD_ALLOC + //! Constructs an IndexedDataMap with NbBuckets + //! (defaulted to 1) buckets. + //! Note that the map will be automatically redimensioned + //! during its use if the number of entries becomes too large. + //! Use: + //! - the function Add to add an entry (key, item, index) in the map, + //! - operator() to read an item from an index, or to + //! assign a new value to this item, + //! - the function FindFromKey or ChangeFromKey to + //! read an item from a key, or to assign a new value to this item, + //! - the function RemoveLast to remove the last entry from the map, + //! - and other available edition and querying functions. Standard_EXPORT Transfer_TransferMapOfProcessForTransient(const Standard_Integer NbBuckets = 1); + //! Replace the content of this map by the content of + //! the map . Standard_EXPORT Transfer_TransferMapOfProcessForTransient& Assign (const Transfer_TransferMapOfProcessForTransient& Other); Transfer_TransferMapOfProcessForTransient& operator = (const Transfer_TransferMapOfProcessForTransient& Other) { return Assign(Other); } + //! Changes the number of buckets of to be + //! . The entries (key + item + index) already + //! stored in this map are maintained. Standard_EXPORT void ReSize (const Standard_Integer NbBuckets); + //! Removes all keys in the map. Standard_EXPORT void Clear(); ~Transfer_TransferMapOfProcessForTransient() { Clear(); } + //! Adds the Key to the Map . Returns the + //! index of the Key. The key is new in the map if + //! Extent has been incremented. The Item is + //! stored with the key. If the key was already in the + //! map the previous item is not replaced by . Standard_EXPORT Standard_Integer Add (const Handle(Standard_Transient)& K, const Handle(Transfer_Binder)& I); + //! Substitutes the Key at index with . + //! must be a valid index, must be a new key. + //! becomes the Item stored with . + //! Trigger: Raises OutOfRange if I < 1 or I > Extent. + //! Raises DomainError if Contains(K). Standard_EXPORT void Substitute (const Standard_Integer I, const Handle(Standard_Transient)& K, const Handle(Transfer_Binder)& T); + //! Removes the last key entered in the map, i.e the + //! key of index Extent(). + //! I must be a valid index and K must be a new key. + //! Exceptions + //! - Standard_OutOfRange if the index I is less than 1 or + //! greater than the number of entries in this map. + //! - Standard_DomainError if the key K is already in this map. Standard_EXPORT void RemoveLast(); + //! Returns True if the key is stored in the map . Standard_EXPORT Standard_Boolean Contains (const Handle(Standard_Transient)& K) const; + //! Returns the Key of index . + //! Exceptions + //! Standard_OutOfRange if I is less than 1 or greater than + //! the number of entries in this map. Standard_EXPORT const Handle(Standard_Transient)& FindKey (const Standard_Integer I) const; + //! Returns the Item of index . Standard_EXPORT const Handle(Transfer_Binder)& FindFromIndex (const Standard_Integer I) const; const Handle(Transfer_Binder)& operator () (const Standard_Integer I) const { return FindFromIndex(I); } + //! Returns the Item of index . The Item can be + //! modified with the syntax aMap(Index) = newItem. Standard_EXPORT Handle(Transfer_Binder)& ChangeFromIndex (const Standard_Integer I); Handle(Transfer_Binder)& operator () (const Standard_Integer I) { return ChangeFromIndex(I); } + //! Returns the index of the key . + //! Returns 0 if K is not in the map. Standard_EXPORT Standard_Integer FindIndex (const Handle(Standard_Transient)& K) const; + //! Returns the Item of the key + //! Trigger: Raises NoSuchObject if K is not in the map. Standard_EXPORT const Handle(Transfer_Binder)& FindFromKey (const Handle(Standard_Transient)& K) const; + //! Returns the Item of the key + //! Trigger: Raises NoSuchObject if K is not in the map. Standard_EXPORT Handle(Transfer_Binder)& ChangeFromKey (const Handle(Standard_Transient)& K); + //! Returns the address of Item of the key + //! or NULL if K is not in the map. Standard_EXPORT Standard_Address FindFromKey1 (const Handle(Standard_Transient)& K) const; + //! Returns the address of Item of the key + //! or NULL if K is not in the map. Standard_EXPORT Standard_Address ChangeFromKey1 (const Handle(Standard_Transient)& K); @@ -102,6 +155,10 @@ protected: private: + //! As copying Map is an expensive operation it is + //! incorrect to do it implicitly. This constructor + //! will raise an error if the Map is not empty. To copy the + //! content of a Map use the Assign method (operator =). Standard_EXPORT Transfer_TransferMapOfProcessForTransient(const Transfer_TransferMapOfProcessForTransient& Other); diff --git a/src/Transfer/Transfer_TransientMapper.hxx b/src/Transfer/Transfer_TransientMapper.hxx index 780122a8a1..3635d21ecb 100644 --- a/src/Transfer/Transfer_TransientMapper.hxx +++ b/src/Transfer/Transfer_TransientMapper.hxx @@ -40,14 +40,25 @@ class Transfer_TransientMapper : public Transfer_Finder public: + //! Creates a Mapper with a Value. This Value can then not be + //! changed. It is used by the Hasher to compute the HashCode, + //! which will then be stored for an immediate reading. Standard_EXPORT Transfer_TransientMapper(const Handle(Standard_Transient)& akey); + //! Returns the contained value Standard_EXPORT const Handle(Standard_Transient)& Value() const; + //! Specific testof equallity : defined as False if has + //! not the same true Type, else contents are compared (by + //! C++ operator ==) Standard_EXPORT Standard_Boolean Equates (const Handle(Transfer_Finder)& other) const; + //! Returns the Type of the Value. By default, returns the + //! DynamicType of , but can be redefined Standard_EXPORT virtual Handle(Standard_Type) ValueType() const Standard_OVERRIDE; + //! Returns the name of the Type of the Value. Default is name + //! of ValueType, unless it is for a non-handled object Standard_EXPORT virtual Standard_CString ValueTypeName() const Standard_OVERRIDE; diff --git a/src/TransferBRep/TransferBRep_OrientedShapeMapper.hxx b/src/TransferBRep/TransferBRep_OrientedShapeMapper.hxx index a1103e8628..ba1f97a89f 100644 --- a/src/TransferBRep/TransferBRep_OrientedShapeMapper.hxx +++ b/src/TransferBRep/TransferBRep_OrientedShapeMapper.hxx @@ -41,14 +41,25 @@ class TransferBRep_OrientedShapeMapper : public Transfer_Finder public: + //! Creates a Mapper with a Value. This Value can then not be + //! changed. It is used by the Hasher to compute the HashCode, + //! which will then be stored for an immediate reading. Standard_EXPORT TransferBRep_OrientedShapeMapper(const TopoDS_Shape& akey); + //! Returns the contained value Standard_EXPORT const TopoDS_Shape& Value() const; + //! Specific testof equallity : defined as False if has + //! not the same true Type, else contents are compared (by + //! C++ operator ==) Standard_EXPORT Standard_Boolean Equates (const Handle(Transfer_Finder)& other) const; + //! Returns the Type of the Value. By default, returns the + //! DynamicType of , but can be redefined Standard_EXPORT virtual Handle(Standard_Type) ValueType() const Standard_OVERRIDE; + //! Returns the name of the Type of the Value. Default is name + //! of ValueType, unless it is for a non-handled object Standard_EXPORT virtual Standard_CString ValueTypeName() const Standard_OVERRIDE; diff --git a/src/TransferBRep/TransferBRep_ShapeMapper.hxx b/src/TransferBRep/TransferBRep_ShapeMapper.hxx index 5f1a68f92f..3a66311447 100644 --- a/src/TransferBRep/TransferBRep_ShapeMapper.hxx +++ b/src/TransferBRep/TransferBRep_ShapeMapper.hxx @@ -41,14 +41,25 @@ class TransferBRep_ShapeMapper : public Transfer_Finder public: + //! Creates a Mapper with a Value. This Value can then not be + //! changed. It is used by the Hasher to compute the HashCode, + //! which will then be stored for an immediate reading. Standard_EXPORT TransferBRep_ShapeMapper(const TopoDS_Shape& akey); + //! Returns the contained value Standard_EXPORT const TopoDS_Shape& Value() const; + //! Specific testof equallity : defined as False if has + //! not the same true Type, else contents are compared (by + //! C++ operator ==) Standard_EXPORT Standard_Boolean Equates (const Handle(Transfer_Finder)& other) const; + //! Returns the Type of the Value. By default, returns the + //! DynamicType of , but can be redefined Standard_EXPORT virtual Handle(Standard_Type) ValueType() const Standard_OVERRIDE; + //! Returns the name of the Type of the Value. Default is name + //! of ValueType, unless it is for a non-handled object Standard_EXPORT virtual Standard_CString ValueTypeName() const Standard_OVERRIDE;