Example #1
0
/* private */
void
Centroid::add(const Polygon& poly)
{
  addShell(*poly.getExteriorRing()->getCoordinatesRO());
  for (size_t i = 0; i < poly.getNumInteriorRing(); i++) {
    addHole(*poly.getInteriorRingN(i)->getCoordinatesRO());
  }
}
Example #2
0
/*
Deallocate a process with a given pid. Must combine holes if needed, 
or add a new hole where the process was originally.
*/
int deallocate(int pid)
{ //deallocate memory allocated to this process
  // return 1 if successful, -1 otherwise with an error message
  if(addHole(pid) == -1) //process does not exist in memory
    return -1;
  removeProcess(pid);
	return 0;
}
Example #3
0
void
CentroidArea::add(const Polygon *poly)
{
	addShell(poly->getExteriorRing()->getCoordinatesRO());
	for(size_t i=0, n=poly->getNumInteriorRing(); i<n; ++i)
	{
		addHole(poly->getInteriorRingN(i)->getCoordinatesRO());
	}
}
Example #4
0
void MapChunk::addHoleBig(int i, int j)
{
	for (int x = -3; x < 4; ++x)
	{
		for (int y = -3; y < 4; ++y)
		{
			addHole(i + x, j + y);
		}
	}
}
Example #5
0
void Polygon::insertHole(int index, const std::vector<PolygonVertex>& vertices)
{
	if (index < 0)
		addHole(vertices);
	m_impl->setInnerRing(static_cast<size_t>(index), convert(vertices));
}