Examples of Intersection


Examples of ca.eandb.jmist.framework.Intersection

    int id = (twoSided && RandomUtil.coin(rj))
        ? DISC_SURFACE_BOTTOM
        : DISC_SURFACE_TOP;

    Intersection x = newSurfacePoint(p, id);
    x.prepareShadingContext(context);
  }
View Full Code Here

Examples of ca.eandb.jmist.framework.Intersection

      if (ray.direction().x() != 0.0) {
        t = (box.minimumX() - ray.origin().x()) / ray.direction().x();
        if (t > 0.0) {
          p = ray.pointAt(t);
          if (box.minimumY() < p.y() && p.y() < box.maximumY() && box.minimumZ() < p.z() && p.z() < box.maximumZ()) {
            Intersection x = super.newIntersection(ray, t, ray.direction().x() > 0.0, BOX_SURFACE_MIN_X)
              .setLocation(p);
            recorder.record(x);
            if (++n == 2) return;
          }
        }

        t = (box.maximumX() - ray.origin().x()) / ray.direction().x();
        if (t > 0.0) {
          p = ray.pointAt(t);
          if (box.minimumY() < p.y() && p.y() < box.maximumY() && box.minimumZ() < p.z() && p.z() < box.maximumZ()) {
            Intersection x = super.newIntersection(ray, t, ray.direction().x() < 0.0, BOX_SURFACE_MAX_X)
              .setLocation(p);
            recorder.record(x);
            if (++n == 2) return;
          }
        }
      }

      if (ray.direction().y() != 0.0) {
        t = (box.minimumY() - ray.origin().y()) / ray.direction().y();
        if (t > 0.0) {
          p = ray.pointAt(t);
          if (box.minimumX() < p.x() && p.x() < box.maximumX() && box.minimumZ() < p.z() && p.z() < box.maximumZ()) {
            Intersection x = super.newIntersection(ray, t, ray.direction().y() > 0.0, BOX_SURFACE_MIN_Y)
              .setLocation(p);
            recorder.record(x);
            if (++n == 2) return;
          }
        }

        t = (box.maximumY() - ray.origin().y()) / ray.direction().y();
        if (t > 0.0) {
          p = ray.pointAt(t);
          if (box.minimumX() < p.x() && p.x() < box.maximumX() && box.minimumZ() < p.z() && p.z() < box.maximumZ()) {
            Intersection x = super.newIntersection(ray, t, ray.direction().y() < 0.0, BOX_SURFACE_MAX_Y)
              .setLocation(p);
            recorder.record(x);
            if (++n == 2) return;
          }
        }
      }

      if (ray.direction().z() != 0.0) {
        t = (box.minimumZ() - ray.origin().z()) / ray.direction().z();
        if (t > 0.0) {
          p = ray.pointAt(t);
          if (box.minimumX() < p.x() && p.x() < box.maximumX() && box.minimumY() < p.y() && p.y() < box.maximumY()) {
            Intersection x = super.newIntersection(ray, t, ray.direction().z() > 0.0, BOX_SURFACE_MIN_Z)
              .setLocation(p);
            recorder.record(x);
            if (++n == 2) return;
          }
        }

        t = (box.maximumZ() - ray.origin().z()) / ray.direction().z();
        if (t > 0.0) {
          p = ray.pointAt(t);
          if (box.minimumX() < p.x() && p.x() < box.maximumX() && box.minimumY() < p.y() && p.y() < box.maximumY()) {
            Intersection x = super.newIntersection(ray, t, ray.direction().z() < 0.0, BOX_SURFACE_MAX_Z)
              .setLocation(p);
            recorder.record(x);
            if (++n == 2) return;
          }
        }
View Full Code Here

Examples of ca.eandb.jmist.framework.Intersection

      p = new Point3(dir ? box.maximumX() : box.minimumX(),
          RandomUtil.uniform(box.spanY(), ru),
          RandomUtil.uniform(box.spanZ(), rv));
    }

    Intersection x = newSurfacePoint(p, id);
    x.prepareShadingContext(context);
  }
