oevislib_net  0.14.3.0
Loading...
Searching...
No Matches

Path struct, based on an Array of Point2D. More...

Inheritance diagram for oevislib_net.Path:

Public Member Functions

 Path ()
 Creates an empty Path.
 Path (bool inClosed)
 Creates an empty Path, specifying if it's closed or not.
 Path (int inSize, bool inClosed=false)
 Creates a new Path with the provided size.
 Path (Segment2D inSegment)
 Creates a new Path from a Segment2D (using its two points).
 Path (Array< Point2D > inPoints, bool inClosed)
 Creates a new Path from an array of points.
int GetSize ()
 Returns the number of points contained in the path.
ByteBuffer Serialize ()
 Serialize the Path object using flatbuffers.
void Append (Point2D inPoint)
 Appends a point to the end of the path.
void Append (Array< Point2D > inPoints)
 Appends an array of points to the end of the path.
void Remove (int inIndex, bool inInverse)
 Removes a point from the path.
bool IsClosed ()
 Returns if the path is closed.
Point2D GetPoint (int inIndex, bool inInverse)
 Returns a specific point from the Path.
Point2D GetPoint (float inIndex)
 Returns the linear interpolation of two consecutive path points.
Array< Point2DGetData ()
 Returns the pointer to the first point of the path.
void SetClosed (bool inClosed)
 Sets the path as open or closed based on the input.
void SetSize (int inSize)
void SetPoint (Point2D inPoint, int inIndex, bool inInverse)
 Changes the value of the point at the provided index.
Point2D GetPointAtDistance (float inDistance, bool inInverse)
 Returns a point at a certain distance from the path starting point.
Segment2D GetSegment (int inIndex, bool inInverse)
 Returns the segment starting with the point at the provided index and ending with the following point on the path.
Path ExtractSubpath (int inStart, int inPointCount)
 Extracts a new path starting from the provided point.
bool IsEmpty ()
 Checks if the path is empty.
bool IsPolygon ()
 Checks if the path can be considered a polygon.
Path Append (Path inPath, bool inClose)
 Concatenates two open paths.
Array< Segment2DGetSegments ()
 Converts the path to an array of Segment2D objects.
Point2D GetMassCenter ()
 Computes the path's mass center.
float GetLength ()
 Computes the length of the path.
Point2D GetFirstPoint ()
 Returns the first path point.
Point2D GetLastPoint ()
 Returns the last path point.
Profile GetTurnAngleProfile ()
 Computes the turning angles for each point of the path.
float GetAverageTurnAngle ()
 Computes the average turning angle (per unit of length) between consecutive segments of the path.
Array< float > GetTurnAngleLocalMaxima (TurnAngleDirection inTurnAngleDirection, float inMinTurnAngle, float inMinDistance, float inSmoothingStdDev, Optional< Array< int > > outIndices, Optional< Array< Point2D > > outPoints, Optional< Profile > outTurnAngleProfile)
 Computes the local maxima of the path's turn angle profile.
float GetMaxTurnAngle (TurnAngleDirection inTurnAngleDirection, Optional< int > outIndex, Optional< Point2D > outPoint)
 Computes the maximum turn angle between the path's consecutive segments.
Circle2D GetBoundingCircle ()
 Computes the smallest circle that contains the entire path.
Box GetBoundingBox ()
 Computes the smallest rectangle box that contains the entire path.
Rectangle2D GetBoundingRect (RectangleOrientation inRectangleOrientation)
 Computes the smallest rectangle that contains the entire path.
Segment2D GetDiameter ()
 Finds the longest segment connecting two points of the path.
void GetCaliperDiameters (Optional< Segment2D > outMinDiameter=null, Optional< Segment2D > outMaxDiameter=null)
 Computes the longest and the shortest segments between two points of the path.
Path GetConvexHull ()
 Computes the path's convex hull.
