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_BisecPC_HeaderFile
0018 #define _Bisector_BisecPC_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 
0022 #include <gp_Pnt2d.hxx>
0023 #include <TColStd_SequenceOfReal.hxx>
0024 #include <Standard_Integer.hxx>
0025 #include <Bisector_Curve.hxx>
0026 #include <GeomAbs_Shape.hxx>
0027 class Geom2d_Curve;
0028 class Geom2d_Geometry;
0029 class gp_Trsf2d;
0030 class gp_Vec2d;
0031 
0032 
0033 class Bisector_BisecPC;
0034 DEFINE_STANDARD_HANDLE(Bisector_BisecPC, Bisector_Curve)
0035 
0036 //! Provides the bisector between a point and a curve.
0037 //! the curvature on the curve has to be monoton.
0038 //! the point can't be on the curve exept at the extremities.
0039 class Bisector_BisecPC : public Bisector_Curve
0040 {
0041 
0042 public:
0043 
0044   
0045   Standard_EXPORT Bisector_BisecPC();
0046   
0047   //! Constructs the bisector between the point <P> and
0048   //! the curve <Cu>.
0049   //! <Side> = 1. if the bisector curve is on the Left of <Cu>
0050   //! else <Side> = -1.
0051   //! <DistMax> is used to trim the bisector.The distance
0052   //! between the points of the bisector and <Cu> is smaller
0053   //! than <DistMax>.
0054   Standard_EXPORT Bisector_BisecPC(const Handle(Geom2d_Curve)& Cu, const gp_Pnt2d& P, const Standard_Real Side, const Standard_Real DistMax = 500);
0055   
0056   //! Constructs the bisector between the point <P> and
0057   //! the curve <Cu> Trimmed by <UMin> and <UMax>
0058   //! <Side> = 1. if the bisector curve is on the Left of <Cu>
0059   //! else <Side> = -1.
0060   //! Warning: the bisector is supposed all over defined between
0061   //! <UMin> and <UMax>.
0062   Standard_EXPORT Bisector_BisecPC(const Handle(Geom2d_Curve)& Cu, const gp_Pnt2d& P, const Standard_Real Side, const Standard_Real UMin, const Standard_Real UMax);
0063   
0064   //! Construct the bisector between the point <P> and
0065   //! the curve <Cu>.
0066   //! <Side> = 1. if the bisector curve is on the Left of <Cu>
0067   //! else <Side> = -1.
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 Handle(Geom2d_Curve)& Cu, const gp_Pnt2d& P, const Standard_Real Side, const Standard_Real DistMax = 500);
0072   
0073   //! Returns True if the bisector is extended at start.
0074   Standard_EXPORT Standard_Boolean IsExtendAtStart() const Standard_OVERRIDE;
0075   
0076   //! Returns True if the bisector is extended at end.
0077   Standard_EXPORT Standard_Boolean IsExtendAtEnd() const Standard_OVERRIDE;
0078   
0079 
0080   //! Changes the direction of parametrization of <me>.
0081   //! The orientation  of the curve is modified. If the curve
0082   //! is bounded the StartPoint of the initial curve becomes the
0083   //! EndPoint of the reversed curve  and the EndPoint of the initial
0084   //! curve becomes the StartPoint of the reversed curve.
0085   Standard_EXPORT void Reverse() Standard_OVERRIDE;
0086   
0087   //! Returns the  parameter on the  reversed  curve for
0088   //! the point of parameter U on <me>.
0089   Standard_EXPORT Standard_Real ReversedParameter (const Standard_Real U) const Standard_OVERRIDE;
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   //! Returns the order of continuity of the curve.
0101   //! Raised if N < 0.
0102   Standard_EXPORT Standard_Boolean IsCN (const Standard_Integer N) const Standard_OVERRIDE;
0103   
0104   //! Value of the first parameter.
0105   Standard_EXPORT Standard_Real FirstParameter() const Standard_OVERRIDE;
0106   
0107   //! Value of the last parameter.
0108   Standard_EXPORT Standard_Real LastParameter() const Standard_OVERRIDE;
0109   
0110   Standard_EXPORT GeomAbs_Shape Continuity() const Standard_OVERRIDE;
0111   
0112   //! If necessary,  breaks the  curve in  intervals  of
0113   //! continuity  <C1>.    And  returns   the number   of
0114   //! intervals.
0115   Standard_EXPORT Standard_Integer NbIntervals() const Standard_OVERRIDE;
0116   
0117   //! Returns  the  first  parameter    of  the  current
0118   //! interval.
0119   Standard_EXPORT Standard_Real IntervalFirst (const Standard_Integer Index) const Standard_OVERRIDE;
0120   
0121   //! Returns  the  last  parameter    of  the  current
0122   //! interval.
0123   Standard_EXPORT Standard_Real IntervalLast (const Standard_Integer Index) const Standard_OVERRIDE;
0124   
0125   Standard_EXPORT GeomAbs_Shape IntervalContinuity() const;
0126   
0127   Standard_EXPORT Standard_Boolean IsClosed() const Standard_OVERRIDE;
0128   
0129   Standard_EXPORT Standard_Boolean IsPeriodic() const Standard_OVERRIDE;
0130   
0131   //! Returns   the   distance   between  the  point  of
0132   //! parameter U on <me> and my point or my curve.
0133   Standard_EXPORT Standard_Real Distance (const Standard_Real U) const;
0134   
0135   Standard_EXPORT void D0 (const Standard_Real U, gp_Pnt2d& P) const Standard_OVERRIDE;
0136   
0137   Standard_EXPORT void D1 (const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& V) const Standard_OVERRIDE;
0138   
0139   Standard_EXPORT void D2 (const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2) const Standard_OVERRIDE;
0140   
0141   Standard_EXPORT void D3 (const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2, gp_Vec2d& V3) const Standard_OVERRIDE;
0142   
0143   Standard_EXPORT gp_Vec2d DN (const Standard_Real U, const Standard_Integer N) const Standard_OVERRIDE;
0144   
0145   Standard_EXPORT void Dump (const Standard_Integer Deep = 0, const Standard_Integer Offset = 0) const;
0146   
0147   //! Returns the parameter on the curve1 of the projection
0148   //! of the point of parameter U on <me>.
0149   Standard_EXPORT Standard_Real LinkBisCurve (const Standard_Real U) const;
0150   
0151   //! Returns the reciproque of LinkBisCurve.
0152   Standard_EXPORT Standard_Real LinkCurveBis (const Standard_Real U) const;
0153   
0154   //! Returns the parameter on <me> corresponding to <P>.
0155   Standard_EXPORT Standard_Real Parameter (const gp_Pnt2d& P) const Standard_OVERRIDE;
0156   
0157   //! Returns <True> if the bisector is empty.
0158   Standard_EXPORT Standard_Boolean IsEmpty() const;
0159 
0160 
0161 
0162 
0163   DEFINE_STANDARD_RTTIEXT(Bisector_BisecPC,Bisector_Curve)
0164 
0165 protected:
0166 
0167 
0168 
0169 
0170 private:
0171 
0172   
0173   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;
0174   
0175   Standard_EXPORT void Extension (const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2, gp_Vec2d& V3) const;
0176   
0177   //! Computes the interval where the bisector is defined.
0178   Standard_EXPORT void ComputeIntervals();
0179   
0180   Standard_EXPORT void CuspFilter();
0181   
0182   Standard_EXPORT Standard_Real SearchBound (const Standard_Real U1, const Standard_Real U2) const;
0183   
0184   Standard_EXPORT void Init (const Handle(Geom2d_Curve)& Curve, const gp_Pnt2d& Point, const Standard_Real Sign, const TColStd_SequenceOfReal& StartIntervals, const TColStd_SequenceOfReal& EndIntervals, const Standard_Integer BisInterval, const Standard_Integer CurrentInterval, const Standard_Real ShiftParameter, const Standard_Real DistMax, const Standard_Boolean IsEmpty, const Standard_Boolean IsConvex, const Standard_Boolean ExtensionStart, const Standard_Boolean ExtensionEnd, const gp_Pnt2d& PointStartBis, const gp_Pnt2d& PointEndBis);
0185 
0186   Handle(Geom2d_Curve) curve;
0187   gp_Pnt2d point;
0188   Standard_Real sign;
0189   TColStd_SequenceOfReal startIntervals;
0190   TColStd_SequenceOfReal endIntervals;
0191   Standard_Integer bisInterval;
0192   Standard_Integer currentInterval;
0193   Standard_Real shiftParameter;
0194   Standard_Real distMax;
0195   Standard_Boolean isEmpty;
0196   Standard_Boolean isConvex;
0197   Standard_Boolean extensionStart;
0198   Standard_Boolean extensionEnd;
0199   gp_Pnt2d pointStartBis;
0200   gp_Pnt2d pointEndBis;
0201 
0202 
0203 };
0204 
0205 
0206 
0207 
0208 
0209 
0210 
0211 #endif // _Bisector_BisecPC_HeaderFile