Exemplo n.º 1
0
void Maze::readFromFile(std::ifstream &f)
{
	for (int i = 0; i < size; i++)
	{
		for(int j = 0; j < size; j++)
		{

			f >> maze[i][j];
		}
	}
	x = getStartRow();
	y = getStartCol();
	startRow = getStartRow();
	startCol = getStartCol();
	endRow = getEndRow();
	endCol = getEndCol();
}
Exemplo n.º 2
0
bool DataRequestImp::validate(const RasterDataDescriptor *pDescriptor) const
{
   if (pDescriptor == NULL)
   {
      return false;
   }
   unsigned int numRows = pDescriptor->getRowCount();
   unsigned int numColumns = pDescriptor->getColumnCount();
   unsigned int numBands = pDescriptor->getBandCount();
   unsigned int bytesPerElement = pDescriptor->getBytesPerElement();
   unsigned int postLineBytes = 0;

   DimensionDescriptor startRow = getStartRow();
   DimensionDescriptor stopRow = getStopRow();
   unsigned int concurrentRows = getConcurrentRows();
   DimensionDescriptor startColumn = getStartColumn();
   DimensionDescriptor stopColumn = getStopColumn();
   unsigned int concurrentColumns = getConcurrentColumns();
   DimensionDescriptor startBand = getStartBand();
   DimensionDescriptor stopBand = getStopBand();
   unsigned int concurrentBands = getConcurrentBands();

   if (!startRow.isActiveNumberValid() || !stopRow.isActiveNumberValid() ||
      !startColumn.isActiveNumberValid() || !stopColumn.isActiveNumberValid() ||
      !startBand.isActiveNumberValid() || !stopBand.isActiveNumberValid())
   {
      return false;
   }

   //validate all the parameters before continuing
   if (startRow.getActiveNumber() >= numRows || 
      startRow.getActiveNumber() > stopRow.getActiveNumber() ||
      stopRow.getActiveNumber() >= numRows ||
      startColumn.getActiveNumber() >= numColumns ||
      startColumn.getActiveNumber() > stopColumn.getActiveNumber() ||
      stopColumn.getActiveNumber() >= numColumns ||
      startBand.getActiveNumber() >= numBands ||
      startBand.getActiveNumber() > stopBand.getActiveNumber() ||
      stopBand.getActiveNumber() >= numBands ||
      concurrentRows > stopRow.getActiveNumber()-startRow.getActiveNumber()+1 ||
      concurrentColumns > stopColumn.getActiveNumber()-startColumn.getActiveNumber()+1 ||
      concurrentBands > stopBand.getActiveNumber()-startBand.getActiveNumber()+1)
   {
      return false;
   }

   if (getInterleaveFormat() == BSQ)
   {
      // Can only get single-band BSQ accessors
      if (startBand != stopBand || concurrentBands != 1)
      {
         return false;
      }
   }

   return true;
}
Exemplo n.º 3
0
LRESULT ListCtrl::ongetProperties( UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled )
{
	switch(wParam)
	{
	case LCP_START_ROW:
		return getStartRow();
	case LCP_END_ROW:
		return getEndRow();
	case LCP_START_COL:
		return getStartCol();
	case LCP_END_COL:
		return getEndCol();
	case LCP_ROWNUM_WIDTH:
		return getRowNumBarWidth();
	default:
		return 0;
	}
}