Merge branch 'master' into gni/evolution

This commit is contained in:
Gérald NICOLAS 2021-09-16 08:56:58 +02:00
commit 6ca43e11b2
22 changed files with 400 additions and 342 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 54 KiB

View File

@ -30,6 +30,7 @@
#include <Utils_SALOME_Exception.hxx>
#include <Basics_Utils.hxx>
#include "SMESH_TypeDefs.hxx"
#ifndef WIN32
#include <unistd.h> // getpid()

View File

@ -659,6 +659,7 @@ namespace
bool toCreateGroups = resMgr->booleanValue( "SMESH", "auto_groups", false );
bool toOverwrite = true;
bool toFindOutDim = true;
bool saveNumbers = resMgr->booleanValue( "SMESH", "med_save_numbers", true );
bool toRenumber = true;
double zTol = resMgr->doubleValue( "SMESH", "med_ztolerance", 0. );
@ -770,7 +771,9 @@ namespace
aDefaultFilter = it.key();
}
QStringList checkBoxes;
checkBoxes << QObject::tr("SMESH_AUTO_GROUPS") << QObject::tr("SMESH_AUTO_DIM");
checkBoxes << QObject::tr("SMESH_AUTO_GROUPS")
<< QObject::tr("SMESH_AUTO_DIM")
<< QObject::tr("SMESH_MED_SAVE_NUMS");
SMESHGUI_FieldSelectorWdg* fieldSelWdg = new SMESHGUI_FieldSelectorWdg();
QList< QWidget* > wdgList;
@ -798,6 +801,7 @@ namespace
fd->selectNameFilter( aDefaultFilter );
fd->SetChecked( toCreateGroups, 0 );
fd->SetChecked( toFindOutDim, 1 );
fd->SetChecked( saveNumbers, 2 );
if ( !anInitialPath.isEmpty() )
fd->setDirectory( anInitialPath );
fd->selectFile(aMeshName);
@ -888,6 +892,7 @@ namespace
}
toCreateGroups = fd->IsChecked(0);
toFindOutDim = fd->IsChecked(1);
saveNumbers = fd->IsChecked(2);
zTol = zTolCheck->isChecked() ? zTolSpin->value() : -1;
fieldSelWdg->GetSelectedFields();
if ( resMgr ) resMgr->setValue( "SMESH", "enable_ztolerance", zTolCheck->isChecked() );
@ -927,7 +932,6 @@ namespace
// }
if ( isMED && isOkToWrite )
{
const bool saveNumbers = resMgr->booleanValue( "SMESH", "med_save_numbers", true );
aMeshIter = aMeshList.begin();
for( int aMeshIndex = 0; aMeshIter != aMeshList.end(); aMeshIter++, aMeshIndex++ )
{

View File

@ -264,13 +264,15 @@ SMESHGUI_ExtrusionAlongPathDlg::SMESHGUI_ExtrusionAlongPathDlg( SMESHGUI* theMod
myPreviewCheckBox = new QCheckBox(tr("PREVIEW"), GroupArguments);
// layouting
GroupArgumentsLayout->addWidget(SelectorWdg, 0, 0, 1, 2);
GroupArgumentsLayout->addWidget(PathGrp, 1, 0, 1, 2);
GroupArgumentsLayout->addWidget(BasePointGrp, 2, 0, 1, 2);
GroupArgumentsLayout->addWidget(AnglesGrp, 3, 0);
GroupArgumentsLayout->addWidget(ScalesGrp, 3, 1);
GroupArgumentsLayout->addWidget(myPreviewCheckBox, 4, 0);
GroupArgumentsLayout->addWidget(MakeGroupsCheck, 5, 0);
GroupArgumentsLayout->addWidget(SelectorWdg, 0, 0, 3, 2);
GroupArgumentsLayout->addWidget(PathGrp, 0, 2, 1, 2);
GroupArgumentsLayout->addWidget(BasePointGrp, 1, 2, 1, 2);
GroupArgumentsLayout->addWidget(AnglesGrp, 2, 2);
GroupArgumentsLayout->addWidget(ScalesGrp, 2, 3);
GroupArgumentsLayout->addWidget(myPreviewCheckBox, 3, 0);
GroupArgumentsLayout->addWidget(MakeGroupsCheck, 3, 1);
SelectorWdg->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
SelectorWdg->setMinimumWidth(320);
/***************************************************************/
// common buttons group box

View File

@ -766,38 +766,53 @@ SMESHGUI_ExtrusionDlg::SMESHGUI_ExtrusionDlg (SMESHGUI* theModule)
AnglesGrpLayout->setRowMinimumHeight(1, 10);
AnglesGrpLayout->setRowStretch(3, 10);
// Controls for advanced parameters
QGridLayout* AdvancedGrpLayout = new QGridLayout();
AdvancedGrpLayout->setSpacing(SPACING);
// layouting
GroupArgumentsLayout->addWidget(SelectorWdg, 0, 0, 1, 9);
GroupArgumentsLayout->addWidget(ExtrMethod_RBut0, 1, 0, 1, 3);
GroupArgumentsLayout->addWidget(ExtrMethod_RBut1, 1, 3, 1, 3);
GroupArgumentsLayout->addWidget(ExtrMethod_RBut2, 1, 6, 1, 3);
GroupArgumentsLayout->addWidget(TextLabelDistance, 2, 0);
GroupArgumentsLayout->addWidget(TextLabelDx, 2, 2);
GroupArgumentsLayout->addWidget(SpinBox_Dx, 2, 3);
GroupArgumentsLayout->addWidget(TextLabelDy, 2, 4);
GroupArgumentsLayout->addWidget(SpinBox_Dy, 2, 5);
GroupArgumentsLayout->addWidget(TextLabelDz, 2, 6);
GroupArgumentsLayout->addWidget(SpinBox_Dz, 2, 7);
GroupArgumentsLayout->addWidget(TextLabelVector, 3, 0);
GroupArgumentsLayout->addWidget(SelectVectorButton, 3, 1);
GroupArgumentsLayout->addWidget(TextLabelVx, 3, 2);
GroupArgumentsLayout->addWidget(SpinBox_Vx, 3, 3);
GroupArgumentsLayout->addWidget(TextLabelVy, 3, 4);
GroupArgumentsLayout->addWidget(SpinBox_Vy, 3, 5);
GroupArgumentsLayout->addWidget(TextLabelVz, 3, 6);
GroupArgumentsLayout->addWidget(SpinBox_Vz, 3, 7);
GroupArgumentsLayout->addWidget(TextLabelDist, 4, 0);
GroupArgumentsLayout->addWidget(SpinBox_VDist, 4, 3);
GroupArgumentsLayout->addWidget(TextLabelNbSteps, 5, 0, 1, 3);
GroupArgumentsLayout->addWidget(SpinBox_NbSteps, 5, 3);
GroupArgumentsLayout->addWidget(ByAverageNormalCheck, 6, 0, 1, 4);
GroupArgumentsLayout->addWidget(UseInputElemsOnlyCheck, 6, 4, 1, 4);
GroupArgumentsLayout->addWidget(BasePointGrp, 7, 0, 1, 9);
GroupArgumentsLayout->addWidget(ScalesGrp, 8, 0, 1, 4);
GroupArgumentsLayout->addWidget(AnglesGrp, 8, 5, 1, 4);
GroupArgumentsLayout->addWidget(myPreviewCheckBox, 9, 0, 1, 8);
GroupArgumentsLayout->addWidget(MakeGroupsCheck, 10,0, 1, 8);
GroupArgumentsLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding), 10, 0);
AdvancedGrpLayout->addWidget(TextLabelDistance, 0, 0);
AdvancedGrpLayout->addWidget(TextLabelDx, 0, 2);
AdvancedGrpLayout->addWidget(SpinBox_Dx, 0, 3);
AdvancedGrpLayout->addWidget(TextLabelDy, 0, 4);
AdvancedGrpLayout->addWidget(SpinBox_Dy, 0, 5);
AdvancedGrpLayout->addWidget(TextLabelDz, 0, 6);
AdvancedGrpLayout->addWidget(SpinBox_Dz, 0, 7);
AdvancedGrpLayout->addWidget(TextLabelVector, 1, 0);
AdvancedGrpLayout->addWidget(SelectVectorButton, 1, 1);
AdvancedGrpLayout->addWidget(TextLabelVx, 1, 2);
AdvancedGrpLayout->addWidget(SpinBox_Vx, 1, 3);
AdvancedGrpLayout->addWidget(TextLabelVy, 1, 4);
AdvancedGrpLayout->addWidget(SpinBox_Vy, 1, 5);
AdvancedGrpLayout->addWidget(TextLabelVz, 1, 6);
AdvancedGrpLayout->addWidget(SpinBox_Vz, 1, 7);
AdvancedGrpLayout->addWidget(TextLabelDist, 2, 0);
AdvancedGrpLayout->addWidget(SpinBox_VDist, 2, 3);
AdvancedGrpLayout->addWidget(TextLabelNbSteps, 3, 0, 1, 3);
AdvancedGrpLayout->addWidget(SpinBox_NbSteps, 3, 3);
AdvancedGrpLayout->addWidget(ByAverageNormalCheck, 4, 0, 1, 4);
AdvancedGrpLayout->addWidget(UseInputElemsOnlyCheck, 4, 4, 1, 4);
// Controls for advanced parameters
QGroupBox* RbGrp = new QGroupBox();
QHBoxLayout* RBLayout = new QHBoxLayout(RbGrp);
RBLayout->setSpacing(SPACING); RBLayout->setMargin(MARGIN);
RBLayout->addWidget(ExtrMethod_RBut0);
RBLayout->addWidget(ExtrMethod_RBut1);
RBLayout->addWidget(ExtrMethod_RBut2);
// layouting
GroupArgumentsLayout->addWidget(RbGrp, 0, 0, 1, 4);
GroupArgumentsLayout->addWidget(SelectorWdg, 1, 0, 3, 2);
GroupArgumentsLayout->addLayout(AdvancedGrpLayout, 1, 2, 1, 2);
GroupArgumentsLayout->addWidget(BasePointGrp, 2, 2, 1, 2);
GroupArgumentsLayout->addWidget(ScalesGrp, 3, 2, 1, 1);
GroupArgumentsLayout->addWidget(AnglesGrp, 3, 3, 1, 1);
GroupArgumentsLayout->addWidget(myPreviewCheckBox, 4, 0);
GroupArgumentsLayout->addWidget(MakeGroupsCheck, 4, 1);
GroupArgumentsLayout->setRowStretch(5, 10);
SelectorWdg->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
SelectorWdg->setMinimumWidth(320);
/***************************************************************/
GroupButtons = new QGroupBox(this);

View File

@ -42,6 +42,11 @@
#include <QString>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <TopoDS_Iterator.hxx>
namespace SMESH
{
GEOM::GEOM_Gen_var GetGEOMGen( GEOM::GEOM_Object_ptr go )
@ -244,4 +249,80 @@ namespace SMESH
}
//================================================================================
/*!
* \brief Return type of shape contained in a group
*/
//================================================================================
TopAbs_ShapeEnum _getGroupType(const TopoDS_Shape& group)
{
if ( group.ShapeType() != TopAbs_COMPOUND )
return group.ShapeType();
// iterate on a compound
TopoDS_Iterator it( group );
if ( it.More() )
return _getGroupType( it.Value() );
return TopAbs_SHAPE;
}
//================================================================================
/*!
* \brief Check if a subGeom contains sub-shapes of a mainGeom
*/
//================================================================================
bool ContainsSubShape( GEOM::GEOM_Object_ptr mainGeom,
GEOM::GEOM_Object_ptr subGeom )
{
if ( CORBA::is_nil( mainGeom ) ||
CORBA::is_nil( subGeom ))
return false;
GEOM::GEOM_Gen_var geomGen = mainGeom->GetGen();
if ( geomGen->_is_nil() ) return false;
GEOM::GEOM_IGroupOperations_wrap op = geomGen->GetIGroupOperations();
if ( op->_is_nil() ) return false;
GEOM::GEOM_Object_var mainObj = op->GetMainShape( subGeom ); /* _var not _wrap as
mainObj already exists! */
while ( !mainObj->_is_nil() )
{
CORBA::String_var entry1 = mainObj->GetEntry();
CORBA::String_var entry2 = mainGeom->GetEntry();
if ( std::string( entry1.in() ) == entry2.in() )
return true;
mainObj = op->GetMainShape( mainObj );
}
if ( subGeom->GetShapeType() == GEOM::COMPOUND )
{
// is subGeom a compound of sub-shapes?
GEOM::GEOM_IShapesOperations_wrap sop = geomGen->GetIShapesOperations();
if ( sop->_is_nil() ) return false;
GEOM::ListOfLong_var ids = sop->GetAllSubShapesIDs( subGeom,
GEOM::SHAPE,/*sorted=*/false);
if ( ids->length() > 0 )
{
GEOM_Client geomClient;
TopoDS_Shape subShape = geomClient.GetShape( geomGen, subGeom );
TopoDS_Shape mainShape = geomClient.GetShape( geomGen, mainGeom );
if ( subShape.IsNull() || mainShape.IsNull() )
return false;
TopAbs_ShapeEnum subType = _getGroupType( subShape );
TopTools_IndexedMapOfShape subMap;
TopExp::MapShapes( subShape, subType, subMap );
for ( TopExp_Explorer exp( mainShape, subType ); exp.More(); exp.Next() )
if ( subMap.Contains( exp.Current() ))
return true;
}
}
return false;
}
} // end of namespace SMESH

