Add occlusion segment in isovist

@param p0 segment origin
@param p1 segment destination
3936
public void addSegment(Coordinate p0, Coordinate p1) {
    if (p0.distance(p1) < epsilon) {
      return;
    }
    addSegment(originalSegments, p0, p1);
  }
31418
public void set(Segment1D<?, ?> segment, double curviline, double shift) {
		assert segment != null : AssertMessages.notNullParameter(0);
		this.segment = new WeakReference<>(segment);
		this.x = curviline;
		this.y = shift;
	}
1015685
void buildLinePortion(final Projection pProjection,
						  final boolean pStorePoints){
		final int size = mOriginalPoints.size();
		if (size < 2) { // nothing to paint
			return;
		}
        computeProjected(pProjection);
        computeDistances();
		final PointL offset = new PointL();
		getBestOffset(pProjection, offset);
		mSegmentClipper.init();
		clipAndStore(pProjection, offset, false, pStorePoints, mSegmentClipper);
		mSegmentClipper.end();
	}
276828
function(segment, segmentType) {
        var points = this.getElementsByTagNameNS(segment, segment.namespaceURI, segmentType);
        var point_features = [];
        for (var i = 0, len = points.length; i < len; i++) {
            point_features.push(new OpenLayers.Geometry.Point(points[i].getAttribute("lon"), points[i].getAttribute("lat")));
        }
        return new OpenLayers.Geometry.LineString(point_features);
    }
729853
@Override
     protected void addOverlays() {
          super.addOverlays();

          final Context context = getActivity();


          icons.add(getResources().getDrawable(org.osmdroid.R.drawable.sfgpuci));
          icons.add(getResources().getDrawable(org.osmdroid.R.drawable.shgpuci));
          icons.add(getResources().getDrawable(org.osmdroid.R.drawable.sngpuci));
          icons.add(getResources().getDrawable(org.osmdroid.R.drawable.sugpuci));


          //generates 50 randomized points
          addIcons(50);

          mRotationGestureOverlay = new RotationGestureOverlay(mMapView);
          mRotationGestureOverlay.setEnabled(false);
          mMapView.getOverlays().add(mRotationGestureOverlay);

          // Zoom and center on the focused item.
          mMapView.getController().setZoom(3);

          setHasOptionsMenu(true);
          Toast.makeText(context, "Icon selection and location are random!", Toast.LENGTH_SHORT).show();
     }
409729
private void mergeReleasedEntries(Segment segment, Segment compactSegment) {
    for (long i = segment.firstIndex(); i <= segment.lastIndex(); i++) {
      if (!segment.isLive(i)) {
        compactSegment.release(i);
      }
    }
  }
1071406
private boolean isOnTheSameSideOut(final long pX0, final long pY0, final long pX1, final long pY1) {
        return (pX0 < mXMin && pX1 < mXMin)
                || (pX0 > mXMax && pX1 > mXMax)
                || (pY0 < mYMin && pY1 < mYMin)
                || (pY0 > mYMax && pY1 > mYMax);
    }
765835
void querySegmentXY(int half_edge, SegmentBuffer outBuffer) {
		outBuffer.createLine();
		Segment seg = outBuffer.get();
		Point2D pt = new Point2D();
		getHalfEdgeFromXY(half_edge, pt);
		seg.setStartXY(pt);
		getHalfEdgeToXY(half_edge, pt);
		seg.setEndXY(pt);
	}
1266148
public void set( Point3D_F64 p1 , Point3D_F64 p2 ) {
		this.p1.set(p1);
		this.p2.set(p2);
	}
346667
public static final double getAngleBetweenTwoLines(final Point2D p0, final Point2D p1, final Point2D p2)
    {
        return getAngleFromSSS(p0.distance(p1), p1.distance(p2), p0.distance(p2));
    }
679600
public void setPointerShadowVisible(final boolean POINTER_SHADOW_VISIBLE) {
        getModel().setPointerShadowVisible(POINTER_SHADOW_VISIBLE);
        init(getInnerBounds().width, getInnerBounds().height);
        repaint(getInnerBounds());
    }
