mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-01-14 10:40:35 +05:00
Mantis issue 0021110: Low efficiency of the explode.
This commit is contained in:
parent
4b3c8c2918
commit
3e74adae35
@ -429,7 +429,7 @@ void EntityGUI_SubShapeDlg::ComboTextChanged()
|
|||||||
// purpose :
|
// purpose :
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
unsigned int EntityGUI_SubShapeDlg::NumberOfSubShapes(const TopoDS_Shape& S,
|
unsigned int EntityGUI_SubShapeDlg::NumberOfSubShapes(const TopoDS_Shape& S,
|
||||||
const int shapeType) const
|
const int shapeType) const
|
||||||
{
|
{
|
||||||
if (S.IsNull())
|
if (S.IsNull())
|
||||||
return 0;
|
return 0;
|
||||||
@ -702,7 +702,8 @@ bool EntityGUI_SubShapeDlg::isValid (QString& msg)
|
|||||||
bool EntityGUI_SubShapeDlg::execute (ObjectList& objects)
|
bool EntityGUI_SubShapeDlg::execute (ObjectList& objects)
|
||||||
{
|
{
|
||||||
GEOM::GEOM_IShapesOperations_var anOper = GEOM::GEOM_IShapesOperations::_narrow(getOperation());
|
GEOM::GEOM_IShapesOperations_var anOper = GEOM::GEOM_IShapesOperations::_narrow(getOperation());
|
||||||
GEOM::ListOfGO_var aList = anOper->ExtractSubShapes(myObject, shapeType(), true);
|
//GEOM::ListOfGO_var aList = anOper->ExtractSubShapes(myObject, shapeType(), true);
|
||||||
|
GEOM::ListOfGO_var aList = anOper->ExtractSubShapes(myObject, shapeType(), isAllSubShapes());
|
||||||
|
|
||||||
if (!aList->length())
|
if (!aList->length())
|
||||||
return false;
|
return false;
|
||||||
@ -714,19 +715,25 @@ bool EntityGUI_SubShapeDlg::execute (ObjectList& objects)
|
|||||||
int nbSel = getSelectedSubshapes(aMapIndex);
|
int nbSel = getSelectedSubshapes(aMapIndex);
|
||||||
|
|
||||||
if (nbSel > 0) {
|
if (nbSel > 0) {
|
||||||
GEOM::GEOM_ILocalOperations_var aLocOp =
|
//GEOM::GEOM_ILocalOperations_var aLocOp =
|
||||||
getGeomEngine()->GetILocalOperations(getStudyId());
|
// getGeomEngine()->GetILocalOperations(getStudyId());
|
||||||
|
TopTools_IndexedMapOfShape aSubShapesMap;
|
||||||
|
TopExp::MapShapes(myShape, aSubShapesMap);
|
||||||
|
|
||||||
for (int i = 0, n = aList->length(); i < n; i++)
|
for (int i = 0, n = aList->length(); i < n; i++) {
|
||||||
if (aMapIndex.Contains(aLocOp->GetSubShapeIndex(myObject, aList[i])))
|
//if (aMapIndex.Contains(aLocOp->GetSubShapeIndex(myObject, aList[i])))
|
||||||
|
TopoDS_Shape aSShape = GEOM_Client::get_client().GetShape(GeometryGUI::GetGeomGen(), aList[i]);
|
||||||
|
if (aMapIndex.Contains(aSubShapesMap.FindIndex(aSShape)))
|
||||||
objects.push_back(GEOM::GEOM_Object::_duplicate(aList[i]));
|
objects.push_back(GEOM::GEOM_Object::_duplicate(aList[i]));
|
||||||
else
|
else
|
||||||
aList[i]->UnRegister();
|
aList[i]->UnRegister();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
for (int i = 0, n = aList->length(); i < n; i++)
|
for (int i = 0, n = aList->length(); i < n; i++)
|
||||||
objects.push_back(GEOM::GEOM_Object::_duplicate(aList[i]));
|
objects.push_back(GEOM::GEOM_Object::_duplicate(aList[i]));
|
||||||
|
}
|
||||||
|
|
||||||
return objects.size();
|
return objects.size();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user