REGION2D Class Reference

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

#include <mi32/region2d.h>

List of all members.

Public Types

typedef MILIST< SUBREGION2D
>::CONST_ITERATOR 
CONST_ITERATOR

Public Member Functions

ERRVALUE Assign (const POLYLINE &PolyLine, const SIMPLE_ARRAY< INT32 > &Index)
CONST_ITERATOR Begin () const
void Clear ()
void ClearCoordRefSys ()
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 ConvertTo (const SPATREF::COORDREFSYS &DestCoordRefSys, double tolerance=0.0)
CONST_ITERATOR End () const
ERRVALUE ExclusiveUnion (const REGION2D &RegionA, const REGION2D &RegionB)
ERRVALUE ExclusiveUnion (const REGION2D &RegionB)
const SPATREF::COORDREFSYSGetCoordRefSys () const
const DRECT3DGetExtents () const
const DRECT2DGetExtents2D () const
INT32 GetNumSubRegions () const
ERRVALUE Intersect (const REGION2D &RegionA, const REGION2D &RegionB)
ERRVALUE Intersect (const REGION2D &RegionB)
ERRVALUE Intersect (const SUBREGION2D &SubRegion)
ERRVALUE Intersect (const POLYLINE &PolyLine)
ERRVALUE Intersect (const DRECT2D &Rect)
ERRVALUE IntersectValidated (const POLYLINE &PolyLine)
bool IsEmpty () const
bool IsEquivalentTo (const REGION2D &rhs, double threshold=0.0) const
bool IsPointInside (const DPOINT2D &point) const
bool IsRectangle () const
REGION2Doperator= (const SUBREGION2D &SubRegion)
REGION2Doperator= (const DRECT2D &rhs)
REGION2Doperator= (const REGION2D &rhs)
 REGION2D (const MILIST< POLYLINE > &)
 REGION2D (const SUBREGION2D &SubRegion)
 REGION2D (const DRECT2D &rhs)
 REGION2D (const REGION2D &rhs)
 REGION2D ()
void Reverse ()
void SetCoordRefSys (const SPATREF::COORDREFSYS &CoordSysRef)
void SetOrientation (ORIENTATION Orientation)
void SetZRange (const DOUBLE_RANGE &range)
ERRVALUE Subtract (const REGION2D &RegionA, const REGION2D &RegionB)
ERRVALUE Subtract (const REGION2D &RegionB)
ERRVALUE Subtract (const SUBREGION2D &SubRegion)
ERRVALUE Subtract (const POLYLINE &PolyLine)
ERRVALUE Subtract (const DRECT2D &Rect)
ERRVALUE SubtractValidated (const POLYLINE &PolyLine)
bool TestLine (const POLYLINE &PolyLine, TESTCRITERIA TestCriteria) const
bool TestPoint (const DPOINT2D &Point, TESTCRITERIA TestCriteria) const
bool TestPolygon (const POLYLINE &PolyLine, TESTCRITERIA TestCriteria) const
bool TestSubRegion (const SUBREGION2D &SubRegion, TESTCRITERIA TestCriteria) const
ERRVALUE Union (const REGION2D &RegionB)
ERRVALUE Union (const REGION2D &RegionA, const REGION2D &RegionB)
ERRVALUE Union (const SUBREGION2D &SubRegion)
ERRVALUE Union (const POLYLINE &PolyLine)
ERRVALUE Union (const DRECT2D &Rect)
ERRVALUE UnionValidated (const POLYLINE &PolyLine)
 ~REGION2D ()


Detailed Description

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

The region can be represented by either a single rectangle or as a list of sub-regions.

Definition at line 562 of file region2d.h.


Member Typedef Documentation

typedef MILIST<SUBREGION2D>::CONST_ITERATOR REGION2D::CONST_ITERATOR
 

Definition at line 565 of file region2d.h.


Constructor & Destructor Documentation

REGION2D::REGION2D  ) 
 

Default constructor, initializes to an invalid region.

REGION2D::REGION2D const REGION2D rhs  ) 
 

Copy constructor.

REGION2D::REGION2D const DRECT2D rhs  ) 
 

