void Graph::DrawXAxis(QSGNode * rootNode) { QRectF bounds = boundingRect(); // X AXIS FEATURES for (QList<float>::iterator i = xAxis.major.begin(); i != xAxis.major.end(); i++) { float x = graphToNodeX(*i); float y = boundingRect().height() + xLabelOffset; _drawLine(rootNode, m_primaryLineColor, x, bounds.top(), x, bounds.bottom(), 2); _drawLabel(x, y, QString::number(*i), xAxisLabels); } for (QList<float>::iterator i = xAxis.minor.begin(); i != xAxis.minor.end(); i++) { float x = graphToNodeX(*i); float y = boundingRect().height() + xLabelOffset; _drawLine(rootNode, m_primaryLineColor.darker(),x, bounds.top(), x, bounds.bottom(), -1); _drawLabel(x, y, QString::number(*i), xAxisLabels); } for (QList<float>::iterator i = xAxis.subminor.begin(); i != xAxis.subminor.end(); i++) { float x = graphToNodeX(*i); float y = boundingRect().height() + xLabelOffset; _drawLine(rootNode, m_primaryLineColor.darker(), x, bounds.bottom(), x, bounds.top(), 0.5); _drawLabel(x, y, QString::number(*i), xAxisLabels); } // We can draw ticks, but the PPA prototype didn't have any /*for (QList<float>::iterator i = xAxis.tick.begin(); i != xAxis.tick.end(); i++) { float x = graphToNodeX(*i); _drawLine(rootNode, QColor(255, 255, 255, 255), x, bounds.bottom(), x, bounds.bottom()+5, 2); }*/ }
void Graph::DrawYAxis(QSGNode * rootNode) { QRectF bounds = boundingRect(); // Y AXIS FEATURES for (QList<float>::iterator i = yAxis.major.begin(); i != yAxis.major.end(); i++) { float x = yLabelOffset; float y = graphToNodeY(*i); _drawLine(rootNode, m_primaryLineColor, bounds.left(), y, bounds.right(), y, 2); _drawLabel(x, y, QString::number(*i), yAxisLabels); } for (QList<float>::iterator i = yAxis.minor.begin(); i != yAxis.minor.end(); i++) { float x = yLabelOffset; float y = graphToNodeY(*i); _drawLine(rootNode, m_primaryLineColor.darker(), bounds.left(), y, bounds.right(), y, 1); _drawLabel(x, y, QString::number(*i), yAxisLabels); } for (QList<float>::iterator i = yAxis.subminor.begin(); i != yAxis.subminor.end(); i++) { float x = yLabelOffset; float y = graphToNodeY(*i); _drawLine(rootNode, m_primaryLineColor.darker(), bounds.left(), y, bounds.right(), y, 1); _drawLabel(x, y, QString::number(*i), yAxisLabels); } // We can draw ticks, but the PPA prototype didn't have any /*for (QList<float>::iterator i = yAxis.tick.begin(); i != yAxis.tick.end(); i++) { float y = graphToNodeY(*i); _drawLine(rootNode, QColor(255, 255, 255, 255), bounds.left(), y, bounds.left()-5, y, 2); }*/ }
/*! * Draw the frame boundaries */ void fp_FrameContainer::drawBoundaries(dg_DrawArgs * pDA) { UT_sint32 iXlow = pDA->xoff - m_iXpad; UT_sint32 iXhigh = iXlow + getFullWidth() ; UT_sint32 iYlow = pDA->yoff - m_iYpad; UT_sint32 iYhigh = iYlow + getFullHeight(); GR_Graphics * pG = pDA->pG; if(getPage()) { getPage()->expandDamageRect(iXlow,iYlow,getFullWidth(),getFullHeight()); // // Only fill to the bottom of the viewed page. // UT_sint32 iFullHeight = getFullHeight(); fl_DocSectionLayout * pDSL = getDocSectionLayout(); UT_sint32 iMaxHeight = 0; if(!pG->queryProperties(GR_Graphics::DGP_PAPER) && (getView()->getViewMode() != VIEW_PRINT)) { iMaxHeight = pDSL->getActualColumnHeight(); } else { iMaxHeight = getPage()->getHeight(); } UT_sint32 iBot = getFullY()+iFullHeight; if(iBot > iMaxHeight) { iFullHeight = iFullHeight - (iBot-iMaxHeight); iYhigh = iFullHeight; } } _drawLine(m_lineTop,iXlow,iYlow,iXhigh,iYlow,pDA->pG); // top _drawLine(m_lineRight,iXhigh,iYlow,iXhigh,iYhigh,pDA->pG); // right _drawLine(m_lineBottom,iXlow,iYhigh,iXhigh,iYhigh,pDA->pG); // bottom _drawLine(m_lineLeft,iXlow,iYlow,iXlow,iYhigh,pDA->pG); // left }
void GuiTSCtrl::drawLine( Point3F p0, Point3F p1, const ColorI &color, F32 width ) { if ( !mSaveFrustum.clipSegment( p0, p1 ) ) return; MathUtils::mProjectWorldToScreen( p0, &p0, mSaveViewport, mSaveModelview, mSaveProjection ); MathUtils::mProjectWorldToScreen( p1, &p1, mSaveViewport, mSaveModelview, mSaveProjection ); p0.x = mClampF( p0.x, 0.0f, mSaveViewport.extent.x ); p0.y = mClampF( p0.y, 0.0f, mSaveViewport.extent.y ); p1.x = mClampF( p1.x, 0.0f, mSaveViewport.extent.x ); p1.y = mClampF( p1.y, 0.0f, mSaveViewport.extent.y ); p0.z = p1.z = 0.0f; _drawLine( p0, p1, color, width ); }