From c7baaf7e925dfd4bacf8e159783e780c8594c5b2 Mon Sep 17 00:00:00 2001 From: nadir Date: Mon, 24 Nov 2003 13:22:53 +0000 Subject: [PATCH] changes due to the fact that Tetra_3D has been replaced by NETGEN_3D plus few changes (misc). --- src/SMESHGUI/SMESHGUI.cxx | 33 +++++++++++++++++++++++++-------- src/SMESHGUI/SMESHGUI.h | 2 +- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index f87fa2546..e02913ede 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -846,7 +846,7 @@ void SMESHGUI::CreateAlgorithm( QString TypeAlgo, QString NameAlgo ) Hyp = myComponentMesh->CreateHypothesis( TypeAlgo, myStudyId ); else if ( TypeAlgo.compare("Hexa_3D") == 0 ) Hyp = myComponentMesh->CreateHypothesis( TypeAlgo, myStudyId ); - else if ( TypeAlgo.compare("Tetra_3D") == 0 ) + else if ( TypeAlgo.compare("NETGEN_3D") == 0 ) Hyp = myComponentMesh->CreateHypothesis( TypeAlgo, myStudyId ); if ( !Hyp->_is_nil() ) { @@ -930,7 +930,7 @@ void SMESHGUI::CreateMaxElementVolume( QString TypeHypothesis, QString NameHypot * */ //============================================================================= -void SMESHGUI::CreateNbSegments( QString TypeHypothesis, QString NameHypothesis, double nbSegments ) +void SMESHGUI::CreateNbSegments( QString TypeHypothesis, QString NameHypothesis, int nbSegments ) { QApplication::setOverrideCursor( Qt::waitCursor ); try { @@ -1363,13 +1363,29 @@ void SMESHGUI::ChangeRepresentation( SMESH_Actor* ac, int type ) float backfacecolor[3]; float nodecolor[3]; ac->GetColor(color[0],color[1],color[2]); - QColor c(color[0]*255,color[1]*255,color[2]*255); +// QColor c(color[0]*255,color[1]*255,color[2]*255); + int c0 = int(color[0]*255); + int c1 = int(color[1]*255); + int c2 = int(color[2]*255); + QColor c( c0, c1, c2 ); ac->GetEdgeColor(edgecolor[0],edgecolor[1],edgecolor[2]); - QColor e(edgecolor[0]*255,edgecolor[1]*255,edgecolor[2]*255); +// QColor e(edgecolor[0]*255,edgecolor[1]*255,edgecolor[2]*255); + c0 = int(edgecolor[0]*255); + c1 = int(edgecolor[1]*255); + c2 = int(edgecolor[2]*255); + QColor e( c0, c1, c2 ); ac->GetBackfaceProperty()->GetColor(backfacecolor); - QColor b(backfacecolor[0]*255,backfacecolor[1]*255,backfacecolor[2]*255); +// QColor b(backfacecolor[0]*255,backfacecolor[1]*255,backfacecolor[2]*255); + c0 = int(backfacecolor[0]*255); + c1 = int(backfacecolor[1]*255); + c2 = int(backfacecolor[2]*255); + QColor b( c0, c1, c2 ); ac->GetNodeColor(nodecolor[0], nodecolor[1], nodecolor[2] ) ; - QColor n(nodecolor[0]*255, nodecolor[1]*255, nodecolor[2]*255 ) ; +// QColor n(nodecolor[0]*255, nodecolor[1]*255, nodecolor[2]*255 ) ; + c0 = int(nodecolor[0]*255); + c1 = int(nodecolor[1]*255); + c2 = int(nodecolor[2]*255); + QColor n( c0, c1, c2 ) ; int Edgewidth = (int)ac->EdgeDevice->GetProperty()->GetLineWidth(); if ( Edgewidth == 0 ) @@ -2494,7 +2510,7 @@ bool SMESHGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent) } case 5021: { - smeshGUI->CreateAlgorithm("Tetra_3D","Tetrahedral (Netgen)"); + smeshGUI->CreateAlgorithm("NETGEN_3D","Tetrahedral (Netgen)"); break; } @@ -5314,7 +5330,8 @@ void SMESHGUI::DisplaySimulationNode( SMESH::SMESH_Mesh_ptr aMesh, float x, floa QString SCb = QAD_CONFIG->getSetting("SMESH:SettingsNodeColorBlue"); QColor nodecolor(SCr.toInt(), SCg.toInt(), SCb.toInt()); if ( !nodecolor.isValid() ) - nodecolor = QColor(0.,1.,0.); +// nodecolor = QColor(0.,1.,0.); + nodecolor = QColor(0,1,0); node->GetProperty()->SetColor( float(nodecolor.red())/255., float(nodecolor.green())/255., diff --git a/src/SMESHGUI/SMESHGUI.h b/src/SMESHGUI/SMESHGUI.h index 37769bcb4..ee29287bf 100644 --- a/src/SMESHGUI/SMESHGUI.h +++ b/src/SMESHGUI/SMESHGUI.h @@ -150,7 +150,7 @@ public : void RemoveHypothesisOrAlgorithmOnMesh( SALOMEDS::SObject_ptr MorSM, SMESH::SMESH_Hypothesis_ptr anHyp ) ; void CreateLocalLength( QString TypeHypothesis, QString NameHypothesis, double Length ); - void CreateNbSegments( QString TypeHypothesis, QString NameHypothesis, double nbSegments ); + void CreateNbSegments( QString TypeHypothesis, QString NameHypothesis, int nbSegments ); void CreateMaxElementArea( QString TypeHypothesis, QString NameHypothesis, double MaxArea ); void CreateMaxElementVolume( QString TypeHypothesis, QString NameHypothesis, double MaxVolume ); -- 2.39.2