Finish measuring point X

@param string|null   $multiplePointLabel
@return void
192520
public function finish($multiplePointLabel = null)
    {
        $this->finishLastPoint();

        if($multiplePointLabel)
        {
            if( ! isset($this->multiPointStack[$multiplePointLabel]))
            	throw new \InvalidArgumentException("Can't finish multiple point '" . $multiplePointLabel . "'.");

            $point = $this->multiPointStack[$multiplePointLabel];
            unset($this->multiPointStack[$multiplePointLabel]);

            if($point->isActive()) {
                // Finish point
                $point->finish();

                // Trigger presenter listener
                $this->presenter->finishPointTrigger($point);
            }

            //
            $this->pointStack[] = $point;

        }
    }
90905
private MultiPoint asMultiPoint(List<List> coords, CrsId crsId) throws IOException {
        if (coords == null || coords.isEmpty()) {
            throw new IOException("A multipoint contains at least one point");
        }
        Point[] points = new Point[coords.size()];
        for (int i = 0; i < coords.size(); i++) {
            points[i] = asPoint(coords.get(i), crsId);
        }
        return new MultiPoint(points);
    }
438698
public function reset()
    {
        $this->closed = false;
        $this->points = array();
        $this->rewind();
        $this->numberOfPoints = 0;
        $this->diagonalPointXIndex = null;
        $this->diagonalPointYIndex = null;
    }
1278100
static boolean multiPointRelatePoint_(MultiPoint multipoint_a,
			Point point_b, double tolerance, String scl,
			ProgressTracker progress_tracker) {
		RelationalOperationsMatrix relOps = new RelationalOperationsMatrix();
		relOps.resetMatrix_();
		relOps.setPredicates_(scl);
		relOps.setPointPointPredicates_();

		Envelope2D env_a = new Envelope2D();
		multipoint_a.queryEnvelope2D(env_a);
		Point2D pt_b = point_b.getXY();

		boolean bRelationKnown = false;
		boolean b_disjoint = RelationalOperations.pointDisjointEnvelope_(pt_b,
				env_a, tolerance, progress_tracker);

		if (b_disjoint) {
			relOps.pointPointDisjointPredicates_();
			bRelationKnown = true;
		}

		if (!bRelationKnown) {
			boolean b_intersects = false;
			boolean b_multipoint_contained = true;
			double tolerance_sq = tolerance * tolerance;

			for (int i = 0; i < multipoint_a.getPointCount(); i++) {
				Point2D pt_a = multipoint_a.getXY(i);

				if (Point2D.sqrDistance(pt_a, pt_b) <= tolerance_sq)
					b_intersects = true;
				else
					b_multipoint_contained = false;

				if (b_intersects && !b_multipoint_contained)
					break;
			}

			if (b_intersects) {
				relOps.m_matrix[MatrixPredicate.InteriorInterior] = 0;

				if (!b_multipoint_contained)
					relOps.m_matrix[MatrixPredicate.InteriorExterior] = 0;
				else
					relOps.m_matrix[MatrixPredicate.InteriorExterior] = -1;

				relOps.m_matrix[MatrixPredicate.ExteriorInterior] = -1;
			} else {
				relOps.m_matrix[MatrixPredicate.InteriorInterior] = -1;
				relOps.m_matrix[MatrixPredicate.InteriorExterior] = 0;
				relOps.m_matrix[MatrixPredicate.ExteriorInterior] = 0;
			}
		}

		boolean bRelation = relationCompare_(relOps.m_matrix, scl);
		return bRelation;
	}
1076690
def multipointm(self, points):
        """"""
        shapeType = MULTIPOINTM
        points = [points] # nest the points inside a list to be compatible with the generic shapeparts method
        self._shapeparts(parts=points, shapeType=shapeType)
