STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC)
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}_VERSION
${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION})
SALOME_ListIteratorOfListIO anIt (aList);
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
+ aGeomGroup = GEOM::GEOM_Object::_narrow(aGroupObj);
if (CORBA::is_nil(aGeomGroup))
continue;
#include <SalomeApp_Application.h>
#include <LightApp_VTKSelector.h>
#include <SVTK_ViewWindow.h>
-#include <LightApp_SelectionMgr.h>
-#include <LightApp_DataOwner.h>
// IDL includes
#include <SALOMEconfig.h>
if( mgr )
{
- myOwners.clear();
- mgr->selected(myOwners, client);
for( int i=0, n=count(); i<n; i++ ) {
myTypes.append( typeName( type( entry( i ) ) ) );
myControls.append( controlMode( i ) );
bool SMESHGUI_Selection::canBreakLink( int ind ) const
{
- if ( ind >= 0 && ind < myTypes.count()) {
- if (isReference(ind)) {
- SUIT_DataOwner* aOwn = myOwners.at(ind);
- LightApp_DataOwner* sowner = dynamic_cast<LightApp_DataOwner*>(aOwn);
- QString aEntry = sowner->entry();
- _PTR(SObject) aSObject = SMESH::getStudy()->FindObjectID(aEntry.toStdString());
- _PTR(SObject) aFatherObj = aSObject->GetFather();
- _PTR(SComponent) aComponent = aFatherObj->GetFatherComponent();
- if (aComponent->ComponentDataType() == "SMESH") {
- QString aObjEntry = entry(ind);
- _PTR(SObject) aGeomSObject = SMESH::getStudy()->FindObjectID(aObjEntry.toStdString());
- GEOM::GEOM_Object_var aObject = SMESH::SObjectToInterface<GEOM::GEOM_Object>(aGeomSObject);
- if (!aObject->_is_nil())
- return aObject->IsParametrical();
+ if ( ind >= 0 && isReference(ind) ) {
+ QString aEntry = objectInfo(ind, OI_RefEntry).toString();
+ if (!aEntry.isEmpty()) {
+ _PTR(SObject) aSObject = SMESH::getStudy()->FindObjectID( aEntry.toStdString());
+ if (aSObject) {
+ _PTR(SObject) aFatherObj = aSObject->GetFather();
+ if (aFatherObj) {
+ _PTR(SComponent) aComponent = aFatherObj->GetFatherComponent();
+ if (aComponent && aComponent->ComponentDataType() == "SMESH") {
+ QString aObjEntry = entry(ind);
+ _PTR(SObject) aGeomSObject = SMESH::getStudy()->FindObjectID(aObjEntry.toStdString());
+ GEOM::GEOM_Object_var aObject = SMESH::SObjectToInterface<GEOM::GEOM_Object>(aGeomSObject);
+ if (!aObject->_is_nil())
+ return aObject->IsParametrical();
+ }
+ }
}
}
}
// SALOME GUI includes
#include <LightApp_Selection.h>
-#include <SUIT_DataOwner.h>
// SALOME KERNEL includes
#include <SALOMEDSClient_definitions.hxx>
QStringList myTypes;
QStringList myControls;
QList<SMESH_Actor*> myActors;
- SUIT_DataOwnerPtrList myOwners;
};
#endif // SMESHGUI_SELECTION_H
TDimHypList dimHypListArr[4]; // dimHyp list for each shape dimension
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;
// shape of submesh
const TopoDS_Shape& aSubMeshShape = sm->GetSubShape();
// Find out dimensions where the submesh can be concurrent.
// We define the dimensions by algo of each of hypotheses in hypList
list <const SMESHDS_Hypothesis*>::const_iterator hypIt = hypList.begin();
- for( ; hypIt != hypList.end(); hypIt++ ) {
+ for( ; hypIt != hypList.end(); hypIt++ )
+ {
SMESH_Algo* anAlgo = 0;
const SMESH_Hypothesis* hyp = dynamic_cast<const SMESH_Hypothesis*>(*hypIt);
if ( hyp->GetType() != SMESHDS_Hypothesis::PARAM_ALGO )
elif tgeo == "SOLID" or tgeo == "COMPSOLID":
typ = VOLUME
elif tgeo == "COMPOUND":
- sub = self.geompyD.SubShapeAll( shape, self.geompyD.ShapeType["SHAPE"])
+ try:
+ 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:
raise ValueError("_groupTypeFromShape(): empty geometric group or compound '%s'" % GetName(shape))
return self._groupTypeFromShape( sub[0] )
if faces and isinstance( faces[0], geomBuilder.GEOM._objref_GEOM_Object ):
faceIDs = []
for shape in faces:
- ff = self.mesh.geompyD.SubShapeAll( shape, self.mesh.geompyD.ShapeType["FACE"] )
- for f in ff:
+ try:
+ ff = self.mesh.geompyD.SubShapeAll( shape, self.mesh.geompyD.ShapeType["FACE"] )
+ for f in ff:
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
hyp = self.Hypothesis("ViscousLayers",
[thickness, numberOfLayers, stretchFactor, faces, isFacesToIgnore],
if edges and isinstance( edges[0], geomBuilder.GEOM._objref_GEOM_Object ):
edgeIDs = []
for shape in edges:
+ try:
ee = self.mesh.geompyD.SubShapeAll( shape, self.mesh.geompyD.ShapeType["EDGE"])
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
hyp = self.Hypothesis("ViscousLayers2D",
[thickness, numberOfLayers, stretchFactor, edges, isEdgesToIgnore],