Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-25 08:29:31

0001 // Created on: 1993-11-10
0002 // Created by: Jean Marc LACHAUME
0003 // Copyright (c) 1993-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_Hatching_HeaderFile
0018 #define _Geom2dHatch_Hatching_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <Geom2dAdaptor_Curve.hxx>
0025 #include <Standard_Boolean.hxx>
0026 #include <HatchGen_PointsOnHatching.hxx>
0027 #include <HatchGen_ErrorStatus.hxx>
0028 #include <HatchGen_Domains.hxx>
0029 
0030 class gp_Pnt2d;
0031 
0032 // resolve name collisions with X11 headers
0033 #ifdef Status
0034   #undef Status
0035 #endif
0036 
0037 class Geom2dHatch_Hatching
0038 {
0039 public:
0040   DEFINE_STANDARD_ALLOC
0041 
0042   Standard_EXPORT Geom2dHatch_Hatching();
0043 
0044   //! Creates a hatching.
0045   Standard_EXPORT Geom2dHatch_Hatching(const Geom2dAdaptor_Curve& Curve);
0046 
0047   //! Returns the curve associated to the hatching.
0048   Standard_EXPORT const Geom2dAdaptor_Curve& Curve() const;
0049 
0050   //! Returns the curve associated to the hatching.
0051   Standard_EXPORT Geom2dAdaptor_Curve& ChangeCurve();
0052 
0053   //! Sets the flag about the trimming computations to the
0054   //! given value.
0055   Standard_EXPORT void TrimDone(const Standard_Boolean Flag);
0056 
0057   //! Returns the flag about the trimming computations.
0058   Standard_EXPORT Standard_Boolean TrimDone() const;
0059 
0060   //! Sets the flag about the trimming failure to the
0061   //! given value.
0062   Standard_EXPORT void TrimFailed(const Standard_Boolean Flag);
0063 
0064   //! Returns the flag about the trimming failure.
0065   Standard_EXPORT Standard_Boolean TrimFailed() const;
0066 
0067   //! Sets the flag about the domains computation to the
0068   //! given value.
0069   Standard_EXPORT void IsDone(const Standard_Boolean Flag);
0070 
0071   //! Returns the flag about the domains computation.
0072   Standard_EXPORT Standard_Boolean IsDone() const;
0073 
0074   //! Sets the error status.
0075   Standard_EXPORT void Status(const HatchGen_ErrorStatus theStatus);
0076 
0077   //! Returns the error status.
0078   Standard_EXPORT HatchGen_ErrorStatus Status() const;
0079 
0080   //! Adds an intersection point to the hatching.
0081   Standard_EXPORT void AddPoint(const HatchGen_PointOnHatching& Point,
0082                                 const Standard_Real             Confusion);
0083 
0084   //! Returns the number of intersection points
0085   //! of the hatching.
0086   Standard_EXPORT Standard_Integer NbPoints() const;
0087 
0088   //! Returns the Index-th intersection point of the
0089   //! hatching.
0090   //! The exception OutOfRange is raised if
0091   //! Index < 1 or Index > NbPoints.
0092   Standard_EXPORT const HatchGen_PointOnHatching& Point(const Standard_Integer Index) const;
0093 
0094   //! Returns the Index-th intersection point of the
0095   //! hatching.
0096   //! The exception OutOfRange is raised if
0097   //! Index < 1 or Index > NbPoints.
0098   Standard_EXPORT HatchGen_PointOnHatching& ChangePoint(const Standard_Integer Index);
0099 
0100   //! Removes the Index-th intersection point of the
0101   //! hatching.
0102   //! The exception OutOfRange is raised if
0103   //! Index < 1 or Index > NbPoints.
0104   Standard_EXPORT void RemPoint(const Standard_Integer Index);
0105 
0106   //! Removes all the intersection points of the hatching.
0107   Standard_EXPORT void ClrPoints();
0108 
0109   //! Adds a domain to the hatching.
0110   Standard_EXPORT void AddDomain(const HatchGen_Domain& Domain);
0111 
0112   //! Returns the number of domains of the hatching.
0113   Standard_EXPORT Standard_Integer NbDomains() const;
0114 
0115   //! Returns the Index-th domain of the hatching.
0116   //! The exception OutOfRange is raised if
0117   //! Index < 1 or Index > NbDomains.
0118   Standard_EXPORT const HatchGen_Domain& Domain(const Standard_Integer Index) const;
0119 
0120   //! Removes the Index-th domain of the hatching.
0121   //! The exception OutOfRange is raised if
0122   //! Index < 1 or Index > NbDomains.
0123   Standard_EXPORT void RemDomain(const Standard_Integer Index);
0124 
0125   //! Removes all the domains of the hatching.
0126   Standard_EXPORT void ClrDomains();
0127 
0128   //! Returns a point on the curve.
0129   //! This point will be used for the classification.
0130   Standard_EXPORT gp_Pnt2d ClassificationPoint() const;
0131 
0132 protected:
0133 private:
0134   Geom2dAdaptor_Curve       myCurve;
0135   Standard_Boolean          myTrimDone;
0136   Standard_Boolean          myTrimFailed;
0137   HatchGen_PointsOnHatching myPoints;
0138   Standard_Boolean          myIsDone;
0139   HatchGen_ErrorStatus      myStatus;
0140   HatchGen_Domains          myDomains;
0141 };
0142 
0143 #endif // _Geom2dHatch_Hatching_HeaderFile