0022048: Visualization, AIS_InteractiveContext - single object selection should alway...
[occt.git] / src / Geom2dHatch / Geom2dHatch_Elements.hxx
1 // Created on: 1994-12-16
2 // Created by: Laurent BUCHARD
3 // Copyright (c) 1994-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_Elements_HeaderFile
18 #define _Geom2dHatch_Elements_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23
24 #include <Geom2dHatch_MapOfElements.hxx>
25 #include <Geom2dHatch_DataMapIteratorOfMapOfElements.hxx>
26 #include <Standard_Integer.hxx>
27 #include <Standard_Boolean.hxx>
28 #include <Standard_Real.hxx>
29 #include <TopAbs_Orientation.hxx>
30 class Standard_DomainError;
31 class Standard_NoSuchObject;
32 class Geom2dHatch_Element;
33 class gp_Pnt2d;
34 class gp_Lin2d;
35 class Geom2dAdaptor_Curve;
36
37
38
39 class Geom2dHatch_Elements 
40 {
41 public:
42
43   DEFINE_STANDARD_ALLOC
44
45   
46   Standard_EXPORT Geom2dHatch_Elements();
47   
48   Standard_EXPORT Geom2dHatch_Elements(const Geom2dHatch_Elements& Other);
49   
50   Standard_EXPORT void Clear();
51 ~Geom2dHatch_Elements()
52 {
53   Clear();
54 }
55   
56   Standard_EXPORT Standard_Boolean Bind (const Standard_Integer K, const Geom2dHatch_Element& I);
57   
58   Standard_EXPORT Standard_Boolean IsBound (const Standard_Integer K) const;
59   
60   Standard_EXPORT Standard_Boolean UnBind (const Standard_Integer K);
61   
62   Standard_EXPORT const Geom2dHatch_Element& Find (const Standard_Integer K) const;
63 const Geom2dHatch_Element& operator() (const Standard_Integer K) const
64 {
65   return Find(K);
66 }
67   
68   Standard_EXPORT Geom2dHatch_Element& ChangeFind (const Standard_Integer K);
69 Geom2dHatch_Element& operator() (const Standard_Integer K)
70 {
71   return ChangeFind(K);
72 }
73   Standard_EXPORT Standard_Boolean CheckPoint (gp_Pnt2d& P);
74
75   Standard_EXPORT Standard_Boolean Reject (const gp_Pnt2d& P) const;
76   
77   Standard_EXPORT Standard_Boolean Segment (const gp_Pnt2d& P, gp_Lin2d& L, Standard_Real& Par);
78   
79   Standard_EXPORT Standard_Boolean OtherSegment (const gp_Pnt2d& P, gp_Lin2d& L, Standard_Real& Par);
80   
81   Standard_EXPORT void InitWires();
82   
83   Standard_EXPORT Standard_Boolean MoreWires() const;
84   
85   Standard_EXPORT void NextWire();
86   
87   Standard_EXPORT Standard_Boolean RejectWire (const gp_Lin2d& L, const Standard_Real Par) const;
88   
89   Standard_EXPORT void InitEdges();
90   
91   Standard_EXPORT Standard_Boolean MoreEdges() const;
92   
93   Standard_EXPORT void NextEdge();
94   
95   Standard_EXPORT Standard_Boolean RejectEdge (const gp_Lin2d& L, const Standard_Real Par) const;
96   
97   Standard_EXPORT void CurrentEdge (Geom2dAdaptor_Curve& E, TopAbs_Orientation& Or) const;
98
99
100
101
102 protected:
103
104
105
106
107
108 private:
109
110
111
112   Geom2dHatch_MapOfElements myMap;
113   Geom2dHatch_DataMapIteratorOfMapOfElements Iter;
114   Standard_Integer NumWire;
115   Standard_Integer NumEdge;
116   Standard_Integer myCurEdge;
117
118
119 };
120
121
122
123
124
125
126
127 #endif // _Geom2dHatch_Elements_HeaderFile