Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-10-06 09:20:23

0001 // Created on: 1994-02-03
0002 // Created by: Jean Marc LACHAUME
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 _Geom2dHatch_Classifier_HeaderFile
0018 #define _Geom2dHatch_Classifier_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 
0023 #include <Geom2dHatch_FClass2dOfClassifier.hxx>
0024 #include <Geom2dAdaptor_Curve.hxx>
0025 #include <IntRes2d_Position.hxx>
0026 #include <TopAbs_State.hxx>
0027 class Standard_DomainError;
0028 class Geom2dHatch_Elements;
0029 class Geom2dAdaptor_Curve;
0030 class Geom2dHatch_Intersector;
0031 class Geom2dHatch_FClass2dOfClassifier;
0032 class gp_Pnt2d;
0033 
0034 class Geom2dHatch_Classifier
0035 {
0036 public:
0037   DEFINE_STANDARD_ALLOC
0038 
0039   //! Empty constructor, undefined algorithm.
0040   Standard_EXPORT Geom2dHatch_Classifier();
0041 
0042   //! Creates an algorithm to classify the Point P with
0043   //! Tolerance <T> on the face described by <F>.
0044   Standard_EXPORT Geom2dHatch_Classifier(Geom2dHatch_Elements& F,
0045                                          const gp_Pnt2d&       P,
0046                                          const double          Tol);
0047 
0048   //! Classify the Point P with Tolerance <T> on the
0049   //! face described by <F>.
0050   Standard_EXPORT void Perform(Geom2dHatch_Elements& F, const gp_Pnt2d& P, const double Tol);
0051 
0052   //! Returns the result of the classification.
0053   Standard_EXPORT TopAbs_State State() const;
0054 
0055   //! Returns True when the state was computed by a
0056   //! rejection. The state is OUT.
0057   bool Rejected() const { return rejected; }
0058 
0059   //! Returns True if the face contains no wire.
0060   //! The state is IN.
0061   bool NoWires() const { return nowires; }
0062 
0063   //! Returns the Edge used to determine the
0064   //! classification. When the State is ON this is the
0065   //! Edge containing the point.
0066   Standard_EXPORT const Geom2dAdaptor_Curve& Edge() const;
0067 
0068   //! Returns the parameter on Edge() used to determine the
0069   //! classification.
0070   Standard_EXPORT double EdgeParameter() const;
0071 
0072   //! Returns the position of the point on the edge
0073   //! returned by Edge.
0074   IntRes2d_Position Position() const { return myPosition; }
0075 
0076 protected:
0077   Geom2dHatch_FClass2dOfClassifier myClassifier;
0078   Geom2dAdaptor_Curve              myEdge;
0079   double                           myEdgeParameter;
0080   IntRes2d_Position                myPosition;
0081   bool                             rejected;
0082   bool                             nowires;
0083 };
0084 
0085 #endif // _Geom2dHatch_Classifier_HeaderFile