Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-16 09:16:49

0001 // Created on: 1995-04-25
0002 // Created by: Modelistation
0003 // Copyright (c) 1995-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _ChFi3d_FilBuilder_HeaderFile
0018 #define _ChFi3d_FilBuilder_HeaderFile
0019 
0020 #include <BRepAdaptor_Surface.hxx>
0021 #include <BlendFunc_SectionShape.hxx>
0022 #include <ChFi3d_Builder.hxx>
0023 #include <ChFi3d_FilletShape.hxx>
0024 #include <ChFiDS_Stripe.hxx>
0025 #include <NCollection_List.hxx>
0026 #include <ChFiDS_ElSpine.hxx>
0027 #include <ChFiDS_CircSection.hxx>
0028 #include <NCollection_Array1.hxx>
0029 #include <NCollection_HArray1.hxx>
0030 #include <ChFiDS_SurfData.hxx>
0031 #include <NCollection_Sequence.hxx>
0032 #include <math_Vector.hxx>
0033 #include <TopAbs_Orientation.hxx>
0034 #include <TopAbs_State.hxx>
0035 
0036 class Adaptor3d_TopolTool;
0037 class BRepBlend_Line;
0038 class gp_XY;
0039 class ChFiDS_SurfData;
0040 class ChFiDS_Spine;
0041 class ChFiDS_Stripe;
0042 class Law_Function;
0043 class TopoDS_Edge;
0044 class TopoDS_Shape;
0045 class TopoDS_Vertex;
0046 
0047 //! Tool of construction of fillets 3d on edges (on a solid).
0048 class ChFi3d_FilBuilder : public ChFi3d_Builder
0049 {
0050 public:
0051   DEFINE_STANDARD_ALLOC
0052 
0053   Standard_EXPORT ChFi3d_FilBuilder(const TopoDS_Shape&      S,
0054                                     const ChFi3d_FilletShape FShape = ChFi3d_Rational,
0055                                     const double             Ta     = 1.0e-2);
0056 
0057   //! Sets the type of fillet surface.
0058   Standard_EXPORT void SetFilletShape(const ChFi3d_FilletShape FShape);
0059 
0060   //! Returns the type of fillet surface.
0061   Standard_EXPORT ChFi3d_FilletShape GetFilletShape() const;
0062 
0063   //! initialisation of a contour with the first edge
0064   //! (the following are found by propagation).
0065   //! Attention, you need to start with SetRadius.
0066   Standard_EXPORT void Add(const TopoDS_Edge& E);
0067 
0068   //! initialisation of the constant vector the corresponding 1st edge.
0069   Standard_EXPORT void Add(const double Radius, const TopoDS_Edge& E);
0070 
0071   //! Set the radius of the contour of index IC.
0072   Standard_EXPORT void SetRadius(const occ::handle<Law_Function>& C, const int IC, const int IinC);
0073 
0074   //! Returns true the contour is flagged as edge constant.
0075   Standard_EXPORT bool IsConstant(const int IC);
0076 
0077   //! Returns the vector if the contour is flagged as edge
0078   //! constant.
0079   Standard_EXPORT double Radius(const int IC);
0080 
0081   //! Reset all vectors of contour IC.
0082   Standard_EXPORT void ResetContour(const int IC);
0083 
0084   //! Set a constant on edge E of the contour of
0085   //! index IC. Since then E is flagged as constant.
0086   Standard_EXPORT void SetRadius(const double Radius, const int IC, const TopoDS_Edge& E);
0087 
0088   //! Extracts the flag constant and the vector of edge E.
0089   Standard_EXPORT void UnSet(const int IC, const TopoDS_Edge& E);
0090 
0091   //! Set a vector on vertex V of the contour of index IC.
0092   Standard_EXPORT void SetRadius(const double Radius, const int IC, const TopoDS_Vertex& V);
0093 
0094   //! Extracts the vector of the vertex V.
0095   Standard_EXPORT void UnSet(const int IC, const TopoDS_Vertex& V);
0096 
0097   //! Set a vertex on the point of parameter U in the edge IinC
0098   //! of the contour of index IC
0099   Standard_EXPORT void SetRadius(const gp_XY& UandR, const int IC, const int IinC);
0100 
0101   //! Returns true E is flagged as edge constant.
0102   Standard_EXPORT bool IsConstant(const int IC, const TopoDS_Edge& E);
0103 
0104   //! Returns the vector if E is flagged as edge constant.
0105   Standard_EXPORT double Radius(const int IC, const TopoDS_Edge& E);
0106 
0107   //! Returns in First and Last extremities of the
0108   //! part of variable vector framing E, returns
0109   //! False if E is flagged as edge constant.
0110   Standard_EXPORT bool GetBounds(const int IC, const TopoDS_Edge& E, double& First, double& Last);
0111 
0112   //! Returns the rule of elementary evolution of the
0113   //! part to variable vector framing E, returns a
0114   //! rule zero if E is flagged as edge constant.
0115   Standard_EXPORT occ::handle<Law_Function> GetLaw(const int IC, const TopoDS_Edge& E);
0116 
0117   //! Sets the rule of elementary evolution of the
0118   //! part to variable vector framing E.
0119   Standard_EXPORT void SetLaw(const int                        IC,
0120                               const TopoDS_Edge&               E,
0121                               const occ::handle<Law_Function>& L);
0122 
0123   Standard_EXPORT void Simulate(const int IC);
0124 
0125   Standard_EXPORT int NbSurf(const int IC) const;
0126 
0127   Standard_EXPORT occ::handle<NCollection_HArray1<ChFiDS_CircSection>> Sect(const int IC,
0128                                                                             const int IS) const;
0129 
0130 protected:
0131   Standard_EXPORT void SimulKPart(const occ::handle<ChFiDS_SurfData>& SD) const override;
0132 
0133   Standard_EXPORT bool SimulSurf(occ::handle<ChFiDS_SurfData>&           Data,
0134                                  const occ::handle<ChFiDS_ElSpine>&      Guide,
0135                                  const occ::handle<ChFiDS_Spine>&        Spine,
0136                                  const int                               Choix,
0137                                  const occ::handle<BRepAdaptor_Surface>& S1,
0138                                  const occ::handle<Adaptor3d_TopolTool>& I1,
0139                                  const occ::handle<BRepAdaptor_Surface>& S2,
0140                                  const occ::handle<Adaptor3d_TopolTool>& I2,
0141                                  const double                            TolGuide,
0142                                  double&                                 First,
0143                                  double&                                 Last,
0144                                  const bool                              Inside,
0145                                  const bool                              Appro,
0146                                  const bool                              Forward,
0147                                  const bool                              RecOnS1,
0148                                  const bool                              RecOnS2,
0149                                  const math_Vector&                      Soldep,
0150                                  int&                                    Intf,
0151                                  int&                                    Intl) override;
0152 
0153   Standard_EXPORT void SimulSurf(occ::handle<ChFiDS_SurfData>&           Data,
0154                                  const occ::handle<ChFiDS_ElSpine>&      Guide,
0155                                  const occ::handle<ChFiDS_Spine>&        Spine,
0156                                  const int                               Choix,
0157                                  const occ::handle<BRepAdaptor_Surface>& S1,
0158                                  const occ::handle<Adaptor3d_TopolTool>& I1,
0159                                  const occ::handle<BRepAdaptor_Curve2d>& PC1,
0160                                  const occ::handle<BRepAdaptor_Surface>& Sref1,
0161                                  const occ::handle<BRepAdaptor_Curve2d>& PCref1,
0162                                  bool&                                   Decroch1,
0163                                  const occ::handle<BRepAdaptor_Surface>& S2,
0164                                  const occ::handle<Adaptor3d_TopolTool>& I2,
0165                                  const TopAbs_Orientation                Or2,
0166                                  const double                            Fleche,
0167                                  const double                            TolGuide,
0168                                  double&                                 First,
0169                                  double&                                 Last,
0170                                  const bool                              Inside,
0171                                  const bool                              Appro,
0172                                  const bool                              Forward,
0173                                  const bool                              RecP,
0174                                  const bool                              RecS,
0175                                  const bool                              RecRst,
0176                                  const math_Vector&                      Soldep) override;
0177 
0178   Standard_EXPORT void SimulSurf(occ::handle<ChFiDS_SurfData>&           Data,
0179                                  const occ::handle<ChFiDS_ElSpine>&      Guide,
0180                                  const occ::handle<ChFiDS_Spine>&        Spine,
0181                                  const int                               Choix,
0182                                  const occ::handle<BRepAdaptor_Surface>& S1,
0183                                  const occ::handle<Adaptor3d_TopolTool>& I1,
0184                                  const TopAbs_Orientation                Or1,
0185                                  const occ::handle<BRepAdaptor_Surface>& S2,
0186                                  const occ::handle<Adaptor3d_TopolTool>& I2,
0187                                  const occ::handle<BRepAdaptor_Curve2d>& PC2,
0188                                  const occ::handle<BRepAdaptor_Surface>& Sref2,
0189                                  const occ::handle<BRepAdaptor_Curve2d>& PCref2,
0190                                  bool&                                   Decroch2,
0191                                  const double                            Fleche,
0192                                  const double                            TolGuide,
0193                                  double&                                 First,
0194                                  double&                                 Last,
0195                                  const bool                              Inside,
0196                                  const bool                              Appro,
0197                                  const bool                              Forward,
0198                                  const bool                              RecP,
0199                                  const bool                              RecS,
0200                                  const bool                              RecRst,
0201                                  const math_Vector&                      Soldep) override;
0202 
0203   Standard_EXPORT void SimulSurf(occ::handle<ChFiDS_SurfData>&           Data,
0204                                  const occ::handle<ChFiDS_ElSpine>&      Guide,
0205                                  const occ::handle<ChFiDS_Spine>&        Spine,
0206                                  const int                               Choix,
0207                                  const occ::handle<BRepAdaptor_Surface>& S1,
0208                                  const occ::handle<Adaptor3d_TopolTool>& I1,
0209                                  const occ::handle<BRepAdaptor_Curve2d>& PC1,
0210                                  const occ::handle<BRepAdaptor_Surface>& Sref1,
0211                                  const occ::handle<BRepAdaptor_Curve2d>& PCref1,
0212                                  bool&                                   Decroch1,
0213                                  const TopAbs_Orientation                Or1,
0214                                  const occ::handle<BRepAdaptor_Surface>& S2,
0215                                  const occ::handle<Adaptor3d_TopolTool>& I2,
0216                                  const occ::handle<BRepAdaptor_Curve2d>& PC2,
0217                                  const occ::handle<BRepAdaptor_Surface>& Sref2,
0218                                  const occ::handle<BRepAdaptor_Curve2d>& PCref2,
0219                                  bool&                                   Decroch2,
0220                                  const TopAbs_Orientation                Or2,
0221                                  const double                            Fleche,
0222                                  const double                            TolGuide,
0223                                  double&                                 First,
0224                                  double&                                 Last,
0225                                  const bool                              Inside,
0226                                  const bool                              Appro,
0227                                  const bool                              Forward,
0228                                  const bool                              RecP1,
0229                                  const bool                              RecRst1,
0230                                  const bool                              RecP2,
0231                                  const bool                              RecRst2,
0232                                  const math_Vector&                      Soldep) override;
0233 
0234   Standard_EXPORT bool PerformFirstSection(const occ::handle<ChFiDS_Spine>&        S,
0235                                            const occ::handle<ChFiDS_ElSpine>&      HGuide,
0236                                            const int                               Choix,
0237                                            occ::handle<BRepAdaptor_Surface>&       S1,
0238                                            occ::handle<BRepAdaptor_Surface>&       S2,
0239                                            const occ::handle<Adaptor3d_TopolTool>& I1,
0240                                            const occ::handle<Adaptor3d_TopolTool>& I2,
0241                                            const double                            Par,
0242                                            math_Vector&                            SolDep,
0243                                            TopAbs_State&                           Pos1,
0244                                            TopAbs_State& Pos2) const override;
0245 
0246   //! Method calculates the elements of construction of the
0247   //! fillet (constant or evolutive).
0248   Standard_EXPORT bool PerformSurf(NCollection_Sequence<occ::handle<ChFiDS_SurfData>>& SeqData,
0249                                    const occ::handle<ChFiDS_ElSpine>&                  Guide,
0250                                    const occ::handle<ChFiDS_Spine>&                    Spine,
0251                                    const int                                           Choix,
0252                                    const occ::handle<BRepAdaptor_Surface>&             S1,
0253                                    const occ::handle<Adaptor3d_TopolTool>&             I1,
0254                                    const occ::handle<BRepAdaptor_Surface>&             S2,
0255                                    const occ::handle<Adaptor3d_TopolTool>&             I2,
0256                                    const double                                        MaxStep,
0257                                    const double                                        Fleche,
0258                                    const double                                        TolGuide,
0259                                    double&                                             First,
0260                                    double&                                             Last,
0261                                    const bool                                          Inside,
0262                                    const bool                                          Appro,
0263                                    const bool                                          Forward,
0264                                    const bool                                          RecOnS1,
0265                                    const bool                                          RecOnS2,
0266                                    const math_Vector&                                  Soldep,
0267                                    int&                                                Intf,
0268                                    int& Intl) override;
0269 
0270   Standard_EXPORT void PerformSurf(NCollection_Sequence<occ::handle<ChFiDS_SurfData>>& SeqData,
0271                                    const occ::handle<ChFiDS_ElSpine>&                  Guide,
0272                                    const occ::handle<ChFiDS_Spine>&                    Spine,
0273                                    const int                                           Choix,
0274                                    const occ::handle<BRepAdaptor_Surface>&             S1,
0275                                    const occ::handle<Adaptor3d_TopolTool>&             I1,
0276                                    const occ::handle<BRepAdaptor_Curve2d>&             PC1,
0277                                    const occ::handle<BRepAdaptor_Surface>&             Sref1,
0278                                    const occ::handle<BRepAdaptor_Curve2d>&             PCref1,
0279                                    bool&                                               Decroch1,
0280                                    const occ::handle<BRepAdaptor_Surface>&             S2,
0281                                    const occ::handle<Adaptor3d_TopolTool>&             I2,
0282                                    const TopAbs_Orientation                            Or2,
0283                                    const double                                        MaxStep,
0284                                    const double                                        Fleche,
0285                                    const double                                        TolGuide,
0286                                    double&                                             First,
0287                                    double&                                             Last,
0288                                    const bool                                          Inside,
0289                                    const bool                                          Appro,
0290                                    const bool                                          Forward,
0291                                    const bool                                          RecP,
0292                                    const bool                                          RecS,
0293                                    const bool                                          RecRst,
0294                                    const math_Vector& Soldep) override;
0295 
0296   Standard_EXPORT void PerformSurf(NCollection_Sequence<occ::handle<ChFiDS_SurfData>>& SeqData,
0297                                    const occ::handle<ChFiDS_ElSpine>&                  Guide,
0298                                    const occ::handle<ChFiDS_Spine>&                    Spine,
0299                                    const int                                           Choix,
0300                                    const occ::handle<BRepAdaptor_Surface>&             S1,
0301                                    const occ::handle<Adaptor3d_TopolTool>&             I1,
0302                                    const TopAbs_Orientation                            Or1,
0303                                    const occ::handle<BRepAdaptor_Surface>&             S2,
0304                                    const occ::handle<Adaptor3d_TopolTool>&             I2,
0305                                    const occ::handle<BRepAdaptor_Curve2d>&             PC2,
0306                                    const occ::handle<BRepAdaptor_Surface>&             Sref2,
0307                                    const occ::handle<BRepAdaptor_Curve2d>&             PCref2,
0308                                    bool&                                               Decroch2,
0309                                    const double                                        MaxStep,
0310                                    const double                                        Fleche,
0311                                    const double                                        TolGuide,
0312                                    double&                                             First,
0313                                    double&                                             Last,
0314                                    const bool                                          Inside,
0315                                    const bool                                          Appro,
0316                                    const bool                                          Forward,
0317                                    const bool                                          RecP,
0318                                    const bool                                          RecS,
0319                                    const bool                                          RecRst,
0320                                    const math_Vector& Soldep) override;
0321 
0322   Standard_EXPORT void PerformSurf(NCollection_Sequence<occ::handle<ChFiDS_SurfData>>& Data,
0323                                    const occ::handle<ChFiDS_ElSpine>&                  Guide,
0324                                    const occ::handle<ChFiDS_Spine>&                    Spine,
0325                                    const int                                           Choix,
0326                                    const occ::handle<BRepAdaptor_Surface>&             S1,
0327                                    const occ::handle<Adaptor3d_TopolTool>&             I1,
0328                                    const occ::handle<BRepAdaptor_Curve2d>&             PC1,
0329                                    const occ::handle<BRepAdaptor_Surface>&             Sref1,
0330                                    const occ::handle<BRepAdaptor_Curve2d>&             PCref1,
0331                                    bool&                                               Decroch1,
0332                                    const TopAbs_Orientation                            Or1,
0333                                    const occ::handle<BRepAdaptor_Surface>&             S2,
0334                                    const occ::handle<Adaptor3d_TopolTool>&             I2,
0335                                    const occ::handle<BRepAdaptor_Curve2d>&             PC2,
0336                                    const occ::handle<BRepAdaptor_Surface>&             Sref2,
0337                                    const occ::handle<BRepAdaptor_Curve2d>&             PCref2,
0338                                    bool&                                               Decroch2,
0339                                    const TopAbs_Orientation                            Or2,
0340                                    const double                                        MaxStep,
0341                                    const double                                        Fleche,
0342                                    const double                                        TolGuide,
0343                                    double&                                             First,
0344                                    double&                                             Last,
0345                                    const bool                                          Inside,
0346                                    const bool                                          Appro,
0347                                    const bool                                          Forward,
0348                                    const bool                                          RecP1,
0349                                    const bool                                          RecRst1,
0350                                    const bool                                          RecP2,
0351                                    const bool                                          RecRst2,
0352                                    const math_Vector& Soldep) override;
0353 
0354   //! Method to split an singular SurfData in several non
0355   //! singular SurfData..
0356   Standard_EXPORT void SplitSurf(NCollection_Sequence<occ::handle<ChFiDS_SurfData>>& SeqData,
0357                                  const occ::handle<BRepBlend_Line>&                  line);
0358 
0359   Standard_EXPORT void PerformTwoCorner(const int Index) override;
0360 
0361   Standard_EXPORT void PerformThreeCorner(const int Index) override;
0362 
0363   Standard_EXPORT void ExtentOneCorner(const TopoDS_Vertex&              V,
0364                                        const occ::handle<ChFiDS_Stripe>& S) override;
0365 
0366   Standard_EXPORT void ExtentTwoCorner(
0367     const TopoDS_Vertex&                                V,
0368     const NCollection_List<occ::handle<ChFiDS_Stripe>>& LS) override;
0369 
0370   Standard_EXPORT void ExtentThreeCorner(
0371     const TopoDS_Vertex&                                V,
0372     const NCollection_List<occ::handle<ChFiDS_Stripe>>& LS) override;
0373 
0374   Standard_EXPORT void SetRegul() override;
0375 
0376 private:
0377   BlendFunc_SectionShape myShape;
0378 };
0379 
0380 #endif // _ChFi3d_FilBuilder_HeaderFile