void QwtCurve::drawCurve(QPainter *painter, int style, const QwtDiMap &xMap, const QwtDiMap &yMap, int from, int to) { switch (style) { case NoCurve: break; case Lines: drawLines(painter, xMap, yMap, from, to); break; case Sticks: drawSticks(painter, xMap, yMap, from, to); break; case Steps: drawSteps(painter, xMap, yMap, from, to); break; case Spline: if ( from > 0 || to < dataSize() - 1 ) drawLines(painter, xMap, yMap, from, to); else drawSpline(painter, xMap, yMap); break; case Dots: drawDots(painter, xMap, yMap, from, to); break; default: break; } }
void GraphicsLayer10::btnTestCallback(cocos2d::Ref* pSender) { GRAPHICS->clearAllGraphics(); drawSpline(); drawPoints(); }
void GraphicsLayer09::btnTestCallback(cocos2d::Ref* pSender) { GRAPHICS->clearAllGraphics(); GRAPHICS->setPixelColor(Color4F::RED); drawSpline(); drawPoints(); }
void BasicSplineVisualizer::drawSplines( QPainter& painter, QTransform const& to_screen, EditableZoneSet const& zones) { BOOST_FOREACH(EditableZoneSet::Zone const& zone, zones) { drawSpline(painter, to_screen, zone.spline()); }
void SplineDisplayerWidget::paintGL() { glClear(GL_COLOR_BUFFER_BIT/* | GL_DEPTH_BUFFER_BIT*/); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); gluLookAt(m_CameraPos.x, m_CameraPos.y, m_CameraPos.z, m_CameraPos.x, m_CameraPos.y, m_CameraPos.z-10, 0, 1, 0); /*glTranslated(0.0, 0.0, -10.0);*/ // glViewport(20, 20, m_width-20, m_height-20); glViewport(0, 0, m_width, m_height); drawGrid(); drawSpline(); }
void drawScene2D() { // setup projection glMatrixMode(GL_PROJECTION); auto res = resolution.Cast<Gs::Real>(); auto proj = Gs::ProjectionMatrix4::Planar(res.x, res.y); glLoadMatrix_T(proj.Ptr()); // setup model-view matrix glMatrixMode(GL_MODELVIEW); glLoadIdentity(); // draw scene drawSpline(spline, 0.0f, 6.0f, 500); drawBezierCurve(bezierCurve, 100); }
void GuiFunctionBox::render(RenderDevice* rd, const GuiThemeRef& skin) const { GuiFunctionBox* me = const_cast<GuiFunctionBox*>(this); me->m_clipBounds = skin->canvasToClientBounds(m_rect, m_captionSize); int shrink = 4; // Shrink bounds slightly so that we can see axes and points rendered against the edge me->m_bounds = Rect2D::xywh(m_clipBounds.x0y0() + Vector2(shrink, shrink), m_clipBounds.wh() - Vector2(shrink, shrink) * 2); // Use textbox borders skin->renderCanvas(m_rect, m_enabled, focused(), m_caption, m_captionSize); me->m_scale.x = (m_maxTime - m_minTime) / m_bounds.width(); me->m_scale.y = (m_maxValue - m_minValue) / m_bounds.height(); static int count = 0; count = (count + 1) % 10; if (count == 0) { // Make sure that the spline hasn't been corrupted by the // program since we last checked it. Avoid doing this every // frame, however. me->clampTimes(m_selected); me->clampValues(); } skin->pauseRendering(); { // Scissor region ignores transformation matrix const CoordinateFrame& matrix = rd->objectToWorldMatrix(); rd->setClip2D(m_clipBounds + matrix.translation.xy()); drawBackground(rd, skin); drawSpline(rd, skin); drawControlPoints(rd, skin); } skin->resumeRendering(); }