// Solve for time float time = (float)(intersectionDistance / lineLength); // If time is outside the boundaries, return null. This algorithm can // return a negative time which indicates the previous intersection. if (time > 1.0f || time < 0.0f) { return null; } // Solve the intersection and normal float ix = time * dx + start.x; float iy = time * dy + start.y; float nx = (float)((ix - cornerX) * inverseRadius); float ny = (float)((iy - cornerY) * inverseRadius); return new Intersection( ix, iy, time, nx, ny );
/** * @inheritDoc */ @Override public void meet(Intersection theOp) throws Exception { binaryOpMeet(theOp, theOp.getLeftArg(), theOp.getRightArg()); }
@Override public void meet(Intersection intersection) { super.meet(intersection); TupleExpr leftArg = intersection.getLeftArg(); TupleExpr rightArg = intersection.getRightArg(); if (leftArg instanceof EmptySet || rightArg instanceof EmptySet) { intersection.replaceWith(leftArg); } } }
@Override protected Iteration<BindingSet, QueryEvaluationException> createIteration() throws QueryEvaluationException { return evaluate(intersection.getRightArg(), bindings); } };
@Override protected Iteration<BindingSet, QueryEvaluationException> createIteration() throws QueryEvaluationException { return evaluate(intersection.getLeftArg(), bindings); } };
List<RoadElement> RoadMap = new LinkedList<RoadElement>(); Road r1 = new Road(); Intersection i1 = new Intersection(); r1.setPrevious(i1); i1.setNorthernConnection(r1); ....
/** * @inheritDoc */ @Override public void meet(Intersection theOp) throws Exception { String aLeft = renderTupleExpr(theOp.getLeftArg()); String aRight = renderTupleExpr(theOp.getRightArg()); mBuffer.append(aLeft).append("\nintersection\n").append(aRight); }
@Override public void meet(Intersection intersection) { super.meet(intersection); TupleExpr leftArg = intersection.getLeftArg(); TupleExpr rightArg = intersection.getRightArg(); if (leftArg instanceof EmptySet || rightArg instanceof EmptySet) { intersection.replaceWith(leftArg); } } }
@Override protected Iteration<BindingSet, QueryEvaluationException> createIteration() throws QueryEvaluationException { return evaluate(intersection.getRightArg(), bindings); } };
@Override protected Iteration<BindingSet, QueryEvaluationException> createIteration() throws QueryEvaluationException { return evaluate(intersection.getLeftArg(), bindings); } };
/** * @inheritDoc */ @Override public void meet(Intersection theOp) throws Exception { String aLeft = renderTupleExpr(theOp.getLeftArg()); String aRight = renderTupleExpr(theOp.getRightArg()); mJoinBuffer.append("\n").append(aLeft).append("}").append("\nintersection\n").append("{").append(aRight).append( "}.\n"); }
@Override public void meet(Intersection intersection) { super.meet(intersection); TupleExpr leftArg = intersection.getLeftArg(); TupleExpr rightArg = intersection.getRightArg(); if (leftArg instanceof EmptySet || rightArg instanceof EmptySet) { intersection.replaceWith(new EmptySet()); } } }
@Override public TupleExpr visit(ASTTupleIntersect node, Object data) throws VisitorException { TupleExpr leftArg = (TupleExpr)node.getLeftArg().jjtAccept(this, null); TupleExpr rightArg = (TupleExpr)node.getRightArg().jjtAccept(this, null); return new Intersection(leftArg, rightArg); }
public Set<String> getBindingNames() { Set<String> bindingNames = new LinkedHashSet<String>(16); bindingNames.addAll(getLeftArg().getBindingNames()); bindingNames.retainAll(getRightArg().getBindingNames()); return bindingNames; }
@Override public void meet(Intersection intersection) { super.meet(intersection); TupleExpr leftArg = intersection.getLeftArg(); TupleExpr rightArg = intersection.getRightArg(); if (leftArg instanceof EmptySet || rightArg instanceof EmptySet) { intersection.replaceWith(new EmptySet()); } }
@Override public TupleExpr visit(ASTGraphIntersect node, Object data) throws VisitorException { TupleExpr leftArg = (TupleExpr)node.getLeftArg().jjtAccept(this, null); TupleExpr rightArg = (TupleExpr)node.getRightArg().jjtAccept(this, null); return new Intersection(leftArg, rightArg); }
public Set<String> getAssuredBindingNames() { Set<String> bindingNames = new LinkedHashSet<String>(16); bindingNames.addAll(getLeftArg().getAssuredBindingNames()); bindingNames.retainAll(getRightArg().getAssuredBindingNames()); return bindingNames; }
@Override public void meet(final Intersection node) { if (Sets.intersection(node.getRightArg().getBindingNames(), filterVars).size() > 0) { relocate(filter, node.getRightArg()); } else if (Sets.intersection(node.getLeftArg().getBindingNames(), filterVars).size() > 0) { final Filter clone = new Filter(filter.getArg(), filter .getCondition().clone()); relocate(clone, node.getLeftArg()); } }
@Override public void meet(Intersection node) { Filter clone = new Filter(); clone.setCondition(filter.getCondition().clone()); relocate(filter, node.getLeftArg()); relocate(clone, node.getRightArg()); FilterRelocator.relocate(filter); FilterRelocator.relocate(clone); }
@Override public void meet(Intersection node) { Filter clone = new Filter(); clone.setCondition(filter.getCondition().clone()); relocate(filter, node.getLeftArg()); relocate(clone, node.getRightArg()); FilterRelocator.relocate(filter); FilterRelocator.relocate(clone); }