本文整理汇总了C++中Series::GetBufferSize方法的典型用法代码示例。如果您正苦于以下问题:C++ Series::GetBufferSize方法的具体用法?C++ Series::GetBufferSize怎么用?C++ Series::GetBufferSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Series
的用法示例。
在下文中一共展示了Series::GetBufferSize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnPaint
void LineChart::OnPaint(wxPaintEvent &event){
wxPaintDC old_dc(this);
float zoomFactor = (float)_zoomPercentage / 100;
int w,h ;
GetClientSize(&w,&h);
if (w != _currentWidth || h != _currentHeight){
delete (_memBitmap);
_currentWidth = w;
_currentHeight = h;
_memBitmap = new wxBitmap(_currentWidth, _currentHeight);
}
/////////////////
// Create a memory DC
wxMemoryDC dc;
dc.SelectObject(*_memBitmap);
wxColor backColor = GetBackgroundColour();
dc.SetBackground(*wxTheBrushList->FindOrCreateBrush(backColor,wxSOLID));
dc.SetBrush(*wxTheBrushList->FindOrCreateBrush(backColor,wxSOLID));
dc.Clear();
DrawGrid(dc);
if (m_showScale){
m_leftEdge = DrawScale(dc);
}
else{
m_leftEdge = 0;
}
size_t largestBufferSize = GetMaxSeriesBufferSize();
double lastValue = 0;
for (SeriesMap::iterator it = m_seriesMap.begin(); it != m_seriesMap.end(); ++it){
float currentX = (float)m_leftEdge;
int lastX = (int)currentX;
int lastY;
Series *series = it->second;
dc.SetPen(*wxThePenList->FindOrCreatePen(series->GetColor(), 1, wxSOLID));
size_t bufSize = series->GetBufferSize();
Range *range = m_rangeArray[series->GetRangeId()];
if (bufSize > 0){
double minValue = range->GetMin();
double maxValue = range->GetMax();
double loggedValue = series->GetValueAt(0);
double percentageOfMax = (loggedValue - minValue) / (maxValue - minValue);
lastY = h - (int)(((double)h) * percentageOfMax);
size_t i = (size_t)(((double)largestBufferSize) * m_viewOffsetFactor);
while (i < bufSize && currentX < _currentWidth ){
if (i == m_markerIndex){
wxPen pen = dc.GetPen();
dc.SetPen(*wxThePenList->FindOrCreatePen(*wxLIGHT_GREY, 1, wxSOLID));
dc.DrawLine(currentX, 0, currentX, _currentHeight);
DrawCurrentValues(dc, i, currentX, CURRENT_VALUES_TOP_OFFSET);
dc.SetPen(pen);
}
loggedValue = series->GetValueAt(i);
if (DatalogValue::NULL_VALUE == loggedValue){
loggedValue = lastValue;
}
else{
lastValue = loggedValue;
}
double percentageOfMax = (loggedValue - minValue) / (maxValue - minValue);
int y = h - (int)(((double)h) * percentageOfMax);
dc.DrawLine(lastX, lastY, (int)currentX, y);
lastX = (int)currentX;
lastY = y;
currentX += zoomFactor;
i++;
}
}
}
if (m_showData) DrawMouseoverMarker(dc);
//blit into the real DC
old_dc.Blit(0,0,_currentWidth,_currentHeight,&dc,0,0);
}