1 // Created on: 2002-04-30
2 // Created by: Alexander KARTOMIN (akm)
3 // Copyright (c) 2002-2014 OPEN CASCADE SAS
4 //
5 // This file is part of Open CASCADE Technology software library.
6 //
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
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.
12 //
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
15
16 // Purpose: To test all methods of all NCollection classes
17
18 #include <QANCollection_Common.hxx>
19 #include <stdio.h>
20
PrintItem(const gp_Pnt & thePnt)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
PrintItem(const Standard_Real theDbl)26 void PrintItem(const Standard_Real theDbl)
27 {
28 printf (" (%5.1f)\n", theDbl);
29 }
30
Random(Standard_Real & theValue)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
Random(Standard_Integer & theValue,const Standard_Integer theMax)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
Random(gp_Pnt & thePnt)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 }
57