#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"
double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100);
/* min, max, step and decimals for spin boxes */
- GroupPoints->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, step, 3);
- GroupDimensions->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, step, 3);
+ GroupPoints->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ GroupDimensions->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, step, DBL_DIGITS_DISPLAY);
GroupPoints->SpinBox_DX->SetValue(100.0);
GroupDimensions->SpinBox_DX->SetValue(100.0);
{
case 0:
{
- globalSelection( GEOM_POINT );
+ localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
GroupDimensions->hide();
resize(0, 0);
GroupPoints->show();
if (!testResult || CORBA::is_nil( aSelectedObject ))
return;
-
+
+ myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
+ 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 )
+ {
+ GEOM::GEOM_IShapesOperations_var aShapesOp =
+ getGeomEngine()->GetIShapesOperations( getStudyId() );
+ int anIndex = aMap( 1 );
+ TopTools_IndexedMapOfShape aShapes;
+ TopExp::MapShapes( aShape, aShapes );
+ aShape = aShapes.FindKey( anIndex );
+ aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
+ aSelMgr->clearSelected();
+ }
+ }
myPoint = aSelectedObject;
- myEditCurrentArgument->setText( GEOMBase::GetName( myPoint ) );
-
+
displayPreview();
}
if(send == GroupPoints->PushButton1) {
GroupPoints->LineEdit1->setFocus();
myEditCurrentArgument = GroupPoints->LineEdit1;
- globalSelection( GEOM_POINT );
+ localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
SelectionIntoArgument();
}
}