1062426
private static boolean multiPointCoverageMultiPoint_(
			MultiPoint _multipointA, MultiPoint _multipointB, double tolerance,
			boolean bPerformWithin, boolean bPerformEquals,
			boolean bPerformOverlaps, ProgressTracker progress_tracker) {
		boolean bPerformContains = false;
		MultiPoint multipoint_a;
		MultiPoint multipoint_b;

		if (_multipointA.getPointCount() > _multipointB.getPointCount()) {
			if (bPerformWithin) {
				bPerformWithin = false;
				bPerformContains = true;
			}

			multipoint_a = _multipointB;
			multipoint_b = _multipointA;
		} else {
			multipoint_a = _multipointA;
			multipoint_b = _multipointB;
		}

		AttributeStreamOfInt8 contained = null;

		if (bPerformEquals || bPerformOverlaps || bPerformContains) {
			contained = new AttributeStreamOfInt8(multipoint_b.getPointCount());

			for (int i = 0; i < multipoint_b.getPointCount(); i++)
				contained.write(i, (byte) 0);
		}

		Envelope2D env_a = new Envelope2D();
		Envelope2D env_b = new Envelope2D();
		Envelope2D envInter = new Envelope2D();
		multipoint_a.queryEnvelope2D(env_a);
		multipoint_b.queryEnvelope2D(env_b);
		env_a.inflate(tolerance, tolerance);
		env_b.inflate(tolerance, tolerance);
		envInter.setCoords(env_a);
		envInter.intersect(env_b);

		Point2D ptA = new Point2D();
		Point2D ptB = new Point2D();

		boolean bWithin = true; // starts off true by default

		QuadTreeImpl quadTreeB = InternalUtils.buildQuadTree(
				(MultiPointImpl) (multipoint_b._getImpl()), envInter);
		QuadTreeImpl.QuadTreeIteratorImpl qtIterB = quadTreeB.getIterator();
		double tolerance_sq = tolerance * tolerance;

		for (int vertex_a = 0; vertex_a < multipoint_a.getPointCount(); vertex_a++) {
			multipoint_a.getXY(vertex_a, ptA);

			if (!envInter.contains(ptA)) {
				if (bPerformEquals || bPerformWithin)
					return false;
				else {
					bWithin = false;
					continue;
				}
			}

			boolean bPtACovered = false;
			env_a.setCoords(ptA.x, ptA.y, ptA.x, ptA.y);
			qtIterB.resetIterator(env_a, tolerance);
			for (int elementHandleB = qtIterB.next(); elementHandleB != -1; elementHandleB = qtIterB
					.next()) {
				int vertex_b = quadTreeB.getElement(elementHandleB);
				multipoint_b.getXY(vertex_b, ptB);

				if (Point2D.sqrDistance(ptA, ptB) <= tolerance_sq) {
					if (bPerformEquals || bPerformOverlaps || bPerformContains)
						contained.write(vertex_b, (byte) 1);

					bPtACovered = true;

					if (bPerformWithin)
						break;
				}
			}

			if (!bPtACovered) {
				bWithin = false;

				if (bPerformEquals || bPerformWithin)
					return false;
			}
		}

		if (bPerformOverlaps && bWithin)
			return false;

		if (bPerformWithin)
			return true;

		for (int i = 0; i < multipoint_b.getPointCount(); i++) {
			if (contained.read(i) == 1) {
				if (bPerformOverlaps)
					return true;
			} else {
				if (bPerformEquals || bPerformContains)
					return false;
			}
		}

		if (bPerformOverlaps)
			return false;

		return true;
	}
560636
private function checkLinesBetweenDescriptionAndFirstAnnotation(
        int $startPointer,
        int $endPointer,
        ?Annotation $firstAnnotation
    ) {
        if ($firstAnnotation === null || $startPointer === $firstAnnotation->getStartPointer()) {
            return;
        }

        \preg_match('~(\\s+)$~', $this->tokens[$endPointer]['content'], $matches);

        $lines = $matches[1] ?? '';
        $lines .= TokenHelper::getContent(
            $this->phpcsFile,
            $endPointer + 1,
            $firstAnnotation->getStartPointer() - 1
        );

        $linesCount = $this->countLines($lines);

        if ($linesCount === 1) {
            return;
        }

        $this->phpcsFile->addError(
            \sprintf('Expected 1 lines between description and annotations, found %d.', $linesCount),
            $firstAnnotation->getStartPointer(),
            'LinesBetweenDescriptionAndFirstAnnotation'
        );
    }
1357941
function(curCoord, finalCoord) {
        this.logger.log("getNextX: " + curCoord + ", " + finalCoord);
        var t = this.thumb,
            thresh,
            tmp = [],
            nextCoord = null;

        if (curCoord[0] > finalCoord[0]) {
            thresh = t.tickSize - this.thumbCenterPoint.x;
            tmp = t.getTargetCoord( curCoord[0] - thresh, curCoord[1] );
            nextCoord = [tmp.x, tmp.y];
        } else if (curCoord[0] < finalCoord[0]) {
            thresh = t.tickSize + this.thumbCenterPoint.x;
            tmp = t.getTargetCoord( curCoord[0] + thresh, curCoord[1] );
            nextCoord = [tmp.x, tmp.y];
        } else {
            // equal, do nothing
        }

        return nextCoord;
    }
