1 // Created on: 1993-11-10
2 // Created by: Jean Marc LACHAUME
3 // Copyright (c) 1993-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _Geom2dHatch_Hatching_HeaderFile
18 #define _Geom2dHatch_Hatching_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <Geom2dAdaptor_Curve.hxx>
25 #include <Standard_Boolean.hxx>
26 #include <HatchGen_PointsOnHatching.hxx>
27 #include <HatchGen_ErrorStatus.hxx>
28 #include <HatchGen_Domains.hxx>
29 #include <Standard_Real.hxx>
30 #include <Standard_Integer.hxx>
34 // resolve name collisions with X11 headers
39 class Geom2dHatch_Hatching
46 Standard_EXPORT Geom2dHatch_Hatching();
48 //! Creates a hatching.
49 Standard_EXPORT Geom2dHatch_Hatching(const Geom2dAdaptor_Curve& Curve);
51 //! Returns the curve associated to the hatching.
52 Standard_EXPORT const Geom2dAdaptor_Curve& Curve() const;
54 //! Returns the curve associated to the hatching.
55 Standard_EXPORT Geom2dAdaptor_Curve& ChangeCurve();
57 //! Sets the flag about the trimming computations to the
59 Standard_EXPORT void TrimDone (const Standard_Boolean Flag);
61 //! Returns the flag about the trimming computations.
62 Standard_EXPORT Standard_Boolean TrimDone() const;
64 //! Sets the flag about the trimming failure to the
66 Standard_EXPORT void TrimFailed (const Standard_Boolean Flag);
68 //! Returns the flag about the trimming failure.
69 Standard_EXPORT Standard_Boolean TrimFailed() const;
71 //! Sets the flag about the domains computation to the
73 Standard_EXPORT void IsDone (const Standard_Boolean Flag);
75 //! Returns the flag about the domains computation.
76 Standard_EXPORT Standard_Boolean IsDone() const;
78 //! Sets the error status.
79 Standard_EXPORT void Status (const HatchGen_ErrorStatus theStatus);
81 //! Returns the error status.
82 Standard_EXPORT HatchGen_ErrorStatus Status() const;
84 //! Adds an intersection point to the hatching.
85 Standard_EXPORT void AddPoint (const HatchGen_PointOnHatching& Point, const Standard_Real Confusion);
87 //! Returns the number of intersection points
89 Standard_EXPORT Standard_Integer NbPoints() const;
91 //! Returns the Index-th intersection point of the
93 //! The exception OutOfRange is raised if
94 //! Index < 1 or Index > NbPoints.
95 Standard_EXPORT const HatchGen_PointOnHatching& Point (const Standard_Integer Index) const;
97 //! Returns the Index-th intersection point of the
99 //! The exception OutOfRange is raised if
100 //! Index < 1 or Index > NbPoints.
101 Standard_EXPORT HatchGen_PointOnHatching& ChangePoint (const Standard_Integer Index);
103 //! Removes the Index-th intersection point of the
105 //! The exception OutOfRange is raised if
106 //! Index < 1 or Index > NbPoints.
107 Standard_EXPORT void RemPoint (const Standard_Integer Index);
109 //! Removes all the intersection points of the hatching.
110 Standard_EXPORT void ClrPoints();
112 //! Adds a domain to the hatching.
113 Standard_EXPORT void AddDomain (const HatchGen_Domain& Domain);
115 //! Returns the number of domains of the hatching.
116 Standard_EXPORT Standard_Integer NbDomains() const;
118 //! Returns the Index-th domain of the hatching.
119 //! The exception OutOfRange is raised if
120 //! Index < 1 or Index > NbDomains.
121 Standard_EXPORT const HatchGen_Domain& Domain (const Standard_Integer Index) const;
123 //! Removes the Index-th domain of the hatching.
124 //! The exception OutOfRange is raised if
125 //! Index < 1 or Index > NbDomains.
126 Standard_EXPORT void RemDomain (const Standard_Integer Index);
128 //! Removes all the domains of the hatching.
129 Standard_EXPORT void ClrDomains();
131 //! Returns a point on the curve.
132 //! This point will be used for the classification.
133 Standard_EXPORT gp_Pnt2d ClassificationPoint() const;
148 Geom2dAdaptor_Curve myCurve;
149 Standard_Boolean myTrimDone;
150 Standard_Boolean myTrimFailed;
151 HatchGen_PointsOnHatching myPoints;
152 Standard_Boolean myIsDone;
153 HatchGen_ErrorStatus myStatus;
154 HatchGen_Domains myDomains;
165 #endif // _Geom2dHatch_Hatching_HeaderFile