diff --git a/src/OBJECT/SMESH_Actor.cxx b/src/OBJECT/SMESH_Actor.cxx index 34c956b5c..f7f6a807c 100644 --- a/src/OBJECT/SMESH_Actor.cxx +++ b/src/OBJECT/SMESH_Actor.cxx @@ -26,23 +26,23 @@ // Module : SMESH #include "SMESH_ActorDef.h" + +#include "SMDS_UnstructuredGrid.hxx" #include "SMESH_ActorUtils.h" +#include "SMESH_CellLabelActor.h" +#include "SMESH_ControlsDef.hxx" #include "SMESH_DeviceActor.h" #include "SMESH_NodeLabelActor.h" -#include "SMESH_CellLabelActor.h" #include "SMESH_ObjectDef.h" -#include "SMESH_ControlsDef.hxx" -#include "SMDS_UnstructuredGrid.hxx" -#include "SMESH_ScalarBarActor.h" -#include "VTKViewer_ExtractUnstructuredGrid.h" -#include "VTKViewer_FramedTextActor.h" -#include "SALOME_InteractiveObject.hxx" #include "SMESH_SVTKActor.h" - -#include "SUIT_Session.h" -#include "SUIT_ResourceMgr.h" +#include "SMESH_ScalarBarActor.h" #include +#include +#include +#include +#include +#include #ifndef DISABLE_PLOT2DVIEWER #include @@ -117,6 +117,9 @@ SMESH_Actor* SMESH_Actor::New(TVisualObjPtr theVisualObj, SMESH_ActorDef::SMESH_ActorDef() { if(MYDEBUG) MESSAGE("SMESH_ActorDef - "<IsSelectionEnabled() ) + { + myBaseActor->SetUnstructuredGrid( NULL ); + myHighlitableActor->SetUnstructuredGrid( NULL ); + // theRenderer->AddActor(this); + // cout << "SMESH_ActorDef " << this << endl; + } theRenderer->AddActor(myBaseActor); theRenderer->AddActor(myNodeExtActor); theRenderer->AddActor(my1DExtActor); @@ -1274,7 +1284,9 @@ bool SMESH_ActorDef::Init(TVisualObjPtr theVisualObj, double* SMESH_ActorDef::GetBounds() { - return myNodeActor->GetBounds(); + if ( GetNumberOfClippingPlanes() + myPlaneCollection->GetNumberOfItems() > 0 ) + return myNodeActor->GetBounds(); + return myVisualObj->GetUnstructuredGrid()->GetPoints()->GetBounds(); } @@ -1603,97 +1615,108 @@ void SMESH_ActorDef::SetEntityMode(unsigned int theMode) myBaseActor->myGeomFilter->SetInside(myEntityMode != myEntityState); myEntityMode = theMode; - VTKViewer_ExtractUnstructuredGrid* aFilter = NULL; - aFilter = myBaseActor->GetExtractUnstructuredGrid(); - aFilter->ClearRegisteredCellsWithType(); - aFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding); + VTKViewer_ExtractUnstructuredGrid* aFilter = myBaseActor->GetExtractUnstructuredGrid(); + aFilter->ClearRegisteredCellsWithType(); VTKViewer_ExtractUnstructuredGrid* aHightFilter = myHighlitableActor->GetExtractUnstructuredGrid(); aHightFilter->ClearRegisteredCellsWithType(); - aHightFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding); - if (myEntityMode & e0DElements) { - if (MYDEBUG) MESSAGE("0D ELEMENTS"); - aFilter->RegisterCellsWithType(VTK_VERTEX); - aHightFilter->RegisterCellsWithType(VTK_VERTEX); + bool isPassAll = + (( myEntityMode & e0DElements || myVisualObj->GetNbEntities(SMDSAbs_0DElement) == 0 ) && + ( myEntityMode & eBallElem || myVisualObj->GetNbEntities(SMDSAbs_Ball) == 0 ) && + ( myEntityMode & eEdges || myVisualObj->GetNbEntities(SMDSAbs_Edge) == 0 ) && + ( myEntityMode & eFaces || myVisualObj->GetNbEntities(SMDSAbs_Face) == 0 ) && + ( myEntityMode & eVolumes || myVisualObj->GetNbEntities(SMDSAbs_Volume) == 0 )); + if ( isPassAll && myEntityMode ) + { + aFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::ePassAll); + aHightFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::ePassAll); } + else + { + aFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding); + aHightFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding); - if (myEntityMode & eBallElem) { - aFilter->RegisterCellsWithType(VTK_POLY_VERTEX); + if (myEntityMode & e0DElements) { + aFilter->RegisterCellsWithType(VTK_VERTEX); + aHightFilter->RegisterCellsWithType(VTK_VERTEX); + } + + if (myEntityMode & eBallElem) { + aFilter->RegisterCellsWithType(VTK_POLY_VERTEX); + } + + if (myEntityMode & eEdges) { + aFilter->RegisterCellsWithType(VTK_LINE); + aFilter->RegisterCellsWithType(VTK_QUADRATIC_EDGE); + + aHightFilter->RegisterCellsWithType(VTK_LINE); + aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_EDGE); + } + + if (myEntityMode & eFaces) { + aFilter->RegisterCellsWithType(VTK_TRIANGLE); + aFilter->RegisterCellsWithType(VTK_QUAD); + aFilter->RegisterCellsWithType(VTK_POLYGON); + aFilter->RegisterCellsWithType(VTK_QUADRATIC_TRIANGLE); + aFilter->RegisterCellsWithType(VTK_QUADRATIC_QUAD); + aFilter->RegisterCellsWithType(VTK_QUADRATIC_POLYGON); + aFilter->RegisterCellsWithType(VTK_BIQUADRATIC_QUAD); + aFilter->RegisterCellsWithType(VTK_BIQUADRATIC_TRIANGLE); + + aHightFilter->RegisterCellsWithType(VTK_TRIANGLE); + aHightFilter->RegisterCellsWithType(VTK_QUAD); + aHightFilter->RegisterCellsWithType(VTK_POLYGON); + aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_TRIANGLE); + aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_QUAD); + aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_POLYGON); + aHightFilter->RegisterCellsWithType(VTK_BIQUADRATIC_QUAD); + aHightFilter->RegisterCellsWithType(VTK_BIQUADRATIC_TRIANGLE); + } + + if (myEntityMode & eVolumes) { + aFilter->RegisterCellsWithType(VTK_TETRA); + aFilter->RegisterCellsWithType(VTK_VOXEL); + aFilter->RegisterCellsWithType(VTK_HEXAHEDRON); + aFilter->RegisterCellsWithType(VTK_WEDGE); + aFilter->RegisterCellsWithType(VTK_PYRAMID); + aFilter->RegisterCellsWithType(VTK_HEXAGONAL_PRISM); + aFilter->RegisterCellsWithType(VTK_QUADRATIC_TETRA); + aFilter->RegisterCellsWithType(VTK_QUADRATIC_HEXAHEDRON); + aFilter->RegisterCellsWithType(VTK_TRIQUADRATIC_HEXAHEDRON); + aFilter->RegisterCellsWithType(VTK_QUADRATIC_PYRAMID); + aFilter->RegisterCellsWithType(VTK_QUADRATIC_WEDGE); + aFilter->RegisterCellsWithType(VTK_CONVEX_POINT_SET); + aFilter->RegisterCellsWithType(VTK_POLYHEDRON); + + aHightFilter->RegisterCellsWithType(VTK_TETRA); + aHightFilter->RegisterCellsWithType(VTK_VOXEL); + aHightFilter->RegisterCellsWithType(VTK_HEXAHEDRON); + aHightFilter->RegisterCellsWithType(VTK_WEDGE); + aHightFilter->RegisterCellsWithType(VTK_PYRAMID); + aHightFilter->RegisterCellsWithType(VTK_HEXAGONAL_PRISM); + aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_TETRA); + aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_HEXAHEDRON); + aHightFilter->RegisterCellsWithType(VTK_TRIQUADRATIC_HEXAHEDRON); + aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_WEDGE); + aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_PYRAMID); + aHightFilter->RegisterCellsWithType(VTK_CONVEX_POINT_SET); + aHightFilter->RegisterCellsWithType(VTK_POLYHEDRON); + } } - - if (myEntityMode & eEdges) { - if (MYDEBUG) MESSAGE("EDGES"); - aFilter->RegisterCellsWithType(VTK_LINE); - aFilter->RegisterCellsWithType(VTK_QUADRATIC_EDGE); - - aHightFilter->RegisterCellsWithType(VTK_LINE); - aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_EDGE); - } - - if (myEntityMode & eFaces) { - if (MYDEBUG) MESSAGE("FACES"); - aFilter->RegisterCellsWithType(VTK_TRIANGLE); - aFilter->RegisterCellsWithType(VTK_QUAD); - aFilter->RegisterCellsWithType(VTK_POLYGON); - aFilter->RegisterCellsWithType(VTK_QUADRATIC_TRIANGLE); - aFilter->RegisterCellsWithType(VTK_QUADRATIC_QUAD); - aFilter->RegisterCellsWithType(VTK_QUADRATIC_POLYGON); - aFilter->RegisterCellsWithType(VTK_BIQUADRATIC_QUAD); - aFilter->RegisterCellsWithType(VTK_BIQUADRATIC_TRIANGLE); - - aHightFilter->RegisterCellsWithType(VTK_TRIANGLE); - aHightFilter->RegisterCellsWithType(VTK_QUAD); - aHightFilter->RegisterCellsWithType(VTK_POLYGON); - aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_TRIANGLE); - aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_QUAD); - aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_POLYGON); - aHightFilter->RegisterCellsWithType(VTK_BIQUADRATIC_QUAD); - aHightFilter->RegisterCellsWithType(VTK_BIQUADRATIC_TRIANGLE); - } - - if (myEntityMode & eVolumes) { - if (MYDEBUG) MESSAGE("VOLUMES"); - aFilter->RegisterCellsWithType(VTK_TETRA); - aFilter->RegisterCellsWithType(VTK_VOXEL); - aFilter->RegisterCellsWithType(VTK_HEXAHEDRON); - aFilter->RegisterCellsWithType(VTK_WEDGE); - aFilter->RegisterCellsWithType(VTK_PYRAMID); - aFilter->RegisterCellsWithType(VTK_HEXAGONAL_PRISM); - aFilter->RegisterCellsWithType(VTK_QUADRATIC_TETRA); - aFilter->RegisterCellsWithType(VTK_QUADRATIC_HEXAHEDRON); - aFilter->RegisterCellsWithType(VTK_TRIQUADRATIC_HEXAHEDRON); - aFilter->RegisterCellsWithType(VTK_QUADRATIC_PYRAMID); - aFilter->RegisterCellsWithType(VTK_QUADRATIC_WEDGE); - aFilter->RegisterCellsWithType(VTK_CONVEX_POINT_SET); - aFilter->RegisterCellsWithType(VTK_POLYHEDRON); - - aHightFilter->RegisterCellsWithType(VTK_TETRA); - aHightFilter->RegisterCellsWithType(VTK_VOXEL); - aHightFilter->RegisterCellsWithType(VTK_HEXAHEDRON); - aHightFilter->RegisterCellsWithType(VTK_WEDGE); - aHightFilter->RegisterCellsWithType(VTK_PYRAMID); - aHightFilter->RegisterCellsWithType(VTK_HEXAGONAL_PRISM); - aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_TETRA); - aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_HEXAHEDRON); - aHightFilter->RegisterCellsWithType(VTK_TRIQUADRATIC_HEXAHEDRON); - aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_WEDGE); - aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_PYRAMID); - aHightFilter->RegisterCellsWithType(VTK_CONVEX_POINT_SET); - aHightFilter->RegisterCellsWithType(VTK_POLYHEDRON); - } - aFilter->Update(); + if ( GetVisibility() ) + aFilter->Update(); if (MYDEBUG) MESSAGE(aFilter->GetOutput()->GetNumberOfCells()); SetVisibility(GetVisibility(),false); } void SMESH_ActorDef::SetRepresentation (int theMode) { - int aNbEdges = myVisualObj->GetNbEntities(SMDSAbs_Edge); - int aNbFaces = myVisualObj->GetNbEntities(SMDSAbs_Face); + int aNbEdges = myVisualObj->GetNbEntities(SMDSAbs_Edge); + int aNbFaces = myVisualObj->GetNbEntities(SMDSAbs_Face); int aNbVolumes = myVisualObj->GetNbEntities(SMDSAbs_Volume); - int aNb0Ds = myVisualObj->GetNbEntities(SMDSAbs_0DElement); - int aNbBalls = myVisualObj->GetNbEntities(SMDSAbs_Ball); + int aNb0Ds = myVisualObj->GetNbEntities(SMDSAbs_0DElement); + int aNbBalls = myVisualObj->GetNbEntities(SMDSAbs_Ball); if (theMode < 0) { myRepresentation = eSurface; @@ -1835,6 +1858,11 @@ void SMESH_ActorDef::UpdateHighlight() case SMESH_DeviceActor::eSurface: case SMESH_DeviceActor::eWireframe: { + // if ( !mySelector || !mySelector->IsSelectionEnabled() ) + // myHighlitableActor->SetUnstructuredGrid( NULL ); + // else if ( !myHighlitableActor->myExtractUnstructuredGrid->GetInput() ) + // myHighlitableActor->SetUnstructuredGrid(myVisualObj->GetUnstructuredGrid()); + if(myIsHighlighted) { myHighlitableActor->SetProperty(myHighlightProp); }else if(myIsPreselected){ @@ -1868,6 +1896,24 @@ void SMESH_ActorDef::UpdateHighlight() } } +void SMESH_ActorDef::EnableSelection( bool enable ) +{ + // selection in the Viewer enabled/disabled + if ( enable && ! myBaseActor->myExtractUnstructuredGrid->GetInput() ) + { + myBaseActor->SetUnstructuredGrid(myVisualObj->GetUnstructuredGrid()); + myHighlitableActor->SetUnstructuredGrid(myVisualObj->GetUnstructuredGrid()); + myBaseActor->myExtractUnstructuredGrid->Update(); + myHighlitableActor->myExtractUnstructuredGrid->Update(); + } + if ( !enable && myBaseActor->myExtractUnstructuredGrid->GetInput() ) + { + myBaseActor->SetUnstructuredGrid( NULL ); + myHighlitableActor->SetUnstructuredGrid( NULL ); + myBaseActor->myExtractUnstructuredGrid->Update(); + myHighlitableActor->myExtractUnstructuredGrid->Update(); + } +} void SMESH_ActorDef::highlight(bool theHighlight) { @@ -2297,6 +2343,11 @@ void SMESH_ActorDef::SetOpenGLClippingPlane() myHighlitableActor->SetPlaneCollection( myPlaneCollection ); myHighlitableActor->SetUnstructuredGrid(myVisualObj->GetUnstructuredGrid()); + if ( !mySelector || !mySelector->IsSelectionEnabled() ) + { + myBaseActor->SetUnstructuredGrid( NULL ); + myHighlitableActor->SetUnstructuredGrid( NULL ); + } my1DActor->SetPlaneCollection( myPlaneCollection ); my1DActor->SetUnstructuredGrid(myVisualObj->GetUnstructuredGrid()); diff --git a/src/OBJECT/SMESH_ActorDef.h b/src/OBJECT/SMESH_ActorDef.h index eb3654ab2..4366a98a6 100644 --- a/src/OBJECT/SMESH_ActorDef.h +++ b/src/OBJECT/SMESH_ActorDef.h @@ -95,6 +95,7 @@ class SMESH_ActorDef : public SMESH_Actor virtual void AddToRender(vtkRenderer* theRenderer); virtual void RemoveFromRender(vtkRenderer* theRenderer); + virtual void EnableSelection( bool enable ); virtual bool hasHighlight() { return true; } virtual void highlight(bool theHighlight); virtual void SetPreSelected(bool thePreselect = false); diff --git a/src/OBJECT/SMESH_DeviceActor.cxx b/src/OBJECT/SMESH_DeviceActor.cxx index f9195f19f..2d632782d 100644 --- a/src/OBJECT/SMESH_DeviceActor.cxx +++ b/src/OBJECT/SMESH_DeviceActor.cxx @@ -204,7 +204,6 @@ SMESH_DeviceActor SetUnstructuredGrid(myVisualObj->GetUnstructuredGrid()); } - void SMESH_DeviceActor ::SetImplicitFunctionUsed(bool theIsImplicitFunctionUsed) @@ -224,14 +223,14 @@ void SMESH_DeviceActor ::SetUnstructuredGrid(vtkUnstructuredGrid* theGrid) { - if(theGrid){ - //myIsShrinkable = theGrid->GetNumberOfCells() > 10; + myExtractUnstructuredGrid->SetInputData(theGrid); + + if ( theGrid ) + { myIsShrinkable = true; - myExtractUnstructuredGrid->SetInputData(theGrid); - myMergeFilter->SetGeometryConnection(myExtractUnstructuredGrid->GetOutputPort()); - + //Pass diameters of the balls if(myMapper->GetBallEnabled()) { myMergeFilter->SetScalarsConnection(myExtractUnstructuredGrid->GetOutputPort()); @@ -242,7 +241,7 @@ SMESH_DeviceActor int anId = 0; SetImplicitFunctionUsed(myIsImplicitFunctionUsed); myPassFilter[ anId + 1]->SetInputConnection( myPassFilter[ anId ]->GetOutputPort() ); - + anId++; // 1 myTransformFilter->SetInputConnection( myPassFilter[ anId ]->GetOutputPort() ); @@ -254,7 +253,7 @@ SMESH_DeviceActor myGeomFilter->SetInputConnection( myPassFilter[ anId ]->GetOutputPort() ); anId++; // 4 - myPassFilter[ anId ]->SetInputConnection( myGeomFilter->GetOutputPort() ); + myPassFilter[ anId ]->SetInputConnection( myGeomFilter->GetOutputPort() ); myPassFilter[ anId + 1 ]->SetInputConnection( myPassFilter[ anId ]->GetOutputPort() ); anId++; // 5 @@ -263,8 +262,8 @@ SMESH_DeviceActor myMapper->SetClippingPlanes( myPlaneCollection ); vtkLODActor::SetMapper( myMapper ); - Modified(); } + Modified(); } void @@ -281,6 +280,7 @@ SMESH_DeviceActor return myExtractUnstructuredGrid; } +#include "SMDS_Mesh.hxx" vtkUnstructuredGrid* SMESH_DeviceActor @@ -607,10 +607,19 @@ SMESH_DeviceActor -unsigned long int +unsigned long int SMESH_DeviceActor ::GetMTime() { + // cout << this->myExtractUnstructuredGrid + // << " " << this->Superclass::GetMTime() + // << " " << myExtractGeometry->GetMTime() + // << " " << myExtractUnstructuredGrid->GetMTime() + // << " " << myMergeFilter->GetMTime() + // << " " << myGeomFilter->GetMTime() + // << " " << myTransformFilter->GetMTime() + // << " " << myFaceOrientationFilter->GetMTime() << endl; + unsigned long mTime = this->Superclass::GetMTime(); mTime = max(mTime,myExtractGeometry->GetMTime()); mTime = max(mTime,myExtractUnstructuredGrid->GetMTime()); @@ -718,7 +727,7 @@ SMESH_DeviceActor ::UpdateFaceOrientation() { bool aShowFaceOrientation = myIsFacesOriented; - aShowFaceOrientation &= GetVisibility(); + aShowFaceOrientation &= vtkLODActor::GetVisibility(); //GetVisibility(); -- avoid calling GetUnstructuredGrid() aShowFaceOrientation &= myRepresentation == eSurface; myFaceOrientation->SetVisibility(aShowFaceOrientation); } @@ -762,8 +771,9 @@ void SMESH_DeviceActor ::SetVisibility(int theMode) { - if(!myExtractUnstructuredGrid->GetInput() || - GetUnstructuredGrid()->GetNumberOfCells()) + if(( theMode ) && + ( !myExtractUnstructuredGrid->GetInput() || + GetUnstructuredGrid()->GetNumberOfCells())) { vtkLODActor::SetVisibility(theMode); }else{ @@ -777,10 +787,12 @@ int SMESH_DeviceActor ::GetVisibility() { - if(!GetUnstructuredGrid()->GetNumberOfCells()){ + int visibi = vtkLODActor::GetVisibility(); + if(visibi && !GetUnstructuredGrid()->GetNumberOfCells()){ vtkLODActor::SetVisibility(false); + visibi = 0; } - return vtkLODActor::GetVisibility(); + return visibi; } @@ -821,7 +833,7 @@ SMESH_DeviceActor { vtkDataSet* aDataSet = myMergeFilter->GetOutput(); vtkIdType anID = myVisualObj->GetNodeVTKId(theObjID); - double* aCoord = (anID >=0) ? aDataSet->GetPoint(anID) : NULL; + double* aCoord = (anID >=0 && anID < aDataSet->GetNumberOfPoints()) ? aDataSet->GetPoint(anID) : NULL; if(MYDEBUG) MESSAGE("GetNodeCoord - theObjID = "<GetCellLinks(); + vtkCellLinks *links = myGrid->GetLinks(); for (int i=0; iGetNcells(i); @@ -4711,8 +4711,8 @@ void SMDS_Mesh::dumpGrid(string ficdump) for (int j=0; jmyCompactTime = this->myModifTime; } int SMDS_Mesh::fromVtkToSmds(int vtkid) @@ -4780,10 +4780,5 @@ unsigned long SMDS_Mesh::GetMTime() const bool SMDS_Mesh::isCompacted() { - if (this->myModifTime > this->myCompactTime) - { - this->myCompactTime = this->myModifTime; - return false; - } - return true; + return this->myCompactTime == this->myModifTime; } diff --git a/src/SMDS/SMDS_MeshNode.cxx b/src/SMDS/SMDS_MeshNode.cxx index 5499f8b7d..77858f173 100644 --- a/src/SMDS/SMDS_MeshNode.cxx +++ b/src/SMDS/SMDS_MeshNode.cxx @@ -62,16 +62,12 @@ SMDS_MeshNode::SMDS_MeshNode(int id, int meshId, int shapeId, double x, double y void SMDS_MeshNode::init(int id, int meshId, int shapeId, double x, double y, double z) { SMDS_MeshElement::init(id, meshId, shapeId); - myVtkID = id -1; + myVtkID = id - 1; assert(myVtkID >= 0); - //MESSAGE("Node " << myID << " " << myVtkID << " (" << x << ", " << y << ", " << z << ")"); - SMDS_Mesh* mesh = SMDS_Mesh::_meshList[myMeshId]; - SMDS_UnstructuredGrid * grid = mesh->getGrid(); + SMDS_UnstructuredGrid * grid = SMDS_Mesh::_meshList[myMeshId]->getGrid(); vtkPoints *points = grid->GetPoints(); points->InsertPoint(myVtkID, x, y, z); - SMDS_CellLinks *cellLinks = dynamic_cast(grid->GetCellLinks()); - assert(cellLinks); - cellLinks->ResizeForPoint( myVtkID ); + grid->GetLinks()->ResizeForPoint( myVtkID ); } SMDS_MeshNode::~SMDS_MeshNode() @@ -91,7 +87,8 @@ void SMDS_MeshNode::RemoveInverseElement(const SMDS_MeshElement * parent) //MESSAGE("RemoveInverseElement " << myID << " " << parent->GetID()); const SMDS_MeshCell* cell = dynamic_cast(parent); MYASSERT(cell); - SMDS_Mesh::_meshList[myMeshId]->getGrid()->RemoveReferenceToCell(myVtkID, cell->getVtkId()); + if ( SMDS_Mesh::_meshList[myMeshId]->getGrid()->HasLinks() ) + SMDS_Mesh::_meshList[myMeshId]->getGrid()->RemoveReferenceToCell(myVtkID, cell->getVtkId()); } //======================================================================= @@ -189,7 +186,7 @@ public: SMDS_ElemIteratorPtr SMDS_MeshNode::GetInverseElementIterator(SMDSAbs_ElementType type) const { - vtkCellLinks::Link l = SMDS_Mesh::_meshList[myMeshId]->getGrid()->GetCellLinks()->GetLink(myVtkID); + vtkCellLinks::Link l = SMDS_Mesh::_meshList[myMeshId]->getGrid()->GetLinks()->GetLink(myVtkID); return SMDS_ElemIteratorPtr(new SMDS_MeshNode_MyInvIterator(SMDS_Mesh::_meshList[myMeshId], l.cells, l.ncells, type)); } @@ -248,7 +245,7 @@ elementsIterator(SMDSAbs_ElementType type) const return SMDS_MeshElement::elementsIterator(SMDSAbs_Node); else { - vtkCellLinks::Link l = SMDS_Mesh::_meshList[myMeshId]->getGrid()->GetCellLinks()->GetLink(myVtkID); + vtkCellLinks::Link l = SMDS_Mesh::_meshList[myMeshId]->getGrid()->GetLinks()->GetLink(myVtkID); return SMDS_ElemIteratorPtr(new SMDS_MeshNode_MyIterator(SMDS_Mesh::_meshList[myMeshId], l.cells, l.ncells, type)); } } @@ -319,7 +316,7 @@ void SMDS_MeshNode::AddInverseElement(const SMDS_MeshElement* ME) const SMDS_MeshCell *cell = dynamic_cast (ME); assert(cell); SMDS_UnstructuredGrid* grid = SMDS_Mesh::_meshList[myMeshId]->getGrid(); - vtkCellLinks *Links = grid->GetCellLinks(); + vtkCellLinks *Links = grid->GetLinks(); Links->ResizeCellList(myVtkID, 1); Links->AddCellReference(cell->getVtkId(), myVtkID); } @@ -335,7 +332,7 @@ void SMDS_MeshNode::ClearInverseElements() bool SMDS_MeshNode::emptyInverseElements() { - vtkCellLinks::Link l = SMDS_Mesh::_meshList[myMeshId]->getGrid()->GetCellLinks()->GetLink(myVtkID); + vtkCellLinks::Link l = SMDS_Mesh::_meshList[myMeshId]->getGrid()->GetLinks()->GetLink(myVtkID); return (l.ncells == 0); } @@ -347,7 +344,7 @@ bool SMDS_MeshNode::emptyInverseElements() int SMDS_MeshNode::NbInverseElements(SMDSAbs_ElementType type) const { - vtkCellLinks::Link l = SMDS_Mesh::_meshList[myMeshId]->getGrid()->GetCellLinks()->GetLink(myVtkID); + vtkCellLinks::Link l = SMDS_Mesh::_meshList[myMeshId]->getGrid()->GetLinks()->GetLink(myVtkID); if ( type == SMDSAbs_All ) return l.ncells; diff --git a/src/SMDS/SMDS_UnstructuredGrid.cxx b/src/SMDS/SMDS_UnstructuredGrid.cxx index 808d809a1..1f0f79941 100644 --- a/src/SMDS/SMDS_UnstructuredGrid.cxx +++ b/src/SMDS/SMDS_UnstructuredGrid.cxx @@ -53,6 +53,51 @@ void SMDS_CellLinks::ResizeForPoint(vtkIdType vtkID) } } +void SMDS_CellLinks::BuildLinks(vtkDataSet *data, vtkCellArray *Connectivity, vtkUnsignedCharArray* types) +{ + // build links taking into account removed cells + + vtkIdType numPts = data->GetNumberOfPoints(); + vtkIdType j, cellId = 0; + unsigned short *linkLoc; + vtkIdType npts=0; + vtkIdType *pts=0; + vtkIdType loc = Connectivity->GetTraversalLocation(); + + // traverse data to determine number of uses of each point + cellId = 0; + for (Connectivity->InitTraversal(); + Connectivity->GetNextCell(npts,pts); cellId++) + { + if ( types->GetValue( cellId ) != VTK_EMPTY_CELL ) + for (j=0; j < npts; j++) + { + this->IncrementLinkCount(pts[j]); + } + } + + // now allocate storage for the links + this->AllocateLinks(numPts); + this->MaxId = numPts - 1; + + // fill out lists with references to cells + linkLoc = new unsigned short[numPts]; + memset(linkLoc, 0, numPts*sizeof(unsigned short)); + + cellId = 0; + for (Connectivity->InitTraversal(); + Connectivity->GetNextCell(npts,pts); cellId++) + { + if ( types->GetValue( cellId ) != VTK_EMPTY_CELL ) + for (j=0; j < npts; j++) + { + this->InsertCellReference(pts[j], (linkLoc[pts[j]])++, cellId); + } + } + delete [] linkLoc; + Connectivity->SetTraversalLocation(loc); +} + SMDS_CellLinks::SMDS_CellLinks() : vtkCellLinks() { @@ -149,6 +194,8 @@ void SMDS_UnstructuredGrid::compactGrid(std::vector& idNodesOldToNew, int n //MESSAGE("------------------------- compactGrid " << newNodeSize << " " << newCellSize);//CHRONO(1); int alreadyCopied = 0; + this->DeleteLinks(); + // --- if newNodeSize, create a new compacted vtkPoints vtkPoints *newPoints = vtkPoints::New(); @@ -187,6 +234,12 @@ void SMDS_UnstructuredGrid::compactGrid(std::vector& idNodesOldToNew, int n int oldCellSize = this->Types->GetNumberOfTuples(); + if ( oldCellSize == newCellSize ) + { + for ( int i = 0; i < oldCellSize; ++i ) + idCellsOldToNew[i] = i; + return; + } vtkCellArray *newConnectivity = vtkCellArray::New(); newConnectivity->Initialize(); int oldCellDataSize = this->Connectivity->GetData()->GetSize(); @@ -287,7 +340,6 @@ void SMDS_UnstructuredGrid::compactGrid(std::vector& idNodesOldToNew, int n newTypes->Delete(); newLocations->Delete(); newConnectivity->Delete(); - this->BuildLinks(); } void SMDS_UnstructuredGrid::copyNodes(vtkPoints * newPoints, @@ -975,17 +1027,34 @@ void SMDS_UnstructuredGrid::BuildLinks() { // Remove the old links if they are already built if (this->Links) - { + { this->Links->UnRegister(this); - } + } - this->Links = SMDS_CellLinks::New(); + SMDS_CellLinks* links; + this->Links = links = SMDS_CellLinks::New(); this->Links->Allocate(this->GetNumberOfPoints()); this->Links->Register(this); - this->Links->BuildLinks(this, this->Connectivity); + links->BuildLinks(this, this->Connectivity,this->GetCellTypesArray() ); this->Links->Delete(); } +void SMDS_UnstructuredGrid::DeleteLinks() +{ + // Remove the old links if they are already built + if (this->Links) + { + this->Links->UnRegister(this); + this->Links = NULL; + } +} +SMDS_CellLinks* SMDS_UnstructuredGrid::GetLinks() +{ + if ( !this->Links ) + BuildLinks(); + return static_cast< SMDS_CellLinks* >( this->Links ); +} + /*! Create a volume (prism or hexahedron) by duplication of a face. * Designed for use in creation of flat elements separating volume domains. * A face separating two domains is shared by two volume cells. diff --git a/src/SMDS/SMDS_UnstructuredGrid.hxx b/src/SMDS/SMDS_UnstructuredGrid.hxx index f2ad6bd57..d34095d9a 100644 --- a/src/SMDS/SMDS_UnstructuredGrid.hxx +++ b/src/SMDS/SMDS_UnstructuredGrid.hxx @@ -54,6 +54,7 @@ class SMDS_EXPORT SMDS_CellLinks: public vtkCellLinks { public: void ResizeForPoint(vtkIdType vtkID); + void BuildLinks(vtkDataSet *data, vtkCellArray *Connectivity, vtkUnsignedCharArray* types); static SMDS_CellLinks* New(); protected: SMDS_CellLinks(); @@ -88,15 +89,15 @@ public: void GetNodeIds(std::set& nodeSet, int downId, unsigned char downType); void ModifyCellNodes(int vtkVolId, std::map localClonedNodeIds); int getOrderedNodesOfFace(int vtkVolId, int& dim, std::vector& orderedNodes); - void BuildLinks(); SMDS_MeshCell* extrudeVolumeFromFace(int vtkVolId, int domain1, int domain2, std::set& originalNodes, std::map >& nodeDomains, std::map >& nodeQuadDomains); - vtkCellLinks* GetLinks() - { - return Links; - } + void BuildLinks(); + void DeleteLinks(); + SMDS_CellLinks* GetLinks(); + bool HasLinks() const { return this->Links; } + SMDS_Downward* getDownArray(unsigned char vtkType) { return _downArray[vtkType]; diff --git a/src/SMESH/SMESH_Gen.cxx b/src/SMESH/SMESH_Gen.cxx index 9eadd2d60..504089aea 100644 --- a/src/SMESH/SMESH_Gen.cxx +++ b/src/SMESH/SMESH_Gen.cxx @@ -123,13 +123,16 @@ SMESH_Mesh* SMESH_Gen::CreateMesh(int theStudyId, bool theIsEmbeddedMode) bool SMESH_Gen::Compute(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape, - const bool aShapeOnly /*=false*/, - const bool anUpward /*=false*/, + const int aFlags /*= COMPACT_MESH*/, const ::MeshDimension aDim /*=::MeshDim_3D*/, TSetOfInt* aShapesId /*=0*/) { MEMOSTAT; + const bool aShapeOnly = aFlags & SHAPE_ONLY; + const bool anUpward = aFlags & UPWARD; + const bool aCompactMesh = aFlags & COMPACT_MESH; + bool ret = true; SMESH_subMesh *sm = aMesh.GetSubMesh(aShape); @@ -141,7 +144,7 @@ bool SMESH_Gen::Compute(SMESH_Mesh & aMesh, SMESH_subMeshIteratorPtr smIt; // Fix of Issue 22150. Due to !BLSURF->OnlyUnaryInput(), BLSURF computes edges - // that must be computed by Projection 1D-2D when Projection asks to compute + // that must be computed by Projection 1D-2D while the Projection asks to compute // one face only. SMESH_subMesh::compute_event computeEvent = aShapeOnly ? SMESH_subMesh::COMPUTE_SUBMESH : SMESH_subMesh::COMPUTE; @@ -331,7 +334,7 @@ bool SMESH_Gen::Compute(SMESH_Mesh & aMesh, SMESH_Hypothesis::Hypothesis_Status status; if ( subAlgo->CheckHypothesis( aMesh, aSubShape, status )) // mesh a lower smToCompute starting from vertices - Compute( aMesh, aSubShape, true, /*anUpward=*/true, aDim, aShapesId ); + Compute( aMesh, aSubShape, aFlags | SHAPE_ONLY_UPWARD, aDim, aShapesId ); // Compute( aMesh, aSubShape, aShapeOnly, /*anUpward=*/true, aDim, aShapesId ); } } @@ -363,17 +366,17 @@ bool SMESH_Gen::Compute(SMESH_Mesh & aMesh, // ----------------------------------------------- // mesh the rest sub-shapes starting from vertices // ----------------------------------------------- - ret = Compute( aMesh, aShape, aShapeOnly, /*anUpward=*/true, aDim, aShapesId ); + ret = Compute( aMesh, aShape, aFlags | UPWARD, aDim, aShapesId ); } MEMOSTAT; - SMESHDS_Mesh *myMesh = aMesh.GetMeshDS(); - //MESSAGE("*** compactMesh after compute"); - myMesh->compactMesh(); + if ( aCompactMesh ) + aMesh.GetMeshDS()->compactMesh(); // fix quadratic mesh by bending iternal links near concave boundary - if ( aShape.IsSame( aMesh.GetShapeToMesh() ) && + if ( aCompactMesh && // a final compute + aShape.IsSame( aMesh.GetShapeToMesh() ) && !aShapesId && // not preview ret ) // everything is OK { diff --git a/src/SMESH/SMESH_Gen.hxx b/src/SMESH/SMESH_Gen.hxx index e047be38f..eb6934595 100644 --- a/src/SMESH/SMESH_Gen.hxx +++ b/src/SMESH/SMESH_Gen.hxx @@ -69,19 +69,25 @@ public: SMESH_Mesh* CreateMesh(int theStudyId, bool theIsEmbeddedMode) throw(SALOME_Exception); + enum ComputeFlags + { + SHAPE_ONLY = 1, // to ignore algo->OnlyUnaryInput() feature and to compute a given shape only. + UPWARD = 2, // to compute from vertices up to more complex shape (internal usage) + COMPACT_MESH = 4, // to compact the mesh at the end + SHAPE_ONLY_UPWARD = 3 // SHAPE_ONLY | UPWARD + }; /*! * \brief Computes aMesh on aShape - * \param aShapeOnly - if true, algo->OnlyUnaryInput() feature is ignored and - * only \a aShape is computed. - * \param anUpward - compute from vertices up to more complex shape (internal usage) - * \param aDim - upper level dimension of the mesh computation + * \param aMesh - the mesh. + * \param aShape - the shape. + * \param aFlags - ComputeFlags. By default compute the whole mesh and compact at the end. + * \param aDim - upper level dimension of the mesh computation (for preview) * \param aShapesId - list of shapes with computed mesh entities (elements or nodes) - * \retval bool - true if none submesh failed to compute + * \retval bool - true if none sub-mesh failed to compute */ bool Compute(::SMESH_Mesh & aMesh, const TopoDS_Shape & aShape, - const bool aShapeOnly=false, - const bool anUpward=false, + const int aFlags = COMPACT_MESH, const ::MeshDimension aDim=::MeshDim_3D, TSetOfInt* aShapesId=0); diff --git a/src/SMESH/SMESH_MeshEditor.cxx b/src/SMESH/SMESH_MeshEditor.cxx index faeeefc01..056da7050 100644 --- a/src/SMESH/SMESH_MeshEditor.cxx +++ b/src/SMESH/SMESH_MeshEditor.cxx @@ -11650,7 +11650,7 @@ bool SMESH_MeshEditor::DoubleNodesOnGroupBoundaries( const std::vectorCleanDownWardConnectivity(); // Mesh has been modified, downward connectivity is no more usable, free memory - grid->BuildLinks(); + grid->DeleteLinks(); CHRONOSTOP(50); counters::stats(); diff --git a/src/SMESHDS/SMESHDS_Mesh.cxx b/src/SMESHDS/SMESHDS_Mesh.cxx index b0df38a21..ad235f0b8 100644 --- a/src/SMESHDS/SMESHDS_Mesh.cxx +++ b/src/SMESHDS/SMESHDS_Mesh.cxx @@ -2145,10 +2145,13 @@ SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1, void SMESHDS_Mesh::compactMesh() { + if ( isCompacted() ) + return; + SMDS_Mesh::compactMesh(); + int newNodeSize = 0; int nbNodes = myNodes.size(); int nbVtkNodes = myGrid->GetNumberOfPoints(); - //MESSAGE("nbNodes=" << nbNodes << " nbVtkNodes=" << nbVtkNodes); int nbNodeTemp = nbVtkNodes; if (nbNodes > nbVtkNodes) nbNodeTemp = nbNodes; @@ -2166,13 +2169,11 @@ void SMESHDS_Mesh::compactMesh() } } bool areNodesModified = (newNodeSize < nbVtkNodes); - //MESSAGE("------------------------- compactMesh Nodes Modified: " << areNodesModified); areNodesModified = true; int newCellSize = 0; int nbCells = myCells.size(); int nbVtkCells = myGrid->GetNumberOfCells(); - //MESSAGE("nbCells=" << nbCells << " nbVtkCells=" << nbVtkCells); int nbCellTemp = nbVtkCells; if (nbCells > nbVtkCells) nbCellTemp = nbCells; @@ -2184,9 +2185,6 @@ void SMESHDS_Mesh::compactMesh() { if (myCells[i]) { - // //idCellsOldToNew[i] = myCellIdVtkToSmds[i]; // valid vtk indexes are > = 0 - // int vtkid = myCells[i]->getVtkId(); - // idCellsOldToNew[vtkid] = i; // old vtkId --> old smdsId (not used in input) newCellSize++; } } @@ -2212,7 +2210,6 @@ void SMESHDS_Mesh::compactMesh() if (areNodesModified) { - //MESSAGE("-------------- modify myNodes"); SetOfNodes newNodes; newNodes.resize(newNodeSize+1,0); // 0 not used, SMDS numbers 1..n int newSmdsId = 0; @@ -2223,16 +2220,13 @@ void SMESHDS_Mesh::compactMesh() newSmdsId++; // SMDS id start to 1 int oldVtkId = myNodes[i]->getVtkId(); int newVtkId = idNodesOldToNew[oldVtkId]; - //MESSAGE("myNodes["<< i << "] vtkId " << oldVtkId << " --> " << newVtkId); myNodes[i]->setVtkId(newVtkId); myNodes[i]->setId(newSmdsId); newNodes[newSmdsId] = myNodes[i]; - //MESSAGE("myNodes["<< i << "] --> newNodes[" << newSmdsId << "]"); } } myNodes.swap(newNodes); this->myNodeIDFactory->emptyPool(newSmdsId); // newSmdsId = number of nodes - //MESSAGE("myNodes.size " << myNodes.size()); } // --- SMDS_MeshCell, myCellIdVtkToSmds, myCellIdSmdsToVtk, myCells @@ -2247,21 +2241,15 @@ void SMESHDS_Mesh::compactMesh() int newVtkId = idCellsOldToNew[oldVtkId]; if (newVtkId > maxVtkId) maxVtkId = newVtkId; - //MESSAGE("myCells["<< oldSmdsId << "] vtkId " << oldVtkId << " --> " << newVtkId); myCells[oldSmdsId]->setVtkId(newVtkId); } } - // MESSAGE("myCells.size()=" << myCells.size() - // << " myCellIdSmdsToVtk.size()=" << myCellIdSmdsToVtk.size() - // << " myCellIdVtkToSmds.size()=" << myCellIdVtkToSmds.size() ); SetOfCells newCells; - //vector newSmdsToVtk; vector newVtkToSmds; assert(maxVtkId < newCellSize); newCells.resize(newCellSize+1, 0); // 0 not used, SMDS numbers 1..n - //newSmdsToVtk.resize(newCellSize+1, -1); newVtkToSmds.resize(newCellSize+1, -1); int myCellsSize = myCells.size(); @@ -2274,18 +2262,14 @@ void SMESHDS_Mesh::compactMesh() assert(newSmdsId <= newCellSize); newCells[newSmdsId] = myCells[i]; newCells[newSmdsId]->setId(newSmdsId); - //MESSAGE("myCells["<< i << "] --> newCells[" << newSmdsId << "]"); int idvtk = myCells[i]->getVtkId(); - //newSmdsToVtk[newSmdsId] = idvtk; assert(idvtk < newCellSize); newVtkToSmds[idvtk] = newSmdsId; } } myCells.swap(newCells); - //myCellIdSmdsToVtk.swap(newSmdsToVtk); myCellIdVtkToSmds.swap(newVtkToSmds); - //MESSAGE("myCells.size()="<< myCells.size()<<" myCellIdVtkToSmds.size()="<myElementIDFactory->emptyPool(newSmdsId); this->myScript->SetModified(true); // notify GUI client for buildPrs when update diff --git a/src/SMESHGUI/SMESHGUI_Hypotheses.cxx b/src/SMESHGUI/SMESHGUI_Hypotheses.cxx index 07757c909..b1f0e20fa 100644 --- a/src/SMESHGUI/SMESHGUI_Hypotheses.cxx +++ b/src/SMESHGUI/SMESHGUI_Hypotheses.cxx @@ -316,10 +316,10 @@ void SMESHGUI_GenericHypothesisCreator::onDialogFinished( int result ) aMesh = aSubMesh->GetFather(); _PTR(SObject) meshSO = SMESH::FindSObject( aMesh ); SMESH::ModifiedMesh( meshSO, false, aMesh->NbNodes()==0); - SMESH_Actor* actor = SMESH::FindActorByEntry( meshSO->GetID().c_str() ); - if( actor ) { - actor->Update(); - } + SMESH_Actor* actor = SMESH::FindActorByEntry( meshSO->GetID().c_str() ); + if( actor ) { + actor->Update(); + } } } SMESHGUI::GetSMESHGUI()->updateObjBrowser( true, 0 ); diff --git a/src/SMESHGUI/SMESHGUI_MeshInfo.cxx b/src/SMESHGUI/SMESHGUI_MeshInfo.cxx index 4d7f87a98..db07868ad 100644 --- a/src/SMESHGUI/SMESHGUI_MeshInfo.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshInfo.cxx @@ -2919,33 +2919,40 @@ SMESHGUI_MeshInfoDlg::~SMESHGUI_MeshInfoDlg() */ void SMESHGUI_MeshInfoDlg::showInfo( const Handle(SALOME_InteractiveObject)& IO ) { + if ( !IO.IsNull() ) + myIO = IO; + SMESH::SMESH_IDSource_var obj = SMESH::IObjectToInterface( IO ); - if ( !CORBA::is_nil( obj ) ) { + if ( !CORBA::is_nil( obj ) ) + { myAddInfo->showInfo( obj ); // nb of nodes in a group can be computed by myAddInfo, myBaseInfo->showInfo( obj ); // and it will be used by myBaseInfo (IPAL52871) - myCtrlInfo->showInfo( obj ); + if ( myTabWidget->currentIndex() == CtrlInfo ) + myCtrlInfo->showInfo( obj ); - myActor = SMESH::FindActorByEntry( IO->getEntry() ); - SVTK_Selector* selector = SMESH::GetSelector(); - QString ID; - int nb = 0; - if ( myActor && selector ) { - nb = myMode->checkedId() == NodeMode ? - SMESH::GetNameOfSelectedElements( selector, IO, ID ) : - SMESH::GetNameOfSelectedNodes( selector, IO, ID ); - } - myElemInfo->setSource( myActor ) ; - if ( nb > 0 ) { - myID->setText( ID.trimmed() ); - QSet ids; - QStringList idTxt = ID.split( " ", QString::SkipEmptyParts ); - foreach ( ID, idTxt ) - ids << ID.trimmed().toLong(); - myElemInfo->showInfo( ids, myMode->checkedId() == ElemMode ); - } - else { - myID->clear(); - myElemInfo->clear(); + { + myActor = SMESH::FindActorByEntry( IO->getEntry() ); + SVTK_Selector* selector = SMESH::GetSelector(); + QString ID; + int nb = 0; + if ( myActor && selector ) { + nb = myMode->checkedId() == NodeMode ? + SMESH::GetNameOfSelectedElements( selector, IO, ID ) : + SMESH::GetNameOfSelectedNodes( selector, IO, ID ); + } + myElemInfo->setSource( myActor ) ; + if ( nb > 0 ) { + myID->setText( ID.trimmed() ); + QSet ids; + QStringList idTxt = ID.split( " ", QString::SkipEmptyParts ); + foreach ( ID, idTxt ) + ids << ID.trimmed().toLong(); + myElemInfo->showInfo( ids, myMode->checkedId() == ElemMode ); + } + else { + myID->clear(); + myElemInfo->clear(); + } } } } @@ -3049,11 +3056,9 @@ void SMESHGUI_MeshInfoDlg::updateInfo() Handle(SALOME_InteractiveObject) IO = selected.First(); showInfo( IO ); } -// else { -// myBaseInfo->clear(); -// myElemInfo->clear(); -// myAddInfo->clear(); -// } + else { + showInfo( myIO ); + } } /*! diff --git a/src/SMESHGUI/SMESHGUI_MeshInfo.h b/src/SMESHGUI/SMESHGUI_MeshInfo.h index dd1af5c02..2edf2e58a 100644 --- a/src/SMESHGUI/SMESHGUI_MeshInfo.h +++ b/src/SMESHGUI/SMESHGUI_MeshInfo.h @@ -395,6 +395,7 @@ private: SMESHGUI_AddInfo* myAddInfo; SMESHGUI_CtrlInfo* myCtrlInfo; SMESH_Actor* myActor; + Handle(SALOME_InteractiveObject) myIO; }; class SMESHGUI_EXPORT SMESHGUI_CtrlInfoDlg : public QDialog diff --git a/src/SMESH_I/SMESH_Gen_i.cxx b/src/SMESH_I/SMESH_Gen_i.cxx index 983a3173b..8c44cfdd9 100644 --- a/src/SMESH_I/SMESH_Gen_i.cxx +++ b/src/SMESH_I/SMESH_Gen_i.cxx @@ -2001,7 +2001,7 @@ SMESH::MeshPreviewStruct* SMESH_Gen_i::Precompute( SMESH::SMESH_Mesh_ptr theMesh ::SMESH_Mesh& myLocMesh = meshServant->GetImpl(); TSetOfInt shapeIds; ::MeshDimension aDim = (MeshDimension)theDimension; - if ( myGen.Compute( myLocMesh, myLocShape, false, false, aDim, &shapeIds ) ) + if ( myGen.Compute( myLocMesh, myLocShape, ::SMESH_Gen::COMPACT_MESH, aDim, &shapeIds ) ) { int nbShapeId = shapeIds.size(); theShapesId.length( nbShapeId ); diff --git a/src/SMESH_I/SMESH_MeshEditor_i.cxx b/src/SMESH_I/SMESH_MeshEditor_i.cxx index a99acd2f6..a0c252bd3 100644 --- a/src/SMESH_I/SMESH_MeshEditor_i.cxx +++ b/src/SMESH_I/SMESH_MeshEditor_i.cxx @@ -2952,8 +2952,9 @@ SMESH_MeshEditor_i::ExtrusionAlongPathObjects(const SMESH::ListOfIDSources & the } if ( !myIsPreviewMode ) { - aPythonDump << "(" << aGroups << ", error) = " - << this << ".ExtrusionAlongPathObjects( " + if ( aGroups->length() > 0 ) aPythonDump << "(" << aGroups << ", error) = "; + else aPythonDump << "(_noGroups, error) = "; + aPythonDump << this << ".ExtrusionAlongPathObjects( " << theNodes << ", " << theEdges << ", " << theFaces << ", " diff --git a/src/StdMeshers/StdMeshers_QuadFromMedialAxis_1D2D.cxx b/src/StdMeshers/StdMeshers_QuadFromMedialAxis_1D2D.cxx index 2fcf21902..76f3a31f2 100644 --- a/src/StdMeshers/StdMeshers_QuadFromMedialAxis_1D2D.cxx +++ b/src/StdMeshers/StdMeshers_QuadFromMedialAxis_1D2D.cxx @@ -383,7 +383,7 @@ namespace tmpMesh.ShapeToMesh( theEdges[i] ); try { if ( !mesh->GetGen() ) continue; // tmp mesh - mesh->GetGen()->Compute( tmpMesh, theEdges[i], true, true ); // make nodes on VERTEXes + mesh->GetGen()->Compute( tmpMesh, theEdges[i], SMESH_Gen::SHAPE_ONLY_UPWARD ); // make nodes on VERTEXes if ( !algo->Compute( tmpMesh, theEdges[i] )) continue; } @@ -868,7 +868,7 @@ namespace TmpMesh tmpMesh; tmpMesh.ShapeToMesh( branchEdge ); try { - mesh->GetGen()->Compute( tmpMesh, branchEdge, true, true ); // make nodes on VERTEXes + mesh->GetGen()->Compute( tmpMesh, branchEdge, SMESH_Gen::SHAPE_ONLY_UPWARD ); // make nodes on VERTEXes if ( !algo->Compute( tmpMesh, branchEdge )) return false; } @@ -1930,7 +1930,8 @@ namespace { if ( !theHasRadialHyp ) // use global hyps - theHelper.GetGen()->Compute( *theHelper.GetMesh(), theShortEdges[i], true, true ); + theHelper.GetGen()->Compute( *theHelper.GetMesh(), theShortEdges[i], + SMESH_Gen::SHAPE_ONLY_UPWARD ); SMESH_subMesh* sm = theHelper.GetMesh()->GetSubMesh(theShortEdges[i] ); if ( sm->IsEmpty() ) diff --git a/src/StdMeshers/StdMeshers_Regular_1D.cxx b/src/StdMeshers/StdMeshers_Regular_1D.cxx index 8f4a10547..8a8bed9c0 100644 --- a/src/StdMeshers/StdMeshers_Regular_1D.cxx +++ b/src/StdMeshers/StdMeshers_Regular_1D.cxx @@ -675,7 +675,7 @@ bool StdMeshers_Regular_1D::computeInternalParameters(SMESH_Mesh & theMesh, if ( !_mainEdge.IsNull() && _isPropagOfDistribution ) { TopoDS_Edge mainEdge = TopoDS::Edge( _mainEdge ); // should not be a reference! - _gen->Compute( theMesh, mainEdge, /*aShapeOnly=*/true, /*anUpward=*/true); + _gen->Compute( theMesh, mainEdge, SMESH_Gen::SHAPE_ONLY_UPWARD ); SMESHDS_SubMesh* smDS = theMesh.GetMeshDS()->MeshElements( mainEdge ); if ( !smDS )