Exemplo n.º 1
0
double& Matrix::At(const uint32_t &i, const uint32_t &j) {
  if (i >= this->rows_ || j >= this->cols_) {
    throw BadIndexException("Index out of bounds.");
  }

  return this->data_[i][j];
}
Exemplo n.º 2
0
// retourne la piece situee a l'index donne
Piece* ListPiece::get(int index){
    if ((index<0)||(index>=this->size())){
        // index hors des limites de la liste
        throw BadIndexException();
    }
    // placement de l'iterateur sur le premier element
    list<Piece*>::const_iterator ci=this->pieces->begin();
    for (int i=0;i<index;i++){
        ci++;
    }
    return *ci;
}
Exemplo n.º 3
0
		math::Vector3& BoundingBox::operator[](int i){
			if(i<0 || i>1)
				throw BadIndexException("Bad index while getting BoundingBox's Vector3!");
			return position[i];
		}
Exemplo n.º 4
0
		word MS3DGroup::operator[](int i){
			if(i<0 || i>=numTriangles)
				throw BadIndexException("Bad triangle index at MS3DGroup!");
			return triangleIndices[i];
		}