// try to load library if it is not loaded yet
QCString libs;
#ifndef WNT
- if ( (libs = getenv( "LD_LIBRARY_PATH" )) ) {
- QStringList dirList = QStringList::split( ":", libs, false ); // skip empty entries
+ if( ( libs = getenv( "LD_LIBRARY_PATH" ) ) ) {
+ QStringList dirList = QStringList::split( ":", libs, false ); // skip empty entries
#else
- if ( (libs = getenv( "PATH" )) ) {
- QStringList dirList = QStringList::split( ";", libs, false ); // skip empty entries
+ if( ( libs = getenv( "PATH" ) ) ) {
+ QStringList dirList = QStringList::split( ";", libs, false ); // skip empty entries
#endif
for( int i = dirList.count()-1; i >= 0; i-- ) {
QString dir = dirList[ i ];
id == 2175 || // POPUP VIEWER - SELECT ONLY - SHELL
id == 2176 || // POPUP VIEWER - SELECT ONLY - SOLID
id == 2177 || // POPUP VIEWER - SELECT ONLY - COMPOUND
- id == 2178 || // POPUP VIEWER - SELECT ONLY - SELECT ALL
+ id == 2178 || // POPUP VIEWER - SELECT ONLY - SELECT ALL
id == 31 || // MENU EDIT - COPY
id == 33 || // MENU EDIT - DELETE
id == 411 || // MENU SETTINGS - ADD IN STUDY
createGeomAction( 707, "CHECK" );
createGeomAction( 7072, "CHECK_COMPOUND" );
-#ifdef _DEBUG_ // PAL16821
+#ifdef _DEBUG_ // PAL16821
createGeomAction( 5103, "CHECK_GEOMETRY" );
#endif
createGeomAction( 412, "SHADING_COLOR" );
createMenu( 707, measurId, -1 );
createMenu( 7072, measurId, -1 );
-#ifdef _DEBUG_ // PAL16821
+#ifdef _DEBUG_ // PAL16821
int toolsId = createMenu( tr( "MEN_TOOLS" ), -1, -1, 50 );
createMenu( separator(), toolsId, -1 );
createMenu( 5103, toolsId, -1 );
mgr->setRule( action( 214 ), clientOCCorVTK, true );
QString selectOnly = "(client='OCCViewer' or client='VTKViewer') and (selcount=0)";
-
+
int selectolnyId = mgr->insert( tr("MEN_SELECT_ONLY"), -1, -1); //select only menu
mgr->insert( action(2171), selectolnyId, -1); //Vertex
mgr->setRule(action(2171), selectOnly, true);
mgr->insert( action(2178), selectolnyId, -1); //Clear selection filter
mgr->setRule(action(2178), selectOnly, true);
mgr->setRule(action(2178), selectOnly + " and selectionmode='ALL'", false);
-
+
mgr->insert( action( 213 ), -1, -1 ); // display only
mgr->setRule( action( 213 ), rule.arg( types ).arg( "true" ), true );
mgr->insert( separator(), -1, -1 );
myVTKSelectors.append( new LightApp_VTKSelector( dynamic_cast<SVTK_Viewer*>( vm->getViewModel() ), sm ) );
// disable OCC selectors
- //getApp()->selectionMgr()->setEnabled( false, OCCViewer_Viewer::Type() );
+ getApp()->selectionMgr()->setEnabled( false, OCCViewer_Viewer::Type() );
for ( GEOMGUI_OCCSelector* sr = myOCCSelectors.first(); sr; sr = myOCCSelectors.next() )
sr->setEnabled(true);
// disable VTK selectors
- //getApp()->selectionMgr()->setEnabled( false, SVTK_Viewer::Type() );
+ getApp()->selectionMgr()->setEnabled( false, SVTK_Viewer::Type() );
for ( LightApp_VTKSelector* sr = myVTKSelectors.first(); sr; sr = myVTKSelectors.next() )
sr->setEnabled(true);
#include "SalomeApp_Application.h"
#include "LightApp_SelectionMgr.h"
+#include <TopoDS_Shape.hxx>
+#include <TopoDS.hxx>
+#include <TopExp.hxx>
+#include <TColStd_IndexedMapOfInteger.hxx>
+#include <TopTools_IndexedMapOfShape.hxx>
+
#include <qlabel.h>
#include "GEOMImpl_Types.hxx"
if (!testResult)
return;
+ QString aName = GEOMBase::GetName(aSelectedObject);
+
if (myEditCurrentArgument == GroupArgs->LineEdit1) {
myFace = aSelectedObject;
}
else if (myEditCurrentArgument == GroupArgs->LineEdit2) {
+ TopoDS_Shape aShape;
+ if (GEOMBase::GetShape(aSelectedObject, aShape, TopAbs_SHAPE) && !aShape.IsNull())
+ {
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ TColStd_IndexedMapOfInteger aMap;
+ aSelMgr->GetIndexes(firstIObject(), aMap);
+ if (aMap.Extent() == 1) // Local Selection
+ {
+ GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId());
+ int anIndex = aMap( 1 );
+ aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
+ aName += QString(":vertex_%1").arg(anIndex);
+ }
+ else // Global Selection
+ {
+ if (aShape.ShapeType() != TopAbs_VERTEX) {
+ aSelectedObject = GEOM::GEOM_Object::_nil();
+ aName = "";
+ }
+ }
+ }
myPoint = aSelectedObject;
}
-
- myEditCurrentArgument->setText(GEOMBase::GetName(aSelectedObject));
+ myEditCurrentArgument->setText( aName );
displayPreview();
}
void MeasureGUI_NormaleDlg::SetEditCurrentArgument()
{
QPushButton* send = (QPushButton*)sender();
+ globalSelection(GEOM_FACE);
if (send == GroupArgs->PushButton1) {
myEditCurrentArgument = GroupArgs->LineEdit1;
- globalSelection(GEOM_FACE);
}
else if (send == GroupArgs->PushButton2) {
myEditCurrentArgument = GroupArgs->LineEdit2;
- globalSelection(GEOM_POINT);
+ localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
}
myEditCurrentArgument->setFocus();