View File

@ -59,6 +59,9 @@ namespace SMESH
SMESHGUI_EXPORT bool GetGeomEntries( Handle(SALOME_InteractiveObject)& hypIO,
QString& subGeom, QString& meshGeom);
SMESHGUI_EXPORT bool ContainsSubShape( GEOM::GEOM_Object_ptr mainShape,
GEOM::GEOM_Object_ptr subShape );
}
#endif // SMESHGUI_GEOMGENUTILS_H

View File

@ -1405,72 +1405,23 @@ void SMESHGUI_GroupDlg::onObjectSelectionChanged()
else if (myCurrentLineEdit == myGeomGroupLine)
{
myGeomObjects = new GEOM::ListOfGO();
myGeomObjects->length( aNbSel );
// The mesh SObject
_PTR(SObject) aMeshSO = SMESH::FindSObject(myMesh);
if (aNbSel == 0 || !aMeshSO)
if ( aNbSel == 0 || myMesh->_is_nil() )
{
myGeomObjects->length(0);
updateButtons();
myIsBusy = false;
return;
}
myGeomObjects->length(aNbSel);
GEOM::GEOM_Object_var aGeomGroup;
GEOM::GEOM_Object_var mainGeom = myMesh->GetShapeToMesh();
int i = 0;
SALOME_ListIteratorOfListIO anIt (aList);
for (; anIt.More(); anIt.Next())
for ( SALOME_ListIteratorOfListIO anIt( aList ); anIt.More(); anIt.Next() )
{
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;
// Check if group constructed on the same shape as a mesh or on its child
// The main shape of the group
GEOM::GEOM_Object_var aGroupMainShape;
if (aGeomGroup->GetType() == 37)
{
GEOM::GEOM_IGroupOperations_wrap anOp =
SMESH::GetGEOMGen( aGeomGroup )->GetIGroupOperations();
aGroupMainShape = anOp->GetMainShape( aGeomGroup );
// aGroupMainShape is an existing servant => GEOM_Object_var not GEOM_Object_wrap
}
else
{
aGroupMainShape = aGeomGroup;
aGroupMainShape->Register();
}
CORBA::String_var entry = aGroupMainShape->GetStudyEntry();
_PTR(SObject) aGroupMainShapeSO =
SMESH::getStudy()->FindObjectID( entry.in() );
_PTR(SObject) anObj, aRef;
bool isRefOrSubShape = false;
if (aMeshSO->FindSubObject(1, anObj) && anObj->ReferencedObject(aRef)) {
if (aRef->GetID() == aGroupMainShapeSO->GetID()) {
isRefOrSubShape = true;
} else {
_PTR(SObject) aFather = aGroupMainShapeSO->GetFather();
_PTR(SComponent) aComponent = aGroupMainShapeSO->GetFatherComponent();
while (!isRefOrSubShape && aFather->GetID() != aComponent->GetID()) {
if (aRef->GetID() == aFather->GetID())
isRefOrSubShape = true;
else
aFather = aFather->GetFather();
}
}
}
if (isRefOrSubShape)
myGeomObjects[i++] = aGeomGroup;
GEOM::GEOM_Object_var geomGroup = SMESH::GetGeom( anIt.Value() );
if ( SMESH::ContainsSubShape( mainGeom, geomGroup ))
myGeomObjects[ i++ ] = geomGroup;
}
myGeomObjects->length(i);

View File

@ -211,9 +211,6 @@ private:
GEOM::ListOfGO_var myGeomObjects;
int mySelectionMode;
//Handle(SMESH_TypeFilter) myMeshFilter;
//Handle(SMESH_TypeFilter) mySubMeshFilter;
//Handle(SMESH_TypeFilter) myGroupFilter;
SUIT_SelectionFilter* myMeshFilter;
SMESH_LogicalFilter* mySubMeshFilter;
SMESH_LogicalFilter* myGroupFilter;

View File

@ -463,24 +463,21 @@ void SMESHGUI_GroupOnShapeOp::selectionDone()
// study
if (_PTR(Study) aStudy = SMESH::getStudy()) {
// mesh
if (_PTR(SObject) meshSO = aStudy->FindObjectID( myMeshID.toUtf8().data() )) {
if (_PTR(SObject) meshSO = aStudy->FindObjectID( myMeshID.toUtf8().data() ))
{
// shape to mesh
_PTR(SObject) anObj, shapeToMesh;
if (meshSO->FindSubObject(1, anObj) && anObj->ReferencedObject(shapeToMesh)) {
GEOM::GEOM_Object_var mainGeom = SMESH::GetGeom( meshSO );
// loop on selected
QStringList::iterator name = names.begin(), id = ids.begin(), idEnd = ids.end();
for (; id != idEnd; ++id, ++name ) {
for (; id != idEnd; ++id, ++name )
{
if ( goodIds.contains( *id ))
continue;
// shape SO
if (_PTR(SObject) shapeSO = aStudy->FindObjectID( id->toUtf8().data() )) {
// check if shape SO is a child of shape to mesh
while ( shapeSO && shapeSO->GetID() != shapeToMesh->GetID() )
if ( shapeSO->Depth() < 2 )
shapeSO.reset();
else
shapeSO = shapeSO->GetFather();
if ( shapeSO ) {
//printf( "selectionDone() %s %s\n", (*id).latin1(), (*name).latin1() );
if ( !goodIds.contains( *id )) {
_PTR(SObject) shapeSO = aStudy->FindObjectID( id->toUtf8().data() );
GEOM::GEOM_Object_var subGeom = SMESH::GetGeom( shapeSO );
if ( SMESH::ContainsSubShape( mainGeom, subGeom ))
{
goodIds.append( *id );
goodNames.append( *name );
}
@ -488,9 +485,6 @@ void SMESHGUI_GroupOnShapeOp::selectionDone()
}
}
}
}
}
}
if ( myDlg->myElemGeomBtn->isChecked() ) // elem geometry selection
{

View File

@ -58,27 +58,15 @@ protected:
virtual void startOperation();
virtual void selectionDone();
virtual SUIT_SelectionFilter* createFilter( const int ) const;
//virtual bool isValid( SUIT_Operation* ) const;
private slots:
bool onApply();
void onButtonClick();
// void onSelectColor();
private:
void init();
// void setGroupColor( const SALOMEDS::Color& );
// SALOMEDS::Color getGroupColor() const;
// void setGroupQColor( const QColor& );
// QColor getGroupQColor() const;
// void setDefaultGroupColor();
private:
@ -86,7 +74,6 @@ private:
QString myMeshID;
QStringList myElemGeoIDs, myNodeGeoIDs;
//GEOM::ListOfGO_var myElemGObj;
};
class SMESHGUI_EXPORT SMESHGUI_GroupOnShapeDlg : public SMESHGUI_Dialog
@ -104,8 +91,6 @@ public slots:
private:
//QLineEdit* myGrpNameLine;
QPushButton* myMeshBtn;
QLineEdit* myMeshLine;
@ -115,12 +100,6 @@ private:
QPushButton* myNodeGeomBtn;
QListWidget* myNodeGeomList;
// QPushButton* myColorBtn;
// bool myCreate, myIsBusy;
// QString myHelpFileName;
friend class SMESHGUI_GroupOnShapeOp;
};

View File

@ -3432,6 +3432,9 @@ SMESHGUI_CtrlInfo::SMESHGUI_CtrlInfo( QWidget* parent ): SMESHGUI_Info( parent )
QIcon aComputeIcon( SUIT_Session::session()->resourceMgr()->loadPixmap( "SMESH", tr( "ICON_COMPUTE" ) ) );
SMESH::FilterManager_var aFilterMgr = SMESH::GetFilterManager();
// QToolBox with MeshInfo
myMeshTB = new QToolBox(this);
// name
QLabel* aNameLab = createLabel( tr( "NAME_LAB" ), this, Bold );
QLabel* aName = createField( this, "ctrlName" );
@ -3548,49 +3551,81 @@ SMESHGUI_CtrlInfo::SMESHGUI_CtrlInfo( QWidget* parent ): SMESHGUI_Info( parent )
connect( myToleranceWidget, SIGNAL( valueChanged( double ) ), this, SLOT( setTolerance( double ) ) );
l->addWidget( aNameLab, 0, 0 ); //0
l->addWidget( aName, 0, 1, 1, 2 ); //1
l->addWidget( aNodesLab, 1, 0, 1, 3 ); //2
l->addWidget( aNodesFreeLab, 2, 0 ); //3
l->addWidget( aNodesFree, 2, 1 ); //4
l->addWidget( aFreeNodesBtn, 2, 2 ); //5
l->addWidget( aNodesNbConnLab, 3, 0 ); //6
l->addWidget( aNodesNbConn, 3, 1 ); //7
l->addWidget( aNodesNbConnBtn, 3, 2 ); //8
l->addWidget( aNodesDoubleLab, 4, 0 ); //9
l->addWidget( aNodesDouble, 4, 1 ); //10
l->addWidget( aDoubleNodesBtn, 4, 2 ); //11
l->addWidget( aToleranceLab, 5, 0 ); //12
l->addWidget( myToleranceWidget, 5, 1 ); //13
l->addWidget( anEdgesLab, 6, 0, 1, 3 ); //14
l->addWidget( anEdgesDoubleLab, 7, 0 ); //15
l->addWidget( anEdgesDouble, 7, 1 ); //16
l->addWidget( aDoubleEdgesBtn, 7, 2 ); //17
l->addWidget( aFacesLab, 8, 0, 1, 3 ); //18
l->addWidget( aFacesDoubleLab, 9, 0 ); //19
l->addWidget( aFacesDouble, 9, 1 ); //20
l->addWidget( aDoubleFacesBtn, 9, 2 ); //21
l->addWidget( aFacesOverLab, 10, 0 ); //22
l->addWidget( aFacesOver, 10, 1 ); //23
l->addWidget( aOverContFacesBtn, 10, 2 ); //24
l->addWidget( anAspectRatioLab, 11, 0 ); //25
l->addWidget( aComputeFaceBtn, 11, 2 ); //26
l->addWidget( myPlot, 12, 0, 1, 3 );//27
l->addWidget( aVolumesLab, 13, 0, 1, 3 );//28
l->addWidget( aVolumesDoubleLab, 14, 0 ); //29
l->addWidget( aVolumesDouble, 14, 1 ); //30
l->addWidget( aDoubleVolumesBtn, 14, 2 ); //31
l->addWidget( aVolumesOverLab, 15, 0 ); //32
l->addWidget( aVolumesOver, 15, 1 ); //33
l->addWidget( aOverContVolumesBtn,15, 2 ); //34
l->addWidget( anAspectRatio3DLab, 16, 0 ); //35
l->addWidget( aComputeVolumeBtn, 16, 2 ); //36
l->addWidget( myPlot3D, 17, 0, 1, 3 );//37
l->addWidget( aName, 0, 1 ); //1
l->setColumnStretch( 0, 0 );
l->setColumnStretch( 1, 5 );
l->setRowStretch ( 12, 5 );
l->setRowStretch ( 17, 5 );
l->setRowStretch ( 18, 1 );
// Node group
QWidget* NodeGrp = new QWidget();
QGridLayout* NodeLayout = new QGridLayout(NodeGrp);
NodeLayout->setSpacing(SPACING); NodeLayout->setMargin(MARGIN);
NodeLayout->addWidget( aNodesFreeLab, 0, 0 );
NodeLayout->addWidget( aNodesFree, 0, 1 );
NodeLayout->addWidget( aFreeNodesBtn, 0, 2 );
NodeLayout->addWidget( aNodesNbConnLab, 1, 0 );
NodeLayout->addWidget( aNodesNbConn, 1, 1 );
NodeLayout->addWidget( aNodesNbConnBtn, 1, 2 );
NodeLayout->addWidget( aNodesDoubleLab, 2, 0 );
NodeLayout->addWidget( aNodesDouble, 2, 1 );
NodeLayout->addWidget( aDoubleNodesBtn, 2, 2 );
NodeLayout->addWidget( aToleranceLab, 3, 0 );
NodeLayout->addWidget( myToleranceWidget, 3, 1 );
NodeLayout->addWidget( myToleranceWidget, 3, 1 );
NodeLayout->setRowStretch(4, 5);
myMeshTB->addItem(NodeGrp, aNodesLab->text());
aNodesLab->setVisible(false);
// Edge group
QWidget* EdgeGrp = new QWidget();
QGridLayout* EdgeLayout = new QGridLayout(EdgeGrp);
EdgeLayout->setSpacing(SPACING); EdgeLayout->setMargin(MARGIN);
EdgeLayout->addWidget( anEdgesDoubleLab, 0, 0 );
EdgeLayout->addWidget( anEdgesDouble, 0, 1 );
EdgeLayout->addWidget( aDoubleEdgesBtn, 0, 2 );
EdgeLayout->setRowStretch(1, 5);
myMeshTB->addItem(EdgeGrp, anEdgesLab->text());
anEdgesLab->setVisible(false);
// Face group
QWidget* FaceGrp = new QWidget();
QGridLayout* FaceLayout = new QGridLayout(FaceGrp);
FaceLayout->setSpacing(SPACING); FaceLayout->setMargin(MARGIN);
FaceLayout->addWidget( aFacesDoubleLab, 0, 0 );
FaceLayout->addWidget( aFacesDouble, 0, 1 );
FaceLayout->addWidget( aDoubleFacesBtn, 0, 2 );
FaceLayout->addWidget( aFacesOverLab, 1, 0 );
FaceLayout->addWidget( aFacesOver, 1, 1 );
FaceLayout->addWidget( aOverContFacesBtn, 1, 2 );
FaceLayout->addWidget( anAspectRatioLab, 2, 0 );
FaceLayout->addWidget( aComputeFaceBtn, 2, 2 );
FaceLayout->addWidget( myPlot, 3, 0, 1, 3 );
myMeshTB->addItem(FaceGrp, aFacesLab->text());
aFacesLab->setVisible(false);
// Volume group
QWidget* VolumeGrp = new QWidget();
QGridLayout* VolumeLayout = new QGridLayout(VolumeGrp);
VolumeLayout->setSpacing(SPACING); VolumeLayout->setMargin(MARGIN);
VolumeLayout->addWidget( aVolumesDoubleLab, 0, 0 );
VolumeLayout->addWidget( aVolumesDouble, 0, 1 );
VolumeLayout->addWidget( aDoubleVolumesBtn, 0, 2 );
VolumeLayout->addWidget( aVolumesOverLab, 1, 0 );
VolumeLayout->addWidget( aVolumesOver, 1, 1 );
VolumeLayout->addWidget( aOverContVolumesBtn,1, 2 );
VolumeLayout->addWidget( anAspectRatio3DLab, 2, 0 );
VolumeLayout->addWidget( aComputeVolumeBtn, 2, 2 );
VolumeLayout->addWidget( myPlot3D, 3, 0, 1, 3 );
myMeshTB->addItem(VolumeGrp, aVolumesLab->text());
aVolumesLab->setVisible(false);
l->addWidget( myMeshTB, 1, 0, 1, 2 ); //2
l->setRowStretch( 2, 5 );
clearInternal();
}
@ -3673,8 +3708,8 @@ void SMESHGUI_CtrlInfo::showInfo( const SMESH::SelectionProxy& proxy )
}
}
else {
for( int i=2; i<=13; i++)
dynamic_cast<QGridLayout*>(layout())->itemAt(i)->widget()->setVisible( false );
myMeshTB->setItemEnabled(0, false );
myMeshTB->widget(0)->setVisible( false );
}
// edges info
@ -3686,8 +3721,8 @@ void SMESHGUI_CtrlInfo::showInfo( const SMESH::SelectionProxy& proxy )
myButtons[3]->setEnabled( true );
}
else {
for( int i=14; i<=17; i++)
dynamic_cast<QGridLayout*>(layout())->itemAt(i)->widget()->setVisible( false );
myMeshTB->setItemEnabled(1, false );
myMeshTB->widget(1)->setVisible( false );
}
// faces info
@ -3705,14 +3740,10 @@ void SMESHGUI_CtrlInfo::showInfo( const SMESH::SelectionProxy& proxy )
myButtons[5]->setEnabled( true );
myButtons[6]->setEnabled( true );
}
#ifdef DISABLE_PLOT2DVIEWER
for( int i=25; i<=27; i++)
dynamic_cast<QGridLayout*>(layout())->itemAt(i)->widget()->setVisible( false );
#endif
}
else {
for( int i=18; i<=27; i++)
dynamic_cast<QGridLayout*>(layout())->itemAt(i)->widget()->setVisible( false );
myMeshTB->setItemEnabled(2, false );
myMeshTB->widget(2)->setVisible( false );
}
// volumes info
@ -3730,15 +3761,15 @@ void SMESHGUI_CtrlInfo::showInfo( const SMESH::SelectionProxy& proxy )
myButtons[8]->setEnabled( true );
myButtons[9]->setEnabled( true );
}
#ifdef DISABLE_PLOT2DVIEWER
for( int i=35; i<=37; i++)
dynamic_cast<QGridLayout*>(layout())->itemAt(i)->widget()->setVisible( false );
#endif
}
else {
for( int i=28; i<=37; i++)
dynamic_cast<QGridLayout*>(layout())->itemAt(i)->widget()->setVisible( false );
myMeshTB->setItemEnabled(3, false );
myMeshTB->widget(3)->setVisible( false );
}
myMeshTB->setCurrentIndex(0);
myMeshTB->setVisible( (nbNodes + nbElemsByType[ SMESH::EDGE ] +
nbElemsByType[ SMESH::FACE ] +
nbElemsByType[ SMESH::VOLUME ]) > 0 );
}
//================================================================================
@ -3892,8 +3923,10 @@ void SMESHGUI_CtrlInfo::computeAspectRatio3D()
*/
void SMESHGUI_CtrlInfo::clearInternal()
{
for( int i=0; i<=37; i++)
dynamic_cast<QGridLayout*>(layout())->itemAt(i)->widget()->setVisible( true );
for (int i=0; i<=3;i++) {
myMeshTB->setItemEnabled(i, true );
myMeshTB->widget(i)->setVisible( true );
}
for( int i=0; i<=9; i++)
myButtons[i]->setEnabled( false );
myPlot->detachItems();

View File

@ -36,6 +36,7 @@
#include <QList>
#include <QMap>
#include <QSet>
#include <QToolBox>
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SMESH_Filter)
@ -345,6 +346,7 @@ private:
ObjectType myObjectType;
SMESHGUI_SpinBox* myToleranceWidget;
QList<QLabel*> myWidgets;
QToolBox* myMeshTB;
QwtPlot* myPlot;
QwtPlot* myPlot3D;
QList<QAbstractButton*> myButtons;

