0022898: IGES import fails in german environment
[occt.git] / src / QANCollection / QANCollection3.cxx
CommitLineData
b311480e 1// Created on: 2004-03-05
2// Created by: Mikhail KUZMITCHEV
3// Copyright (c) 2004-2012 OPEN CASCADE SAS
4//
5// The content of this file is subject to the Open CASCADE Technology Public
6// License Version 6.5 (the "License"). You may not use the content of this file
7// except in compliance with the License. Please obtain a copy of the License
8// at http://www.opencascade.org and read it completely before using this file.
9//
10// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
11// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
12//
13// The Original Code and all software distributed under the License is
14// distributed on an "AS IS" basis, without warranty of any kind, and the
15// Initial Developer hereby disclaims all such warranties, including without
16// limitation, any warranties of merchantability, fitness for a particular
17// purpose or non-infringement. Please see the License for the specific terms
18// and conditions governing the rights and limitations under the License.
19
7fd59977 20#include <QANCollection.hxx>
91322f44 21
22#include <Draw.hxx>
7fd59977 23#include <Draw_Interpretor.hxx>
24
25#define ItemType gp_Pnt
26#define Key1Type Standard_Real
27#define Key2Type Standard_Integer
28
29#include <QANCollection_PerfTest.hxx>
30
ba39a6a3
Y
31#include <QANCollection_PerfSparseArray.hxx>
32
7fd59977 33IMPLEMENT_HARRAY1(QANCollection_HArray1Perf)
34IMPLEMENT_HARRAY2(QANCollection_HArray2Perf)
35IMPLEMENT_HSET(QANCollection_HSetPerf)
36IMPLEMENT_HSEQUENCE(QANCollection_HSequencePerf)
37
38//=======================================================================
39//function : CheckArguments
40//purpose :
41//=======================================================================
42Standard_Integer CheckArguments(Draw_Interpretor& di, Standard_Integer argc, const char ** argv, Standard_Integer& Repeat, Standard_Integer& Size)
43{
44 if ( argc != 3) {
45 di << "Usage : " << argv[0] << " Repeat Size" << "\n";
46 return 1;
47 }
91322f44 48 Repeat = Draw::Atoi(argv[1]);
49 Size = Draw::Atoi(argv[2]);
7fd59977 50 if ( Repeat < 1 ) {
51 di << "Repeat > 0" << "\n";
52 return 1;
53 }
54 if ( Size < 1 ) {
55 di << "Size > 0" << "\n";
56 return 1;
57 }
58 return 0;
59}
60
61
62//=======================================================================
63//function : QANColPerfArray1
64//purpose :
65//=======================================================================
66static Standard_Integer QANColPerfArray1(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
67{
68 Standard_Integer Repeat, Size;
69 if ( CheckArguments(di, argc, argv, Repeat, Size) ) {
70 return 1;
71 }
72 CompArray1(Repeat,Size);
73 return 0;
74}
75
76//=======================================================================
77//function : QANColPerfArray2
78//purpose :
79//=======================================================================
80static Standard_Integer QANColPerfArray2(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
81{
82 Standard_Integer Repeat, Size;
83 if ( CheckArguments(di, argc, argv, Repeat, Size) ) {
84 return 1;
85 }
86 CompArray2(Repeat,Size);
87 return 0;
88}
89
90//=======================================================================
91//function : QANColPerfList
92//purpose :
93//=======================================================================
94static Standard_Integer QANColPerfList(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
95{
96 Standard_Integer Repeat, Size;
97 if ( CheckArguments(di, argc, argv, Repeat, Size) ) {
98 return 1;
99 }
100 CompList(Repeat,Size);
101 return 0;
102}
103
104//=======================================================================
105//function : QANColPerfQueue
106//purpose :
107//=======================================================================
108static Standard_Integer QANColPerfQueue(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
109{
110 Standard_Integer Repeat, Size;
111 if ( CheckArguments(di, argc, argv, Repeat, Size) ) {
112 return 1;
113 }
114 CompQueue(Repeat,Size);
115 return 0;
116}
117
118//=======================================================================
119//function : QANColPerfStack
120//purpose :
121//=======================================================================
122static Standard_Integer QANColPerfStack(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
123{
124 Standard_Integer Repeat, Size;
125 if ( CheckArguments(di, argc, argv, Repeat, Size) ) {
126 return 1;
127 }
128 CompStack(Repeat,Size);
129 return 0;
130}
131
132//=======================================================================
133//function : QANColPerfSet
134//purpose :
135//=======================================================================
136static Standard_Integer QANColPerfSet(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
137{
138 Standard_Integer Repeat, Size;
139 if ( CheckArguments(di, argc, argv, Repeat, Size) ) {
140 return 1;
141 }
142 CompSet(Repeat,Size);
143 return 0;
144}
145
146//=======================================================================
147//function : QANColPerfSList
148//purpose :
149//=======================================================================
150static Standard_Integer QANColPerfSList(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
151{
152 Standard_Integer Repeat, Size;
153 if ( CheckArguments(di, argc, argv, Repeat, Size) ) {
154 return 1;
155 }
156 CompSList(Repeat,Size);
157 return 0;
158}
159
160//=======================================================================
161//function : QANColPerfSequence
162//purpose :
163//=======================================================================
164static Standard_Integer QANColPerfSequence(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
165{
166 Standard_Integer Repeat, Size;
167 if ( CheckArguments(di, argc, argv, Repeat, Size) ) {
168 return 1;
169 }
170 CompSequence(Repeat,Size);
171 return 0;
172}
173
174//=======================================================================
175//function : QANColPerfMap
176//purpose :
177//=======================================================================
178static Standard_Integer QANColPerfMap(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
179{
180 Standard_Integer Repeat, Size;
181 if ( CheckArguments(di, argc, argv, Repeat, Size) ) {
182 return 1;
183 }
184 CompMap(Repeat,Size);
185 return 0;
186}
187
188//=======================================================================
189//function : QANColPerfDataMap
190//purpose :
191//=======================================================================
192static Standard_Integer QANColPerfDataMap(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
193{
194 Standard_Integer Repeat, Size;
195 if ( CheckArguments(di, argc, argv, Repeat, Size) ) {
196 return 1;
197 }
198 CompDataMap(Repeat,Size);
199 return 0;
200}
201
202//=======================================================================
203//function : QANColPerfDoubleMap
204//purpose :
205//=======================================================================
206static Standard_Integer QANColPerfDoubleMap(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
207{
208 Standard_Integer Repeat, Size;
209 if ( CheckArguments(di, argc, argv, Repeat, Size) ) {
210 return 1;
211 }
212 CompDoubleMap(Repeat,Size);
213 return 0;
214}
215
216//=======================================================================
217//function : QANColPerfIndexedMap
218//purpose :
219//=======================================================================
220static Standard_Integer QANColPerfIndexedMap(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
221{
222 Standard_Integer Repeat, Size;
223 if ( CheckArguments(di, argc, argv, Repeat, Size) ) {
224 return 1;
225 }
226 CompIndexedMap(Repeat,Size);
227 return 0;
228}
229
230//=======================================================================
231//function : QANColPerfIndexedDataMap
232//purpose :
233//=======================================================================
234static Standard_Integer QANColPerfIndexedDataMap(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
235{
236 Standard_Integer Repeat, Size;
237 if ( CheckArguments(di, argc, argv, Repeat, Size) ) {
238 return 1;
239 }
240 CompIndexedDataMap(Repeat,Size);
241 return 0;
242}
243
ba39a6a3
Y
244//=======================================================================
245//function : QANColCheckSparseArray
246//purpose :
247//=======================================================================
248static Standard_Integer QANColCheckSparseArray(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
249{
250 Standard_Integer Repeat, Size;
251 if ( CheckArguments(di, argc, argv, Repeat, Size) ) {
252 return 1;
253 }
254 CompSparseArray(Repeat,Size);
255 return 0;
256}
257
7fd59977 258void QANCollection::Commands3(Draw_Interpretor& theCommands) {
1365140b 259 const char *group = "QANCollection";
7fd59977 260
261 // from agvCollTest/src/CollectionEXE/PerfTestEXE.cxx
262 theCommands.Add("QANColPerfArray1", "QANColPerfArray1 Repeat Size", __FILE__, QANColPerfArray1, group);
263 theCommands.Add("QANColPerfArray2", "QANColPerfArray2 Repeat Size", __FILE__, QANColPerfArray2, group);
264 theCommands.Add("QANColPerfList", "QANColPerfList Repeat Size", __FILE__, QANColPerfList, group);
265 theCommands.Add("QANColPerfQueue", "QANColPerfQueue Repeat Size", __FILE__, QANColPerfQueue, group);
266 theCommands.Add("QANColPerfStack", "QANColPerfStack Repeat Size", __FILE__, QANColPerfStack, group);
267 theCommands.Add("QANColPerfSet", "QANColPerfSet Repeat Size", __FILE__, QANColPerfSet, group);
268 theCommands.Add("QANColPerfSList", "QANColPerfSList Repeat Size", __FILE__, QANColPerfSList, group);
269 theCommands.Add("QANColPerfSequence", "QANColPerfSequence Repeat Size", __FILE__, QANColPerfSequence, group);
270 theCommands.Add("QANColPerfMap", "QANColPerfMap Repeat Size", __FILE__, QANColPerfMap, group);
271 theCommands.Add("QANColPerfDataMap", "QANColPerfDataMap Repeat Size", __FILE__, QANColPerfDataMap, group);
272 theCommands.Add("QANColPerfDoubleMap", "QANColPerfDoubleMap Repeat Size", __FILE__, QANColPerfDoubleMap, group);
273 theCommands.Add("QANColPerfIndexedMap", "QANColPerfIndexedMap Repeat Size", __FILE__, QANColPerfIndexedMap, group);
274 theCommands.Add("QANColPerfIndexedDataMap", "QANColPerfIndexedDataMap Repeat Size", __FILE__, QANColPerfIndexedDataMap, group);
ba39a6a3
Y
275
276 theCommands.Add("QANColCheckSparseArray", "QANColCheckSparseArray Repeat Size", __FILE__, QANColCheckSparseArray, group);
277
7fd59977 278 return;
279}
ba39a6a3 280