X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESHDS%2FSMESHDS_GroupBase.cxx;h=50ac2ee748e09f96756ada094b685c4dd0c3026a;hp=a9c378fd621ac033dcfdee2f95a71461ecbee1c8;hb=0fc0831670e27a5611b941c52dc152fd63964515;hpb=251f8c052dd12dd29922210dc901b295fe999a0e diff --git a/src/SMESHDS/SMESHDS_GroupBase.cxx b/src/SMESHDS/SMESHDS_GroupBase.cxx index a9c378fd6..50ac2ee74 100644 --- a/src/SMESHDS/SMESHDS_GroupBase.cxx +++ b/src/SMESHDS/SMESHDS_GroupBase.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2020 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 @@ -32,6 +32,8 @@ using namespace std; +Quantity_Color SMESHDS_GroupBase::myDefaultColor = Quantity_Color( 0.0, 0.0, 0.0, Quantity_TOC_RGB ); + //============================================================================= /*! * @@ -44,12 +46,12 @@ SMESHDS_GroupBase::SMESHDS_GroupBase (const int theID, myID(theID), myMesh(theMesh), myType(theType), myStoreName(""), myCurIndex(0), myCurID(-1) { - myColor = Quantity_Color( 0.0, 0.0, 0.0, Quantity_TOC_RGB ); + myColor = myDefaultColor; } //============================================================================= /*! - * + * Don't use it! */ //============================================================================= @@ -122,6 +124,9 @@ int SMESHDS_GroupBase::Extent() const bool SMESHDS_GroupBase::IsEmpty() { + if ( myMesh->GetMeshInfo().NbElements( myType ) == 0 ) + // avoid long iteration over sub-meshes of a complex sub-mesh of a group on geometry + return true; SMDS_ElemIteratorPtr it = GetElements(); return ( !it || !it->more() ); }