mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-05-30 16:37:50 +05:00
NPAL 18363
This commit is contained in:
parent
156fe6ad40
commit
0d45320fe4
@ -241,11 +241,19 @@ void TransformationGUI_MirrorDlg::SelectionIntoArgument()
|
||||
if(!testResult || CORBA::is_nil( myArgument ))
|
||||
return;
|
||||
|
||||
aName = GEOMBase::GetName( aSelectedObject );
|
||||
|
||||
if ( testResult && !aSelectedObject->_is_nil() )
|
||||
{
|
||||
TopoDS_Shape aShape;
|
||||
if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() )
|
||||
{
|
||||
TopAbs_ShapeEnum aNeedType = TopAbs_VERTEX;
|
||||
if (getConstructorId() == 1)
|
||||
aNeedType = TopAbs_EDGE;
|
||||
else if (getConstructorId() == 2)
|
||||
aNeedType = TopAbs_FACE;
|
||||
|
||||
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||
TColStd_IndexedMapOfInteger aMap;
|
||||
aSelMgr->GetIndexes( firstIObject(), aMap );
|
||||
@ -254,15 +262,23 @@ void TransformationGUI_MirrorDlg::SelectionIntoArgument()
|
||||
GEOM::GEOM_IShapesOperations_var aShapesOp =
|
||||
getGeomEngine()->GetIShapesOperations( getStudyId() );
|
||||
int anIndex = aMap( 1 );
|
||||
TopTools_IndexedMapOfShape aShapes;
|
||||
TopExp::MapShapes( aShape, aShapes );
|
||||
aShape = aShapes.FindKey( anIndex );
|
||||
int id = getConstructorId();
|
||||
if (aNeedType == TopAbs_VERTEX)
|
||||
aName += QString(":vertex_%1").arg(anIndex);
|
||||
else
|
||||
aName += QString(":edge_%1").arg(anIndex);
|
||||
|
||||
myArgument = aShapesOp->GetSubShape(aSelectedObject, anIndex);
|
||||
aSelMgr->clearSelected();
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (aShape.ShapeType() != aNeedType) {
|
||||
myArgument = GEOM::GEOM_Object::_nil();
|
||||
aName = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
aName = GEOMBase::GetName( aSelectedObject );
|
||||
}
|
||||
myEditCurrentArgument->setText( aName );
|
||||
|
||||
@ -293,10 +309,10 @@ void TransformationGUI_MirrorDlg::LineEditReturnPressed()
|
||||
void TransformationGUI_MirrorDlg::SetEditCurrentArgument()
|
||||
{
|
||||
QPushButton* send = (QPushButton*)sender();
|
||||
globalSelection();
|
||||
|
||||
if(send == GroupPoints->PushButton1){
|
||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||
globalSelection();
|
||||
}
|
||||
else if(send == GroupPoints->PushButton2) {
|
||||
myEditCurrentArgument = GroupPoints->LineEdit2;
|
||||
@ -304,15 +320,12 @@ void TransformationGUI_MirrorDlg::SetEditCurrentArgument()
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
// globalSelection( GEOM_POINT );
|
||||
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
//globalSelection( GEOM_LINE );
|
||||
GEOM::GEOM_Object_var anObj;
|
||||
localSelection( anObj, TopAbs_EDGE );
|
||||
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
|
@ -288,6 +288,8 @@ void TransformationGUI_MultiRotationDlg::SelectionIntoArgument()
|
||||
if (!testResult || CORBA::is_nil(aSelectedObject) || !GEOMBase::IsShape(aSelectedObject))
|
||||
return;
|
||||
|
||||
QString aName = GEOMBase::GetName( aSelectedObject );
|
||||
|
||||
if (myEditCurrentArgument == GroupPoints->LineEdit1 ||
|
||||
myEditCurrentArgument == GroupDimensions->LineEdit1)
|
||||
myBase = aSelectedObject;
|
||||
@ -297,6 +299,7 @@ void TransformationGUI_MultiRotationDlg::SelectionIntoArgument()
|
||||
{
|
||||
TopoDS_Shape aShape;
|
||||
|
||||
|
||||
if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() )
|
||||
{
|
||||
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||
@ -307,18 +310,22 @@ void TransformationGUI_MultiRotationDlg::SelectionIntoArgument()
|
||||
GEOM::GEOM_IShapesOperations_var aShapesOp =
|
||||
getGeomEngine()->GetIShapesOperations( getStudyId() );
|
||||
int anIndex = aMap( 1 );
|
||||
TopTools_IndexedMapOfShape aShapes;
|
||||
TopExp::MapShapes( aShape, aShapes );
|
||||
aShape = aShapes.FindKey( anIndex );
|
||||
aName += QString(":edge_%1").arg(anIndex);
|
||||
myVector = aShapesOp->GetSubShape(aSelectedObject, anIndex);
|
||||
aSelMgr->clearSelected();
|
||||
}
|
||||
else
|
||||
else {
|
||||
if (aShape.ShapeType() != TopAbs_EDGE) {
|
||||
aSelectedObject = GEOM::GEOM_Object::_nil();
|
||||
aName = "";
|
||||
}
|
||||
myVector = aSelectedObject;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
|
||||
myEditCurrentArgument->setText( aName );
|
||||
|
||||
displayPreview();
|
||||
}
|
||||
@ -331,26 +338,21 @@ void TransformationGUI_MultiRotationDlg::SelectionIntoArgument()
|
||||
void TransformationGUI_MultiRotationDlg::SetEditCurrentArgument()
|
||||
{
|
||||
QPushButton* send = (QPushButton*)sender();
|
||||
globalSelection( GEOM_ALLSHAPES );
|
||||
|
||||
if(send == GroupPoints->PushButton1) {
|
||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||
globalSelection( GEOM_ALLSHAPES );
|
||||
}
|
||||
else if(send == GroupPoints->PushButton2) {
|
||||
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 == GroupDimensions->PushButton1) {
|
||||
myEditCurrentArgument = GroupDimensions->LineEdit1;
|
||||
globalSelection( GEOM_ALLSHAPES );
|
||||
}
|
||||
else if(send == GroupDimensions->PushButton2) {
|
||||
myEditCurrentArgument = GroupDimensions->LineEdit2;
|
||||
// globalSelection( GEOM_LINE );
|
||||
GEOM::GEOM_Object_var anObj;
|
||||
localSelection( anObj, TopAbs_EDGE );
|
||||
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
|
||||
}
|
||||
|
||||
myEditCurrentArgument->setFocus();
|
||||
|
@ -305,6 +305,8 @@ void TransformationGUI_MultiTranslationDlg::SelectionIntoArgument()
|
||||
if ( !testResult || CORBA::is_nil( aSelectedObject ) || !GEOMBase::IsShape( aSelectedObject ) )
|
||||
return;
|
||||
|
||||
QString aName = GEOMBase::GetName( aSelectedObject );
|
||||
|
||||
if (myEditCurrentArgument == GroupPoints->LineEdit1 ||
|
||||
myEditCurrentArgument == GroupDimensions->LineEdit1)
|
||||
myBase = aSelectedObject;
|
||||
@ -325,25 +327,27 @@ void TransformationGUI_MultiTranslationDlg::SelectionIntoArgument()
|
||||
GEOM::GEOM_IShapesOperations_var aShapesOp =
|
||||
getGeomEngine()->GetIShapesOperations( getStudyId() );
|
||||
int anIndex = aMap( 1 );
|
||||
TopTools_IndexedMapOfShape aShapes;
|
||||
TopExp::MapShapes( aShape, aShapes );
|
||||
aShape = aShapes.FindKey( anIndex );
|
||||
aSelMgr->clearSelected();
|
||||
aName += QString(":edge_%1").arg(anIndex);
|
||||
if ( myEditCurrentArgument == GroupDimensions->LineEdit3 )
|
||||
myVectorV = aShapesOp->GetSubShape(aSelectedObject, anIndex);
|
||||
else
|
||||
myVectorU = aShapesOp->GetSubShape(aSelectedObject, anIndex);
|
||||
}
|
||||
else
|
||||
else {
|
||||
if (aShape.ShapeType() != TopAbs_EDGE) {
|
||||
aSelectedObject = GEOM::GEOM_Object::_nil();
|
||||
aName = "";
|
||||
}
|
||||
if ( myEditCurrentArgument == GroupDimensions->LineEdit3 )
|
||||
myVectorV = aSelectedObject;
|
||||
else
|
||||
myVectorU = aSelectedObject;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
myEditCurrentArgument->setText( GEOMBase::GetName( aSelectedObject ) );
|
||||
myEditCurrentArgument->setText( aName );
|
||||
|
||||
displayPreview();
|
||||
}
|
||||
@ -356,32 +360,25 @@ void TransformationGUI_MultiTranslationDlg::SelectionIntoArgument()
|
||||
void TransformationGUI_MultiTranslationDlg::SetEditCurrentArgument()
|
||||
{
|
||||
QPushButton* send = (QPushButton*)sender();
|
||||
globalSelection( GEOM_ALLSHAPES );
|
||||
|
||||
if(send == GroupPoints->PushButton1) {
|
||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||
globalSelection( GEOM_ALLSHAPES );
|
||||
}
|
||||
else if(send == GroupPoints->PushButton2) {
|
||||
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 == GroupDimensions->PushButton1) {
|
||||
myEditCurrentArgument = GroupDimensions->LineEdit1;
|
||||
globalSelection( GEOM_ALLSHAPES );
|
||||
}
|
||||
else if(send == GroupDimensions->PushButton2) {
|
||||
myEditCurrentArgument = GroupDimensions->LineEdit2;
|
||||
// globalSelection( GEOM_LINE );
|
||||
GEOM::GEOM_Object_var anObj;
|
||||
localSelection( anObj, TopAbs_EDGE );
|
||||
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
|
||||
}
|
||||
else if(send == GroupDimensions->PushButton3) {
|
||||
myEditCurrentArgument = GroupDimensions->LineEdit3;
|
||||
// globalSelection( GEOM_LINE );
|
||||
GEOM::GEOM_Object_var anObj;
|
||||
localSelection( anObj, TopAbs_EDGE );
|
||||
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
|
||||
}
|
||||
|
||||
myEditCurrentArgument->setFocus();
|
||||
|
@ -273,6 +273,10 @@ void TransformationGUI_RotationDlg::SelectionIntoArgument()
|
||||
TopoDS_Shape aShape;
|
||||
if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() )
|
||||
{
|
||||
TopAbs_ShapeEnum aNeedType = TopAbs_VERTEX;
|
||||
if (myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 0)
|
||||
aNeedType = TopAbs_EDGE;
|
||||
|
||||
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||
TColStd_IndexedMapOfInteger aMap;
|
||||
aSelMgr->GetIndexes( firstIObject(), aMap );
|
||||
@ -281,12 +285,19 @@ void TransformationGUI_RotationDlg::SelectionIntoArgument()
|
||||
GEOM::GEOM_IShapesOperations_var aShapesOp =
|
||||
getGeomEngine()->GetIShapesOperations( getStudyId() );
|
||||
int anIndex = aMap( 1 );
|
||||
TopTools_IndexedMapOfShape aShapes;
|
||||
TopExp::MapShapes( aShape, aShapes );
|
||||
aShape = aShapes.FindKey( anIndex );
|
||||
if (aNeedType == TopAbs_EDGE)
|
||||
aName += QString(":edge_%1").arg(anIndex);
|
||||
else
|
||||
aName += QString(":vertex_%1").arg(anIndex);
|
||||
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
|
||||
aSelMgr->clearSelected();
|
||||
}
|
||||
else {
|
||||
if (aShape.ShapeType() != aNeedType) {
|
||||
aSelectedObject = GEOM::GEOM_Object::_nil();
|
||||
aName = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 0)
|
||||
@ -312,18 +323,15 @@ void TransformationGUI_RotationDlg::SelectionIntoArgument()
|
||||
void TransformationGUI_RotationDlg::SetEditCurrentArgument()
|
||||
{
|
||||
QPushButton* send = (QPushButton*)sender();
|
||||
globalSelection();
|
||||
|
||||
if(send == GroupPoints->PushButton1) {
|
||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||
globalSelection();
|
||||
}
|
||||
else if(send == GroupPoints->PushButton2) {
|
||||
myEditCurrentArgument = GroupPoints->LineEdit2;
|
||||
if (getConstructorId() == 0) {
|
||||
//globalSelection( GEOM_LINE );
|
||||
GEOM::GEOM_Object_var anObj;
|
||||
localSelection( anObj, TopAbs_EDGE );
|
||||
}
|
||||
if (getConstructorId() == 0)
|
||||
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
|
||||
else
|
||||
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
|
||||
}
|
||||
|
@ -214,12 +214,16 @@ void TransformationGUI_ScaleDlg::SelectionIntoArgument()
|
||||
GEOM::GEOM_IShapesOperations_var aShapesOp =
|
||||
getGeomEngine()->GetIShapesOperations( getStudyId() );
|
||||
int anIndex = aMap( 1 );
|
||||
TopTools_IndexedMapOfShape aShapes;
|
||||
TopExp::MapShapes( aShape, aShapes );
|
||||
aShape = aShapes.FindKey( anIndex );
|
||||
aName += QString(":vertex_%1").arg(anIndex);
|
||||
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
|
||||
aSelMgr->clearSelected();
|
||||
}
|
||||
else {
|
||||
if (aShape.ShapeType() != TopAbs_VERTEX) {
|
||||
aSelectedObject = GEOM::GEOM_Object::_nil();
|
||||
aName = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
myPoint = aSelectedObject;
|
||||
@ -257,10 +261,10 @@ void TransformationGUI_ScaleDlg::LineEditReturnPressed()
|
||||
void TransformationGUI_ScaleDlg::SetEditCurrentArgument()
|
||||
{
|
||||
QPushButton* send = (QPushButton*)sender();
|
||||
globalSelection();
|
||||
|
||||
if(send == GroupPoints->PushButton1) {
|
||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||
globalSelection();
|
||||
}
|
||||
else if(send == GroupPoints->PushButton2) {
|
||||
myEditCurrentArgument = GroupPoints->LineEdit2;
|
||||
|
@ -287,6 +287,10 @@ void TransformationGUI_TranslationDlg::SelectionIntoArgument()
|
||||
aName = GEOMBase::GetName( aSelectedObject );
|
||||
if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() )
|
||||
{
|
||||
TopAbs_ShapeEnum aNeedType = TopAbs_VERTEX;
|
||||
if (myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 2)
|
||||
aNeedType = TopAbs_EDGE;
|
||||
|
||||
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||
TColStd_IndexedMapOfInteger aMap;
|
||||
aSelMgr->GetIndexes( firstIObject(), aMap );
|
||||
@ -294,13 +298,19 @@ void TransformationGUI_TranslationDlg::SelectionIntoArgument()
|
||||
{
|
||||
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 anIndex = aMap( 1 );
|
||||
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
|
||||
if (aNeedType == TopAbs_EDGE)
|
||||
aName += QString(":edge_%1").arg(anIndex);
|
||||
else
|
||||
aName += QString(":vertex_%1").arg(anIndex);
|
||||
} else // Global Selection
|
||||
{
|
||||
if (aShape.ShapeType() != aNeedType) {
|
||||
aSelectedObject = GEOM::GEOM_Object::_nil();
|
||||
aName = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 1)
|
||||
@ -338,10 +348,10 @@ void TransformationGUI_TranslationDlg::LineEditReturnPressed()
|
||||
void TransformationGUI_TranslationDlg::SetEditCurrentArgument()
|
||||
{
|
||||
QPushButton* send = (QPushButton*)sender();
|
||||
globalSelection();
|
||||
|
||||
if (send == GroupPoints->PushButton1) {
|
||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||
globalSelection();
|
||||
}
|
||||
else if (send == GroupPoints->PushButton2) {
|
||||
myEditCurrentArgument = GroupPoints->LineEdit2;
|
||||
|
Loading…
x
Reference in New Issue
Block a user