]> SALOME platform Git repositories - modules/geom.git/blob - src/NMTDS_NEW/NMTDS_CArray1OfIndexRange.hxx
Salome HOME
Mantis issue 0021191: GlueEdges and GlueFaces problem with tolerance 1. A fix by...
[modules/geom.git] / src / NMTDS_NEW / NMTDS_CArray1OfIndexRange.hxx
1 // Copyright (C) 2007-2011  CEA/DEN, EDF R&D, OPEN CASCADE\r
2 //\r
3 // This library is free software; you can redistribute it and/or\r
4 // modify it under the terms of the GNU Lesser General Public\r
5 // License as published by the Free Software Foundation; either\r
6 // version 2.1 of the License.\r
7 //\r
8 // This library is distributed in the hope that it will be useful,\r
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of\r
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
11 // Lesser General Public License for more details.\r
12 //\r
13 // You should have received a copy of the GNU Lesser General Public\r
14 // License along with this library; if not, write to the Free Software\r
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA\r
16 //\r
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com\r
18 //\r
19 \r
20 // File:        NMTDS_BndSphere.hxx\r
21 // Created:     \r
22 // Author:      Peter KURNEV\r
23 //              <pkv@irinox>\r
24 \r
25 #ifndef _NMTDS_CArray1OfIndexRange_HeaderFile\r
26 #define _NMTDS_CArray1OfIndexRange_HeaderFile\r
27 \r
28 #include <Standard.hxx>\r
29 #include <Standard_Macro.hxx>\r
30 #include <Standard_Address.hxx>\r
31 #include <Standard_Integer.hxx>\r
32 #include <Standard_Boolean.hxx>\r
33 #include <NMTDS_IndexRange.hxx>\r
34 \r
35 class Standard_OutOfRange;\r
36 class Standard_OutOfMemory;\r
37 \r
38 \r
39 \r
40 //=======================================================================\r
41 //function : NMTDS_CArray1OfIndexRange\r
42 //purpose  : \r
43 //=======================================================================\r
44 class NMTDS_CArray1OfIndexRange  {\r
45  public:\r
46 \r
47   Standard_EXPORT\r
48     NMTDS_CArray1OfIndexRange(const Standard_Integer Length = 0,\r
49                               const Standard_Integer BlockLength = 5);\r
50   \r
51   Standard_EXPORT   \r
52     void Resize(const Standard_Integer theNewLength) ;\r
53   \r
54   Standard_EXPORT     \r
55     void Destroy() ;\r
56 \r
57   ~NMTDS_CArray1OfIndexRange() {\r
58     Destroy();\r
59   }\r
60   \r
61   Standard_EXPORT\r
62     Standard_Integer Length() const;\r
63   \r
64   Standard_EXPORT\r
65     Standard_Integer Extent() const;\r
66   \r
67   Standard_EXPORT\r
68     Standard_Integer FactLength() const;\r
69   \r
70   Standard_EXPORT\r
71     Standard_Integer Append(const NMTDS_IndexRange& Value) ;\r
72   \r
73   Standard_EXPORT\r
74     void Remove(const Standard_Integer Index) ;\r
75   \r
76   Standard_EXPORT\r
77     const NMTDS_IndexRange& Value(const Standard_Integer Index) const;\r
78    \r
79   const NMTDS_IndexRange& operator ()(const Standard_Integer Index) const {\r
80     return Value(Index);\r
81   }\r
82   \r
83   Standard_EXPORT\r
84     NMTDS_IndexRange& ChangeValue(const Standard_Integer Index) ;\r
85 \r
86     NMTDS_IndexRange& operator ()(const Standard_Integer Index) {\r
87       return ChangeValue(Index);\r
88     }\r
89   \r
90   Standard_EXPORT\r
91     void SetBlockLength(const Standard_Integer aBL) ;\r
92   \r
93   Standard_EXPORT\r
94     Standard_Integer BlockLength() const;\r
95   \r
96   Standard_EXPORT\r
97     void Purge() ;\r
98 \r
99  private:\r
100   Standard_EXPORT\r
101     NMTDS_CArray1OfIndexRange(const NMTDS_CArray1OfIndexRange& AnArray);\r
102   \r
103   Standard_EXPORT\r
104     NMTDS_CArray1OfIndexRange& Assign(const NMTDS_CArray1OfIndexRange& Other) ;\r
105   \r
106   NMTDS_CArray1OfIndexRange& operator =(const NMTDS_CArray1OfIndexRange& Other) {\r
107     return Assign(Other);\r
108   }\r
109   \r
110   Standard_EXPORT\r
111     Standard_Boolean IsInvalidIndex(const Standard_Integer Index) const;\r
112 \r
113 \r
114   Standard_Address myStart;\r
115   Standard_Integer myLength;\r
116   Standard_Integer myFactLength;\r
117   Standard_Integer myBlockLength;\r
118   Standard_Boolean myIsAllocated;\r
119 };\r
120 \r
121 #endif\r