/*************************************************************************** * Copyright (C) 2005 by Tavarez Arnaud Bakoula * * tbakoula@yahoo.fr * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #include "tickrow.h" #include "tick.h" #include "utilities.h" TickRow::TickRow( uint idx, uint sz ) : CellRow( idx, sz ) { } TickRow::~TickRow() { // Nothing to do } /** This function create all the ticks of this manager. It must be called, once, after the instanciation of this object. */ void TickRow::createCells() { uint i=0; for ( ; ipush_back( cell ); computePosition( cell, i ); } } /** This function reset the state of all the tick contained in this row. */ void TickRow::reset() { cell_iterator it = cell_list->begin(); for ( ; it != cell_list->end(); it++ ) { Tick* tick = static_cast(*it); tick->setState( ABSENT ); tick->empty( TRUE ); } } /** This function is a specific reimplementation used to add cells of type Tick. */ void TickRow::appendCells( uint ap ) { uint i=0; for ( ; i!=ap; i++ ) { Cell* cell = new Tick( index, dim+i ); cell_list->push_back( cell ); computePosition( cell, dim+i ); } dim += ap; } void TickRow::ready() { cell_iterator it = cell_list->begin(); for ( ; it != cell_list->end(); it++ ) { Tick* tick = static_cast(*it); tick->setState( ABSENT ); tick->empty( TRUE ); } }