bool SelfIntersects (Optional< Array< Point2D > > outPoints, Optional< Array< int > > outFirstSegmentIndices, Optional< Array< int > > outSecondSegmentIndices)
 Tests if the path has self-intersections.
bool IntersectsWith (Path inPath, Optional< float > outOverlapArea=null)
 Check if the Path (closed) is intersecting with the given Path (closed).
Path Shorten (float inMaxDistance)
 Shortens the path, reducing the number of points but preserving the shape.
Path SpaceRegularly (float inStep)
 Creates a new path with points equally spaced and lying on the input path.
Path GetBicircularCurve (int inInterpolationPoints)
 Builds a bi-circular curve starting from the path's points.
Path RemoveSelfIntersections ()
 Removes the self-intersections of the path.
void Extend (float inExtraLengthOnFirst, float inExtraLengthOnLast)
 Resizes the segments at the path's ends.
Path ExtractLongestSubpath (float inMaxTurnAngle)
 Creates a new path selecting the longest segment sequence which turns at most the angle provided.
Path Stretch (Point2D inNewStartingPoint, Point2D inNewEndingPoint)
 Aligns the path so that its endpoints match the two provided ones.
Array< PathSplit (Path inPath)
 Splits the path at the intersections with the provided object.
Array< PathSplit (Segment2D inSegment)
 Splits the path at the intersections with the provided object.
Array< PathSplit (Line2D inLine)
 Splits the path at the intersections with the provided object.
Path Smooth (int inKernelRadius)
 Smooths a path by applying a mobile average to its points.
Path GaussianSmooth (float inStdDev, float inKernelRelativeSize)
 Smooths a path applying a Gaussian kernel to its points.
Path Translate (Vector2D inDelta, TranslateAlignment inTranslateAlignment, bool inInverse)
 Translates each point of the path using the provided vector.
Path Rotate (float inAngle, Optional< Point2D > inCenter=null, bool inInverse=false)
 Rotates the entire path clockwise around a center point.
Path Crop (Box inBox, TrimPathMethod inTrimPathMethod)
 Crops the path to the provided rectangle box.
Path Crop (Rectangle2D inRectangle, TrimPathMethod inTrimPathMethod)
 Crops the path to the provided rectangle.
Path Rescale (float inScale, Optional< Point2D > inReferencePoint=null, bool inInverse=false)
 Rescales all the path's points distance with respect to a reference point.
Path Align (UCS2D inAlignment, bool inInverse)
 Moves the path to a new coordinate system.
void Reverse ()
 Reverses path's points ordered.
void Transpose ()
 Flips x and y coordinates of each path's point.
Path Shift (float inDistance, ShiftDirection inDirection)
 Shifts the points of the path by a given distance in a specified direction.
Profile ProjectsOn (Line2D inLine, Optional< Array< Segment2D > > outProjectionSegments=null)
 Project each point on the provided line.
Conditional< PathInflate (float inMargin, float inMaxPointDisplacement)
 Enlarges the path with a given margin.
void NormalizeOrientation ()
 Normalize the polygon orientation based on the axis.
float GetMoment (PolygonMoment inMomentType, bool inCentral)
 Computer the polygon second-order moment.
float GetNormMoment (PolygonMoment inMomentType, bool inCentral)
 Computer the polygon second-order normalized moment.
float GetArea ()
 Computes the polygon area.
Point2D GetPolygonMassCenter ()
 Computes the polygon mass center.
float GetOrientation ()
 Computes the polygon orientation as an angle.
float GetElongation ()
 Computes the polygon elongation.
Segment2D GetMinorEllipticAxis ()
 Computes the path minor elliptical axis.
Segment2D GetMajorEllipticAxis ()
 Computes the path major elliptical axis.
float GetCircularity (CircularityMeasure inCircularityMeasure)
 Computes the path circularity, defined as the polygon area divided by the area of the circle having the same provided feature.
