BGeometry Class Reference

#include <BGeometry.h>

Inheritance diagram for BGeometry:

Inheritance graph
[legend]

List of all members.


Detailed Description

Abstract base class for all geometry objects.

Public Member Functions

virtual BGeometryClone (void) const =0
 Creates a deep-copy of this object.
virtual size_t ComputeSize (void) const
 Computes the size of the BByteArray required to store this object.
virtual double DistanceTo (const BPoint &point) const
 Calculates the minimum distance from this BGeometry to the specified BPoint.
virtual void DoResolveToPoint (const BPoint &refPt)=0
 Resolves this BGeometry based on the input BPoint.
virtual void FromByteArray (const BByteArray &bytes, size_t &startPos)
 Initializes an instance of this object from a BByteArray.
EGeometryClass GetGeometryClass (void) const
 Gets the class of geometry contained in this object.
EGeometryType GetGeometryType (void) const
 Gets the type of geometry contained in this object.
const BRectGetMBR (void) const
 Gets the minimum bounding rectangle for this BGeometry.
BRenditionPtr GetOverrideRendition (void)
 Get the rendition that overrides the rendition defined on the feature.
virtual const
BVectorizable
GetVectorizablePtr (void) const
 Returns an interface that can be used to convert this geometry to a simple geometry.
bool HasOverrideRendition (void)
 Indicates whether or not this geometry has a rendition that overrides the rendition defined on the feature.
virtual bool Intersects (const BRect &rect) const
 Determines whether or not this BGeometry intersects the specified rectangle.
bool Is3d (void) const
 Gets the flag indicating whether or not this BGeometry is three-dimensional.
virtual bool IsAggregate (void) const
 Determines whether or not this BGeometry is an aggregate geometry.
virtual bool IsBitmap (void) const
 Indicates whether or not this is a bitmap geometry, such as a BPixelBuffer.
virtual bool IsClosed (void) const
 Indicates whether or not this is a "closed" geometry, such as a BPolygon or a BEllipse.
bool IsOfType (EGeometryType type) const
 Determines whether or not this BGeometry is of the specified type.
BGeometryResolveToPoint (const BPoint &refPt)
 Resolves this BGeometry based on the input BPoint.
void Set3d (bool is3d)
 Sets the flag indicating whether or not this BGeometry is three-dimensional.
void SetMBR (const BRect &mbr)
 Sets the minimum bounding rectangle for this BGeometry.
void SetOverrideRendition (const BRenditionPtr &pRend)
 Set the rendition that will override the rendition defined on the feature.
virtual BByteArray ToByteArray (void) const
 Stores this object in a BByteArray.
virtual BString ToWKT () const
 Returns a Well-Known Text (WKT) string representing this BGeometry.
virtual void Transform (const BTransform &cst)
 Transforms the coordinates in this BGeometry to a different coordinate system.
virtual void TransformReverse (const BTransform &cst)
 Transforms the coordinates in this BGeometry to a different coordinate system using the "reverse" of the BTransform.
virtual ~BGeometry ()
 Destructor.

Static Public Member Functions

static BGeometryFromBinary (const BByteArray &bytes, size_t &startPos)
 Creates a BGeometry instance from a BByteArray.
static BGeometryFromWKT (const BString &wkt)
 Creates a BGeometry from a Well-Known Text (WKT) string.

Protected Member Functions

 BGeometry (const BGeometry &geo)
 Copy constructor.
 BGeometry (EGeometryType type, EGeometryClass c)
 Constructor.
 BGeometry ()
 Default constructor.
virtual BRect ComputeMBR () const =0
 Computes the minimum bounding rectangle for this BGeometry.
void SetChanged (bool val=true)
 Sets the indicator of whether or not this BGeometry has been changed since the MBR was last calculated.

Protected Attributes

EGeometryClass m_class
 The class of geometry contained in this object.
bool m_is3d
 Indicates whether or not this BGeometry is three-dimensional.
bool m_isChanged
 Indicates whether or not this BGeometry has been updated since the MBR was last calculated.
BRect m_mbr
 The minimum bounding rectangle for this BGeometry object.
BRenditionPtr m_rendition
 Pointer to a BRendition that can be used to override the feature rendition for this geometry.
EGeometryType m_type
 The type of geometry contained in this object.

Constructor & Destructor Documentation

virtual ~BGeometry (  )  [inline, virtual]

Destructor.

BGeometry (  )  [inline, protected]

Default constructor.

This constructor is hidden since this is an abstract class.

BGeometry ( EGeometryType  type,
EGeometryClass  c 
) [inline, protected]

Constructor.

This constructor is hidden because this is an abstract class.

Parameters:
type The geometry type.
c The geometry class.

BGeometry ( const BGeometry geo  )  [inline, protected]

Copy constructor.

This constructor is hidden because this is an abstract class.

Parameters:
geo The BGeometry object to copy.


Member Function Documentation

