]> SALOME platform Git repositories - modules/superv.git/commitdiff
Salome HOME
very slight modification with text, etc.
authorasv <asv@opencascade.com>
Fri, 13 Jan 2006 07:14:03 +0000 (07:14 +0000)
committerasv <asv@opencascade.com>
Fri, 13 Jan 2006 07:14:03 +0000 (07:14 +0000)
src/SUPERVGUI/SUPERVGUI_Main.cxx
src/SUPERVGUI/SUPERVGUI_PrsNode.cxx

index ca8f88021a37b4b9113010cfb2a88dbc5641008f..ed059aebc7655dd4c5d4fed1c5fdb9d582968d56 100644 (file)
@@ -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();
index b47ab929e23d9309ca6d6b826c811d9a14667ac1..98578f5dd89f09c94010f3e77f7ba8b4598a8d2b 100644 (file)
@@ -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<GLViewer_Object*>::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,