Min Max2D
Class full path: NemAll_Python_Geometry.MinMax2D
Representation class for 2D MinMax box.
Attributes
Max: Point2D
property
writable
Get maximum point
Min: Point2D
property
writable
Get minimum point
SizeX: float
property
writable
Get the size of the box in the X direction
SizeY: float
property
writable
Get the size of the box in the Y direction
Functions
Deflate
overload
Deflate(x, y)
Deflate in x and y axis.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x
|
float
|
|
required |
y
|
float
|
|
required |
Deflate(size)
Deflate in x,y axis concurrently.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
size
|
float
|
|
required |
Get()
Get minimum and maximum point
Returns:
Type | Description |
---|---|
Point2D
|
minimum point, |
Point2D
|
maximum point) |
GetCenter()
Get box center point
Returns:
Type | Description |
---|---|
Point2D
|
center point |
GetMax()
Get maximum point
Returns:
Type | Description |
---|---|
Point2D
|
maximum point |
GetMin()
Get minimum point
Returns:
Type | Description |
---|---|
Point2D
|
minimum point |
GetSizeX()
Get the size of the box in the X direction
Returns:
Type | Description |
---|---|
float
|
delta X value |
GetSizeY()
Get the size of the box in the Y direction
Returns:
Type | Description |
---|---|
float
|
delta Y value |
Inflate
overload
Inflate(x, y)
ame Inflate and deflate minmax box
Inflate in x and y axis.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x
|
float
|
|
required |
y
|
float
|
|
required |
Inflate(size)
Inflate in x,y axis concurrently.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
size
|
float
|
|
required |
IsContaining
overload
IsContaining(box)
Is box inside this box
Parameters:
Name | Type | Description | Default |
---|---|---|---|
box
|
MinMax2D
|
Potentially contained box |
required |
Returns:
Type | Description |
---|---|
bool
|
true, if is inside, otherwise false |
IsContaining(point)
Is point inside this box
Parameters:
Name | Type | Description | Default |
---|---|---|---|
point
|
Point2D
|
point in world coordinate system |
required |
Returns:
Type | Description |
---|---|
bool
|
true, if is inside, otherwise false |
IsValid()
Test if box is valid
Returns:
Type | Description |
---|---|
bool
|
true, if box valid, otherwise false |
Overlaps(box)
Does box overlap this box
Parameters:
Name | Type | Description | Default |
---|---|---|---|
box
|
MinMax2D
|
Box |
required |
Returns:
Type | Description |
---|---|
bool
|
true, if boxes overlap, otherwise false |
Reset()
Set min point to [DBL_MAX,DBL_MAX] and max point to [-DBL_MAX,-DBL_MAX]
Set(min, max)
Set minimum and maximum point
Parameters:
Name | Type | Description | Default |
---|---|---|---|
min
|
Point2D
|
minimum point |
required |
max
|
Point2D
|
maximum point |
required |
SetMax(max)
Set maximum point
Parameters:
Name | Type | Description | Default |
---|---|---|---|
max
|
Point2D
|
maximum point |
required |
SetMin(min)
Set minimum point
Parameters:
Name | Type | Description | Default |
---|---|---|---|
min
|
Point2D
|
minimum point |
required |
ToPolygon2D()
Creates a 2D polygon from the minmax box the corners of MinMax.
Returns:
Type | Description |
---|---|
bool
|
true, if the polygon has been created successfully, otherwise false, |
Polygon2D
|
polygon created from the minmax box) |
__add__(minmax)
Expand MinMax2D box.
Expands the MinMax2D box by the box given in parameter minmax
Parameters:
Name | Type | Description | Default |
---|---|---|---|
minmax
|
MinMax2D
|
MinMax2D to be added |
required |
Returns:
Type | Description |
---|---|
MinMax2D
|
minmax box. |
__eq__(minmax)
Comparison of minmax objects without tolerance.
Be careful, this method work without tolerance!
Parameters:
Name | Type | Description | Default |
---|---|---|---|
minmax
|
MinMax2D
|
Compared minmax. |
required |
Returns:
Type | Description |
---|---|
object
|
True when minmax objects are equal, otherwise false. |
__getitem__(index)
Get the corners of MinMax. Corner index (0-left bottom, 1-right bottom, 2-right top, 3-left top)
This method is checked and throwing Geometry::Exception when index is out of range.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
index
|
int
|
|
required |
Returns:
Type | Description |
---|---|
Point2D
|
corner as Point2D in world coordinate system. |
__iadd__
overload
__iadd__(minmax)
Expand MinMax2D box.
Expands the MinMax2D box by the box given in parameter minmax
Parameters:
Name | Type | Description | Default |
---|---|---|---|
minmax
|
MinMax2D
|
MinMax2D to be added |
required |
Returns:
Type | Description |
---|---|
MinMax2D
|
minmax box. |
__iadd__(point)
Expand MinMax2D box.
Expands the MinMax2D box by the Point2D given in parameter point
Parameters:
Name | Type | Description | Default |
---|---|---|---|
point
|
Point2D
|
Point2D to be added |
required |
Returns:
Type | Description |
---|---|
MinMax2D
|
minmax box. |
__iadd__(box)
Expand MinMax2D box.
Expands the MinMax2D box by the bounding box given in parameter box
Parameters:
Name | Type | Description | Default |
---|---|---|---|
box
|
BoundingBox2D
|
Bounding box to be added |
required |
Returns:
Type | Description |
---|---|
MinMax2D
|
minmax box. |
__init__
overload
__init__()
initialize
__init__(min, max)
Set constructor
Initialize MinMax box with given MIN and MAX points.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
min
|
Point2D
|
minimum point |
required |
max
|
Point2D
|
maximum point |
required |
__init__(point)
Set constructor
Initialize MinMax box with given point.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
point
|
Point2D
|
point |
required |
__init__(minmax)
Copy constructor.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
minmax
|
MinMax2D
|
MinMax2D to be copied |
required |
__init__(minmax)
Copy constructor.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
minmax
|
MinMax3D
|
the MinMax3D box to be copied into MinMax2D. Only X and Y values will be copied |
required |
__repr__()
Convert to string