SUBREGION2D Class Reference

SUBREGION2D class - Definitions and methods to support a generic 2D sub-region object in memory. More...

#include <mi32/region2d.h>

List of all members.

Public Types

typedef POLYLINELIST::CONST_ITERATOR CONST_ITERATOR

Public Member Functions

ERRVALUE Assign (const POLYLINE &Polygon)
void AssignValidated (const POLYLINELIST &PolygonList)
void AssignValidated (const POLYLINE &Polygon)
CONST_ITERATOR Begin () const
void Clear ()
int ClipLine (POLYLINE &PolyLine, POLYLINE::CLIP &ClipTarget, CLIPMODE ClipMode=CLIPMODE_Inside) const
double ComputeArea () const
double ComputeAreaNoIslands () const
double ComputePerimeter () const
double ComputePerimeterNoIslands () const
ERRVALUE ConvertForward (const SPATREF::COORDOP &Op)
ERRVALUE ConvertForward (const TRANS2D_MAPGEN &tmg)
void ConvertForward (const TRANS2D_AFFINE &taf)
ERRVALUE ConvertForwardDense (const SPATREF::COORDOP &Op, double tolerance)
ERRVALUE ConvertForwardDense (const TRANS2D_MAPGEN &tmg)
ERRVALUE ConvertInverse (const TRANS2D_MAPGEN &tmg)
void ConvertInverse (const TRANS2D_AFFINE &taf)
ERRVALUE ConvertInverseDense (const TRANS2D_MAPGEN &tmg)
ERRVALUE ConvertReverse (const SPATREF::COORDOP &Op)
ERRVALUE ConvertReverseDense (const SPATREF::COORDOP &Op, double tolerance)
ERRVALUE ConvertToLongRound (SIMPLE_ARRAY< LPOLYGON > &PolygonArray, SIMPLE_ARRAY< LPOINT2D > &PointArray) const
ERRVALUE ConvertToLongTruncate (SIMPLE_ARRAY< LPOLYGON > &PolygonArray, SIMPLE_ARRAY< LPOINT2D > &PointArray) const
ERRVALUE CopyTo (SUBREGION2D &target, COPYFILTER &filter) const
CONST_ITERATOR End () const
ERRVALUE GeneratePointInside (DPOINT2D &PointInside) const
const DRECT3DGetExtents () const
const DRECT2DGetExtents2D () const
INT32 GetNumIslands () const
ERRVALUE Intersect (const SUBREGION2D &SubRegion, MILIST< SUBREGION2D > &SubRegionList)
ERRVALUE Intersect (const POLYLINE &PolyLine, MILIST< SUBREGION2D > &SubRegionList)
ERRVALUE Intersect (const DRECT2D &Rect, MILIST< SUBREGION2D > &SubRegionList)
ERRVALUE IntersectValidated (const POLYLINE &PolyLine, MILIST< SUBREGION2D > &SubRegionList)
bool IsEmpty () const
bool IsEquivalentTo (const SUBREGION2D &rhs, double threshold=0.0) const
bool IsPointInside (const DPOINT2D &point) const
bool IsRectangle () const
SUBREGION2Doperator= (const DRECT2D &rhs)
SUBREGION2Doperator= (const SUBREGION2D &rhs)
void RemoveIslands ()
void Reverse ()
void SetDimension (DIMENSION dim)
void SetOrientation (ORIENTATION Orientation)
 SUBREGION2D (const DRECT2D &rect)
 SUBREGION2D (const SUBREGION2D &rhs)
 SUBREGION2D ()
ERRVALUE Subtract (const DRECT2D &IslandRect, MILIST< SUBREGION2D > &SubRegionList)
ERRVALUE Subtract (const SUBREGION2D &SubRegion, MILIST< SUBREGION2D > &SubRegionList)
ERRVALUE Subtract (const POLYLINE &Island, MILIST< SUBREGION2D > &SubRegionList)
ERRVALUE SubtractValidated (const POLYLINE &Island, MILIST< SUBREGION2D > &SubRegionList)
POLYLINE::COMPRESULT TestLine (const POLYLINE &PolyLine) const
bool TestLine (const POLYLINE &PolyLine, TESTCRITERIA TestCriteria) const
bool TestPoint (const DPOINT2D &Point, TESTCRITERIA TestCriteria) const
POLYLINE::COMPRESULT TestPolygon (const POLYLINE &PolyLine) const
bool TestPolygon (const POLYLINE &PolyLine, TESTCRITERIA TestCriteria) const
POLYLINE::COMPRESULT TestSubRegion (const SUBREGION2D &SubRegion) const
bool TestSubRegion (const SUBREGION2D &SubRegion, TESTCRITERIA TestCriteria) const
ERRVALUE Union (const SUBREGION2D &SubRegion, MILIST< SUBREGION2D > &SubRegionList, POLYLINE::COMBINERESULT &CombineResult)
ERRVALUE Union (const POLYLINE &PolyLine, MILIST< SUBREGION2D > &SubRegionList)
ERRVALUE Union (const DRECT2D &Rect, MILIST< SUBREGION2D > &SubRegionList, POLYLINE::COMBINERESULT &CombineResult)
ERRVALUE UnionValidated (const POLYLINE &PolyLine, MILIST< SUBREGION2D > &SubRegionList, POLYLINE::COMBINERESULT &CombineResult)
 ~SUBREGION2D ()