Constructor from DRECT2D.

REGION2D::REGION2D const SUBREGION2D SubRegion  ) 
 

Constructor from SUBREGION2D.

REGION2D::REGION2D const MILIST< POLYLINE > &   ) 
 

Constructor from a list of polylines.

REGION2D::~REGION2D  ) 
 

Destructor.


Member Function Documentation

ERRVALUE REGION2D::Assign const POLYLINE PolyLine,
const SIMPLE_ARRAY< INT32 > &  Index
 

Assign from a POLYLINE and an index array defining how the polyline is formatted.

Parameters:
Index  Each entry is the number of points >0 is shell <0 is island

CONST_ITERATOR REGION2D::Begin  )  const [inline]
 

Get the beginning of the list of SUBREGION's.

Returns:
Iterator to the beginning of the subregion list

Definition at line 618 of file region2d.h.

void REGION2D::Clear  ) 
 

Clear the region.

void REGION2D::ClearCoordRefSys  ) 
 

Clear coordinate reference system.

int REGION2D::ClipLine POLYLINE PolyLine,
POLYLINE::CLIP ClipTarget,
CLIPMODE  ClipMode = CLIPMODE_Inside
const
 

Clip a polyline to a region, call the ClipTarget for each segment.

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

double REGION2D::ComputeArea  )  const
 

Compute the region area in region units.

double REGION2D::ComputeAreaNoIslands  )  const
 

Compute the region area in region units but do not exclude islands in the calculation.

double REGION2D::ComputePerimeter  )  const
 

Compute the region perimeter in region units.

double REGION2D::ComputePerimeterNoIslands  )  const
 

Compute the region perimeter in region units but do not include sub-region islands in the calculation.

ERRVALUE REGION2D::ConvertForward const SPATREF::COORDOP Op  ) 
 

Translate the region using a coordinate operation (SPATREF::COORDOP) transformation Region coordinate reference system "GetCoordRefSys()' must equate to the Op.GetSourceCRS().

The Op.GetTargetCRS() is assigned as the region's COORDREFSYS after the transformation.

ERRVALUE REGION2D::ConvertForward const TRANS2D_MAPGEN tmg  ) 
 

Translate the region using a mapgen transformation An error will occur if the COORDREFSYS of 'this' is not local and the TRANS2D_MAPGEN's input transformation is not identity or the COORDREFSYS of 'this' does not match the TRANS2D_MAPGEN's input COORDREFSYS.

If the TRANS2D_MAPGEN's output transformation is identity, 'this' COORDREFSYS will be set to the TRANS2D_MAPGEN's output COORDREFSYS. otherwise it will be set to "Undefined".

void REGION2D::ConvertForward const TRANS2D_AFFINE taf  ) 
 

Translate the region using an affine transformation If the COORDREFSYS of 'this' is set, it will be changed to "Undefined".

ERRVALUE REGION2D::ConvertForwardDense const SPATREF::COORDOP Op,
double  tolerance
 

Translate the region using a coordinate operation (SPATREF::COORDOP) transformation with densification Region coordinate reference system "GetCoordRefSys()' must equate to the Op.GetSourceCRS().

The Op.GetTargetCRS() is assigned as the region's COORDREFSYS after the transformation.

ERRVALUE REGION2D::ConvertForwardDense const TRANS2D_MAPGEN tmg  ) 
 

Translate the region using a mapgen transformation with densification An error will occur if the COORDREFSYS of 'this' is not local and the TRANS2D_MAPGEN's input transformation is not identity or the COORDREFSYS of 'this' does not match the TRANS2D_MAPGEN's input COORDREFSYS.

If the TRANS2D_MAPGEN's output transformation is identity, 'this' COORDREFSYS will be set to the TRANS2D_MAPGEN's output COORDREFSYS. otherwise it will be set to "Undefined".

ERRVALUE REGION2D::ConvertInverse const TRANS2D_MAPGEN tmg  ) 
 

Translate the region using a mapgen transformation An error will occur if the COORDREFSYS of 'this' is not local and the TRANS2D_MAPGEN's output transformation is not identity or the COORDREFSYS of 'this' does not match the TRANS2D_MAPGEN's output COORDREFSYS.

