/usr/include/ossim/base/ossimGeoPolygon.h is in libossim-dev 1.7.21-3ubuntu2.
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 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 | //*****************************************************************************
// FILE: ossimPolygon.h
//
// Copyright (C) 2001 ImageLinks, Inc.
//
// License: See top level LICENSE.txt file.
//
// AUTHOR: Garrett Potts
//
//*****************************************************************************
// $Id: ossimGeoPolygon.h 12760 2008-04-29 16:33:29Z 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():theCurrentVertex(-1),
theOrderingType(OSSIM_VERTEX_ORDER_UNKNOWN)
{}
ossimGeoPolygon(const std::vector<ossimGpt>& points)
:theVertexList(points),
theOrderingType(OSSIM_VERTEX_ORDER_UNKNOWN)
{
theCurrentVertex = 0;
}
ossimGeoPolygon(const ossimGeoPolygon& rhs)
{
theVertexList = rhs.theVertexList;
theOrderingType = rhs.theOrderingType;
theAttributeList = rhs.theAttributeList;
theHoleList = rhs.theHoleList;
theCurrentVertex = rhs.theCurrentVertex;
}
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)
{
if(&rhs != this)
{
theVertexList = rhs.theVertexList;
theCurrentVertex = rhs.theCurrentVertex;
theAttributeList = rhs.theAttributeList;
theHoleList = rhs.theHoleList;
}
theOrderingType = rhs.theOrderingType;
return *this;
}
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
|