Classes

class  COPYFILTER
 Filter for copying subregion. More...


Detailed Description

SUBREGION2D class - Definitions and methods to support a 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.

Definition at line 237 of file region2d.h.


Member Typedef Documentation

typedef POLYLINELIST::CONST_ITERATOR SUBREGION2D::CONST_ITERATOR

Definition at line 240 of file region2d.h.


Constructor & Destructor Documentation

SUBREGION2D::SUBREGION2D (  ) 

Default Constructor.

SUBREGION2D::SUBREGION2D ( const SUBREGION2D rhs  ) 

Copy Constructor.

SUBREGION2D::SUBREGION2D ( const DRECT2D rect  ) 

Constructor from DRECT2D.

SUBREGION2D::~SUBREGION2D (  ) 

Destructor.


Member Function Documentation

ERRVALUE SUBREGION2D::Assign ( const POLYLINE Polygon  ) 

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.

Returns:
Iterator to the beginning of the POLYLINE list

Definition at line 313 of file region2d.h.

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.

Returns:
TRUE if part of the line is clipped, FALSE if not, < 0 error

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::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::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::ConvertToLongTruncate ( SIMPLE_ARRAY< LPOLYGON > &  PolygonArray,
SIMPLE_ARRAY< LPOINT2D > &  PointArray 
) const

Convert subregion from double's to INT32's, truncating towards 0, removes duplicate points.

ERRVALUE SUBREGION2D::CopyTo ( SUBREGION2D target,
COPYFILTER filter 
) const

Copy subregion to specified target with filter.

Parameters:
target  Target subregion
filter  Filter to determine which islands to copy

CONST_ITERATOR SUBREGION2D::End (  )  const [inline]

Get the end of the list of POLYLINE's.

Returns:
End of POLYLINE list, see Begin() for details

Definition at line 424 of file region2d.h.

ERRVALUE SUBREGION2D::GeneratePointInside ( DPOINT2D PointInside  )  const

Generate a point inside of the subregion This does deal with the islands of the subregion, the point will not be in an island.

const DRECT3D& SUBREGION2D::GetExtents (  )  const [inline]

Get sub-region extents.

Returns:
Extents of the sub-region

Definition at line 435 of file region2d.h.

const DRECT2D& SUBREGION2D::GetExtents2D (  )  const [inline]

Get sub-region extents.

Returns:
Extents of the sub-region

Definition at line 440 of file region2d.h.

INT32 SUBREGION2D::GetNumIslands (  )  const [inline]

Get number of islands in the sub-region.

Returns:
Number of islands in the sub-region

Definition at line 445 of file region2d.h.

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.

Parameters:
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.

Parameters:
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.

Parameters:
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

Parameters:
SubRegionList  Filled in if operation creates more than one sub-region

bool SUBREGION2D::IsEmpty (  )  const [inline]

Is the sub-region an empty sub-region.

Definition at line 495 of file region2d.h.

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.

Returns:
'True' if they are, 'False' if not
Parameters:
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.

Returns:
'True' if point is inside the sub-region, 'false' if not

bool SUBREGION2D::IsRectangle (  )  const [inline]

Is the sub-region a simple rectangle region?

Definition at line 499 of file region2d.h.

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.

Parameters:
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.

Parameters:
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.

Parameters:
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

Parameters:
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.

Returns:
POLYLINE::COMPRESULT

bool SUBREGION2D::TestLine ( const POLYLINE PolyLine,
TESTCRITERIA  TestCriteria 
) const

Test the line given the test criteria against the sub-region.

Returns:
"True" if the line meets the criteria, "false" if not

bool SUBREGION2D::TestPoint ( const DPOINT2D Point,
TESTCRITERIA  TestCriteria 
) const

Test the point given the test criteria against the sub-region.

Returns:
"True" if the point meets the criteria, "false" if not

POLYLINE::COMPRESULT SUBREGION2D::TestPolygon ( const POLYLINE PolyLine  )  const

Test the polygon against the sub-region.

Returns:
POLYLINE::COMPRESULT

bool SUBREGION2D::TestPolygon ( const POLYLINE PolyLine,
TESTCRITERIA  TestCriteria 
) const

Test the polygon given the test criteria against the sub-region.

Returns:
"True" if the polygon meets the criteria, "false" if not

POLYLINE::COMPRESULT SUBREGION2D::TestSubRegion ( const SUBREGION2D SubRegion  )  const

Test the subregion against 'this'.

Returns:
POLYLINE::COMPRESULT

bool SUBREGION2D::TestSubRegion ( const SUBREGION2D SubRegion,
TESTCRITERIA  TestCriteria 
) const

Test the subregion given the test criteria against 'this'.

Returns:
"True" if the subregion meets the criteria, "false" if not

ERRVALUE SUBREGION2D::Union ( const SUBREGION2D SubRegion,
MILIST< SUBREGION2D > &  SubRegionList,
POLYLINE::COMBINERESULT CombineResult 
)

Union (ADD) a sub-region to the sub-region.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
SubRegionList  Filled in if operation creates more than one sub-region


The documentation for this class was generated from the following file:
Generated on Thu Apr 26 04:12:36 2007 for TNTsdk by  doxygen 1.5.2