If the TRANS2D_MAPGEN's input transformation is identity, 'this' COORDREFSYS will be set to the TRANS2D_MAPGEN's input COORDREFSYS otherwise it will be set to "Undefined".

void REGION2D::ConvertInverse const TRANS2D_AFFINE taf  ) 
 

Translate the region using an affine transformation If the COORDREFSYS of 'this' is set, it will be changed to "Undefined".

ERRVALUE REGION2D::ConvertInverseDense const TRANS2D_MAPGEN tmg  ) 
 

Translate the region using a mapgen transformation with densification An error will occur if the COORDREFSYS of 'this' is not local and the TRANS2D_MAPGEN's output transformation is not identity or the COORDREFSYS of 'this' does not match the TRANS2D_MAPGEN's output COORDREFSYS.

If the TRANS2D_MAPGEN's input transformation is identity, 'this' COORDREFSYS will be set to the TRANS2D_MAPGEN's input COORDREFSYS. otherwise it will be set to "Undefined".

ERRVALUE REGION2D::ConvertReverse const SPATREF::COORDOP Op  ) 
 

Translate the region using a coordinate operation (SPATREF::COORDOP) transformation Region coordinate reference system "GetCoordRefSys()' must equate to the Op.GetTargetCRS().

The Op.GetSourceCRS() is assigned as the region's COORDREFSYS after the transformation.

ERRVALUE REGION2D::ConvertReverseDense const SPATREF::COORDOP Op,
double  tolerance
 

Translate the region using a coordinate operation (SPATREF::COORDOP) transformation with densification Region coordinate reference system "GetCoordRefSys()' must equate to the Op.GetTargetCRS().

The Op.GetSourceCRS() is assigned as the region's COORDREFSYS after the transformation.

ERRVALUE REGION2D::ConvertTo const SPATREF::COORDREFSYS DestCoordRefSys,
double  tolerance = 0.0
 

Convert 'this' to a different COORDREFSYS.

CONST_ITERATOR REGION2D::End  )  const [inline]
 

Get the end of the list of SUBREGION's.

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

Definition at line 739 of file region2d.h.

ERRVALUE REGION2D::ExclusiveUnion const REGION2D RegionA,
const REGION2D RegionB
 

Exclusive Union (XOR) RegionB with RegionA and place in 'this' Will convert 'this' to RegionA's SPATREF::COORDREFSYS.

ERRVALUE REGION2D::ExclusiveUnion const REGION2D RegionB  ) 
 

Exclusive Union (XOR) RegionB with 'this'.

const SPATREF::COORDREFSYS& REGION2D::GetCoordRefSys  )  const [inline]
 

Get the region's coordinate reference system.

Returns:
SPATREF::COORDREFSYS of the region

Definition at line 756 of file region2d.h.

const DRECT3D& REGION2D::GetExtents  )  const [inline]
 

Get region extents.

Returns:
Extents of the entire region

Definition at line 761 of file region2d.h.

const DRECT2D& REGION2D::GetExtents2D  )  const [inline]
 

Get region extents.

Returns:
Extents of the entire region

Definition at line 766 of file region2d.h.

INT32 REGION2D::GetNumSubRegions  )  const
 

Get number of sub-regions.

Returns:
Number of sub-regions

ERRVALUE REGION2D::Intersect const REGION2D RegionA,
const REGION2D RegionB
 

Intersect RegionB with RegionA and place in 'this' Will convert 'this' to RegionA's SPATREF::COORDREFSYS.

ERRVALUE REGION2D::Intersect const REGION2D RegionB  ) 
 

Intersect RegionB with 'this'.

ERRVALUE REGION2D::Intersect const SUBREGION2D SubRegion  ) 
 

Intersect a sub-region with 'this'.

ERRVALUE REGION2D::Intersect const POLYLINE PolyLine  ) 
 

Intersect a polygon with 'this'.

ERRVALUE REGION2D::Intersect const DRECT2D Rect  ) 
 

Intersect rectangle with 'this'.

