scidavis  2.3.0
About: SciDAVis is a free application for Scientific Data Analysis and Visualization (a fork off of QtiPlot).
  Fossies Dox: scidavis-2.3.0.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

IntervalAttribute< bool > Class Reference

A class representing an interval-based attribute (bool version) More...

#include <IntervalAttribute.h>

Public Member Functions

 IntervalAttribute ()
 
 IntervalAttribute (QList< Interval< int > > intervals)
 
IntervalAttribute< bool > & operator= (const IntervalAttribute< bool > &other)
 
void setValue (Interval< int > i, bool value=true)
 
void setValue (int row, bool value)
 
bool isSet (int row) const
 
bool isSet (Interval< int > i) const
 
void insertRows (int before, int count)
 
void removeRows (int first, int count)
 
QList< Interval< int > > intervals () const
 
void clear ()
 

Private Attributes

QList< Interval< int > > d_intervals
 

Detailed Description

A class representing an interval-based attribute (bool version)

Definition at line 197 of file IntervalAttribute.h.

Constructor & Destructor Documentation

◆ IntervalAttribute() [1/2]

IntervalAttribute< bool >::IntervalAttribute ( )
inline

Definition at line 193 of file IntervalAttribute.h.

200 {}

◆ IntervalAttribute() [2/2]

IntervalAttribute< bool >::IntervalAttribute ( QList< Interval< int > >  intervals)
inline

Definition at line 193 of file IntervalAttribute.h.

Member Function Documentation

◆ clear()

void IntervalAttribute< bool >::clear ( )
inline

Definition at line 294 of file IntervalAttribute.h.

294 { d_intervals.clear(); }

References IntervalAttribute< T >::d_intervals.

Referenced by AbstractSimpleFilter::clearMasks().

Here is the caller graph for this function:

◆ insertRows()

void IntervalAttribute< bool >::insertRows ( int  before,
int  count 
)
inline

Definition at line 245 of file IntervalAttribute.h.

246  {
247  QList< Interval<int> > temp_list;
248  int c;
249  // first: split all intervals that contain 'before'
250  for(c=0; c<d_intervals.size(); c++)
251  {
252  if(d_intervals.at(c).contains(before))
253  {
254  temp_list = Interval<int>::split(d_intervals.at(c), before);
255  d_intervals.replace(c, temp_list.at(0));
256  if(temp_list.size()>1)
257  d_intervals.insert(c++, temp_list.at(1));
258 
259  }
260  }
261  // second: translate all intervals that start at 'before' or later
262  for(c=0; c<d_intervals.size(); c++)
263  {
264  if(d_intervals.at(c).start() >= before)
265  d_intervals[c].translate(count);
266  }
267 
268  }

References IntervalAttribute< T >::d_intervals.

◆ intervals()

QList< Interval<int> > IntervalAttribute< bool >::intervals ( ) const
inline

◆ isSet() [1/2]

bool IntervalAttribute< bool >::isSet ( int  row) const
inline

Definition at line 229 of file IntervalAttribute.h.

230  {
231  foreach(Interval<int> iv, d_intervals)
232  if(iv.contains(row))
233  return true;
234  return false;
235  }

References IntervalAttribute< T >::d_intervals.

Referenced by Column::Private::isInvalid(), Column::Private::isMasked(), and AbstractSimpleFilter::isMasked().

Here is the caller graph for this function:

◆ isSet() [2/2]

bool IntervalAttribute< bool >::isSet ( Interval< int >  i) const
inline

Definition at line 237 of file IntervalAttribute.h.

238  {
239  foreach(Interval<int> iv, d_intervals)
240  if(iv.contains(i))
241  return true;
242  return false;
243  }

References IntervalAttribute< T >::d_intervals.

◆ operator=()

IntervalAttribute<bool>& IntervalAttribute< bool >::operator= ( const IntervalAttribute< bool > &  other)
inline

Definition at line 202 of file IntervalAttribute.h.

203  {
204  d_intervals.clear();
205  foreach( Interval<int> iv, other.intervals())
206  d_intervals.append(iv);
207  return *this;
208  }

References IntervalAttribute< T >::d_intervals, and intervals().

Here is the call graph for this function:

◆ removeRows()

void IntervalAttribute< bool >::removeRows ( int  first,
int  count 
)
inline

Definition at line 270 of file IntervalAttribute.h.

271  {
272  int c;
273  // first: remove the relevant rows from all intervals
275  // second: translate all intervals that start at 'first+count' or later
276  for(c=0; c<d_intervals.size(); c++)
277  {
278  if(d_intervals.at(c).start() >= first+count)
279  d_intervals[c].translate(-count);
280  }
281  // third: merge as many intervals as possible
282  for(c=d_intervals.size()-1; c>=0; c--)
283  {
284  Interval<int> iv = d_intervals.takeAt(c);
285  int size_before = d_intervals.size();
287  if(size_before == d_intervals.size()) // merge successful
288  c--;
289  }
290  }

References IntervalAttribute< T >::d_intervals.

◆ setValue() [1/2]

void IntervalAttribute< bool >::setValue ( int  row,
bool  value 
)
inline

Definition at line 224 of file IntervalAttribute.h.

225  {
226  setValue(Interval<int>(row, row), value);
227  }

References IntervalAttribute< T >::setValue(), and IntervalAttribute< T >::value().

Here is the call graph for this function:

◆ setValue() [2/2]

void IntervalAttribute< bool >::setValue ( Interval< int >  i,
bool  value = true 
)
inline

Definition at line 210 of file IntervalAttribute.h.

211  {
212  if(value)
213  {
214  foreach(Interval<int> iv, d_intervals)
215  if(iv.contains(i))
216  return;
217 
219  } else { // unset
221  }
222  }

References IntervalAttribute< T >::d_intervals, and IntervalAttribute< T >::value().

Referenced by String2DateTimeFilter::invalidIntervals(), String2DayOfWeekFilter::invalidIntervals(), String2DoubleFilter::invalidIntervals(), String2MonthFilter::invalidIntervals(), TableView::selectedRows(), and AbstractSimpleFilter::setMasked().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ d_intervals

QList< Interval<int> > IntervalAttribute< bool >::d_intervals
private

Definition at line 297 of file IntervalAttribute.h.


The documentation for this class was generated from the following file:
IntervalAttribute< bool >::setValue
void setValue(Interval< int > i, bool value=true)
Definition: IntervalAttribute.h:210
IntervalAttribute< bool >::d_intervals
QList< Interval< int > > d_intervals
Definition: IntervalAttribute.h:297
IntervalAttribute< bool >::intervals
QList< Interval< int > > intervals() const
Definition: IntervalAttribute.h:292
Interval
Auxiliary class for interval based data.
Definition: Interval.h:211