b311480e |
1 | // Created on: 2002-04-30 |
2 | // Created by: Alexander KARTOMIN (akm) |
973c2be1 |
3 | // Copyright (c) 2002-2014 OPEN CASCADE SAS |
7fd59977 |
4 | // |
973c2be1 |
5 | // This file is part of Open CASCADE Technology software library. |
b311480e |
6 | // |
d5f74e42 |
7 | // This library is free software; you can redistribute it and/or modify it under |
8 | // the terms of the GNU Lesser General Public License version 2.1 as published |
973c2be1 |
9 | // by the Free Software Foundation, with special exception defined in the file |
10 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
11 | // distribution for complete text of the license and disclaimer of any warranty. |
b311480e |
12 | // |
973c2be1 |
13 | // Alternatively, this file may be used under the terms of Open CASCADE |
14 | // commercial license or contractual agreement. |
b311480e |
15 | |
7fd59977 |
16 | // Purpose: To test all methods of all NCollection classes |
17 | |
18 | #include <QANCollection_Common.hxx> |
19 | #include <stdio.h> |
20 | |
21 | void PrintItem(const gp_Pnt& thePnt) |
22 | { |
23 | printf (" (%5.1f %5.1f %5.1f)\n", thePnt.X(), thePnt.Y(), thePnt.Z()); |
24 | } |
25 | |
26 | void PrintItem(const Standard_Real theDbl) |
27 | { |
28 | printf (" (%5.1f)\n", theDbl); |
29 | } |
30 | |
31 | void Random (Standard_Real& theValue) |
32 | { |
33 | static Standard_Real dfV=0.14159265358979323846; |
34 | dfV *= 37.; |
35 | dfV -= Floor(dfV); |
36 | theValue = dfV; |
37 | //theValue=drand48(); |
38 | } |
39 | |
40 | void Random (Standard_Integer& theValue, |
41 | const Standard_Integer theMax) |
42 | { |
43 | Standard_Real dfR; |
44 | Random(dfR); |
45 | theValue = RealToInt(theMax*dfR); |
46 | } |
47 | |
48 | void Random (gp_Pnt& thePnt) |
49 | { |
50 | // thePnt.SetCoord(drand48(),drand48(),drand48()); |
51 | Standard_Real dfX, dfY, dfZ; |
52 | Random(dfX); |
53 | Random(dfY); |
54 | Random(dfZ); |
55 | thePnt.SetCoord(dfX,dfY,dfZ); |
56 | } |