mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-24 08:20:34 +05:00
0021338: EDF 1926 SMESH: New controls and filters
+ FT_EqualNodes, + FT_EqualEdges, + FT_EqualFaces, + FT_EqualVolumes,
This commit is contained in:
parent
8931be9b66
commit
c1e553583f
@ -53,6 +53,10 @@ module SMESH
|
||||
FT_FreeEdges,
|
||||
FT_FreeNodes,
|
||||
FT_FreeFaces,
|
||||
FT_EqualNodes,
|
||||
FT_EqualEdges,
|
||||
FT_EqualFaces,
|
||||
FT_EqualVolumes,
|
||||
FT_MultiConnection,
|
||||
FT_MultiConnection2D,
|
||||
FT_Length,
|
||||
@ -193,6 +197,31 @@ module SMESH
|
||||
*/
|
||||
interface OverConstrainedFace: Predicate {};
|
||||
|
||||
/*!
|
||||
* Logical functor (predicate) "Equal Nodes".
|
||||
* Verify whether there is another mesh node with same coordinates
|
||||
*/
|
||||
interface EqualNodes: Predicate
|
||||
{
|
||||
void SetTolerance( in double theToler );
|
||||
double GetTolerance();
|
||||
};
|
||||
/*!
|
||||
* Logical functor (predicate) "Equal Edges".
|
||||
* Verify whether there is another mesh edge basing on the same nodes
|
||||
*/
|
||||
interface EqualEdges: Predicate {};
|
||||
/*!
|
||||
* Logical functor (predicate) "Equal Faces".
|
||||
* Verify whether there is another mesh face basing on the same nodes
|
||||
*/
|
||||
interface EqualFaces: Predicate {};
|
||||
/*!
|
||||
* Logical functor (predicate) "Equal Volumes".
|
||||
* Verify whether there is another mesh volumes basing on the same nodes
|
||||
*/
|
||||
interface EqualVolumes: Predicate {};
|
||||
|
||||
/*!
|
||||
* Logical functor (predicate) "Belong To Geometry".
|
||||
* Verify whether mesh element or node belong to pointed Geom Object
|
||||
@ -527,6 +556,11 @@ module SMESH
|
||||
FreeNodes CreateFreeNodes();
|
||||
FreeFaces CreateFreeFaces();
|
||||
|
||||
EqualNodes CreateEqualNodes();
|
||||
EqualEdges CreateEqualEdges();
|
||||
EqualFaces CreateEqualFaces();
|
||||
EqualVolumes CreateEqualVolumes();
|
||||
|
||||
RangeOfIds CreateRangeOfIds();
|
||||
|
||||
BadOrientedVolume CreateBadOrientedVolume();
|
||||
|
@ -872,21 +872,21 @@ SetControlMode(eControl theMode,
|
||||
if (!myIsEntityModeCache){
|
||||
myEntityModeCache = GetEntityMode();
|
||||
myIsEntityModeCache=true;
|
||||
}
|
||||
}
|
||||
SetEntityMode(eFaces);
|
||||
break;
|
||||
default:
|
||||
if (!myIsEntityModeCache){
|
||||
myEntityModeCache = GetEntityMode();
|
||||
myIsEntityModeCache=true;
|
||||
}
|
||||
}
|
||||
SetEntityMode(eFaces);
|
||||
}
|
||||
}else if(myControlActor == my3DActor) {
|
||||
if (!myIsEntityModeCache){
|
||||
myEntityModeCache = GetEntityMode();
|
||||
myIsEntityModeCache=true;
|
||||
}
|
||||
}
|
||||
SetEntityMode(eVolumes);
|
||||
}
|
||||
}
|
||||
@ -1219,24 +1219,27 @@ void SMESH_ActorDef::SetVisibility(int theMode, bool theIsUpdateRepersentation){
|
||||
if(myControlMode != eNone){
|
||||
switch(myControlMode){
|
||||
case eFreeNodes:
|
||||
case eCoincidentNodes:
|
||||
myNodeExtActor->VisibilityOn();
|
||||
break;
|
||||
case eFreeEdges:
|
||||
case eFreeBorders:
|
||||
case eCoincidentElems1D:
|
||||
case eLength2D:
|
||||
case eMultiConnection2D:
|
||||
my1DExtActor->VisibilityOn();
|
||||
break;
|
||||
case eFreeFaces:
|
||||
case eBareBorderFace:
|
||||
case eOverConstrainedFace:
|
||||
case eCoincidentElems2D:
|
||||
my2DExtActor->VisibilityOn();
|
||||
break;
|
||||
case eBareBorderVolume:
|
||||
case eOverConstrainedVolume:
|
||||
case eCoincidentElems3D:
|
||||
my3DExtActor->VisibilityOn();
|
||||
break;
|
||||
case eLength2D:
|
||||
case eMultiConnection2D:
|
||||
my1DExtActor->VisibilityOn();
|
||||
default:
|
||||
if(myControlActor->GetUnstructuredGrid()->GetNumberOfCells())
|
||||
myScalarBarActor->VisibilityOn();
|
||||
|
@ -489,19 +489,18 @@ SMESH_DeviceActor
|
||||
dynamic_cast<BareBorderVolume *>(theFunctor.get()) ||
|
||||
dynamic_cast<BareBorderFace *>(theFunctor.get()) ||
|
||||
dynamic_cast<OverConstrainedVolume*>(theFunctor.get()) ||
|
||||
dynamic_cast<CoincidentNodes *>(theFunctor.get()) ||
|
||||
dynamic_cast<CoincidentElements1D *>(theFunctor.get()) ||
|
||||
dynamic_cast<CoincidentElements2D *>(theFunctor.get()) ||
|
||||
dynamic_cast<CoincidentElements3D *>(theFunctor.get()) ||
|
||||
dynamic_cast<OverConstrainedFace *>(theFunctor.get()))
|
||||
{
|
||||
Predicate* aFreePredicate = dynamic_cast<Predicate*>(theFunctor.get());
|
||||
Predicate* aPredicate = dynamic_cast<Predicate*>(theFunctor.get());
|
||||
myExtractUnstructuredGrid->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
|
||||
vtkUnstructuredGrid* aGrid = myVisualObj->GetUnstructuredGrid();
|
||||
vtkIdType aNbCells = aGrid->GetNumberOfCells();
|
||||
for( vtkIdType i = 0; i < aNbCells; i++ ){
|
||||
vtkIdType anObjId = myVisualObj->GetElemObjId(i);
|
||||
if(aFreePredicate->IsSatisfy(anObjId))
|
||||
if(aPredicate->IsSatisfy(anObjId))
|
||||
myExtractUnstructuredGrid->RegisterCell(i);
|
||||
}
|
||||
if(!myExtractUnstructuredGrid->IsCellsRegistered())
|
||||
@ -557,13 +556,15 @@ SMESH_DeviceActor
|
||||
SetUnstructuredGrid(aDataSet);
|
||||
aDataSet->Delete();
|
||||
}
|
||||
else if(FreeNodes* aFreeNodes = dynamic_cast<FreeNodes*>(theFunctor.get()))
|
||||
else if(dynamic_cast<FreeNodes *>(theFunctor.get()) ||
|
||||
dynamic_cast<CoincidentNodes*>(theFunctor.get()))
|
||||
{
|
||||
Predicate* aPredicate = dynamic_cast<Predicate*>(theFunctor.get());
|
||||
myExtractUnstructuredGrid->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
|
||||
vtkIdType aNbNodes = myVisualObj->GetNbEntities(SMDSAbs_Node);
|
||||
for( vtkIdType i = 0; i < aNbNodes; i++ ){
|
||||
vtkIdType anObjId = myVisualObj->GetNodeObjId(i);
|
||||
if(aFreeNodes->IsSatisfy(anObjId))
|
||||
if(aPredicate->IsSatisfy(anObjId))
|
||||
myExtractUnstructuredGrid->RegisterCell(i);
|
||||
}
|
||||
if(!myExtractUnstructuredGrid->IsCellsRegistered())
|
||||
|
@ -1351,7 +1351,8 @@ void SMESHGUI_FilterTable::SetCriterion (const int theRow,
|
||||
theCriterion.Type == SMESH::FT_BelongToGenSurface ||
|
||||
theCriterion.Type == SMESH::FT_BelongToGeom ||
|
||||
theCriterion.Type == SMESH::FT_LyingOnGeom ||
|
||||
theCriterion.Type == SMESH::FT_CoplanarFaces)
|
||||
theCriterion.Type == SMESH::FT_CoplanarFaces ||
|
||||
theCriterion.Type == SMESH::FT_EqualNodes)
|
||||
{
|
||||
QTableWidgetItem* anItem = aTable->item(theRow, 0);
|
||||
if (!myAddWidgets.contains(anItem))
|
||||
@ -1534,6 +1535,7 @@ const char* SMESHGUI_FilterTable::getPrecision( const int aType )
|
||||
case SMESH::FT_BelongToCylinder:
|
||||
case SMESH::FT_BelongToGenSurface:
|
||||
case SMESH::FT_LyingOnGeom:
|
||||
case SMESH::FT_EqualNodes:
|
||||
retval = "len_tol_precision"; break;
|
||||
case SMESH::FT_Length:
|
||||
case SMESH::FT_Length2D:
|
||||
@ -1729,15 +1731,19 @@ void SMESHGUI_FilterTable::onCriterionChanged (const int row, const int col, con
|
||||
aTable->blockSignals( isSignalsBlocked );
|
||||
}
|
||||
|
||||
if ((aType == SMESH::NODE && aCriterionType == SMESH::FT_FreeNodes ) ||
|
||||
(aType == SMESH::EDGE && aCriterionType == SMESH::FT_FreeBorders ) ||
|
||||
(aType == SMESH::FACE && (aCriterionType == SMESH::FT_BareBorderFace ||
|
||||
aCriterionType == SMESH::FT_OverConstrainedFace ||
|
||||
aCriterionType == SMESH::FT_FreeEdges ||
|
||||
aCriterionType == SMESH::FT_FreeFaces)) ||
|
||||
(aType == SMESH::VOLUME && (aCriterionType == SMESH::FT_BadOrientedVolume ||
|
||||
if ((aType == SMESH::NODE && (aCriterionType == SMESH::FT_FreeNodes ||
|
||||
aCriterionType == SMESH::FT_EqualNodes )) ||
|
||||
(aType == SMESH::EDGE && (aCriterionType == SMESH::FT_FreeBorders ||
|
||||
aCriterionType == SMESH::FT_EqualEdges )) ||
|
||||
(aType == SMESH::FACE && (aCriterionType == SMESH::FT_BareBorderFace ||
|
||||
aCriterionType == SMESH::FT_OverConstrainedFace ||
|
||||
aCriterionType == SMESH::FT_FreeEdges ||
|
||||
aCriterionType == SMESH::FT_FreeFaces ||
|
||||
aCriterionType == SMESH::FT_EqualFaces)) ||
|
||||
(aType == SMESH::VOLUME && (aCriterionType == SMESH::FT_BadOrientedVolume ||
|
||||
aCriterionType == SMESH::FT_OverConstrainedVolume ||
|
||||
aCriterionType == SMESH::FT_BareBorderVolume)) ||
|
||||
aCriterionType == SMESH::FT_BareBorderVolume ||
|
||||
aCriterionType == SMESH::FT_EqualVolumes )) ||
|
||||
aCriterionType == SMESH::FT_LinearOrQuadratic ||
|
||||
aCriterionType == SMESH::FT_GroupColor ||
|
||||
aCriterionType == SMESH::FT_ElemGeomType ||
|
||||
@ -1980,6 +1986,7 @@ const QMap<int, QString>& SMESHGUI_FilterTable::getCriteria (const int theType)
|
||||
aCriteria[ SMESH::FT_LyingOnGeom ] = tr("LYING_ON_GEOM");
|
||||
aCriteria[ SMESH::FT_FreeNodes ] = tr("FREE_NODES");
|
||||
aCriteria[ SMESH::FT_GroupColor ] = tr("GROUP_COLOR");
|
||||
aCriteria[ SMESH::FT_EqualNodes ] = tr("EQUAL_NODE");
|
||||
}
|
||||
return aCriteria;
|
||||
}
|
||||
@ -2000,6 +2007,7 @@ const QMap<int, QString>& SMESHGUI_FilterTable::getCriteria (const int theType)
|
||||
aCriteria[ SMESH::FT_LinearOrQuadratic ] = tr("LINEAR");
|
||||
aCriteria[ SMESH::FT_GroupColor ] = tr("GROUP_COLOR");
|
||||
aCriteria[ SMESH::FT_ElemGeomType ] = tr("GEOM_TYPE");
|
||||
aCriteria[ SMESH::FT_EqualEdges ] = tr("EQUAL_EDGE");
|
||||
}
|
||||
return aCriteria;
|
||||
}
|
||||
@ -2031,6 +2039,7 @@ const QMap<int, QString>& SMESHGUI_FilterTable::getCriteria (const int theType)
|
||||
aCriteria[ SMESH::FT_GroupColor ] = tr("GROUP_COLOR");
|
||||
aCriteria[ SMESH::FT_ElemGeomType ] = tr("GEOM_TYPE");
|
||||
aCriteria[ SMESH::FT_CoplanarFaces ] = tr("COPLANAR_FACES");
|
||||
aCriteria[ SMESH::FT_EqualFaces ] = tr("EQUAL_FACE");
|
||||
}
|
||||
return aCriteria;
|
||||
}
|
||||
@ -2051,6 +2060,7 @@ const QMap<int, QString>& SMESHGUI_FilterTable::getCriteria (const int theType)
|
||||
aCriteria[ SMESH::FT_LinearOrQuadratic ] = tr("LINEAR");
|
||||
aCriteria[ SMESH::FT_GroupColor ] = tr("GROUP_COLOR");
|
||||
aCriteria[ SMESH::FT_ElemGeomType ] = tr("GEOM_TYPE");
|
||||
aCriteria[ SMESH::FT_EqualVolumes ] = tr("EQUAL_VOLUME");
|
||||
}
|
||||
return aCriteria;
|
||||
}
|
||||
|
@ -411,6 +411,10 @@
|
||||
<source>STB_FIND_ELEM</source>
|
||||
<translation>Find Element by Point</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>EQUAL_NODE</source>
|
||||
<translation>Double nodes</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>MEN_EQUAL_NODE</source>
|
||||
<translation>Double nodes</translation>
|
||||
@ -423,6 +427,10 @@
|
||||
<source>TOP_EQUAL_NODE</source>
|
||||
<translation>Double nodes</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>EQUAL_EDGE</source>
|
||||
<translation>Double edges</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>MEN_EQUAL_EDGE</source>
|
||||
<translation>Double edges</translation>
|
||||
@ -435,6 +443,10 @@
|
||||
<source>TOP_EQUAL_EDGE</source>
|
||||
<translation>Double edges</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>EQUAL_FACE</source>
|
||||
<translation>Double faces</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>MEN_EQUAL_FACE</source>
|
||||
<translation>Double faces</translation>
|
||||
@ -447,6 +459,10 @@
|
||||
<source>TOP_EQUAL_FACE</source>
|
||||
<translation>Double faces</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>EQUAL_VOLUME</source>
|
||||
<translation>Double volumes</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>MEN_EQUAL_VOLUME</source>
|
||||
<translation>Double volumes</translation>
|
||||
|
@ -901,10 +901,11 @@ class smeshDC(SMESH._objref_SMESH_Gen):
|
||||
print "Error: The threshold value should be of SALOMEDS.Color type"
|
||||
return None
|
||||
pass
|
||||
elif CritType in [FT_FreeBorders, FT_FreeEdges, FT_BadOrientedVolume, FT_FreeNodes,
|
||||
FT_FreeFaces, FT_LinearOrQuadratic,
|
||||
elif CritType in [FT_FreeBorders, FT_FreeEdges, FT_FreeNodes, FT_FreeFaces,
|
||||
FT_LinearOrQuadratic, FT_BadOrientedVolume,
|
||||
FT_BareBorderFace, FT_BareBorderVolume,
|
||||
FT_OverConstrainedFace, FT_OverConstrainedVolume]:
|
||||
FT_OverConstrainedFace, FT_OverConstrainedVolume,
|
||||
FT_EqualNodes,FT_EqualEdges,FT_EqualFaces,FT_EqualVolumes ]:
|
||||
# At this point the treshold is unnecessary
|
||||
if aTreshold == FT_LogicalNOT:
|
||||
aCriterion.UnaryOp = self.EnumToLong(FT_LogicalNOT)
|
||||
@ -940,7 +941,7 @@ class smeshDC(SMESH._objref_SMESH_Gen):
|
||||
# @param Treshold the threshold value (range of id ids as string, shape, numeric)
|
||||
# @param UnaryOp FT_LogicalNOT or FT_Undefined
|
||||
# @param Tolerance the tolerance used by FT_BelongToGeom, FT_BelongToSurface,
|
||||
# FT_LyingOnGeom, FT_CoplanarFaces criteria
|
||||
# FT_LyingOnGeom, FT_CoplanarFaces and FT_EqualNodes criteria
|
||||
# @return SMESH_Filter
|
||||
#
|
||||
# <a href="../tui_filters_page.html#tui_filters">Example of Filters usage</a>
|
||||
|
Loading…
Reference in New Issue
Block a user