// 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 _Select3D_SensitiveEntity_HeaderFile
#define _Select3D_SensitiveEntity_HeaderFile

#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Handle_Select3D_SensitiveEntity_HeaderFile
#include <Handle_Select3D_SensitiveEntity.hxx>
#endif

#ifndef _Standard_Address_HeaderFile
#include <Standard_Address.hxx>
#endif
#ifndef _Standard_ShortReal_HeaderFile
#include <Standard_ShortReal.hxx>
#endif
#ifndef _SelectBasics_SensitiveEntity_HeaderFile
#include <SelectBasics_SensitiveEntity.hxx>
#endif
#ifndef _Handle_SelectBasics_EntityOwner_HeaderFile
#include <Handle_SelectBasics_EntityOwner.hxx>
#endif
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
#ifndef _Standard_Real_HeaderFile
#include <Standard_Real.hxx>
#endif
#ifndef _Standard_OStream_HeaderFile
#include <Standard_OStream.hxx>
#endif
class SelectBasics_EntityOwner;
class Select3D_Projector;
class TopLoc_Location;
class TColgp_Array1OfPnt2d;
class Bnd_Box2d;
class gp_Lin;


//!  Abstract framework to define 3D sensitive entities. <br>
//! As the selection process uses the principle of a <br>
//! projection of 3D shapes onto a 2D view where <br>
//! nearness to a rectangle determines whether a shape <br>
//! is picked or not, all 3D shapes need to be converted <br>
//! into 2D ones in order to be selected. <br>
class Select3D_SensitiveEntity : public SelectBasics_SensitiveEntity {

public:
 // Methods PUBLIC
 // 
//! Returns true if this framework needs conversion. <br>
  Standard_Boolean NeedsConversion() const;

//! Returns true if this framework provides 3D information. <br>
Standard_EXPORT   Standard_Boolean Is3D() const;

//!Returns the projector aProjector. <br>
//!	 In classes inheriting this framework, you must <br>
//! redefine this function in order to get a sensitive 2D <br>
//! rectangle from a 3D entity. This rectangle is the <br>
//! sensitive zone which makes the 3D entity selectable. <br>
Standard_EXPORT virtual  void Project(const Select3D_Projector& aProjector) ;

//! Returns the max number of sensitive areas returned <br>
//!          by this class is 1 by default. <br>
//!          Else on must redefine this method. <br>
Standard_EXPORT virtual  Standard_Integer MaxBoxes() const;

//! Returns the sensitive entity found at the location  aLocation. <br>
//! You must redefine this function for any type of <br>
//! sensitive entity which can accept another connected <br>
//! sensitive entity.//can be connected to another sensitive entity. <br>
Standard_EXPORT virtual  Handle_Select3D_SensitiveEntity GetConnected(const TopLoc_Location& aLocation) ;

//! Matches the coordinates X, Y with the entity found at <br>
//! that point within the tolerance aTol and the minimum depth DMin. <br>
//! You must redefine this function for every inheriting entity. <br>
//! You will have to call this framework inside the redefined function. <br>
Standard_EXPORT virtual  Standard_Boolean Matches(const Standard_Real X,const Standard_Real Y,const Standard_Real aTol,Standard_Real& DMin) ;

//! Matches the box defined by the coordinates Xmin, <br>
//! Ymin, Xmax, Ymax with the entity found at that point <br>
//! within the tolerance aTol. <br>
//! Xmin, YMin define the minimum point in the lower left <br>
//! hand corner of the box, and   XMax, YMax define the <br>
//! maximum point in the upper right hand corner of the box. <br>
//! You must redefine this function for every inheriting entity. <br>
//! You will have to call this framework inside the redefined function. <br>
Standard_EXPORT virtual  Standard_Boolean Matches(const Standard_Real XMin,const Standard_Real YMin,const Standard_Real XMax,const Standard_Real YMax,const Standard_Real aTol) ;

//! prevents from hiding virtual methods... <br>
Standard_EXPORT virtual  Standard_Boolean Matches(const TColgp_Array1OfPnt2d& Polyline,const Bnd_Box2d& aBox,const Standard_Real aTol) ;

//! Returns the eye line for the point defined by the coordinates X,Y. <br>
Standard_EXPORT   gp_Lin GetEyeLine(const Standard_Real X,const Standard_Real Y) const;

//! Returns the depth of this object on the line EyeLine. <br>
//! EyeLine goes through the eye towards a point <br>
//! defined by the coordinates X,Y in the function GetEyeLine. <br>//! gives an abcissa on <aLin> . <br>
//!          <aLin> represents the line going through <br>
//!          the eye towards an X,Y point on the screen. This Method <br>
//!          must return a mean Depth on this line. <br>
Standard_EXPORT virtual  Standard_Real ComputeDepth(const gp_Lin& EyeLine) const = 0;


Standard_EXPORT virtual  Standard_Real Depth() const;

//! Returns true if this framework has a location defined. <br>
Standard_EXPORT virtual  Standard_Boolean HasLocation() const;


Standard_EXPORT virtual const TopLoc_Location& Location() const;

//! sets the location to Identity <br>
Standard_EXPORT virtual  void ResetLocation() ;


Standard_EXPORT virtual  void SetLocation(const TopLoc_Location& aLoc) ;

//! 2 options : <br>
//!          <FullDump> = False -> general information <br>
//!	        <FullDump> = True  -> whole informtion 3D +2d ... <br>
Standard_EXPORT virtual  void Dump(Standard_OStream& S,const Standard_Boolean FullDump = Standard_True) const;


Standard_EXPORT static  void DumpBox(Standard_OStream& S,const Bnd_Box2d& abox) ;


Standard_EXPORT   void UpdateLocation(const TopLoc_Location& aLoc) ;


Standard_EXPORT virtual  void SetLastPrj(const Select3D_Projector& aPrj) ;
//Standard_EXPORT ~Select3D_SensitiveEntity();




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

protected:

 // Methods PROTECTED
 // 


Standard_EXPORT Select3D_SensitiveEntity(const Handle(SelectBasics_EntityOwner)& OwnerId);


Standard_EXPORT   void SetLastDepth(const Standard_Real aDepth) ;


 // Fields PROTECTED
 //
Standard_Address mylastprj;


private: 

 // Methods PRIVATE
 // 


 // Fields PRIVATE
 //
Standard_ShortReal mylastdepth;


};


#include <Select3D_SensitiveEntity.lxx>



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


#endif
