Extents2d Class

Class that describes the extents of another object as an axis aligned box.
Public Class Extents2d 
Inherits Geometry2d
This language is not supported or no code example is available.
public class Extents2d : Geometry2d
This language is not supported or no code example is available.
public ref class Extents2d : public Geometry2d^
This language is not supported or no code example is available.
public class Extents2d 
extends Geometry2d
This language is not supported or no code example is available.
Name Description
Public constructor Extents2d() Constructor. Creates a new, empty extent object.
Public constructor Extents2d(Extents2d) Copy constructor.
Public constructor Extents2d(Point2d, Point2d) Creates an extent object given two opposite corners of it by two points.
Public constructor Extents2d(double, double, double, double) Creates an extent object given two opposite corners of it by four real numbers x1,y1,x2,y2.
Top
Name Description
Public property Area Gets the area of the extent. If the box is empty 0.0 is gotten.
Public property Bottom Gets or sets the bottom of the extent.
Public property BottomLeft Gets a new point at the bottom left corner of this extent. If the extent is empty the result is undefined.
Public property BottomMid
Public property BottomRight Gets a new point at the bottom right corner of this extent. If the extent is empty the result is undefined.
Public property Center Returns the center point of this extent.
Public property Diagonal Gets the length of the diagonal
Public property Extents Returns the extents of this extent (this function exists for inheritance purposes). Simply returns a new extent that is a copy of this one.
Public property Height Gets the height of the extent box. If the box is empty 0.0 is gotten.
Public property IsCorrupt
Public property Left Gets or sets the left side of the extent.
Public property Length Gets the length/circumference of the extent. If the box is empty 0.0 is gotten.
Public property MidLeft
Public property MidRight
Public property Right Gets or sets the right side of the extent.
Public property Top Gets or sets the top of the extent.
Public property TopLeft Gets a new point at the top left of this extent. If the extent is empty the result is undefined.
Public property TopMid
Public property TopRight Gets a new point at the top right of this extent. If the extent is empty the result is undefined.
Public property Valid Returns true if this extent is valid (not empty).
Public property Width Gets the width of the extent box. If the box is empty 0.0 is gotten.
Top
Methods
 
Name Description
Public method Append(Extents2d) Grows the box to include another extent. If the appended extent appended is empty, nothing happens. If this extent is empty, its is set to equal the one appended.
Public method Append(Point2d) Grows the extent to include a point.
Public method Clear() Clears the box (makes it 'empty')
Public method Contains(Extents2d) Checks if an Extents2d is totally inside this extent.
Public method Contains(Point2d) Checks if a point is inside this extent.
Public method Distance(Point2d, bool) Computes the minimum distance from a point to circumference of this extent.
Public method Distance(Point2d) Computes the minimum distance from a point to circumference of this extent.
Public method GetOverlap(Extents2d)
Public method Mirror(Point2d, Point2d) Mirrors the extents in-place. This is done by mirroring the bottom left and the top right points and redefinig the box by theese two points.
Public method Offset(double) Offsets the extent box with a specified distance in-place. A posetive offset will make the box bigger, and a negative will make it smaller. If the offset is less than -(width/2), the box will have a zero area (disappear)
Public method OverlapArea(Extents2d) Calculates the overlapping area or 0 if no overlap
Public method Overlaps(Extents2d) Checks if this extent overlaps another extent. If any of the two extents is empty they never overlap. Returns true if the two extents are NOT totally separated. Extents are viewed as 'solids'.
Public method Rotate(double) Rotates this extent in-place around world origo. Since an extent is always axis aligned, this is done by definig a new extent area with the rotated lower left and upper right corners of this extent.
Public method Rotate(double, Point2d) Rotates this extent in-place around a given point. Since an extent is always axis aligned, this is done by definig a new extent area with the rotated lower left and upper right corners of this extent.
Public method Scale(double) Scales this extent in-place using world origo for scaling center.
Public method Scale(double, Point2d) Scales this extent in-place using a given scaling center.
Public method Split(Extents2d)
Public method ToRegion(double) Converts this extent to a region representing it.
Public method ToString() Creates a string representation of the extent suitable for debugging.
Public method Transform(Matrix2d) Transforms the extents in-place with a matrix. Since the extents is axis aligned, rotating it will give a result of rotating the lower-left and upper-right corner and building a new box with thoose points.
Public method Translate(double, double) Translates this extent by a given deltax and delta y.
Public method WriteAutoCADScript(StreamWriter, int) Writes text to a stream, that can be loaded as a script into autocad.
Top

.NET Framework

Supported in: 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8

In this article

Definition