Merge remote-tracking branch 'origin/V9_5_BR'

Conflicts:
	src/SMESH_I/SMESH_Mesh_i.cxx
This commit is contained in:
eap 2020-07-10 19:33:14 +03:00
commit d55dbe18f5
7 changed files with 59 additions and 29 deletions

View File

@ -27,7 +27,7 @@ INCLUDE(CMakeDependentOption)
STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC) STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC)
SET(${PROJECT_NAME_UC}_MAJOR_VERSION 9) SET(${PROJECT_NAME_UC}_MAJOR_VERSION 9)
SET(${PROJECT_NAME_UC}_MINOR_VERSION 4) SET(${PROJECT_NAME_UC}_MINOR_VERSION 5)
SET(${PROJECT_NAME_UC}_PATCH_VERSION 0) SET(${PROJECT_NAME_UC}_PATCH_VERSION 0)
SET(${PROJECT_NAME_UC}_VERSION SET(${PROJECT_NAME_UC}_VERSION
${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION}) ${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION})

View File

@ -1402,9 +1402,11 @@ void SMESHGUI_GroupDlg::onObjectSelectionChanged()
SALOME_ListIteratorOfListIO anIt (aList); SALOME_ListIteratorOfListIO anIt (aList);
for (; anIt.More(); anIt.Next()) for (; anIt.More(); anIt.Next())
{ {
aGeomGroup = GEOMBase::ConvertIOinGEOMObject(anIt.Value()); CORBA::Object_var aGroupObj = SMESH::IObjectToObject(anIt.Value());
if (CORBA::is_nil(aGroupObj))
continue;
// Check if the object is a geometry group // Check if the object is a geometry group
aGeomGroup = GEOM::GEOM_Object::_narrow(aGroupObj);
if (CORBA::is_nil(aGeomGroup)) if (CORBA::is_nil(aGeomGroup))
continue; continue;

View File

@ -43,8 +43,6 @@
#include <SalomeApp_Application.h> #include <SalomeApp_Application.h>
#include <LightApp_VTKSelector.h> #include <LightApp_VTKSelector.h>
#include <SVTK_ViewWindow.h> #include <SVTK_ViewWindow.h>
#include <LightApp_SelectionMgr.h>
#include <LightApp_DataOwner.h>
// IDL includes // IDL includes
#include <SALOMEconfig.h> #include <SALOMEconfig.h>
@ -79,8 +77,6 @@ void SMESHGUI_Selection::init( const QString& client, LightApp_SelectionMgr* mgr
if( mgr ) if( mgr )
{ {
myOwners.clear();
mgr->selected(myOwners, client);
for( int i=0, n=count(); i<n; i++ ) { for( int i=0, n=count(); i<n; i++ ) {
myTypes.append( typeName( type( entry( i ) ) ) ); myTypes.append( typeName( type( entry( i ) ) ) );
myControls.append( controlMode( i ) ); myControls.append( controlMode( i ) );
@ -659,15 +655,15 @@ bool SMESHGUI_Selection::hasGeomReference( int ind ) const
bool SMESHGUI_Selection::canBreakLink( int ind ) const bool SMESHGUI_Selection::canBreakLink( int ind ) const
{ {
if ( ind >= 0 && ind < myTypes.count()) { if ( ind >= 0 && isReference(ind) ) {
if (isReference(ind)) { QString aEntry = objectInfo(ind, OI_RefEntry).toString();
SUIT_DataOwner* aOwn = myOwners.at(ind); if (!aEntry.isEmpty()) {
LightApp_DataOwner* sowner = dynamic_cast<LightApp_DataOwner*>(aOwn); _PTR(SObject) aSObject = SMESH::getStudy()->FindObjectID( aEntry.toStdString());
QString aEntry = sowner->entry(); if (aSObject) {
_PTR(SObject) aSObject = SMESH::getStudy()->FindObjectID(aEntry.toStdString());
_PTR(SObject) aFatherObj = aSObject->GetFather(); _PTR(SObject) aFatherObj = aSObject->GetFather();
if (aFatherObj) {
_PTR(SComponent) aComponent = aFatherObj->GetFatherComponent(); _PTR(SComponent) aComponent = aFatherObj->GetFatherComponent();
if (aComponent->ComponentDataType() == "SMESH") { if (aComponent && aComponent->ComponentDataType() == "SMESH") {
QString aObjEntry = entry(ind); QString aObjEntry = entry(ind);
_PTR(SObject) aGeomSObject = SMESH::getStudy()->FindObjectID(aObjEntry.toStdString()); _PTR(SObject) aGeomSObject = SMESH::getStudy()->FindObjectID(aObjEntry.toStdString());
GEOM::GEOM_Object_var aObject = SMESH::SObjectToInterface<GEOM::GEOM_Object>(aGeomSObject); GEOM::GEOM_Object_var aObject = SMESH::SObjectToInterface<GEOM::GEOM_Object>(aGeomSObject);
@ -676,6 +672,8 @@ bool SMESHGUI_Selection::canBreakLink( int ind ) const
} }
} }
} }
}
}
return false; return false;
} }

View File

@ -32,7 +32,6 @@
// SALOME GUI includes // SALOME GUI includes
#include <LightApp_Selection.h> #include <LightApp_Selection.h>
#include <SUIT_DataOwner.h>
// SALOME KERNEL includes // SALOME KERNEL includes
#include <SALOMEDSClient_definitions.hxx> #include <SALOMEDSClient_definitions.hxx>
@ -99,7 +98,6 @@ private:
QStringList myTypes; QStringList myTypes;
QStringList myControls; QStringList myControls;
QList<SMESH_Actor*> myActors; QList<SMESH_Actor*> myActors;
SUIT_DataOwnerPtrList myOwners;
}; };
#endif // SMESHGUI_SELECTION_H #endif // SMESHGUI_SELECTION_H

View File

@ -6757,7 +6757,8 @@ TListOfListOfInt SMESH_Mesh_i::findConcurrentSubMeshes()
TDimHypList dimHypListArr[4]; // dimHyp list for each shape dimension TDimHypList dimHypListArr[4]; // dimHyp list for each shape dimension
map<int, ::SMESH_subMesh*>::iterator i_sm = _mapSubMesh.begin(); map<int, ::SMESH_subMesh*>::iterator i_sm = _mapSubMesh.begin();
for ( ; i_sm != _mapSubMesh.end(); i_sm++ ) { for ( ; i_sm != _mapSubMesh.end(); i_sm++ )
{
::SMESH_subMesh* sm = (*i_sm).second; ::SMESH_subMesh* sm = (*i_sm).second;
// shape of submesh // shape of submesh
const TopoDS_Shape& aSubMeshShape = sm->GetSubShape(); const TopoDS_Shape& aSubMeshShape = sm->GetSubShape();
@ -6767,7 +6768,8 @@ TListOfListOfInt SMESH_Mesh_i::findConcurrentSubMeshes()
// Find out dimensions where the submesh can be concurrent. // Find out dimensions where the submesh can be concurrent.
// We define the dimensions by algo of each of hypotheses in hypList // We define the dimensions by algo of each of hypotheses in hypList
list <const SMESHDS_Hypothesis*>::const_iterator hypIt = hypList.begin(); list <const SMESHDS_Hypothesis*>::const_iterator hypIt = hypList.begin();
for( ; hypIt != hypList.end(); hypIt++ ) { for( ; hypIt != hypList.end(); hypIt++ )
{
SMESH_Algo* anAlgo = 0; SMESH_Algo* anAlgo = 0;
const SMESH_Hypothesis* hyp = dynamic_cast<const SMESH_Hypothesis*>(*hypIt); const SMESH_Hypothesis* hyp = dynamic_cast<const SMESH_Hypothesis*>(*hypIt);
if ( hyp->GetType() != SMESHDS_Hypothesis::PARAM_ALGO ) if ( hyp->GetType() != SMESHDS_Hypothesis::PARAM_ALGO )

View File

@ -2636,7 +2636,15 @@ class Mesh(metaclass = MeshMeta):
elif tgeo == "SOLID" or tgeo == "COMPSOLID": elif tgeo == "SOLID" or tgeo == "COMPSOLID":
typ = VOLUME typ = VOLUME
elif tgeo == "COMPOUND": elif tgeo == "COMPOUND":
try:
sub = self.geompyD.SubShapeAll( shape, self.geompyD.ShapeType["SHAPE"]) sub = self.geompyD.SubShapeAll( shape, self.geompyD.ShapeType["SHAPE"])
except:
# try to get the SHAPERSTUDY engine directly, because GetGen does not work because of
# simplification of access in geomBuilder: omniORB.registerObjref
from SHAPERSTUDY_utils import getEngine
gen = getEngine()
if gen:
sub = gen.GetIShapesOperations().ExtractSubShapes(shape, self.geompyD.ShapeType["SHAPE"], False)
if not sub: if not sub:
raise ValueError("_groupTypeFromShape(): empty geometric group or compound '%s'" % GetName(shape)) raise ValueError("_groupTypeFromShape(): empty geometric group or compound '%s'" % GetName(shape))
return self._groupTypeFromShape( sub[0] ) return self._groupTypeFromShape( sub[0] )

View File

@ -340,9 +340,20 @@ class Mesh_Algorithm:
if faces and isinstance( faces[0], geomBuilder.GEOM._objref_GEOM_Object ): if faces and isinstance( faces[0], geomBuilder.GEOM._objref_GEOM_Object ):
faceIDs = [] faceIDs = []
for shape in faces: for shape in faces:
try:
ff = self.mesh.geompyD.SubShapeAll( shape, self.mesh.geompyD.ShapeType["FACE"] ) ff = self.mesh.geompyD.SubShapeAll( shape, self.mesh.geompyD.ShapeType["FACE"] )
for f in ff: for f in ff:
faceIDs.append( self.mesh.geompyD.GetSubShapeID(self.mesh.geom, f)) faceIDs.append( self.mesh.geompyD.GetSubShapeID(self.mesh.geom, f))
except:
# try to get the SHAPERSTUDY engine directly, because GetGen does not work because of
# simplification of access in geomBuilder: omniORB.registerObjref
from SHAPERSTUDY_utils import getEngine
gen = getEngine()
if gen:
aShapeOp = gen.GetIShapesOperations()
ff = aShapeOp.ExtractSubShapes( shape, self.mesh.geompyD.ShapeType["FACE"], False)
for f in ff:
faceIDs.append( aShapeOp.GetSubShapeIndex( self.mesh.geom, f ))
faces = faceIDs faces = faceIDs
hyp = self.Hypothesis("ViscousLayers", hyp = self.Hypothesis("ViscousLayers",
[thickness, numberOfLayers, stretchFactor, faces, isFacesToIgnore], [thickness, numberOfLayers, stretchFactor, faces, isFacesToIgnore],
@ -392,9 +403,20 @@ class Mesh_Algorithm:
if edges and isinstance( edges[0], geomBuilder.GEOM._objref_GEOM_Object ): if edges and isinstance( edges[0], geomBuilder.GEOM._objref_GEOM_Object ):
edgeIDs = [] edgeIDs = []
for shape in edges: for shape in edges:
try:
ee = self.mesh.geompyD.SubShapeAll( shape, self.mesh.geompyD.ShapeType["EDGE"]) ee = self.mesh.geompyD.SubShapeAll( shape, self.mesh.geompyD.ShapeType["EDGE"])
for e in ee: for e in ee:
edgeIDs.append( self.mesh.geompyD.GetSubShapeID( self.mesh.geom, e )) edgeIDs.append( self.mesh.geompyD.GetSubShapeID( self.mesh.geom, e ))
except:
# try to get the SHAPERSTUDY engine directly, because GetGen does not work because of
# simplification of access in geomBuilder: omniORB.registerObjref
from SHAPERSTUDY_utils import getEngine
gen = getEngine()
if gen:
aShapeOp = gen.GetIShapesOperations()
ee = aShapeOp.ExtractSubShapes( shape, self.mesh.geompyD.ShapeType["EDGE"], False)
for e in ee:
edgeIDs.append( aShapeOp.GetSubShapeIndex( self.mesh.geom, e ))
edges = edgeIDs edges = edgeIDs
hyp = self.Hypothesis("ViscousLayers2D", hyp = self.Hypothesis("ViscousLayers2D",
[thickness, numberOfLayers, stretchFactor, edges, isEdgesToIgnore], [thickness, numberOfLayers, stretchFactor, edges, isEdgesToIgnore],