return;
myEditCurrentArgument->setText( "" );
- if ( IObjectCount() != 1 ) {
- switch ( getConstructorId() ) {
+
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
+ if (aSelList.Extent() != 1) {
+ switch (getConstructorId()) {
case 0:
if ( myEditCurrentArgument == Group3Pnts->LineEdit1 ) myPoint1 = GEOM::GEOM_Object::_nil();
else if ( myEditCurrentArgument == Group3Pnts->LineEdit2 ) myPoint2 = GEOM::GEOM_Object::_nil();
}
// nbSel == 1
Standard_Boolean aRes = Standard_False;
- GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), aRes );
+ GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), aRes);
if ( !CORBA::is_nil( aSelectedObject ) && aRes ) {
QString 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);
+ aSelMgr->GetIndexes(aSelList.First(), aMap);
if (aMap.Extent() == 1) // Local Selection
{
int anIndex = aMap(1);
Standard_Boolean aRes = Standard_False;
- int IOC = IObjectCount();
- // bool is_append = myPoints->length() < IOC; // if true - add point, else remove
- // myPoints->length( IOC ); // this length may be greater than number of objects,
- // that will actually be put into myPoints
-
- LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
- SalomeApp_Application* app =
- dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
- SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
+ SalomeApp_Application* app = myGeomGUI->getApp();
+ SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>(app->activeStudy());
_PTR(Study) aDStudy = appStudy->studyDS();
- GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations( getStudyId() );
+ GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId());
int anIndex;
TopoDS_Shape aShape;
TColStd_IndexedMapOfInteger aMapIndexes;
GEOM::GEOM_Object_var anObject;
std::list<GEOM::GEOM_Object_var> aList;
+ LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
SALOME_ListIO selected;
- aSelMgr->selectedObjects( selected, QString::null, false );
+ aSelMgr->selectedObjects(selected, QString::null, false);
+
+ int IOC = selected.Extent();
+ // bool is_append = myPoints->length() < IOC; // if true - add point, else remove
+ // myPoints->length( IOC ); // this length may be greater than number of objects,
+ // that will actually be put into myPoints
- for ( SALOME_ListIteratorOfListIO anIt( selected ); anIt.More(); anIt.Next() ) {
- GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( anIt.Value(), aRes );
- if ( !CORBA::is_nil( aSelectedObject ) && aRes ) {
- if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() ) {
- aSelMgr->GetIndexes( anIt.Value(), aMapIndexes );
+ for (SALOME_ListIteratorOfListIO anIt (selected); anIt.More(); anIt.Next()) {
+ GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(anIt.Value(), aRes);
+ if (!CORBA::is_nil(aSelectedObject) && aRes) {
+ if (GEOMBase::GetShape(aSelectedObject, aShape, TopAbs_SHAPE) && !aShape.IsNull()) {
+ aSelMgr->GetIndexes(anIt.Value(), aMapIndexes);
- if ( aMapIndexes.Extent() > 0 ) {
- for ( int ii = 1; ii <= aMapIndexes.Extent(); ii++ ) {
+ if (aMapIndexes.Extent() > 0) {
+ for (int ii = 1; ii <= aMapIndexes.Extent(); ii++) {
anIndex = aMapIndexes(ii);
QString aName = GEOMBase::GetName( aSelectedObject );
aName = aName + ":vertex_" + QString::number( anIndex );
{
myEditCurrentArgument->setText( "" );
- if ( IObjectCount() != 1 ) {
- if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) myPoint = GEOM::GEOM_Object::_nil();
- else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) myDir = GEOM::GEOM_Object::_nil();
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
+ if (aSelList.Extent() != 1) {
+ if (myEditCurrentArgument == GroupPoints->LineEdit1) myPoint = GEOM::GEOM_Object::_nil();
+ else if (myEditCurrentArgument == GroupPoints->LineEdit2) myDir = GEOM::GEOM_Object::_nil();
return;
}
Standard_Boolean aRes = Standard_False;
- Handle(SALOME_InteractiveObject) anIO = firstIObject();
- GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), aRes );
- if ( !CORBA::is_nil( aSelectedObject ) && aRes ) {
- QString aName = GEOMBase::GetName( aSelectedObject );
+ Handle(SALOME_InteractiveObject) anIO = aSelList.First();
+ GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(anIO, aRes);
+ if (!CORBA::is_nil(aSelectedObject) && aRes) {
+ QString aName = GEOMBase::GetName(aSelectedObject);
// Get Selected object if selected subshape
TopoDS_Shape aShape;
aNeedType = TopAbs_EDGE;
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 ) {
+ aSelMgr->GetIndexes(anIO, aMap);
+ if (aMap.Extent() == 1) {
int anIndex = aMap(1);
- if ( aNeedType == TopAbs_EDGE )
- aName += QString( ":edge_%1" ).arg( anIndex );
+ if (aNeedType == TopAbs_EDGE)
+ aName += QString(":edge_%1").arg(anIndex);
else
- aName += QString( ":vertex_%1" ).arg( anIndex );
+ aName += QString(":vertex_%1").arg(anIndex);
//Find SubShape Object in Father
- GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather( aSelectedObject, aName );
+ GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather(aSelectedObject, aName);
- if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study
- GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations( getStudyId() );
- aSelectedObject = aShapesOp->GetSubShape( aSelectedObject, anIndex );
+ if (aFindedObject == GEOM::GEOM_Object::_nil()) { // Object not found in study
+ GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId());
+ aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
}
else {
aSelectedObject = aFindedObject; // get Object from study
}
}
else { // Global Selection
- if ( aShape.ShapeType() != aNeedType ) {
+ if (aShape.ShapeType() != aNeedType) {
aSelectedObject = GEOM::GEOM_Object::_nil();
aName = "";
}
{
myEditCurrentArgument->setText( "" );
- if ( IObjectCount() != 1 ) {
- if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) myPoint1 = GEOM::GEOM_Object::_nil();
- else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) myPoint2 = GEOM::GEOM_Object::_nil();
- else if ( myEditCurrentArgument == GroupFaces->LineEdit1 ) myFace1 = GEOM::GEOM_Object::_nil();
- else if ( myEditCurrentArgument == GroupFaces->LineEdit2 ) myFace2 = GEOM::GEOM_Object::_nil();
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
+ if (aSelList.Extent() != 1) {
+ if (myEditCurrentArgument == GroupPoints->LineEdit1) myPoint1 = GEOM::GEOM_Object::_nil();
+ else if (myEditCurrentArgument == GroupPoints->LineEdit2) myPoint2 = GEOM::GEOM_Object::_nil();
+ else if (myEditCurrentArgument == GroupFaces->LineEdit1) myFace1 = GEOM::GEOM_Object::_nil();
+ else if (myEditCurrentArgument == GroupFaces->LineEdit2) myFace2 = GEOM::GEOM_Object::_nil();
displayPreview();
return;
}
Standard_Boolean aRes = Standard_False;
- GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), aRes );
+ GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), aRes);
if ( !CORBA::is_nil( aSelectedObject ) && aRes ) {
QString aName = GEOMBase::GetName( aSelectedObject );
TopAbs_ShapeEnum aNeedType = 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( firstIObject(), aMap );
+ aSelMgr->GetIndexes(aSelList.First(), aMap);
if ( aMap.Extent() == 1 ) { // Local Selection
int anIndex = aMap( 1 );
if ( aNeedType == TopAbs_FACE )
//=================================================================================
void BasicGUI_MarkerDlg::onSelectionDone0()
{
- if ( IObjectCount() == 1 ) {
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
+ if (aSelList.Extent() == 1) {
Standard_Boolean aRes = Standard_False;
- Handle(SALOME_InteractiveObject) anIO = firstIObject();
- GEOM::GEOM_Object_var aSelectedObj = GEOMBase::ConvertIOinGEOMObject( anIO, aRes );
+ Handle(SALOME_InteractiveObject) anIO = aSelList.First();
+ GEOM::GEOM_Object_var aSelectedObj = GEOMBase::ConvertIOinGEOMObject(anIO, aRes);
- LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
-
if ( aRes && !aSelectedObj->_is_nil() ) {
TopoDS_Shape aShape;
if ( GEOMBase::GetShape( aSelectedObj, aShape, TopAbs_SHAPE ) && !aShape.IsNull() ) {
myEditCurrentArgument->setText( "" );
- if ( IObjectCount() == 1 ) {
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
+ if (aSelList.Extent() == 1) {
Standard_Boolean aRes = Standard_False;
- Handle(SALOME_InteractiveObject) anIO = firstIObject();
+ Handle(SALOME_InteractiveObject) anIO = aSelList.First();
GEOM::GEOM_Object_var aSelectedObj = GEOMBase::ConvertIOinGEOMObject( anIO, aRes );
if ( !CORBA::is_nil( aSelectedObj ) && aRes ) {
aNeedType = TopAbs_VERTEX;
TColStd_IndexedMapOfInteger aMap;
- LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
aSelMgr->GetIndexes( anIO, aMap );
if ( !aMap.IsEmpty() ) {
{
myEditCurrentArgument->setText("");
- if ( IObjectCount() != 1 ) {
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
+ if (aSelList.Extent() != 1) {
if ( myEditCurrentArgument == GroupPntDir->LineEdit1 ) myPoint = GEOM::GEOM_Object::_nil();
else if ( myEditCurrentArgument == GroupPntDir->LineEdit2 ) myDir = GEOM::GEOM_Object::_nil();
else if ( myEditCurrentArgument == Group3Pnts->LineEdit1 ) myPoint1 = GEOM::GEOM_Object::_nil();
// nbSel == 1
Standard_Boolean aRes = Standard_False;
- GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), aRes );
+ GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), aRes);
if ( !CORBA::is_nil( aSelectedObject ) && aRes ) {
QString aName = GEOMBase::GetName( aSelectedObject );
TopAbs_ShapeEnum aNeedType = 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( firstIObject(), aMap );
+ aSelMgr->GetIndexes(aSelList.First(), aMap);
if ( aMap.Extent() == 1 ) { // Local Selection
int anIndex = aMap( 1 );
if ( aNeedType == TopAbs_EDGE )
myRefPoint = myEdge = myFace = GEOM::GEOM_Object::_nil();
}
- if ( IObjectCount() == 1 ) {
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
+ if (aSelList.Extent() == 1) {
Standard_Boolean aRes = Standard_False;
- Handle(SALOME_InteractiveObject) anIO = firstIObject();
+ Handle(SALOME_InteractiveObject) anIO = aSelList.First();
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( anIO, aRes );
if ( !CORBA::is_nil( aSelectedObject ) && aRes ) {
QString aName = GEOMBase::GetName(aSelectedObject);
else if ( id == 4 )
aNeedType = TopAbs_FACE;
- LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
TColStd_IndexedMapOfInteger aMap;
- aSelMgr->GetIndexes(firstIObject(), aMap);
+ aSelMgr->GetIndexes(anIO, aMap);
if ( aMap.Extent() == 1 ) { // Local Selection
int anIndex = aMap( 1 );
if ( aNeedType == TopAbs_EDGE )
aName += QString( ":vertex_%1" ).arg( anIndex );
//Find SubShape Object in Father
- GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather( aSelectedObject, aName );
+ GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather(aSelectedObject, aName);
if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study
- GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations( getStudyId() );
- aSelectedObject = aShapesOp->GetSubShape( aSelectedObject, anIndex );
+ GEOM::GEOM_IShapesOperations_var aShapesOp =
+ getGeomEngine()->GetIShapesOperations(getStudyId());
+ aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
}
else {
aSelectedObject = aFindedObject; // get Object from study
{
myEditCurrentArgument->setText( "" );
- if ( IObjectCount() != 1 ) {
- if ( myEditCurrentArgument == GroupPoints->LineEdit1 )
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
+ if (aSelList.Extent() != 1) {
+ if (myEditCurrentArgument == GroupPoints->LineEdit1)
myPoint1 = GEOM::GEOM_Object::_nil();
- else if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
+ else if (myEditCurrentArgument == GroupPoints->LineEdit2)
myPoint2 = GEOM::GEOM_Object::_nil();
return;
}
// nbSel == 1
Standard_Boolean aRes = Standard_False;
- GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), aRes );
- if ( !CORBA::is_nil( aSelectedObject ) && aRes ) {
+ GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), aRes);
+ if (!CORBA::is_nil(aSelectedObject) && aRes) {
QString aName = GEOMBase::GetName(aSelectedObject);
TopoDS_Shape aShape;
- if ( GEOMBase::GetShape(aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() ) {
- LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ if (GEOMBase::GetShape(aSelectedObject, aShape, TopAbs_SHAPE) && !aShape.IsNull()) {
TColStd_IndexedMapOfInteger aMap;
- aSelMgr->GetIndexes( firstIObject(), aMap );
- if ( aMap.Extent() == 1 ) { // Local Selection
- int anIndex = aMap( 1 );
- aName += QString( ":vertex_%1" ).arg( anIndex );
+ aSelMgr->GetIndexes(aSelList.First(), aMap);
+ if (aMap.Extent() == 1) { // Local Selection
+ int anIndex = aMap(1);
+ aName += QString(":vertex_%1").arg(anIndex);
//Find SubShape Object in Father
- GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather( aSelectedObject, aName );
+ GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather(aSelectedObject, aName);
- if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study
- GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations( getStudyId() );
- aSelectedObject = aShapesOp->GetSubShape( aSelectedObject, anIndex );
+ if (aFindedObject == GEOM::GEOM_Object::_nil()) { // Object not found in study
+ GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId());
+ aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
}
else {
aSelectedObject = aFindedObject; // get Object from study
}
}
else { // Global Selection
- if ( aShape.ShapeType() != TopAbs_VERTEX ) {
+ if (aShape.ShapeType() != TopAbs_VERTEX) {
aSelectedObject = GEOM::GEOM_Object::_nil();
aName = "";
}
if (!aSelectedObject->_is_nil()) { // clear selection if something selected
globalSelection();
- localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
+ localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
}
- if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) {
+ if (myEditCurrentArgument == GroupPoints->LineEdit1) {
myPoint1 = aSelectedObject;
- if ( !myPoint1->_is_nil() && myPoint2->_is_nil() )
+ if (!myPoint1->_is_nil() && myPoint2->_is_nil())
GroupPoints->PushButton2->click();
}
- else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) {
+ else if (myEditCurrentArgument == GroupPoints->LineEdit2) {
myPoint2 = aSelectedObject;
- if ( !myPoint2->_is_nil() && myPoint1->_is_nil() )
+ if (!myPoint2->_is_nil() && myPoint1->_is_nil())
GroupPoints->PushButton1->click();
}
}
displayPreview();
}
-
//=================================================================================
// function : SetEditCurrentArgument()
// purpose :
myEditCurrentArgument->setText( "" );
QString aName;
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
const int id = getConstructorId();
- if ( IObjectCount() != 1 ) {
+ if (aSelList.Extent() != 1) {
if ( id == 0 )
myFace = GEOM::GEOM_Object::_nil();
else if ( id == 1 ) {
// nbSel == 1
Standard_Boolean aRes = Standard_False;
- GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), aRes );
+ GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), aRes);
if ( !aRes || CORBA::is_nil( aSelectedObject ) )
return;
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 );
+ aSelMgr->GetIndexes(aSelList.First(), aMap);
if ( aMap.Extent() == 1 ) {
int anIndex = aMap( 1 );
aName = aName + ":edge_" + QString::number( anIndex );
//=================================================================================
void BlocksGUI_ExplodeDlg::SelectionIntoArgument()
{
- if ( !isAllSubShapes() )
+ if (!isAllSubShapes())
return;
myObject = GEOM::GEOM_Object::_nil();
- myGrp1->LineEdit1->setText( "" );
+ myGrp1->LineEdit1->setText("");
+
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
- if ( IObjectCount() == 1 ) {
+ if (aSelList.Extent() == 1) {
Standard_Boolean aResult = Standard_False;
- GEOM::GEOM_Object_var anObj =
- GEOMBase::ConvertIOinGEOMObject( firstIObject(), aResult );
+ GEOM::GEOM_Object_var anObj = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), aResult);
- if ( aResult && !anObj->_is_nil() && GEOMBase::IsShape( anObj ) ) {
+ if (aResult && !anObj->_is_nil() && GEOMBase::IsShape(anObj)) {
myObject = anObj;
- myGrp1->LineEdit1->setText( GEOMBase::GetName( anObj ) );
+ myGrp1->LineEdit1->setText(GEOMBase::GetName(anObj));
}
}
// function : isValid()
// purpose : Verify validity of input data
//=================================================================================
-bool BlocksGUI_ExplodeDlg::isValid( QString& )
+bool BlocksGUI_ExplodeDlg::isValid (QString&)
{
bool ok = false;
switch ( getConstructorId() ) {
case 0:
- if ( IsPreview() )
+ if ( IsPreview() ) {
ok = !myObject->_is_nil();
- else
- ok = !myObject->_is_nil() && ( isAllSubShapes() || IObjectCount() );
+ }
+ else {
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
+ ok = !myObject->_is_nil() && (isAllSubShapes() || aSelList.Extent());
+ }
break;
default:
break;
if ( !isAllSubShapes() ) {
QMap<QString, char> selected;
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
// Get names of selected objects
- SALOME_ListIteratorOfListIO it ( selectedIO() );
+ SALOME_ListIteratorOfListIO it (aSelList);
for ( ; it.More(); it.Next() ) {
selected.insert( it.Value()->getName(), 0 );
}
// Iterate through result and select objects with names from selection
- ObjectList toRemoveFromEnggine;
+ ObjectList toRemoveFromEngine;
ObjectList::iterator anIter;
for ( anIter = myTmpObjs.begin(); anIter != myTmpObjs.end(); ++anIter ) {
CORBA::String_var objStr = myGeomGUI->getApp()->orb()->object_to_string( *anIter );
if ( selected.contains( QString( objStr.in() ) ) )
objects.push_back( *anIter );
else
- toRemoveFromEnggine.push_back( *anIter );
+ toRemoveFromEngine.push_back( *anIter );
}
// Remove from engine useless objects
- ObjectList::iterator anIter2 = toRemoveFromEnggine.begin();
- for ( ; anIter2 != toRemoveFromEnggine.end(); ++anIter2 )
+ ObjectList::iterator anIter2 = toRemoveFromEngine.begin();
+ for ( ; anIter2 != toRemoveFromEngine.end(); ++anIter2 )
getGeomEngine()->RemoveObject( *anIter2 );
myTmpObjs.clear();
myGrp->LineEdit1->setText( "" );
myObject = GEOM::GEOM_Object::_nil();
- if ( IObjectCount() == 1 ) {
- Handle(SALOME_InteractiveObject) anIO = firstIObject();
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
+ if (aSelList.Extent() == 1) {
+ Handle(SALOME_InteractiveObject) anIO = aSelList.First();
Standard_Boolean aRes;
myObject = GEOMBase::ConvertIOinGEOMObject( anIO, aRes );
if ( aRes )
}
}
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
GEOM::GEOM_Object_var anObj;
- Standard_Boolean aResult = Standard_False;
- if ( IObjectCount() == 1 ) {
- anObj = GEOMBase::ConvertIOinGEOMObject( firstIObject(), aResult );
+ if (aSelList.Extent() == 1) {
+ Standard_Boolean aResult = Standard_False;
+ anObj = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), aResult);
if ( aResult ) {
if (anObj->_is_nil()) {
aResult = Standard_False;
}
}
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
// If selection of main object is activated
if ( aCurrFocus == MainObj1 || aCurrFocus == MainObj2 ) {
- if ( IObjectCount() == 1 ) {
+ if (aSelList.Extent() == 1) {
Standard_Boolean aResult = Standard_False;
GEOM::GEOM_Object_var anObj =
- GEOMBase::ConvertIOinGEOMObject( firstIObject(), aResult );
+ GEOMBase::ConvertIOinGEOMObject(aSelList.First(), aResult);
if ( aResult && !anObj->_is_nil() && GEOMBase::IsShape( anObj ) ) {
myShape = anObj;
else if ( aCurrFocus == Face1 || aCurrFocus == Face2 ||
aCurrFocus == Face1U || aCurrFocus == Face2U ||
aCurrFocus == Face1V || aCurrFocus == Face2V ) {
- if ( IObjectCount() == 1 ) {
+ if (aSelList.Extent() == 1) {
Standard_Boolean aResult = Standard_False;
GEOM::GEOM_Object_var anObj =
- GEOMBase::ConvertIOinGEOMObject( firstIObject(), aResult );
+ GEOMBase::ConvertIOinGEOMObject(aSelList.First(), aResult);
if ( aResult && !anObj->_is_nil() && GEOMBase::IsShape( anObj ) ) {
TColStd_IndexedMapOfInteger anIndexes;
- ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr()->GetIndexes( firstIObject(), anIndexes );
+ myGeomGUI->getApp()->selectionMgr()->GetIndexes(aSelList.First(), anIndexes);
if ( anIndexes.Extent() == 1 ) {
int anIndex = anIndexes( 1 );
return true;
}
-
//=================================================================================
// function : SelectionIntoArgument()
// purpose : Called when selection has changed
{
myEditCurrentArgument->setText( "" );
- if ( IObjectCount() != 1 ) {
- if ( myEditCurrentArgument == myGroup->LineEdit1 ) myObject1 = GEOM::GEOM_Object::_nil();
- else if ( myEditCurrentArgument == myGroup->LineEdit2 ) myObject2 = GEOM::GEOM_Object::_nil();
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
+ if (aSelList.Extent() != 1) {
+ if (myEditCurrentArgument == myGroup->LineEdit1) myObject1 = GEOM::GEOM_Object::_nil();
+ else if (myEditCurrentArgument == myGroup->LineEdit2) myObject2 = GEOM::GEOM_Object::_nil();
return;
}
// nbSel == 1
Standard_Boolean aRes = Standard_False;
- GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), aRes );
- if ( !CORBA::is_nil( aSelectedObject ) && aRes && GEOMBase::IsShape( aSelectedObject ) ) {
- myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
- if ( myEditCurrentArgument == myGroup->LineEdit1 ) myObject1 = aSelectedObject;
- else if ( myEditCurrentArgument == myGroup->LineEdit2 ) myObject2 = aSelectedObject;
+ GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), aRes);
+ if (!CORBA::is_nil(aSelectedObject) && aRes && GEOMBase::IsShape(aSelectedObject)) {
+ myEditCurrentArgument->setText(GEOMBase::GetName(aSelectedObject));
+ if (myEditCurrentArgument == myGroup->LineEdit1) myObject1 = aSelectedObject;
+ else if (myEditCurrentArgument == myGroup->LineEdit2) myObject2 = aSelectedObject;
}
}
-
//=================================================================================
// function : SetEditCurrentArgument()
// purpose :
//=================================================================================
GEOM::GEOM_IOperations_ptr BooleanGUI_Dialog::createOperation()
{
- return getGeomEngine()->GetIBooleanOperations( getStudyId() );
+ return getGeomEngine()->GetIBooleanOperations(getStudyId());
}
//=================================================================================
// function : isValid
// purpose :
//=================================================================================
-bool BooleanGUI_Dialog::isValid( QString& msg )
+bool BooleanGUI_Dialog::isValid (QString& msg)
{
- Handle(SALOME_InteractiveObject) IO = firstIObject();
- Standard_Boolean testResult;
- GEOM::GEOM_Object_var anObject = GEOMBase::ConvertIOinGEOMObject( IO, testResult );
- if ( !testResult || anObject->_is_nil() )
- return false;
+ //Handle(SALOME_InteractiveObject) IO = firstIObject();
+ //Standard_Boolean testResult;
+ //GEOM::GEOM_Object_var anObject = GEOMBase::ConvertIOinGEOMObject(IO, testResult);
+ //if (!testResult || anObject->_is_nil())
+ // return false;
- return !CORBA::is_nil( myObject1 ) && !CORBA::is_nil( myObject2 );
+ return !CORBA::is_nil(myObject1) && !CORBA::is_nil(myObject2);
}
//=================================================================================
myEditCurrentArgument->setText( "" );
QString aString = ""; /* name of selection */
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
myOkShapes = false;
- int nbSel = GEOMBase::GetNameOfSelectedIObjects( selectedIO(), aString, true );
+ int nbSel = GEOMBase::GetNameOfSelectedIObjects(aSelList, aString, true);
if ( nbSel == 0 )
return;
if ( nbSel != 1 )
aString = QString( "%1_objects").arg( nbSel );
- GEOMBase::ConvertListOfIOInListOfGO( selectedIO(), myShapes, true );
+ GEOMBase::ConvertListOfIOInListOfGO(aSelList, myShapes, true);
myEditCurrentArgument->setText( aString );
myOkShapes = true;
}
return true;
}
-
//=================================================================================
// function : SelectionIntoArgument()
// purpose : Called when selection as changed or other case
void BuildGUI_EdgeDlg::SelectionIntoArgument()
{
erasePreview();
- myEditCurrentArgument->setText( "" );
-
- if ( IObjectCount() != 1 ) {
- if ( myEditCurrentArgument == GroupPoints->LineEdit1 )
+ myEditCurrentArgument->setText("");
+
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
+ if (aSelList.Extent() != 1) {
+ if (myEditCurrentArgument == GroupPoints->LineEdit1)
myOkPoint1 = false;
- else if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
+ else if (myEditCurrentArgument == GroupPoints->LineEdit2)
myOkPoint2 = false;
return;
}
-
+
// nbSel == 1
Standard_Boolean testResult = Standard_False;
- GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
-
- if ( !testResult )
+ GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
+ if (!testResult)
return;
- if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) {
+ if (myEditCurrentArgument == GroupPoints->LineEdit1) {
myPoint1 = aSelectedObject;
myOkPoint1 = true;
}
- else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) {
+ else if (myEditCurrentArgument == GroupPoints->LineEdit2) {
myPoint2 = aSelectedObject;
myOkPoint2 = true;
}
-
- myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
-
+
+ myEditCurrentArgument->setText(GEOMBase::GetName(aSelectedObject));
+
displayPreview();
}
-
//=================================================================================
// function : LineEditReturnPressed()
// purpose :
myEditCurrentArgument->setText( "" );
QString aName;
- int aNbSel = GEOMBase::GetNameOfSelectedIObjects( selectedIO(), aName );
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
+ int aNbSel = GEOMBase::GetNameOfSelectedIObjects(aSelList, aName);
if ( aNbSel < 1) {
myWires.length(0);
return;
}
- GEOMBase::ConvertListOfIOInListOfGO( selectedIO(), myWires );
+ GEOMBase::ConvertListOfIOInListOfGO(aSelList, myWires);
if ( !myWires.length() )
return;
if ( aNbSel != 1 )
myEditCurrentArgument->setText( "" );
QString aString;
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
myOkFacesAndShells = false;
- int nbSel = GEOMBase::GetNameOfSelectedIObjects( selectedIO(), aString, true );
+ int nbSel = GEOMBase::GetNameOfSelectedIObjects(aSelList, aString, true);
if ( nbSel == 0 )
return;
if ( nbSel != 1 )
aString = QString( "%1_objects ").arg( nbSel );
- GEOMBase::ConvertListOfIOInListOfGO( selectedIO(), myFacesAndShells, true );
+ GEOMBase::ConvertListOfIOInListOfGO(aSelList, myFacesAndShells, true);
if ( !myFacesAndShells.length() )
return;
myEditCurrentArgument->setText( "" );
QString aString = "";
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
myOkShells = false;
- int nbSel = GEOMBase::GetNameOfSelectedIObjects( selectedIO(), aString );
+ int nbSel = GEOMBase::GetNameOfSelectedIObjects(aSelList, aString);
if ( nbSel == 0 )
return;
if ( nbSel != 1 )
aString = tr( "%1_objects" ).arg( nbSel );
- GEOMBase::ConvertListOfIOInListOfGO( selectedIO(), myShells );
+ GEOMBase::ConvertListOfIOInListOfGO(aSelList, myShells);
if ( !myShells.length() )
return;
myEditCurrentArgument->setText( "" );
QString aString = ""; /* name of selection */
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
myOkEdgesAndWires = false;
- int nbSel = GEOMBase::GetNameOfSelectedIObjects( selectedIO(), aString );
+ int nbSel = GEOMBase::GetNameOfSelectedIObjects(aSelList, aString);
if ( nbSel == 0 )
return;
if ( nbSel != 1 )
aString = tr( "%1_objects" ).arg( nbSel );
- GEOMBase::ConvertListOfIOInListOfGO( selectedIO(), myEdgesAndWires );
+ GEOMBase::ConvertListOfIOInListOfGO(aSelList, myEdgesAndWires);
if ( !myEdgesAndWires.length() )
return;
myX = myLastX1;
myY = myLastY1;
- int nbSel = IObjectCount();
- if ( nbSel == 1 && myEditCurrentArgument == Group1Sel->LineEdit1 ) {
+ LightApp_SelectionMgr* aSelMgr = myGeometryGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
+ int nbSel = aSelList.Extent();
+ if (nbSel == 1 && myEditCurrentArgument == Group1Sel->LineEdit1) {
Standard_Boolean aRes = Standard_False;
- GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), aRes );
- if ( !CORBA::is_nil( aSelectedObject ) && aRes ) {
+ GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), aRes);
+ if (!CORBA::is_nil(aSelectedObject) && aRes) {
TopoDS_Shape aShape;
- if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_VERTEX ) ) {
+ if (GEOMBase::GetShape(aSelectedObject, aShape, TopAbs_VERTEX)) {
gp_Trsf aTrans;
gp_Ax3 aWPlane = myGeometryGUI->GetWorkingPlane();
- aTrans.SetTransformation( aWPlane );
- BRepBuilderAPI_Transform aTransformation( aShape, aTrans, Standard_False );
+ aTrans.SetTransformation(aWPlane);
+ BRepBuilderAPI_Transform aTransformation (aShape, aTrans, Standard_False);
aShape = aTransformation.Shape();
gp_Pnt aPnt;
/* so SelectionIntoArgument() is automatically called. */
const QString objectUserName = myEditCurrentArgument->text();
QWidget* thisWidget = (QWidget*)this;
- if ( GEOMBase::SelectionByNameInDialogs( thisWidget, objectUserName, selectedIO() ) )
+
+ LightApp_SelectionMgr* aSelMgr = myGeometryGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
+ if (GEOMBase::SelectionByNameInDialogs(thisWidget, objectUserName, aSelList))
myEditCurrentArgument->setText( objectUserName );
}
}
//=================================================================================
void EntityGUI_SubShapeDlg::SelectionIntoArgument()
{
- if ( !isAllSubShapes() )
+ if (!isAllSubShapes())
return;
ResetStateOfDialog();
QString aString = ""; /* name of selection */
- int nbSel = GEOMBase::GetNameOfSelectedIObjects( selectedIO(), aString, true );
- if ( nbSel != 1 )
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
+ int nbSel = GEOMBase::GetNameOfSelectedIObjects(aSelList, aString, true);
+ if (nbSel != 1)
return;
TopoDS_Shape S;
- Handle(SALOME_InteractiveObject) IO = firstIObject();
+ Handle(SALOME_InteractiveObject) IO = aSelList.First();
if ( !IO->hasEntry() ) {
SUIT_Session::session()->activeApplication()->putInfo( tr( "GEOM_PRP_SHAPE_IN_STUDY" ) );
updateButtonState();
return;
}
- if ( !GEOMBase::GetTopoFromSelection( selectedIO(), S ) ||
- S.IsNull() ||
- S.ShapeType() == TopAbs_VERTEX ) {
+ if (!GEOMBase::GetTopoFromSelection(aSelList, S) ||
+ S.IsNull() ||
+ S.ShapeType() == TopAbs_VERTEX) {
myObject = GEOM::GEOM_Object::_nil();
updateButtonState();
return;
}
-
Standard_Boolean testResult;
- myObject = GEOMBase::ConvertIOinGEOMObject( IO, testResult );
- if ( !testResult || myObject->_is_nil() ) {
+ myObject = GEOMBase::ConvertIOinGEOMObject(IO, testResult);
+ if (!testResult || myObject->_is_nil()) {
updateButtonState();
return;
}
myShape = S;
- GroupPoints->LineEdit1->setText( aString );
-
+ GroupPoints->LineEdit1->setText(aString);
int SelectedShapeType = GroupPoints->ComboBox1->currentIndex();
int count = GroupPoints->ComboBox1->count();
- if ( myWithShape )
+ if (myWithShape)
count = count - 1;
int i = 0;
// Solving PAL5590
- if ( myShape.ShapeType() == TopAbs_COMPOUND ) {
+ if (myShape.ShapeType() == TopAbs_COMPOUND) {
unsigned int nb = NumberOfSubShapes(myShape, TopAbs_COMPOUND);
if ( nb > 0 )
i++;
}
- while ( i <= myShape.ShapeType() ) {
- GroupPoints->ComboBox1->removeItem( 0 );
+ while (i <= myShape.ShapeType()) {
+ GroupPoints->ComboBox1->removeItem(0);
i++;
}
- if ( myShape.ShapeType() == TopAbs_COMPOUND ) {
- if ( myWithShape == false ) {
- GroupPoints->ComboBox1->insertItem( GroupPoints->ComboBox1->count(), "Shape" );
+ if (myShape.ShapeType() == TopAbs_COMPOUND) {
+ if (myWithShape == false) {
+ GroupPoints->ComboBox1->insertItem(GroupPoints->ComboBox1->count(), "Shape");
myWithShape = true;
}
}
// function : isValid
// purpose :
//=================================================================================
-bool EntityGUI_SubShapeDlg::isValid( QString& msg )
+bool EntityGUI_SubShapeDlg::isValid (QString& msg)
{
bool isOk = false;
- Standard_Boolean testResult;
- GEOM::GEOM_Object_var anObj = GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
- if ( !testResult || myObject->_is_nil() ) {
+
+ if (myObject->_is_nil()) {
updateButtonState();
return isOk;
}
- if ( !myObject->_is_nil() ) {
- if ( isAllSubShapes() )
- isOk = true;
- else if ( IObjectCount() == 1 ) {
- if ( testResult && !anObj->_is_nil() ) {
- TColStd_IndexedMapOfInteger aMapIndex;
- myGeomGUI->getApp()->selectionMgr()->GetIndexes( firstIObject(), aMapIndex );
- isOk = aMapIndex.Extent() > 0;
- if ( !isOk )
- msg += tr( "NO_SUBSHAPES_SELECTED" );
+
+ if (isAllSubShapes())
+ isOk = true;
+ else {
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
+ if (aSelList.Extent() == 1) {
+ Standard_Boolean testResult;
+ GEOM::GEOM_Object_var anObj = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
+ if (testResult && !anObj->_is_nil()) {
+ TColStd_IndexedMapOfInteger aMapIndex;
+ aSelMgr->GetIndexes(aSelList.First(), aMapIndex);
+ isOk = aMapIndex.Extent() > 0;
+ if (!isOk)
+ msg += tr("NO_SUBSHAPES_SELECTED");
}
}
}
+
return isOk;
}
// function : execute
// purpose :
//=================================================================================
-bool EntityGUI_SubShapeDlg::execute( ObjectList& objects )
+bool EntityGUI_SubShapeDlg::execute (ObjectList& objects)
{
- GEOM::ListOfGO_var aList = GEOM::GEOM_IShapesOperations::_narrow(
- getOperation() )->MakeExplode( myObject, shapeType(), true );
-
- if ( !aList->length() )
+ GEOM::ListOfGO_var aList = GEOM::GEOM_IShapesOperations::_narrow(getOperation())->
+ MakeExplode(myObject, shapeType(), true);
+
+ if (!aList->length())
return false;
-
+
// Throw away sub-shapes not selected by user if not in preview mode
// and manual selection is active
- if ( !isAllSubShapes() ) {
- if ( IObjectCount() == 1 ) {
+ if (!isAllSubShapes()) {
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
+ if (aSelList.Extent() == 1) {
Standard_Boolean aResult = Standard_False;
GEOM::GEOM_Object_var anObj =
- GEOMBase::ConvertIOinGEOMObject( firstIObject(), aResult );
+ GEOMBase::ConvertIOinGEOMObject(aSelList.First(), aResult);
- if ( aResult && !anObj->_is_nil() ) {
+ if (aResult && !anObj->_is_nil()) {
TColStd_IndexedMapOfInteger aMapIndex;
- myGeomGUI->getApp()->selectionMgr()->GetIndexes( firstIObject(), aMapIndex );
+ aSelMgr->GetIndexes(aSelList.First(), aMapIndex);
GEOM::GEOM_ILocalOperations_var aLocOp =
- getGeomEngine()->GetILocalOperations( getStudyId() );
+ getGeomEngine()->GetILocalOperations(getStudyId());
- for ( int i = 0, n = aList->length(); i < n; i++ )
- if ( aMapIndex.Contains( aLocOp->GetSubShapeIndex( myObject, aList[i] ) ) )
- objects.push_back( GEOM::GEOM_Object::_duplicate( aList[i] ) );
+ for (int i = 0, n = aList->length(); i < n; i++)
+ if (aMapIndex.Contains(aLocOp->GetSubShapeIndex(myObject, aList[i])))
+ objects.push_back(GEOM::GEOM_Object::_duplicate(aList[i]));
}
}
}
else
- for ( int i = 0, n = aList->length(); i < n; i++ )
- objects.push_back( GEOM::GEOM_Object::_duplicate( aList[i] ) );
+ for (int i = 0, n = aList->length(); i < n; i++)
+ objects.push_back(GEOM::GEOM_Object::_duplicate(aList[i]));
return objects.size();
}
}
}
-//================================================================
-// Function : selectedIO
-// Purpose : Return the list of selected SALOME_InteractiveObject's
-//================================================================
-const SALOME_ListIO& GEOMBase_Helper::selectedIO()
-{
- mySelected.Clear();
-
- SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
- if ( app ) {
- LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
- if ( aSelMgr )
- aSelMgr->selectedObjects( mySelected );
- }
-
- return mySelected;
-}
-
-//================================================================
-// Function : IObjectCount
-// Purpose : Return the number of selected objects
-//================================================================
-int GEOMBase_Helper::IObjectCount()
-{
- return selectedIO().Extent();
-}
-
-//================================================================
-// Function : firstIObject
-// Purpose : Return the first selected object in the selected object list
-//================================================================
-Handle(SALOME_InteractiveObject) GEOMBase_Helper::firstIObject()
-{
- const SALOME_ListIO& aList = selectedIO();
- return aList.Extent() > 0 ? aList.First() : Handle(SALOME_InteractiveObject)();
-}
-
-//================================================================
-// Function : lastIObject
-// Purpose : Return the last selected object in the selected object list
-//================================================================
-Handle(SALOME_InteractiveObject) GEOMBase_Helper::lastIObject()
-{
- const SALOME_ListIO& aList = selectedIO();
- return aList.Extent() > 0 ? aList.Last() : Handle(SALOME_InteractiveObject)();
-}
-
//================================================================
// Function : getDesktop
-// Purpose : Returns myDesktop field. Initialized in constructor, usually as dynamic_cast<SUIT_Desktop*>(parentWidget())
+// Purpose : Returns myDesktop field. Initialized in constructor,
+// usually as dynamic_cast<SUIT_Desktop*>(parentWidget())
//================================================================
SUIT_Desktop* GEOMBase_Helper::getDesktop() const
{
// Purpose : It should return an object if its founded in study or
// return Null object if the object is not founded
//================================================================
-GEOM::GEOM_Object_ptr GEOMBase_Helper::findObjectInFather( GEOM::GEOM_Object_ptr theFather, const QString& theName)
+GEOM::GEOM_Object_ptr GEOMBase_Helper::findObjectInFather (GEOM::GEOM_Object_ptr theFather,
+ const QString& theName)
{
SalomeApp_Application* app =
dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
inline void setPrefix( const QString& prefix ) { myPrefix = prefix; }
QString getPrefix( GEOM::GEOM_Object_ptr = GEOM::GEOM_Object::_nil() ) const;
-
- const SALOME_ListIO& selectedIO();
- // Function returns a list of SALOME_InteractiveObject's from
- // selection manager in GUI
-
- int IObjectCount() ;
- // Function returns the number of selected objects
-
- Handle(SALOME_InteractiveObject) firstIObject() ;
- // Function returns the first selected object in the list
- // of selected objects
-
- Handle(SALOME_InteractiveObject) lastIObject() ;
- // Function returns the last selected object in the list
- // of selected objects
bool selectObjects( ObjectList& objects );
// Selects list of objects
//=================================================================================
void GEOMBase_Skeleton::LineEditReturnPressed()
{
- if ( !myEditCurrentArgument )
+ if (!myEditCurrentArgument)
return;
/* User name of object input management */
/* so SelectionIntoArgument() is automatically called. */
const QString objectUserName = myEditCurrentArgument->text();
QWidget* thisWidget = (QWidget*)this;
-
- if ( GEOMBase::SelectionByNameInDialogs( thisWidget, objectUserName, selectedIO() ) )
- myEditCurrentArgument->setText( objectUserName );
+
+ SALOME_ListIO aList;
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ if (aSelMgr)
+ aSelMgr->selectedObjects(aList);
+ if (GEOMBase::SelectionByNameInDialogs(thisWidget, objectUserName, aList))
+ myEditCurrentArgument->setText(objectUserName);
}
//=================================================================================
void GenerationGUI_FillingDlg::SelectionIntoArgument()
{
erasePreview();
- myEditCurrentArgument->setText( "" );
+ myEditCurrentArgument->setText("");
- if ( IObjectCount() != 1 ) {
- if ( myEditCurrentArgument == GroupPoints->LineEdit1 )
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
+ if (aSelList.Extent() != 1) {
+ if (myEditCurrentArgument == GroupPoints->LineEdit1)
myOkCompound = false;
return;
}
// nbSel == 1
Standard_Boolean testResult = Standard_False;
- GEOM::GEOM_Object_ptr aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
+ GEOM::GEOM_Object_ptr aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
- if ( !testResult )
+ if (!testResult)
return;
- if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) {
+ if (myEditCurrentArgument == GroupPoints->LineEdit1) {
TopoDS_Shape S;
myOkCompound = false;
- if ( GEOMBase::GetShape(aSelectedObject, S) &&
- S.ShapeType() == TopAbs_COMPOUND ) {
- // myCompound should be a compound of edges
- for ( TopoDS_Iterator it( S ); it.More(); it.Next() )
- if ( it.Value().ShapeType() != TopAbs_EDGE )
- return;
- myCompound = aSelectedObject;
- myOkCompound = true;
- }
+ if (GEOMBase::GetShape(aSelectedObject, S) && S.ShapeType() == TopAbs_COMPOUND) {
+ // myCompound should be a compound of edges
+ for (TopoDS_Iterator it (S); it.More(); it.Next())
+ if (it.Value().ShapeType() != TopAbs_EDGE)
+ return;
+ myCompound = aSelectedObject;
+ myOkCompound = true;
+ }
}
- myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
+ myEditCurrentArgument->setText(GEOMBase::GetName(aSelectedObject));
displayPreview();
}
-
//=================================================================================
// function : SetEditCurrentArgument()
// purpose :
{
erasePreview();
myEditCurrentArgument->setText( "" );
-
- if ( IObjectCount() != 1 ) {
- if ( myEditCurrentArgument == GroupPoints->LineEdit1 )
- myOkBase = false;
- else if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
- myOkPath = false;
+
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
+ if (aSelList.Extent() != 1) {
+ if (myEditCurrentArgument == GroupPoints->LineEdit1) myOkBase = false;
+ else if (myEditCurrentArgument == GroupPoints->LineEdit2) myOkPath = false;
return;
}
-
+
// nbSel == 1
Standard_Boolean testResult = Standard_False;
- GEOM::GEOM_Object_ptr aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
-
- if ( !testResult )
+ GEOM::GEOM_Object_ptr aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
+
+ if (!testResult)
return;
-
+
TopoDS_Shape S;
-
- if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) {
+
+ if (myEditCurrentArgument == GroupPoints->LineEdit1) {
myOkBase = false;
- if ( !GEOMBase::GetShape( aSelectedObject, S ) ||
- S.ShapeType() == TopAbs_COMPSOLID ||
- S.ShapeType() == TopAbs_COMPOUND ||
- S.ShapeType() == TopAbs_SOLID ||
- S.ShapeType() == TopAbs_SHAPE )
+ if (!GEOMBase::GetShape(aSelectedObject, S) ||
+ S.ShapeType() == TopAbs_COMPSOLID ||
+ S.ShapeType() == TopAbs_COMPOUND ||
+ S.ShapeType() == TopAbs_SOLID ||
+ S.ShapeType() == TopAbs_SHAPE)
return;
-
+
myBase = aSelectedObject;
- myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
+ myEditCurrentArgument->setText(GEOMBase::GetName(aSelectedObject));
myOkBase = true;
}
- else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) {
+ else if (myEditCurrentArgument == GroupPoints->LineEdit2) {
myOkPath = false;
-
- if ( !GEOMBase::GetShape( aSelectedObject, S ) )
+
+ if (!GEOMBase::GetShape(aSelectedObject, S))
return;
- QString aName = GEOMBase::GetName( aSelectedObject );
-
- if ( testResult && !aSelectedObject->_is_nil() && aSelectedObject != myBase ) {
- LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ QString aName = GEOMBase::GetName(aSelectedObject);
+
+ if (testResult && !aSelectedObject->_is_nil() && aSelectedObject != myBase) {
TColStd_IndexedMapOfInteger aMap;
-
- aSelMgr->GetIndexes( firstIObject(), aMap );
- if ( aMap.Extent() == 1 ) {
- int anIndex = aMap( 1 );
- aName.append( ":edge_" + QString::number( anIndex ) );
-
+ aSelMgr->GetIndexes(aSelList.First(), aMap);
+ if (aMap.Extent() == 1) {
+ int anIndex = aMap(1);
+ aName.append(":edge_" + QString::number(anIndex));
+
//Find SubShape Object in Father
- GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather( aSelectedObject, aName );
-
- if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study
+ GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather(aSelectedObject, aName);
+
+ if (aFindedObject == GEOM::GEOM_Object::_nil()) { // Object not found in study
GEOM::GEOM_IShapesOperations_var aShapesOp =
- getGeomEngine()->GetIShapesOperations( getStudyId() );
- myPath = aShapesOp->GetSubShape( aSelectedObject, anIndex );
+ getGeomEngine()->GetIShapesOperations(getStudyId());
+ myPath = aShapesOp->GetSubShape(aSelectedObject, anIndex);
myOkPath = true;
}
- else { // get Object from study
+ else { // get Object from study
myPath = aFindedObject;
myOkPath = true;
}
}
else {
myOkPath = true;
- if ( S.ShapeType() != TopAbs_EDGE ) {
+ if (S.ShapeType() != TopAbs_EDGE) {
aSelectedObject = GEOM::GEOM_Object::_nil();
aName = "";
myOkPath = false;
myPath = aSelectedObject;
}
}
- myEditCurrentArgument->setText( aName );
+ myEditCurrentArgument->setText(aName);
}
-
+
displayPreview();
}
-
//=================================================================================
// function : SetEditCurrentArgument()
// purpose :
erasePreview();
myEditCurrentArgument->setText( "" );
- if ( getConstructorId() == 0 ) {
-
- if ( IObjectCount() != 1 ) {
- if ( myEditCurrentArgument == GroupPoints->LineEdit1 )
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
+ if (getConstructorId() == 0)
+ {
+ if (aSelList.Extent() != 1) {
+ if (myEditCurrentArgument == GroupPoints->LineEdit1)
myOkBase = false;
- else if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
+ else if (myEditCurrentArgument == GroupPoints->LineEdit2)
myOkVec = false;
return;
}
// nbSel == 1
Standard_Boolean testResult = Standard_False;
GEOM::GEOM_Object_var aSelectedObject =
- GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
-
- if ( !testResult )
+ GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
+ if (!testResult)
return;
bool myOk = true;
TopoDS_Shape aShape;
QString 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 ) {
- int anIndex = aMap( 1 );
+ aSelMgr->GetIndexes(aSelList.First(), aMap);
+ if (aMap.Extent() == 1) {
+ int anIndex = aMap(1);
aName.append( ":edge_" + QString::number( anIndex ) );
//Find SubShape Object in Father
}
myEditCurrentArgument->setText( aName );
}
- else if ( getConstructorId() == 1 ) { // getConstructorId()==1 - extrusion using 2 points
- if ( IObjectCount() != 1 ) {
- if ( myEditCurrentArgument == GroupPoints2->LineEdit1 )
+ else if (getConstructorId() == 1) { // getConstructorId()==1 - extrusion using 2 points
+ if (aSelList.Extent() != 1) {
+ if (myEditCurrentArgument == GroupPoints2->LineEdit1)
myOkBase = false;
- else if ( myEditCurrentArgument == GroupPoints2->LineEdit2 ) {
+ else if (myEditCurrentArgument == GroupPoints2->LineEdit2) {
myPoint1 = GEOM::GEOM_Object::_nil();
myOkPnt1 = false;
}
- else if ( myEditCurrentArgument == GroupPoints2->LineEdit3 ) {
+ else if (myEditCurrentArgument == GroupPoints2->LineEdit3) {
myPoint2 = GEOM::GEOM_Object::_nil();
myOkPnt2 = false;
}
// nbSel == 1
Standard_Boolean testResult = Standard_False;
GEOM::GEOM_Object_var aSelectedObject =
- GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
-
- if ( !testResult || CORBA::is_nil( aSelectedObject ) )
+ GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
+
+ if (!testResult || CORBA::is_nil(aSelectedObject))
return;
-
- QString aName = GEOMBase::GetName( aSelectedObject );
+
+ QString aName = GEOMBase::GetName(aSelectedObject);
TopoDS_Shape aShape;
bool myOk = true;
- if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() ) {
- LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ if (GEOMBase::GetShape(aSelectedObject, aShape, TopAbs_SHAPE) && !aShape.IsNull()) {
TColStd_IndexedMapOfInteger aMap;
- aSelMgr->GetIndexes( firstIObject(), aMap );
+ aSelMgr->GetIndexes(aSelList.First(), aMap );
if (aMap.Extent() == 1) {
int anIndex = aMap(1);
aName.append( ":vertex_" + QString::number( anIndex ) );
myPoint2 = aSelectedObject;
}
}
- else if ( getConstructorId() == 2 ) { // extrusion using dx dy dz
+ else if (getConstructorId() == 2) { // extrusion using dx dy dz
Standard_Boolean testResult = Standard_False;
GEOM::GEOM_Object_var aSelectedObject =
- GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
-
- if ( !testResult || CORBA::is_nil( aSelectedObject ) )
+ GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
+
+ if (!testResult || CORBA::is_nil(aSelectedObject))
return;
-
- QString aName = GEOMBase::GetName( aSelectedObject );
+
+ QString aName = GEOMBase::GetName(aSelectedObject);
myBase = aSelectedObject;
- myEditCurrentArgument->setText( aName );
+ myEditCurrentArgument->setText(aName);
}
-
+
displayPreview();
}
-
//=================================================================================
// function : SetEditCurrentArgument()
// purpose :
erasePreview();
myEditCurrentArgument->setText( "" );
- if ( IObjectCount() != 1 ) {
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
+ if (aSelList.Extent() != 1) {
if ( myEditCurrentArgument == GroupPoints->LineEdit1 )
myOkBase = false;
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
// nbSel == 1
Standard_Boolean testResult = Standard_False;
- GEOM::GEOM_Object_ptr aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
+ GEOM::GEOM_Object_ptr aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
QString aName = GEOMBase::GetName( aSelectedObject );
if ( !testResult )
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 );
+ aSelMgr->GetIndexes(aSelList.First(), aMap);
if ( aMap.Extent() == 1 ) {
int anIndex = aMap( 1 );
displayPreview();
}
-
//=================================================================================
// function : SetEditCurrentArgument()
// purpose :
{
// san -- TODO: clear selected sub-shapes...
//mySelSubBtn->setChecked( true );
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+
if ( myMode == CreateGroup ) {
initName( tr( "GROUP_PREFIX" ) );
connect( mySelBtn, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
connect( mySelBtn2, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
}
- else if ( myMode == EditGroup && IObjectCount() ) {
- Standard_Boolean aResult = Standard_False;
- GEOM::GEOM_Object_var anObj =
- GEOMBase::ConvertIOinGEOMObject( firstIObject(), aResult );
+ else if (myMode == EditGroup) {
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
+ if (aSelList.Extent()) {
+ Standard_Boolean aResult = Standard_False;
+ GEOM::GEOM_Object_var anObj =
+ GEOMBase::ConvertIOinGEOMObject(aSelList.First(), aResult);
- if ( aResult && !CORBA::is_nil( anObj ) && anObj->GetType() == GEOM_GROUP ) {
- myGroup = anObj;
+ if ( aResult && !CORBA::is_nil( anObj ) && anObj->GetType() == GEOM_GROUP ) {
+ myGroup = anObj;
- mainFrame()->ResultName->setText( GEOMBase::GetName( myGroup ) );
+ mainFrame()->ResultName->setText( GEOMBase::GetName( myGroup ) );
- GEOM::GEOM_IGroupOperations_var anOp = GEOM::GEOM_IGroupOperations::_narrow( getOperation() );
- myMainObj = anOp->GetMainShape( myGroup );
- if ( !CORBA::is_nil( myMainObj ) )
- myMainName->setText( GEOMBase::GetName( myMainObj ) );
+ GEOM::GEOM_IGroupOperations_var anOp = GEOM::GEOM_IGroupOperations::_narrow( getOperation() );
+ myMainObj = anOp->GetMainShape( myGroup );
+ if ( !CORBA::is_nil( myMainObj ) )
+ myMainName->setText( GEOMBase::GetName( myMainObj ) );
- setShapeType( (TopAbs_ShapeEnum)anOp->GetType( myGroup ) );
+ setShapeType( (TopAbs_ShapeEnum)anOp->GetType( myGroup ) );
- GEOM::ListOfLong_var aCurrList = anOp->GetObjects( myGroup );
- for ( int i = 0, n = aCurrList->length(); i < n; i++ )
- myIdList->addItem( new QListWidgetItem( QString( "%1" ).arg( aCurrList[i] ) ) );
+ GEOM::ListOfLong_var aCurrList = anOp->GetObjects( myGroup );
+ for ( int i = 0, n = aCurrList->length(); i < n; i++ )
+ myIdList->addItem( new QListWidgetItem( QString( "%1" ).arg( aCurrList[i] ) ) );
- myEditCurrentArgument = 0;
+ myEditCurrentArgument = 0;
+ }
+ connect( mySelBtn2, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
}
- connect( mySelBtn2, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
}
- connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
- this, SLOT( SelectionIntoArgument() ) );
+ connect( aSelMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()) );
connect( buttonOk(), SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
connect( buttonApply(), SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
connect( myRemBtn, SIGNAL( clicked() ), this, SLOT( remove() ) );
connect( myIdList, SIGNAL( selectionChanged() ), this, SLOT( selectionChanged() ) );
- setInPlaceObj( GEOM::GEOM_Object::_nil() );
+ setInPlaceObj(GEOM::GEOM_Object::_nil());
myBusy = true; // just activate but do not select in the list
activateSelection();
myIdList->clearSelection();
myIdList->blockSignals( isBlocked );
- if (IObjectCount() != 1 )
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
+ if (aSelList.Extent() != 1)
return;
Standard_Boolean aResult = Standard_False;
GEOM::GEOM_Object_var anObj =
- GEOMBase::ConvertIOinGEOMObject( firstIObject(), aResult );
- if ( aResult && !anObj->_is_nil() && GEOMBase::IsShape( anObj ) ) {
- if ( !anObj->_is_equivalent(myMainObj) && !anObj->_is_equivalent( myGroup )) {
+ GEOMBase::ConvertIOinGEOMObject(aSelList.First(), aResult);
+ if (aResult && !anObj->_is_nil() && GEOMBase::IsShape(anObj)) {
+ if (!anObj->_is_equivalent(myMainObj) && !anObj->_is_equivalent(myGroup)) {
SUIT_OverrideCursor wc;
- myEditCurrentArgument->setText( GEOMBase::GetName( anObj ) );
+ myEditCurrentArgument->setText(GEOMBase::GetName(anObj));
GEOM::GEOM_IShapesOperations_var aShapesOp =
- getGeomEngine()->GetIShapesOperations( getStudyId() );
+ getGeomEngine()->GetIShapesOperations(getStudyId());
if ( subSelectionWay() == GET_IN_PLACE ) {
GEOM::GEOM_Object_var aGetInPlaceObj = aShapesOp->GetInPlace(myMainObj, anObj);
setInPlaceObj( aGetInPlaceObj );
void GroupGUI_GroupDlg::SelectionIntoArgument()
{
// if (myPlaceCheckBox->isChecked() && myEditCurrentArgument == myShape2Name )
- if (subSelectionWay() != ALL_SUBSHAPES && myEditCurrentArgument == myShape2Name ) {
+ if (subSelectionWay() != ALL_SUBSHAPES && myEditCurrentArgument == myShape2Name) {
onGetInPlace();
return;
}
- if ( myEditCurrentArgument == myMainName) { // Selection of a main shape is active
- myEditCurrentArgument->setText( "" );
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
+ if (myEditCurrentArgument == myMainName) { // Selection of a main shape is active
+ myEditCurrentArgument->setText("");
myIdList->clear();
-
- if ( IObjectCount() == 1 ) {
+
+ if (aSelList.Extent() == 1) {
Standard_Boolean aResult = Standard_False;
GEOM::GEOM_Object_var anObj =
- GEOMBase::ConvertIOinGEOMObject( firstIObject(), aResult );
+ GEOMBase::ConvertIOinGEOMObject(aSelList.First(), aResult);
if ( aResult && !anObj->_is_nil() && GEOMBase::IsShape( anObj ) ) {
myMainObj = anObj;
TColStd_IndexedMapOfInteger aMapIndex;
- SALOME_ListIO aSelIOs;
- SalomeApp_Application* app = myGeomGUI->getApp();
- if ( app ) {
- LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
- if ( aSelMgr ) {
- LightApp_SelectionMgr::MapEntryOfMapOfInteger aMap;
- aSelMgr->selectedSubOwners( aMap );
- if ( aMap.Size() == 1 )
- aMapIndex = LightApp_SelectionMgr::MapEntryOfMapOfInteger::Iterator( aMap ).Value();
- }
- }
+ LightApp_SelectionMgr::MapEntryOfMapOfInteger aMap;
+ aSelMgr->selectedSubOwners( aMap );
+ if ( aMap.Size() == 1 )
+ aMapIndex = LightApp_SelectionMgr::MapEntryOfMapOfInteger::Iterator( aMap ).Value();
bool subselected = aMapIndex.Extent();
// convert inPlace indices to main indices
globalSelection( GEOM_ALLSHAPES );
GEOM::ListOfGO anObjects;
- GEOMBase::ConvertListOfIOInListOfGO(selectedIO(), anObjects);
+ GEOMBase::ConvertListOfIOInListOfGO(aSelList, anObjects);
GEOM::GEOM_ILocalOperations_var aLocOp = getGeomEngine()->GetILocalOperations( getStudyId() );
GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations( getStudyId() );
#include <GEOMBase.h>
#include <DlgRef.h>
+#include <GeometryGUI.h>
+
#include <SUIT_Desktop.h>
#include <SUIT_Session.h>
#include <SUIT_ResourceMgr.h>
#include <SUIT_ViewManager.h>
#include <SOCC_Prs.h>
#include <SOCC_ViewModel.h>
-//#include "SalomeApp_Application.h"
+#include <SalomeApp_Application.h>
+#include <LightApp_SelectionMgr.h>
// OCCT Includes
#include <AIS_AngleDimension.hxx>
//=================================================================================
void MeasureGUI_AngleDlg::SelectionIntoArgument()
{
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
Standard_Boolean testResult = Standard_False;
GEOM::GEOM_Object_var aSelectedObject =
- GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
+ GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
if ( !testResult )
aSelectedObject = GEOM::GEOM_Object::_nil();
{
QLineEdit* send = (QLineEdit*)sender();
- if ( send == mySelEdit )
+ if (send == mySelEdit)
myEditCurrentArgument = mySelEdit;
else
myEditCurrentArgument = mySelEdit2;
- if ( GEOMBase::SelectionByNameInDialogs( this, mySelEdit->text(), selectedIO() ) )
- mySelEdit->setText( mySelEdit->text() );
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
+ if (GEOMBase::SelectionByNameInDialogs(this, mySelEdit->text(), aSelList))
+ mySelEdit->setText(mySelEdit->text());
}
//=================================================================================
#include <DlgRef.h>
#include <GEOMBase.h>
+#include <GeometryGUI.h>
+
#include <SUIT_Session.h>
#include <SUIT_ResourceMgr.h>
#include <SalomeApp_Application.h>
erasePreview();
myObj = GEOM::GEOM_Object::_nil();
- if ( IObjectCount() != 1 ) {
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
+ if (aSelList.Extent() != 1) {
processObject();
return;
}
Standard_Boolean testResult = Standard_False;
GEOM::GEOM_Object_var aSelectedObject =
- GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
+ GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
- if ( !testResult || aSelectedObject->_is_nil() ) {
+ if (!testResult || aSelectedObject->_is_nil()) {
processObject();
return;
}
displayPreview();
}
-
//=================================================================================
// function : SetEditCurrentArgument()
// purpose :
erasePreview();
myObj = GEOM::GEOM_Object::_nil();
- if ( IObjectCount() != 1 ) {
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
+ if (aSelList.Extent() != 1) {
myGrp->LineEdit1->setText( "" );
processObject();
return;
Standard_Boolean testResult = Standard_False;
GEOM::GEOM_Object_var aSelectedObject =
- GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
+ GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
if ( !testResult || aSelectedObject->_is_nil() ) {
myGrp->LineEdit1->setText( "" );
#include <GEOMBase.h>
#include <DlgRef.h>
+#include <GeometryGUI.h>
+
#include <SUIT_Session.h>
#include <SUIT_Desktop.h>
#include <SUIT_ResourceMgr.h>
#include <SOCC_Prs.h>
#include <SOCC_ViewModel.h>
#include <SalomeApp_Tools.h>
+#include <SalomeApp_Application.h>
+#include <LightApp_SelectionMgr.h>
#include <Geom_Plane.hxx>
#include <AIS_LengthDimension.hxx>
//=================================================================================
void MeasureGUI_DistanceDlg::SelectionIntoArgument()
{
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
Standard_Boolean testResult = Standard_False;
GEOM::GEOM_Object_var aSelectedObject =
- GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
+ GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
if ( !testResult )
aSelectedObject = GEOM::GEOM_Object::_nil();
else
myEditCurrentArgument = mySelEdit2;
- if ( GEOMBase::SelectionByNameInDialogs( this, mySelEdit->text(), selectedIO() ) )
- mySelEdit->setText( mySelEdit->text() );
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
+ if (GEOMBase::SelectionByNameInDialogs(this, mySelEdit->text(), aSelList))
+ mySelEdit->setText(mySelEdit->text());
}
myPoint = GEOM::GEOM_Object::_nil();
}
- if ( IObjectCount() != 1 )
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
+ if (aSelList.Extent() != 1)
return;
// nbSel == 1
Standard_Boolean testResult = Standard_False;
GEOM::GEOM_Object_var aSelectedObject =
- GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
+ GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
if ( !testResult )
return;
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 );
+ aSelMgr->GetIndexes(aSelList.First(), aMap);
if ( aMap.Extent() == 1 ) // Local Selection
{
GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations( getStudyId() );
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 );
+ aSelMgr->GetIndexes(aSelList.First(), aMap);
if ( aMap.Extent() == 1 ) // Local Selection
{
GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations( getStudyId() );
#include <GEOMBase.h>
#include <DlgRef.h>
+#include <GeometryGUI.h>
+
#include <SUIT_Session.h>
#include <SUIT_ResourceMgr.h>
#include <SalomeApp_Application.h>
myGrp->LineEdit3->setText( "" );
myGrp->LineEdit4->setText( "" );
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
Standard_Boolean testResult = Standard_False;
GEOM::GEOM_Object_var aSelectedObject =
- GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
+ GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
if ( !testResult || aSelectedObject->_is_nil() )
return;
myObj = aSelectedObject;
TColStd_IndexedMapOfInteger anIndexes;
- ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->
- selectionMgr()->GetIndexes( firstIObject(), anIndexes );
+ aSelMgr->GetIndexes(aSelList.First(), anIndexes);
TopoDS_Shape aShape;
if ( anIndexes.Extent() > 1 || !GEOMBase::GetShape( myObj, aShape ) || aShape.IsNull() )
const QString objectUserName = mySelEdit->text();
QWidget* thisWidget = ( QWidget* )this;
- if ( GEOMBase::SelectionByNameInDialogs( thisWidget, objectUserName, selectedIO() ) )
- mySelEdit->setText( objectUserName );
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
+ if (GEOMBase::SelectionByNameInDialogs(thisWidget, objectUserName, aSelList))
+ mySelEdit->setText(objectUserName);
}
}
void MeasureGUI_Skeleton::SelectionIntoArgument()
{
myObj = GEOM::GEOM_Object::_nil();
-
+
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
Standard_Boolean testResult = Standard_False;
GEOM::GEOM_Object_var aSelectedObject =
- GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
-
- if ( !testResult || aSelectedObject->_is_nil() ) {
- mySelEdit->setText( "" );
+ GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
+
+ if (!testResult || aSelectedObject->_is_nil()) {
+ mySelEdit->setText("");
processObject();
erasePreview();
return;
}
myObj = aSelectedObject;
- mySelEdit->setText( GEOMBase::GetName( myObj ) );
+ mySelEdit->setText(GEOMBase::GetName(myObj));
processObject();
redisplayPreview();
}
return true;
}
-
//=================================================================================
// function : SelectionIntoArgument()
// purpose : Called when selection as changed or other case
//=================================================================================
void OperationGUI_ArchimedeDlg::SelectionIntoArgument()
{
- myEditCurrentArgument->setText( "" );
+ myEditCurrentArgument->setText("");
myShape = GEOM::GEOM_Object::_nil();
-
- if ( IObjectCount() != 1 )
+
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
+ if (aSelList.Extent() != 1)
return;
Standard_Boolean testResult = Standard_False;
- myShape = GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
+ myShape = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
- if ( !testResult || myShape->_is_nil() || !GEOMBase::IsShape( myShape ) ) {
+ if (!testResult || myShape->_is_nil() || !GEOMBase::IsShape(myShape)) {
myShape = GEOM::GEOM_Object::_nil();
return;
}
- myEditCurrentArgument->setText( GEOMBase::GetName( myShape ) );
+ myEditCurrentArgument->setText(GEOMBase::GetName(myShape));
}
-
//=================================================================================
// function : LineEditReturnPressed()
// purpose :
return true;
}
-
//=================================================================================
// function : SelectionIntoArgument()
// purpose : Called when selection has changed
void OperationGUI_ChamferDlg::SelectionIntoArgument()
{
erasePreview();
- myEditCurrentArgument->setText( "" );
+ myEditCurrentArgument->setText("");
// Get index of current selection focus
int aCurrFocus = -1;
}
}
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
// If selection of main object is activated
- if ( aCurrFocus == MainObj1 || aCurrFocus == MainObj2 || aCurrFocus == MainObj3 || aCurrFocus == MainObj4) {
- if ( IObjectCount() == 1 ) {
+ if (aCurrFocus == MainObj1 || aCurrFocus == MainObj2 || aCurrFocus == MainObj3 || aCurrFocus == MainObj4)
+ {
+ if (aSelList.Extent() == 1) {
Standard_Boolean aResult = Standard_False;
GEOM::GEOM_Object_var anObj =
- GEOMBase::ConvertIOinGEOMObject( firstIObject(), aResult );
+ GEOMBase::ConvertIOinGEOMObject(aSelList.First(), aResult);
if ( aResult && !anObj->_is_nil() ) {
myShape = anObj;
enableWidgets();
}
// If face selection of second tab is activated
- else if ( aCurrFocus == Face1 || aCurrFocus == Face2 ) {
- if ( IObjectCount() == 1 ) {
+ else if (aCurrFocus == Face1 || aCurrFocus == Face2)
+ {
+ if (aSelList.Extent() == 1) {
Standard_Boolean aResult = Standard_False;
GEOM::GEOM_Object_var anObj =
- GEOMBase::ConvertIOinGEOMObject( firstIObject(), aResult );
+ GEOMBase::ConvertIOinGEOMObject(aSelList.First(), aResult);
if ( aResult && !anObj->_is_nil() ) {
TColStd_IndexedMapOfInteger anIndexes;
- ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr()->GetIndexes( firstIObject(), anIndexes );
+ aSelMgr->GetIndexes(aSelList.First(), anIndexes);
- if ( anIndexes.Extent() == 1 ) {
- int anIndex = anIndexes( 1 );
+ if (anIndexes.Extent() == 1) {
+ int anIndex = anIndexes(1);
QString aFaceName = QString( GEOMBase::GetName( anObj ) ) + ":%1";
myEditCurrentArgument->setText( aFaceName.arg( anIndex ) );
myFace[ aCurrFocus ] = anIndex;
myFace[ aCurrFocus ] = -1;
}
// If face selection of third or fourth tab is activated
- else if ( aCurrFocus == Faces || aCurrFocus == Edges ) {
- if ( IObjectCount() == 1 ) {
+ else if (aCurrFocus == Faces || aCurrFocus == Edges) {
+ if (aSelList.Extent() == 1) {
Standard_Boolean aResult = Standard_False;
GEOM::GEOM_Object_var anObj =
- GEOMBase::ConvertIOinGEOMObject( firstIObject(), aResult );
-
+ GEOMBase::ConvertIOinGEOMObject(aSelList.First(), aResult);
+
if ( aResult && !anObj->_is_nil() ) {
TColStd_IndexedMapOfInteger anIndexes;
- ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr()->GetIndexes( firstIObject(), anIndexes );
+ aSelMgr->GetIndexes(aSelList.First(), anIndexes);
- if ( anIndexes.Extent() > 0 ) {
+ if (anIndexes.Extent() > 0) {
QString aName;
- if ( anIndexes.Extent() == 1 ) {
- int anIndex = anIndexes( 1 );
+ if (anIndexes.Extent() == 1) {
+ int anIndex = anIndexes(1);
aName = QString( GEOMBase::GetName( anObj ) ) + QString( ":%1" ).arg( anIndex );
}
erasePreview();
myEditCurrentArgument->setText( "" );
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
// If selection of main object is activated
- if ( myEditCurrentArgument == Group1->LineEdit1 ||
- myEditCurrentArgument == Group2->LineEdit1 ||
- myEditCurrentArgument == Group3->LineEdit1 ) {
- if ( IObjectCount() == 1 ) {
+ if (myEditCurrentArgument == Group1->LineEdit1 ||
+ myEditCurrentArgument == Group2->LineEdit1 ||
+ myEditCurrentArgument == Group3->LineEdit1)
+ {
+ if (aSelList.Extent() == 1) {
Standard_Boolean aResult = Standard_False;
GEOM::GEOM_Object_var anObj =
- GEOMBase::ConvertIOinGEOMObject( firstIObject(), aResult );
-
- if ( aResult && !anObj->_is_nil() ) {
+ GEOMBase::ConvertIOinGEOMObject(aSelList.First(), aResult);
+
+ if (aResult && !anObj->_is_nil()) {
myShape = anObj;
- myEditCurrentArgument->setText( GEOMBase::GetName( anObj ) );
+ myEditCurrentArgument->setText(GEOMBase::GetName(anObj));
displayPreview();
enableWidgets();
return;
enableWidgets();
}
// If face or edge selection is activated
- else if ( myEditCurrentArgument == Group2->LineEdit2 ||
- myEditCurrentArgument == Group3->LineEdit2 ) {
- if ( IObjectCount() == 1 ) {
+ else if (myEditCurrentArgument == Group2->LineEdit2 ||
+ myEditCurrentArgument == Group3->LineEdit2)
+ {
+ if (aSelList.Extent() == 1) {
Standard_Boolean aResult = Standard_False;
GEOM::GEOM_Object_var anObj =
- GEOMBase::ConvertIOinGEOMObject( firstIObject(), aResult );
+ GEOMBase::ConvertIOinGEOMObject(aSelList.First(), aResult);
- if ( aResult && !anObj->_is_nil() ) {
+ if (aResult && !anObj->_is_nil()) {
TColStd_IndexedMapOfInteger anIndexes;
- myGeomGUI->getApp()->selectionMgr()->GetIndexes( firstIObject(), anIndexes );
+ aSelMgr->GetIndexes(aSelList.First(), anIndexes);
- if ( anIndexes.Extent() > 0 ) {
+ if (anIndexes.Extent() > 0) {
QString aName;
- if ( anIndexes.Extent() == 1 ) {
- int anIndex = anIndexes( 1 );
+ if (anIndexes.Extent() == 1) {
+ int anIndex = anIndexes(1);
aName = QString( GEOMBase::GetName( anObj ) ) + QString( ":%1" ).arg( anIndex );
}
}
}
-
//=================================================================================
// function : LineEditReturnPressed()
// purpose :
myEditCurrentArgument->setText( "" );
QString aString = "";
- int nbSel = GEOMBase::GetNameOfSelectedIObjects( selectedIO(), aString, true );
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
- if ( nbSel > 0 ) {
+ int nbSel = GEOMBase::GetNameOfSelectedIObjects(aSelList, aString, true);
+
+ if (nbSel > 0) {
Standard_Boolean aRes = Standard_False;
- GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), aRes );
- if ( !CORBA::is_nil( aSelectedObject ) && aRes && GEOMBase::IsShape( aSelectedObject ) ) {
+ GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), aRes);
+ if (!CORBA::is_nil(aSelectedObject) && aRes && GEOMBase::IsShape(aSelectedObject)) {
{
- myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
- if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) myObject1 = aSelectedObject;
- else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) myObject2 = aSelectedObject;
+ myEditCurrentArgument->setText(GEOMBase::GetName(aSelectedObject));
+ if (myEditCurrentArgument == GroupPoints->LineEdit1) myObject1 = aSelectedObject;
+ else if (myEditCurrentArgument == GroupPoints->LineEdit2) myObject2 = aSelectedObject;
}
}
}
//=================================================================================
bool OperationGUI_GetShapesOnShapeDlg::isValid( QString& msg )
{
- Handle(SALOME_InteractiveObject) IO = firstIObject();
- Standard_Boolean testResult;
- GEOM::GEOM_Object_var anObject = GEOMBase::ConvertIOinGEOMObject( IO, testResult );
- if ( !testResult || anObject->_is_nil() )
- return false;
+ //Handle(SALOME_InteractiveObject) IO = firstIObject();
+ //Standard_Boolean testResult;
+ //GEOM::GEOM_Object_var anObject = GEOMBase::ConvertIOinGEOMObject( IO, testResult );
+ //if ( !testResult || anObject->_is_nil() )
+ // return false;
return !CORBA::is_nil( myObject1 ) && !CORBA::is_nil( myObject2 );
}
myEditCurrentArgument->setText( "" );
QString aString = "";
- int nbSel = GEOMBase::GetNameOfSelectedIObjects( selectedIO(), aString, true );
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
+ int nbSel = GEOMBase::GetNameOfSelectedIObjects(aSelList, aString, true);
if ( nbSel < 1 ) {
if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) {
// One and only one plane can be selected
- if ( getConstructorId() == 1 &&
+ if ( getConstructorId() == 1 &&
myEditCurrentArgument == GroupPoints->LineEdit2 &&
nbSel != 1 ) {
myListTools.length( 0 );
}
if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) {
- GEOMBase::ConvertListOfIOInListOfGO( selectedIO(), myListShapes, true );
+ GEOMBase::ConvertListOfIOInListOfGO(aSelList, myListShapes, true);
myListMaterials.length( 0 );
if ( !myListShapes.length() )
return;
}
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) {
- GEOMBase::ConvertListOfIOInListOfGO( selectedIO(), myListTools, true );
+ GEOMBase::ConvertListOfIOInListOfGO(aSelList, myListTools, true);
if ( !myListTools.length() )
return;
}
myEditCurrentArgument->setText( "" );
- if ( IObjectCount() != 1 ) {
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
+ if ( aSelList.Extent() != 1 ) {
if ( myEditCurrentArgument == GroupPoints->LineEdit1 )
myPoint1 = GEOM::GEOM_Object::_nil();
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
// nbSel == 1
Standard_Boolean testResult = Standard_False;
- GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
+ GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( aSelList.First(), testResult );
if ( !testResult || CORBA::is_nil( aSelectedObject ) )
return;
TopoDS_Shape aShape;
QString 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 );
+ aSelMgr->GetIndexes( aSelList.First(), aMap );
if ( aMap.Extent() == 1) { // Local Selection
int anIndex = aMap( 1 );
aName.append( ":vertex_" + QString::number( anIndex ) );
return true;
}
-
//=================================================================================
// function : SelectionIntoArgument()
// purpose : Called when selection as changed or other case
//=================================================================================
void PrimitiveGUI_ConeDlg::SelectionIntoArgument()
{
- if ( getConstructorId() != 0 )
+ if (getConstructorId() != 0)
return;
- if ( IObjectCount() != 1 ) {
- if ( myEditCurrentArgument == GroupPoints->LineEdit1 )
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
+ if (aSelList.Extent() != 1) {
+ if (myEditCurrentArgument == GroupPoints->LineEdit1)
myPoint = GEOM::GEOM_Object::_nil();
- else if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
+ else if (myEditCurrentArgument == GroupPoints->LineEdit2)
myDir = GEOM::GEOM_Object::_nil();
return;
}
/* nbSel == 1 */
Standard_Boolean testResult = Standard_False;
- GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
+ GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
if ( !testResult || CORBA::is_nil( aSelectedObject ) )
return;
if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
aNeedType = TopAbs_EDGE;
- LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
TColStd_IndexedMapOfInteger aMap;
- aSelMgr->GetIndexes( firstIObject(), aMap );
+ aSelMgr->GetIndexes(aSelList.First(), aMap);
if ( aMap.Extent() == 1 ) {
int anIndex = aMap(1);
if ( aNeedType == TopAbs_EDGE )
displayPreview();
}
-
//=================================================================================
// function : SetEditCurrentArgument()
// purpose :
myEditCurrentArgument->setText( "" );
- if ( IObjectCount() != 1 ) {
- if ( myEditCurrentArgument == GroupPoints->LineEdit1 )
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
+ if (aSelList.Extent() != 1) {
+ if (myEditCurrentArgument == GroupPoints->LineEdit1)
myPoint = GEOM::GEOM_Object::_nil();
- else if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
+ else if (myEditCurrentArgument == GroupPoints->LineEdit2)
myDir = GEOM::GEOM_Object::_nil();
return;
}
/* nbSel == 1 */
Standard_Boolean testResult = Standard_False;
- GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
+ GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
- if ( !testResult || CORBA::is_nil( aSelectedObject ) )
+ if (!testResult || CORBA::is_nil(aSelectedObject))
return;
-
QString aName = GEOMBase::GetName(aSelectedObject);
TopoDS_Shape aShape;
if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
aNeedType = TopAbs_EDGE;
- LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
TColStd_IndexedMapOfInteger aMap;
- aSelMgr->GetIndexes( firstIObject(), aMap );
+ aSelMgr->GetIndexes(aSelList.First(), aMap);
if ( aMap.Extent() == 1 ) { // Local Selection
int anIndex = aMap( 1 );
if ( aNeedType == TopAbs_EDGE )
myEditCurrentArgument->setText( "" );
- if ( IObjectCount() != 1 ) {
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
+ if ( aSelList.Extent() != 1 ) {
if ( myEditCurrentArgument == GroupPlane->LineEdit1 ) myEdge = GEOM::GEOM_Object::_nil();
return;
}
// nbSel == 1
Standard_Boolean aRes = Standard_False;
TopAbs_ShapeEnum aNeedType = TopAbs_EDGE;
- GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), aRes );
+ GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( aSelList.First(), aRes );
if ( !CORBA::is_nil( aSelectedObject ) && aRes ) {
QString aName = GEOMBase::GetName( aSelectedObject );
if (GroupType->RadioButton2->isChecked())
aNeedType = TopAbs_FACE;
- LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
TColStd_IndexedMapOfInteger aMap;
- aSelMgr->GetIndexes( firstIObject(), aMap );
+ aSelMgr->GetIndexes( aSelList.First(), aMap );
if ( aMap.Extent() == 1 ) { // Local Selection
int anIndex = aMap( 1 );
if ( aNeedType == TopAbs_EDGE )
{
if ( getConstructorId() != 0 )
return;
-
+
myEditCurrentArgument->setText( "" );
-
- if ( IObjectCount() != 1 ) {
+
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
+ if (aSelList.Extent() != 1) {
myPoint = GEOM::GEOM_Object::_nil();
return;
}
-
+
/* nbSel == 1 ! */
Standard_Boolean testResult = Standard_False;
- GEOM::GEOM_Object_ptr aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
-
+ GEOM::GEOM_Object_ptr aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
+
if ( !testResult || CORBA::is_nil( aSelectedObject ) )
return;
-
+
QString 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 );
+ aSelMgr->GetIndexes(aSelList.First(), aMap);
if ( aMap.Extent() == 1 ) { // Local Selection
int anIndex = aMap( 1 );
aName.append( ":vertex_" + QString::number( anIndex ) );
myEditCurrentArgument->setText( aName );
myPoint = aSelectedObject;
-
+
displayPreview();
}
-
//=================================================================================
// function : LineEditReturnPressed()
// purpose :
myEditCurrentArgument->setText( "" );
- if ( IObjectCount() != 1 ) {
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
+ if ( aSelList.Extent() != 1 ) {
if ( myEditCurrentArgument == GroupPoints->LineEdit1 )
myPoint = GEOM::GEOM_Object::_nil();
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
/* nbSel == 1 */
Standard_Boolean testResult = Standard_False;
- GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
+ GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( aSelList.First(), testResult );
if ( !testResult || CORBA::is_nil( aSelectedObject ) )
return;
if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
aNeedType = TopAbs_EDGE;
- LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
TColStd_IndexedMapOfInteger aMap;
- aSelMgr->GetIndexes( firstIObject(), aMap );
+ aSelMgr->GetIndexes( aSelList.First(), aMap );
if ( aMap.Extent() == 1 ) { // Local Selection
int anIndex = aMap( 1 );
if ( aNeedType == TopAbs_EDGE )
myEditCurrentArgument->setText( "" );
QString aName;
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) {
- if ( IObjectCount() != 1 ) {
+ if ( aSelList.Extent() != 1 ) {
if ( myEditCurrentArgument == GroupPoints->LineEdit1 )
myOkObject = false;
return;
// nbSel == 1
Standard_Boolean testResult = Standard_False;
GEOM::GEOM_Object_ptr aSelectedObject =
- GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
+ GEOMBase::ConvertIOinGEOMObject( aSelList.First(), testResult );
if ( !testResult )
return;
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
myWiresInd->length( 0 );
- if ( IObjectCount() == 1 ) {
- Handle(SALOME_InteractiveObject) anIO = firstIObject();
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
+ if ( aSelList.Extent() == 1 ) {
+ Handle(SALOME_InteractiveObject) anIO = aSelList.First();
if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) { // face selection
Standard_Boolean aRes;
}
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) {
TColStd_IndexedMapOfInteger aMap;
- myGeomGUI->getApp()->selectionMgr()->GetIndexes( anIO, aMap );
+ aSelMgr->GetIndexes( anIO, aMap );
const int n = aMap.Extent();
myWiresInd->length( n );
for ( int i = 1; i <= n; i++ )
myObject = GEOM::GEOM_Object::_nil();
- if ( IObjectCount() == 1 ) {
- Handle(SALOME_InteractiveObject) anIO = firstIObject();
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
+ if ( aSelList.Extent() == 1 ) {
+ Handle(SALOME_InteractiveObject) anIO = aSelList.First();
Standard_Boolean aRes;
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( anIO, aRes );
if ( !CORBA::is_nil( aSelectedObject ) && aRes ) {
GEOM::short_array anIndexes;
TColStd_IndexedMapOfInteger aMap;
- SalomeApp_Application* anApp =
- (SalomeApp_Application*)(SUIT_Session::session()->activeApplication());
- anApp->selectionMgr()->GetIndexes( anIO, aMap );
+ aSelMgr->GetIndexes( anIO, aMap );
if ( aMap.Extent() == 1 ) { // local selection
int anIndex = aMap( 1 );
//=================================================================================
void RepairGUI_FreeBoundDlg::onSelectionDone()
{
- if ( IObjectCount() != 1 )
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
+ if ( aSelList.Extent() != 1 )
return;
Standard_Boolean isOk = Standard_False;
GEOM::GEOM_Object_var anObj =
- GEOMBase::ConvertIOinGEOMObject( firstIObject(), isOk );
+ GEOMBase::ConvertIOinGEOMObject( aSelList.First(), isOk );
if ( !isOk || anObj->_is_nil() || !GEOMBase::IsShape( anObj ) )
return;
void RepairGUI_FreeFacesDlg::onSelectionDone()
{
erasePreview();
- if ( IObjectCount() != 1 ) {
+
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
+ if ( aSelList.Extent() != 1 ) {
myEdit->setText( "" );
return;
}
Standard_Boolean isOk = Standard_False;
GEOM::GEOM_Object_var anObj =
- GEOMBase::ConvertIOinGEOMObject( firstIObject(), isOk );
+ GEOMBase::ConvertIOinGEOMObject( aSelList.First(), isOk );
if ( !isOk || anObj->_is_nil() || !GEOMBase::IsShape( anObj ) ) {
myEdit->setText( "" );
myEditCurrentArgument->setText( "" );
myObject = GEOM::GEOM_Object::_nil();
- if ( IObjectCount() == 1 ) {
- Handle(SALOME_InteractiveObject) anIO = firstIObject();
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
+ if ( aSelList.Extent() == 1 ) {
+ Handle(SALOME_InteractiveObject) anIO = aSelList.First();
Standard_Boolean aRes;
myObject = GEOMBase::ConvertIOinGEOMObject( anIO, aRes );
if ( aRes )
QMap<QString, char> selected;
// Get names of selected objects
- SALOME_ListIteratorOfListIO it ( selectedIO() );
- for ( ; it.More(); it.Next() )
- selected.insert( it.Value()->getName(), 0 );
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
+ SALOME_ListIteratorOfListIO it (aSelList);
+ for (; it.More(); it.Next())
+ selected.insert(it.Value()->getName(), 0);
// Iterate through result and select objects with names from selection
// ObjectList toRemoveFromEnggine;
}
else
{
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
bool wasSelected = false;
- SALOME_ListIteratorOfListIO it ( selectedIO() );
+ SALOME_ListIteratorOfListIO it (aSelList);
if (it.More() > 0)
wasSelected = true;
bool wasDetected = myTmpObjs.size() ? true : false;
myEditCurrentArgument->setText( "" );
QString aName;
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) {
- if ( IObjectCount() != 1 ) {
+ if ( aSelList.Extent() != 1 ) {
if ( myEditCurrentArgument == GroupPoints->LineEdit1 )
myOkObject = false;
return;
// nbSel == 1
Standard_Boolean testResult = Standard_False;
GEOM::GEOM_Object_ptr aSelectedObject =
- GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
+ GEOMBase::ConvertIOinGEOMObject( aSelList.First(), testResult );
if ( !testResult )
return;
if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) myObject = GEOM::GEOM_Object::_nil();
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) myWiresInd->length( 0 );
- if ( IObjectCount() == 1 ) {
- Handle(SALOME_InteractiveObject) anIO = firstIObject();
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
+ if ( aSelList.Extent() == 1 ) {
+ Handle(SALOME_InteractiveObject) anIO = aSelList.First();
if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) { // face selection
Standard_Boolean aRes;
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 &&
!GroupPoints->CheckButton1->isChecked() ) {
TColStd_IndexedMapOfInteger aMap;
- ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr()->GetIndexes( anIO, aMap );
+ aSelMgr->GetIndexes( anIO, aMap );
const int n = aMap.Extent();
myWiresInd->length( n );
for ( int i = 1; i <= n; i++ )
if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) myObject = GEOM::GEOM_Object::_nil();
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) myWiresInd->length( 0 );
- if ( IObjectCount() == 1 ) {
- Handle(SALOME_InteractiveObject) anIO = firstIObject();
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
+ if ( aSelList.Extent() == 1 ) {
+ Handle(SALOME_InteractiveObject) anIO = aSelList.First();
if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) { // face selection
Standard_Boolean aRes;
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 &&
!GroupPoints->CheckButton1->isChecked() ) {
TColStd_IndexedMapOfInteger aMap;
- ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr()->GetIndexes( anIO, aMap );
+ aSelMgr->GetIndexes( anIO, aMap );
const int n = aMap.Extent();
myWiresInd->length( n );
for ( int i = 1; i <= n; i++ )
myEditCurrentArgument->setText( "" );
myObject = GEOM::GEOM_Object::_nil();
- if ( IObjectCount() == 1 ) {
- Handle(SALOME_InteractiveObject) anIO = firstIObject();
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
+ if ( aSelList.Extent() == 1 ) {
+ Handle(SALOME_InteractiveObject) anIO = aSelList.First();
Standard_Boolean aRes;
myObject = GEOMBase::ConvertIOinGEOMObject( anIO, aRes );
if ( aRes )
{
reset();
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
Standard_Boolean aRes = Standard_False;
int i = 0;
- myObjects->length( IObjectCount() );
- for ( SALOME_ListIteratorOfListIO anIt( selectedIO() ); anIt.More(); anIt.Next() ) {
+ myObjects->length(aSelList.Extent());
+ for (SALOME_ListIteratorOfListIO anIt (aSelList); anIt.More(); anIt.Next()) {
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( anIt.Value(), aRes );
if ( !CORBA::is_nil( aSelectedObject ) && aRes )
myObjects[i++] = aSelectedObject;
Standard_Boolean aRes = Standard_False;
int i = 0;
int numFaces = 0;
- myObjects->length( IObjectCount() );
+
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
+ myObjects->length( aSelList.Extent() );
myFaces.clear();
- for ( SALOME_ListIteratorOfListIO anIt( selectedIO() ); anIt.More(); anIt.Next() ) {
+
+ for (SALOME_ListIteratorOfListIO anIt (aSelList); anIt.More(); anIt.Next()) {
Handle(SALOME_InteractiveObject) anIO = anIt.Value();
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( anIO, aRes );
if ( !CORBA::is_nil( aSelectedObject ) && aRes ) {
GEOM::short_array anIndexes;
TColStd_IndexedMapOfInteger aMap;
- myGeomGUI->getApp()->selectionMgr()->GetIndexes( anIO, aMap );
+ aSelMgr->GetIndexes( anIO, aMap );
if ( !aMap.IsEmpty() ) {
Convert( aMap, anIndexes );
myEditCurrentArgument->setText( "" );
QString aName;
- if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) {
- int aNbSel = GEOMBase::GetNameOfSelectedIObjects( selectedIO(), aName );
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
+ if (myEditCurrentArgument == GroupPoints->LineEdit1) {
+ int aNbSel = GEOMBase::GetNameOfSelectedIObjects(aSelList, aName);
if ( aNbSel < 1 ) {
- myObjects.length( 0 );
+ myObjects.length(0);
return;
}
- GEOMBase::ConvertListOfIOInListOfGO( selectedIO(), myObjects );
- if ( !myObjects.length() )
+ GEOMBase::ConvertListOfIOInListOfGO(aSelList, myObjects);
+ if (!myObjects.length())
return;
- if ( aNbSel != 1 )
- aName = tr( "%1_objects" ).arg( aNbSel );
+ if (aNbSel != 1)
+ aName = tr("%1_objects").arg(aNbSel);
}
- else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) {
- if ( IObjectCount() != 1 ) {
+ else if (myEditCurrentArgument == GroupPoints->LineEdit2) {
+ if (aSelList.Extent() != 1) {
myArgument = GEOM::GEOM_Object::_nil();
return;
}
Standard_Boolean testResult = Standard_False;
- GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
+ GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
myArgument = aSelectedObject;
- if ( !testResult || CORBA::is_nil( myArgument ) )
+ if (!testResult || CORBA::is_nil(myArgument))
return;
- aName = GEOMBase::GetName( aSelectedObject );
+ aName = GEOMBase::GetName(aSelectedObject);
- if ( testResult && !aSelectedObject->_is_nil() ) {
+ if (testResult && !aSelectedObject->_is_nil()) {
TopoDS_Shape aShape;
if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() ) {
TopAbs_ShapeEnum aNeedType = TopAbs_VERTEX;
else if ( getConstructorId() == 2 )
aNeedType = TopAbs_FACE;
- LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
TColStd_IndexedMapOfInteger aMap;
- aSelMgr->GetIndexes( firstIObject(), aMap );
+ aSelMgr->GetIndexes(aSelList.First(), aMap);
if ( aMap.Extent() == 1 ) {
int anIndex = aMap( 1 );
if ( aNeedType == TopAbs_VERTEX )
{
myEditCurrentArgument->setText( "" );
- if ( IObjectCount() != 1 ) {
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
+ if ( aSelList.Extent() != 1 ) {
if ( myEditCurrentArgument == GroupPoints->LineEdit1 ||
myEditCurrentArgument == GroupDimensions->LineEdit1 )
myBase = GEOM::GEOM_Object::_nil();
// nbSel == 1
Standard_Boolean testResult = Standard_False;;
GEOM::GEOM_Object_var aSelectedObject =
- GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
+ GEOMBase::ConvertIOinGEOMObject( aSelList.First(), testResult );
if ( !testResult || CORBA::is_nil( aSelectedObject) || !GEOMBase::IsShape( aSelectedObject ) )
return;
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 );
+ aSelMgr->GetIndexes( aSelList.First(), aMap );
if ( aMap.Extent() == 1 ) {
int anIndex = aMap( 1 );
aName += QString( ":edge_%1" ).arg( anIndex );
{
myEditCurrentArgument->setText( "" );
- if ( IObjectCount() != 1 ) {
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
+ if ( aSelList.Extent() != 1 ) {
if ( myEditCurrentArgument == GroupPoints->LineEdit1 ||
myEditCurrentArgument == GroupDimensions->LineEdit1 )
myBase = GEOM::GEOM_Object::_nil();
// nbSel == 1
Standard_Boolean testResult = Standard_False;;
- GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
+ GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( aSelList.First(), testResult );
if ( !testResult || CORBA::is_nil( aSelectedObject ) || !GEOMBase::IsShape( aSelectedObject ) )
return;
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 );
+ aSelMgr->GetIndexes( aSelList.First(), aMap );
if ( aMap.Extent() == 1 ) {
int anIndex = aMap( 1 );
aName += QString( ":edge_%1" ).arg( anIndex );
myEditCurrentArgument->setText( "" );
QString aName;
- int aNbSel = GEOMBase::GetNameOfSelectedIObjects( selectedIO(), aName );
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
+ int aNbSel = GEOMBase::GetNameOfSelectedIObjects(aSelList, aName);
if ( aNbSel < 1 ) {
myObjects.length( 0 );
return;
}
// nbSel > 0
- GEOMBase::ConvertListOfIOInListOfGO( selectedIO(), myObjects );
- if ( !myObjects.length() )
+ GEOMBase::ConvertListOfIOInListOfGO (aSelList, myObjects);
+ if (!myObjects.length())
return;
-
- myEditCurrentArgument->setText( aName );
-
+
+ myEditCurrentArgument->setText(aName);
+
displayPreview();
}
myEditCurrentArgument->setText( "" );
QString aName;
- if ( myEditCurrentArgument == Group1->LineEdit1 ) {
- int aNbSel = GEOMBase::GetNameOfSelectedIObjects( selectedIO(), aName );
- if ( aNbSel < 1 ) {
- myObjects.length( 0 );
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
+ if (myEditCurrentArgument == Group1->LineEdit1) {
+ int aNbSel = GEOMBase::GetNameOfSelectedIObjects(aSelList, aName);
+ if (aNbSel < 1) {
+ myObjects.length(0);
displayPreview();
return;
}
- GEOMBase::ConvertListOfIOInListOfGO( selectedIO(), myObjects );
+ GEOMBase::ConvertListOfIOInListOfGO(aSelList, myObjects);
if ( !myObjects.length() ) {
displayPreview();
return;
}
}
- else if ( myEditCurrentArgument == Group1->LineEdit2 ) {
+ else if (myEditCurrentArgument == Group1->LineEdit2) {
myStartLCS = GEOM::GEOM_Object::_nil();
- if ( IObjectCount() != 1 ) {
+ if (aSelList.Extent() != 1) {
displayPreview();
return;
}
Standard_Boolean testResult = Standard_False;
- myStartLCS = GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
+ myStartLCS = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
if ( !testResult || CORBA::is_nil( myStartLCS ) ) {
displayPreview();
return;
}
else if ( myEditCurrentArgument == Group1->LineEdit3 ) {
myEndLCS = GEOM::GEOM_Object::_nil();
- if ( IObjectCount() != 1 ) {
+ if ( aSelList.Extent() != 1 ) {
displayPreview();
return;
}
Standard_Boolean testResult = Standard_False;
- myEndLCS = GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
+ myEndLCS = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
if ( !testResult || CORBA::is_nil( myEndLCS ) ) {
displayPreview();
return;
displayPreview();
}
-
//=================================================================================
// function : LineEditReturnPressed()
// purpose :
myEditCurrentArgument->setText( "" );
QString aName;
- if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) {
- int aNbSel = GEOMBase::GetNameOfSelectedIObjects( selectedIO(), aName );
- if ( aNbSel < 1) {
- myObjects.length( 0 );
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
+ if (myEditCurrentArgument == GroupPoints->LineEdit1) {
+ int aNbSel = GEOMBase::GetNameOfSelectedIObjects(aSelList, aName);
+ if (aNbSel < 1) {
+ myObjects.length(0);
return;
}
- GEOMBase::ConvertListOfIOInListOfGO( selectedIO(), myObjects );
- if ( !myObjects.length() )
+ GEOMBase::ConvertListOfIOInListOfGO(aSelList, myObjects);
+ if (!myObjects.length())
return;
}
else {
- if ( IObjectCount() != 1 ) {
+ if (aSelList.Extent() != 1) {
if ( myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 0 )
myAxis = GEOM::GEOM_Object::_nil();
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 1 )
}
Standard_Boolean testResult = Standard_False;
- GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
+ GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
if ( !testResult || CORBA::is_nil( aSelectedObject ) )
return;
if ( myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 0 )
aNeedType = TopAbs_EDGE;
- LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
TColStd_IndexedMapOfInteger aMap;
- aSelMgr->GetIndexes( firstIObject(), aMap );
+ aSelMgr->GetIndexes(aSelList.First(), aMap);
if ( aMap.Extent() == 1 ) {
int anIndex = aMap( 1 );
if ( aNeedType == TopAbs_EDGE )
myEditCurrentArgument->setText( "" );
QString aName;
- if ( myEditCurrentArgument == LineEdit1 )
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
+ if (myEditCurrentArgument == LineEdit1)
{
- int aNbSel = GEOMBase::GetNameOfSelectedIObjects( selectedIO(), aName );
- if ( aNbSel < 1 )
+ int aNbSel = GEOMBase::GetNameOfSelectedIObjects(aSelList, aName);
+ if (aNbSel < 1)
{
- myObjects.length( 0 );
+ myObjects.length(0);
return;
}
- GEOMBase::ConvertListOfIOInListOfGO( selectedIO(), myObjects );
- if ( !myObjects.length() )
+ GEOMBase::ConvertListOfIOInListOfGO(aSelList, myObjects);
+ if (!myObjects.length())
return;
}
- else if ( myEditCurrentArgument == LineEdit2 )
+ else if (myEditCurrentArgument == LineEdit2)
{
GEOM::GEOM_Object_var aSelectedObject = GEOM::GEOM_Object::_nil();
- if ( IObjectCount() == 1 )
+ if (aSelList.Extent() == 1)
{
Standard_Boolean testResult = Standard_False;
- aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
- if ( testResult )
+ aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
+ if (testResult)
{
- aName = GEOMBase::GetName( aSelectedObject );
+ aName = GEOMBase::GetName(aSelectedObject);
TopoDS_Shape aShape;
- if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() )
+ 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 )
+ aSelMgr->GetIndexes(aSelList.First(), aMap);
+ if (aMap.Extent() == 1)
{
int anIndex = aMap( 1 );
aName += QString( ":vertex_%1" ).arg( anIndex );
myPoint = aSelectedObject;
}
- myEditCurrentArgument->setText( aName );
+ myEditCurrentArgument->setText(aName);
displayPreview();
}
myEditCurrentArgument->setText( "" );
QString aName;
- if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) {
- int aNbSel = GEOMBase::GetNameOfSelectedIObjects( selectedIO(), aName );
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ SALOME_ListIO aSelList;
+ aSelMgr->selectedObjects(aSelList);
+
+ if (myEditCurrentArgument == GroupPoints->LineEdit1) {
+ int aNbSel = GEOMBase::GetNameOfSelectedIObjects(aSelList, aName);
- if ( aNbSel < 1 ) {
- myObjects.length( 0 );
+ if (aNbSel < 1) {
+ myObjects.length(0);
return;
}
- GEOMBase::ConvertListOfIOInListOfGO( selectedIO(), myObjects );
- if ( !myObjects.length() )
+ GEOMBase::ConvertListOfIOInListOfGO(aSelList, myObjects);
+ if (!myObjects.length())
return;
}
else {
- if ( IObjectCount() != 1 ) {
- if ( myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 1 )
+ if (aSelList.Extent() != 1 ) {
+ if (myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 1)
myPoint1 = GEOM::GEOM_Object::_nil();
- else if ( myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 2 )
+ else if (myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 2)
myVector = GEOM::GEOM_Object::_nil();
- else if ( myEditCurrentArgument == GroupPoints->LineEdit3 )
+ else if (myEditCurrentArgument == GroupPoints->LineEdit3)
myPoint2 = GEOM::GEOM_Object::_nil();
return;
}
+
+ Standard_Boolean testResult = Standard_False;
+ GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
- Standard_Boolean testResult = Standard_False;;
- GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
-
- if ( !testResult || CORBA::is_nil( aSelectedObject ) )
+ if (!testResult || CORBA::is_nil(aSelectedObject))
return;
TopoDS_Shape aShape;
if ( myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 2 )
aNeedType = TopAbs_EDGE;
- LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
TColStd_IndexedMapOfInteger aMap;
- aSelMgr->GetIndexes( firstIObject(), aMap );
+ aSelMgr->GetIndexes(aSelList.First(), aMap);
if ( aMap.Extent() == 1 )
{
int anIndex = aMap( 1 );
displayPreview();
}
-
//=================================================================================
// function : LineEditReturnPressed()
// purpose :
bool TransformationGUI_TranslationDlg::isValid( QString& /*msg*/ )
{
int aConstructorId = getConstructorId();
-
- switch ( aConstructorId ) {
+
+ switch (aConstructorId) {
case 0:
{
- Handle(SALOME_InteractiveObject) IO = firstIObject();
- Standard_Boolean testResult;
- GEOM::GEOM_Object_var anObject = GEOMBase::ConvertIOinGEOMObject( IO, testResult );
- if ( !testResult || anObject->_is_nil() )
- return false;
-
- return !( myObjects.length() == 0 );
+ //LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ //SALOME_ListIO aSelList;
+ //aSelMgr->selectedObjects(aSelList);
+ //
+ //Handle(SALOME_InteractiveObject) IO = aSelList.First();
+ //Standard_Boolean testResult;
+ //GEOM::GEOM_Object_var anObject = GEOMBase::ConvertIOinGEOMObject(IO, testResult);
+ //if (!testResult || anObject->_is_nil())
+ // return false;
+
+ return !(myObjects.length() == 0);
}
case 1:
- return !( myObjects.length() == 0 || myPoint1->_is_nil() || myPoint2->_is_nil() );
+ return !(myObjects.length() == 0 || myPoint1->_is_nil() || myPoint2->_is_nil());
case 2:
- return !( myObjects.length() == 0 || myVector->_is_nil() );
+ return !( myObjects.length() == 0 || myVector->_is_nil());
default:
break;
}
if ( toCreateCopy ) {
for ( int i = 0; i < myObjects.length(); i++ ) {
myCurrObject = myObjects[i];
- anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->TranslateDXDYDZCopy( myObjects[i], dx, dy, dz );
+ anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->
+ TranslateDXDYDZCopy( myObjects[i], dx, dy, dz );
if ( !anObj->_is_nil() )
objects.push_back( anObj._retn() );
}
else {
for ( int i = 0; i < myObjects.length(); i++ ) {
myCurrObject = myObjects[i];
- anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->TranslateDXDYDZ( myObjects[i], dx, dy, dz );
+ anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->
+ TranslateDXDYDZ( myObjects[i], dx, dy, dz );
if ( !anObj->_is_nil() )
objects.push_back( anObj._retn() );
}
if ( toCreateCopy ) {
for ( int i = 0; i < myObjects.length(); i++ ) {
myCurrObject = myObjects[i];
- anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->TranslateTwoPointsCopy( myObjects[i], myPoint1, myPoint2 );
+ anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->
+ TranslateTwoPointsCopy( myObjects[i], myPoint1, myPoint2 );
if ( !anObj->_is_nil() )
objects.push_back( anObj._retn() );
}
else {
for ( int i = 0; i < myObjects.length(); i++ ) {
myCurrObject = myObjects[i];
- anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->TranslateTwoPoints( myObjects[i], myPoint1, myPoint2 );
+ anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->
+ TranslateTwoPoints( myObjects[i], myPoint1, myPoint2 );
if ( !anObj->_is_nil() )
objects.push_back( anObj._retn() );
}