322657
private static boolean polylineTouchesMultiPoint_(Polyline polyline_a,
			MultiPoint multipoint_b, double tolerance,
			ProgressTracker progress_tracker) {
		// Quick rasterize test to see whether the the geometries are disjoint.
		if (tryRasterizedContainsOrDisjoint_(polyline_a, multipoint_b,
				tolerance, false) == Relation.disjoint) {
			return false;
		}

		SegmentIteratorImpl segIterA = ((MultiPathImpl) polyline_a._getImpl())
				.querySegmentIterator();

		Envelope2D env_a = new Envelope2D();
		Envelope2D env_b = new Envelope2D();
		Envelope2D envInter = new Envelope2D();
		polyline_a.queryEnvelope2D(env_a);
		multipoint_b.queryEnvelope2D(env_b);
		env_a.inflate(tolerance, tolerance);
		env_b.inflate(tolerance, tolerance);
		envInter.setCoords(env_a);
		envInter.intersect(env_b);

		QuadTreeImpl qtA = null;
		QuadTreeImpl quadTreeA = null;
        QuadTreeImpl quadTreePathsA = null;

		GeometryAccelerators accel = ((MultiPathImpl) (polyline_a._getImpl()))
				._getAccelerators();

		if (accel != null) {
			quadTreeA = accel.getQuadTree();
            quadTreePathsA = accel.getQuadTreeForPaths();
			if (quadTreeA == null) {
				qtA = InternalUtils.buildQuadTree(
						(MultiPathImpl) polyline_a._getImpl(), envInter);
				quadTreeA = qtA;
			}
		} else {
			qtA = InternalUtils.buildQuadTree(
					(MultiPathImpl) polyline_a._getImpl(), envInter);
			quadTreeA = qtA;
		}

		QuadTreeImpl.QuadTreeIteratorImpl qtIterA = quadTreeA.getIterator();

        QuadTreeImpl.QuadTreeIteratorImpl qtIterPathsA = null;
        if (quadTreePathsA != null)
            qtIterPathsA = quadTreePathsA.getIterator();

		Point2D ptB = new Point2D(), closest = new Point2D();
		boolean b_intersects = false;
		double toleranceSq = tolerance * tolerance;

		AttributeStreamOfInt8 intersects = new AttributeStreamOfInt8(
				multipoint_b.getPointCount());
		for (int i = 0; i < multipoint_b.getPointCount(); i++) {
			intersects.write(i, (byte) 0);
		}

		for (int i = 0; i < multipoint_b.getPointCount(); i++) {
			multipoint_b.getXY(i, ptB);

			if (!envInter.contains(ptB)) {
				continue;
			}

			env_b.setCoords(ptB.x, ptB.y, ptB.x, ptB.y);

            if (qtIterPathsA != null) {
                qtIterPathsA.resetIterator(env_b, tolerance);

                if (qtIterPathsA.next() == -1)
                    continue;
            }

			qtIterA.resetIterator(env_b, tolerance);

			for (int elementHandleA = qtIterA.next(); elementHandleA != -1; elementHandleA = qtIterA
					.next()) {
				int vertex_a = quadTreeA.getElement(elementHandleA);
				segIterA.resetToVertex(vertex_a);

				Segment segmentA = segIterA.nextSegment();
				double t = segmentA.getClosestCoordinate(ptB, false);
				segmentA.getCoord2D(t, closest);

				if (Point2D.sqrDistance(ptB, closest) <= toleranceSq) {
					intersects.write(i, (byte) 1);
					b_intersects = true;
					break;
				}
			}
		}

		if (!b_intersects) {
			return false;
		}

		MultiPoint boundary_a = (MultiPoint) (polyline_a.getBoundary());
		MultiPoint multipoint_b_inter = new MultiPoint();
		Point2D pt = new Point2D();

		for (int i = 0; i < multipoint_b.getPointCount(); i++) {
			if (intersects.read(i) == 0) {
				continue;
			}

			multipoint_b.getXY(i, pt);
			multipoint_b_inter.add(pt.x, pt.y);
		}

		return multiPointContainsMultiPointBrute_(boundary_a,
				multipoint_b_inter, tolerance);
	}
276259
private function handleMultiShipments($possibleMultiLabelObject) {
		if(is_array($possibleMultiLabelObject)) {
			$multiLabelArray = $possibleMultiLabelObject;

			foreach($multiLabelArray as &$singleLabel)
				$this->addLabelData(new LabelData($this->getVersion(), $singleLabel));
		} else
			$this->addLabelData(new LabelData($this->getVersion(), $possibleMultiLabelObject));
	}
625221
public function finishMultipart()
    {
        if ( isset( $this->parts[0] ) )
        {
            $this->report->setReadablePart( $this->parts[0] );
        }
        if ( isset( $this->parts[1] ) )
        {
            $this->report->setMachinePart( $this->parts[1] );
        }
        if ( isset( $this->parts[2] ) )
        {
            $this->report->setOriginalPart( $this->parts[2] );
        }
        $size = 0;
        foreach ( $this->report->getParts() as $part )
        {
            $size += $part->size;
        }
        $this->report->size = $size;
        return $this->report;
    }
