// File generated by CPPExt (Transient)
//
//
//                     Copyright (C) 1991 - 2000 by  
//                      Matra Datavision SA.  All rights reserved.
//  
//                     Copyright (C) 2001 - 2004 by
//                     Open CASCADE SA.  All rights reserved.
// 
// This file is part of the Open CASCADE Technology software.
//
// This software may be distributed and/or modified under the terms and
// conditions of the Open CASCADE Public License as defined by Open CASCADE SA
// and appearing in the file LICENSE included in the packaging of this file.
//  
// This software is distributed on an "AS IS" basis, without warranty of any
// kind, and Open CASCADE SA hereby disclaims all such warranties,
// including without limitation, any warranties of merchantability, fitness
// for a particular purpose or non-infringement. Please see the License for
// the specific terms and conditions governing rights and limitations under the
// License.

#ifndef _Bisector_BisecPC_HeaderFile
#define _Bisector_BisecPC_HeaderFile

#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Handle_Bisector_BisecPC_HeaderFile
#include <Handle_Bisector_BisecPC.hxx>
#endif

#ifndef _Handle_Geom2d_Curve_HeaderFile
#include <Handle_Geom2d_Curve.hxx>
#endif
#ifndef _gp_Pnt2d_HeaderFile
#include <gp_Pnt2d.hxx>
#endif
#ifndef _Standard_Real_HeaderFile
#include <Standard_Real.hxx>
#endif
#ifndef _TColStd_SequenceOfReal_HeaderFile
#include <TColStd_SequenceOfReal.hxx>
#endif
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
#ifndef _Bisector_Curve_HeaderFile
#include <Bisector_Curve.hxx>
#endif
#ifndef _Handle_Geom2d_Geometry_HeaderFile
#include <Handle_Geom2d_Geometry.hxx>
#endif
#ifndef _GeomAbs_Shape_HeaderFile
#include <GeomAbs_Shape.hxx>
#endif
class Geom2d_Curve;
class Standard_DomainError;
class Standard_RangeError;
class gp_Pnt2d;
class Geom2d_Geometry;
class gp_Trsf2d;
class gp_Vec2d;
class TColStd_SequenceOfReal;


//! Provides the bisector between a point and a curve. <br>
//!          the curvature on the curve has to be monoton. <br>
//!          the point can't be on the curve exept at the extremitys. <br>
//! <br>
class Bisector_BisecPC : public Bisector_Curve {

public:
 // Methods PUBLIC
 // 


Standard_EXPORT Bisector_BisecPC();

//! Constructs the bisector between the point <P> and <br>
//!          the curve <Cu>. <br>
//!          <Side> = 1. if the bisector curve is on the Left of <Cu> <br>
//!          else <Side> = -1. <br>
//!          <DistMax> is used to trim the bisector.The distance <br>
//!          between the points of the bisector and <Cu> is smaller <br>
//!          than <DistMax>. <br>
//! <br>
Standard_EXPORT Bisector_BisecPC(const Handle(Geom2d_Curve)& Cu,const gp_Pnt2d& P,const Standard_Real Side,const Standard_Real DistMax = 500);

//! Constructs the bisector between the point <P> and <br>
//!          the curve <Cu> Trimmed by <UMin> and <UMax> <br>
//!          <Side> = 1. if the bisector curve is on the Left of <Cu> <br>
//!          else <Side> = -1. <br>
//!  Warning: the bisector is supposed all over defined between <br>
//!          <UMin> and <UMax>. <br>
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);

//! Construct the bisector between the point <P> and <br>
//!          the curve <Cu>. <br>
//!          <Side> = 1. if the bisector curve is on the Left of <Cu> <br>
//!          else <Side> = -1. <br>
//!          <DistMax> is used to trim the bisector.The distance <br>
//!          between the points of the bisector and <Cu> is smaller <br>
//!          than <DistMax>. <br>
Standard_EXPORT   void Perform(const Handle(Geom2d_Curve)& Cu,const gp_Pnt2d& P,const Standard_Real Side,const Standard_Real DistMax = 500) ;

//! Returns True if the bisector is extended at start. <br>
Standard_EXPORT   Standard_Boolean IsExtendAtStart() const;

//! Returns True if the bisector is extended at end. <br>
Standard_EXPORT   Standard_Boolean IsExtendAtEnd() const;


//!  Changes the direction of parametrization of <me>. <br>
//!  The orientation  of the curve is modified. If the curve <br>
//!  is bounded the StartPoint of the initial curve becomes the <br>
//!  EndPoint of the reversed curve  and the EndPoint of the initial <br>
//!  curve becomes the StartPoint of the reversed curve. <br>
Standard_EXPORT   void Reverse() ;

//! Returns the  parameter on the  reversed  curve for <br>
//!          the point of parameter U on <me>. <br>
Standard_EXPORT   Standard_Real ReversedParameter(const Standard_Real U) const;


