// File generated by CPPExt (Value)
//
//                     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 _TopOpeBRep_FaceEdgeIntersector_HeaderFile
#define _TopOpeBRep_FaceEdgeIntersector_HeaderFile

#ifndef _TopoDS_Face_HeaderFile
#include <TopoDS_Face.hxx>
#endif
#ifndef _TopoDS_Edge_HeaderFile
#include <TopoDS_Edge.hxx>
#endif
#ifndef _Standard_Real_HeaderFile
#include <Standard_Real.hxx>
#endif
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
#ifndef _GeomAdaptor_Curve_HeaderFile
#include <GeomAdaptor_Curve.hxx>
#endif
#ifndef _IntCurveSurface_SequenceOfPnt_HeaderFile
#include <IntCurveSurface_SequenceOfPnt.hxx>
#endif
#ifndef _TColStd_SequenceOfInteger_HeaderFile
#include <TColStd_SequenceOfInteger.hxx>
#endif
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
#ifndef _TopExp_Explorer_HeaderFile
#include <TopExp_Explorer.hxx>
#endif
#ifndef _TopoDS_Shape_HeaderFile
#include <TopoDS_Shape.hxx>
#endif
#ifndef _TopoDS_Vertex_HeaderFile
#include <TopoDS_Vertex.hxx>
#endif
#ifndef _TopAbs_State_HeaderFile
#include <TopAbs_State.hxx>
#endif
#ifndef _TopAbs_Orientation_HeaderFile
#include <TopAbs_Orientation.hxx>
#endif
#ifndef _TopAbs_ShapeEnum_HeaderFile
#include <TopAbs_ShapeEnum.hxx>
#endif
class TopoDS_Shape;
class gp_Pnt;
class gp_Pnt2d;
class TopOpeBRepDS_Transition;
class TopoDS_Vertex;


#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif


class TopOpeBRep_FaceEdgeIntersector  {

public:

    void* operator new(size_t,void* anAddress) 
      {
        return anAddress;
      }
    void* operator new(size_t size) 
      { 
        return Standard::Allocate(size); 
      }
    void  operator delete(void *anAddress) 
      { 
        if (anAddress) Standard::Free((Standard_Address&)anAddress); 
      }
 // Methods PUBLIC
 // 


Standard_EXPORT TopOpeBRep_FaceEdgeIntersector();


Standard_EXPORT   void Perform(const TopoDS_Shape& F,const TopoDS_Shape& E) ;


Standard_EXPORT   Standard_Boolean IsEmpty() ;

//! returns intersected face or edge according to <br>
//!          value of <Index> = 1 or 2 <br>
Standard_EXPORT  const TopoDS_Shape& Shape(const Standard_Integer Index) const;


//! Force the tolerance values used by the next Perform(S1,S2) call. <br>
Standard_EXPORT   void ForceTolerance(const Standard_Real tol) ;


//! Return the tolerance value used in the last Perform() call <br>
//! If ForceTolerance() has been called, return the given value. <br>
//! If not, return value extracted from shapes. <br>
Standard_EXPORT   Standard_Real Tolerance() const;


Standard_EXPORT   Standard_Integer NbPoints() const;


Standard_EXPORT   void InitPoint() ;


Standard_EXPORT   Standard_Boolean MorePoint() const;


Standard_EXPORT   void NextPoint() ;

//! return the 3D point of the current intersection point. <br>
Standard_EXPORT   gp_Pnt Value() const;

//! parametre de Value() sur l'arete <br>
Standard_EXPORT   Standard_Real Parameter() const;

//! parametre de Value() sur la face <br>
Standard_EXPORT   void UVPoint(gp_Pnt2d& P) const;

//! IN ou ON / a la face. Les points OUT ne sont pas retournes. <br>
Standard_EXPORT   TopAbs_State State() const;


//! Index = 1 transition par rapport a la face, en cheminant sur l'arete <br>
Standard_EXPORT   TopOpeBRepDS_Transition Transition(const Standard_Integer Index,const TopAbs_Orientation FaceOrientation) const;


Standard_EXPORT   Standard_Boolean IsVertex(const TopoDS_Shape& S,const gp_Pnt& P,const Standard_Real Tol,TopoDS_Vertex& V) ;


Standard_EXPORT   Standard_Boolean IsVertex(const Standard_Integer I,TopoDS_Vertex& V) ;

//! trace only <br>
Standard_EXPORT   Standard_Integer Index() const;





protected:

 // Methods PROTECTED
 // 


 // Fields PROTECTED
 //


private: 

 // Methods PRIVATE
 // 


Standard_EXPORT   void ResetIntersection() ;

//! extract tolerance values from shapes <S1>,<S2>, <br>
//!          in order to perform intersection between <S1> and <S2> <br>
//!          with tolerance values "fitting" the shape tolerances. <br>
//! (called by Perform() by default, when ForceTolerances() has not <br>
//!  been called) <br>
Standard_EXPORT   void ShapeTolerances(const TopoDS_Shape& S1,const TopoDS_Shape& S2) ;

//! returns the max tolerance of sub-shapes of type <T> <br>
//!           found in shape <S>. If no such sub-shape found, return <br>
//!           Precision::Intersection() <br>
//! (called by ShapeTolerances()) <br>
Standard_EXPORT   Standard_Real ToleranceMax(const TopoDS_Shape& S,const TopAbs_ShapeEnum T) const;


 // Fields PRIVATE
 //
TopoDS_Face myFace;
TopoDS_Edge myEdge;
Standard_Real myTol;
Standard_Boolean myForceTolerance;
GeomAdaptor_Curve myCurve;
Standard_Boolean myIntersectionDone;
IntCurveSurface_SequenceOfPnt mySequenceOfPnt;
TColStd_SequenceOfInteger mySequenceOfState;
Standard_Integer myPointIndex;
Standard_Integer myNbPoints;
TopExp_Explorer myVertexExplorer;
TopoDS_Shape myNullShape;
TopoDS_Vertex myNullVertex;


};





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


#endif
