Beispiel #1
0
static void _update_row( QTableWidget * table,const T& list,int row,const QFont& font )
{
	_manage_row( table,list,[ & ](){

		_for_each_column( table,row,[ & ]( count_t row,count_t col ){

			_set_item( table->item( row,col ),_at( list,col ),font ) ;
		} ) ;
	} ) ;
}
Beispiel #2
0
static void _add_row( QTableWidget * table,const T& l,const QFont& font )
{
	_manage_row( table,l,[ & ](){

		count_t row = table->rowCount() ;

		table->insertRow( row ) ;

		_for_each_column( table,row,[ & ]( count_t row,count_t col ){

			auto e = _set_item( new QTableWidgetItem,_at( l,col ),font ) ;

			table->setItem( row,col,e ) ;
		} ) ;
	} ) ;
}
Beispiel #3
0
Datei: poi.C Projekt: wixor/ewo
/* check if o.id can visit field (o.xi, o,yi) */
bool ProximityMap::canVisit(const djk &o) const
{
    /* first check if the field exists */
    if(o.xi < 0 || o.yi < 0 || o.xi >= widet || o.yi >= hedet) 
        return false;

    /* then check if there's free space in the field */
    poiid_t k = usedEntries[o.yi][o.xi];
    if(k == entries) 
        return false;

    /* finally check if the field has been visited yet 
     * TODO: performance here can be propably improved */
    const poiid_t *entries = _at(o.xi,o.yi);
    for(int i=k-1; i>=0; i--)
        if(entries[i] == o.id)
            return false;
    
    return true;
}
Beispiel #4
0
 bool   operator () (int i, int j) const { return _at(i,j); }
Beispiel #5
0
 BitRef operator () (int i, int j)       { return _at(i,j); }
Beispiel #6
0
template<unsigned N> void BinaryRelation<N>::merge(int i, int j)
{
    //Assert (not _at(i,j), "...");
    for (int k=0; k<N; ++k) { BitRef b = _at(j,k); b = b | _at(i,k); }
    for (int k=0; k<N; ++k) { BitRef b = _at(k,j); b = b | _at(k,i); }
}
Beispiel #7
0
template<unsigned N> void BinaryRelation<N>::insert(int i)
{
    for (int j=0; j<N; ++j) _at(i,j) = false;
    for (int j=0; j<N; ++j) _at(j,i) = false;
}
Beispiel #8
0
template<unsigned N> void BinaryRelation<N>::merge(int i, int j)
{ for (int k=0; k<N; ++k) { BitRef b = _at(j,k); b = b | _at(i,k); } }
Beispiel #9
0
image::const_reference image::operator()(image::size_type x, image::size_type y) const
{
 // std::cout << "x: "<<x<< " y: " << y << std::endl;
  assert(x < width() && y < height());
  return _at(x,y);
}
Beispiel #10
0
image::reference image::operator()(image::size_type x, image::size_type y)
{
  assert(x < width() && y < height());
  return _at(x,y);
}
Beispiel #11
0
 char at(std::size_t _Index) const { return _at(_Index); }
Beispiel #12
0
 bool operator()(std::size_t i, std::size_t j) const noexcept {
     assert(i < nodes_count() && j < nodes_count());
     return _at(i,j);
 }
Beispiel #13
0
 auto neighbors(std::size_t node)
 {
     return ranges::view::iota(0u, nodes_count() - 1) |
            ranges::view::remove_if([=](int i){ return !_at(node, i); });
 }
Beispiel #14
0
Datei: poi.C Projekt: wixor/ewo
void ProximityMap::pushEntry(const djk &o)
{
    poiid_t *k = &usedEntries[o.yi][o.xi];
    assert(*k < entries);
    _at(o.xi,o.yi)[(*k)++] = o.id;
}