Standard_EXPORT   Handle_Geom2d_Geometry Copy() const;


//!  Transformation of a geometric object. This tansformation <br>
//!  can be a translation, a rotation, a symmetry, a scaling <br>
//!  or a complex transformation obtained by combination of <br>
//!  the previous elementaries transformations. <br>
Standard_EXPORT   void Transform(const gp_Trsf2d& T) ;

//! Returns the order of continuity of the curve. <br>//! Raised if N < 0. <br>
Standard_EXPORT   Standard_Boolean IsCN(const Standard_Integer N) const;

//! Value of the first parameter. <br>
Standard_EXPORT   Standard_Real FirstParameter() const;

//! Value of the last parameter. <br>
Standard_EXPORT   Standard_Real LastParameter() const;


Standard_EXPORT   GeomAbs_Shape Continuity() const;

//! If necessary,  breaks the  curve in  intervals  of <br>
//!          continuity  <C1>.    And  returns   the number   of <br>
//!          intervals. <br>
Standard_EXPORT   Standard_Integer NbIntervals() const;

//! Returns  the  first  parameter    of  the  current <br>
//!          interval. <br>
Standard_EXPORT   Standard_Real IntervalFirst(const Standard_Integer Index) const;

//! Returns  the  last  parameter    of  the  current <br>
//!          interval. <br>
Standard_EXPORT   Standard_Real IntervalLast(const Standard_Integer Index) const;


Standard_EXPORT   GeomAbs_Shape IntervalContinuity() const;


Standard_EXPORT   Standard_Boolean IsClosed() const;


Standard_EXPORT   Standard_Boolean IsPeriodic() const;

//! Returns   the   distance   between  the  point  of <br>
//!          parameter U on <me> and my point or my curve. <br>
Standard_EXPORT   Standard_Real Distance(const Standard_Real U) const;


Standard_EXPORT   void D0(const Standard_Real U,gp_Pnt2d& P) const;


Standard_EXPORT   void D1(const Standard_Real U,gp_Pnt2d& P,gp_Vec2d& V) const;


Standard_EXPORT   void D2(const Standard_Real U,gp_Pnt2d& P,gp_Vec2d& V1,gp_Vec2d& V2) const;


Standard_EXPORT   void D3(const Standard_Real U,gp_Pnt2d& P,gp_Vec2d& V1,gp_Vec2d& V2,gp_Vec2d& V3) const;


Standard_EXPORT   gp_Vec2d DN(const Standard_Real U,const Standard_Integer N) const;


Standard_EXPORT   void Dump(const Standard_Integer Deep = 0,const Standard_Integer Offset = 0) const;

//! Returns the parameter on the curve1 of the projection <br>
//!          of the point of parameter U on <me>. <br>
Standard_EXPORT   Standard_Real LinkBisCurve(const Standard_Real U) const;

//! Returns the reciproque of LinkBisCurve. <br>
Standard_EXPORT   Standard_Real LinkCurveBis(const Standard_Real U) const;

//! Returns the parameter on <me> corresponding to <P>. <br>
Standard_EXPORT   Standard_Real Parameter(const gp_Pnt2d& P) const;

//! Returns <True> if the bisector is empty. <br>
Standard_EXPORT   Standard_Boolean IsEmpty() const;
//Standard_EXPORT ~Bisector_BisecPC();




 // Type management
 //
 Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
 //Standard_EXPORT Standard_Boolean	       IsKind(const Handle(Standard_Type)&) const;

protected:

 // Methods PROTECTED
 // 


 // Fields PROTECTED
 //


private: 

 // Methods PRIVATE
 // 


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;


Standard_EXPORT   void Extension(const Standard_Real U,gp_Pnt2d& P,gp_Vec2d& V1,gp_Vec2d& V2,gp_Vec2d& V3) const;

//! Computes the interval where the bisector is defined. <br>
Standard_EXPORT   void ComputeIntervals() ;


Standard_EXPORT   void CuspFilter() ;


Standard_EXPORT   Standard_Real SearchBound(const Standard_Real U1,const Standard_Real U2) const;


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) ;


 // Fields PRIVATE
 //
Handle_Geom2d_Curve curve;
gp_Pnt2d point;
Standard_Real sign;
TColStd_SequenceOfReal startIntervals;
TColStd_SequenceOfReal endIntervals;
Standard_Integer bisInterval;
Standard_Integer currentInterval;
Standard_Real shiftParameter;
Standard_Real distMax;
Standard_Boolean isEmpty;
Standard_Boolean isConvex;
Standard_Boolean extensionStart;
Standard_Boolean extensionEnd;
gp_Pnt2d pointStartBis;
gp_Pnt2d pointEndBis;


};





// other Inline functions and methods (like "C++: function call" methods)
//


#endif