View Full Code Here

Examples of com.greplin.lucene.util.Intersection

          termPositions.seek(term.term);

          if (matches == null) {
            // If this is the first term, collect all matches that intersect
            // with the provided initial document set.
            Intersection intersection = this.intersectionProvider.get(reader);

            matches = new PhraseFilterMatchList(term.docFreq);
            while (intersection.advanceToNextIntersection(termPositions)) {
              int freq = termPositions.freq();
              PhraseFilterIntList list = new PhraseFilterIntList(freq);
              for (int i = 0; i < freq; i++) {
                list.add(termPositions.nextPosition() - term.offset);
              }
View Full Code Here

Examples of com.hp.hpl.jena.graph.compose.Intersection

     
  public void testIntersection()
    {
        Graph g1 = graphWith( "x R y; p R q" );
        Graph g2 = graphWith( "r A s; x R y" );
        Intersection i = new Intersection( g1, g2 );
        assertContains( "Intersection", "x R y", i );
     assertOmits( "Intersection", i, "p R q" );
    assertOmits( "Intersection", i, "r A s" );
        if (i.size() != 1)
            fail( "oops: size of intersection is not 1" );
        i.add( triple( "cats eat cheese" ) );
        assertContains( "Intersection.L", "cats eat cheese", g1 );
        assertContains( "Intersection.R", "cats eat cheese", g2 );
        }
View Full Code Here

Examples of com.hp.hpl.jena.graph.compose.Intersection

   
    public void testDeleteDoesNotUpdateR()
        {
      Graph L = graphWith( "a pings b; b pings c; c pings a" );
      Graph R = graphWith( "c pings a; b pings c; x captures y" );
      Graph join = new Intersection( L, R );
        L.getBulkUpdateHandler().delete( join );
        assertIsomorphic( "R should not change", graphWith( "c pings a; b pings c; x captures y" ), R );
        assertIsomorphic( graphWith( "a pings b" ), L );
    }
View Full Code Here

Examples of com.hp.hpl.jena.graph.compose.Intersection

  
  @Override
  public Graph getGraph()
  {
    Graph gBase = graphWith( "" ), g1 = graphWith( "" );
        return new Intersection( gBase, g1 );
  }
View Full Code Here

Examples of com.hp.hpl.jena.graph.compose.Intersection

 
  public void testIntersection()
    {
        Graph g1 = graphWith( "x R y; p R q" );
        Graph g2 = graphWith( "r A s; x R y" );
        Intersection i = new Intersection( g1, g2 );
        assertContains( "Intersection", "x R y", i );
     assertOmits( "Intersection", i, "p R q" );
    assertOmits( "Intersection", i, "r A s" );
        if (i.size() != 1)
            fail( "oops: size of intersection is not 1" );
        i.add( triple( "cats eat cheese" ) );
        assertContains( "Intersection.L", "cats eat cheese", g1 );
        assertContains( "Intersection.R", "cats eat cheese", g2 );
        }
View Full Code Here

Examples of com.hp.hpl.jena.graph.compose.Intersection

   
    public void testDeleteDoesNotUpdateR()
        {
      Graph L = graphWith( "a pings b; b pings c; c pings a" );
      Graph R = graphWith( "c pings a; b pings c; x captures y" );
      Graph join = new Intersection( L, R );
      GraphUtil.deleteFrom(L, R) ;
        assertIsomorphic( "R should not change", graphWith( "c pings a; b pings c; x captures y" ), R );
        assertIsomorphic( graphWith( "a pings b" ), L );
    }
View Full Code Here

Examples of jpbrt.core.Intersection

    }
   
    @Override
    public Intersection intersect(Ray r)
    {
        Intersection result = new Intersection();
        Ray ray = worldToObject.transform(r);
       
        // compute quadratic sphere coefficients
        double a = ray.d.x*ray.d.x +ray.d.y*ray.d.y + ray.d.z*ray.d.z;
        double b = 2 * (ray.d.x*ray.o.x + ray.d.y*ray.o.y + ray.d.z* ray.o.z);
 
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.