#include "SalomeApp_Application.h"
#include "LightApp_SelectionMgr.h"
+#include <TColStd_IndexedMapOfInteger.hxx>
+#include <TopTools_IndexedMapOfShape.hxx>
+#include <TopoDS_Shape.hxx>
+#include <TopoDS_Edge.hxx>
+#include <TopoDS.hxx>
+#include <TopExp.hxx>
+
#include <qlabel.h>
#include <qcheckbox.h>
{
case 0:
{
- globalSelection( GEOM_POINT );
+ localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX); //Select Vertex on All Shapes
Group3Pnts->show();
resize(0, 0);
}
case 1:
{
- globalSelection( GEOM_POINT );
+ localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX); //Select Vertex on All Shapes
Group3Pnts->hide();
resize(0, 0);
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), aRes );
if ( !CORBA::is_nil( aSelectedObject ) && aRes )
{
+ myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
+ // Get Selected object if selected subshape
+ 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();
+ }
+ }
switch (getConstructorId())
{
case 0:
{
- myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
if ( myEditCurrentArgument == Group3Pnts->LineEdit1 ) myPoint1 = aSelectedObject;
else if ( myEditCurrentArgument == Group3Pnts->LineEdit2 ) myPoint2 = aSelectedObject;
else if ( myEditCurrentArgument == Group3Pnts->LineEdit3 ) myPoint3 = aSelectedObject;
}
case 1:
{
- myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
if ( myEditCurrentArgument == Group3Pnts2->LineEdit1 ) myPoint1 = aSelectedObject;
else if ( myEditCurrentArgument == Group3Pnts2->LineEdit2 ) myPoint2 = aSelectedObject;
else if ( myEditCurrentArgument == Group3Pnts2->LineEdit3 ) myPoint3 = aSelectedObject;
}
myEditCurrentArgument->setFocus();
- globalSelection( GEOM_POINT );
+ // globalSelection( GEOM_POINT );
+ GEOM::GEOM_Object_var anObj;
+ localSelection( anObj, TopAbs_VERTEX );
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
}
if ( !CORBA::is_nil( aSelectedObject ) && aRes )
{
myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
- if ( myEditCurrentArgument == GroupPntVecR->LineEdit1 ) myPoint = aSelectedObject;
- else if ( myEditCurrentArgument == GroupPntVecR->LineEdit2 )
+ // If selected Vertex or Edge on the some Shape Get selection Subshape
+ TopoDS_Shape aShape;
+ if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() )
{
- if ( aRes && !aSelectedObject->_is_nil() )
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ TColStd_IndexedMapOfInteger aMap;
+ aSelMgr->GetIndexes( anIO, aMap );
+ if ( aMap.Extent() == 1 )
{
- TopoDS_Shape aShape;
-
- if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() )
- {
- LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
- TColStd_IndexedMapOfInteger aMap;
- aSelMgr->GetIndexes( anIO, 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 );
- myDir = aShapesOp->GetSubShape(aSelectedObject, anIndex);
- aSelMgr->clearSelected();
- }
- else
- myDir = aSelectedObject;
- }
+ 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();
}
}
+ if ( myEditCurrentArgument == GroupPntVecR->LineEdit1 ) myPoint = aSelectedObject;
+ else if ( myEditCurrentArgument == GroupPntVecR->LineEdit2 ) myDir = aSelectedObject;
else if ( myEditCurrentArgument == Group3Pnts->LineEdit1 ) myPoint1 = aSelectedObject;
else if ( myEditCurrentArgument == Group3Pnts->LineEdit2 ) myPoint2 = aSelectedObject;
else if ( myEditCurrentArgument == Group3Pnts->LineEdit3 ) myPoint3 = aSelectedObject;
if ( myEditCurrentArgument == GroupPntVecR->LineEdit2 )
{
- //globalSelection( GEOM_LINE );
GEOM::GEOM_Object_var anObj;
localSelection( anObj, TopAbs_EDGE );
}
- else
- globalSelection( GEOM_POINT );
+ else {
+ GEOM::GEOM_Object_var anObj;
+ localSelection( anObj, TopAbs_EDGE );
+ }
SelectionIntoArgument();
}
#include "SALOME_ListIteratorOfListIO.hxx"
#include "SALOME_ListIO.hxx"
+#include <TopoDS_Shape.hxx>
+#include <TopoDS.hxx>
+#include <TopExp.hxx>
+#include <TColStd_IndexedMapOfInteger.hxx>
+#include <TopTools_IndexedMapOfShape.hxx>
+
#include "GEOMImpl_Types.hxx"
using namespace std;
myPoints = new GEOM::ListOfGO();
myPoints->length( 0 );
- globalSelection( GEOM_POINT );
+ // globalSelection( GEOM_POINT );
+ localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
/* signals and slots connections */
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
{
//TopoDS_Shape aPointShape;
//if ( myGeomBase->GetShape( aSelectedObject, aPointShape, TopAbs_VERTEX ) )
+
+ TopoDS_Shape aShape;
+ if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() )
+ {
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ TColStd_IndexedMapOfInteger aMap;
+ aSelMgr->GetIndexes( anIt.Value(), 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();
+ }
+ }
+
int pos = isPointInList(myOrderedSel,aSelectedObject);
if(is_append && pos==-1)
- myOrderedSel.push_back(aSelectedObject);
+ myOrderedSel.push_back(aSelectedObject);
+
myPoints[i++] = aSelectedObject;
}
}
// myGeomGUI->SetState( 0 );
- globalSelection( GEOM_POINT );
+ // globalSelection( GEOM_POINT );
+ localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
ConstructorsClicked( getConstructorId() );
}
#include "SalomeApp_Application.h"
#include "LightApp_SelectionMgr.h"
+#include <TColStd_IndexedMapOfInteger.hxx>
+#include <TopTools_IndexedMapOfShape.hxx>
+#include <TopoDS_Shape.hxx>
+#include <TopoDS_Edge.hxx>
+#include <TopoDS.hxx>
+#include <TopExp.hxx>
+
#include <qlabel.h>
#include "GEOMImpl_Types.hxx"
{
/* init variables */
myEditCurrentArgument = GroupPoints->LineEdit1;
- globalSelection( GEOM_POINT );
+ // globalSelection( GEOM_POINT );
+ localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX); //Select Vertex on All Shapes
myPoint = myDir = GEOM::GEOM_Object::_nil();
if ( !CORBA::is_nil( aSelectedObject ) && aRes )
{
myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
+ // Get Selected object if selected subshape
+ 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();
+ }
+ }
if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) myPoint = aSelectedObject;
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) myDir = aSelectedObject;
}
myEditCurrentArgument->setFocus();
if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
- globalSelection( GEOM_LINE );
+ localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
else
- globalSelection( GEOM_POINT );
+ localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
SelectionIntoArgument();
}
#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"
myPoint1 = myPoint2 = GEOM::GEOM_Object::_nil();
// myGeomGUI->SetState( 0 );
- globalSelection( GEOM_POINT );
+ localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
/* signals and slots connections */
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
{
if ( !onAccept() )
return false;
-
+ GroupPoints->LineEdit1->setText( "" );
+ GroupPoints->LineEdit2->setText( "" );
+ GroupFaces->LineEdit1->setText( "" );
+ GroupFaces->LineEdit2->setText( "" );
+ myPoint1 = myPoint2 = myFace1 = myFace2 = GEOM::GEOM_Object::_nil();
+ myEditCurrentArgument = GroupPoints->LineEdit1;
+ localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX ); //Select vertex on all shapes
initName();
return true;
}
myEditCurrentArgument->setText("");
myPoint1 = GEOM::GEOM_Object::_nil();
myPoint2 = GEOM::GEOM_Object::_nil();
- globalSelection( GEOM_POINT );
GroupPoints->show();
GroupFaces->hide();
break;
myEditCurrentArgument->setText("");
myFace1 = GEOM::GEOM_Object::_nil();
myFace2 = GEOM::GEOM_Object::_nil();
- globalSelection( GEOM_FACE );
GroupPoints->hide();
GroupFaces->show();
break;
if ( !CORBA::is_nil( aSelectedObject ) && aRes )
{
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();
+ }
+ }
if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) myPoint1 = aSelectedObject;
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) myPoint2 = aSelectedObject;
else if ( myEditCurrentArgument == GroupFaces->LineEdit1 ) myFace1 = aSelectedObject;
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
// myGeomGUI->SetState( 0 );
- globalSelection( GEOM_POINT );
+ // globalSelection( GEOM_POINT );
+ localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
myEditCurrentArgument = GroupPoints->LineEdit1;
myEditCurrentArgument->setFocus();
//PAL6669: resize(0, 0);
Group2->show();
- globalSelection( GEOM_POINT );
+ localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
myEditCurrentArgument = Group2->LineEdit1;
Group2->LineEdit1->setText("");
Group2->LineEdit2->setText("");
else if(send == Group2->PushButton1) {
myEditCurrentArgument = Group2->LineEdit1;
globalSelection( GEOM_POINT );
+ localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
}
else if(send == Group2->PushButton2) {
myEditCurrentArgument = Group2->LineEdit2;
globalSelection( GEOM_LINE );
+ localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
}
else if(send == Group2->PushButton3) {
myEditCurrentArgument = Group2->LineEdit3;
- globalSelection( GEOM_LINE );
+ localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
}
myEditCurrentArgument->setFocus();
GroupPntDir->LineEdit2->setText(tr(""));
/* for the first argument */
- globalSelection( GEOM_POINT );
+ localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
break;
}
case 1: /* plane from 3 points */
Group3Pnts->LineEdit3->setText("");
/* for the first argument */
- globalSelection( GEOM_POINT );
+ localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
break;
}
case 2: /* plane from a planar face selection */
if ( !CORBA::is_nil( aSelectedObject ) && aRes )
{
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();
+ }
+ }
if ( myEditCurrentArgument == GroupPntDir->LineEdit1 ) myPoint = aSelectedObject;
- else if ( myEditCurrentArgument == GroupPntDir->LineEdit2 ) {
- if ( aRes && !aSelectedObject->_is_nil() )
- {
- 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 );
- myDir = aShapesOp->GetSubShape(aSelectedObject, anIndex);
- aSelMgr->clearSelected();
- }
- else
- myDir = aSelectedObject;
- }
- }
- }
+ else if ( myEditCurrentArgument == GroupPntDir->LineEdit2 ) myDir = aSelectedObject;
else if ( myEditCurrentArgument == Group3Pnts->LineEdit1 ) myPoint1 = aSelectedObject;
else if ( myEditCurrentArgument == Group3Pnts->LineEdit2 ) myPoint2 = aSelectedObject;
else if ( myEditCurrentArgument == Group3Pnts->LineEdit3 ) myPoint3 = aSelectedObject;
else if ( myEditCurrentArgument == GroupFace->LineEdit1 ) myFace = aSelectedObject;
}
-
displayPreview();
}
myEditCurrentArgument->setFocus();
if ( myEditCurrentArgument == GroupPntDir->LineEdit2 ) {
- //globalSelection( GEOM_LINE );
GEOM::GEOM_Object_var anObj;
localSelection( anObj, TopAbs_EDGE );
}
globalSelection( aMap );
}
else
- globalSelection( GEOM_POINT );
+ localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
SelectionIntoArgument();
}
myEditCurrentArgument->setText("");
myRefPoint = GEOM::GEOM_Object::_nil();
- globalSelection( GEOM_POINT );
+ localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
GroupXYZ->hide();
GroupOnCurve->hide();
myEditCurrentArgument->setText("");
myEdge = GEOM::GEOM_Object::_nil();
- globalSelection( GEOM_EDGE );
+ localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
GroupXYZ->hide();
GroupRefPoint->hide();
myLine1 = GEOM::GEOM_Object::_nil();
myLine2 = GEOM::GEOM_Object::_nil();
- globalSelection( GEOM_EDGE );
+ localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
GroupXYZ->hide();
GroupRefPoint->hide();
Standard_Boolean aRes = Standard_False;
Handle(SALOME_InteractiveObject) anIO = firstIObject();
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( anIO, aRes );
+ QString aName = GEOMBase::GetName( aSelectedObject );
if ( !CORBA::is_nil( aSelectedObject ) && aRes )
{
+ 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();
+ }
+ }
if ( id == 0 )
{
- // get CORBA reference to data object
- TopoDS_Shape aShape = myGeomGUI->GetShapeReader().GetShape
- ( myGeomGUI->GetGeomGen(), aSelectedObject );
- if ( aShape.IsNull() )
- return;
-
- if ( aShape.ShapeType() != TopAbs_VERTEX )
- {
- TColStd_IndexedMapOfInteger aMap;
- LightApp_Application* anApp =
- (LightApp_Application*)(SUIT_Session::session()->activeApplication());
- anApp->selectionMgr()->GetIndexes( anIO, aMap );
-
- if ( aMap.Extent() == 1 )
- {
- int anIndex = aMap( 1 );
- TopTools_IndexedMapOfShape aShapes;
- TopExp::MapShapes( aShape, aShapes );
- aShape = aShapes.FindKey( anIndex );
-
- if ( aShape.IsNull() || aShape.ShapeType() != TopAbs_VERTEX )
- return;
- }
- else
- return;
- }
+ if ( aShape.IsNull() || aShape.ShapeType() != TopAbs_VERTEX )
+ return;
gp_Pnt aPnt = BRep_Tool::Pnt( TopoDS::Vertex( aShape ) );
GroupXYZ->SpinBox_DX->SetValue( aPnt.X() );
else if ( id == 1 )
{
myRefPoint = aSelectedObject;
- GroupRefPoint->LineEdit1->setText( GEOMBase::GetName( aSelectedObject ) );
+ GroupRefPoint->LineEdit1->setText( aName );
}
else if ( id == 2 )
{
myEdge = aSelectedObject;
- GroupOnCurve->LineEdit1->setText( GEOMBase::GetName( aSelectedObject ) );
+ GroupOnCurve->LineEdit1->setText( aName );
}
else if ( id == 3 )
{
if (myEditCurrentArgument == GroupLineIntersection->LineEdit1) {
myLine1 = aSelectedObject;
- GroupLineIntersection->LineEdit1->setText( GEOMBase::GetName( aSelectedObject ) );
+ GroupLineIntersection->LineEdit1->setText( aName );
}
else if (myEditCurrentArgument == GroupLineIntersection->LineEdit2) {
myLine2 = aSelectedObject;
- GroupLineIntersection->LineEdit2->setText( GEOMBase::GetName( aSelectedObject ) );
+ GroupLineIntersection->LineEdit2->setText( aName );
}
}
}
GroupRefPoint->LineEdit1->setFocus();
myEditCurrentArgument = GroupRefPoint->LineEdit1;
- globalSelection( GEOM_POINT );
+ localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
}
else if ( send == GroupOnCurve->PushButton1 )
{
GroupOnCurve->LineEdit1->setFocus();
myEditCurrentArgument = GroupOnCurve->LineEdit1;
- globalSelection( GEOM_EDGE );
+ localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
}
else if ( send == GroupLineIntersection->PushButton1 )
{
GroupLineIntersection->LineEdit1->setFocus();
myEditCurrentArgument = GroupLineIntersection->LineEdit1;
- globalSelection( GEOM_EDGE );
+ localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
}
else if ( send == GroupLineIntersection->PushButton2 )
{
GroupLineIntersection->LineEdit2->setFocus();
myEditCurrentArgument = GroupLineIntersection->LineEdit2;
- globalSelection( GEOM_EDGE );
+ localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
}
}
#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"
GroupPoints->LineEdit1->setText("");
GroupPoints->LineEdit2->setText("");
- globalSelection( GEOM_POINT );
+ localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
break;
if ( !CORBA::is_nil( aSelectedObject ) && aRes )
{
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();
+ }
+ }
if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) myPoint1 = aSelectedObject;
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) myPoint2 = aSelectedObject;
}
myEditCurrentArgument = Group2->LineEdit1;
GEOM::GEOM_Object_var anObj;
localSelection( anObj, TopAbs_EDGE );
- //globalSelection( GEOM_LINE );
}
else if(send == Group2->PushButton2) {
myEditCurrentArgument = Group2->LineEdit2;
GEOM::GEOM_Object_var anObj;
localSelection( anObj, TopAbs_EDGE );
- //globalSelection( GEOM_LINE );
}
myEditCurrentArgument->setFocus();
}
}
catch (Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- SetErrorCode(aFail->GetMessageString());
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ SetErrorCode(aFail->GetMessageString());
return NULL;
}
// nbSel == 1
Standard_Boolean testResult = Standard_False;
GEOM::GEOM_Object_ptr aSelectedObject =
- GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
+ GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
if (!testResult)
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();
+ }
+ }
+
if (myEditCurrentArgument == GroupPoints->LineEdit1) {
myBase = aSelectedObject;
myOkBase = true;
}
else if (myEditCurrentArgument == GroupPoints->LineEdit2) {
- if ( testResult && !aSelectedObject->_is_nil() )
- {
- 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 );
- myVec = aShapesOp->GetSubShape(aSelectedObject, anIndex);
- aSelMgr->clearSelected();
- }
- else
- myVec = aSelectedObject;
-
- myOkVec = true;
- }
- }
+ myVec = aSelectedObject;
+ myOkVec = true;
}
myEditCurrentArgument->setText(GEOMBase::GetName(aSelectedObject));
}
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();
+ }
+ }
+
if (myEditCurrentArgument == GroupPoints2->LineEdit1) {
myBase = aSelectedObject;
myOkBase = true;
myOkPnt2 = true;
}
- myEditCurrentArgument->setText(GEOMBase::GetName(aSelectedObject));
}
displayPreview();
else if (send == GroupPoints2->PushButton2) {
GroupPoints2->LineEdit2->setFocus();
myEditCurrentArgument = GroupPoints2->LineEdit2;
- globalSelection( GEOM_POINT );
+ localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
}
else if (send == GroupPoints2->PushButton3) {
GroupPoints2->LineEdit3->setFocus();
myEditCurrentArgument = GroupPoints2->LineEdit3;
- globalSelection( GEOM_POINT );
+ localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
}
myEditCurrentArgument->setFocus();
#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"
{
case 0:
{
- globalSelection( GEOM_POINT );
+ // globalSelection( GEOM_POINT );
+ localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
GroupDimensions->hide();
resize(0, 0);
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();
+ }
+ }
if(myEditCurrentArgument == GroupPoints->LineEdit1)
myPoint1 = aSelectedObject;
else if(myEditCurrentArgument == GroupPoints->LineEdit2)
myPoint2 = aSelectedObject;
- myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
-
displayPreview();
}
else if(send == GroupPoints->PushButton2)
myEditCurrentArgument = GroupPoints->LineEdit2;
- globalSelection( GEOM_POINT );
+ // globalSelection( GEOM_POINT );
+ localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
myEditCurrentArgument->setFocus();
SelectionIntoArgument();
{
case 0 :
{
- globalSelection( GEOM_POINT );
+ // globalSelection( GEOM_POINT );
+ localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
GroupDimensions->hide();
resize(0, 0);
GroupPoints->show();
if(!testResult || CORBA::is_nil( aSelectedObject ))
return;
+ TopoDS_Shape aShape;
+ myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
+ 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();
+ }
+ }
if (myEditCurrentArgument == GroupPoints->LineEdit1)
myPoint = aSelectedObject;
- else if (myEditCurrentArgument == GroupPoints->LineEdit2) {
- if ( testResult && !aSelectedObject->_is_nil() )
- {
- 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 );
- myDir = aShapesOp->GetSubShape(aSelectedObject, anIndex);
- aSelMgr->clearSelected();
- }
- else
- myDir = aSelectedObject;
- }
- }
- }
- myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
+ else if (myEditCurrentArgument == GroupPoints->LineEdit2)
+ myDir = aSelectedObject;
+
displayPreview();
}
if(send == GroupPoints->PushButton1) {
myEditCurrentArgument = GroupPoints->LineEdit1;
- globalSelection( GEOM_POINT );
+ // globalSelection( GEOM_POINT );
+ localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
}
else if(send == GroupPoints->PushButton2) {
myEditCurrentArgument = GroupPoints->LineEdit2;
// globalSelection( GEOM_LINE );
- GEOM::GEOM_Object_var anObj;
+ GEOM::GEOM_Object_var anObj;
localSelection( anObj, TopAbs_EDGE );
}
{
case 0 :
{
- globalSelection( GEOM_POINT );
+ // globalSelection( GEOM_POINT );
+ localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
GroupDimensions->hide();
resize(0, 0);
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();
+ }
+ }
if (myEditCurrentArgument == GroupPoints->LineEdit1)
myPoint = aSelectedObject;
- else if (myEditCurrentArgument == GroupPoints->LineEdit2) {
- if ( testResult && !aSelectedObject->_is_nil() )
- {
- 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 );
- myDir = aShapesOp->GetSubShape(aSelectedObject, anIndex);
- aSelMgr->clearSelected();
- }
- else
- myDir = aSelectedObject;
- }
- }
- }
- myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
+ else if (myEditCurrentArgument == GroupPoints->LineEdit2)
+ myDir = aSelectedObject;
displayPreview();
}
if(send == GroupPoints->PushButton1) {
myEditCurrentArgument = GroupPoints->LineEdit1;
- globalSelection( GEOM_POINT );
+ // globalSelection( GEOM_POINT );
+ localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
}
else if(send == GroupPoints->PushButton2) {
myEditCurrentArgument = GroupPoints->LineEdit2;
#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"
{
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();
}
}
{
case 0:
{
- globalSelection( GEOM_POINT );
+ localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
GroupDimensions->hide();
resize(0, 0);
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();
+ }
+ }
if (myEditCurrentArgument == GroupPoints->LineEdit1)
myPoint = aSelectedObject;
- else if (myEditCurrentArgument == GroupPoints->LineEdit2) {
- if ( testResult && !aSelectedObject->_is_nil() )
- {
- 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 );
- myDir = aShapesOp->GetSubShape(aSelectedObject, anIndex);
- aSelMgr->clearSelected();
- }
- else
- myDir = aSelectedObject;
- }
- }
- }
- myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
+ else if (myEditCurrentArgument == GroupPoints->LineEdit2)
+ myDir = aSelectedObject;
+
displayPreview();
}
if (send == GroupPoints->PushButton1) {
myEditCurrentArgument = GroupPoints->LineEdit1;
- globalSelection( GEOM_POINT );
+ localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
}
else if (send == GroupPoints->PushButton2) {
myEditCurrentArgument = GroupPoints->LineEdit2;
- // globalSelection( GEOM_LINE );
GEOM::GEOM_Object_var anObj;
localSelection( anObj, TopAbs_EDGE );
}
{
case 0:
{
- globalSelection( GEOM_POINT );
+ // globalSelection( GEOM_POINT );
+ localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
break;
}
case 1:
if(!testResult || CORBA::is_nil( aSelectedObject ))
return;
- if(myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 0) {
- if ( testResult && !aSelectedObject->_is_nil() )
+ aName = GEOMBase::GetName( aSelectedObject );
+ TopoDS_Shape aShape;
+ if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() )
{
- 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 )
{
- 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 );
- myAxis = aShapesOp->GetSubShape(aSelectedObject, anIndex);
- aSelMgr->clearSelected();
- }
- else
- myAxis = aSelectedObject;
+ 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();
}
}
- }
+
+ if(myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 0)
+ myAxis = aSelectedObject;
else if(myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 1)
myCentPoint = aSelectedObject;
else if(myEditCurrentArgument == GroupPoints->LineEdit4)
else if(myEditCurrentArgument == GroupPoints->LineEdit5)
myPoint2 = aSelectedObject;
- aName = GEOMBase::GetName( aSelectedObject );
}
myEditCurrentArgument->setText( aName );
localSelection( anObj, TopAbs_EDGE );
}
else
- globalSelection( GEOM_POINT );
+ localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
}
else if (send == GroupPoints->PushButton4)
{
myEditCurrentArgument = GroupPoints->LineEdit4;
- globalSelection( GEOM_POINT );
+ localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
}
else if (send == GroupPoints->PushButton5)
{
myEditCurrentArgument = GroupPoints->LineEdit5;
- globalSelection( GEOM_POINT );
+ localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
}
myEditCurrentArgument->setFocus();
#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 <qcheckbox.h>
return;
}
Standard_Boolean testResult = Standard_False;
- myPoint = GEOMBase::ConvertIOinGEOMObject(firstIObject(), testResult );
+ GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(firstIObject(), testResult );
+ aName = 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;
+
if(!testResult || CORBA::is_nil( myPoint ))
return;
- aName = GEOMBase::GetName( myPoint );
+
}
myEditCurrentArgument->setText( aName );
}
else if(send == GroupPoints->PushButton2) {
myEditCurrentArgument = GroupPoints->LineEdit2;
- globalSelection( GEOM_POINT );
+ localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
}
myEditCurrentArgument->setFocus();
if (!testResult || CORBA::is_nil( aSelectedObject ))
return;
- if (myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 1)
- myPoint1 = aSelectedObject;
- else if (myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 2) {
- if ( testResult && !aSelectedObject->_is_nil() )
- {
- 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() );
+ TopoDS_Shape aShape;
+ aName = GEOMBase::GetName( aSelectedObject );
+ 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 );
- myVector = aShapesOp->GetSubShape(aSelectedObject, anIndex);
+ aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
aSelMgr->clearSelected();
- }
- else
- myVector = aSelectedObject;
- }
- }
- }
+ }
+ }
+
+ if (myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 1)
+ myPoint1 = aSelectedObject;
+ else if (myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 2)
+ myVector = aSelectedObject;
else if (myEditCurrentArgument == GroupPoints->LineEdit3)
myPoint2 = aSelectedObject;
-
- aName = GEOMBase::GetName( aSelectedObject );
}
myEditCurrentArgument->setText( aName );
else if (send == GroupPoints->PushButton2) {
myEditCurrentArgument = GroupPoints->LineEdit2;
if (getConstructorId() == 1)
- globalSelection( GEOM_POINT );
- else {
- //globalSelection( GEOM_LINE );
- GEOM::GEOM_Object_var anObj;
- localSelection( anObj, TopAbs_EDGE );
- }
+ localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
+ else
+ localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
}
else if (send == GroupPoints->PushButton3) {
myEditCurrentArgument = GroupPoints->LineEdit3;
- globalSelection( GEOM_POINT );
+ localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
}
myEditCurrentArgument->setFocus();