In file polygon.h:

class XxxPolygonADT : public XxxLargeFixedADT

XxxPolygonADT: Basic ADT for handling any generic polygon data

Inheritance:


Public Classes

class InMemPolygon
InMemPolygon: In Memory polygon information
XXX_POLYGON polygon
The actual polygon represention, containing the array points, number of points, and bounding box
InMemPolygon (XXX_POLYGON PS)
Constructor for InMemPolygon
~InMemPolygon ()
Destructor for InMemPolygon
class PlanInfo : public XxxFuncPlanInfo
PlanInfo: Plan structure for methods on polygons
friend class XxxPolygonADT
friends that need to use the getMemPolygon method.
XxxErrCode execDisjoint (XxxValueEnv* Env, XxxADTValue *ReturnValue)
Disjoint method between this polygon and other objects
XxxErrCode execMeets (XxxValueEnv* Env, XxxADTValue *ReturnValue)
Meets method between this polygon and other objects
XxxErrCode execCovers (XxxValueEnv* Env, XxxADTValue *ReturnValue)
Covers method between this polygon and other objects -- polygons, boxes, or points
XxxErrCode execContains (XxxValueEnv* Env, XxxADTValue *ReturnValue)
Contains method between this polygon and other objects -- polygons, boxes, or points
XxxErrCode execOverlaps (XxxValueEnv* Env, XxxADTValue *ReturnValue)
Overlaps method between this polygon and other objects -- polygons or boxes
XxxErrCode execInside (XxxValueEnv* Env, XxxADTValue *ReturnValue)
Inside method between this polygon and other objects -- polygons, circles, or boxes
XxxErrCode execCoveredBy (XxxValueEnv* Env, XxxADTValue *ReturnValue)
Covered-by method between this polygon and other objects -- polygons, circles, or boxes
XxxErrCode execEquals (XxxValueEnv* Env, XxxADTValue *ReturnValue)
Equals method between this polygon and other objects -- obviously another polygon or box
XxxErrCode execBoundingBox (XxxValueEnv* Env, XxxADTValue *ReturnValue)
Bounding-box method of this polygon
XxxErrCode execSize (XxxValueEnv* Env, XxxADTValue *ReturnValue)
Size method of this polygon
static XxxErrCode getMemPolygon (PolygonStruct *PS, InMemPolygon*& Polygon)
Fetches the polygon data into memory
static XxxErrCode putMemPolygon (InMemPolygon* Polygon, PolygonStruct *PS, XxxShoreVolumeId &VolId, XxxShoreObjectId &FileId)
Writes the in-memory polygon data into SHORE
static XxxErrCode reclaimMemPolygon (PolygonStruct *PS)
Reclaims an in-memory polygon and its data
PlanInfo (const XxxFuncParseInfo* FuncParse, int ArgCount)
Constructor for PlanInfo
virtual ~PlanInfo ()
Destructor for PlanInfo
class PolygonMetaInfo : public XxxADTMetaInfo
PolygonMetaInfo: Meta Info for polygons
int AvgPolygonSize
Average polygon size
PolygonMetaInfo ()
Constructor for PolygonMetaInfo
virtual XxxErrCode Replicate (XxxADTMetaInfo*& NewMI)
Replication function for this polygon meta info
virtual ~PolygonMetaInfo ()
Destructor
virtual void Print (ostream& OStr)
Print
virtual XxxErrCode SerializeCopySize (int &Size)
Returns the number of bytes necessary to hold the serialized version of this meta-info object
virtual XxxErrCode SerializeCopy (char *Data)
Creates a binary version of this meta-info object
class PolygonStruct : public XxxADTValue
PolygonStruct: Contains the ADT information on the polygon
XXX_POLYGON polygon
Basic polygon info.
XxxShoreLogicalOID PolygonId
Shore ID of polygon data.
InMemPolygon* MemPolygon
In-memory polygon.

Public Fields

static XxxBasicType PolygonTypeId
Polygon's type ID.

Public Methods

