/usr/include/ossim/base/ossimGeoPolygon.h is in libossim-dev 2.2.2-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | //*****************************************************************************
// FILE: ossimPolygon.h
//
// Copyright (C) 2001 ImageLinks, Inc.
//
// License: See top level LICENSE.txt file.
//
// AUTHOR: Garrett Potts
//
//*****************************************************************************
// $Id: ossimGeoPolygon.h 23166 2015-02-24 20:57:50Z dburken $
#ifndef ossimGeoPolygon_HEADER
#define ossimGeoPolygon_HEADER
#include <vector>
#include <ossim/base/ossimGpt.h>
class ossimKeywordlist;
class OSSIMDLLEXPORT ossimGeoPolygon
{
public:
friend OSSIM_DLL std::ostream& operator <<(std::ostream& out, const ossimGeoPolygon& poly);
ossimGeoPolygon();
ossimGeoPolygon(const std::vector<ossimGpt>& points);
ossimGeoPolygon(const ossimGeoPolygon& rhs);
bool addWmsBbox(const ossimString& wmsBbox);
void addPoint(const ossimGpt& pt)
{
theVertexList.push_back(pt);
}
void addPoint(double lat, double lon, double h=ossim::nan(), const ossimDatum* datum=0)
{
theVertexList.push_back(ossimGpt(lat, lon, h, datum));
}
void addAttribute( const ossimString& attribute )
{
theAttributeList.push_back( attribute );
}
void addHole( const ossimGeoPolygon& polygon )
{
theHoleList.push_back( polygon );
}
ossimGpt& operator[](int index)
{
return theVertexList[index];
}
const ossimGpt& operator[](int index)const
{
return theVertexList[index];
}
const std::vector<ossimGpt>& getVertexList()const
{
return theVertexList;
}
std::vector<ossimString>& getAttributeList()
{
return theAttributeList;
}
std::vector<ossimGeoPolygon>& getHoleList()
{
return theHoleList;
}
void clear()
{
theVertexList.clear();
}
ossim_uint32 size()const
{
return (ossim_uint32)theVertexList.size();
}
void resize(ossim_uint32 newSize)
{
theVertexList.resize(newSize);
theCurrentVertex = 0;
theOrderingType = OSSIM_VERTEX_ORDER_UNKNOWN;
}
const ossimGeoPolygon& operator = (const std::vector<ossimGpt>& rhs)
{
theVertexList = rhs;
theCurrentVertex = 0;
theOrderingType = OSSIM_VERTEX_ORDER_UNKNOWN;
return *this;
}
const ossimGeoPolygon& operator = (const ossimGeoPolygon& rhs);
void stretchOut(ossimGeoPolygon& newPolygon,
double displacement);
double area()const;
ossimGpt computeCentroid()const;
bool vertex(int index, ossimGpt& v) const;
bool nextVertex(ossimDpt& v) const;
bool hasNans()const;
void reverseOrder();
bool saveState(ossimKeywordlist& kwl,
const char* prefix=0)const;
bool loadState(const ossimKeywordlist& kwl,
const char* prefix=0);
void checkOrdering()const;
ossimVertexOrdering getOrdering()const
{
if(theOrderingType == OSSIM_VERTEX_ORDER_UNKNOWN)
{
checkOrdering();
}
return theOrderingType;
}
void setOrdering(ossimVertexOrdering ordering)
{
theOrderingType = ordering;
}
protected:
std::vector<ossimGpt> theVertexList;
std::vector<ossimString> theAttributeList;
std::vector<ossimGeoPolygon> theHoleList;
mutable ossim_int32 theCurrentVertex;
/*!
* This enumeration is found in ossimConstants.h
*/
mutable ossimVertexOrdering theOrderingType;
};
#endif
|