Examples of Plane


Examples of org.hibernate.test.annotations.Plane

  public void testCache() throws Exception {
    Session s;
    Transaction tx;
    s = openSession();
    tx = s.beginTransaction();
    Plane plane = new Plane();
    plane.setNbrOfSeats( 5 );
    s.persist( plane );
    tx.commit();
    s.close();
    getSessions().getStatistics().clear();
    getSessions().getStatistics().setStatisticsEnabled( true );
    s = openSession();
    tx = s.beginTransaction();
    Query query = s.getNamedQuery( "plane.byId" ).setParameter( "id", plane.getId() );
    plane = (Plane) query.uniqueResult();
    assertEquals( 1, getSessions().getStatistics().getQueryCachePutCount() );
    plane = (Plane) s.getNamedQuery( "plane.byId" ).setParameter( "id", plane.getId() ).uniqueResult();
    assertEquals( 1, getSessions().getStatistics().getQueryCacheHitCount() );
    tx.commit();
    s.close();

    s = openSession();
    tx = s.beginTransaction();
    s.delete( s.get( Plane.class, plane.getId() ) );
    tx.commit();
    s.close();
  }
View Full Code Here

Examples of org.hibernate.test.annotations.Plane

  }

  public void testPolymorphism() throws Exception {
    Session s = openSession();
    Transaction tx = s.beginTransaction();
    Plane p = new Plane();
    p.setNbrOfSeats( 10 );
    A320 a = new A320();
    a.setJavaEmbeddedVersion( "5.0" );
    a.setNbrOfSeats( 300 );
    s.persist( a );
    s.persist( p );
View Full Code Here

Examples of org.hibernate.test.annotations.Plane

  }

  public void testEmbeddedSuperclass() throws Exception {
    Session s = openSession();
    Transaction tx = s.beginTransaction();
    Plane p = new Plane();
    p.setAlive( true ); //sic
    p.setAltitude( 10000 );
    p.setMetricAltitude( 3000 );
    p.setNbrOfSeats( 150 );
    p.setSerial( "0123456789" );
    s.persist( p );
    tx.commit();
    s.close();

    s = openSession();
    tx = s.beginTransaction();
    p = (Plane) s.get( Plane.class, p.getId() );
    assertNotNull( p );
    assertEquals( true, p.isAlive() );
    assertEquals( 150, p.getNbrOfSeats() );
    assertEquals( 10000, p.getAltitude() );
    assertEquals( "0123456789", p.getSerial() );
    assertFalse( 3000 == p.getMetricAltitude() );
    s.delete( p );
    tx.commit();
    s.close();
  }
View Full Code Here

Examples of org.hibernate.test.annotations.Plane

  }

  public void testPackageQueries() throws Exception {
    Session s = openSession();
    Transaction tx = s.beginTransaction();
    Plane p = new Plane();
    s.persist( p );
    Query q = s.getNamedQuery( "plane.getAll" );
    assertEquals( 1, q.list().size() );
    tx.commit();
    s.close();
View Full Code Here

Examples of org.hibernate.test.annotations.Plane

  public void testCache() throws Exception {
    Session s;
    Transaction tx;
    s = openSession();
    tx = s.beginTransaction();
    Plane plane = new Plane();
    plane.setNbrOfSeats( 5 );
    s.persist( plane );
    tx.commit();
    s.close();
    getSessions().getStatistics().clear();
    getSessions().getStatistics().setStatisticsEnabled( true );
    s = openSession();
    tx = s.beginTransaction();
    Query query = s.getNamedQuery( "plane.byId" ).setParameter( "id", plane.getId() );
    plane = (Plane) query.uniqueResult();
    assertEquals( 1, getSessions().getStatistics().getQueryCachePutCount() );
    plane = (Plane) s.getNamedQuery( "plane.byId" ).setParameter( "id", plane.getId() ).uniqueResult();
    assertEquals( 1, getSessions().getStatistics().getQueryCacheHitCount() );
    tx.commit();
    s.close();

    s = openSession();
    tx = s.beginTransaction();
    s.delete( s.get( Plane.class, plane.getId() ) );
    tx.commit();
    s.close();
  }
View Full Code Here

Examples of org.mt4j.util.math.Plane

    Z = new Vector3D();
    X = new Vector3D();
    Y = new Vector3D();
   
    planes = new Plane[]{
         new Plane(Vector3D.ZERO_VECTOR,Vector3D.ZERO_VECTOR)
        ,new Plane(Vector3D.ZERO_VECTOR,Vector3D.ZERO_VECTOR)
        ,new Plane(Vector3D.ZERO_VECTOR,Vector3D.ZERO_VECTOR)
        ,new Plane(Vector3D.ZERO_VECTOR,Vector3D.ZERO_VECTOR)
        ,new Plane(Vector3D.ZERO_VECTOR,Vector3D.ZERO_VECTOR)
        ,new Plane(Vector3D.ZERO_VECTOR,Vector3D.ZERO_VECTOR)
    };
   
    PGraphics3D p3d = ((PGraphics3D)pa.g);
   
    //This has to be called if the perspective is changed!!
View Full Code Here

Examples of plane.Plane

        submitScorePane= new SubmitScorePane();
        submitScorePane.setTranslateY(300);
        highScoresPane= new HighScoresPane();
        highScoresPane.setTranslateY(300);
        clouds = new Clouds(this);
        plane = new Plane(this);
        init();
    }