View File

@ -319,25 +319,6 @@ SUIT_SelectionFilter* SMESHGUI_MeshOp::createFilter( const int theId ) const
return 0;
}
//================================================================================
/*!
* \brief Return type of shape contained in a group
*/
//================================================================================
TopAbs_ShapeEnum getGroupType(const TopoDS_Shape& group)
{
if ( group.ShapeType() != TopAbs_COMPOUND )
return group.ShapeType();
// iterate on a compound
TopoDS_Iterator it( group );
if ( it.More() )
return getGroupType( it.Value() );
return TopAbs_SHAPE;
}
//================================================================================
/*!
* \brief check if selected shape is a sub-shape of the shape to mesh
@ -365,60 +346,17 @@ bool SMESHGUI_MeshOp::isSubshapeOk() const
QStringList aGEOMs;
myDlg->selectedObject(SMESHGUI_MeshDlg::Geom, aGEOMs);
if (aGEOMs.count() > 0) {
GEOM::GEOM_Gen_var geomGen = mainGeom->GetGen();
if (geomGen->_is_nil()) return false;
GEOM::GEOM_IGroupOperations_wrap op = geomGen->GetIGroupOperations();
if (op->_is_nil()) return false;
// check all selected shapes
QStringList::const_iterator aSubShapesIter = aGEOMs.begin();
for ( ; aSubShapesIter != aGEOMs.end(); aSubShapesIter++)
for ( QString& aSubGeomEntry : aGEOMs )
{
QString aSubGeomEntry = (*aSubShapesIter);
_PTR(SObject) pSubGeom = SMESH::getStudy()->FindObjectID(aSubGeomEntry.toUtf8().data());
if (!pSubGeom) return false;
_PTR(SObject) pSubGeom = SMESH::getStudy()->FindObjectID( aSubGeomEntry.toUtf8().data() );
if ( !pSubGeom ) return false;
GEOM::GEOM_Object_var aSubGeomVar =
GEOM::GEOM_Object_var subGeom =
GEOM::GEOM_Object::_narrow(_CAST(SObject,pSubGeom)->GetObject());
if (aSubGeomVar->_is_nil()) return false;
// skl for NPAL14695 - implementation of searching of mainObj
GEOM::GEOM_Object_var mainObj = op->GetMainShape(aSubGeomVar); /* _var not _wrap as
mainObj already exists! */
while( !mainObj->_is_nil())
{
CORBA::String_var entry1 = mainObj->GetEntry();
CORBA::String_var entry2 = mainGeom->GetEntry();
if (std::string( entry1.in() ) == entry2.in() )
if ( SMESH::ContainsSubShape( mainGeom, subGeom ))
return true;
mainObj = op->GetMainShape(mainObj);
}
if ( aSubGeomVar->GetShapeType() == GEOM::COMPOUND )
{
// is aSubGeomVar a compound of sub-shapes?
GEOM::GEOM_IShapesOperations_wrap sop = geomGen->GetIShapesOperations();
if (sop->_is_nil()) return false;
GEOM::ListOfLong_var ids = sop->GetAllSubShapesIDs( aSubGeomVar,
GEOM::SHAPE,/*sorted=*/false);
if ( ids->length() > 0 )
{
GEOM_Client geomClient;
TopoDS_Shape subShape = geomClient.GetShape( geomGen, aSubGeomVar );
TopoDS_Shape mainShape = geomClient.GetShape( geomGen, mainGeom );
if ( subShape.IsNull() || mainShape.IsNull() )
return false;
TopAbs_ShapeEnum subType = getGroupType( subShape );
TopTools_IndexedMapOfShape subMap;
TopExp::MapShapes( subShape, subType, subMap );
for ( TopExp_Explorer exp( mainShape, subType ); exp.More(); exp.Next() )
if ( subMap.Contains( exp.Current() ))
return true;
}
}
}
}
return false;