float GetConvexity ()
 Computes the path convexity, defined as the polygon area normalized to the area of the convex hull.
float GetRectangularity ()
 Computes the path rectangularity, defined as the polygon area divided by the area of its bounding rectangle.
Circle2D GetInscribedCircle ()
 Computes the path's inscribed circle with the maximal area.
bool Contains (Point2D inPoint)
 Checks if a point is contained inside the polygon.
bool IsConvex ()
 Checks if the polygon is convex.
bool Contains (Array< Point2D > inPoints, Optional< Array< bool > > outIsContainedArray, Optional< Array< Point2D > > outContainedPoints)
 For each point in the array, checks if it is contained in the polygon.
bool Contains (Path inSubPolygon)
 Checks if the provided path is contained inside the calling object.
Path Copy ()
bool Equals (Path other)
override bool Equals (object obj)
override int GetHashCode ()
override object Clone ()
override void Dispose ()

Static Public Member Functions

static bool operator== (Path inPath1, Path inPath2)
static bool operator!= (Path inPath1, Path inPath2)
static Path Deserialize (ByteBuffer inBuffer)
 De-serialize a Path buffer.
static Path FromArc (Arc2D inArc, int inPointCount)
 Creates an open path starting from the provided arc object.
static Path FromCircle (Circle2D inCircle, int inPointCount)
 Creates a closed path from the provided circle object.
static Path FromEllipse (Ellipse2D inEllipse, int inPointCount)
 Creates a closed path from the provided ellipse object.
static Path FromRectangle (Rectangle2D inRectangle)
 Creates a closed path using the four vertices of the provided rectangle.
static Path FromSegment (Segment2D inSegment, int inPointCount)
 Creates an open path using the provided segment object.
static Array< PathExtractOpenPaths (Array< Path > inPaths)
 Selects open paths from an input array.
static Array< PathExtractClosedPaths (Array< Path > inPaths)
 Selects closed paths from an input array.
static Array< PathExtractExternalPaths (Array< Path > inPaths, Point2D inCenterPoint, float inTolerance)
 Selects paths that do not obstruct the external visibility of other objects, given a reference point.
static Array< PathExtractInternalPaths (Array< Path > inPaths, Point2D inCenterPoint, float inTolerance)
 Selects paths that are visible from a reference point.
static Array< PathExtractPaths (Array< Path > inPaths, PathFeature inPathFeature, PathFilter inPathFilter, Optional< float > inMinValue, Optional< float > inMaxValue, Optional< Array< Path > > outRejected, Optional< Array< Path > > outBelow, Optional< Array< Path > > outAbove, Optional< Array< float > > outValues)
 Filters an array of paths based on the provided feature.
static void MakePathConditional (Path inPath, PathFeature inFeature, Optional< float > inMinimum, Optional< float > inMaximum, Conditional< Path > outConditionalPath)
 Computes a path feature, checks whether its value is in range and creates an optional path on this basis.
static Array< PathSortPaths (Array< Path > inPaths, PathFeature inPathFeature, PathFilter inPathFilter, SortingOrder inSortingOrder, Optional< Array< float > > outSortedValues)
 Returns the input path array sorted based on the requested feature.
static Path FindMinPath (Array< Path > inPaths, PathFeature inPathFeature, Optional< float > outValue, Optional< int > outIndex)
 Returns the path with the minimum value of the requested feature.
static Path FindMaxPath (Array< Path > inPaths, PathFeature inPathFeature, Optional< float > outValue, Optional< int > outIndex)
 Returns the path with the maximum value of the requested feature.
static Path ConcatenatePaths (Array< Path > inPaths, bool inClose)
 Concatenates an array of paths.
static Path MakeAveragePath (Path inPath1, Path inPath2)
 Computes a new path averaging each point of two objects with equal size and type.
