Minsky
anonymous_namespace{sheet.cc}::ElisionRowChecker Struct Reference
Collaboration diagram for anonymous_namespace{sheet.cc}::ElisionRowChecker:
Collaboration graph

Public Member Functions

 ElisionRowChecker (ShowSlice slice, double height, double rowHeight, size_t size)
 
bool operator() (size_t &row, double &y) const
 

Public Attributes

size_t startRow
 
size_t numRows
 
size_t tailStartRow
 
double rowHeight
 

Detailed Description

Definition at line 186 of file sheet.cc.

Constructor & Destructor Documentation

◆ ElisionRowChecker()

anonymous_namespace{sheet.cc}::ElisionRowChecker::ElisionRowChecker ( ShowSlice  slice,
double  height,
double  rowHeight,
size_t  size 
)
inline

Definition at line 190 of file sheet.cc.

References minsky::head, minsky::headAndTail, and minsky::tail.

190  : rowHeight(rowHeight) {
191  switch (slice)
192  {
193  default: // just to shut up the "maybe uninitialised" checker.
194  case ShowSlice::head:
196  numRows=std::min(size, size_t(height/rowHeight+1));
197  break;
198  case ShowSlice::headAndTail:
199  startRow=0;
200  numRows=std::min(size, size_t(0.5*height/rowHeight-1));
201  tailStartRow=size-numRows;
202  if (numRows<size && 2*numRows*rowHeight>height)
203  tailStartRow++;
204  break;
205  case ShowSlice::tail:
206  numRows=std::min(size, size_t(height/rowHeight-1));
208  break;
209  }
210  }

Member Function Documentation

◆ operator()()

bool anonymous_namespace{sheet.cc}::ElisionRowChecker::operator() ( size_t &  row,
double &  y 
) const
inline

Definition at line 211 of file sheet.cc.

211  {
212  if (row==startRow+numRows && row<tailStartRow)
213  {
214  row=tailStartRow; // for middle elision
215  y+=rowHeight;
216  }
217  return row>=tailStartRow+numRows;
218  }

Member Data Documentation

◆ numRows

size_t anonymous_namespace{sheet.cc}::ElisionRowChecker::numRows

Definition at line 188 of file sheet.cc.

◆ rowHeight

double anonymous_namespace{sheet.cc}::ElisionRowChecker::rowHeight

Definition at line 189 of file sheet.cc.

◆ startRow

size_t anonymous_namespace{sheet.cc}::ElisionRowChecker::startRow

Definition at line 188 of file sheet.cc.

◆ tailStartRow

size_t anonymous_namespace{sheet.cc}::ElisionRowChecker::tailStartRow

Definition at line 188 of file sheet.cc.


The documentation for this struct was generated from the following file: