From: asv Date: Fri, 13 Jan 2006 07:14:03 +0000 (+0000) Subject: very slight modification with text, etc. X-Git-Tag: T_Supervisor_GUI_based_on_GLViewer_start~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=975ab30982dd3124b451daa72c21c3bf143b61d1;p=modules%2Fsuperv.git very slight modification with text, etc. --- diff --git a/src/SUPERVGUI/SUPERVGUI_Main.cxx b/src/SUPERVGUI/SUPERVGUI_Main.cxx index ca8f880..ed059ae 100644 --- a/src/SUPERVGUI/SUPERVGUI_Main.cxx +++ b/src/SUPERVGUI/SUPERVGUI_Main.cxx @@ -700,6 +700,7 @@ void SUPERVGUI_Main::addComputeNode(SUPERV_CNode theNode) { myCanvas->update(); + // SUPERVGUI_Node* aNode = new SUPERVGUI_ComputeNode( resMgr(), getGLViewer(), this, theNode); SUPERVGUI_PrsNode* glNode = new SUPERVGUI_PrsNode( aNode ); glNode->setFirstPoint( new GLViewer_Pnt( 10, 10 ) ); glNode->compute(); diff --git a/src/SUPERVGUI/SUPERVGUI_PrsNode.cxx b/src/SUPERVGUI/SUPERVGUI_PrsNode.cxx index b47ab92..98578f5 100644 --- a/src/SUPERVGUI/SUPERVGUI_PrsNode.cxx +++ b/src/SUPERVGUI/SUPERVGUI_PrsNode.cxx @@ -50,10 +50,10 @@ SUPERVGUI_PrsNode::SUPERVGUI_PrsNode( SUPERVGUI_CanvasNode* theNode ) : QString fileName = aResMgr->path( "resources", "SUPERVGUI", "ICO_NODE_INLINE" ); myIcon = GLViewer_Drawer::loadTexture( fileName ); - myColor = aResMgr->colorValue( "SUPERVGraph", "NodeBody", DEF_MAIN_BACK ); - setState(myNode->getEngine()->State()); + // setState(myNode->getEngine()->State()); + setState(SUPERV_Running); //updatePorts(); // method for ports' presentations creation } @@ -373,7 +373,7 @@ SUPERVGUI_PrsDrawer() setTextFormat( DTF_TEXTURE_SCALABLE ); - QFont aFont( "Helvetica", 12 ); + QFont aFont( "Helvetica", 10 ); aFont.setStyleHint( QFont::Helvetica ); aFont.setStyleStrategy( QFont::PreferQuality ); setFont( aFont ); @@ -392,6 +392,8 @@ void SUPERVGUI_PrsNodeDrawer::create( float xScale, float yScale, bool /*onlyUpd { myXScale = xScale; myYScale = yScale; + + // GLViewer_Group* group = new GLViewer_Group(); QValueList::Iterator it; for( it = myObjects.begin(); it != myObjects.end(); it++ ) { @@ -413,28 +415,22 @@ void SUPERVGUI_PrsNodeDrawer::create( float xScale, float yScale, bool /*onlyUpd else if( object->isHighlighted() ) drawBoundaryBox( rect, gap, myStippleHPattern ); - QColor primingColor = myPrimingColor; - - primingColor = Qt::white; - //drawRectangle( rect, myLineWidth, 0, myNColor, true, primingColor ); - - QString name = "computing node";//object->getName(); - if ( textFormat() == DTF_TEXTURE_SCALABLE && name.length() > 15 ) - name = name.left( 12 ) + QString( "..." ); - - drawGLText( name, (rect->left()-rect->right())/2, rect->top()-5, GLText_Center, GLText_Center ); - - QFont* aFont = new QFont( "Helvetica", 12 ); - aFont->setStyleHint( QFont::Helvetica ); - aFont->setStyleStrategy( QFont::PreferQuality ); - drawText( name, (rect->left()-rect->right())/2, rect->top()-25, Qt::black, aFont, 0 ); - - GLViewer_PntList pnts; - pnts.push_back( GLViewer_Pnt( rect->left(), rect->top() ) ); - pnts.push_back( GLViewer_Pnt( rect->left(), rect->bottom() ) ); - pnts.push_back( GLViewer_Pnt( rect->right(), rect->bottom() ) ); - pnts.push_back( GLViewer_Pnt( rect->right(), rect->top() ) ); - drawPolygon( pnts, Qt::black ); + const int fieldHeight = 30; + GLViewer_Rect frect( *rect ); + frect.setBottom( rect->top() - fieldHeight ); + drawRectangle( &frect, 1., 0., Qt::black, true, Qt::cyan ); + frect.setTop( rect->top() - fieldHeight ); + frect.setBottom( rect->top() - 2*fieldHeight ); + drawRectangle( &frect, 1., 0., Qt::black, true, Qt::yellow ); + frect.setTop( rect->top() - 2*fieldHeight ); + frect.setBottom( rect->top() - 3*fieldHeight ); + drawRectangle( &frect, 1., 0., Qt::black, true, Qt::yellow ); + // drawing Gate ports must be moved down, after drawing ports.. + frect.setTop( rect->top() - 3*fieldHeight ); + frect.setBottom( rect->top() - 4*fieldHeight ); + drawRectangle( &frect, 1., 0., Qt::black, true, Qt::green ); + + drawGLText( "DTF_TEXTURE_SCALABLE text", rect->left()+5, rect->top()-5, GLText_Right, GLText_Center ); float iconSize = 16; drawTexture( object->getIcon(), (int)iconSize,