virtual XxxBool GetBoundingBox (const XxxADTValue *&Object, XxxBoundingBox& Box)
Retrieves the bounding box of this spatial data type
virtual XxxErrCode GetCompOp (const char* FuncName, XxxCompareOp& CompOp, XxxBool& Success)
Retrieves the compare method given a function name and a array of arguments for that function
virtual XxxErrCode ReadText (istream& is, XxxADTValue* ObjectRef, const XxxADTMetaInfo* MetaInfo)
Input function for loading polygons into tables
virtual XxxErrCode WriteText (ostream& OutStream, const XxxADTValue* Object, const XxxADTMetaInfo *MetaInfo)
Display function for the txtclient protocol
XxxPolygonADT (XxxBasicType Id)
Constructor for XxxPolygonADT
virtual ~XxxPolygonADT ()
Destructor for XxxPolygonADT

Protected Fields

static const char* const POLYGONFILENAME
/ Polygon temp file name.

Protected Methods

virtual XxxErrCode getOid (const XxxADTValue *Object, XxxShoreVolumeId& VolId, XxxShoreObjectId& LocalId)
Retrieves a SHORE logical object ID from a char buffer
virtual XxxErrCode makeMetaInfo (const MetaInfoHandle& MIHandle, XxxADTMetaInfo*& MI)
Reads in the meta info for polygons
XxxErrCode parseMetaInfo (const char* MetaInfoString, MetaInfoHandle& MIHandle)
Parses the meta info
virtual XxxErrCode showDataFile (const char* FileName, ostream& OutStream, const XxxADTValue* Object, const XxxADTMetaInfo* MetaInfo)
Does nothing for now

Inherited from XxxLargeFixedADT:


Inherited from XxxLargeADT:

Public Classes

class XxxLargeADTEnv: public XxxADTEnv
enum XxxLargeADTDisplayTypeEnum
Determines the display type
typedef enum XxxLargeADTDisplayTypeEnum XxxLargeADTDisplayType
A typedef for easy reference
static const char* const DISPLAY_TYPE
The command referencing the next variable
XxxLargeADTDisplayType DisplayType
The desired display type
XxxShoreVolumeId StorageVolume
The volume on which the large ADTs store information
XxxShoreObjectId StorageFile
A file on the default volume which is persistent
XxxShoreObjectId TemporaryFile
A file on the default volume which is cleared after all Xacts end

Public Methods

virtual XxxErrCode CreateEnv( XxxADTEnv* &Env )
virtual XxxErrCode DeleteEnv( XxxADTEnv* Env )
virtual XxxErrCode GetResultSize(const XxxADTValue *ObjectRef, const XxxADTMetaInfo *MetaInfo, const char *Message, const int MessageSize, int &ResultSize)
virtual XxxBool IsSmall(const XxxADTMetaInfo*)
virtual XxxErrCode ServiceCallback(const XxxADTValue *ObjectRef, const XxxADTMetaInfo *MetaInfo, const char *Message, const int MessageSize, ostream &OStr)
virtual XxxBool SupportsCallback()

Documentation

XxxPolygonADT: Basic ADT for handling any generic polygon data. Polygons are stored as fixed size objects within a record. Consequently they hold an object ID of the actual polygon data stored in SHORE. The polygon data is a file containing a binary stream of doubles, first the x-coords, then the y-coords. The polygon ADT currently supports the following methods: disjoint(), meets(), covers(), contains(), inside(), covered_by(), overlaps(), equals(), size(), and bounding_box(). The first 6 of these methods come from the 9-point intersection model of spatial objects.
class PolygonMetaInfo: public XxxADTMetaInfo
PolygonMetaInfo: Meta Info for polygons. Currently it only contains info on the average polygon size.
See Also:
genadt.h types.

int AvgPolygonSize
Average polygon size

PolygonMetaInfo()
Constructor for PolygonMetaInfo

virtual XxxErrCode Replicate(XxxADTMetaInfo*& NewMI)
Replication function for this polygon meta info
Returns:
The status code.
Parameters:
NewMI - Reference to the newly replicated meta info.

virtual ~PolygonMetaInfo()
Destructor

virtual void Print(ostream& OStr)
Print
Returns:
Nothing.
Parameters:
OStr - Output stream.

virtual XxxErrCode SerializeCopySize(int &Size)
Returns the number of bytes necessary to hold the serialized version of this meta-info object
Returns:
XXX_NOT_OK if the object cannot be serialized, XXX_OK otherwise
Parameters:
Size - (out) The required number of bytes

