OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimShapeFile.h
Go to the documentation of this file.
1 //*******************************************************************
2 //
3 // License: See top level LICENSE.txt file.
4 //
5 // Author: Garrett Potts
6 //
7 //*************************************************************************
8 // $Id: ossimShapeFile.h 19908 2011-08-05 19:57:34Z dburken $
9 
10 #ifndef ossimShapeFile_HEADER
11 #define ossimShapeFile_HEADER 1
12 
13 #include <iostream>
14 
15 #include <shapefil.h>
16 
18 #include <ossim/base/ossimRtti.h>
19 #include <ossim/base/ossimObject.h>
21 #include <ossim/base/ossimString.h>
22 #include <ossim/base/ossimDrect.h>
23 
24 
25 class ossimShapeFile;
27 
29 {
30 public:
32  const ossimShapeObject& rhs);
33 
35 
37 
38  void setShape(SHPObject* obj);
39  bool isLoaded()const;
40  long getIndex()const;
41  long getId()const;
42 
43  bool loadShape(const ossimShapeFile& shapeFile, long shapeRecord);
44 
46 
48 
49  void getBounds(double& minX, double& minY, double& minZ, double& minM,
50  double& maxX, double& maxY, double& maxZ, double& maxM)const;
51 
52  void getBounds(double& minX, double& minY,
53  double& maxX, double& maxY)const;
54 
55  void getBoundingRect(ossimDrect& result,
57 
59 
60  int getType()const;
61 
63 
64  int getPartType(ossim_uint32 partIndex)const;
65 
66  ossimString getPartByName(ossim_uint32 partIndex)const;
67 
69 
70  const SHPObject* getShapeObject()const;
71 
72 protected:
74  long theIndex;
75 };
76 
78 {
79 public:
81  const ossimShapeFile& rhs);
82 
84  virtual ~ossimShapeFile();
85 
86  virtual bool open(const ossimFilename& file,
87  const ossimString& flags=ossimString("rb"));
88 
89  virtual void close();
90 
91  bool isOpen()const;
92 
93  virtual SHPHandle getHandle();
94 
95  virtual const SHPHandle& getHandle()const;
96 
97  virtual std::ostream& print(std::ostream& out) const;
98 
99  virtual ossimString getShapeTypeString()const;
100 
101 
102  virtual long getNumberOfShapes()const;
103 
104  void getBounds(double& minX, double& minY, double& minZ, double& minM,
105  double& maxX, double& maxY, double& maxZ, double& maxM)const;
106 
107  void getBounds(double& minX, double& minY,
108  double& maxX, double& maxY)const;
109 
110  void getBoundingRect(ossimDrect& result,
112 
113  ossimDrect getBoundingRect(ossimCoordSysOrientMode orient = OSSIM_RIGHT_HANDED)const;
114 
115  const ossimFilename& getFilename()const;
116 
117 protected:
120 
121 TYPE_DATA
122 };
123 
124 #endif
int getPartType(ossim_uint32 partIndex) const
ossimFilename theFilename
ossimString getTypeByName() const
ossim_uint32 getNumberOfParts() const
void setShape(SHPObject *obj)
long getId() const
friend OSSIMDLLEXPORT std::ostream & operator<<(std::ostream &out, const ossimObject &obj)
friend std::ostream & operator<<(std::ostream &out, const ossimShapeObject &rhs)
ossimCoordSysOrientMode
SHPObject * theShape
virtual std::ostream & print(std::ostream &out) const
Generic print method.
bool loadShape(const ossimShapeFile &shapeFile, long shapeRecord)
ossim_uint32 getNumberOfVertices() const
#define TYPE_DATA
Definition: ossimRtti.h:339
unsigned int ossim_uint32
SHPHandle theHandle
ossimString getPartByName(ossim_uint32 partIndex) const
#define OSSIM_PLUGINS_DLL
void getBoundingRect(ossimDrect &result, ossimCoordSysOrientMode orient=OSSIM_RIGHT_HANDED) const
void getBounds(double &minX, double &minY, double &minZ, double &minM, double &maxX, double &maxY, double &maxZ, double &maxM) const
SHPObject * getShapeObject()
bool isLoaded() const
long getIndex() const
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23