virtual BGeometry* Clone ( void   )  const [pure virtual]

Creates a deep-copy of this object.

Returns:
A deep-copy of this object.

Implemented in BAggregateArea, BAggregateGeo, BAggregateLinear, BAggregatePoint, BArc, BDonut, BEllipse, BLine, BPath, BPointGeo, BPolygon, BPolyline, BRectangle, and BRoundRectangle.

virtual BRect ComputeMBR (  )  const [protected, pure virtual]

Computes the minimum bounding rectangle for this BGeometry.

Returns:
the minimum bounding rectangle.

Implemented in BAggregateArea, BAggregateGeo, BAggregateLinear, BAggregatePoint, BArc, BDonut, BEllipse, BLine, BPath, BPointGeo, BPolygon, and BPolyline.

virtual size_t ComputeSize ( void   )  const [inline, virtual]

Computes the size of the BByteArray required to store this object.

Returns:
The size of the BByteArray.

Implements BByteStreamable.

Reimplemented in BAggregateArea, BAggregateGeo, BAggregateLinear, BAggregatePoint, BArc, BAreaGeo, BDonut, BEllipse, BLine, BLinearGeo, BPath, BPointGeo, BPolygon, BPolyline, BRoundRectangle, and BSegment.

virtual double DistanceTo ( const BPoint point  )  const [virtual]

Calculates the minimum distance from this BGeometry to the specified BPoint.

Parameters:
point The BPoint used to calculate distance.
Returns:
The distance. The units used to express this distance are the same as the units used to express the location of this BGeometry.

Reimplemented in BAggregateArea, BAggregateGeo, BAggregateLinear, BAggregatePoint, BArc, BDonut, BEllipse, BLine, BPath, BPointGeo, BPolygon, and BPolyline.

virtual void DoResolveToPoint ( const BPoint refPt  )  [pure virtual]

Resolves this BGeometry based on the input BPoint.

This should only be called on BGeometry objects that are part of a BBlockDef and contain coordinates that represent offsets from a point rather then an absolute location.

Parameters:
refPt The insertion point.

Implemented in BAggregateArea, BAggregateGeo, BAggregateLinear, BAggregatePoint, BArc, BDonut, BEllipse, BLine, BPath, BPointGeo, BPolygon, and BPolyline.

static BGeometry* FromBinary ( const BByteArray bytes,
size_t &  startPos 
) [static]

Creates a BGeometry instance from a BByteArray.

Parameters:
bytes The BByteArray containing the byte representation of the BGeometry.
startPos The position in the BByteArray where the byte representation begins. This value will be updated to point to the byte past the end of this object in the byte array.

virtual void FromByteArray ( const BByteArray bytes,
size_t &  startPos 
) [virtual]

Initializes an instance of this object from a BByteArray.

Parameters:
bytes The BByteArray containing the byte representation of the object.
startPos The position in the BByteArray where the byte representation begins. This value will be updated to point to the byte past the end of this object in the byte array.

Implements BByteStreamable.

Reimplemented in BAggregateArea, BAggregateGeo, BAggregateLinear, BAggregatePoint, BArc, BAreaGeo, BDonut, BEllipse, BLine, BLinearGeo, BPath, BPointGeo, BPolygon, BPolyline, BRoundRectangle, and BSegment.

static BGeometry* FromWKT ( const BString wkt  )  [static]

Creates a BGeometry from a Well-Known Text (WKT) string.

Parameters:
wkt The WKT string.
Returns:
A new BGeometry object that represents the geometry described in the WKT string.

EGeometryClass GetGeometryClass ( void   )  const [inline]

Gets the class of geometry contained in this object.

Returns:
The geometry class.

EGeometryType GetGeometryType ( void   )  const [inline]

Gets the type of geometry contained in this object.

Returns:
The geometry type.

const BRect& GetMBR ( void   )  const

Gets the minimum bounding rectangle for this BGeometry.

Returns:
The minimum bounding rectangle.

BRenditionPtr GetOverrideRendition ( void   )  [inline]

Get the rendition that overrides the rendition defined on the feature.

Returns:
Pointer to the rendition. Will be null if the geometry has no rendition defined.

virtual const BVectorizable* GetVectorizablePtr ( void   )  const [inline, virtual]

Returns an interface that can be used to convert this geometry to a simple geometry.

The caller should NOT delete the pointer returned by this method.

Returns:
A BVectorizable interface for this object, or NULL if this geometry is already a simple geometry.

Reimplemented in BArc, BEllipse, BLine, BPath, BPointGeo, BPolygon, and BPolyline.

bool HasOverrideRendition ( void   )  [inline]

Indicates whether or not this geometry has a rendition that overrides the rendition defined on the feature.

Returns:
True if the geometry has a rendition, false otherwise.

virtual bool Intersects ( const BRect rect  )  const [virtual]

Determines whether or not this BGeometry intersects the specified rectangle.

