From 882dc8f6ee23cedf50cf3c718fb864dec115b35e Mon Sep 17 00:00:00 2001 From: rnv Date: Tue, 14 Feb 2012 12:03:57 +0000 Subject: [PATCH] Implementation of the "21046: EDF 1610 GUI: To be able to change the width of the lines" issue. --- doc/salome/gui/GEOM/images/line_width.png | Bin 0 -> 4936 bytes doc/salome/gui/GEOM/images/line_width_1.png | Bin 0 -> 7790 bytes doc/salome/gui/GEOM/images/line_width_2.png | Bin 0 -> 7517 bytes doc/salome/gui/GEOM/input/line_width.doc | 18 ++ .../gui/GEOM/input/viewing_geom_obj.doc | 2 + resources/SalomeApp.xml.in | 5 + src/GEOMBase/GEOMBase_Helper.cxx | 8 +- src/GEOMGUI/GEOM_Displayer.cxx | 81 +++++- src/GEOMGUI/GEOM_Displayer.h | 6 + src/GEOMGUI/GEOM_msg_en.ts | 61 ++++- src/GEOMGUI/GeometryGUI.cxx | 53 +++- src/GEOMGUI/GeometryGUI_Operations.h | 2 + src/GEOMToolsGUI/GEOMToolsGUI.cxx | 6 + src/GEOMToolsGUI/GEOMToolsGUI.h | 2 + src/GEOMToolsGUI/GEOMToolsGUI_1.cxx | 257 +++++++++++++++++- .../GEOMToolsGUI_LineWidthDlg.cxx | 192 +++++++++++++ src/GEOMToolsGUI/GEOMToolsGUI_LineWidthDlg.h | 59 ++++ src/GEOMToolsGUI/Makefile.am | 9 +- src/MeasureGUI/MeasureGUI.h | 6 + src/MeasureGUI/MeasureGUI_AngleDlg.cxx | 4 + .../MeasureGUI_CheckCompoundOfBlocksDlg.cxx | 9 +- src/MeasureGUI/MeasureGUI_DistanceDlg.cxx | 4 + src/MeasureGUI/MeasureGUI_NormaleDlg.cxx | 7 +- src/OBJECT/GEOM_Actor.cxx | 33 +++ src/OBJECT/GEOM_Actor.h | 12 + src/OBJECT/GEOM_Constants.h | 2 + 26 files changed, 815 insertions(+), 23 deletions(-) create mode 100755 doc/salome/gui/GEOM/images/line_width.png create mode 100755 doc/salome/gui/GEOM/images/line_width_1.png create mode 100755 doc/salome/gui/GEOM/images/line_width_2.png create mode 100644 doc/salome/gui/GEOM/input/line_width.doc create mode 100644 src/GEOMToolsGUI/GEOMToolsGUI_LineWidthDlg.cxx create mode 100644 src/GEOMToolsGUI/GEOMToolsGUI_LineWidthDlg.h diff --git a/doc/salome/gui/GEOM/images/line_width.png b/doc/salome/gui/GEOM/images/line_width.png new file mode 100755 index 0000000000000000000000000000000000000000..bf5c713a8280e9c44f130a6fd83418762e49d0ca GIT binary patch literal 4936 zcmbtYXH-*bvknm?bPj?j9T60%g3<}S3kV2E7by|xgb+gS9F^Xc&{RYOK|y*~q)QE* z1jGcSgc86QnqSa!?meEh?vHQX{bMIH@9f#nOy+&wXXU|7BOL}>4q5;Jz@VqAX$k;P z=##%c0RhQ(RbW;x`GW##s-q658014Z8F`VBNf@^bJ8_61OS4B0Dy=X z0AQc&iueiuz$5{H)jI%yLJk1H?t^SJQ6eu0`)l3y*K~n8`MLS{yLo#7R8B6wlbZsc ziN6>WcGuCz$HUFZ@njWj6VnO+u%zl~s@)2-$LG2Gn2)n{j}08NrVwmLHR*do8Yw0@vc-3cXH1?Sa-1^*y|i5SY(tBX&BKeQbi z@h~z2DC$7SeOEZ9{^3XS>&ES>07@x>ugaxlU-0dSV@pwXOMjR;nh|PUl>HBf@>HtwjV(sE z8r<%HBN=%{tMuU3k4dUAtQL=}5f-PEH$@8WdwFnQ+f>i*8<*YzmA(;1*t}&Nn$Cr; zOE#n~Bg02rga-9_C88>tQql&ccdp$As*|J`z>ZgJt(sDjZJ#;5|8m8vS_;Z<6;}A0$;&=`D3lsGY#ERo;9eNAi-wp^FW|*1YvG7Udd#8wEbuOAh`Wz|D_AR6(m; zhXUtZGZ7piK_S9LWz*=adG2K zCB7vAqG==Im>@{e7~)<~j^!WNG`4T;)cMw%GBoxmKy7Hwpiy(lj^*Z7M=YqhEj&)t zb)+6);VOQy?2SdWL6XOK9@PGpsVlk9Hv(uf;Ni|6SLFj1lNq@Vb1rbHY?J0l$yHoS zVu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MaH8e|o#{i6gmNC~OP;Up)`G z?edshzM9s1vG=ZJr|$I(4~sE)y-kIGs6G8Z&--P0l3Rl4|KE(iJS&yCb24aF|EAS@ zullWO$-h!uBImz6`%IHfp5);T7$3Ryb9lY=Q6vr0&^b8=*fpvp(b;o{B7#D~@2Sb^ zM;T~!Y^gtLz|lh9zc)atnD6ZBe=8XGs>To9p8r%n)^$X|TM+es%8mafD3Sn%Z`l5e zhEy-364k$unW#scg10nHcWrHLEEQgOOqM--DO$k%T7GY(mgop~%A8ua(2foK%vV?6 zvG&*1MiG+%Pc~bs?N70gA5NhG&5&hNtrxRTOhmb7&unVZM+>sN$e8I0KG8~dja5rL zn~6zB!%N>QVhN$|662vK?i=k6vnlX|__LgrNoPPP8B8#lgP9G0LNgX^#1{qrkz^rR zuXd-sGGmzT94I2ffHJM^s?1YA+9M{i{#-amk@oEe#jQ)ZK1>8p68Rr3fS#6-W`+8l GsQ&=f6Ot+b literal 0 HcmV?d00001 diff --git a/doc/salome/gui/GEOM/images/line_width_1.png b/doc/salome/gui/GEOM/images/line_width_1.png new file mode 100755 index 0000000000000000000000000000000000000000..e7fc005f2005f470fe9465185a9e92cdaeffae56 GIT binary patch literal 7790 zcmeHshf`B+(|6?N2@wN?YG@&nfT-vlB2_><6ceNfSO5iSks>{aG)3Uh1WltW7K$LZ z6hTEoQz;UfQ~_xUga{%a0Yy~cJ3cetJNNe|d^2xmGFQ%Cd**u$Xul>?b6OnS;SX2{71aR~YO_HVn2qD7V(u00vY1Vr~kY4!^K?_q@d7 zBN15IbIQ|=?s8B28>hTd+@6RSld(a?ODBt9COEB%Q|nu+F56o@Mn9AUv9KMAv7Ol8 zu`ogG1Kd|JXRS*BOaS#`dna5N6$29-6eJ*$bP>mnorHmN?@OLrnIRNRV4y4N|B4i! z-Xx$9k9NAEkODgpbI@w2|Gc^c5$l2Ym#EGoQyea^Lu&^z4uBqMxC5E*RXn6Ey(b9y zZ&6qmvFRB0focpuKtT5FjRDra42~8l3)1%dT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%E{N9{j16(WjUhZ_+*RKC#ikp{ZoQ*^k4GbbO?J69a()koV|7>VrRdCV zCNgFUGiN24_G{&Forz|D&f)GA?XbPJ%u2Y=u$K2ff;{yJKKyouw;lC9I_+mXzgdNzzIqU*ZIfz-7pe(2tOW6hKi`&w| zk+dt`&jhFx@wm!x zR!DxZE2c1|^3qD>FW~$!m8b^+<91^G>9096+d2nbe2XJ6RA&6;Oa(nvCOZsltJQ4f zxxyTWqZx~bfNR3+VXluPL^V5I@85xB1pS@wQ;bmkVaBg#r#}_Py)uV_r89 zT#<IdWY;w40sB` zJ-Q{mI{O6GQ+9_$;QTHG?=l>Wrno&=h}t}PG^08O(9wdp7xvk<_RL3-DZbJX9ub|k`77}C4N^++cHjx7KNqZ)FM!1>Qqgd_lN zDC1zLsso0VI#O(0)gEq^+za;w;9z{pTEtr9{|2_K%oV!14W_U-#qb}9i}FYE|G>V4 zr4luz1XBJDpGr;Kea}4h!oP{gs7oGD7uvj)8TWY(HnhRyGX(3K{;%TDP?FRc`X!|B zzlm&jR(t6D=a2q3w)X#GX>|2Tj)wA6IhAdCEssl0L2ig`*Es%6x~erA PfG;a^TUx29=lTBu6s6S- literal 0 HcmV?d00001 diff --git a/doc/salome/gui/GEOM/input/line_width.doc b/doc/salome/gui/GEOM/input/line_width.doc new file mode 100644 index 000000000..3850a8dcd --- /dev/null +++ b/doc/salome/gui/GEOM/input/line_width.doc @@ -0,0 +1,18 @@ +/*! + +\page line_width_page Line Width + +\n In this menu you can change the width of the edges and isolines displayed within +a shape. + +\n Arguments: 1 value (width of the edge or isoline). + +\image html line_width.png + +\n Example: + +\image html line_width_1.png + +\image html line_width_2.png + +*/ diff --git a/doc/salome/gui/GEOM/input/viewing_geom_obj.doc b/doc/salome/gui/GEOM/input/viewing_geom_obj.doc index 9ff681259..b269619a9 100644 --- a/doc/salome/gui/GEOM/input/viewing_geom_obj.doc +++ b/doc/salome/gui/GEOM/input/viewing_geom_obj.doc @@ -33,6 +33,8 @@ deflection coefficient of a shape. material properties of a shape.
  • \subpage point_marker_page "Point Marker" - allows to change the representation of geometrical vertices.
  • +
  • \subpage line_width_page "Line Width" - allows to change the +width of the edges and isolines.
  • Auto color / Disable auto color - activates the auto color mode. When the auto color mode is enabled, the groups created on the sub-shapes of the selected geometrical object are automatically diff --git a/resources/SalomeApp.xml.in b/resources/SalomeApp.xml.in index 8ea7476e7..f910e6569 100644 --- a/resources/SalomeApp.xml.in +++ b/resources/SalomeApp.xml.in @@ -57,6 +57,11 @@ + + + + + diff --git a/src/GEOMBase/GEOMBase_Helper.cxx b/src/GEOMBase/GEOMBase_Helper.cxx index 50c5c46e6..04a0be7b4 100755 --- a/src/GEOMBase/GEOMBase_Helper.cxx +++ b/src/GEOMBase/GEOMBase_Helper.cxx @@ -37,6 +37,7 @@ #include #include #include +#include #include #include @@ -317,7 +318,12 @@ void GEOMBase_Helper::displayPreview( GEOM::GEOM_Object_ptr object, getDisplayer()->SetColor( color == -1 ? Quantity_NOC_VIOLET : color ); // set width of displayed shape - getDisplayer()->SetWidth( lineWidth ); + int lw = lineWidth; + if(lw == -1) { + SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); + lw = resMgr->integerValue("Geometry", "preview_edge_width", -1); + } + getDisplayer()->SetWidth( lw ); // set display mode of displayed shape int aPrevDispMode = getDisplayer()->SetDisplayMode( displayMode ); diff --git a/src/GEOMGUI/GEOM_Displayer.cxx b/src/GEOMGUI/GEOM_Displayer.cxx index 31d7d4b0c..8d7bb7603 100644 --- a/src/GEOMGUI/GEOM_Displayer.cxx +++ b/src/GEOMGUI/GEOM_Displayer.cxx @@ -313,7 +313,11 @@ GEOM_Displayer::GEOM_Displayer( SalomeApp_Study* st ) myShadingColor = SalomeApp_Tools::color( col ); myDisplayMode = resMgr->integerValue("Geometry", "display_mode", 0); + int aType = resMgr->integerValue("Geometry", "type_of_marker", (int)Aspect_TOM_PLUS); + myWidth = resMgr->integerValue("Geometry", "edge_width", -1); + myIsosWidth = resMgr->integerValue("Geometry", "isolines_width", -1); + myTypeOfMarker = (Aspect_TypeOfMarker)(std::min((int)Aspect_TOM_RING3, std::max((int)Aspect_TOM_POINT, aType))); myScaleOfMarker = (resMgr->integerValue("Geometry", "marker_scale", 1)-(int)GEOM::MS_10)*0.5 + 1.0; myScaleOfMarker = std::min(7.0, std::max(1., myScaleOfMarker)); @@ -696,10 +700,15 @@ void GEOM_Displayer::Update( SALOME_OCCPrs* prs ) Handle(Prs3d_IsoAspect) anAspect = AISShape->Attributes()->UIsoAspect(); anAspect->SetNumber( anUIsoNumber ); anAspect->SetColor( aColor ); + if(HasIsosWidth()) + anAspect->SetWidth( GetIsosWidth() ); AISShape->Attributes()->SetUIsoAspect( anAspect ); + anAspect = AISShape->Attributes()->VIsoAspect(); anAspect->SetNumber( aVIsoNumber ); + if(HasIsosWidth()) + anAspect->SetWidth( GetIsosWidth() ); anAspect->SetColor( aColor ); AISShape->Attributes()->SetVIsoAspect( anAspect ); @@ -828,6 +837,8 @@ void GEOM_Displayer::Update( SALOME_OCCPrs* prs ) double aDC = 0; if(useStudy) { aDC = aPropMap.value(DEFLECTION_COEFF_PROP).toDouble(); + SetWidth(aPropMap.value(EDGE_WIDTH_PROP).toInt()); + SetIsosWidth(aPropMap.value(ISOS_WIDTH_PROP).toInt()); } else { aDC = aResMgr->doubleValue("Geometry", "deflection_coeff", 0.001); @@ -1003,6 +1014,13 @@ void GEOM_Displayer::Update( SALOME_OCCPrs* prs ) if ( aModelB ) delete aModelB; + if(HasWidth()) + aStudy->setObjectProperty( aMgrId, anIO->getEntry(), EDGE_WIDTH_PROP, GetWidth() ); + + if(HasIsosWidth()) + aStudy->setObjectProperty( aMgrId, anIO->getEntry(), ISOS_WIDTH_PROP, GetIsosWidth() ); + + } // AISShape->SetName(???); ??? necessary to set name ??? @@ -1133,11 +1151,6 @@ void GEOM_Displayer::Update( SALOME_VTKPrs* prs ) aProp->SetColor( aColor.Red(), aColor.Green(), aColor.Blue() ); } - if ( HasWidth() ) - { - aProp->SetLineWidth( GetWidth() ); - } - while ( anActor != NULL ) { SALOME_Actor* GActor = SALOME_Actor::SafeDownCast( anActor ); @@ -1172,6 +1185,8 @@ void GEOM_Displayer::Update( SALOME_VTKPrs* prs ) aIsos[0] = uv[0].toInt(); aIsos[1] = uv[1].toInt(); aGeomGActor->SetNbIsos(aIsos); aGeomGActor->SetOpacity(1.0 - aPropMap.value(TRANSPARENCY_PROP).toDouble()); + SetWidth(aPropMap.value(EDGE_WIDTH_PROP).toInt()); + SetIsosWidth(aPropMap.value(ISOS_WIDTH_PROP).toInt()); aGeomGActor->SetVectorMode(aPropMap.value(VECTOR_MODE_PROP).toInt()); int aDispModeId = aPropMap.value(DISPLAY_MODE_PROP).toInt(); // Specially processing of 'Shading with edges' mode from preferences, @@ -1217,6 +1232,13 @@ void GEOM_Displayer::Update( SALOME_VTKPrs* prs ) // Release memory delete aModelB; + + if(HasWidth()) + aStudy->setObjectProperty( aMgrId, anEntry, EDGE_WIDTH_PROP, GetWidth() ); + + if(HasIsosWidth()) + aStudy->setObjectProperty( aMgrId, anEntry, ISOS_WIDTH_PROP, GetIsosWidth() ); + } else { // Set the same front and back materials for the selected shape @@ -1292,6 +1314,17 @@ void GEOM_Displayer::Update( SALOME_VTKPrs* prs ) } } + if ( HasWidth() ) + { + aGeomGActor->SetWidth( GetWidth() ); + } + + + if ( HasIsosWidth() ) + { + aGeomGActor->SetIsosWidth( GetIsosWidth() ); + } + if ( myToActivate ) GActor->PickableOn(); else @@ -1760,6 +1793,23 @@ void GEOM_Displayer::UnsetWidth() myWidth = -1; } + +int GEOM_Displayer::GetIsosWidth() const +{ + return myIsosWidth; +} + +void GEOM_Displayer::SetIsosWidth(const int width) +{ + myIsosWidth = width; +} + +bool GEOM_Displayer::HasIsosWidth() const +{ + return myIsosWidth != -1; +} + + //================================================================= /*! * GEOM_Displayer::SetToActivate @@ -1962,12 +2012,20 @@ PropMap GEOM_Displayer::getDefaultPropertyMap(const QString& viewer_type) { QString aMaterialF = aModelF.getMaterialProperty(); aDefaultMap.insert( FRONT_MATERIAL_PROP , aMaterialF ); - // Back material + //9. Back material Material_Model aModelB; aModelB.fromResources( aResMgr, "Geometry", false ); QString aMaterialB = aModelB.getMaterialProperty(); aDefaultMap.insert( BACK_MATERIAL_PROP , aMaterialB ); + //10. Width of the edges + aDefaultMap.insert( EDGE_WIDTH_PROP , aResMgr->integerValue("Geometry", "edge_width", 1)); + + + //11. Width of iso-lines + aDefaultMap.insert( ISOS_WIDTH_PROP , aResMgr->integerValue("Geometry", "isolines_width", 1)); + + return aDefaultMap; } @@ -2005,6 +2063,17 @@ bool GEOM_Displayer::MergePropertyMaps(PropMap& theOrigin, PropMap& theDefault) theOrigin.insert(BACK_MATERIAL_PROP, theDefault.value(BACK_MATERIAL_PROP)); nbInserted++; } + + if(!theOrigin.contains(EDGE_WIDTH_PROP)) { + theOrigin.insert(EDGE_WIDTH_PROP, theDefault.value(EDGE_WIDTH_PROP)); + nbInserted++; + } + + if(!theOrigin.contains(ISOS_WIDTH_PROP)) { + theOrigin.insert(ISOS_WIDTH_PROP, theDefault.value(ISOS_WIDTH_PROP)); + nbInserted++; + } + return (nbInserted > 0); } diff --git a/src/GEOMGUI/GEOM_Displayer.h b/src/GEOMGUI/GEOM_Displayer.h index 30337eaac..c7ced1329 100644 --- a/src/GEOMGUI/GEOM_Displayer.h +++ b/src/GEOMGUI/GEOM_Displayer.h @@ -134,6 +134,11 @@ public: void UnsetWidth(); double GetWidth () const; bool HasWidth () const; + + /* Set width for iso-lines displaying. If it is equal -1 then default width is used. */ + void SetIsosWidth ( const int ); + int GetIsosWidth () const; + bool HasIsosWidth () const; /* Set display mode shape displaying. If it is equal -1 then display mode is used. */ int SetDisplayMode( const int ); @@ -215,6 +220,7 @@ protected: Quantity_Color myShadingColor; int myColor; double myWidth; + int myIsosWidth; bool myToActivate; int myDisplayMode; Aspect_TypeOfMarker myTypeOfMarker; diff --git a/src/GEOMGUI/GEOM_msg_en.ts b/src/GEOMGUI/GEOM_msg_en.ts index 14a87c7aa..a993e8be3 100644 --- a/src/GEOMGUI/GEOM_msg_en.ts +++ b/src/GEOMGUI/GEOM_msg_en.ts @@ -11,6 +11,14 @@ CHANGE_ORIENTATION_NEW_OBJ_NAME Invert + + EDGE_WIDTH_TLT + Select Edge Width + + + ISOS_WIDTH_TLT + Select Isos Width + CLOSE_CONTOUR_NEW_OBJ_NAME CloseContour @@ -2574,6 +2582,34 @@ Please, select face, shell or solid and try again MEN_POP_TEXTURE Texture + + MEN_EDGE_WIDTH + Edge Width + + + TOP_EDGE_WIDTH + Edge Width + + + STB_EDGE_WIDTH + Edge Width + + + MEN_ISOS_WIDTH + Isos Width + + + TOP_ISOS_WIDTH + Isos Width + + + STB_ISOS_WIDTH + Isos Width + + + MEN_LINE_WIDTH + Line Width + MEN_POP_SETTEXTURE Texture @@ -2906,6 +2942,22 @@ Please, select face, shell or solid and try again PREF_BACK_MATERIAL Default back material + + PREF_EDGE_WIDTH + Edges width + + + PREF_ISOLINES_WIDTH + Iso lines width + + + PREF_PREVIEW_EDGE_WIDTH + Preview edges width + + + PREF_MEASURES_LINE_WIDTH + Measures lines width + PROCESS_SHAPE_NEW_OBJ_NAME ProcessShape @@ -4779,7 +4831,7 @@ Number of sketch points too small EMPTY_NAME Please, specify a non-empty group name - + GROUP_NAME Group Name @@ -5003,6 +5055,13 @@ Would you like to continue? Deflection : + + GEOMToolsGUI_LineWidthDlg + + GEOM_LINE_WIDTH + Line width: + + GEOMToolsGUI_MarkerDlg diff --git a/src/GEOMGUI/GeometryGUI.cxx b/src/GEOMGUI/GeometryGUI.cxx index cfa64c465..a230d3725 100644 --- a/src/GEOMGUI/GeometryGUI.cxx +++ b/src/GEOMGUI/GeometryGUI.cxx @@ -424,6 +424,8 @@ void GeometryGUI::OnGUIEvent( int id ) case GEOMOp::OpPublishObject: // ROOT GEOM OBJECT - POPUP MENU - PUBLISH case GEOMOp::OpPointMarker: // POPUP MENU - POINT MARKER case GEOMOp::OpMaterialProperties: // POPUP MENU - MATERIAL PROPERTIES + case GEOMOp::OpEdgeWidth: // POPUP MENU - LINE WIDTH - EDGE WIDTH + case GEOMOp::OpIsosWidth: // POPUP MENU - LINE WIDTH - ISOS WIDTH libName = "GEOMToolsGUI"; break; case GEOMOp::OpDisplayMode: // MENU VIEW - WIREFRAME/SHADING @@ -844,6 +846,8 @@ void GeometryGUI::initialize( CAM_Application* app ) createGeomAction( GEOMOp::OpShading, "POP_SHADING", "", 0, true ); createGeomAction( GEOMOp::OpShadingWithEdges, "POP_SHADING_WITH_EDGES", "", 0, true ); createGeomAction( GEOMOp::OpTexture, "POP_TEXTURE", "", 0, true ); + createGeomAction( GEOMOp::OpEdgeWidth, "EDGE_WIDTH"); + createGeomAction( GEOMOp::OpIsosWidth, "ISOS_WIDTH"); createGeomAction( GEOMOp::OpVectors, "POP_VECTORS", "", 0, true ); createGeomAction( GEOMOp::OpDeflection, "POP_DEFLECTION" ); createGeomAction( GEOMOp::OpColor, "POP_COLOR" ); @@ -1234,6 +1238,14 @@ void GeometryGUI::initialize( CAM_Application* app ) mgr->setRule( action( GEOMOp::OpMaterialProperties ), clientOCCorVTK_AndSomeVisible + " and ($component={'GEOM'}) and selcount>0 and isVisible", QtxPopupMgr::VisibleRule ); mgr->insert( action( GEOMOp::OpSetTexture ), -1, -1 ); // texture mgr->setRule( action( GEOMOp::OpSetTexture ), clientOCCorOB_AndSomeVisible + " and ($component={'GEOM'})", QtxPopupMgr::VisibleRule ); + + int lineW = mgr->insert( tr( "MEN_LINE_WIDTH" ), -1, -1 ); // line width menu + mgr->insert( action( GEOMOp::OpEdgeWidth ), lineW, -1 ); // edge width + mgr->setRule( action( GEOMOp::OpEdgeWidth ), clientOCCorVTK_AndSomeVisible, QtxPopupMgr::VisibleRule ); + + mgr->insert( action( GEOMOp::OpIsosWidth ), lineW, -1 ); // isos width + mgr->setRule( action( GEOMOp::OpIsosWidth ), clientOCCorVTK_AndSomeVisible, QtxPopupMgr::VisibleRule ); + mgr->insert( separator(), -1, -1 ); // ----------- mgr->insert( action( GEOMOp::OpAutoColor ), -1, -1 ); // auto color mgr->setRule( action( GEOMOp::OpAutoColor ), autoColorPrefix + " and isAutoColor=false", QtxPopupMgr::VisibleRule ); @@ -1679,11 +1691,33 @@ void GeometryGUI::createPreferences() int front_material = addPreference( tr( "PREF_FRONT_MATERIAL" ), genGroup, LightApp_Preferences::Selector, "Geometry", "front_material" ); - + int back_material = addPreference( tr( "PREF_BACK_MATERIAL" ), genGroup, LightApp_Preferences::Selector, "Geometry", "back_material" ); + int nb = 4; + int wd[nb]; + int iter=0; + + wd[iter++] = addPreference( tr( "PREF_EDGE_WIDTH" ), genGroup, + LightApp_Preferences::IntSpin, "Geometry", "edge_width" ); + + wd[iter++] = addPreference( tr( "PREF_ISOLINES_WIDTH" ), genGroup, + LightApp_Preferences::IntSpin, "Geometry", "isolines_width" ); + + wd[iter++] = addPreference( tr( "PREF_PREVIEW_EDGE_WIDTH" ), genGroup, + LightApp_Preferences::IntSpin, "Geometry", "preview_edge_width" ); + + wd[iter++] = addPreference( tr( "PREF_MEASURES_LINE_WIDTH" ), genGroup, + LightApp_Preferences::IntSpin, "Geometry", "measures_line_width" ); + + for(int i = 0; i < nb; i++) { + setPreferenceProperty( wd[i], "min", 1 ); + setPreferenceProperty( wd[i], "max", 5 ); + } + + // Quantities with individual precision settings int precGroup = addPreference( tr( "GEOM_PREF_GROUP_PRECISION" ), tabId ); setPreferenceProperty( precGroup, "columns", 2 ); @@ -1950,6 +1984,17 @@ void GeometryGUI::storeVisualParameters (int savePoint) if(aProps.contains(BACK_MATERIAL_PROP)) { param = occParam + BACK_MATERIAL_PROP; ip->setParameter(entry, param, aProps.value(BACK_MATERIAL_PROP).toString().toLatin1().data()); + + } + + if(aProps.contains( EDGE_WIDTH_PROP )) { + param = occParam + EDGE_WIDTH_PROP; + ip->setParameter(entry, param, aProps.value(EDGE_WIDTH_PROP).toString().toLatin1().data()); + } + + if(aProps.contains( ISOS_WIDTH_PROP )) { + param = occParam + ISOS_WIDTH_PROP; + ip->setParameter(entry, param, aProps.value(ISOS_WIDTH_PROP).toString().toLatin1().data()); } } // object iterator } // for (views) @@ -2062,8 +2107,14 @@ void GeometryGUI::restoreVisualParameters (int savePoint) aListOfMap[viewIndex].insert( FRONT_MATERIAL_PROP, val); } else if(paramNameStr == BACK_MATERIAL_PROP) { aListOfMap[viewIndex].insert( BACK_MATERIAL_PROP, val); + } else if(paramNameStr == EDGE_WIDTH_PROP) { + aListOfMap[viewIndex].insert( EDGE_WIDTH_PROP , val); + } else if(paramNameStr == ISOS_WIDTH_PROP) { + aListOfMap[viewIndex].insert( ISOS_WIDTH_PROP , val); } + + } // for names/parameters iterator QList lst = getApp()->viewManagers(); diff --git a/src/GEOMGUI/GeometryGUI_Operations.h b/src/GEOMGUI/GeometryGUI_Operations.h index 5ff8d5921..227c23283 100644 --- a/src/GEOMGUI/GeometryGUI_Operations.h +++ b/src/GEOMGUI/GeometryGUI_Operations.h @@ -54,6 +54,8 @@ namespace GEOMOp { OpHideChildren = 1251, // POPUP MENU - HIDE CHILDREN OpUnpublishObject = 1253, // POPUP MENU - UNPUBLISH OpPublishObject = 1254, // GEOM ROOT OBJECT - POPUP MENU - PUBLISH + OpEdgeWidth = 1260, // POPUP MENU - LINE WIDTH - EDGE WIDTH + OpIsosWidth = 1261, // POPUP MENU - LINE WIDTH - ISOS WIDTH // DisplayGUI ----------------//-------------------------------- OpDisplayMode = 2000, // MENU VIEW - DISPLAY MODE - WIREFRAME/SHADING/SHADING WITH EDGES diff --git a/src/GEOMToolsGUI/GEOMToolsGUI.cxx b/src/GEOMToolsGUI/GEOMToolsGUI.cxx index f1abd61d0..3c5c6f1d1 100644 --- a/src/GEOMToolsGUI/GEOMToolsGUI.cxx +++ b/src/GEOMToolsGUI/GEOMToolsGUI.cxx @@ -371,6 +371,12 @@ bool GEOMToolsGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent) case GEOMOp::OpPublishObject:// GEOM ROOT OBJECT - POPUP - PUBLISH OnPublishObject(); break; + case GEOMOp::OpEdgeWidth: + OnEdgeWidth(); + break; + case GEOMOp::OpIsosWidth: + OnIsosWidth(); + break; default: SUIT_Session::session()->activeApplication()->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID)); break; diff --git a/src/GEOMToolsGUI/GEOMToolsGUI.h b/src/GEOMToolsGUI/GEOMToolsGUI.h index 5706765f0..2141f0c97 100644 --- a/src/GEOMToolsGUI/GEOMToolsGUI.h +++ b/src/GEOMToolsGUI/GEOMToolsGUI.h @@ -76,6 +76,8 @@ private: void OnPublishObject() ; void OnPointMarker(); void OnMaterialProperties(); + void OnEdgeWidth(); + void OnIsosWidth(); // Shortcut commands void OnChangeTransparency( bool ); diff --git a/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx b/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx index 8420eb5cd..31b734b33 100644 --- a/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx +++ b/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx @@ -32,6 +32,7 @@ #include "GEOMToolsGUI_MarkerDlg.h" #include "GEOMToolsGUI_PublishDlg.h" #include "GEOMToolsGUI_MaterialPropertiesDlg.h" +#include "GEOMToolsGUI_LineWidthDlg.h" #include #include @@ -79,6 +80,7 @@ #include #include #include +#include #if OCC_VERSION_LARGE > 0x06040000 // Porting to OCCT6.5.1 #include @@ -392,7 +394,6 @@ void GEOMToolsGUI::OnTexture() if ( !selected.IsEmpty() ) { SUIT_ViewWindow* window = app->desktop()->activeWindow(); bool isOCC = ( window && window->getViewManager()->getType() == OCCViewer_Viewer::Type() ); - int mgrId = window->getViewManager()->getGlobalId(); if ( isOCC ) { QString aTexture = QFileDialog::getOpenFileName(window,tr( "GEOM_SELECT_IMAGE"),QString(), tr("OCC_IMAGE_FILES")); if( !aTexture.isEmpty() ) @@ -563,12 +564,17 @@ void GEOMToolsGUI::OnNbIsos( ActionType actionType ) } for(; ic->MoreCurrent(); ic->NextCurrent()) { + int aMgrId = window->getViewManager()->getGlobalId(); CurObject = Handle(GEOM_AISShape)::DownCast(ic->Current()); Handle(AIS_Drawer) CurDrawer = CurObject->Attributes(); - CurDrawer->SetUIsoAspect( new Prs3d_IsoAspect(Quantity_NOC_GRAY75, Aspect_TOL_SOLID, 0.5 , newNbUIso) ); - CurDrawer->SetVIsoAspect( new Prs3d_IsoAspect(Quantity_NOC_GRAY75, Aspect_TOL_SOLID, 0.5 , newNbVIso) ); + QVariant v = aStudy->getObjectProperty( aMgrId, CurObject->getIO()->getEntry(), EDGE_WIDTH_PROP , QVariant() ); + + int width = v.isValid() ? v.toInt() : 1; + + CurDrawer->SetUIsoAspect( new Prs3d_IsoAspect(Quantity_NOC_GRAY75, Aspect_TOL_SOLID, width , newNbUIso) ); + CurDrawer->SetVIsoAspect( new Prs3d_IsoAspect(Quantity_NOC_GRAY75, Aspect_TOL_SOLID, width , newNbVIso) ); CurObject->storeIsoNumbers(); @@ -576,8 +582,7 @@ void GEOMToolsGUI::OnNbIsos( ActionType actionType ) ic->Redisplay(CurObject); QString anIsos("%1%2%3");anIsos = anIsos.arg(newNbUIso);anIsos = anIsos.arg(DIGIT_SEPARATOR);anIsos = anIsos.arg(newNbVIso); - int aMgrId = window->getViewManager()->getGlobalId(); - aStudy->setObjectProperty(aMgrId ,CurObject->getIO()->getEntry(), ISOS_PROP, anIsos); + aStudy->setObjectProperty(aMgrId ,CurObject->getIO()->getEntry(), ISOS_WIDTH_PROP, anIsos); } } GeometryGUI::Modified(); @@ -940,3 +945,245 @@ void GEOMToolsGUI::OnPublishObject() { new GEOMToolsGUI_PublishDlg( SUIT_Session::session()->activeApplication()->desktop() ); publishDlg->exec(); } + + +void GEOMToolsGUI::OnEdgeWidth() +{ + SUIT_ViewWindow* window = SUIT_Session::session()->activeApplication()->desktop()->activeWindow(); + SalomeApp_Study* appStudy = dynamic_cast( SUIT_Session::session()->activeApplication()->activeStudy() ); + + + bool isOCC = (window && window->getViewManager()->getType() == OCCViewer_Viewer::Type()); + bool isVTK = (window && window->getViewManager()->getType() == SVTK_Viewer::Type()); + int mgrId = window->getViewManager()->getGlobalId(); + + if (isOCC) { // if is OCCViewer + OCCViewer_Viewer* vm = dynamic_cast(window->getViewManager()->getViewModel()); + Handle (AIS_InteractiveContext) ic = vm->getAISContext(); + ic->InitCurrent(); + if (ic->MoreCurrent()) { + Handle(GEOM_AISShape) CurObject = Handle(GEOM_AISShape)::DownCast(ic->Current()); + + int aWidth = (int)CurObject->Width(); + + GEOMToolsGUI_LineWidthDlg * Dlg = new GEOMToolsGUI_LineWidthDlg + (SUIT_Session::session()->activeApplication()->desktop(),"EDGE_WIDTH_TLT"); + Dlg->setTheLW(aWidth); + int aNewWidth = 0; + if (Dlg->exec()) { + aNewWidth = Dlg->getTheLW(); + bool ok = (aNewWidth != aWidth && aNewWidth != 0 ); + if (ok) { + for(; ic->MoreCurrent(); ic->NextCurrent()) { + CurObject = Handle(GEOM_AISShape)::DownCast(ic->Current()); + CurObject->SetWidth(aNewWidth); + ic->Redisplay(CurObject); + appStudy->setObjectProperty(mgrId,CurObject->getIO()->getEntry(), EDGE_WIDTH_PROP, aNewWidth); + } + } + } + } + else { + return; + } + GeometryGUI::Modified(); + } + else if (isVTK) { // if is VTKViewer + SalomeApp_Application* app = dynamic_cast + (SUIT_Session::session()->activeApplication()); + if (!app) + return; + + LightApp_SelectionMgr* aSelMgr = app->selectionMgr(); + if (!aSelMgr) + return; + + SALOME_ListIO selected; + aSelMgr->selectedObjects(selected); + if (selected.IsEmpty()) + return; + + SVTK_ViewWindow* vtkVW = dynamic_cast(window); + if (!vtkVW) + return; + + SALOME_View* view = GEOM_Displayer::GetActiveView(); + + vtkActorCollection* aCollection = vtkActorCollection::New(); + + for (SALOME_ListIteratorOfListIO It (selected); It.More(); It.Next()) { + Handle(SALOME_InteractiveObject) anIObject = It.Value(); + SALOME_Prs* aPrs = view->CreatePrs(anIObject->getEntry()); + SVTK_Prs* vtkPrs = dynamic_cast(aPrs); + if (vtkPrs) { + vtkActorCollection* anActors = vtkPrs->GetObjects(); + anActors->InitTraversal(); + vtkActor* anAct = anActors->GetNextActor(); + aCollection->AddItem(anAct); + } + } + + if (aCollection) + aCollection->InitTraversal(); + else + return; + + int aWidth = 1; + + vtkActor* anAct = aCollection->GetNextActor(); + if (GEOM_Actor* anActor = GEOM_Actor::SafeDownCast(anAct)) + aWidth = anActor->GetWidth(); + else + return; + + GEOMToolsGUI_LineWidthDlg * Dlg = new GEOMToolsGUI_LineWidthDlg + (SUIT_Session::session()->activeApplication()->desktop(),"EDGE_WIDTH_TLT"); + + Dlg->setTheLW(aWidth); + if (Dlg->exec()) { + SUIT_OverrideCursor(); + aWidth = Dlg->getTheLW(); + while (anAct != NULL) { + if (GEOM_Actor* anActor = GEOM_Actor::SafeDownCast(anAct)) { + // There are no casting to needed actor. + anActor->SetWidth(aWidth); + appStudy->setObjectProperty(mgrId, anActor->getIO()->getEntry(), EDGE_WIDTH_PROP, aWidth); + } + anAct = aCollection->GetNextActor(); + } + } + GeometryGUI::Modified(); + } // end vtkviewer +} + + +void GEOMToolsGUI::OnIsosWidth() { + SalomeApp_Application* app = + dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() ); + SalomeApp_Study* aStudy = dynamic_cast( app->activeStudy() ); + SUIT_ViewWindow* window = app->desktop()->activeWindow(); + + bool isOCC = ( window && window->getViewManager()->getType() == OCCViewer_Viewer::Type() ); + bool isVTK = ( window && window->getViewManager()->getType() == SVTK_Viewer::Type() ); + + if(isOCC){ // if is OCCViewer + + OCCViewer_Viewer* vm = dynamic_cast( window->getViewManager()->getViewModel() ); + Handle (AIS_InteractiveContext) ic = vm->getAISContext(); + + ic->InitCurrent(); + if ( ic->MoreCurrent() ) { + Handle(GEOM_AISShape) CurObject = Handle(GEOM_AISShape)::DownCast(ic->Current()); + CurObject->restoreIsoNumbers(); + Handle(AIS_Drawer) CurDrawer = CurObject->Attributes(); + + Handle(Graphic3d_AspectLine3d) asp = CurDrawer->UIsoAspect()->Aspect(); + + Quantity_Color C; + Aspect_TypeOfLine T; + Standard_Real W; + asp->Values(C,T,W); + + int aWidth = (int)W; + + GEOMToolsGUI_LineWidthDlg * Dlg = + new GEOMToolsGUI_LineWidthDlg( SUIT_Session::session()->activeApplication()->desktop(),"ISOS_WIDTH_TLT" ); + + Dlg->setTheLW( aWidth ); + + if ( Dlg->exec() ) { + SUIT_OverrideCursor(); + aWidth = Dlg->getTheLW(); + } else //Cancel case + return; + + for(; ic->MoreCurrent(); ic->NextCurrent()) { + int aMgrId = window->getViewManager()->getGlobalId(); + CurObject = Handle(GEOM_AISShape)::DownCast(ic->Current()); + + Handle(AIS_Drawer) CurDrawer = CurObject->Attributes(); + + CurObject->Attributes()->UIsoAspect()->SetWidth(aWidth); + CurObject->Attributes()->VIsoAspect()->SetWidth(aWidth); + + ic->Redisplay(CurObject); + + aStudy->setObjectProperty(aMgrId ,CurObject->getIO()->getEntry(), ISOS_WIDTH_PROP, aWidth); + } + GeometryGUI::Modified(); + } + } + else if(isVTK){ // if is VTKViewer + // + // Warning. It's works incorrect. must be recheked. + // + SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* > + ( SUIT_Session::session()->activeApplication() ); + if ( !app ) + return; + LightApp_SelectionMgr* aSelMgr = app->selectionMgr(); + if ( !aSelMgr ) + return; + SALOME_ListIO selected; + aSelMgr->selectedObjects( selected ); + if ( selected.IsEmpty() ) + return; + + SVTK_ViewWindow* vtkVW = dynamic_cast( window ); + if ( !vtkVW ) + return; + + SALOME_View* view = GEOM_Displayer::GetActiveView(); + + vtkActorCollection* aCollection = vtkActorCollection::New(); + + for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) { + Handle(SALOME_InteractiveObject) anIObject = It.Value(); + SALOME_Prs* aPrs = view->CreatePrs( anIObject->getEntry() ); + SVTK_Prs* vtkPrs = dynamic_cast( aPrs ); + if ( vtkPrs ) { + vtkActorCollection* anActors = vtkPrs->GetObjects(); + anActors->InitTraversal(); + vtkActor* anAct = anActors->GetNextActor(); + aCollection->AddItem(anAct); + } + } + + if(aCollection) + aCollection->InitTraversal(); + else + return; + + int aWidth = 1; + + vtkActor* anAct = aCollection->GetNextActor(); + if (GEOM_Actor* anActor = GEOM_Actor::SafeDownCast(anAct)) { + aWidth = anActor->GetIsosWidth(); + } + else + return; + + GEOMToolsGUI_LineWidthDlg* Dlg = + new GEOMToolsGUI_LineWidthDlg( SUIT_Session::session()->activeApplication()->desktop(), "ISOS_WIDTH_TLT" ); + + Dlg->setTheLW( aWidth ); + if (Dlg->exec() ) { + SUIT_OverrideCursor(); + aWidth = Dlg->getTheLW(); + } else + return; //Cancel case + + while( anAct!= NULL ) { + if(GEOM_Actor* anActor = GEOM_Actor::SafeDownCast(anAct)) { + // There are no casting to needed actor. + anActor->SetIsosWidth(aWidth); + int aMgrId = window->getViewManager()->getGlobalId(); + aStudy->setObjectProperty(aMgrId ,anActor->getIO()->getEntry(), ISOS_WIDTH_PROP, aWidth); + } + anAct = aCollection->GetNextActor(); + } + + view->Repaint(); + GeometryGUI::Modified(); + } // end vtkviewer +} diff --git a/src/GEOMToolsGUI/GEOMToolsGUI_LineWidthDlg.cxx b/src/GEOMToolsGUI/GEOMToolsGUI_LineWidthDlg.cxx new file mode 100644 index 000000000..49c845da2 --- /dev/null +++ b/src/GEOMToolsGUI/GEOMToolsGUI_LineWidthDlg.cxx @@ -0,0 +1,192 @@ +// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +// GEOM GEOMGUI : GUI for Geometry component +// File : GEOMToolsGUI_LineWidthDlg.cxx +// Author : OCC Team +// +#include "GEOMToolsGUI_LineWidthDlg.h" +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +//================================================================================= +// class : GEOMToolsGUI_LineWidthDlg() +// purpose : Constructs a GEOMToolsGUI_LineWidthDlg which is a child of 'parent', with the +// name 'name' and widget flags set to 'f'. +// The dialog will by default be modeless, unless you set 'modal' to +// TRUE to construct a modal dialog. +//================================================================================= + +GEOMToolsGUI_LineWidthDlg::GEOMToolsGUI_LineWidthDlg (QWidget* parent, const QString& title) + : QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint) +{ + setObjectName("GEOMToolsGUI_LineWidthDlg"); + setModal(true); + + setWindowTitle(tr(title.toLatin1().constData())); + setSizeGripEnabled(TRUE); + QGridLayout* MyDialogLayout = new QGridLayout(this); + MyDialogLayout->setSpacing(6); + MyDialogLayout->setMargin(11); + + + /***************************************************************/ + QGroupBox* GroupC1 = new QGroupBox (this); + GroupC1->setObjectName("GroupC1"); + QGridLayout* GroupC1Layout = new QGridLayout (GroupC1); + GroupC1Layout->setAlignment(Qt::AlignTop); + GroupC1Layout->setSpacing(6); + GroupC1Layout->setMargin(11); + + QLabel* TextLabel1 = new QLabel (GroupC1); + TextLabel1->setObjectName("TextLabel1"); + TextLabel1->setText(tr("GEOM_LINE_WIDTH")); + GroupC1Layout->addWidget(TextLabel1, 0, 0); + + + mySpinBox = new SalomeApp_IntSpinBox (GroupC1); + mySpinBox->setRange( 1, 5 ); + mySpinBox->setSingleStep( 1 ); + + mySpinBox->setObjectName("SpinBoxU"); + mySpinBox->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); + mySpinBox->setValue(1); + GroupC1Layout->addWidget(mySpinBox, 0, 1); + + + /***************************************************************/ + QGroupBox* GroupButtons = new QGroupBox (this); + GroupButtons->setObjectName("GroupButtons"); + QGridLayout* GroupButtonsLayout = new QGridLayout (GroupButtons); + GroupButtonsLayout->setAlignment(Qt::AlignTop); + GroupButtonsLayout->setSpacing(6); + GroupButtonsLayout->setMargin(11); + + QPushButton* buttonOk = new QPushButton (GroupButtons); + buttonOk->setObjectName("buttonOk"); + buttonOk->setText(tr("GEOM_BUT_OK")); + buttonOk->setAutoDefault(TRUE); + buttonOk->setDefault(TRUE); + GroupButtonsLayout->addWidget(buttonOk, 0, 0); + + GroupButtonsLayout->addItem(new QSpacerItem (20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 1); + + QPushButton* buttonCancel = new QPushButton (GroupButtons); + buttonCancel->setObjectName("buttonCancel"); + buttonCancel->setText(tr("GEOM_BUT_CANCEL")); + buttonCancel->setAutoDefault(TRUE); + GroupButtonsLayout->addWidget(buttonCancel, 0, 1); + + QPushButton* buttonHelp = new QPushButton (GroupButtons); + buttonHelp->setObjectName("buttonHelp"); + buttonHelp->setText(tr("GEOM_BUT_HELP")); + buttonHelp->setAutoDefault(TRUE); + GroupButtonsLayout->addWidget(buttonHelp, 0, 2); + /***************************************************************/ + + MyDialogLayout->addWidget(GroupC1, 0, 0); + MyDialogLayout->addWidget(GroupButtons, 1, 0); + + myHelpFileName = "line_width_page.html"; + + // signals and slots connections + connect(buttonOk, SIGNAL(clicked()), this, SLOT(accept())); + connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject())); + connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp())); + + // Move widget on the botton right corner of main widget + SUIT_Tools::centerWidget(this, parent); +} + + +//================================================================================= +// function : ~GEOMToolsGUI_LineWidthDlg() +// purpose : Destroys the object and frees any allocated resources +//================================================================================= +GEOMToolsGUI_LineWidthDlg::~GEOMToolsGUI_LineWidthDlg() +{ + // no need to delete child widgets, Qt does it all for us +} + +int GEOMToolsGUI_LineWidthDlg::getTheLW() const +{ + return mySpinBox->text().toInt(); +} + +void GEOMToolsGUI_LineWidthDlg::setTheLW (const int v) +{ + mySpinBox->setValue(v); +} + + +//================================================================================= +// function : ClickOnHelp() +// purpose : +//================================================================================= +void GEOMToolsGUI_LineWidthDlg::ClickOnHelp() +{ + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) { + GeometryGUI* aGeomGUI = dynamic_cast(app->module("Geometry")); + app->onHelpContextModule(aGeomGUI ? app->moduleName(aGeomGUI->moduleName()) : QString(""), myHelpFileName); + } + else { + QString platform; +#ifdef WIN32 + platform = "winapplication"; +#else + platform = "application"; +#endif + SUIT_MessageBox::warning + (0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName), + QObject::tr("BUT_OK")); + } +} + +//================================================================================= +// function : keyPressEvent() +// purpose : +//================================================================================= +void GEOMToolsGUI_LineWidthDlg::keyPressEvent (QKeyEvent* e) +{ + QDialog::keyPressEvent(e); + if (e->isAccepted()) + return; + + if (e->key() == Qt::Key_F1) { + e->accept(); + ClickOnHelp(); + } +} diff --git a/src/GEOMToolsGUI/GEOMToolsGUI_LineWidthDlg.h b/src/GEOMToolsGUI/GEOMToolsGUI_LineWidthDlg.h new file mode 100644 index 000000000..09bfe4446 --- /dev/null +++ b/src/GEOMToolsGUI/GEOMToolsGUI_LineWidthDlg.h @@ -0,0 +1,59 @@ +// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +// GEOM GEOMGUI : GUI for Geometry component +// File : GEOMToolsGUI_DeflectionDlg.h +// Author : OCC Team +// +#ifndef GEOMTOOLSGUI_LINEWIDTHDLG_H +#define GEOMTOOLSGUI_LINEWIDTHDLG_H + +#include "GEOM_ToolsGUI.hxx" + +#include + +class SalomeApp_IntSpinBox; + +//================================================================================= +// class : GEOMToolsGUI_LineWidthDlg +// purpose : +//================================================================================= +class GEOMTOOLSGUI_EXPORT GEOMToolsGUI_LineWidthDlg : public QDialog +{ + Q_OBJECT + +public: + GEOMToolsGUI_LineWidthDlg( QWidget*, const QString& ); + ~GEOMToolsGUI_LineWidthDlg(); + + int getTheLW() const; + void setTheLW( const int ); + +private slots: + void ClickOnHelp(); + +private: + void keyPressEvent( QKeyEvent* ); + +private: + SalomeApp_IntSpinBox* mySpinBox; + QString myHelpFileName; +}; + +#endif // GEOMTOOLSGUI_LINEWIDTHDLG_H diff --git a/src/GEOMToolsGUI/Makefile.am b/src/GEOMToolsGUI/Makefile.am index 63afb84f2..c3a32d6f4 100644 --- a/src/GEOMToolsGUI/Makefile.am +++ b/src/GEOMToolsGUI/Makefile.am @@ -36,7 +36,8 @@ salomeinclude_HEADERS = \ GEOMToolsGUI_DeleteDlg.h \ GEOMToolsGUI_MarkerDlg.h \ GEOMToolsGUI_PublishDlg.h \ - GEOMToolsGUI_MaterialPropertiesDlg.h + GEOMToolsGUI_MaterialPropertiesDlg.h \ + GEOMToolsGUI_LineWidthDlg.h dist_libGEOMToolsGUI_la_SOURCES = \ GEOMToolsGUI.cxx \ @@ -47,7 +48,8 @@ dist_libGEOMToolsGUI_la_SOURCES = \ GEOMToolsGUI_DeleteDlg.cxx \ GEOMToolsGUI_MarkerDlg.cxx \ GEOMToolsGUI_PublishDlg.cxx \ - GEOMToolsGUI_MaterialPropertiesDlg.cxx + GEOMToolsGUI_MaterialPropertiesDlg.cxx \ + GEOMToolsGUI_LineWidthDlg.cxx MOC_FILES = \ GEOMToolsGUI_TransparencyDlg_moc.cxx \ @@ -56,7 +58,8 @@ MOC_FILES = \ GEOMToolsGUI_DeleteDlg_moc.cxx \ GEOMToolsGUI_MarkerDlg_moc.cxx \ GEOMToolsGUI_PublishDlg_moc.cxx \ - GEOMToolsGUI_MaterialPropertiesDlg_moc.cxx + GEOMToolsGUI_MaterialPropertiesDlg_moc.cxx \ + GEOMToolsGUI_LineWidthDlg_moc.cxx nodist_libGEOMToolsGUI_la_SOURCES = \ $(MOC_FILES) diff --git a/src/MeasureGUI/MeasureGUI.h b/src/MeasureGUI/MeasureGUI.h index 4a9f28201..d196684f8 100644 --- a/src/MeasureGUI/MeasureGUI.h +++ b/src/MeasureGUI/MeasureGUI.h @@ -33,6 +33,12 @@ // class : MeasureGUI // purpose : //================================================================================= + +#define DISPLAY_PREVIEW_MACRO \ +SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); \ +int w = resMgr->integerValue("Geometry", "measures_line_width", 1); \ +displayPreview(true, false, true, true, w, -1, -1); + class MeasureGUI : public GEOMGUI { public: diff --git a/src/MeasureGUI/MeasureGUI_AngleDlg.cxx b/src/MeasureGUI/MeasureGUI_AngleDlg.cxx index d80594e04..d628fa594 100644 --- a/src/MeasureGUI/MeasureGUI_AngleDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_AngleDlg.cxx @@ -377,6 +377,10 @@ SALOME_Prs* MeasureGUI_AngleDlg::buildPrs() anIO->SetArrowSize(arrowSize); } + SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); + int w = resMgr->integerValue("Geometry", "measures_line_width", 1); + anIO->SetWidth(w); + SOCC_Prs* aPrs = dynamic_cast(((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->CreatePrs(0)); diff --git a/src/MeasureGUI/MeasureGUI_CheckCompoundOfBlocksDlg.cxx b/src/MeasureGUI/MeasureGUI_CheckCompoundOfBlocksDlg.cxx index c61cbc0af..2c8166beb 100644 --- a/src/MeasureGUI/MeasureGUI_CheckCompoundOfBlocksDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_CheckCompoundOfBlocksDlg.cxx @@ -24,6 +24,7 @@ // File : MeasureGUI_CheckCompoundOfBlocksDlg.cxx // Author : Vladimir KLYACHIN, Open CASCADE S.A.S. (vladimir.klyachin@opencascade.com) // +#include "MeasureGUI.h" #include "MeasureGUI_CheckCompoundOfBlocksDlg.h" #include "MeasureGUI_Widgets.h" @@ -188,7 +189,7 @@ void MeasureGUI_CheckCompoundOfBlocksDlg::SelectionIntoArgument() myObj = aSelectedObject; myGrp->LineEdit1->setText( GEOMBase::GetName( myObj ) ); processObject(); - displayPreview(true); + DISPLAY_PREVIEW_MACRO; } //================================================================================= @@ -228,7 +229,7 @@ void MeasureGUI_CheckCompoundOfBlocksDlg::ActivateThisDialog() connect( aSel, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); activateSelection(); - displayPreview(true); + DISPLAY_PREVIEW_MACRO } //================================================================================= @@ -418,9 +419,11 @@ void MeasureGUI_CheckCompoundOfBlocksDlg::onSubShapesListSelectionChanged() QList::iterator it; for ( it = aIds.begin(); it != aIds.end(); ++it ) { aSubShape = anIndices.FindKey(aObjLst[(*it)]); + SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); + int w = resMgr->integerValue("Geometry", "measures_line_width", 1); try { getDisplayer()->SetColor( Quantity_NOC_RED ); - getDisplayer()->SetWidth( 3 ); + getDisplayer()->SetWidth( w ); getDisplayer()->SetToActivate( false ); aPrs = !aSubShape.IsNull() ? getDisplayer()->BuildPrs( aSubShape ) : 0; if ( aPrs ) diff --git a/src/MeasureGUI/MeasureGUI_DistanceDlg.cxx b/src/MeasureGUI/MeasureGUI_DistanceDlg.cxx index ecd82d3e3..3b8bc2a13 100644 --- a/src/MeasureGUI/MeasureGUI_DistanceDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_DistanceDlg.cxx @@ -327,6 +327,10 @@ SALOME_Prs* MeasureGUI_DistanceDlg::buildPrs() Handle(AIS_LengthDimension) anIO = new AIS_LengthDimension( aVert1, aVert2, P, aDist, TCollection_ExtendedString((Standard_CString)aLabel.toLatin1().constData())); anIO->SetArrowSize(aDist/20); + + SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); + int w = resMgr->integerValue("Geometry", "measures_line_width", 1); + anIO->SetWidth(w); SOCC_Prs* aPrs = dynamic_cast(((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->CreatePrs(0)); diff --git a/src/MeasureGUI/MeasureGUI_NormaleDlg.cxx b/src/MeasureGUI/MeasureGUI_NormaleDlg.cxx index 44fc3639a..4b8ab9329 100644 --- a/src/MeasureGUI/MeasureGUI_NormaleDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_NormaleDlg.cxx @@ -21,6 +21,7 @@ // File : MeasureGUI_NormaleDlg.cxx // Author : Julia DOROVSKIKH, Open CASCADE S.A.S. // +#include "MeasureGUI.h" #include "MeasureGUI_NormaleDlg.h" #include @@ -246,7 +247,7 @@ void MeasureGUI_NormaleDlg::SelectionIntoArgument() GroupArgs->PushButton1->click(); } - displayPreview(true); + DISPLAY_PREVIEW_MACRO } //================================================================================= @@ -286,7 +287,7 @@ void MeasureGUI_NormaleDlg::SetEditCurrentArgument() send->setDown(true); // seems we need it only to avoid preview disappearing, caused by selection mode change - displayPreview(true); + DISPLAY_PREVIEW_MACRO } //================================================================================= @@ -313,7 +314,7 @@ void MeasureGUI_NormaleDlg::ActivateThisDialog() connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - displayPreview(true); + DISPLAY_PREVIEW_MACRO } //================================================================================= diff --git a/src/OBJECT/GEOM_Actor.cxx b/src/OBJECT/GEOM_Actor.cxx index 318ea45b8..9b956bf68 100644 --- a/src/OBJECT/GEOM_Actor.cxx +++ b/src/OBJECT/GEOM_Actor.cxx @@ -497,6 +497,12 @@ void GEOM_Actor::SetWireframeProperty(vtkProperty* Prop) myWireframeFaceActor->SetProperty(Prop); } + +vtkProperty* GEOM_Actor::GetWireframeProperty() +{ + return myWireframeFaceActor->GetProperty(); +} + void GEOM_Actor::SetShadingProperty(vtkProperty* Prop) { #ifdef MYDEBUG @@ -506,6 +512,12 @@ void GEOM_Actor::SetShadingProperty(vtkProperty* Prop) } +vtkProperty* GEOM_Actor::GetShadingProperty() +{ + return myShadingFaceProp; +} + + void GEOM_Actor::Render(vtkRenderer *ren, vtkMapper *theMapper) { #ifdef MYDEBUG @@ -995,6 +1007,27 @@ void GEOM_Actor::StoreIsoNumbers() myWireframeFaceSource->GetNbIso(myNbIsos[0], myNbIsos[1]); } +void GEOM_Actor::SetIsosWidth(const int width) { + myWireframeFaceActor->GetProperty()->SetLineWidth(width); +} + +int GEOM_Actor::GetIsosWidth() const { + return myWireframeFaceActor->GetProperty()->GetLineWidth(); +} + +void GEOM_Actor::SetWidth(const int width) { + myIsolatedEdgeActor->GetProperty()->SetLineWidth(width); + myOneFaceEdgeActor->GetProperty()->SetLineWidth(width); + mySharedEdgeActor->GetProperty()->SetLineWidth(width); + myHighlightProp->SetLineWidth(width); + myPreHighlightProp->SetLineWidth(width+1); + +} + +int GEOM_Actor::GetWidth() const { + return myIsolatedEdgeActor->GetProperty()->GetLineWidth(); +} + void GEOM_Actor::RestoreIsoNumbers() { if ( myNbIsos[0] > 0 || myNbIsos[1] > 0 ) diff --git a/src/OBJECT/GEOM_Actor.h b/src/OBJECT/GEOM_Actor.h index a6e890d65..c0c31fc5a 100644 --- a/src/OBJECT/GEOM_Actor.h +++ b/src/OBJECT/GEOM_Actor.h @@ -86,6 +86,9 @@ public: void SetWireframeProperty(vtkProperty* Prop); void SetShadingProperty(vtkProperty* Prop); + vtkProperty* GetWireframeProperty(); + vtkProperty* GetShadingProperty(); + void setDeflection(double adef); virtual void setDisplayMode(int thenewmode); @@ -166,6 +169,15 @@ public: void GetNbIsos(int &theNbU,int &theNbV); + virtual + void SetIsosWidth(const int width); + + int GetIsosWidth() const; + + virtual void SetWidth(const int width); + + int GetWidth() const; + //! Vector mode management virtual void diff --git a/src/OBJECT/GEOM_Constants.h b/src/OBJECT/GEOM_Constants.h index 49bdabe8a..655dfc125 100644 --- a/src/OBJECT/GEOM_Constants.h +++ b/src/OBJECT/GEOM_Constants.h @@ -45,5 +45,7 @@ #define MARKER_TYPE_PROP "MarkerType" //Marker type property #define FRONT_MATERIAL_PROP "FrontMaterial" //Object front material property #define BACK_MATERIAL_PROP "BackMaterial" //Object back material property +#define EDGE_WIDTH_PROP "EdgeWidth" //Width of the edge +#define ISOS_WIDTH_PROP "IsosWidth" //Width of the iso-lines #endif //GEOM_CONSTANTS_H -- 2.39.2