static Array< PathConnectAdjacentPaths (Array< Path > inPaths, float inMaxDistance, float inMaxAngle, Optional< float > inMaxDeviation, float inExcessTrim, Optional< float > inEndingLength, PathJoiningMethod inJoiningMethod, PathJoiningAngleMeasure inAngleMeasure, bool inIgnorePathEndsOrder, float inMinPathLength, Optional< Array< Path > > outJoinedPaths)
 Joins the paths of an input array using the provided parameters.
static Array< Point2DExtractPoints (Array< Path > inPaths)
 Extracts all the points from a group of paths.
static void SegmentPath (Path inPath, float inStdDev, float inMaxDeviation, PathSegmentationMode inSegmentationMode, float inMaxArcRadius, Optional< Array< Path > > outStraight, Optional< Array< Path > > outArciform, Optional< Array< Segment2D > > outSegments, Optional< Array< Arc2D > > outArcs)
 Splits a path into parts that can be approximated as segments (or arcs, if specified).
static Array< Point2DIntersect (Path inPath1, Path inPath2, Optional< Array< int > > outSegmentIndices1, Optional< Array< int > > outSegmentIndices2)
 Returns the intersection points of two paths.
static Array< Point2DIntersect (Path inPath, Segment2D inSegment, Optional< Array< int > > outSegmentIndices=null)
 Returns the intersection points between a path and a segment.
static Array< Point2DIntersect (Path inPath, Line2D inLine, Optional< Array< int > > outSegmentIndices=null)
 Returns the intersection points between a path and a line.
static float Distance (Path inPath, Point2D inPoint, float inResolution, Optional< Segment2D > outConnectingSegment)
 Measures the distance between a point and its projection on the provided path.
static Profile DistanceProfile (Path inPath, Point2D inPoint, float inResolution, Optional< Array< Segment2D > > outConnectingSegments)
 Computes distances between all the path's points and the provided reference point.
static float Distance (Path inPath, Line2D inLine, float inResolution, Optional< Segment2D > outConnectingSegment)
 Computes the minimum distance between a path and a line.
static Profile DistanceProfile (Path inPath, Line2D inLine, float inResolution, Optional< Array< Segment2D > > outConnectingSegments)
 Computes distances between all the path's points and the provided reference line.
static float Distance (Path inPath1, Path inPath2, PathDistanceMode inDistanceMode, float inResolution, Optional< Segment2D > outConnectingSegment)
 Computes the smallest distance between two paths.
static Profile DistanceProfile (Path inPath1, Path inPath2, PathDistanceMode inDistanceMode, float inResolution, Optional< Array< Segment2D > > outConnectingSegments)
 Computes distances between all points of two paths.
static float DistanceMax (Path inPath1, Path inPath2, PathDistanceMode inDistanceMode, float inResolution, Optional< Segment2D > outConnectingSegment)
 Computes the maximum distance from two paths.
static void TranslatePaths (Array< Path > ioPaths, Vector2D inDelta, TranslateAlignment inTranslateAlignment, bool inInverse)
 Translates each path of the provided array.
static void RotatePaths (Array< Path > ioPaths, float inAngle, Optional< Point2D > inCenter=null, bool inInverse=false)
 Rotates each path of the provided array.
static void CropPaths (Array< Path > ioPaths, Box inBox, TrimPathMethod inTrimPathMethod)
 Crops each path of the provided array.
static void CropPaths (Array< Path > ioPaths, Rectangle2D inRectangle, TrimPathMethod inTrimPathMethod)
 Crops each path of the provided array using the provided rectangle.
static void RescalePaths (Array< Path > ioPaths, float inScale, Optional< Point2D > inReferencePoint, bool inInverse)
 Rescales each path of the provided array.
static void AlignPaths (Array< Path > ioPaths, UCS2D inAlignment, bool inInverse)
 Aligns each path of the provided array.

Properties

Point2D this[int i] [get, set]

Detailed Description

Path struct, based on an Array of Point2D.