View File

@ -202,13 +202,15 @@ SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg( SMESHGUI* theModule )
MakeGroupsCheck = new QCheckBox(tr("SMESH_MAKE_GROUPS"), GroupArguments);
MakeGroupsCheck->setChecked(true);
GroupArgumentsLayout->addWidget(SelectorWdg, 0, 0, 1, 4);
GroupArgumentsLayout->addWidget(GroupAxis, 1, 0, 1, 4);
GroupArgumentsLayout->addWidget(GroupAngleBox, 2, 0, 1, 4);
GroupArgumentsLayout->addWidget(TextLabelTolerance, 3, 0, 1, 2);
GroupArgumentsLayout->addWidget(SpinBox_Tolerance, 3, 2, 1, 2);
GroupArgumentsLayout->addWidget(myPreviewCheckBox, 4, 0, 1, 4);
GroupArgumentsLayout->addWidget(MakeGroupsCheck, 5, 0, 1, 4);
GroupArgumentsLayout->addWidget(SelectorWdg, 0, 0, 3, 4);
GroupArgumentsLayout->addWidget(GroupAxis, 0, 4, 1, 4);
GroupArgumentsLayout->addWidget(GroupAngleBox, 1, 4, 1, 4);
GroupArgumentsLayout->addWidget(TextLabelTolerance, 2, 4, 1, 2);
GroupArgumentsLayout->addWidget(SpinBox_Tolerance, 2, 6, 1, 2);
GroupArgumentsLayout->addWidget(myPreviewCheckBox, 3, 0, 1, 2);
GroupArgumentsLayout->addWidget(MakeGroupsCheck, 3, 2, 1, 2);
SelectorWdg->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
SelectorWdg->setMinimumWidth(320);
SelectorWdg->GetButtonGroup()->addButton( SelectVectorButton );
SelectorWdg->GetButtonGroup()->addButton( SelectPointButton );

