From 6e35826cb713c794dd25f6faa30a3315b8bed013 Mon Sep 17 00:00:00 2001 From: vsr Date: Wed, 31 Mar 2010 15:37:44 +0000 Subject: [PATCH] 0020695: EDF 1076 GEOM: Add a new shape in GEOM: T-shape Additional change: customize "What Is" information --- src/GEOMGUI/GEOM_msg_en.ts | 4 ++++ src/GEOMImpl/GEOMImpl_IMeasureOperations.cxx | 8 ++++++++ src/GEOMImpl/GEOMImpl_IMeasureOperations.hxx | 4 +++- src/MeasureGUI/MeasureGUI_WhatisDlg.cxx | 8 ++++++++ 4 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/GEOMGUI/GEOM_msg_en.ts b/src/GEOMGUI/GEOM_msg_en.ts index 05feaa709..1d2ff79b4 100644 --- a/src/GEOMGUI/GEOM_msg_en.ts +++ b/src/GEOMGUI/GEOM_msg_en.ts @@ -3984,6 +3984,10 @@ Please, select face, shell or solid and try again Would you like to take into account the units? Otherwise the dimensions will be kept without modifications. + + GEOM_ADVANCED + Advanced shape: type %1 + BasicGUI_CurveDlg diff --git a/src/GEOMImpl/GEOMImpl_IMeasureOperations.cxx b/src/GEOMImpl/GEOMImpl_IMeasureOperations.cxx index cb04f5776..3c6aabbc9 100644 --- a/src/GEOMImpl/GEOMImpl_IMeasureOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_IMeasureOperations.cxx @@ -155,6 +155,14 @@ GEOMImpl_IMeasureOperations::ShapeKind GEOMImpl_IMeasureOperations::KindOfShape TopoDS_Shape aShape = aRefShape->GetValue(); if (aShape.IsNull()) return aKind; + int geom_type = theShape->GetType(); + + // check if it's advanced shape + if ( geom_type > ADVANCED_BASE ) { + SetErrorCode(OK); + return SK_ADVANCED; + } + // Call algorithm GEOMAlgo_ShapeInfoFiller aSF; aSF.SetShape(aShape); diff --git a/src/GEOMImpl/GEOMImpl_IMeasureOperations.hxx b/src/GEOMImpl/GEOMImpl_IMeasureOperations.hxx index 286c83423..56f68e61b 100644 --- a/src/GEOMImpl/GEOMImpl_IMeasureOperations.hxx +++ b/src/GEOMImpl/GEOMImpl_IMeasureOperations.hxx @@ -78,7 +78,9 @@ class GEOMImpl_IMeasureOperations : public GEOM_IOperations { SK_SEGMENT, // segment SK_EDGE, // other edge // VERTEX - SK_VERTEX + SK_VERTEX, + // ADVANCED shapes + SK_ADVANCED, // all advanced shapes (temporary implementation) }; Standard_EXPORT ShapeKind KindOfShape (Handle(GEOM_Object) theShape, diff --git a/src/MeasureGUI/MeasureGUI_WhatisDlg.cxx b/src/MeasureGUI/MeasureGUI_WhatisDlg.cxx index 64faf036b..2c77dce21 100644 --- a/src/MeasureGUI/MeasureGUI_WhatisDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_WhatisDlg.cxx @@ -587,6 +587,14 @@ QString MeasureGUI_WhatisDlg::getKindOfShape( QString& theParameters ) "\n" + tr( "GEOM_Y" ) + PRINT_DOUBLE( aDbls[1] ) + "\n" + tr( "GEOM_Z" ) + PRINT_DOUBLE( aDbls[2] ); break; + case GEOM::GEOM_IKindOfShape::ADVANCED: + { + QString strid = QString( "GEOM_ADVANCED_%1" ).arg( myObj->GetType() ); + aKindStr = tr( strid.toLatin1().constData() ) == strid ? + tr( "GEOM_ADVANCED" ).arg( myObj->GetType() ) : + tr( strid.toLatin1().constData() ); + break; + } default: break; } -- 2.39.2