View Full Code Here

Examples of toxi.geom.Plane

    return pickBuffer;
  }

  public Vec2D getPointOnPlane(Vec2D mousePoint, Plane planeIn) {

    Plane plane = new Plane(planeIn.copy(), planeIn.normal.copy());

    Vec3D mouseRayPos = new Vec3D(mousePoint.x, mousePoint.y, planeIn.z); // this only works for planes perpendicular to the screen
    Vec3D mouseRayDir = new Vec3D(0, 0, -1);

    Vec3D focusCentre = new Vec3D(
        ((GLOBAL.windowWidth / 2) - (float)GLOBAL.CAM_OFFSET_X),
        ((GLOBAL.windowHeight / 2) - (float)GLOBAL.CAM_OFFSET_Y), 0);

    //now mouse pos is refereced from the centre of the screen
    mouseRayPos.x -= (GLOBAL.windowWidth / 2);
    mouseRayPos.y -= (GLOBAL.windowHeight / 2);
    mouseRayPos.scaleSelf((float) (1 / GLOBAL.getZOOM()));

    mouseRayPos.addSelf(focusCentre);

    Ray3D ray;

    Vec3D mousePos = null;
    Vec3D intersect;
    mouseRayDir = new Vec3D(0, 0, -1);

    plane.z = 0;
    //we need to rotate the plane so that it matches the one on the draw view
    plane.normal.rotateY(GLOBAL.rotateModelsY);
    plane.normal.rotateX(GLOBAL.rotateModelsX);

    plane.addSelf(plane.normal.scale(planeIn.z));
    //mouseRayDir.rotateY(GLOBAL.rotateModelsY);
    //mouseRayDir.rotateX(GLOBAL.rotateModelsX);

    mouseRayPos.subSelf(focusCentre);
    ray = new Ray3D(mouseRayPos, mouseRayDir); // this should be the world position of the mouse poiner on the 0,0,-1 plane

    intersect = plane.getIntersectionWithRay(ray);

    if (intersect == null) {
      ray = new Ray3D(mouseRayPos, mouseRayDir.invert());
      intersect = plane.getIntersectionWithRay(ray);
    }

    ray = new Ray3D(mouseRayPos, mouseRayDir);
    ray.addSelf(focusCentre);
View Full Code Here

Examples of toxi.geom.Plane

          .getWorldTransform(transform);
      transform.getMatrix(chairMatrix);
      chairCentreOfMass = GLOBAL.sketchChairs.getCurChair().centreOfMass;
    }

    Plane plane = new Plane(planeIn.copy(), planeIn.normal.copy());

    Vec3D mouseRayPos = new Vec3D(mousePoint.x, mousePoint.y, plane.z); // this only works for planes perpendicular to the screen
    Vec3D mouseRayDir = new Vec3D(0, 0, -1);

    Vec3D focusCentre = new Vec3D(
View Full Code Here

Examples of toxi.geom.Plane

   * Build design from SketchShape element
   * @param shape
   */
  public SketchChair(SketchShape shape) {

    SlicePlane plane = new SlicePlane(new Plane(new Vec3D(0, 0, 0),
        new Vec3D(0, 0, -1)));
    plane.setSelected(true);
    plane.getSketch().getSketchShapes().add(shape);
    this.selectedPlanes.add(plane);
    this.mouseReleased(0, 0);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.