?? mitab.h
字號:
* * In MapInfo, an arc is defined by the coords of the MBR corners of its * defining ellipse, which in this case is different from the arc's MBR, * and a start and end angle in degrees. * * Feature geometry can be either an OGRLineString or an OGRPoint. * * In any case, X/Y radius X/Y center, and start/end angle (in degrees * counterclockwise) MUST be set. * * When an arc is read, the returned geometry is an OGRLineString * representing the arc with 2 degrees line segments. *--------------------------------------------------------------------*/class TABArc: public TABFeature, public ITABFeaturePen{ private: double m_dStartAngle; // In degrees, counterclockwise, double m_dEndAngle; // starting at 3 o'clock public: TABArc(OGRFeatureDefn *poDefnIn); virtual ~TABArc(); virtual TABFeatureClass GetFeatureClass() { return TABFCArc; }; virtual int ValidateMapInfoType(TABMAPFile *poMapFile = NULL); virtual TABFeature *CloneTABFeature(OGRFeatureDefn *poNewDefn = NULL ); virtual int ReadGeometryFromMAPFile(TABMAPFile *poMapFile, TABMAPObjHdr *); virtual int WriteGeometryToMAPFile(TABMAPFile *poMapFile, TABMAPObjHdr *); virtual int ReadGeometryFromMIFFile(MIDDATAFile *fp); virtual int WriteGeometryToMIFFile(MIDDATAFile *fp); virtual const char *GetStyleString(); virtual void DumpMIF(FILE *fpOut = NULL); double GetStartAngle() { return m_dStartAngle; }; double GetEndAngle() { return m_dEndAngle; }; void SetStartAngle(double dAngle); void SetEndAngle(double dAngle); // MapInfo-specific attributes... made available through public vars // for now. double m_dCenterX; double m_dCenterY; double m_dXRadius; double m_dYRadius;};/*--------------------------------------------------------------------- * class TABText * * Feature class to handle the MapInfo text types: * * TAB_GEOM_TEXT_C 0x10 * TAB_GEOM_TEXT 0x11 * * Feature geometry is an OGRPoint corresponding to the lower-left * corner of the text MBR BEFORE ROTATION. * * Text string, and box height/width (box before rotation is applied) * are required in a valid text feature and MUST be set. * Text angle and other styles are optional. *--------------------------------------------------------------------*/class TABText: public TABFeature, public ITABFeatureFont, public ITABFeaturePen{ protected: char *m_pszString; double m_dAngle; double m_dHeight; double m_dWidth; double m_dfLineEndX; double m_dfLineEndY; GBool m_bLineEndSet; void UpdateTextMBR(); GInt32 m_rgbForeground; GInt32 m_rgbBackground; GInt16 m_nTextAlignment; // Justification/Vert.Spacing/arrow GInt16 m_nFontStyle; // Bold/italic/underlined/shadow/... const char *GetLabelStyleString(); public: TABText(OGRFeatureDefn *poDefnIn); virtual ~TABText(); virtual TABFeatureClass GetFeatureClass() { return TABFCText; }; virtual int ValidateMapInfoType(TABMAPFile *poMapFile = NULL); virtual TABFeature *CloneTABFeature(OGRFeatureDefn *poNewDefn = NULL ); virtual int ReadGeometryFromMAPFile(TABMAPFile *poMapFile, TABMAPObjHdr *); virtual int WriteGeometryToMAPFile(TABMAPFile *poMapFile, TABMAPObjHdr *); virtual int ReadGeometryFromMIFFile(MIDDATAFile *fp); virtual int WriteGeometryToMIFFile(MIDDATAFile *fp); virtual const char *GetStyleString(); virtual void DumpMIF(FILE *fpOut = NULL); const char *GetTextString(); double GetTextAngle(); double GetTextBoxHeight(); double GetTextBoxWidth(); GInt32 GetFontFGColor(); GInt32 GetFontBGColor(); void GetTextLineEndPoint(double &dX, double &dY); TABTextJust GetTextJustification(); TABTextSpacing GetTextSpacing(); TABTextLineType GetTextLineType(); GBool QueryFontStyle(TABFontStyle eStyleToQuery); void SetTextString(const char *pszStr); void SetTextAngle(double dAngle); void SetTextBoxHeight(double dHeight); void SetTextBoxWidth(double dWidth); void SetFontFGColor(GInt32 rgbColor); void SetFontBGColor(GInt32 rgbColor); void SetTextLineEndPoint(double dX, double dY); void SetTextJustification(TABTextJust eJust); void SetTextSpacing(TABTextSpacing eSpacing); void SetTextLineType(TABTextLineType eLineType); void ToggleFontStyle(TABFontStyle eStyleToToggle, GBool bStatus); int GetFontStyleMIFValue(); void SetFontStyleMIFValue(int nStyle, GBool bBGColorSet=FALSE); GBool IsFontBGColorUsed(); int GetFontStyleTABValue() {return m_nFontStyle;}; void SetFontStyleTABValue(int nStyle){m_nFontStyle=(GInt16)nStyle;};};/*--------------------------------------------------------------------- * class TABMultiPoint * * Feature class to handle MapInfo Multipoint features: * * TAB_GEOM_MULTIPOINT_C 0x34 * TAB_GEOM_MULTIPOINT 0x35 * * Feature geometry will be a OGRMultiPoint * * The symbol number is in the range [31..67], with 31=None and corresponds * to one of the 35 predefined "Old MapInfo Symbols" *--------------------------------------------------------------------*/class TABMultiPoint: public TABFeature, public ITABFeatureSymbol{ private: // We call it center, but it's more like a label point // Its value default to be the location of the first point GBool m_bCenterIsSet; double m_dCenterX, m_dCenterY; public: TABMultiPoint(OGRFeatureDefn *poDefnIn); virtual ~TABMultiPoint(); virtual TABFeatureClass GetFeatureClass() { return TABFCMultiPoint; }; virtual int ValidateMapInfoType(TABMAPFile *poMapFile = NULL); virtual TABFeature *CloneTABFeature(OGRFeatureDefn *poNewDefn = NULL ); int GetXY(int i, double &dX, double &dY); int GetNumPoints(); int GetCenter(double &dX, double &dY); void SetCenter(double dX, double dY); int ReadGeometryFromMAPFile(TABMAPFile *poMapFile, TABMAPObjHdr *, TABMAPCoordBlock **ppoCoordBlock); virtual int ReadGeometryFromMAPFile(TABMAPFile *poMapFile, TABMAPObjHdr *); virtual int WriteGeometryToMAPFile(TABMAPFile *poMapFile, TABMAPObjHdr *); virtual int ReadGeometryFromMIFFile(MIDDATAFile *fp); virtual int WriteGeometryToMIFFile(MIDDATAFile *fp); virtual const char *GetStyleString(); virtual void DumpMIF(FILE *fpOut = NULL);};/*--------------------------------------------------------------------- * * class TABCollection * * Feature class to handle MapInfo Collection features: * * TAB_GEOM_COLLECTION_C 0x37 * TAB_GEOM_COLLECTION 0x38 * * Feature geometry will be a OGRCollection * * **** IMPORTANT NOTE: **** * * The current implementation does not allow setting the Geometry via * OGRFeature::SetGeometry*(). The geometries must be set via the * TABCollection::SetRegion/Pline/MpointDirectly() methods which will take * care of keeping the OGRFeature's geometry in sync. * * If we ever want to support creating collections via the OGR interface then * something should be added in TABCollection::WriteGeometryToMapFile(), or * perhaps in ValidateMapInfoType(), or even better in a custom * TABCollection::SetGeometry*()... but then this last option may not work * unless OGRFeature::SetGeometry*() are made virtual in OGR. * *--------------------------------------------------------------------*/class TABCollection: public TABFeature, public ITABFeatureSymbol{ private: TABRegion *m_poRegion; TABPolyline *m_poPline; TABMultiPoint *m_poMpoint; void EmptyCollection(); int ReadLabelAndMBR(TABMAPCoordBlock *poCoordBlock, GBool bComprCoord, GInt32 nComprOrgX, GInt32 nComprOrgY, GInt32 &pnMinX, GInt32 &pnMinY, GInt32 &pnMaxX, GInt32 &pnMaxY, GInt32 &pnLabelX, GInt32 &pnLabelY ); int WriteLabelAndMBR(TABMAPCoordBlock *poCoordBlock, GBool bComprCoord, GInt32 nMinX, GInt32 nMinY, GInt32 nMaxX, GInt32 nMaxY, GInt32 nLabelX, GInt32 nLabelY ); int SyncOGRGeometryCollection(GBool bSyncRegion, GBool bSyncPline, GBool bSyncMpoint); public: TABCollection(OGRFeatureDefn *poDefnIn); virtual ~TABCollection(); virtual TABFeatureClass GetFeatureClass() { return TABFCCollection; }; virtual int ValidateMapInfoType(TABMAPFile *poMapFile = NULL); virtual TABFeature *CloneTABFeature(OGRFeatureDefn *poNewDefn = NULL ); virtual int ReadGeometryFromMAPFile(TABMAPFile *poMapFile, TABMAPObjHdr *); virtual int WriteGeometryToMAPFile(TABMAPFile *poMapFile, TABMAPObjHdr *); virtual int ReadGeometryFromMIFFile(MIDDATAFile *fp); virtual int WriteGeometryToMIFFile(MIDDATAFile *fp); virtual const char *GetStyleString(); virtual void DumpMIF(FILE *fpOut = NULL); TABRegion *GetRegionRef() {return m_poRegion; }; TABPolyline *GetPolylineRef() {return m_poPline; }; TABMultiPoint *GetMultiPointRef() {return m_poMpoint; }; int SetRegionDirectly(TABRegion *poRegion); int SetPolylineDirectly(TABPolyline *poPline); int SetMultiPointDirectly(TABMultiPoint *poMpoint);};/*--------------------------------------------------------------------- * class TABDebugFeature * * Feature class to use for testing purposes... this one does not * correspond to any MapInfo type... it's just used to dump info about * feature types that are not implemented yet. *--------------------------------------------------------------------*/class TABDebugFeature: public TABFeature{ private: GByte m_abyBuf[512]; int m_nSize; int m_nCoordDataPtr; // -1 if none int m_nCoordDataSize; public: TABDebugFeature(OGRFeatureDefn *poDefnIn); virtual ~TABDebugFeature(); virtual TABFeatureClass GetFeatureClass() { return TABFCDebugFeature; }; virtual int ReadGeometryFromMAPFile(TABMAPFile *poMapFile, TABMAPObjHdr *); virtual int WriteGeometryToMAPFile(TABMAPFile *poMapFile, TABMAPObjHdr *); virtual int ReadGeometryFromMIFFile(MIDDATAFile *fp); virtual int WriteGeometryToMIFFile(MIDDATAFile *fp); virtual void DumpMIF(FILE *fpOut = NULL);};/* -------------------------------------------------------------------- *//* Some stuff related to spatial reference system handling. *//* -------------------------------------------------------------------- */char *MITABSpatialRef2CoordSys( OGRSpatialReference * );OGRSpatialReference * MITABCoordSys2SpatialRef( const char * );GBool MITABExtractCoordSysBounds( const char * pszCoordSys, double &dXMin, double &dYMin, double &dXMax, double &dYMax );int MITABCoordSys2TABProjInfo(const char * pszCoordSys, TABProjInfo *psProj);typedef struct { int nMapInfoDatumID; const char *pszOGCDatumName; int nEllipsoid; double dfShiftX; double dfShiftY; double dfShiftZ; double dfDatumParm0; /* RotX */ double dfDatumParm1; /* RotY */ double dfDatumParm2; /* RotZ */ double dfDatumParm3; /* Scale Factor */ double dfDatumParm4; /* Prime Meridian */} MapInfoDatumInfo;typedef struct{ int nMapInfoId; const char *pszMapinfoName; double dfA; /* semi major axis in meters */ double dfInvFlattening; /* Inverse flattening */} MapInfoSpheroidInfo;/*--------------------------------------------------------------------- * The following are used for coordsys bounds lookup *--------------------------------------------------------------------*/typedef struct{ TABProjInfo sProj; /* Projection/datum definition */ double dXMin; /* Default bounds for that coordsys */ double dYMin; double dXMax; double dYMax;} MapInfoBoundsInfo;GBool MITABLookupCoordSysBounds(TABProjInfo *psCS, double &dXMin, double &dYMin, double &dXMax, double &dYMax);int MITABLoadCoordSysTable(const char *pszFname);void MITABFreeCoordSysTable();GBool MITABCoordSysTableLoaded();#endif /* _MITAB_H_INCLUDED_ */
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -