Generic 2D sub-region object in memory. More...
#include <mi32/region2d.h>
Generic 2D sub-region object in memory.
The sub-region can be represented by either a single rectangle or as a polygon and a list of zero or more islands. All POLYLINE's stored in the SUBREGION are closed.
| typedef POLYLINELIST::CONST_ITERATOR SUBREGION2D::CONST_ITERATOR |
| SUBREGION2D::SUBREGION2D | ( | ) |
Default Constructor.
| SUBREGION2D::SUBREGION2D | ( | const SUBREGION2D & | rhs | ) |
Copy Constructor.
| SUBREGION2D::~SUBREGION2D | ( | ) |
Destructor.
Assigns the sub-region to the passed in polygon This will clear any existing information in 'this'.
| void SUBREGION2D::AssignValidated | ( | const POLYLINELIST & | PolygonList | ) |
Assigns the sub-region to the passed in polygon list.
Assumes that the first polygon is the shell and the rest are islands. A validated polygon is a polygon that does not intersect itself. This will clear any existing information in 'this'
| void SUBREGION2D::AssignValidated | ( | const POLYLINE & | Polygon | ) |
Assigns the sub-region to the passed in polygon.
A validated polygon is a polygon that does not intersect itself. This will clear any existing information in 'this'
| CONST_ITERATOR SUBREGION2D::Begin | ( | ) | const [inline] |
Get the beginning of the list of POLYLINE's.
The first item is the shell polygon, the rest following are islands.
| void SUBREGION2D::Clear | ( | ) |
Clear the sub-region.
| int SUBREGION2D::ClipLine | ( | POLYLINE & | PolyLine, | |
| POLYLINE::CLIP & | ClipTarget, | |||
| CLIPMODE | ClipMode = CLIPMODE_Inside | |||
| ) | const |
Clip a polyline to a sub-region, call the ClipTarget for each segment.
| double SUBREGION2D::ComputeArea | ( | ) | const |
Compute the sub-region area in sub-region units.
| double SUBREGION2D::ComputeAreaNoIslands | ( | ) | const |
Compute the sub-region area in sub-region units but do not exclude islands in the calculation.
| double SUBREGION2D::ComputeCentroid | ( | DPOINT3D & | centroid | ) | const |
Compute centroid of subregion.
| centroid | Centroid returned |
| double SUBREGION2D::ComputePerimeter | ( | ) | const |
Compute the sub-region perimeter in sub-region units.
| double SUBREGION2D::ComputePerimeterNoIslands | ( | ) | const |
Compute the sub-region perimeter in sub-region units but do not include islands in the calculation.
| ERRVALUE SUBREGION2D::ConvertForward | ( | const SPATREF::COORDOP & | Op | ) |
Translate the subregion using a coordinate operation (SPATREF::COORDOP) transformation.
| ERRVALUE SUBREGION2D::ConvertForward | ( | const TRANS2D_MAPGEN & | tmg | ) |
Translate the sub-region using a mapgen transformation.
| void SUBREGION2D::ConvertForward | ( | const TRANS2D_AFFINE & | taf | ) |
Translate the sub-region using an affine transformation.
| ERRVALUE SUBREGION2D::ConvertForwardDense | ( | const SPATREF::COORDOP & | Op, | |
| double | tolerance | |||
| ) |
Translate the region using a coordinate operation (SPATREF::COORDOP) transformation with densification If the region is the extents only, this will convert it to a proper sub-region before doing the transformation.
| ERRVALUE SUBREGION2D::ConvertForwardDense | ( | const TRANS2D_MAPGEN & | tmg | ) |
Translate the sub-region using a mapgen transformation with densification If the sub-region is the extents only, this will convert it to a polygon sub-region before doing the transformation.
| ERRVALUE SUBREGION2D::ConvertInverse | ( | const TRANS2D_MAPGEN & | tmg | ) |
Translate the sub-region using a mapgen transformation.
| void SUBREGION2D::ConvertInverse | ( | const TRANS2D_AFFINE & | taf | ) |
Translate the sub-region using an affine transformation.
| ERRVALUE SUBREGION2D::ConvertInverseDense | ( | const TRANS2D_MAPGEN & | tmg | ) |
Translate the sub-region using a mapgen transformation with densification If the sub-region is the extents only, this will convert it to a polygon sub-region before doing the transformation.
| ERRVALUE SUBREGION2D::ConvertReverse | ( | const SPATREF::COORDOP & | Op | ) |
Translate the subregion using a coordinate operation (SPATREF::COORDOP) transformation.
| ERRVALUE SUBREGION2D::ConvertReverseDense | ( | const SPATREF::COORDOP & | Op, | |
| double | tolerance | |||
| ) |
Translate the subregion using a coordinate operation (SPATREF::COORDOP) transformation with densification If the subregion is the extents only, this will convert it to a proper sub-region before doing the transformation.
| ERRVALUE SUBREGION2D::ConvertToLongFloor | ( | SIMPLE_ARRAY< LPOLYGON > & | PolygonArray, | |
| SIMPLE_ARRAY< LPOINT2D > & | PointArray, | |||
| const DPOINT2D & | scale, | |||
| const DPOINT2D & | offset | |||
| ) | const |
Convert subregion from double's to INT32's using floor method with scale and offset.
| PolygonArray | Array of polygons returned | |
| PointArray | Array of points (referenced by polygons) returned | |
| scale | Scaling factors | |
| offset | Offset values added after scaling |
| ERRVALUE SUBREGION2D::ConvertToLongFloor | ( | SIMPLE_ARRAY< LPOLYGON > & | PolygonArray, | |
| SIMPLE_ARRAY< LPOINT2D > & | PointArray | |||
| ) | const |
Convert subregion from double's to INT32's using floor method.
| PolygonArray | Array of polygons returned | |
| PointArray | Array of points (referenced by polygons) returned |
| ERRVALUE SUBREGION2D::ConvertToLongNearInt | ( | SIMPLE_ARRAY< LPOLYGON > & | PolygonArray, | |
| SIMPLE_ARRAY< LPOINT2D > & | PointArray | |||
| ) | const |
Convert subregion from double's to INT32's, using floor with a near integer offset.
| ERRVALUE SUBREGION2D::ConvertToLongRound | ( | SIMPLE_ARRAY< LPOLYGON > & | PolygonArray, | |
| SIMPLE_ARRAY< LPOINT2D > & | PointArray | |||
| ) | const |
Convert subregion from double's to INT32's with rounding, removes duplicate points.
| ERRVALUE SUBREGION2D::CopyTo | ( | SUBREGION2D & | target, | |
| COPYFILTER & | filter | |||
| ) | const |
Copy subregion to specified target with filter.
| target | Target subregion | |
| filter | Filter to determine which islands to copy |
| void SUBREGION2D::DumpCoords | ( | MISTRING & | result, | |
| int | indent, | |||
| bool | maxprec = false | |||
| ) | const |
Dump coordinates to string.
Though intended for debugging, not for serialization, the format is compatible with AssignFromXML when maximum precision is used.
| result | String to append to | |
| indent | Amount to indent each coordinate | |
| maxprec | Use maximum precision |
| CONST_ITERATOR SUBREGION2D::End | ( | ) | const [inline] |
| int SUBREGION2D::FitRectangleInside | ( | const DPOINT2D & | size, | |
| DPOINT2D & | ptCenterRet, | |||
| UINT32 | QuantFactor = 10, |
|||
| bool | bUseFirstFound = false | |||
| ) | const |
Attempt to fit rectangle of specified size inside subregion.
| size | Size of rectangle | |
| ptCenterRet | Point at center of rectangle returned rectangle fits, unchanged if not | |
| QuantFactor | Quantization factor, must be positive | |
| bUseFirstFound | Use first found location instead of one farthest from edge |
Generate a point inside of the subregion This does deal with the islands of the subregion, the point will not be in an island.
Generate a point inside of the subregion This does deal with the islands of the subregion, the point will not be in an island.
If called multiple times for the same subregion, the points generated will not be the same.
| const DRECT3D& SUBREGION2D::GetExtents | ( | ) | const [inline] |
Get sub-region extents.
| const DRECT2D& SUBREGION2D::GetExtents2D | ( | ) | const [inline] |
Get sub-region extents.
| INT32 SUBREGION2D::GetNumIslands | ( | ) | const [inline] |
Get number of islands in the sub-region.
Get XML representation.
| parentnode | Parent node | |
| nodename | Node name |
| ERRVALUE SUBREGION2D::Intersect | ( | const SUBREGION2D & | SubRegion, | |
| MILIST< SUBREGION2D > & | SubRegionList | |||
| ) |
Intersect an specified area against the sub-region If the "SubRegion" does not intersect with the sub-region area, 'this' will be set to empty.
| SubRegionList | Filled in if operation creates more than one sub-region |
| ERRVALUE SUBREGION2D::Intersect | ( | const POLYLINE & | PolyLine, | |
| MILIST< SUBREGION2D > & | SubRegionList | |||
| ) |
Intersect an specified area against the sub-region If the polygon does not intersect the sub-region area, 'this' will be set to empty If the "PolyLine" passed in is invalid, this method will only use one of the valid polygons it finds, otherwise the results will be in error.
| SubRegionList | Filled in if operation creates more than one sub-region |
| ERRVALUE SUBREGION2D::Intersect | ( | const DRECT2D & | Rect, | |
| MILIST< SUBREGION2D > & | SubRegionList | |||
| ) |
Intersect an specified rectangle area with the sub-region If the rectangle does not intersect with the sub-region area, 'this' will be set to empty.
| SubRegionList | Filled in if operation creates more than one sub-region |
| ERRVALUE SUBREGION2D::IntersectValidated | ( | const POLYLINE & | PolyLine, | |
| MILIST< SUBREGION2D > & | SubRegionList | |||
| ) |
Intersect an specified area from the sub-region known to be valid A validated polygon is a polygon that does not intersect itself.
If the polygon does not intersect the sub-region area, 'this' will be set to empty
| SubRegionList | Filled in if operation creates more than one sub-region |
| bool SUBREGION2D::IsEmpty | ( | ) | const [inline] |
Is the sub-region an empty sub-region.
| bool SUBREGION2D::IsEquivalentTo | ( | const SUBREGION2D & | rhs, | |
| double | threshold = 0.0 | |||
| ) | const |
Determine if the two subregions are equivalent This method uses "Fuzzy" vertex comparisons and the direction and order of the elements are not relevant Specify a different threshold to allow greater distances.
| threshold | Default threshold is max absolute value of rectangle coordinate * 1.0E-13 |
| bool SUBREGION2D::IsPointInside | ( | const DPOINT2D & | point | ) | const |
Determine if the point falls inside the sub-region.
| bool SUBREGION2D::IsRectangle | ( | ) | const [inline] |
Is the sub-region a simple rectangle region?
| SUBREGION2D& SUBREGION2D::operator= | ( | const DRECT3D & | rhs | ) |
Assignment operator from 3d rectangle.
| SUBREGION2D& SUBREGION2D::operator= | ( | const DRECT2D & | rhs | ) |
Assignment operator from rectangle.
| SUBREGION2D& SUBREGION2D::operator= | ( | const SUBREGION2D & | rhs | ) |
Assignment operator.
| void SUBREGION2D::RemoveIslands | ( | ) |
Remove all of the islands from the subregion.
| void SUBREGION2D::Reverse | ( | ) |
Reverse the orientation of the polygons and islands in the subregion.
| void SUBREGION2D::SetDimension | ( | DIMENSION | dim | ) |
Set the dimension of the points stored in 'this' as 2D or 3D vertices.
| void SUBREGION2D::SetOrientation | ( | ORIENTATION | Orientation | ) |
Set subregion orientation Outer shell polygon is set to the orientation specified in respect to itself.
Islands are set in the opposite orientation in respect to themselves
| ERRVALUE SUBREGION2D::Subtract | ( | const DRECT2D & | IslandRect, | |
| MILIST< SUBREGION2D > & | SubRegionList | |||
| ) |
Remove an specified rectangle area from the sub-region If the island removes the entire sub-region area, 'this' will be set to empty.
| SubRegionList | Filled in if operation creates more than one sub-region |
| ERRVALUE SUBREGION2D::Subtract | ( | const SUBREGION2D & | SubRegion, | |
| MILIST< SUBREGION2D > & | SubRegionList | |||
| ) |
Remove an specified area from the sub-region If the "SubRegion" removes the entire sub-region area, 'this' will be set to empty.
| SubRegionList | Filled in if operation creates more than one sub-region |
| ERRVALUE SUBREGION2D::Subtract | ( | const POLYLINE & | Island, | |
| MILIST< SUBREGION2D > & | SubRegionList | |||
| ) |
Remove an specified area from the sub-region If the island removes the entire sub-region area, 'this' will be set to empty If the "Island" passed in is invalid, this method will only use one of the valid polygons it finds, otherwise the results will be in error.
| SubRegionList | Filled in if operation creates more than one sub-region |
| ERRVALUE SUBREGION2D::SubtractValidated | ( | const POLYLINE & | Island, | |
| MILIST< SUBREGION2D > & | SubRegionList, | |||
| double | ConflateThreshold | |||
| ) |
Remove an specified area from the sub-region known to be valid A validated polygon is a polygon that does not intersect itself.
If the island removes the entire sub-region area, 'this' will be set to empty
| SubRegionList | Filled in if operation creates more than one sub-region |
| ERRVALUE SUBREGION2D::SubtractValidated | ( | const POLYLINE & | Island, | |
| MILIST< SUBREGION2D > & | SubRegionList | |||
| ) |
Remove an specified area from the sub-region known to be valid A validated polygon is a polygon that does not intersect itself.
If the island removes the entire sub-region area, 'this' will be set to empty
| SubRegionList | Filled in if operation creates more than one sub-region |
| POLYLINE::COMPRESULT SUBREGION2D::TestLine | ( | const POLYLINE & | PolyLine | ) | const |
Test the line against the sub-region.
| bool SUBREGION2D::TestLine | ( | const POLYLINE & | PolyLine, | |
| TESTCRITERIA | TestCriteria | |||
| ) | const |
Test the line given the test criteria against the sub-region.
| bool SUBREGION2D::TestPoint | ( | const DPOINT2D & | Point, | |
| TESTCRITERIA | TestCriteria | |||
| ) | const |
Test the point given the test criteria against the sub-region.
| POLYLINE::COMPRESULT SUBREGION2D::TestPolygon | ( | const POLYLINE & | PolyLine | ) | const |
Test the polygon against the sub-region.
| bool SUBREGION2D::TestPolygon | ( | const POLYLINE & | PolyLine, | |
| TESTCRITERIA | TestCriteria | |||
| ) | const |
Test the polygon given the test criteria against the sub-region.
| POLYLINE::COMPRESULT SUBREGION2D::TestSubRegion | ( | const SUBREGION2D & | SubRegion | ) | const |
Test the subregion against 'this'.
| bool SUBREGION2D::TestSubRegion | ( | const SUBREGION2D & | SubRegion, | |
| TESTCRITERIA | TestCriteria | |||
| ) | const |
Test the subregion given the test criteria against 'this'.
| ERRVALUE SUBREGION2D::Union | ( | const SUBREGION2D & | SubRegion, | |
| MILIST< SUBREGION2D > & | SubRegionList, | |||
| POLYLINE::COMBINERESULT & | CombineResult | |||
| ) |
Union (ADD) a sub-region to the sub-region.
| SubRegionList | Filled in if operation creates more than one sub-region |
| ERRVALUE SUBREGION2D::Union | ( | const POLYLINE & | PolyLine, | |
| MILIST< SUBREGION2D > & | SubRegionList | |||
| ) |
Union (ADD) a Polygon to the sub-region.
| SubRegionList | Filled in if operation creates more than one sub-region |
| ERRVALUE SUBREGION2D::Union | ( | const DRECT2D & | Rect, | |
| MILIST< SUBREGION2D > & | SubRegionList, | |||
| POLYLINE::COMBINERESULT & | CombineResult | |||
| ) |
Union (ADD) a rectangle to the sub-region.
| SubRegionList | Filled in if operation creates more than one sub-region |
| ERRVALUE SUBREGION2D::UnionValidated | ( | const POLYLINE & | PolyLine, | |
| MILIST< SUBREGION2D > & | SubRegionList, | |||
| POLYLINE::COMBINERESULT & | CombineResult | |||
| ) |
Union (ADD) a polygon to the sub-region.
| SubRegionList | Filled in if operation creates more than one sub-region |
1.6.1