ERRVALUE REGION2D::IntersectValidated const POLYLINE PolyLine  ) 
 

Intersect a validated polygon with 'this'.

bool REGION2D::IsEmpty  )  const [inline]
 

Is the region an empty region.

Definition at line 807 of file region2d.h.

bool REGION2D::IsEquivalentTo const REGION2D rhs,
double  threshold = 0.0
const
 

Determine if the two regions 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 REGION2D::IsPointInside const DPOINT2D point  )  const
 

Determine if the point falls inside the region.

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

bool REGION2D::IsRectangle  )  const [inline]
 

Is the region a simple rectangle region?

Definition at line 826 of file region2d.h.

REGION2D& REGION2D::operator= const SUBREGION2D SubRegion  ) 
 

Assignment from SUBREGION2D.

REGION2D& REGION2D::operator= const DRECT2D rhs  ) 
 

Assignment from DRECT2D.

REGION2D& REGION2D::operator= const REGION2D rhs  ) 
 

Assignment.

void REGION2D::Reverse  ) 
 

Reverse the orientation of the subregions in the region.

void REGION2D::SetCoordRefSys const SPATREF::COORDREFSYS CoordSysRef  )  [inline]
 

Set the region's coordinate reference system Does not do any transformations of the region, assumes that the region is in the system specified.

Definition at line 836 of file region2d.h.

void REGION2D::SetOrientation ORIENTATION  Orientation  ) 
 

Set region orientation Each subregion is set using SUBREGION2D::SetOrientation().

void REGION2D::SetZRange const DOUBLE_RANGE range  ) 
 

Set the Z init and Z last fields of the extents box.

ERRVALUE REGION2D::Subtract const REGION2D RegionA,
const REGION2D RegionB
 

Subtract RegionB from RegionA and place in 'this' Will convert 'this' to RegionA's SPATREF::COORDREFSYS.

ERRVALUE REGION2D::Subtract const REGION2D RegionB  ) 
 

Subtract RegionB from 'this'.

ERRVALUE REGION2D::Subtract const SUBREGION2D SubRegion  ) 
 

Subtract a sub-region from 'this'.

ERRVALUE REGION2D::Subtract const POLYLINE PolyLine  ) 
 

Subtract a polygon from 'this'.

ERRVALUE REGION2D::Subtract const DRECT2D Rect  ) 
 

Subtract rectangle from 'this'.

ERRVALUE REGION2D::SubtractValidated const POLYLINE PolyLine  ) 
 

Subtract a validated polygon from 'this'.

bool REGION2D::TestLine const POLYLINE PolyLine,
TESTCRITERIA  TestCriteria
const
 

Test the line given the test criteria against the region.

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

bool REGION2D::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

bool REGION2D::TestPolygon const POLYLINE PolyLine,
TESTCRITERIA  TestCriteria
const
 

Test the polygon given the test criteria against the region.

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

bool REGION2D::TestSubRegion const SUBREGION2D SubRegion,
TESTCRITERIA  TestCriteria
const
 

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

Returns:
"True" if the sub-region meets the criteria, "false" if not

ERRVALUE REGION2D::Union const REGION2D RegionB  ) 
 

Union (ADD) RegionB to 'this'.

ERRVALUE REGION2D::Union const REGION2D RegionA,
const REGION2D RegionB
 

Union (ADD) RegionB to RegionA and place in 'this' Will convert 'this' to RegionA's SPATREF::COORDREFSYS.

ERRVALUE REGION2D::Union const SUBREGION2D SubRegion  ) 
 

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

ERRVALUE REGION2D::Union const POLYLINE PolyLine  ) 
 

Union (ADD) a polygon to 'this'.

ERRVALUE REGION2D::Union const DRECT2D Rect  ) 
 

Union (ADD) rectangle to 'this'.

ERRVALUE REGION2D::UnionValidated const POLYLINE PolyLine  ) 
 

Union (ADD) a validated polygon to 'this'.


The documentation for this class was generated from the following file:
Generated on Tue Dec 14 13:20:10 2004 for TNTsdk by  doxygen 1.3.8-20040913