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

A 2D representation of a segment in the Cartesian space. More...

Inheritance diagram for oevislib_net.Geometry.Segment2D:

Public Member Functions

bool Equals (Segment2D other)
override bool Equals (object obj)
override int GetHashCode ()
override object Clone ()
Segment2D Features
See also
Features
Point2D GetCenter ()
 Returns the center of the segment.
float GetLength ()
 Returns the segment length.
Line2D GetBisector ()
 Returns the segment bisector.
Vector2D GetNormalVector (bool inReverse)
 Returns a unary vector with direction normal to the segment.
Line2D GetLine ()
 Computes the line containing the segment.
Vector2D GetVector ()
 Returns the corresponding vector.
float GetOrientation (AngleRange inAngleRange)
 Returns the segment direction normalized to the provided range.
Segment2D Normalizations
void NormalizeOrientation (float inBaseOrientation)
 Changes the segment orientation based on the base angle.
void NormalizeOrientation (Point2D inReferencePoint)
 Changes the segment orientation based on the distance with the provided point.
void NormalizeOrientation (Axis inAxis)
 Changes the segment orientation using the coordinates on the selected axis.
Segment2D Spatial Transforms
Segment2D Translate (Vector2D inDelta, TranslateAlignment inDeltaAlignment, bool inInverse)
 Translates the segment using the provided vector.
Segment2D Rotate (float inAngle, Optional< Point2D > inCenter=null, bool inInverse=false)
 Rotates the segment around a center point.
Conditional< Segment2DTrim (Box inBox)
 Trims the segment so that it is entirely contained in a box.
Conditional< Segment2DTrim (Rectangle2D inRectangle)
 Trims the segment so that it is entirely contained in a rectangle.
Conditional< Segment2DTrim (Circle2D inCircle)
 Trims the segment so that it is entirely contained in a circle.
Segment2D Align (UCS2D inAlignment, bool inInverse)
 Aligns the segment to a new coordinate system.
Segment2D Resize (float inNewLength, float inAnchor)
 Changes the length of the segment while keeping an anchor point fixed.
Segment2D ResizeRelative (float inDelta, float inAnchor)
 Increases or decreases the length of the segment while keeping an anchor point fixed.
Segment2D Rescale (float inScale=1.0f, Optional< Point2D > inReferencePoint=null, bool inInverse=false)
 Rescales the segment using a scaling factor.
void Reverse ()
 Swaps the segment endpoints.
Array< Segment2DSplit (int inCount)
 Splits the segments in multiple ones, each with the same length.
Segment2D Relations
See also
Relations
bool Contains (Point2D inPoint, float inError)
 Tests if a point is part of the segment.

Static Public Member Functions

static bool operator== (Segment2D inSegment2D1, Segment2D inSegment2D2)
static bool operator!= (Segment2D inSegment2D1, Segment2D inSegment2D2)

Properties

Point2D P1 = new Point2D(0.0f, 0.0f) [get, set]
Point2D P2 = new Point2D(0.0f, 0.0f) [get, set]

Segment2D Basics

See also
Basics
static Segment2D Deserialize (ByteBuffer inBuffer)
 De-serialize a Segment2D buffer.
 Segment2D ()
 Creates a new Segment2D object where both points are (0, 0).
 Segment2D (Point2D inPoint1, Point2D inPoint2)
 Creates a new Segment2D object using the provided points.
 Segment2D (float inX1, float inY1, float inX2, float inY2)
 Creates a new Segment2D using the provided points coordinates.
 Segment2D (Point2D inPoint, float inDirection, float inLength, float inPointAnchor=0.5f)
 Creates a new Segment2D given direction, length and a contained point.
bool IsHorizontal ()
 Returns true if the segment is horizontal, false otherwise.
bool IsVertical ()
 Returns true if the segment is vertical, false otherwise.
bool HasSlope ()
 Returns true if the segment is neither horizontal nor vertical, false otherwise.
float GetSlope ()
 Returns the slope of the segment.
float GetDirection ()
 Returns the segment direction.
ByteBuffer Serialize ()
 Serializes the object.

Detailed Description

A 2D representation of a segment in the Cartesian space.