mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-27 18:50:33 +05:00
IPAL53698: Clipping dialog: ambiguos object identification by names
This commit is contained in:
parent
b6bea82aa0
commit
1a1b88b9cf
@ -231,6 +231,8 @@ SMESH::OrientedPlane::~OrientedPlane()
|
||||
myPlaneSource->Delete();
|
||||
}
|
||||
|
||||
namespace
|
||||
{
|
||||
/*!
|
||||
Definition of class ActorItem
|
||||
*/
|
||||
@ -259,6 +261,7 @@ struct TSetVisibility {
|
||||
}
|
||||
int myIsVisible;
|
||||
};
|
||||
}
|
||||
|
||||
/*********************************************************************************
|
||||
********************* class SMESHGUI_ClippingDlg *********************
|
||||
@ -713,6 +716,8 @@ vtkImplicitPlaneWidget* SMESHGUI_ClippingDlg::createPreviewWidget()
|
||||
return aPlaneWgt;
|
||||
}
|
||||
|
||||
namespace
|
||||
{
|
||||
/*!
|
||||
Translate two angles of plane to normal
|
||||
*/
|
||||
@ -755,6 +760,24 @@ void rotationToNormal ( double theRotation[2],
|
||||
vtkMath::Cross( theNormal, theDir[1], theDir[0] );
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Return a name of a father mesh if any
|
||||
*/
|
||||
QString getFatherName( _PTR(SObject)& theSObj )
|
||||
{
|
||||
_PTR(SComponent) objComponent = theSObj->GetFatherComponent();
|
||||
const int theMeshDepth = 1 + objComponent->Depth();
|
||||
if ( theSObj->Depth() <= theMeshDepth )
|
||||
return QString(); // theSObj is a mesh
|
||||
|
||||
_PTR(SObject) sobj = theSObj->GetFather();
|
||||
while ( sobj && sobj->Depth() > theMeshDepth )
|
||||
sobj = sobj->GetFather();
|
||||
|
||||
return sobj ? sobj->GetName().c_str() : "";
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
Used in SMESHGUI::restoreVisualParameters() to avoid
|
||||
Declaration of OrientedPlane outside of SMESHGUI_ClippingDlg.cxx
|
||||
@ -1084,6 +1107,10 @@ void SMESHGUI_ClippingDlg::updateActorList()
|
||||
}
|
||||
}
|
||||
QString aName = QString( aSObj->GetName().c_str() );
|
||||
QString aFatherName = getFatherName( aSObj );
|
||||
if ( !aFatherName.isEmpty() )
|
||||
aName = aFatherName + " / " + aName;
|
||||
aName += QString(" (%1)").arg( aSObj->GetID().c_str() );
|
||||
QListWidgetItem* anItem = new ActorItem( anActor, aName, ActorList );
|
||||
anItem->setCheckState( anIsChecked ? Qt::Checked : Qt::Unchecked );
|
||||
updateActorItem( anItem, true, false );
|
||||
|
Loading…
Reference in New Issue
Block a user