330677
public void clip(final long pX0, final long pY0, final long pX1, final long pY1) {
        if (!mPathMode) {
            if (isOnTheSameSideOut(pX0, pY0, pX1, pY1)) {
                return;
            }
        }
        if (isInClipArea(pX0, pY0)) {
            if (isInClipArea(pX1, pY1)) {
                nextVertex(pX0, pY0);
                nextVertex(pX1, pY1);
                return;
            }
            if (intersection(pX0, pY0, pX1, pY1)) {
                nextVertex(pX0, pY0);
                nextVertex(mOptimIntersection.x, mOptimIntersection.y);
                if (mPathMode) {
                    nextVertex(clipX(pX1), clipY(pY1));
                }
                return;
            }
            throw new RuntimeException("Cannot find expected mOptimIntersection for " + new RectL(pX0, pY0, pX1, pY1));
        }
        if (isInClipArea(pX1, pY1)) {
            if (intersection(pX0, pY0, pX1, pY1)) {
                if (mPathMode) {
                    nextVertex(clipX(pX0), clipY(pY0));
                }
                nextVertex(mOptimIntersection.x, mOptimIntersection.y);
                nextVertex(pX1, pY1);
                return;
            }
            throw new RuntimeException("Cannot find expected mOptimIntersection for " + new RectL(pX0, pY0, pX1, pY1));
        }
        // no point is on the screen
        int count = 0;
        if (intersection(pX0, pY0, pX1, pY1, mXMin, mYMin, mXMin, mYMax)) { // x mClipMin segment
            final PointL point = count ++ == 0 ? mOptimIntersection1 : mOptimIntersection2;
            point.set(mOptimIntersection);
        }
        if (intersection(pX0, pY0, pX1, pY1, mXMax, mYMin, mXMax, mYMax)) { // x mClipMax segment
            final PointL point = count ++ == 0 ? mOptimIntersection1 : mOptimIntersection2;
            point.set(mOptimIntersection);
        }
        if (intersection(pX0, pY0, pX1, pY1, mXMin, mYMin, mXMax, mYMin)) { // y mClipMin segment
            final PointL point = count ++ == 0 ? mOptimIntersection1 : mOptimIntersection2;
            point.set(mOptimIntersection);
        }
        if (intersection(pX0, pY0, pX1, pY1, mXMin, mYMax, mXMax, mYMax)) { // y mClipMax segment
            final PointL point = count ++ == 0 ? mOptimIntersection1 : mOptimIntersection2;
            point.set(mOptimIntersection);
        }
        if (count == 2) {
            final double distance1 = Distance.getSquaredDistanceToPoint(
                    mOptimIntersection1.x, mOptimIntersection1.y, pX0, pY0);
            final double distance2 = Distance.getSquaredDistanceToPoint(
                    mOptimIntersection2.x, mOptimIntersection2.y, pX0, pY0);
            final PointL start = distance1 < distance2 ? mOptimIntersection1 : mOptimIntersection2;
            final PointL end =  distance1 < distance2 ? mOptimIntersection2 : mOptimIntersection1;
            if (mPathMode) {
                nextVertex(clipX(pX0), clipY(pY0));
            }
            nextVertex(start.x, start.y);
            nextVertex(end.x, end.y);
            if (mPathMode) {
                nextVertex(clipX(pX1), clipY(pY1));
            }
            return;
        }
        if (count == 1) {
            if (mPathMode) {
                nextVertex(clipX(pX0), clipY(pY0));
                nextVertex(mOptimIntersection1.x, mOptimIntersection1.y);
                nextVertex(clipX(pX1), clipY(pY1));
            }
            return;
        }
        if (count == 0) {
            if (mPathMode) {
                nextVertex(clipX(pX0), clipY(pY0));
                final int corner = getClosestCorner(pX0, pY0, pX1, pY1);
                nextVertex(cornerX[corner], cornerY[corner]);
                nextVertex(clipX(pX1), clipY(pY1));
            }
            return;
        }
        throw new RuntimeException("Impossible mOptimIntersection count (" + count + ")");
    }
859288
public void showPointCloud(GrayF32 disparity, BufferedImage left,
							   Se3_F64 motion, DMatrixRMaj rectifiedK , DMatrixRMaj rectifiedR)
	{
		DisparityToColorPointCloud d2c = new DisparityToColorPointCloud();
		double baseline = motion.getT().norm();
		d2c.configure(baseline, rectifiedK, rectifiedR, new DoNothing2Transform2_F64(), controls.minDisparity, controls.maxDisparity);
		d2c.process(disparity,left);

		CameraPinhole rectifiedPinhole = PerspectiveOps.matrixToPinhole(rectifiedK,disparity.width,disparity.height,null);

		PointCloudViewer pcv = guiPointCloud;
		pcv.setCameraHFov(PerspectiveOps.computeHFov(rectifiedPinhole));
		pcv.setCameraToWorld(new Se3_F64());
		pcv.setTranslationStep(baseline/3);
		pcv.clearPoints();
		pcv.addCloud(d2c.getCloud(),d2c.getCloudColor());
		pcv.setDotSize(1);
		pcv.setTranslationStep(baseline/10);

		pcv.getComponent().setPreferredSize(new Dimension(left.getWidth(), left.getHeight()));

		BoofSwingUtil.invokeNowOrLater(()->{
			controls.setViews(4);
		});
	}
1090512
def segment_intersection1(start0, end0, start1, end1, s):
    """"""
    if NO_IMAGES:
        return

    line0 = bezier.Curve.from_nodes(stack1d(start0, end0))
    line1 = bezier.Curve.from_nodes(stack1d(start1, end1))
    ax = line0.plot(2)
    line1.plot(256, ax=ax)
    (x_val,), (y_val,) = line0.evaluate(s)
    ax.plot([x_val], [y_val], color="black", marker="o")
    ax.axis("scaled")
    save_image(ax.figure, "segment_intersection1.png")
991191
public void enableSrcPosCalculation(){
		calculateSrcPositions = true;
		final int len = sb.length();
		ib = new ArrayList<Integer>(len);
		for( int i=0; i<len; i++) ib.add( i );
	}
462790
public void addEnvelope(Envelope2D envSrc, boolean bReverse) {
		boolean bWasEmpty = m_pointCount == 0;

		startPath(envSrc.xmin, envSrc.ymin);
		if (bReverse) {
			lineTo(envSrc.xmax, envSrc.ymin);
			lineTo(envSrc.xmax, envSrc.ymax);
			lineTo(envSrc.xmin, envSrc.ymax);
		} else {
			lineTo(envSrc.xmin, envSrc.ymax);
			lineTo(envSrc.xmax, envSrc.ymax);
			lineTo(envSrc.xmax, envSrc.ymin);
		}

		closePathWithLine();
		m_bPathStarted = false;

		if (bWasEmpty && !bReverse) {
			_setDirtyFlag(DirtyFlags.DirtyIsEnvelope, false);// now we no(sic?)
																// the polypath
																// is envelope
		}
	}
831826
void add(Iterable<SGraphSegment> segments) {
		for (final SGraphSegment segment : segments) {
			this.segments.add(segment);
		}
	}