-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// GEOM GEOMGUI : GUI for Geometry component
// File : EntityGUI_SubShapeDlg.cxx
// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
// TRUE to construct a modal dialog.
//=================================================================================
EntityGUI_SubShapeDlg::EntityGUI_SubShapeDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
- bool modal, Qt::WindowFlags fl )
+ bool modal, Qt::WindowFlags fl )
: GEOMBase_Skeleton( theGeometryGUI, parent, modal, fl )
{
QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_SUBSHAPE" ) ) );
connect( GroupPoints->CheckButton1, SIGNAL( stateChanged( int ) ), this, SLOT( SubShapeToggled() ) );
connect( myGeomGUI->getApp()->selectionMgr(),
- SIGNAL( currentSelectionChanged( )), this, SLOT( SelectionIntoArgument() ) );
+ SIGNAL( currentSelectionChanged( )), this, SLOT( SelectionIntoArgument() ) );
updateButtonState();
resize(100,100);
{
GEOMBase_Skeleton::ActivateThisDialog();
connect( myGeomGUI->getApp()->selectionMgr(),
- SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
+ SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
SubShapeToggled();
updateButtonState();
}
// purpose :
//=================================================================================
unsigned int EntityGUI_SubShapeDlg::NumberOfSubShapes( const TopoDS_Shape& S,
- const int shapeType ) const
+ const int shapeType ) const
{
if ( S.IsNull() )
return 0;
if ( S.ShapeType() == TopAbs_COMPOUND &&
( TopAbs_ShapeEnum(shapeType) == TopAbs_SHAPE ||
- TopAbs_ShapeEnum(shapeType) == TopAbs_COMPSOLID ||
- TopAbs_ShapeEnum(shapeType) == TopAbs_COMPOUND ) ) {
+ TopAbs_ShapeEnum(shapeType) == TopAbs_COMPSOLID ||
+ TopAbs_ShapeEnum(shapeType) == TopAbs_COMPOUND ) ) {
TopoDS_Iterator It( S, Standard_True, Standard_True );
for ( ; It.More(); It.Next() ) {
if ( M.Add( It.Value() ) ) {
if ( TopAbs_ShapeEnum( shapeType ) == TopAbs_SHAPE ||
- TopAbs_ShapeEnum( shapeType ) == It.Value().ShapeType() ) {
+ TopAbs_ShapeEnum( shapeType ) == It.Value().ShapeType() ) {
index++;
}
}
//=================================================================================
bool EntityGUI_SubShapeDlg::execute (ObjectList& objects)
{
- GEOM::ListOfGO_var aList = GEOM::GEOM_IShapesOperations::_narrow(getOperation())->
- MakeExplode(myObject, shapeType(), true);
+ GEOM::GEOM_IShapesOperations_var anOper = GEOM::GEOM_IShapesOperations::_narrow(getOperation());
+ GEOM::ListOfGO_var aList = anOper->MakeExplode(myObject, shapeType(), true);
if (!aList->length())
return false;
if (aSelList.Extent() == 1) {
Standard_Boolean aResult = Standard_False;
GEOM::GEOM_Object_var anObj =
- GEOMBase::ConvertIOinGEOMObject(aSelList.First(), aResult);
+ GEOMBase::ConvertIOinGEOMObject(aSelList.First(), aResult);
if (aResult && !anObj->_is_nil()) {
- TColStd_IndexedMapOfInteger aMapIndex;
- aSelMgr->GetIndexes(aSelList.First(), aMapIndex);
+ TColStd_IndexedMapOfInteger aMapIndex;
+ aSelMgr->GetIndexes(aSelList.First(), aMapIndex);
- GEOM::GEOM_ILocalOperations_var aLocOp =
- getGeomEngine()->GetILocalOperations(getStudyId());
+ GEOM::GEOM_ILocalOperations_var aLocOp =
+ 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]));
}
}
}