Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-10-24 09:13:06

0001 // Created on: 1994-01-10
0002 // Created by: Yves FRICAUD
0003 // Copyright (c) 1994-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 _Bisector_BisecCC_HeaderFile
0018 #define _Bisector_BisecCC_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 
0022 #include <NCollection_Sequence.hxx>
0023 #include <Standard_Integer.hxx>
0024 #include <Bisector_PolyBis.hxx>
0025 #include <gp_Pnt2d.hxx>
0026 #include <Bisector_Curve.hxx>
0027 #include <GeomAbs_Shape.hxx>
0028 class Geom2d_Curve;
0029 class Geom2d_Geometry;
0030 class gp_Trsf2d;
0031 class gp_Vec2d;
0032 
0033 //! Construct the bisector between two curves.
0034 //! The curves can intersect only in their extremities.
0035 class Bisector_BisecCC : public Bisector_Curve
0036 {
0037 
0038 public:
0039   Standard_EXPORT Bisector_BisecCC();
0040 
0041   //! Constructs the bisector between the curves <Cu1>
0042   //! and <Cu2>.
0043   //!
0044   //! <Side1> (resp <Side2>) = 1 if the
0045   //! bisector curve is on the left of <Cu1> (resp <Cu2>)
0046   //! else <Side1> (resp <Side2>) = -1.
0047   //!
0048   //! the Bisector is trimmed by the Point <Origin>.
0049   //! <DistMax> is used to trim the bisector.The distance
0050   //! between the points of the bisector and <Cu> is smaller
0051   //! than <DistMax>.
0052   Standard_EXPORT Bisector_BisecCC(const occ::handle<Geom2d_Curve>& Cu1,
0053                                    const occ::handle<Geom2d_Curve>& Cu2,
0054                                    const double                     Side1,
0055                                    const double                     Side2,
0056                                    const gp_Pnt2d&                  Origin,
0057                                    const double                     DistMax = 500);
0058 
0059   //! Computes the bisector between the curves <Cu1>
0060   //! and <Cu2>.
0061   //!
0062   //! <Side1> (resp <Side2>) = 1 if the
0063   //! bisector curve is on the left of <Cu1> (resp <Cu2>)
0064   //! else <Side1> (resp <Side2>) = -1.
0065   //!
0066   //! the Bisector is trimmed by the Point <Origin>.
0067   //!
0068   //! <DistMax> is used to trim the bisector.The distance
0069   //! between the points of the bisector and <Cu> is smaller
0070   //! than <DistMax>.
0071   Standard_EXPORT void Perform(const occ::handle<Geom2d_Curve>& Cu1,
0072                                const occ::handle<Geom2d_Curve>& Cu2,
0073                                const double                     Side1,
0074                                const double                     Side2,
0075                                const gp_Pnt2d&                  Origin,
0076                                const double                     DistMax = 500);
0077 
0078   Standard_EXPORT bool IsExtendAtStart() const override;
0079 
0080   Standard_EXPORT bool IsExtendAtEnd() const override;
0081 
0082   Standard_EXPORT void Reverse() override;
0083 
0084   Standard_EXPORT double ReversedParameter(const double U) const override;
0085 
0086   //! Returns the order of continuity of the curve.
0087   //! Raised if N < 0.
0088   Standard_EXPORT bool IsCN(const int N) const override;
0089 
0090   //! The parameter on <me> is linked to the parameter
0091   //! on the first curve. This method creates the same bisector
0092   //! where the curves are inversed.
0093   Standard_EXPORT occ::handle<Bisector_BisecCC> ChangeGuide() const;
0094 
0095   Standard_EXPORT occ::handle<Geom2d_Geometry> Copy() const override;
0096 
0097   //! Transformation of a geometric object. This transformation
0098   //! can be a translation, a rotation, a symmetry, a scaling
0099   //! or a complex transformation obtained by combination of
0100   //! the previous elementaries transformations.
0101   Standard_EXPORT void Transform(const gp_Trsf2d& T) override;
0102 
0103   Standard_EXPORT double FirstParameter() const override;
0104 
0105   Standard_EXPORT double LastParameter() const override;
0106 
0107   Standard_EXPORT GeomAbs_Shape Continuity() const override;
0108 
0109   //! If necessary, breaks the curve in intervals of
0110   //! continuity <C1>. And returns the number of
0111   //! intervals.
0112   Standard_EXPORT int NbIntervals() const override;
0113 
0114   //! Returns the first parameter of the current
0115   //! interval.
0116   Standard_EXPORT double IntervalFirst(const int Index) const override;
0117 
0118   //! Returns the last parameter of the current
0119   //! interval.
0120   Standard_EXPORT double IntervalLast(const int Index) const override;
0121 
0122   Standard_EXPORT GeomAbs_Shape IntervalContinuity() const;
0123 
0124   Standard_EXPORT bool IsClosed() const override;
0125 
0126   Standard_EXPORT bool IsPeriodic() const override;
0127 
0128   //! Returns the point of parameter U.
0129   //! Computes the distance between the current point and
0130   //! the two curves I separate.
0131   //! Computes the parameters on each curve corresponding
0132   //! of the projection of the current point.
0133   Standard_EXPORT gp_Pnt2d ValueAndDist(const double U,
0134                                         double&      U1,
0135                                         double&      U2,
0136                                         double&      Distance) const;
0137 
0138   //! Returns the point of parameter U.
0139   //! Computes the distance between the current point and
0140   //! the two curves I separate.
0141   //! Computes the parameters on each curve corresponding
0142   //! of the projection of the current point.
0143   Standard_EXPORT gp_Pnt2d ValueByInt(const double U,
0144                                       double&      U1,
0145                                       double&      U2,
0146                                       double&      Distance) const;
0147 
0148   Standard_EXPORT gp_Pnt2d EvalD0(const double U) const override;
0149 
0150   Standard_EXPORT Geom2d_Curve::ResD1 EvalD1(const double U) const override;
0151 
0152   Standard_EXPORT Geom2d_Curve::ResD2 EvalD2(const double U) const override;
0153 
0154   Standard_EXPORT Geom2d_Curve::ResD3 EvalD3(const double U) const override;
0155 
0156   Standard_EXPORT gp_Vec2d EvalDN(const double U, const int N) const override;
0157 
0158   Standard_EXPORT bool IsEmpty() const;
0159 
0160   //! Returns the parameter on the curve1 of the projection
0161   //! of the point of parameter U on <me>.
0162   Standard_EXPORT double LinkBisCurve(const double U) const;
0163 
0164   //! Returns the reciproque of LinkBisCurve.
0165   Standard_EXPORT double LinkCurveBis(const double U) const;
0166 
0167   Standard_EXPORT double Parameter(const gp_Pnt2d& P) const override;
0168 
0169   Standard_EXPORT occ::handle<Geom2d_Curve> Curve(const int IndCurve) const;
0170 
0171   Standard_EXPORT const Bisector_PolyBis& Polygon() const;
0172 
0173   Standard_EXPORT void Dump(const int Deep = 0, const int Offset = 0) const;
0174 
0175   DEFINE_STANDARD_RTTIEXT(Bisector_BisecCC, Bisector_Curve)
0176 
0177 private:
0178   Standard_EXPORT void Values(const double U,
0179                               const int    N,
0180                               gp_Pnt2d&    P,
0181                               gp_Vec2d&    V1,
0182                               gp_Vec2d&    V2,
0183                               gp_Vec2d&    V3) const;
0184 
0185   Standard_EXPORT void SupLastParameter();
0186 
0187   Standard_EXPORT gp_Pnt2d
0188     Extension(const double U, double& U1, double& U2, double& Dist, gp_Vec2d& T1) const;
0189 
0190   Standard_EXPORT double SearchBound(const double U1, const double U2) const;
0191 
0192   Standard_EXPORT void ComputePointEnd();
0193 
0194   Standard_EXPORT void Curve(const int Index, const occ::handle<Geom2d_Curve>& C);
0195 
0196   Standard_EXPORT void Sign(const int Index, const double Sign);
0197 
0198   Standard_EXPORT void Polygon(const Bisector_PolyBis& Poly);
0199 
0200   Standard_EXPORT void DistMax(const double DistMax);
0201 
0202   Standard_EXPORT void IsConvex(const int Index, const bool IsConvex);
0203 
0204   Standard_EXPORT void IsEmpty(const bool IsEmpty);
0205 
0206   Standard_EXPORT void ExtensionStart(const bool ExtensionStart);
0207 
0208   Standard_EXPORT void ExtensionEnd(const bool ExtensionEnd);
0209 
0210   Standard_EXPORT void PointStart(const gp_Pnt2d& Point);
0211 
0212   Standard_EXPORT void PointEnd(const gp_Pnt2d& Point);
0213 
0214   Standard_EXPORT void StartIntervals(const NCollection_Sequence<double>& StartIntervals);
0215 
0216   Standard_EXPORT void EndIntervals(const NCollection_Sequence<double>& EndIntervals);
0217 
0218   Standard_EXPORT void FirstParameter(const double U1);
0219 
0220   Standard_EXPORT void LastParameter(const double U1);
0221 
0222   occ::handle<Geom2d_Curve>    curve1;
0223   occ::handle<Geom2d_Curve>    curve2;
0224   double                       sign1;
0225   double                       sign2;
0226   NCollection_Sequence<double> startIntervals;
0227   NCollection_Sequence<double> endIntervals;
0228   int                          currentInterval;
0229   Bisector_PolyBis             myPolygon;
0230   double                       shiftParameter;
0231   double                       distMax;
0232   bool                         isEmpty;
0233   bool                         isConvex1;
0234   bool                         isConvex2;
0235   bool                         extensionStart;
0236   bool                         extensionEnd;
0237   gp_Pnt2d                     pointStart;
0238   gp_Pnt2d                     pointEnd;
0239 };
0240 
0241 #endif // _Bisector_BisecCC_HeaderFile