GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), aRes );
if ( !CORBA::is_nil( aSelectedObject ) && aRes )
{
- myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
// Get Selected object if selected subshape
TopoDS_Shape aShape;
+ QString aName = GEOMBase::GetName( aSelectedObject );
if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() )
{
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
GEOM::GEOM_IShapesOperations_var aShapesOp =
getGeomEngine()->GetIShapesOperations( getStudyId() );
int anIndex = aMap( 1 );
- TopTools_IndexedMapOfShape aShapes;
- TopExp::MapShapes( aShape, aShapes );
- aShape = aShapes.FindKey( anIndex );
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
aSelMgr->clearSelected();
+ aName.append( ":vertex_" + QString::number( anIndex ) );
}
}
+
+ myEditCurrentArgument->setText( aName );
+
switch (getConstructorId())
{
case 0:
#include "SUIT_Desktop.h"
#include "SUIT_Session.h"
#include "SalomeApp_Application.h"
+#include "SalomeApp_Study.h"
#include "LightApp_SelectionMgr.h"
#include <qlabel.h>
myEditCurrentArgument->setText("");
Standard_Boolean aRes = Standard_False;
- int i = 0;
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,
+ // 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( selectedIO() ); anIt.More(); anIt.Next() )
+
+ 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() );
+ _PTR(Study) aDStudy = appStudy->studyDS();
+ 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;
+ SALOME_ListIO selected;
+ aSelMgr->selectedObjects( selected, QString::null, false );
+
+ 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 )
{
- //TopoDS_Shape aPointShape;
- //if ( myGeomBase->GetShape( aSelectedObject, aPointShape, TopAbs_VERTEX ) )
-
- TopoDS_Shape aShape;
if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() )
{
- LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
- TColStd_IndexedMapOfInteger aMap;
- aSelMgr->GetIndexes( anIt.Value(), aMap );
- if ( aMap.Extent() == 1 )
+ aSelMgr->GetIndexes( anIt.Value(), aMapIndexes );
+
+ if ( aMapIndexes.Extent() > 0 )
{
- GEOM::GEOM_IShapesOperations_var aShapesOp =
- getGeomEngine()->GetIShapesOperations( getStudyId() );
- int anIndex = aMap( 1 );
- TopTools_IndexedMapOfShape aShapes;
- TopExp::MapShapes( aShape, aShapes );
- aShape = aShapes.FindKey( anIndex );
- aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
- aSelMgr->clearSelected();
- }
- }
-
- int pos = isPointInList(myOrderedSel,aSelectedObject);
- if(is_append && pos==-1)
- myOrderedSel.push_back(aSelectedObject);
-
- myPoints[i++] = aSelectedObject;
+ for (int ii=1; ii <= aMapIndexes.Extent(); ii++) {
+ anIndex = aMapIndexes(ii);
+ QString aName = GEOMBase::GetName( aSelectedObject );
+ aName = aName + ":vertex_" + QString::number( anIndex );
+ anObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
+ //Find Object in study
+ _PTR(SObject) obj ( aDStudy->FindObjectID( anIt.Value()->getEntry() ) );
+ bool inStudy = false;
+ for (_PTR(ChildIterator) iit (aDStudy->NewChildIterator(obj)); iit->More(); iit->Next()) {
+ _PTR(SObject) child (iit->Value());
+ QString aChildName = child->GetName();
+ if (aChildName == aName) {
+ inStudy = true;
+ CORBA::Object_var corbaObj = GeometryGUI::ClientSObjectToObject(iit->Value());
+ anObject = GEOM::GEOM_Object::_narrow( corbaObj );
+ }
+ }
+
+ if (!inStudy)
+ GeometryGUI::GetGeomGen()->AddInStudy(GeometryGUI::ClientStudyToStudy(aDStudy),
+ anObject, aName, aSelectedObject);
+
+ int pos = isPointInList(myOrderedSel, anObject);
+ if (pos==-1) {
+ myOrderedSel.push_back(anObject);
+ }
+ // if (!inStudy)
+ aList.push_back(anObject);
+ }
+ } else { // aMap.Extent() == 0
+ int pos = isPointInList(myOrderedSel,aSelectedObject);
+ if(pos==-1)
+ myOrderedSel.push_back(aSelectedObject);
+ aList.push_back(aSelectedObject);
+ }
+ }
}
}
- myPoints->length( i ); // this is the right length, smaller of equal to the previously set
+ myPoints->length( aList.size() );
+
+ int k=0;
+ for (list<GEOM::GEOM_Object_var>::iterator j=aList.begin();j!=aList.end();j++)
+ myPoints[k++] = *j;
+
if(IOC == 0)
myOrderedSel.clear();
else
- removeUnnecessaryPnt(myOrderedSel,myPoints);
+ removeUnnecessaryPnt(myOrderedSel, myPoints);
- if(myOrderedSel.size() == myPoints->length()){
- int k=0;
- for (list<GEOM::GEOM_Object_var>::iterator j=myOrderedSel.begin();j!=myOrderedSel.end();j++)
- myPoints[k++] = *j;
- } else {
- //cout << "ERROR: Ordered sequence size != selection sequence size! ("<<myOrderedSel.size()<<"!="<<myPoints->length()<<")"<<endl;
- }
- if ( i )
- GroupPoints->LineEdit1->setText( QString::number( i ) + "_" + tr( "GEOM_POINT" ) + tr( "_S_" ) );
+ // if ( myOrderedSel.size() == myPoints->length() ) {
+ myPoints->length( myOrderedSel.size() );
+ k=0;
+ for (list<GEOM::GEOM_Object_var>::iterator j=myOrderedSel.begin();j!=myOrderedSel.end();j++)
+ myPoints[k++] = *j;
+ // }
+
+ if ( myPoints->length() > 0 )
+ GroupPoints->LineEdit1->setText( QString::number( myPoints->length() ) + "_" + tr( "GEOM_POINT" ) + tr( "_S_" ) );
displayPreview();
}
{
/* init variables */
myEditCurrentArgument = GroupPoints->LineEdit1;
- // globalSelection( GEOM_POINT );
- localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX); //Select Vertex on All Shapes
+ localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
myPoint = myDir = GEOM::GEOM_Object::_nil();
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), aRes );
if ( !CORBA::is_nil( aSelectedObject ) && aRes )
{
- myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
// Get Selected object if selected subshape
TopoDS_Shape aShape;
+ QString aName = GEOMBase::GetName( aSelectedObject );
+
if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() )
{
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
GEOM::GEOM_IShapesOperations_var aShapesOp =
getGeomEngine()->GetIShapesOperations( getStudyId() );
int anIndex = aMap( 1 );
- TopTools_IndexedMapOfShape aShapes;
- TopExp::MapShapes( aShape, aShapes );
- aShape = aShapes.FindKey( anIndex );
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
+ if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
+ aName.append( ":edge_" + QString::number( anIndex ) );
+ else
+ aName.append( ":vertex_" + QString::number( anIndex ) );
aSelMgr->clearSelected();
}
}
+
+ myEditCurrentArgument->setText( aName );
+
if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) myPoint = aSelectedObject;
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) myDir = aSelectedObject;
}
void BasicGUI_EllipseDlg::SetEditCurrentArgument()
{
QPushButton* send = (QPushButton*)sender();
+ globalSelection( GEOM_POINT );
if ( send == GroupPoints->PushButton1 ) myEditCurrentArgument = GroupPoints->LineEdit1;
else if ( send == GroupPoints->PushButton2 ) myEditCurrentArgument = GroupPoints->LineEdit2;
{
case 0:
{
+ globalSelection(GEOM_POINT); // to break previous local selection
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
myEditCurrentArgument = GroupPoints->LineEdit1;
myEditCurrentArgument->setText("");
}
case 1:
{
+ globalSelection(GEOM_PLANE); // to break previous local selection
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_FACE );
myEditCurrentArgument = GroupFaces->LineEdit1;
myEditCurrentArgument->setText("");
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), aRes );
if ( !CORBA::is_nil( aSelectedObject ) && aRes )
{
- myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
TopoDS_Shape aShape;
+ QString aName = GEOMBase::GetName( aSelectedObject );
+
if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() )
{
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
GEOM::GEOM_IShapesOperations_var aShapesOp =
getGeomEngine()->GetIShapesOperations( getStudyId() );
int anIndex = aMap( 1 );
- TopTools_IndexedMapOfShape aShapes;
- TopExp::MapShapes( aShape, aShapes );
- aShape = aShapes.FindKey( anIndex );
+ if ( myEditCurrentArgument == GroupFaces->LineEdit1 ||
+ myEditCurrentArgument == GroupFaces->LineEdit2 )
+ aName.append( ":face_" + QString::number( anIndex ) );
+ else
+ aName.append( ":vertex_" + QString::number( anIndex ) );
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
aSelMgr->clearSelected();
}
}
+ myEditCurrentArgument->setText( aName );
+
if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) myPoint1 = aSelectedObject;
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) myPoint2 = aSelectedObject;
else if ( myEditCurrentArgument == GroupFaces->LineEdit1 ) myFace1 = aSelectedObject;
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
// myGeomGUI->SetState( 0 );
- // globalSelection( GEOM_POINT );
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
myEditCurrentArgument = GroupPoints->LineEdit1;
GroupPntDir->LineEdit2->setText(tr(""));
/* for the first argument */
+ globalSelection( GEOM_POINT ); // to break previous local selection
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
break;
}
Group3Pnts->LineEdit3->setText("");
/* for the first argument */
+ globalSelection( GEOM_POINT ); // to break previous local selection
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
break;
}
GroupFace->LineEdit1->setText(tr(""));
/* for the first argument */
- //globalSelection( GEOM_PLANE );
+ globalSelection( GEOM_PLANE );
TColStd_MapOfInteger aMap;
aMap.Add( GEOM_PLANE );
aMap.Add( GEOM_MARKER );
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), aRes );
if ( !CORBA::is_nil( aSelectedObject ) && aRes )
{
- myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
TopoDS_Shape aShape;
+ QString aName = GEOMBase::GetName( aSelectedObject );
+
if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() )
{
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
GEOM::GEOM_IShapesOperations_var aShapesOp =
getGeomEngine()->GetIShapesOperations( getStudyId() );
int anIndex = aMap( 1 );
- TopTools_IndexedMapOfShape aShapes;
- TopExp::MapShapes( aShape, aShapes );
- aShape = aShapes.FindKey( anIndex );
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
+ if ( myEditCurrentArgument == GroupPntDir->LineEdit2 )
+ aName.append( ":edge_" + QString::number( anIndex ) );
+ else
+ aName.append( ":vertex_" + QString::number( anIndex ) );
+
aSelMgr->clearSelected();
}
}
+ myEditCurrentArgument->setText( aName );
+
if ( myEditCurrentArgument == GroupPntDir->LineEdit1 ) myPoint = aSelectedObject;
else if ( myEditCurrentArgument == GroupPntDir->LineEdit2 ) myDir = aSelectedObject;
else if ( myEditCurrentArgument == Group3Pnts->LineEdit1 ) myPoint1 = aSelectedObject;
void BasicGUI_PlaneDlg::SetEditCurrentArgument()
{
QPushButton* send = (QPushButton*)sender();
+ globalSelection( GEOM_POINT );
if ( send == GroupPntDir->PushButton1 ) myEditCurrentArgument = GroupPntDir->LineEdit1;
else if ( send == GroupPntDir->PushButton2 ) myEditCurrentArgument = GroupPntDir->LineEdit2;
myEditCurrentArgument->setFocus();
- if ( myEditCurrentArgument == GroupPntDir->LineEdit2 ) {
- GEOM::GEOM_Object_var anObj;
- localSelection( anObj, TopAbs_EDGE );
- }
+ if ( myEditCurrentArgument == GroupPntDir->LineEdit2 )
+ localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
else if ( myEditCurrentArgument == GroupFace->LineEdit1 ) {
- //globalSelection( GEOM_PLANE );
+ globalSelection( GEOM_PLANE );
TColStd_MapOfInteger aMap;
aMap.Add( GEOM_PLANE );
aMap.Add( GEOM_MARKER );
{
case 0:
{
+ globalSelection( GEOM_POINT); // to break previous local selection
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
GroupRefPoint->hide();
myEditCurrentArgument = GroupRefPoint->LineEdit1;
myEditCurrentArgument->setText("");
myRefPoint = GEOM::GEOM_Object::_nil();
-
+ globalSelection( GEOM_POINT); // to break previous local selection
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
GroupXYZ->hide();
myEditCurrentArgument = GroupOnCurve->LineEdit1;
myEditCurrentArgument->setText("");
myEdge = GEOM::GEOM_Object::_nil();
-
+ globalSelection( GEOM_LINE); // to break previous local selection
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
GroupXYZ->hide();
GroupLineIntersection->LineEdit2->setText("");
myLine1 = GEOM::GEOM_Object::_nil();
myLine2 = GEOM::GEOM_Object::_nil();
-
+ globalSelection( GEOM_EDGE); // to break previous local selection
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
GroupXYZ->hide();
{
TopoDS_Shape aShape;
if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() )
- {
- LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
- TColStd_IndexedMapOfInteger aMap;
- aSelMgr->GetIndexes( firstIObject(), aMap );
- if ( aMap.Extent() == 1 )
- {
- GEOM::GEOM_IShapesOperations_var aShapesOp =
- getGeomEngine()->GetIShapesOperations( getStudyId() );
- int anIndex = aMap( 1 );
- TopTools_IndexedMapOfShape aShapes;
- TopExp::MapShapes( aShape, aShapes );
- aShape = aShapes.FindKey( anIndex );
- aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
- }
- }
+ {
+ LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+ TColStd_IndexedMapOfInteger aMap;
+ aSelMgr->GetIndexes( firstIObject(), aMap );
+ if ( aMap.Extent() == 1 )
+ {
+ GEOM::GEOM_IShapesOperations_var aShapesOp =
+ getGeomEngine()->GetIShapesOperations( getStudyId() );
+ int anIndex = aMap( 1 );
+ aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
+ if ( id == 2 || id == 3 )
+ aName.append( ":edge_" + QString::number( anIndex ) );
+ else
+ aName.append( ":vertex_" + QString::number( anIndex ) );
+ aSelMgr->clearSelected();
+ }
+ }
+
if ( id == 0 )
{
- if ( aShape.IsNull() || aShape.ShapeType() != TopAbs_VERTEX )
- return;
+ GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE );
+
+ if ( aShape.IsNull() || aShape.ShapeType() != TopAbs_VERTEX )
+ return;
gp_Pnt aPnt = BRep_Tool::Pnt( TopoDS::Vertex( aShape ) );
GroupXYZ->SpinBox_DX->SetValue( aPnt.X() );
void BasicGUI_PointDlg::SetEditCurrentArgument()
{
QPushButton* send = (QPushButton*)sender();
+ globalSelection( GEOM_POINT); // to break previous local selection
if ( send == GroupRefPoint->PushButton1 )
{
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), aRes );
if ( !CORBA::is_nil( aSelectedObject ) && aRes )
{
- myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
TopoDS_Shape aShape;
+ QString aName = GEOMBase::GetName( aSelectedObject );
+
if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() )
{
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
GEOM::GEOM_IShapesOperations_var aShapesOp =
getGeomEngine()->GetIShapesOperations( getStudyId() );
int anIndex = aMap( 1 );
- TopTools_IndexedMapOfShape aShapes;
- TopExp::MapShapes( aShape, aShapes );
- aShape = aShapes.FindKey( anIndex );
+ aName.append( ":vertex_" + QString::number( anIndex ) );
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
aSelMgr->clearSelected();
}
}
+ myEditCurrentArgument->setText( aName );
+
if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) myPoint1 = aSelectedObject;
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) myPoint2 = aSelectedObject;
}
#: GeometryGUI.cxx:3854
msgid "GEOM_REALLY_DELETE"
-msgstr "Do you really want to delete this %1 object(s): %2"
+msgstr "Do you really want to delete this %1 object(s):"
#
#==============================================================================
return;
myBase = aSelectedObject;
+ myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
myOkBase = true;
}
else if(myEditCurrentArgument == GroupPoints->LineEdit2) {
{
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
TColStd_IndexedMapOfInteger aMap;
+ QString aName = GEOMBase::GetName( aSelectedObject );
aSelMgr->GetIndexes( firstIObject(), aMap );
if ( aMap.Extent() == 1 )
{
GEOM::GEOM_IShapesOperations_var aShapesOp =
getGeomEngine()->GetIShapesOperations( getStudyId() );
int anIndex = aMap( 1 );
- TopTools_IndexedMapOfShape aShapes;
- TopExp::MapShapes( S, aShapes );
- S = aShapes.FindKey( anIndex );
- if ( S.ShapeType() == TopAbs_WIRE || S.ShapeType() == TopAbs_EDGE ) {
- myPath = aShapesOp->GetSubShape(aSelectedObject, anIndex);
- myOkPath = true;
- aSelMgr->clearSelected();
- }
+ myPath = aShapesOp->GetSubShape(aSelectedObject, anIndex);
+ aName.append( ":edge_" + QString::number( anIndex ) );
+ myOkPath = true;
+ aSelMgr->clearSelected();
}
- else if ( S.ShapeType() == TopAbs_WIRE || S.ShapeType() == TopAbs_EDGE ) {
+ else {
myPath = aSelectedObject;
myOkPath = true;
}
+ myEditCurrentArgument->setText( aName );
}
}
- myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
displayPreview();
}
if (!testResult)
return;
- myEditCurrentArgument->setText(GEOMBase::GetName(aSelectedObject));
TopoDS_Shape aShape;
+ QString aName = GEOMBase::GetName( aSelectedObject );
if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() )
{
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
GEOM::GEOM_IShapesOperations_var aShapesOp =
getGeomEngine()->GetIShapesOperations( getStudyId() );
int anIndex = aMap( 1 );
- TopTools_IndexedMapOfShape aShapes;
- TopExp::MapShapes( aShape, aShapes );
- aShape = aShapes.FindKey( anIndex );
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
+ aName.append( ":edge_" + QString::number( anIndex ) );
aSelMgr->clearSelected();
}
}
myVec = aSelectedObject;
myOkVec = true;
}
- myEditCurrentArgument->setText(GEOMBase::GetName(aSelectedObject));
+ myEditCurrentArgument->setText( aName );
}
else // getConstructorId()==1 - extrusion using 2 points
{
if (!testResult || CORBA::is_nil( aSelectedObject ))
return;
- myEditCurrentArgument->setText(GEOMBase::GetName(aSelectedObject));
+ QString aName = GEOMBase::GetName( aSelectedObject );
TopoDS_Shape aShape;
+
if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() )
{
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
GEOM::GEOM_IShapesOperations_var aShapesOp =
getGeomEngine()->GetIShapesOperations( getStudyId() );
int anIndex = aMap( 1 );
- TopTools_IndexedMapOfShape aShapes;
- TopExp::MapShapes( aShape, aShapes );
- aShape = aShapes.FindKey( anIndex );
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
+ aName.append( ":vertex_" + QString::number( anIndex ) );
aSelMgr->clearSelected();
}
}
+ myEditCurrentArgument->setText( aName );
+
if (myEditCurrentArgument == GroupPoints2->LineEdit1) {
myBase = aSelectedObject;
myOkBase = true;
void GenerationGUI_PrismDlg::SetEditCurrentArgument()
{
QPushButton* send = (QPushButton*)sender();
+ globalSelection( GEOM_POINT ); // to break previous local selection
if (send == GroupPoints->PushButton1) {
GroupPoints->LineEdit1->setFocus();
else if (send == GroupPoints->PushButton2) {
GroupPoints->LineEdit2->setFocus();
myEditCurrentArgument = GroupPoints->LineEdit2;
- // globalSelection( GEOM_LINE );
- GEOM::GEOM_Object_var anObj;
- localSelection( anObj, TopAbs_EDGE );
+ localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
}
else if (send == GroupPoints2->PushButton1) {
GroupPoints2->LineEdit1->setFocus();
// nbSel == 1
Standard_Boolean testResult = Standard_False;
GEOM::GEOM_Object_ptr aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
+ QString aName = GEOMBase::GetName( aSelectedObject );
if (!testResult)
return;
GEOM::GEOM_IShapesOperations_var aShapesOp =
getGeomEngine()->GetIShapesOperations( getStudyId() );
int anIndex = aMap( 1 );
- TopTools_IndexedMapOfShape aShapes;
- TopExp::MapShapes( aShape, aShapes );
- aShape = aShapes.FindKey( anIndex );
+ aName.append( ":edge_" + QString::number( anIndex ) );
myAxis = aShapesOp->GetSubShape(aSelectedObject, anIndex);
aSelMgr->clearSelected();
}
}
}
}
- myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
+ myEditCurrentArgument->setText( aName );
displayPreview();
}
GroupPoints->LineEdit2->setFocus();
myEditCurrentArgument = GroupPoints->LineEdit2;
//globalSelection( GEOM_LINE );
- GEOM::GEOM_Object_var anObj;
- localSelection( anObj, TopAbs_EDGE );
+ localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
}
SelectionIntoArgument();
}
if(!testResult || CORBA::is_nil( aSelectedObject ))
return;
- myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
TopoDS_Shape aShape;
+ QString aName = GEOMBase::GetName( aSelectedObject );
if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() )
{
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
GEOM::GEOM_IShapesOperations_var aShapesOp =
getGeomEngine()->GetIShapesOperations( getStudyId() );
int anIndex = aMap( 1 );
- TopTools_IndexedMapOfShape aShapes;
- TopExp::MapShapes( aShape, aShapes );
- aShape = aShapes.FindKey( anIndex );
+ aName.append( ":vertex_" + QString::number( anIndex ) );
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
aSelMgr->clearSelected();
}
}
+
+ myEditCurrentArgument->setText( aName );
+
if(myEditCurrentArgument == GroupPoints->LineEdit1)
myPoint1 = aSelectedObject;
else if(myEditCurrentArgument == GroupPoints->LineEdit2)
return;
TopoDS_Shape aShape;
- myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
+ QString aName = GEOMBase::GetName( aSelectedObject );
+
if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() )
{
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
GEOM::GEOM_IShapesOperations_var aShapesOp =
getGeomEngine()->GetIShapesOperations( getStudyId() );
int anIndex = aMap( 1 );
- TopTools_IndexedMapOfShape aShapes;
- TopExp::MapShapes( aShape, aShapes );
- aShape = aShapes.FindKey( anIndex );
+ if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
+ aName.append( ":edge_" + QString::number( anIndex ) );
+ else
+ aName.append( ":vertex_" + QString::number( anIndex ) );
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
aSelMgr->clearSelected();
}
}
+ myEditCurrentArgument->setText( aName );
+
if (myEditCurrentArgument == GroupPoints->LineEdit1)
myPoint = aSelectedObject;
else if (myEditCurrentArgument == GroupPoints->LineEdit2)
if(send == GroupPoints->PushButton1) {
myEditCurrentArgument = GroupPoints->LineEdit1;
- // globalSelection( GEOM_POINT );
+ globalSelection( GEOM_POINT ); // to break prvious local selection
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
}
else if(send == GroupPoints->PushButton2) {
myEditCurrentArgument = GroupPoints->LineEdit2;
- // globalSelection( GEOM_LINE );
- GEOM::GEOM_Object_var anObj;
- localSelection( anObj, TopAbs_EDGE );
+ globalSelection( GEOM_LINE );// to break prvious local selection
+ localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
}
myEditCurrentArgument->setFocus();
if(!testResult || CORBA::is_nil( aSelectedObject ))
return;
- myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
+ QString aName = GEOMBase::GetName( aSelectedObject );
TopoDS_Shape aShape;
if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() )
{
GEOM::GEOM_IShapesOperations_var aShapesOp =
getGeomEngine()->GetIShapesOperations( getStudyId() );
int anIndex = aMap( 1 );
- TopTools_IndexedMapOfShape aShapes;
- TopExp::MapShapes( aShape, aShapes );
- aShape = aShapes.FindKey( anIndex );
+ if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
+ aName.append( ":edge_" + QString::number( anIndex ) );
+ else
+ aName.append( ":vertex_" + QString::number( anIndex ) );
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
aSelMgr->clearSelected();
}
}
+ myEditCurrentArgument->setText( aName );
+
if (myEditCurrentArgument == GroupPoints->LineEdit1)
myPoint = aSelectedObject;
else if (myEditCurrentArgument == GroupPoints->LineEdit2)
if(send == GroupPoints->PushButton1) {
myEditCurrentArgument = GroupPoints->LineEdit1;
- // globalSelection( GEOM_POINT );
+ globalSelection( GEOM_POINT ); // to break previous local selection
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
}
else if(send == GroupPoints->PushButton2) {
myEditCurrentArgument = GroupPoints->LineEdit2;
- // globalSelection( GEOM_LINE );
- GEOM::GEOM_Object_var anObj;
- localSelection( anObj, TopAbs_EDGE );
+ globalSelection( GEOM_LINE ); // to break previous local selection
+ localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
}
myEditCurrentArgument->setFocus();
if (!testResult || CORBA::is_nil( aSelectedObject ))
return;
- myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
+ QString aName = GEOMBase::GetName( aSelectedObject );
TopoDS_Shape aShape;
if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() )
{
GEOM::GEOM_IShapesOperations_var aShapesOp =
getGeomEngine()->GetIShapesOperations( getStudyId() );
int anIndex = aMap( 1 );
- TopTools_IndexedMapOfShape aShapes;
- TopExp::MapShapes( aShape, aShapes );
- aShape = aShapes.FindKey( anIndex );
+ aName.append( ":vertex_" + QString::number( anIndex ) );
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
aSelMgr->clearSelected();
}
}
+
+ myEditCurrentArgument->setText( aName );
myPoint = aSelectedObject;
displayPreview();
if (!testResult || CORBA::is_nil( aSelectedObject ))
return;
- myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
+ QString aName = GEOMBase::GetName( aSelectedObject );
TopoDS_Shape aShape;
if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() )
{
GEOM::GEOM_IShapesOperations_var aShapesOp =
getGeomEngine()->GetIShapesOperations( getStudyId() );
int anIndex = aMap( 1 );
- TopTools_IndexedMapOfShape aShapes;
- TopExp::MapShapes( aShape, aShapes );
- aShape = aShapes.FindKey( anIndex );
+ if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
+ aName.append( ":edge_" + QString::number( anIndex ) );
+ else
+ aName.append( ":vertex_" + QString::number( anIndex ) );
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
aSelMgr->clearSelected();
}
}
+ myEditCurrentArgument->setText( aName );
+
if (myEditCurrentArgument == GroupPoints->LineEdit1)
myPoint = aSelectedObject;
else if (myEditCurrentArgument == GroupPoints->LineEdit2)
void PrimitiveGUI_TorusDlg::SetEditCurrentArgument()
{
QPushButton* send = (QPushButton*)sender();
+ globalSelection( GEOM_POINT ); // to break previous local selection
if (send == GroupPoints->PushButton1) {
myEditCurrentArgument = GroupPoints->LineEdit1;