2,Top-level constructor for the PointBenchmark Java3D benchmark.

Power Java
High-Performance Java Software Development
James Schatzman and Roy Donehower
Listing 2. Top-level constructor for the PointBenchmark Java3D benchmark.


// Constructor for the benchmark
public PointBenchmark(int testtype) {
     myPointArray = new PointArray
             (myNumPoints,GeometryArray.COORDINATES|
             GeometryArray.COLOR_3);
     myPoints = new Point3f[myNumPoints];
     switch (testtype) {
          case 1:
              myPointTransform = new
TransformPoints1(myNumPoints, myPointArray, 0.01f);
              break;
          case 2:
              myPointTransform = new
TransformPoints2(myNumPoints, myPointArray, 0.01f,myPoints);
               break;
           case 3:
               myPointTransform = new
TransformPoints3(0.01f, myTransformGroup);
               break;
   }
}