static void drawNodes(Node p, int x, int y) { drawNode(p, x + p->x.centre, y); if (p->kids[0]) { drawNodes(p->kids[0], x + p->x.centre, y + Y_SCALE); } if (p->kids[1]) { drawNodes(p->kids[1], x + p->x.centre, y + Y_SCALE); } }
void PortionDrawer::drawGraph(DiagramDrawer &drawer) { if(mGraph) { // This must be set for svg drawer.setDiagramSize(getDrawingSize(drawer)); drawNodes(drawer); drawer.groupShapes(true, Color(0,0,0), Color(245,245,255)); drawConnections(drawer); drawer.groupShapes(false, 0, 0); std::vector<DrawString> drawStrings; std::vector<bool> virtOpers; getNodeText(drawer, drawStrings, virtOpers); drawer.groupText(true, false); drawNodeText(drawer, false, drawStrings, virtOpers); drawer.groupText(false, false); drawer.groupText(true, true); drawNodeText(drawer, true, drawStrings, virtOpers); drawer.groupText(false, false); } }
void GraphDrawer::draw() { startDrawing(); drawEdges(); drawHighlightEdges(); drawNodes(); drawLabels(); clearChanged(); }
void RenderArea::paintEvent(QPaintEvent *) { QPainter painter(this); drawField(painter); drawStartPos(painter); drawEndPos(painter); drawObstacles(painter); drawNodes(painter); emit painting(); }
void Visualizer::populate() { treewidget.clear(); QList<QTreeWidgetItem *> items; for (unsigned int i=0; i<experiment->size(); ++i) items.append(new QTreeWidgetItem((QTreeWidget*)0, QStringList(QString("%1").arg(i)))); treewidget.insertTopLevelItems(0, items); treewidget.setCurrentItem(items.first()); drawNodes(0); }
static int doTree(Node p, int y) { Shape shape = treeWalk(p); int i, centre; int left = 0; int right = 0; p->x.centre = 0; for (i = 0; i < shape->length; i++) { left = max(left, shape->items[i].left); right = max(right, shape->items[i].right); } centre = (left - right)/2; drawLines(p, centre, y); drawNodes(p, centre, y); return y + shape->length * Y_SCALE + Y_SPACING; }
void PolylineAnnotation::paint( GeoPainter *painter, const ViewportParams *viewport ) { m_viewport = viewport; Q_ASSERT( placemark()->geometry()->nodeType() == GeoDataTypes::GeoDataLineStringType ); painter->save(); if ( state() == SceneGraphicsItem::DrawingPolyline || !m_regionsInitialized ) { setupRegionsLists( painter ); m_regionsInitialized = true; } else { updateRegions( painter ); } if ( hasFocus() ) { drawNodes( painter ); } painter->restore(); }
void VDGridTest::drawGraph(GeoDrawer * dr) { #define SHO_NODE 0 #define SHO_EDGE 0 #define SHO_ERR 1 #if SHO_NODE drawNodes(&m_msh, dr); #endif #if SHO_EDGE dr->setColor(0.f, 0.f, .5f); drawEdges(&m_msh, dr); #endif #if SHO_ERR drawErrors(&m_msh, m_msh.dirtyEdges(), m_msh.errorThreshold() ); #endif }
void QgsComposerNodesItem::paint( QPainter* painter, const QStyleOptionGraphicsItem* itemStyle, QWidget* pWidget ) { Q_UNUSED( itemStyle ); Q_UNUSED( pWidget ); if ( !painter ) return; painter->save(); painter->setPen( Qt::NoPen ); painter->setBrush( Qt::NoBrush ); painter->setRenderHint( QPainter::Antialiasing, true ); rescaleToFitBoundingBox(); _draw( painter ); if ( mDrawNodes && composition()->plotStyle() == QgsComposition::Preview ) drawNodes( painter ); painter->restore(); }
void OpenGLWidget::paintGL() { glClearColor(0,0,0,0); //glClearColor(255,255,255,0); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glMatrixMode( GL_PROJECTION ); glLoadIdentity(); gluPerspective(70,(double)600/440,1,1000); glMatrixMode( GL_MODELVIEW ); glLoadIdentity(); gluLookAt(camera[0], camera[1], camera[2], camera[3], camera[4], camera[5],camera[6],camera[7],camera[8]); drawGrid(); drawNodes(); if (draw_connections) drawConnections(); }
void ramActorsScene::draw() { /// bRecording = false; /// ramBeginCamera(); for(int i=0; i<getNumNodeArray(); i++) { ramNodeArray &NA = getNodeArray(i); const string name = NA.getName(); SegmentsIter it = mSegmentsMap.find(name); if (it == mSegmentsMap.end()) continue; BaseSegment *seg = it->second; /// draw if "Show actor" toggle is anabled // note that ofxUIImageToggle shows hilighted image when it's false, if (seg->isVisible()) { ofPushMatrix(); ofPushStyle(); { if (bUseShading) light.enable(); ofSetColor(seg->jointColor); ofTranslate(seg->position.x, 0, seg->position.y); if (NA.isRigid()) { ramDrawBasicRigid((ramRigidBody&)NA); } else { if (bUseSimpleActor) ramDrawBasicActor((ramActor&)NA); else drawNodes(NA); } if (bUseShading) light.disable(); } ofPopStyle(); ofPopMatrix(); } if (seg->getType() == RAM_UI_SEGMENT_TYPE_CONTROL) { if (static_cast<ControlSegment*>(seg)->isRecording()) { bRecording = true; } } } ramEndCamera(); }
void HomeScreen::draw(SDL_Surface *surface) { drawNodes(surface); }
void Visualizer::on_ExperimentChanged(QTreeWidgetItem * item, int column) { drawNodes(item->text(0).toInt()); }
void SettingsScreen::draw(SDL_Surface *screen) { drawNodes(screen); }