View File

@ -1614,6 +1614,10 @@ Please enter correct values and try again</translation>
<source>SMESH_AUTO_DIM</source>
<translation>Automatically define space dimension</translation>
</message>
<message>
<source>SMESH_MED_SAVE_NUMS</source>
<translation>Export indices</translation>
</message>
<message>
<source>SMESH_ZTOLERANCE</source>
<translation>Z tolerance</translation>

View File

@ -547,7 +547,7 @@ SALOMEDS::SComponent_ptr SMESH_Gen_i::PublishComponent()
SALOMEDS::StudyBuilder_var aStudyBuilder = getStudyServant()->NewBuilder();
SALOMEDS::UseCaseBuilder_wrap useCaseBuilder = getStudyServant()->GetUseCaseBuilder();
std::string compDataType = ComponentDataType(); // SMESH module's data type
CORBA::String_var compDataType = ComponentDataType(); // SMESH module's data type
std::string ior;
{
CORBA::String_var iorString = GetORB()->object_to_string( SMESH_Gen::_this() );
@ -562,7 +562,8 @@ SALOMEDS::SComponent_ptr SMESH_Gen_i::PublishComponent()
CORBA::String_var ior_i;
bool ok = f_i->ComponentIOR(ior_i.out());
CORBA::String_var cdt(f_i->ComponentDataType());
if ( ok && compDataType == cdt.in() && ior == ior_i.in()) {
if ( ok && strcmp( compDataType.in(), cdt.in() ) == 0 && ior == ior_i.in())
{
father = f_i;
break;
}
@ -583,14 +584,14 @@ SALOMEDS::SComponent_ptr SMESH_Gen_i::PublishComponent()
if ( CORBA::is_nil( aCat ) )
return father._retn();
SALOME_ModuleCatalog::Acomponent_var aComp = aCat->GetComponent( compDataType.c_str() );
SALOME_ModuleCatalog::Acomponent_var aComp = aCat->GetComponent( compDataType.in() );
if ( CORBA::is_nil( aComp ) )
return father._retn();
SALOMEDS::GenericAttribute_wrap anAttr;
SALOMEDS::AttributePixMap_wrap aPixmap;
father = aStudyBuilder->NewComponent( compDataType.c_str() );
father = aStudyBuilder->NewComponent( compDataType.in() );
aStudyBuilder->DefineComponentInstance( father, SMESH_Gen::_this() );
anAttr = aStudyBuilder->FindOrCreateAttribute( father, "AttributePixMap" );
aPixmap = anAttr;

View File

@ -1138,12 +1138,7 @@ SMESH_ComputeErrorPtr ComputePentahedralMesh(SMESH_Mesh & aMesh,
SMESH_ProxyMesh* proxyMesh)
{
SMESH_ComputeErrorPtr err = SMESH_ComputeError::New();
if ( proxyMesh )
{
err->myName = COMPERR_BAD_INPUT_MESH;
err->myComment = "Can't build pentahedral mesh on viscous layers";
return err;
}
bool bOK;
StdMeshers_Penta_3D anAlgo;
//
@ -1165,6 +1160,24 @@ SMESH_ComputeErrorPtr ComputePentahedralMesh(SMESH_Mesh & aMesh,
err = aPrism3D->GetComputeError();
}
}
if ( !bOK && proxyMesh )
{
// check if VL elements are present on block FACEs
bool hasVLonFace = false;
for ( TopExp_Explorer exp( aShape, TopAbs_FACE ); exp.More(); exp.Next() )
{
const SMESHDS_SubMesh* sm1 = aMesh.GetSubMesh( exp.Current() )->GetSubMeshDS();
const SMESHDS_SubMesh* sm2 = proxyMesh->GetSubMesh( exp.Current() );
if (( hasVLonFace = ( sm2 && sm1->NbElements() != sm2->NbElements() )))
break;
}
if ( hasVLonFace )
{
err->myName = COMPERR_BAD_INPUT_MESH;
err->myComment = "Can't build pentahedral mesh on viscous layers";
}
}
return err;
}

View File

@ -101,7 +101,9 @@
#include <unordered_map>
#ifdef _DEBUG_
#ifndef WIN32
#define __myDEBUG
#endif
//#define __NOT_INVALIDATE_BAD_SMOOTH
//#define __NODES_AT_POS
#endif
@ -2775,13 +2777,12 @@ bool _ViscousBuilder::makeLayer(_SolidData& data)
if ( !setEdgeData( *edge, edgesByGeom[ shapeID ], helper, data ))
return false;
if ( edge->_nodes.size() < 2 )
edge->Block( data );
//data._noShrinkShapes.insert( shapeID );
if ( edge->_nodes.size() < 2 && !noShrink )
edge->Block( data ); // a sole node is moved only if noShrink
}
dumpMove(edge->_nodes.back());
if ( edge->_cosin > faceMaxCosin && !edge->Is( _LayerEdge::BLOCKED ))
if ( edge->_cosin > faceMaxCosin && edge->_nodes.size() > 1 )
{
faceMaxCosin = edge->_cosin;
maxCosinEdge = edge;
@ -3905,7 +3906,7 @@ bool _ViscousBuilder::setEdgeData(_LayerEdge& edge,
getMeshDS()->SetNodeOnFace( tgtNode, TopoDS::Face( eos._sWOL ), uv.X(), uv.Y() );
}
if ( edge._nodes.size() > 1 )
//if ( edge._nodes.size() > 1 ) -- allow RISKY_SWOL on noShrink shape
{
// check if an angle between a FACE with layers and SWOL is sharp,
// else the edge should not inflate
@ -3919,10 +3920,13 @@ bool _ViscousBuilder::setEdgeData(_LayerEdge& edge,
if ( helper.GetSubShapeOri( data._solid, F ) != TopAbs_REVERSED )
geomNorm.Reverse(); // inside the SOLID
if ( geomNorm * edge._normal < -0.001 )
{
if ( edge._nodes.size() > 1 )
{
getMeshDS()->RemoveFreeNode( tgtNode, 0, /*fromGroups=*/false );
edge._nodes.resize( 1 );
}
}
else if ( realLenFactor > 3 ) /// -- moved to SetCosin()
//else if ( edge._lenFactor > 3 )
{
@ -4739,7 +4743,7 @@ void _ViscousBuilder::computeGeomSize( _SolidData& data )
double thinkness = eos._hyp.GetTotalThickness();
for ( size_t i = 0; i < eos._edges.size(); ++i )
{
if ( eos._edges[i]->Is( _LayerEdge::BLOCKED )) continue;
if ( eos._edges[i]->_nodes.size() < 2 ) continue;
eos._edges[i]->SetMaxLen( thinkness );
eos._edges[i]->FindIntersection( *searcher, intersecDist, data._epsilon, eos, &face );
if ( intersecDist > 0 && face )
@ -4930,7 +4934,7 @@ bool _ViscousBuilder::inflate(_SolidData& data)
if ( eos._edges[i]->_nodes.size() > 1 )
avgThick += Min( 1., eos._edges[i]->_len / shapeTgtThick );
else
avgThick += shapeTgtThick;
avgThick += 1;
nbActiveEdges += ( ! eos._edges[i]->Is( _LayerEdge::BLOCKED ));
}
}
@ -5444,8 +5448,11 @@ bool _ViscousBuilder::smoothAndCheck(_SolidData& data,
// intersection not ignored
if ( toBlockInfaltion &&
dist < ( eos._edges[i]->_len * theThickToIntersection ))
double minDist = 0;
if ( eos._edges[i]->_maxLen < 0.99 * eos._hyp.GetTotalThickness() ) // limited length
minDist = eos._edges[i]->_len * theThickToIntersection;
if ( toBlockInfaltion && dist < minDist )
{
if ( is1stBlocked ) { is1stBlocked = false; // debug
dumpFunction(SMESH_Comment("blockIntersected") <<data._index<<"_InfStep"<<infStep);
@ -6192,9 +6199,11 @@ bool _Smoother1D::smoothAnalyticEdge( _SolidData& data,
tgtNode->setXYZ( newPos.X(), newPos.Y(), newPos.Z() );
dumpMove( tgtNode );
SMDS_FacePositionPtr pos = tgtNode->GetPosition();
if ( SMDS_FacePositionPtr pos = tgtNode->GetPosition() ) // NULL if F is noShrink
{
pos->SetUParameter( newUV.X() );
pos->SetVParameter( newUV.Y() );
}
gp_XYZ newUV0( newUV.X(), newUV.Y(), 0 );
@ -6304,10 +6313,11 @@ bool _Smoother1D::smoothAnalyticEdge( _SolidData& data,
tgtNode->setXYZ( newPos.X(), newPos.Y(), newPos.Z() );
dumpMove( tgtNode );
SMDS_FacePositionPtr pos = tgtNode->GetPosition();
if ( SMDS_FacePositionPtr pos = tgtNode->GetPosition() ) // NULL if F is noShrink
{
pos->SetUParameter( newUV.X() );
pos->SetVParameter( newUV.Y() );
}
_eos[i]->Set( _LayerEdge::SMOOTHED ); // to check in refine() (IPAL54237)
}
}
@ -6939,14 +6949,14 @@ void _SolidData::PrepareEdgesToSmoothOnFace( _EdgesOnShape* eos, bool substitute
eos->_edgeForOffset = 0;
double maxCosin = -1;
bool hasNoShrink = false;
//bool hasNoShrink = false;
for ( TopExp_Explorer eExp( eos->_shape, TopAbs_EDGE ); eExp.More(); eExp.Next() )
{
_EdgesOnShape* eoe = GetShapeEdges( eExp.Current() );
if ( !eoe || eoe->_edges.empty() ) continue;
if ( eos->GetData()._noShrinkShapes.count( eoe->_shapeID ))
hasNoShrink = true;
// if ( eos->GetData()._noShrinkShapes.count( eoe->_shapeID ))
// hasNoShrink = true;
vector<_LayerEdge*>& eE = eoe->_edges;
_LayerEdge* e = eE[ eE.size() / 2 ];
@ -6984,8 +6994,8 @@ void _SolidData::PrepareEdgesToSmoothOnFace( _EdgesOnShape* eos, bool substitute
// Try to initialize _Mapper2D
if ( hasNoShrink )
return;
// if ( hasNoShrink )
// return;
SMDS_ElemIteratorPtr fIt = eos->_subMesh->GetSubMeshDS()->GetElements();
if ( !fIt->more() || fIt->next()->NbCornerNodes() != 4 )
@ -10841,12 +10851,20 @@ namespace VISCOUS_3D
std::vector< SMESH_NodeXYZ > _nodes;
TopAbs_ShapeEnum _vertSWOLType[2]; // shrink part includes VERTEXes
AverageHyp* _vertHyp[2];
double _edgeWOLLen[2]; // length of wol EDGE
double _tol; // to compare _edgeWOLLen's
BndPart():
_isShrink(0), _isReverse(0), _nbSegments(0), _hyp(0),
_vertSWOLType{ TopAbs_WIRE, TopAbs_WIRE }, _vertHyp{ 0, 0 }
_vertSWOLType{ TopAbs_WIRE, TopAbs_WIRE }, _vertHyp{ 0, 0 }, _edgeWOLLen{ 0., 0.}
{}
bool IsEqualLengthEWOL( const BndPart& other ) const
{
return ( std::abs( _edgeWOLLen[0] - other._edgeWOLLen[0] ) < _tol &&
std::abs( _edgeWOLLen[1] - other._edgeWOLLen[1] ) < _tol );
}
bool operator==( const BndPart& other ) const
{
return ( _isShrink == other._isShrink &&
@ -10857,7 +10875,8 @@ namespace VISCOUS_3D
(( !_isShrink ) ||
( *_hyp == *other._hyp &&
vertHyp1() == other.vertHyp1() &&
vertHyp2() == other.vertHyp2() ))
vertHyp2() == other.vertHyp2() &&
IsEqualLengthEWOL( other )))
);
}
bool CanAppend( const BndPart& other )
@ -10875,8 +10894,10 @@ namespace VISCOUS_3D
bool hasCommonNode = ( _nodes.back()->GetID() == other._nodes.front()->GetID() );
_nodes.insert( _nodes.end(), other._nodes.begin() + hasCommonNode, other._nodes.end() );
_vertSWOLType[1] = other._vertSWOLType[1];
if ( _isShrink )
if ( _isShrink ) {
_vertHyp[1] = other._vertHyp[1];
_edgeWOLLen[1] = other._edgeWOLLen[1];
}
}
const SMDS_MeshNode* Node(size_t i) const
{
@ -11026,6 +11047,11 @@ namespace VISCOUS_3D
for ( int iE = 0; iE < nbEdgesInWire.front(); ++iE )
{
BndPart bndPart;
std::vector<const SMDS_MeshNode*> nodes = fSide.GetOrderedNodes( iE );
bndPart._nodes.assign( nodes.begin(), nodes.end() );
bndPart._nbSegments = bndPart._nodes.size() - 1;
_EdgesOnShape* eos = _data1->GetShapeEdges( fSide.EdgeID( iE ));
bndPart._isShrink = ( eos->SWOLType() == TopAbs_FACE );
@ -11054,10 +11080,14 @@ namespace VISCOUS_3D
bndPart._vertSWOLType[iV] = eov[iV]->SWOLType();
}
}
bndPart._edgeWOLLen[0] = fSide.EdgeLength( iE - 1 );
bndPart._edgeWOLLen[1] = fSide.EdgeLength( iE + 1 );
bndPart._tol = std::numeric_limits<double>::max(); // tolerance by segment size
for ( size_t i = 1; i < bndPart._nodes.size(); ++i )
bndPart._tol = Min( bndPart._tol,
( bndPart._nodes[i-1] - bndPart._nodes[i] ).SquareModulus() );
}
std::vector<const SMDS_MeshNode*> nodes = fSide.GetOrderedNodes( iE );
bndPart._nodes.assign( nodes.begin(), nodes.end() );
bndPart._nbSegments = bndPart._nodes.size() - 1;
if ( _boundary.empty() || ! _boundary.back().CanAppend( bndPart ))
_boundary.push_back( bndPart );
@ -11164,6 +11194,9 @@ namespace VISCOUS_3D
}
SMESHDS_Mesh* meshDS = dataSrc->GetHelper().GetMeshDS();
dumpFunction(SMESH_Comment("periodicMoveNodes_F")
<< _shriFace[iSrc]->_subMesh->GetId() << "_F"
<< _shriFace[iTgt]->_subMesh->GetId() );
TNode2Edge::iterator n2e;
TNodeNodeMap::iterator n2n = _nnMap.begin();
for ( ; n2n != _nnMap.end(); ++n2n )
@ -11193,6 +11226,8 @@ namespace VISCOUS_3D
SMESH_NodeXYZ pSrc = leSrc->_nodes[ iN ];
gp_XYZ pTgt = trsf->Transform( pSrc );
meshDS->MoveNode( leTgt->_nodes[ iN ], pTgt.X(), pTgt.Y(), pTgt.Z() );
dumpMove( leTgt->_nodes[ iN ]);
}
}
}
@ -11201,6 +11236,7 @@ namespace VISCOUS_3D
<< _shriFace[iSrc]->_subMesh->GetId() << " -> "
<< _shriFace[iTgt]->_subMesh->GetId() << " -- "
<< ( done ? "DONE" : "FAIL"));
dumpFunctionEnd();
return done;
}
@ -11735,6 +11771,8 @@ bool _ViscousBuilder::shrink(_SolidData& theData)
{
_EdgesOnShape& eos = * subEOS[ iS ];
if ( eos.ShapeType() != TopAbs_EDGE ) continue;
if ( eos.size() == 0 )
continue;
const TopoDS_Edge& E = TopoDS::Edge( eos._shape );
data.SortOnEdge( E, eos._edges );
@ -11757,8 +11795,8 @@ bool _ViscousBuilder::shrink(_SolidData& theData)
uvPtVec[ i ].param = helper.GetNodeU( E, edges[i]->_nodes[0] );
uvPtVec[ i ].SetUV( helper.GetNodeUV( F, edges[i]->_nodes.back() ));
}
if ( edges.empty() )
continue;
// if ( edges.empty() )
// continue;
BRep_Tool::Range( E, uvPtVec[0].param, uvPtVec.back().param );
StdMeshers_FaceSide fSide( uvPtVec, F, E, _mesh );
StdMeshers_ViscousLayers2D::SetProxyMeshOfEdge( fSide );