1055315
public void set_point( int point, int tick, int ampl ) {
		if( point >= 0 && point < ticks.length ) {
			if( point == 0 ) {
				tick = 0;
			}
			if( point > 0 ) {
				if( tick < ticks[ point - 1 ] ) {
					/* Simple guess at where the point is supposed to be.*/
					tick += 256;
				}
				if( tick <= ticks[ point - 1 ] ) {
					System.out.println( "Envelope: Point not valid (" + tick + " <= " + ticks[ point - 1 ] + ")");
					tick = ticks[ point - 1 ] + 1;
				}
			}
			ticks[ point ] = tick;
			ampls[ point ] = ampl;
			point += 1;
			while( point < ticks.length ) {
				ticks[ point ] = ticks[ point - 1 ] + 1;
				ampls[ point ] = 0;
				point += 1;
			}
		}
	}
1307766
protected function finishLastPoint()
    {
        // Measurements are more accurate
        $stopTime = microtime(true);

        if($this->currentPoint)
        {
            // Get point
            $point = $this->currentPoint;

            if($point->isActive())
            {
                // Set query log items
                $this->setQueryLogItemsToPoint($point);

                // Check if message in label text
                $this->checkAndSetMessageInToLabel($point);

                // Finish point
                $point->setStopTime($stopTime);
                $point->finish();

                $this->pointStack[] = $point;

                // Trigger presenter listener
                $this->presenter->finishPointTrigger($point);
            }
        }
    }
1229650
private function toStringMultiPoint(array $multiPoint)
    {
        $strings = array();

        foreach ($multiPoint as $point) {
            $strings[] = $this->toStringPoint($point);
        }

        return implode(',', $strings);
    }
1027807
public function setPointer($charOffset)
    {
        if ($charOffset > $this->array_size) {
            $charOffset = $this->array_size;
        } elseif ($charOffset < 0) {
            $charOffset = 0;
        }
        $this->offset = $charOffset;
    }
476192
@Override
    public final void onCompleted(String pin) {
        resetStatus();
        if (isPinCorrect(pin)) {
            setResult(SUCCESS);
            finish();
        } else {
            setLabel(getString(R.string.message_invalid_pin));
        }
    }
473762
private static boolean multiPointWithinEnvelope_(MultiPoint multipoint_a,
			Envelope envelope_b, double tolerance,
			ProgressTracker progress_tracker) {
		Envelope2D env_a = new Envelope2D(), env_b = new Envelope2D();
		multipoint_a.queryEnvelope2D(env_a);
		envelope_b.queryEnvelope2D(env_b);

		if (!envelopeInfContainsEnvelope_(env_b, env_a, tolerance))
			return false;

		if (env_b.getHeight() <= tolerance && env_b.getWidth() <= tolerance)
			return envelopeEqualsEnvelope_(env_a, env_b, tolerance,
					progress_tracker); // treat as point

		if (env_b.getHeight() <= tolerance || env_b.getWidth() <= tolerance) {// treat
																				// as
																				// line

			boolean b_interior = false;

			Envelope2D env_b_deflated = new Envelope2D(), env_b_inflated = new Envelope2D();
			env_b_deflated.setCoords(env_b);
			env_b_inflated.setCoords(env_b);

			if (env_b.getHeight() > tolerance)
				env_b_deflated.inflate(0, -tolerance);
			else
				env_b_deflated.inflate(-tolerance, 0);

			env_b_inflated.inflate(tolerance, tolerance);

			Point2D pt_a = new Point2D();

			for (int i = 0; i < multipoint_a.getPointCount(); i++) {
				multipoint_a.getXY(i, pt_a);

				if (!env_b_inflated.contains(pt_a))
					return false;

				if (env_b.getHeight() > tolerance) {
					if (pt_a.y > env_b_deflated.ymin
							&& pt_a.y < env_b_deflated.ymax)
						b_interior = true;
				} else {
					if (pt_a.x > env_b_deflated.xmin
							&& pt_a.x < env_b_deflated.xmax)
						b_interior = true;
				}
			}

			return b_interior;
		}

		// treat as area

		boolean b_interior = false;

		Envelope2D env_b_deflated = new Envelope2D(), env_b_inflated = new Envelope2D();
		env_b_deflated.setCoords(env_b);
		env_b_inflated.setCoords(env_b);
		env_b_deflated.inflate(-tolerance, -tolerance);
		env_b_inflated.inflate(tolerance, tolerance);

		Point2D pt_a = new Point2D();

		// we loop to find a proper interior intersection (i.e. something inside
		// instead of just on the boundary)
		for (int i = 0; i < multipoint_a.getPointCount(); i++) {
			multipoint_a.getXY(i, pt_a);

			if (!env_b_inflated.contains(pt_a))
				return false;

			if (env_b_deflated.containsExclusive(pt_a))
				b_interior = true;
		}

		return b_interior;
	}