*/
void SetFacesWithImprinting(in SMESH::long_array faceIDs);
SMESH::long_array GetFacesWithImprinting();
+ /*!
+ * To snap layers on given faces.
+ */
+ void SetFacesWithSnapping(in SMESH::long_array faceIDs);
+ SMESH::long_array GetFacesWithSnapping();
/*!
* To make groups of volumes of different domains when mesh is generated from skin.
* Default is to make groups.
ADV_TAB,
FACE_SEL_LAYERS_TAB,
FACE_SEL_IMPRINTING_TAB,
+ FACE_SEL_SNAPPING_TAB,
ENF_MESH_TAB
};
faceSelImprintingLayout->addWidget( myFaceSelectorImprinting, 1, 0, 2, 2 );
faceSelImprintingLayout->setRowStretch( 1, 10);
+ // selection of faces for snapping
+
+ QWidget* faceSelSnappingGroup = new QWidget( dlg() );
+ QGridLayout* faceSelSnappingLayout = new QGridLayout( faceSelSnappingGroup );
+
+ QLabel* facesLblSnapping = new QLabel( tr("HYBRID_FACE_IDS"), faceSelSnappingGroup );
+ faceSelSnappingLayout->addWidget( facesLblSnapping, 0, 0 );
+
+ myFaceSelectorSnapping = new StdMeshersGUI_SubShapeSelectorWdg( faceSelSnappingGroup, TopAbs_FACE, true, true );
+ myFaceSelectorSnapping->SetGeomShapeEntry( aSubEntry, aMainEntry );
+ faceSelSnappingLayout->addWidget( myFaceSelectorSnapping, 1, 0, 2, 2 );
+ faceSelSnappingLayout->setRowStretch( 1, 10);
+
// add tabs
tab->insertTab( STD_TAB, myStdGroup, tr( "SMESH_ARGUMENTS" ) );
tab->insertTab( ADV_TAB, myAdvGroup, tr( "HYBRID_ADV_ARGS" ) );
else {
tab->insertTab( FACE_SEL_LAYERS_TAB, faceSelLayersGroup, tr( "HYBRID_FACES_LAYERS_TAB" ));
tab->insertTab( FACE_SEL_IMPRINTING_TAB, faceSelImprintingGroup, tr( "HYBRID_FACES_IMPRINTING_TAB" ));
+ tab->insertTab( FACE_SEL_SNAPPING_TAB, faceSelSnappingGroup, tr( "HYBRID_FACES_SNAPPING_TAB" ));
}
tab->insertTab( ENF_MESH_TAB, myEnfMeshGroup, tr( "HYBRID_ENFORCED_MESHES" ) );
tab->setCurrentIndex( STD_TAB );
myFaceSelectorLayers->ShowPreview( false );
myFaceSelectorImprinting->ActivateSelection( false );
myFaceSelectorImprinting->ShowPreview( false );
+ myFaceSelectorSnapping->ActivateSelection( false );
+ myFaceSelectorSnapping->ShowPreview( false );
}
void HYBRIDPluginGUI_HypothesisCreator::updateWidgets()
myFaceSelectorLayers->setEnabled(enabled);
if ( QTabWidget* tab = qobject_cast<QTabWidget*>( myStdGroup->parentWidget()->parentWidget() )) {
tab->setTabEnabled( FACE_SEL_IMPRINTING_TAB, enabled );
+ tab->setTabEnabled( FACE_SEL_SNAPPING_TAB, enabled );
}
}
myMultinormalsAngleSpin -> setValue( data.myMultinormalsAngle );
myFaceSelectorLayers ->SetListOfIDs( data.myFaceWLIds );
myFaceSelectorImprinting ->SetListOfIDs( data.myFaceWIIds );
+ myFaceSelectorSnapping ->SetListOfIDs( data.myFaceWSIds );
myAdvWidget->workingDirectoryLineEdit ->setText ( data.myWorkingDir );
myAdvWidget->keepWorkingFilesCheck ->setChecked( data.myKeepFiles );
h_data.myNbOfBoundaryLayers = h->GetNbOfBoundaryLayers();
h_data.myFaceWLIds = h->GetFacesWithLayers();
h_data.myFaceWIIds = h->GetFacesWithImprinting();
+ h_data.myFaceWSIds = h->GetFacesWithSnapping();
h_data.myLayersOnAllWrap = h->GetLayersOnAllWrap();
h_data.myToMeshHoles = h->GetToMeshHoles();
h->SetNbOfBoundaryLayers ( h_data.myNbOfBoundaryLayers );
h->SetFacesWithLayers( h_data.myFaceWLIds );
h->SetFacesWithImprinting( h_data.myFaceWIIds );
+ h->SetFacesWithSnapping( h_data.myFaceWSIds );
if ( h->GetKeepFiles() != h_data.myKeepFiles)
h->SetKeepFiles ( h_data.myKeepFiles);
h_data.myMultinormalsAngle = myMultinormalsAngleSpin -> value();
h_data.myFaceWLIds = myFaceSelectorLayers->GetListOfIDs();
h_data.myFaceWIIds = myFaceSelectorImprinting->GetListOfIDs();
+ h_data.myFaceWSIds = myFaceSelectorSnapping->GetListOfIDs();
h_data.myKeepFiles = myAdvWidget->keepWorkingFilesCheck->isChecked();
h_data.myWorkingDir = myAdvWidget->workingDirectoryLineEdit->text().trimmed();
SMESH::long_array_var myFaceWLIds;
// IDs of faces with imprinting
SMESH::long_array_var myFaceWIIds;
+ // IDs of faces with snapping
+ SMESH::long_array_var myFaceWSIds;
} HYBRIDHypothesisData;
QLabel* myFacesLbl;
StdMeshersGUI_SubShapeSelectorWdg* myFaceSelectorLayers;
StdMeshersGUI_SubShapeSelectorWdg* myFaceSelectorImprinting;
+ StdMeshersGUI_SubShapeSelectorWdg* myFaceSelectorSnapping;
};
class EnforcedVertexTableWidgetDelegate : public QItemDelegate
<source>HYBRID_FACES_IMPRINTING_TAB</source>
<translation>Faces with imprinting</translation>
</message>
+ <message>
+ <source>HYBRID_FACES_SNAPPING_TAB</source>
+ <translation>Faces with snapping</translation>
+ </message>
<message>
<source>HYBRID_FACE_IDS</source>
<translation>Face IDs</translation>
<source>HYBRID_FACES_IMPRINTING_TAB</source>
<translation>Faces avec empreinte</translation>
</message>
+ <message>
+ <source>HYBRID_FACES_SNAPPING_TAB</source>
+ <translation>Faces avec empreinte existante</translation>
+ </message>
<message>
<source>HYBRID_FACE_IDS</source>
<translation>Numéros des faces</translation>
<source>HYBRID_FACES_IMPRINTING_TAB</source>
<translation>プリント付フェイス</translation>
</message>
+ <message>
+ <source>HYBRID_FACES_SNAPPING_TAB</source>
+ <translation type="unfinished">Faces with snapping</translation>
+ </message>
<message>
<source>HYBRID_FACE_IDS</source>
<translation>面ID</translation>
self.SetLayersOnAllWrap( False )
pass
+ ## To snap the layers on given surface (use existing surface layers as base for volume layers).
+ # @param faceIDs faces or face IDs that already have surface layers
+ def SetFacesWithSnapping(self, faceIDs):
+ import GEOM
+ ids = []
+ if not isinstance( faceIDs, list ) and not isinstance( faceIDs, tuple ):
+ faceIDs = [ faceIDs ]
+ for fid in faceIDs:
+ if isinstance( fid, int ):
+ ids.append( fid )
+ elif isinstance( fid, GEOM._objref_GEOM_Object):
+ faces = self.mesh.geompyD.SubShapeAll( fid, self.mesh.geompyD.ShapeType["FACE"])
+ for f in faces:
+ ids.append( self.mesh.geompyD.GetSubShapeID( self.mesh.geom, f ))
+ else:
+ raise TypeError("Face should be either ID or GEOM_Object, not %s" % type(fid))
+ pass
+ self.Parameters().SetFacesWithSnapping(ids)
+ if ids:
+ self.SetLayersOnAllWrap( False )
+ pass
+
"""
obsolete
## To mesh "holes" in a solid or not. Default is to mesh.
return myFacesWithImprinting;
}
+//=======================================================================
+//function : SetFacesWithSnapping
+//purpose : Set IDs of faces that already have surface layers
+//=======================================================================
+
+bool HYBRIDPlugin_Hypothesis::SetFacesWithSnapping(const std::vector<int>& theVal)
+{
+ if ( myFacesWithSnapping != theVal )
+ {
+ myFacesWithSnapping = theVal;
+ NotifySubMeshesHypothesisModification();
+ return true;
+ }
+ return false;
+}
+
+//=======================================================================
+//function : GetFacesWithSnapping
+//purpose : Return IDs of faces that already have surface layers
+//=======================================================================
+
+const std::vector<int>& HYBRIDPlugin_Hypothesis::GetFacesWithSnapping() const
+{
+ return myFacesWithSnapping;
+}
+
//=======================================================================
//function : SetToMeshHoles
//=======================================================================
for ( size_t i = 0; i < myFacesWithImprinting.size(); ++i )
save << " " << myFacesWithImprinting[i];
+ save << " " << myFacesWithSnapping.size();
+ for ( size_t i = 0; i < myFacesWithSnapping.size(); ++i )
+ save << " " << myFacesWithSnapping[i];
+
return save;
}
}
}
+ isOK = static_cast<bool>(load >> separator);
+ if ( isOK )
+ {
+ i = atoi( separator.c_str() );
+ isOK = ( i >= 0 );
+ if ( isOK )
+ {
+ myFacesWithSnapping.reserve( i );
+ while (( myFacesWithSnapping.size() < myFacesWithSnapping.capacity() ) &&
+ ( isOK = static_cast<bool>(load >> i)) )
+ myFacesWithSnapping.push_back( i );
+ }
+ }
+
return load;
}
cmd << " --boundary_layer_imprinting yes --boundary_layer_imprinting_tags ";
for ( size_t i = 0; i < faceImprintingIDs.size(); ++i )
cmd << faceImprintingIDs[i] << ",";
+
+ // faces with snapping
+ const std::vector<int>& faceSnappingIDs = hyp->GetFacesWithSnapping();
+ if ( !faceSnappingIDs.empty() )
+ cmd << " --boundary_layer_snapping yes --boundary_layer_snapping_tags ";
+ for ( size_t i = 0; i < faceSnappingIDs.size(); ++i )
+ cmd << faceSnappingIDs[i] << ",";
}
}
*/
bool SetFacesWithImprinting(const std::vector<int>& theVal);
const std::vector<int>& GetFacesWithImprinting() const;
+ /*!
+ * IDs of faces with snapping (faces that already have surface layers)
+ */
+ bool SetFacesWithSnapping(const std::vector<int>& theVal);
+ const std::vector<int>& GetFacesWithSnapping() const;
/*!
* To make groups of volumes of different domains when mesh is generated from skin.
* Default is to make groups.
bool myLayersOnAllWrap;
std::vector<int> myFacesWithLayers;
std::vector<int> myFacesWithImprinting;
+ std::vector<int> myFacesWithSnapping;
bool myToMakeGroupsOfDomains;
double myMaximumMemory;
double myInitialMemory;
return ids._retn();
}
+//=======================================================================
+//function : SetFacesWithSnapping
+//=======================================================================
+
+void HYBRIDPlugin_Hypothesis_i::SetFacesWithSnapping(const ::SMESH::long_array& theVal)
+{
+ std::vector<int> ids( theVal.length() );
+ for ( size_t i = 0; i < ids.size(); ++i )
+ ids[i] = theVal[i];
+
+ bool valueChanged = this->GetImpl()->SetFacesWithSnapping(ids);
+ if (valueChanged)
+ SMESH::TPythonDump() << _this() << ".SetFacesWithSnapping( "<< theVal << " )";
+}
+
+//=======================================================================
+//function : GetFacesWithSnapping
+//=======================================================================
+
+SMESH::long_array* HYBRIDPlugin_Hypothesis_i::GetFacesWithSnapping()
+{
+ const std::vector<int>& idsVec = this->GetImpl()->GetFacesWithSnapping();
+ SMESH::long_array_var ids = new SMESH::long_array;
+ ids->length( idsVec.size() );
+ for ( size_t i = 0; i < idsVec.size(); ++i )
+ ids[i] = idsVec[i];
+ return ids._retn();
+}
+
//=======================================================================
//function : SetToMeshHoles
//=======================================================================
*/
void SetFacesWithImprinting(const SMESH::long_array& faceIDs);
SMESH::long_array* GetFacesWithImprinting();
+ /*!
+ * IDs of faces to snap the layers on (faces that already have surface layers)
+ */
+ void SetFacesWithSnapping(const SMESH::long_array& faceIDs);
+ SMESH::long_array* GetFacesWithSnapping();
/*!
* To mesh "layers on all wrap". Default is to mesh.
*/
enforced_mesh
layers_imprinting
layers_imprinting_hexa_core
+ layers_with_snapping
mg_hybrid_pyramids
advanced_text_option
)