f61346ac9519cbea1ba0619c0b11626af9f32c49
[occt.git] / src / Geom2dHatch / Geom2dHatch_Hatching.hxx
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
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
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.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #ifndef _Geom2dHatch_Hatching_HeaderFile
18 #define _Geom2dHatch_Hatching_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23
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>
31 class Standard_OutOfRange;
32 class Geom2dAdaptor_Curve;
33 class HatchGen_PointOnHatching;
34 class HatchGen_Domain;
35 class gp_Pnt2d;
36
37
38
39 class Geom2dHatch_Hatching 
40 {
41 public:
42
43   DEFINE_STANDARD_ALLOC
44
45   
46   Standard_EXPORT Geom2dHatch_Hatching();
47   
48   //! Creates a hatching.
49   Standard_EXPORT Geom2dHatch_Hatching(const Geom2dAdaptor_Curve& Curve);
50   
51   //! Returns the curve associated to the hatching.
52   Standard_EXPORT const Geom2dAdaptor_Curve& Curve() const;
53   
54   //! Returns the curve associated to the hatching.
55   Standard_EXPORT Geom2dAdaptor_Curve& ChangeCurve();
56   
57   //! Sets the flag about the trimming computations to the
58   //! given value.
59   Standard_EXPORT void TrimDone (const Standard_Boolean Flag);
60   
61   //! Returns the flag about the trimming computations.
62   Standard_EXPORT Standard_Boolean TrimDone() const;
63   
64   //! Sets the flag about the trimming failure to the
65   //! given value.
66   Standard_EXPORT void TrimFailed (const Standard_Boolean Flag);
67   
68   //! Returns the flag about the trimming failure.
69   Standard_EXPORT Standard_Boolean TrimFailed() const;
70   
71   //! Sets the flag about the domains computation to the
72   //! given value.
73   Standard_EXPORT void IsDone (const Standard_Boolean Flag);
74   
75   //! Returns the flag about the domains computation.
76   Standard_EXPORT Standard_Boolean IsDone() const;
77   
78   //! Sets the error status.
79   Standard_EXPORT void Status (const HatchGen_ErrorStatus Status);
80   
81   //! Returns the error status.
82   Standard_EXPORT HatchGen_ErrorStatus Status() const;
83   
84   //! Adds an intersection point to the hatching.
85   Standard_EXPORT void AddPoint (const HatchGen_PointOnHatching& Point, const Standard_Real Confusion);
86   
87   //! Returns the number of intersection points
88   //! of the hatching.
89   Standard_EXPORT Standard_Integer NbPoints() const;
90   
91   //! Returns the Index-th intersection point of the
92   //! hatching.
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;
96   
97   //! Returns the Index-th intersection point of the
98   //! hatching.
99   //! The exception OutOfRange is raised if
100   //! Index < 1 or Index > NbPoints.
101   Standard_EXPORT HatchGen_PointOnHatching& ChangePoint (const Standard_Integer Index);
102   
103   //! Removes the Index-th intersection point of the
104   //! hatching.
105   //! The exception OutOfRange is raised if
106   //! Index < 1 or Index > NbPoints.
107   Standard_EXPORT void RemPoint (const Standard_Integer Index);
108   
109   //! Removes all the intersection points of the hatching.
110   Standard_EXPORT void ClrPoints();
111   
112   //! Adds a domain to the hatching.
113   Standard_EXPORT void AddDomain (const HatchGen_Domain& Domain);
114   
115   //! Returns the number of domains of the hatching.
116   Standard_EXPORT Standard_Integer NbDomains() const;
117   
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;
122   
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);
127   
128   //! Removes all the domains of the hatching.
129   Standard_EXPORT void ClrDomains();
130   
131   //! Returns a point on the curve.
132   //! This point will be used for the classification.
133   Standard_EXPORT gp_Pnt2d ClassificationPoint() const;
134
135
136
137
138 protected:
139
140
141
142
143
144 private:
145
146
147
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;
155
156
157 };
158
159
160
161
162
163
164
165 #endif // _Geom2dHatch_Hatching_HeaderFile