virtual XxxErrCode SerializeCopy(char *Data)
Creates a binary version of this meta-info object
Returns:
XXX_NOT_OK if the object cannot be serialized, XXX_OK otherwise
Parameters:
Data - An array of bytes of at least the size specified by the SerializeCopySize() function.

class InMemPolygon
InMemPolygon: In Memory polygon information. Used by XxxPolygonADT whenever it needs to retrieve a polygon's data from SHORE and read it into a POLYGON.
Author:
Dave Koster dkoster@cs.cornell.edu
Version:
6/17/97
See Also:
geometry.h genadt.h

XXX_POLYGON polygon
The actual polygon represention, containing the array points, number of points, and bounding box

InMemPolygon(XXX_POLYGON PS)
Constructor for InMemPolygon
Parameters:
PS - Polygon info (number of points, etc.).

~InMemPolygon()
Destructor for InMemPolygon. Deletes the array of points in its XXX_POLYGON.

class PolygonStruct: public XxxADTValue
PolygonStruct: Contains the ADT information on the polygon. This includes more than just the number of points and bounding box; namely, the Shore ID of the polygon's data and also a pointer to the polygon's in-memory location, if it exists.
Author:
Dave Koster dkoster@cs.cornell.edu
Version:
6/17/97
See Also:
genadt.h

XXX_POLYGON polygon
Basic polygon info.

XxxShoreLogicalOID PolygonId
Shore ID of polygon data.

InMemPolygon* MemPolygon
In-memory polygon.

class PlanInfo: public XxxFuncPlanInfo
PlanInfo: Plan structure for methods on polygons. Contains all the different geographic intersection methods as well.
Author:
Dave Koster dkoster@cs.cornell.edu
Version:
6/17/97
See Also:
genadt.h

friend class XxxPolygonADT
friends that need to use the getMemPolygon method.

XxxErrCode execDisjoint(XxxValueEnv* Env, XxxADTValue *ReturnValue)
Disjoint method between this polygon and other objects. These other objects can be either polygons or boxes.
Returns:
The status code.
Parameters:
Env - Function environment.
ReturnValue - Where to write the answer.

XxxErrCode execMeets(XxxValueEnv* Env, XxxADTValue *ReturnValue)
Meets method between this polygon and other objects. These other objects can be either polygons or boxes. Meets simply checks if any of the two object's edges lie tangent to each other.
Returns:
The status code.
Parameters:
Env - Function environment.
ReturnValue - Where to write the answer.

XxxErrCode execCovers(XxxValueEnv* Env, XxxADTValue *ReturnValue)
Covers method between this polygon and other objects -- polygons, boxes, or points. This simply checks if this polygon "covers" another object.
Returns:
The status code.
Parameters:
Env - Function environment.
ReturnValue - Where to write the answer.

XxxErrCode execContains(XxxValueEnv* Env, XxxADTValue *ReturnValue)
Contains method between this polygon and other objects -- polygons, boxes, or points. This is the strict version of Covers -- i.e. the inner object must lie completely within this polygon.
Returns:
The status code.
Parameters:
Env - Function environment.
ReturnValue - Where to write the answer.

XxxErrCode execOverlaps(XxxValueEnv* Env, XxxADTValue *ReturnValue)
Overlaps method between this polygon and other objects -- polygons or boxes. This simply checks if this polygon overlaps any part of the argument object.
Returns:
The status code.
Parameters:
Env - Function environment.
ReturnValue - Where to write the answer.

XxxErrCode execInside(XxxValueEnv* Env, XxxADTValue *ReturnValue)
Inside method between this polygon and other objects -- polygons, circles, or boxes. This checks if this polygon lies completely inside the outer object. This is the stricter form of Covered-by.
Returns:
The status code.
Parameters:
Env - Function environment.
ReturnValue - Where to write the answer.

XxxErrCode execCoveredBy(XxxValueEnv* Env, XxxADTValue *ReturnValue)
Covered-by method between this polygon and other objects -- polygons, circles, or boxes. This checks if this polygon lies inside the outer object.
Returns:
The status code.
Parameters:
Env - Function environment.
ReturnValue - Where to write the answer.

