Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:01

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