Examples of Plane


Examples of org.apache.commons.math3.geometry.euclidean.threed.Plane

    }

    @Test
    public void testIntersection3() throws MathArithmeticException {
        Vector3D reference = new Vector3D (1.2, 3.4, -5.8);
        Plane p1 = new Plane(reference, new Vector3D(1, 3, 3), 1.0e-10);
        Plane p2 = new Plane(reference, new Vector3D(-2, 4, 0), 1.0e-10);
        Plane p3 = new Plane(reference, new Vector3D(7, 0, -4), 1.0e-10);
        Vector3D p = Plane.intersection(p1, p2, p3);
        Assert.assertEquals(reference.getX(), p.getX(), 1.0e-10);
        Assert.assertEquals(reference.getY(), p.getY(), 1.0e-10);
        Assert.assertEquals(reference.getZ(), p.getZ(), 1.0e-10);
    }
View Full Code Here

Examples of org.apache.commons.math3.geometry.euclidean.threed.Plane

    @Test
    public void testSimilar() throws MathArithmeticException {
        Vector3D p1  = new Vector3D (1.2, 3.4, -5.8);
        Vector3D p2  = new Vector3D (3.4, -5.8, 1.2);
        Vector3D p3  = new Vector3D (-2.0, 4.3, 0.7);
        Plane    pA  = new Plane(p1, p2, p3, 1.0e-10);
        Plane    pB  = new Plane(p1, new Vector3D (11.4, -3.8, 5.1), p2, 1.0e-10);
        Assert.assertTrue(! pA.isSimilarTo(pB));
        Assert.assertTrue(pA.isSimilarTo(pA));
        Assert.assertTrue(pA.isSimilarTo(new Plane(p1, p3, p2, 1.0e-10)));
        Vector3D shift = new Vector3D(0.3, pA.getNormal());
        Assert.assertTrue(! pA.isSimilarTo(new Plane(p1.add(shift),
                                                     p3.add(shift),
                                                     p2.add(shift),
                                                     1.0e-10)));
    }
View Full Code Here

Examples of org.eclipse.dd.di.Plane

            if (result == null)
                result = defaultCase(theEObject);
            return result;
        }
        case DiPackage.PLANE: {
            Plane plane = (Plane) theEObject;
            T result = casePlane(plane);
            if (result == null)
                result = caseNode(plane);
            if (result == null)
                result = caseDiagramElement(plane);
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.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.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
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.