XxxErrCode execEquals(XxxValueEnv* Env, XxxADTValue *ReturnValue)
Equals method between this polygon and other objects -- obviously another polygon or box.
Returns:
The status code.
Parameters:
Env - Function environment.
ReturnValue - Where to write the answer.

XxxErrCode execBoundingBox(XxxValueEnv* Env, XxxADTValue *ReturnValue)
Bounding-box method of this polygon. Simply writes the bounding box of this polygon into the ReturnValue.
Returns:
The status code.
Parameters:
Env - Function environment.
ReturnValue - Where to write the answer.

XxxErrCode execSize(XxxValueEnv* Env, XxxADTValue *ReturnValue)
Size method of this polygon. Currently, this incorrectly returns the area of the bounding box.
Returns:
The status code.
Parameters:
Env - Function environment.
ReturnValue - Where to write the answer.

static XxxErrCode getMemPolygon(PolygonStruct *PS, InMemPolygon*& Polygon)
Fetches the polygon data into memory

static XxxErrCode putMemPolygon(InMemPolygon* Polygon, PolygonStruct *PS, XxxShoreVolumeId &VolId, XxxShoreObjectId &FileId)
Writes the in-memory polygon data into SHORE

static XxxErrCode reclaimMemPolygon(PolygonStruct *PS)
Reclaims an in-memory polygon and its data

PlanInfo(const XxxFuncParseInfo* FuncParse, int ArgCount)
Constructor for PlanInfo
Parameters:
FuncParse - Parse info for this func expression.
ArgCount - Number of arguments to this function.

virtual ~PlanInfo()
Destructor for PlanInfo

XxxErrCode parseMetaInfo(const char* MetaInfoString, MetaInfoHandle& MIHandle)
Parses the meta info. Currently this can only consist of an average polygon size.

virtual XxxErrCode makeMetaInfo(const MetaInfoHandle& MIHandle, XxxADTMetaInfo*& MI)
Reads in the meta info for polygons.
Returns:
The status code.
Parameters:
MIHandle - Handle for storing the meta info.
MetaInfo - Reference to the meta info.

static const char* const POLYGONFILENAME
/ Polygon temp file name.

virtual XxxErrCode getOid(const XxxADTValue *Object, XxxShoreVolumeId& VolId, XxxShoreObjectId& LocalId)
Retrieves a SHORE logical object ID from a char buffer.
Returns:
The status code.
Parameters:
Object - Char buffer.
VolId - Reference to volume ID.
LocalId - Reference to object ID.

virtual XxxErrCode showDataFile(const char* FileName, ostream& OutStream, const XxxADTValue* Object, const XxxADTMetaInfo* MetaInfo)
Does nothing for now. The actual display goes on in the WriteText method.

static XxxBasicType PolygonTypeId
Polygon's type ID.

XxxPolygonADT(XxxBasicType Id)
Constructor for XxxPolygonADT.
Parameters:
Id - Type ID for polygon.

virtual ~XxxPolygonADT()
Destructor for XxxPolygonADT

virtual XxxErrCode WriteText(ostream& OutStream, const XxxADTValue* Object, const XxxADTMetaInfo *MetaInfo)
Display function for the txtclient protocol.
Returns:
The status code.
Parameters:
OutStream - Output stream to write to.
Object - Buffer containing the PolygonStruct.
MetaInfo - Meta info for polygons.

virtual XxxErrCode ReadText(istream& is, XxxADTValue* ObjectRef, const XxxADTMetaInfo* MetaInfo)
Input function for loading polygons into tables.
Returns:
The status code.
Parameters:
is - Input stream from which to read the PolygonStruct.
ObjectRef - Buffer in which to store the PolygonStruct.
MetaInfo - Meta info for polygons.

virtual XxxBool GetBoundingBox(const XxxADTValue *&Object, XxxBoundingBox& Box)
Retrieves the bounding box of this spatial data type. Used by the indexing methods.

virtual XxxErrCode GetCompOp(const char* FuncName, XxxCompareOp& CompOp, XxxBool& Success)
Retrieves the compare method given a function name and a array of arguments for that function. This is used in index scans and is index independent.


This class has no child classes.
Author:
Dave Koster dkoster@cs.cornell.edu
Version:
6/17/97
See Also:
geometry.h box.h point.h

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de