if( !GEOMBase::GetShape(aSelectedObject, S) )
return;
+
+ QString aName = GEOMBase::GetName( aSelectedObject );
if ( testResult && !aSelectedObject->_is_nil() && aSelectedObject != myBase)
{
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
TColStd_IndexedMapOfInteger aMap;
- QString aName = GEOMBase::GetName( aSelectedObject );
+
aSelMgr->GetIndexes( firstIObject(), aMap );
if ( aMap.Extent() == 1 )
{
aSelMgr->clearSelected();
}
else {
- myPath = aSelectedObject;
- myOkPath = true;
+ myOkPath = true;
+ if (S.ShapeType() != TopAbs_EDGE) {
+ aSelectedObject = GEOM::GEOM_Object::_nil();
+ aName = "";
+ myOkPath = false;
}
- myEditCurrentArgument->setText( aName );
+ myPath = aSelectedObject;
+ }
}
+ myEditCurrentArgument->setText( aName );
}
displayPreview();
void GenerationGUI_PipeDlg::SetEditCurrentArgument()
{
QPushButton* send = (QPushButton*)sender();
+ globalSelection();
if(send == GroupPoints->PushButton1) {
GroupPoints->LineEdit1->setFocus();
- myEditCurrentArgument = GroupPoints->LineEdit1;
globalSelection( GEOM_ALLSHAPES );
+ myEditCurrentArgument = GroupPoints->LineEdit1;
}
else if(send == GroupPoints->PushButton2) {
GroupPoints->LineEdit2->setFocus();
myEditCurrentArgument = GroupPoints->LineEdit2;
- GEOM::GEOM_Object_var anObj;
- localSelection( anObj, TopAbs_EDGE );
+ globalSelection();
+ localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
}
SelectionIntoArgument();
}
if (!testResult)
return;
+ bool myOk = true;
TopoDS_Shape aShape;
QString aName = GEOMBase::GetName( aSelectedObject );
if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() )
aName.append( ":edge_" + QString::number( anIndex ) );
aSelMgr->clearSelected();
}
+ else {
+ if (aShape.ShapeType() != TopAbs_EDGE && myEditCurrentArgument == GroupPoints->LineEdit2) {
+ aSelectedObject = GEOM::GEOM_Object::_nil();
+ aName = "";
+ myOk = false;
+ }
+ }
}
-
+
if (myEditCurrentArgument == GroupPoints->LineEdit1) {
myBase = aSelectedObject;
myOkBase = true;
}
- else if (myEditCurrentArgument == GroupPoints->LineEdit2) {
+ else if (myEditCurrentArgument == GroupPoints->LineEdit2 && myOk) {
+ myOkVec = true;
myVec = aSelectedObject;
- myOkVec = true;
}
myEditCurrentArgument->setText( aName );
}
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();
TColStd_IndexedMapOfInteger aMap;
aSelMgr->GetIndexes( firstIObject(), aMap );
aName.append( ":vertex_" + QString::number( anIndex ) );
aSelMgr->clearSelected();
}
+ else {
+ if ( (aShape.ShapeType() != TopAbs_EDGE && myEditCurrentArgument == GroupPoints2->LineEdit2 ) ||
+ (aShape.ShapeType() != TopAbs_EDGE && myEditCurrentArgument == GroupPoints2->LineEdit3 )) {
+ aSelectedObject = GEOM::GEOM_Object::_nil();
+ aName = "";
+ myOk = false;
+ }
+ }
}
-
+
myEditCurrentArgument->setText( aName );
if (myEditCurrentArgument == GroupPoints2->LineEdit1) {
myBase = aSelectedObject;
myOkBase = true;
}
- else if (myEditCurrentArgument == GroupPoints2->LineEdit2) {
- myPoint1 = aSelectedObject;
+ else if (myEditCurrentArgument == GroupPoints2->LineEdit2 && myOk) {
myOkPnt1 = true;
+ myPoint1 = aSelectedObject;
}
- else if (myEditCurrentArgument == GroupPoints2->LineEdit3) {
- myPoint2 = aSelectedObject;
+ else if (myEditCurrentArgument == GroupPoints2->LineEdit3 && myOk) {
myOkPnt2 = true;
+ myPoint2 = aSelectedObject;
}
}
void GenerationGUI_PrismDlg::SetEditCurrentArgument()
{
QPushButton* send = (QPushButton*)sender();
- globalSelection( GEOM_POINT ); // to break previous local selection
+ globalSelection( GEOM_ALLSHAPES );
if (send == GroupPoints->PushButton1) {
GroupPoints->LineEdit1->setFocus();
myEditCurrentArgument = GroupPoints->LineEdit1;
- globalSelection( GEOM_ALLSHAPES );
}
else if (send == GroupPoints->PushButton2) {
GroupPoints->LineEdit2->setFocus();
else if (send == GroupPoints2->PushButton1) {
GroupPoints2->LineEdit1->setFocus();
myEditCurrentArgument = GroupPoints2->LineEdit1;
- globalSelection( GEOM_ALLSHAPES );
}
else if (send == GroupPoints2->PushButton2) {
GroupPoints2->LineEdit2->setFocus();
int anIndex = aMap( 1 );
aName.append( ":edge_" + QString::number( anIndex ) );
myAxis = aShapesOp->GetSubShape(aSelectedObject, anIndex);
- aSelMgr->clearSelected();
+ myOkAxis = true;
+ }
+ else {
+ myOkAxis = true;
+ if (aShape.ShapeType() != TopAbs_EDGE) {
+ aSelectedObject = GEOM::GEOM_Object::_nil();
+ aName = "";
+ myOkAxis = false;
}
- else
myAxis = aSelectedObject;
-
- myOkAxis = true;
+ }
}
}
}
else if(send == GroupPoints->PushButton2) {
GroupPoints->LineEdit2->setFocus();
myEditCurrentArgument = GroupPoints->LineEdit2;
- //globalSelection( GEOM_LINE );
localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
}
SelectionIntoArgument();