mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-15 12:40:37 +05:00
Bug 0016155: EDF PAL 447: If the shape is a Shell, disable 3D tab.
This commit is contained in:
parent
65d1c98391
commit
49922d93e3
@ -498,6 +498,11 @@ bool SMESH_subMesh::CanAddHypothesis(const SMESH_Hypothesis* theHypothesis) cons
|
|||||||
{
|
{
|
||||||
int aHypDim = theHypothesis->GetDim();
|
int aHypDim = theHypothesis->GetDim();
|
||||||
int aShapeDim = SMESH_Gen::GetShapeDim(_subShape);
|
int aShapeDim = SMESH_Gen::GetShapeDim(_subShape);
|
||||||
|
if (aHypDim == 3 && aShapeDim == 3) {
|
||||||
|
// check case of open shell
|
||||||
|
if (_subShape.ShapeType() == TopAbs_SHELL && !_subShape.Closed())
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if ( aHypDim <= aShapeDim )
|
if ( aHypDim <= aShapeDim )
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
@ -61,7 +61,9 @@
|
|||||||
#include <QLineEdit>
|
#include <QLineEdit>
|
||||||
|
|
||||||
// OCCT includes
|
// OCCT includes
|
||||||
|
#include <TopoDS.hxx>
|
||||||
#include <TopoDS_Shape.hxx>
|
#include <TopoDS_Shape.hxx>
|
||||||
|
#include <TopoDS_Shell.hxx>
|
||||||
#include <TopExp_Explorer.hxx>
|
#include <TopExp_Explorer.hxx>
|
||||||
|
|
||||||
// IDL includes
|
// IDL includes
|
||||||
@ -453,18 +455,35 @@ void SMESHGUI_MeshOp::selectionDone()
|
|||||||
for (int iss = 0; iss < aSeq->length() && shapeDim < 3; iss++) {
|
for (int iss = 0; iss < aSeq->length() && shapeDim < 3; iss++) {
|
||||||
GEOM::GEOM_Object_var aGeomVar = aSeq[iss];
|
GEOM::GEOM_Object_var aGeomVar = aSeq[iss];
|
||||||
switch ( aGeomVar->GetShapeType() ) {
|
switch ( aGeomVar->GetShapeType() ) {
|
||||||
case GEOM::SOLID:
|
case GEOM::SOLID: shapeDim = 3; break;
|
||||||
case GEOM::SHELL: shapeDim = 3; break;
|
case GEOM::SHELL:
|
||||||
|
{
|
||||||
|
//shapeDim = 3; // Bug 0016155: EDF PAL 447: If the shape is a Shell, disable 3D tab
|
||||||
|
shapeDim = (shapeDim < 2) ? 2 : shapeDim;
|
||||||
|
TopoDS_Shape aShape;
|
||||||
|
if (GEOMBase::GetShape(aGeomVar, aShape)) {
|
||||||
|
if (aShape.Closed())
|
||||||
|
shapeDim = 3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
case GEOM::FACE: shapeDim = (shapeDim < 2) ? 2 : shapeDim; break;
|
case GEOM::FACE: shapeDim = (shapeDim < 2) ? 2 : shapeDim; break;
|
||||||
case GEOM::WIRE:
|
case GEOM::WIRE:
|
||||||
case GEOM::EDGE: shapeDim = (shapeDim < 1) ? 1 : shapeDim; break;
|
case GEOM::EDGE: shapeDim = (shapeDim < 1) ? 1 : shapeDim; break;
|
||||||
case GEOM::VERTEX: break;
|
case GEOM::VERTEX: break;
|
||||||
default:
|
default:
|
||||||
|
{
|
||||||
TopoDS_Shape aShape;
|
TopoDS_Shape aShape;
|
||||||
if (GEOMBase::GetShape(aGeomVar, aShape)) {
|
if (GEOMBase::GetShape(aGeomVar, aShape)) {
|
||||||
TopExp_Explorer exp (aShape, TopAbs_SHELL);
|
TopExp_Explorer exp (aShape, TopAbs_SHELL);
|
||||||
if ( exp.More() )
|
if (exp.More()) {
|
||||||
|
//shapeDim = 3; // Bug 0016155: EDF PAL 447: If the shape is a Shell, disable 3D tab
|
||||||
|
shapeDim = (shapeDim < 2) ? 2 : shapeDim;
|
||||||
|
for (; exp.More() && shapeDim == 2; exp.Next()) {
|
||||||
|
if (exp.Current().Closed())
|
||||||
shapeDim = 3;
|
shapeDim = 3;
|
||||||
|
}
|
||||||
|
}
|
||||||
else if ( exp.Init( aShape, TopAbs_FACE ), exp.More() )
|
else if ( exp.Init( aShape, TopAbs_FACE ), exp.More() )
|
||||||
shapeDim = (shapeDim < 2) ? 2 : shapeDim;
|
shapeDim = (shapeDim < 2) ? 2 : shapeDim;
|
||||||
else if ( exp.Init( aShape, TopAbs_EDGE ), exp.More() )
|
else if ( exp.Init( aShape, TopAbs_EDGE ), exp.More() )
|
||||||
@ -475,6 +494,7 @@ void SMESHGUI_MeshOp::selectionDone()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
myDlg->setMaxHypoDim( shapeDim );
|
myDlg->setMaxHypoDim( shapeDim );
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user