Parameters:
rect The rectangle to test for intersection.
Returns:
True if this BGeometry intersects the rectangle and false otherwise.

Reimplemented in BAggregateArea, BAggregateGeo, BAggregateLinear, BAggregatePoint, BArc, BDonut, BEllipse, BLine, BPath, BPointGeo, BPolygon, and BPolyline.

bool Is3d ( void   )  const [inline]

Gets the flag indicating whether or not this BGeometry is three-dimensional.

Returns:
True if this BGeometry is 3D and false otherwise.

virtual bool IsAggregate ( void   )  const [inline, virtual]

Determines whether or not this BGeometry is an aggregate geometry.

Returns:
True if the geometry is an aggregate (a collection of BGeometry objects) and false otherwise.

Reimplemented in BAggregateArea, BAggregateGeo, BAggregateLinear, and BAggregatePoint.

virtual bool IsBitmap ( void   )  const [inline, virtual]

Indicates whether or not this is a bitmap geometry, such as a BPixelBuffer.

return True if the geometry is a bitmap geometry and false otherwise.

virtual bool IsClosed ( void   )  const [inline, virtual]

Indicates whether or not this is a "closed" geometry, such as a BPolygon or a BEllipse.

Returns:
True if the geometry is closed and false otherwise.

Reimplemented in BAggregateArea, BDonut, BEllipse, and BPolygon.

bool IsOfType ( EGeometryType  type  )  const [inline]

Determines whether or not this BGeometry is of the specified type.

Parameters:
type The geometry type.
Returns:
True if this BGeometry is of the specified type and false otherwise.

BGeometry* ResolveToPoint ( const BPoint refPt  ) 

Resolves this BGeometry based on the input BPoint.

This should only be called on BGeometry objects that are part of a BBlockDef and contain coordinates that represent offsets from a point rather then an absolute location.

Parameters:
refPt The insertion point.
Returns:
a new BGeometry object with coordinates given as absolute locations instead of offsets from an insertion point.

void Set3d ( bool  is3d  )  [inline]

Sets the flag indicating whether or not this BGeometry is three-dimensional.

Parameters:
is3d True if this BGeometry is 3D and false otherwise.

void SetChanged ( bool  val = true  )  [inline, protected]

Sets the indicator of whether or not this BGeometry has been changed since the MBR was last calculated.

Parameters:
val Optional parameter that indicates if this BGeometry has been changed since the MBR was last calculated.

void SetMBR ( const BRect mbr  ) 

Sets the minimum bounding rectangle for this BGeometry.

Parameters:
mbr The minimum bounding rectangle.

void SetOverrideRendition ( const BRenditionPtr pRend  )  [inline]

Set the rendition that will override the rendition defined on the feature.

Parameters:
pRend A pointer to the rendition.

virtual BByteArray ToByteArray ( void   )  const [virtual]

Stores this object in a BByteArray.

Returns:
A BByteArray that stores the contents of this object.

Implements BByteStreamable.

Reimplemented in BAggregateArea, BAggregateGeo, BAggregateLinear, BAggregatePoint, BArc, BAreaGeo, BDonut, BEllipse, BLine, BLinearGeo, BPath, BPointGeo, BPolygon, BPolyline, BRoundRectangle, and BSegment.

virtual BString ToWKT (  )  const [virtual]

Returns a Well-Known Text (WKT) string representing this BGeometry.

Returns:
A WKT string that describes this BGeometry.

virtual void Transform ( const BTransform cst  )  [virtual]

Transforms the coordinates in this BGeometry to a different coordinate system.

Parameters:
cst The BTransform that describes the transformation.

Reimplemented in BAggregateArea, BAggregateGeo, BAggregateLinear, BAggregatePoint, BArc, BDonut, BEllipse, BLine, BPath, BPointGeo, BPolygon, and BPolyline.

virtual void TransformReverse ( const BTransform cst  )  [virtual]

Transforms the coordinates in this BGeometry to a different coordinate system using the "reverse" of the BTransform.

Parameters:
cst The BTransform that describes the transformation.

Reimplemented in BAggregateArea, BAggregateGeo, BAggregateLinear, BAggregatePoint, BArc, BDonut, BEllipse, BLine, BPath, BPointGeo, BPolygon, and BPolyline.


Member Data Documentation

EGeometryClass m_class [protected]

The class of geometry contained in this object.

bool m_is3d [protected]

Indicates whether or not this BGeometry is three-dimensional.

bool m_isChanged [mutable, protected]

Indicates whether or not this BGeometry has been updated since the MBR was last calculated.

BRect m_mbr [mutable, protected]

The minimum bounding rectangle for this BGeometry object.

BRenditionPtr m_rendition [protected]

Pointer to a BRendition that can be used to override the feature rendition for this geometry.

EGeometryType m_type [protected]

The type of geometry contained in this object.

Reimplemented in BSegment.


The documentation for this class was generated from the following file:

GeoTranslate 5.0 From Blue Marble Geographics