OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
Functions
ossimShapeFile.cpp File Reference
#include <iomanip>
#include <ossimShapeFile.h>

Go to the source code of this file.

Functions

 RTTI_DEF1 (ossimShapeFile, "ossimShapeFile", ossimObject)
 
std::ostream & operator<< (std::ostream &out, const ossimShapeObject &rhs)
 
std::ostream & operator<< (std::ostream &out, const ossimShapeFile &rhs)
 

Function Documentation

◆ operator<<() [1/2]

std::ostream& operator<< ( std::ostream &  out,
const ossimShapeObject rhs 
)

Definition at line 18 of file ossimShapeFile.cpp.

References ossimString::c_str(), ossimShapeObject::getBounds(), ossimShapeObject::getId(), ossimShapeObject::getNumberOfParts(), ossimShapeObject::getNumberOfVertices(), ossimShapeObject::getTypeByName(), ossimShapeObject::isLoaded(), SHPObject::panPartStart, SHPObject::panPartType, ossimShapeObject::theShape, and ossimString::toString().

19 {
20  if(rhs.isLoaded())
21  {
22  double minx, miny, minz, minm;
23  double maxx, maxy, maxz, maxm;
24  ossim_uint32 i = 0;
25 
26  rhs.getBounds(minx, miny, minz, minm,
27  maxx, maxy, maxz, maxm);
28 
29  out << std::setw(15) << setiosflags(std::ios::left)<<"type:"<<rhs.getTypeByName() << std::endl
30  << std::setw(15) << setiosflags(std::ios::left)<<"id:"<<rhs.getId()<<std::endl
31  << std::setw(15) << setiosflags(std::ios::left)<<"minx:"<<minx <<std::endl
32  << std::setw(15) << setiosflags(std::ios::left)<<"miny:"<<miny <<std::endl
33  << std::setw(15) << setiosflags(std::ios::left)<<"minz:"<<minz <<std::endl
34  << std::setw(15) << setiosflags(std::ios::left)<<"minm:"<<minm <<std::endl
35  << std::setw(15) << setiosflags(std::ios::left)<<"maxx:"<<maxx <<std::endl
36  << std::setw(15) << setiosflags(std::ios::left)<<"maxy:"<<maxy <<std::endl
37  << std::setw(15) << setiosflags(std::ios::left)<<"maxz:"<<maxz <<std::endl
38  << std::setw(15) << setiosflags(std::ios::left)<<"maxm:"<<maxm <<std::endl
39  << std::setw(15) << setiosflags(std::ios::left)<<"parts:"<<rhs.getNumberOfParts()<<std::endl
40  << std::setw(15) << setiosflags(std::ios::left)<<"vertices:"<<rhs.getNumberOfVertices();
41 
42  if(rhs.getNumberOfParts())
43  {
44  out << std::endl;
45  for(i = 0; i < rhs.getNumberOfParts()-1; ++i)
46  {
47  ossimString s1 = "part start ";
48  ossimString s2 = "part type ";
49  s1 += (ossimString::toString(i+1)+":");
50  s2 += (ossimString::toString(i+1)+":");
51 
52  out << std::setw(15) << setiosflags(std::ios::left) << s1.c_str() << rhs.theShape->panPartStart[i]<<std::endl;
53  out << std::setw(15) << setiosflags(std::ios::left) << s2.c_str() << SHPPartTypeName(rhs.theShape->panPartType[i])<<std::endl;
54  }
55  ossimString s1 = "part start ";
56  ossimString s2 = "part type ";
57 
58  s1 += (ossimString::toString(rhs.getNumberOfParts())+":");
59  out << std::setw(15) << setiosflags(std::ios::left) << s1.c_str() << rhs.theShape->panPartStart[i]<<std::endl;
60  out << std::setw(15) << setiosflags(std::ios::left) << s2.c_str() << SHPPartTypeName(rhs.theShape->panPartType[i]);
61  }
62 
63  out << std::setw(0);
64 
65  }
66  return out;
67 }
ossimString getTypeByName() const
ossim_uint32 getNumberOfParts() const
long getId() const
static ossimString toString(bool aValue)
Numeric to string methods.
int * panPartType
Definition: shapefil.h:285
SHPObject * theShape
ossim_uint32 getNumberOfVertices() const
unsigned int ossim_uint32
int * panPartStart
Definition: shapefil.h:284
void getBounds(double &minX, double &minY, double &minZ, double &minM, double &maxX, double &maxY, double &maxZ, double &maxM) const
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string&#39;s contents...
Definition: ossimString.h:396
bool isLoaded() const

◆ operator<<() [2/2]

std::ostream& operator<< ( std::ostream &  out,
const ossimShapeFile rhs 
)

Definition at line 306 of file ossimShapeFile.cpp.

References ossimShapeFile::print().

307 {
308  rhs.print(out);
309 
310  return out;
311 }
virtual std::ostream & print(std::ostream &out) const
Generic print method.

◆ RTTI_DEF1()

RTTI_DEF1 ( ossimShapeFile  ,
"ossimShapeFile"  ,
ossimObject   
)