Face quality controls:
<ul>
<li>\subpage free_faces_page "Free faces"</li>
+<li>\subpage bare_border_faces_page "Bare border faces"</li>
<li>\subpage length_2d_page "Length 2D"</li>
<li>\subpage borders_at_multi_connection_2d_page "Borders at multi-connection 2D"</li>
<li>\subpage area_page "Area"</li>
<li>\subpage aspect_ratio_3d_page "Aspect ratio 3D"</li>
<li>\subpage volume_page "Volume"</li>
<li>\subpage max_element_length_3d_page "Max element length 3D"</li>
+<li>\subpage bare_border_volumes_page "Bare border volumes"</li>
</ul>
*/
--- /dev/null
+/*!
+
+\page bare_border_faces_page Bare border faces
+
+This mesh quality control highlights the faces having the border not
+shared with other faces (free border) and missing an edge based on
+nodes of the free border. The faces with bare border are shown with a
+color different from the color of shared faces.
+
+\image html bare_border_faces_smpl.png
+
+\sa A sample TUI Script making a group of faces highlighted in the
+picture is \ref tui_bare_border_faces "Bare border faces Control".
+
+*/
--- /dev/null
+/*!
+
+\page bare_border_volumes_page Bare border volumes
+
+This mesh quality control highlights the volumes having the border not
+shared with other volumes (free border) and missing a face based on
+nodes of the free border. The volumes with bare border are shown with a
+color different from the color of shared volumes.
+
+\image html bare_border_volumes_smpl.png
+
+\sa A sample TUI Script making a group of volumes highlighted in the
+picture is \ref tui_bare_border_volumes "Bare border volumes Control".
+
+*/
one element of mesh only. See also a
\ref free_edges_page "Free Edges quality control".
</li><li>
-<b>Free faces</b> selects 3D mesh elements wich belong to less than two volumes.
+<b>Free faces</b> selects 2D mesh elements wich belong to less than two volumes.
+</li><li>
+<b>Faces with bare border</b> selects 2D mesh elements having a free border without an edge on it.
+See also \ref bare_border_faces_page "Bare border faces quality control".
</li><li>
<b>Borders at Multi-Connections 2D</b> selects cells consisting of edges belonging to
several elements of mesh. The number of mesh elements should be more, less or equal
</li><li>
<b>Bad oriented volume</b> selects mesh volumes, which are incorrectly oriented from
the point of view of MED convention.
+</li><li>
+<b>Volumes with bare border</b> selects 3D mesh elements having a free border without a face on it.
+See also \ref bare_border_volumes_page "Bare border volumes quality control".
</li>
</ul>
salome.sg.updateObjBrowser(1)
\endcode
+\section tui_bare_border_faces Bare border faces
+
+\code
+from smesh import *
+SetCurrentStudy(salome.myStudy)
+
+box = geompy.MakeBoxDXDYDZ(100, 100, 100)
+geompy.addToStudy( box, "box" )
+
+mesh = smesh.Mesh(box)
+mesh.Segment().NumberOfSegments(3)
+mesh.Quadrangle()
+mesh.Compute()
+
+# remove 2 faces
+allFaces = mesh.GetElementsByType(FACE)
+mesh.RemoveElements( allFaces[0:2])
+
+bareGroup = mesh.MakeGroup("bare faces", FACE, FT_BareBorderFace)
+assert(bareGroup.Size() == 3)
+\endcode
+
+\section tui_bare_border_volumes Bare border volumes
+
+\code
+from smesh import *
+SetCurrentStudy(salome.myStudy)
+
+box = geompy.MakeBoxDXDYDZ(100, 30, 10)
+# the smallest face of the box
+face = geompy.SubShapeAllSorted( box, geompy.ShapeType["FACE"])[0]
+
+geompy.addToStudy( box, "box" )
+geompy.addToStudyInFather( box, face, "face" )
+
+mesh = Mesh(box)
+mesh.AutomaticHexahedralization();
+
+# remove half of mesh faces from the smallest face
+faceFaces = mesh.GetSubMeshElementsId(face)
+faceToRemove = faceFaces[: len(faceFaces)/2]
+mesh.RemoveElements( faceToRemove )
+
+# make a group of volumes missing the removed faces
+bareGroup = mesh.MakeGroup("bare volumes", VOLUME, FT_BareBorderVolume)
+assert(bareGroup.Size() == len( faceToRemove))
+\endcode
+
\section tui_length_2d Length 2D
\code
FT_LyingOnGeom,
FT_RangeOfIds,
FT_BadOrientedVolume,
+ FT_BareBorderVolume,
+ FT_BareBorderFace,
FT_LinearOrQuadratic,
FT_GroupColor,
FT_ElemGeomType,
};
typedef sequence<HistogramRectangle> Histogram;
+
/*!
* Base interface for all functors ( i.e. numerical functors and predicates )
*/
ElementType GetElementType();
};
-
-
/*!
* Numerical functors are intended for calculating value by Id of mesh entity
*/
Values GetValues();
};
+
/*!
* Predicates are intended for verification of criteria,
* must return bool value by mesh id
*/
interface BadOrientedVolume: Predicate {};
+ /*!
+ * Logical functor (predicate) "Volumes with bare border" and "Faces with bare border".
+ * Verify whether a mesh volume has a free facet without a mesh face on it
+ */
+ interface BareBorderVolume: Predicate {};
+ /*!
+ * Logical functor (predicate) "Faces with bare border".
+ * Verify whether a mesh face has a side not shared with another face
+ * and without a mesh edge on it
+ */
+ interface BareBorderFace: Predicate {};
+
/*!
* Logical functor (predicate) "Belong To Geometry".
* Verify whether mesh element or node belong to pointed Geom Object
RangeOfIds CreateRangeOfIds();
BadOrientedVolume CreateBadOrientedVolume();
+ BareBorderVolume CreateBareBorderVolume();
+ BareBorderFace CreateBareBorderFace();
LinearOrQuadratic CreateLinearOrQuadratic();
GroupColor CreateGroupColor();
mesh_vertex_n.png \
mesh_vertex.png \
mesh_volume_3d.png \
+ bare_border_volume.png \
+ bare_border_face.png \
mesh_wireframe.png \
mesh_points.png \
mesh_wrap.png \
aFilter->RegisterCellsWithType(VTK_QUADRATIC_PYRAMID);
aFilter->RegisterCellsWithType(VTK_CONVEX_POINT_SET);
+ my3DExtActor = SMESH_DeviceActor::New();
+ my3DExtActor->SetUserMatrix(aMatrix);
+ my3DExtActor->PickableOff();
+ my3DExtActor->SetProperty(my2DExtProp);
+ my3DExtActor->SetBackfaceProperty(my2DExtProp);
+ my3DExtActor->SetRepresentation(SMESH_DeviceActor::eSurface);
+ aFilter = my3DExtActor->GetExtractUnstructuredGrid();
+ aFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
+ aFilter->RegisterCellsWithType(VTK_TETRA);
+ aFilter->RegisterCellsWithType(VTK_VOXEL);
+ aFilter->RegisterCellsWithType(VTK_HEXAHEDRON);
+ aFilter->RegisterCellsWithType(VTK_WEDGE);
+ aFilter->RegisterCellsWithType(VTK_PYRAMID);
+ aFilter->RegisterCellsWithType(VTK_QUADRATIC_TETRA);
+ aFilter->RegisterCellsWithType(VTK_QUADRATIC_HEXAHEDRON);
+ aFilter->RegisterCellsWithType(VTK_QUADRATIC_WEDGE);
+ aFilter->RegisterCellsWithType(VTK_QUADRATIC_PYRAMID);
+ aFilter->RegisterCellsWithType(VTK_CONVEX_POINT_SET);
+
//Definition 1D device of the actor
//---------------------------------
myEdgeProp = vtkProperty::New();
my2DExtProp->Delete();
my2DExtActor->Delete();
my3DActor->Delete();
+ my3DExtActor->Delete();
myNodeActor->Delete();
myBaseActor->Delete();
bool anIsScalarVisible = theMode > eNone;
- if(anIsScalarVisible){
- switch(theMode){
+ if(anIsScalarVisible) {
+ switch(theMode) {
case eLength:
{
SMESH::Controls::Length* aControl = new SMESH::Controls::Length();
myFunctor.reset(new SMESH::Controls::FreeFaces());
myControlActor = my2DActor;
break;
+ case eBareBorderFace:
+ myFunctor.reset(new SMESH::Controls::BareBorderFace());
+ myControlActor = my2DActor;
+ break;
case eMultiConnection:
myFunctor.reset(new SMESH::Controls::MultiConnection());
myControlActor = my1DActor;
myControlActor = my3DActor;
break;
}
+ case eBareBorderVolume:
+ {
+ myFunctor.reset(new SMESH::Controls::BareBorderVolume());
+ myControlActor = my3DActor;
+ break;
+ }
case eMinimumAngle:
{
SMESH::Controls::MinimumAngle* aControl = new SMESH::Controls::MinimumAngle();
case eFreeFaces:
my2DExtActor->SetExtControlMode(myFunctor);
break;
+ case eBareBorderFace:
+ my2DExtActor->SetExtControlMode(myFunctor);
+ break;
+ case eBareBorderVolume:
+ my3DExtActor->SetExtControlMode(myFunctor);
+ break;
case eLength2D:
case eMultiConnection2D:
my1DExtActor->SetExtControlMode(myFunctor,myScalarBarActor,myLookupTable);
theRenderer->AddActor(myNodeExtActor);
my3DActor->AddToRender(theRenderer);
+ my3DExtActor->AddToRender(theRenderer);
my2DActor->AddToRender(theRenderer);
my2DExtActor->AddToRender(theRenderer);
my2DActor->RemoveFromRender(theRenderer);
my2DExtActor->RemoveFromRender(theRenderer);
my3DActor->RemoveFromRender(theRenderer);
+ my3DExtActor->RemoveFromRender(theRenderer);
theRenderer->RemoveActor(myScalarBarActor);
theRenderer->RemoveActor(myPointLabels);
my2DActor->Init(myVisualObj,myImplicitBoolean);
my2DExtActor->Init(myVisualObj,myImplicitBoolean);
my3DActor->Init(myVisualObj,myImplicitBoolean);
+ my3DExtActor->Init(myVisualObj,myImplicitBoolean);
my0DActor->GetMapper()->SetLookupTable(myLookupTable);
//my0DExtActor->GetMapper()->SetLookupTable(myLookupTable);
my2DActor->GetMapper()->SetLookupTable(myLookupTable);
my2DExtActor->GetMapper()->SetLookupTable(myLookupTable);
my3DActor->GetMapper()->SetLookupTable(myLookupTable);
+ my3DExtActor->GetMapper()->SetLookupTable(myLookupTable);
vtkFloatingPointType aFactor, aUnits;
my2DActor->GetPolygonOffsetParameters(aFactor,aUnits);
my2DActor->SetTransform(theTransform);
my2DExtActor->SetTransform(theTransform);
my3DActor->SetTransform(theTransform);
+ my3DExtActor->SetTransform(theTransform);
Modified();
}
my2DActor->SetShrinkFactor(theValue);
my2DExtActor->SetShrinkFactor(theValue);
my3DActor->SetShrinkFactor(theValue);
+ my3DExtActor->SetShrinkFactor(theValue);
Modified();
}
my2DActor->SetShrink();
my2DExtActor->SetShrink();
my3DActor->SetShrink();
+ my3DExtActor->SetShrink();
myIsShrunk = true;
Modified();
my2DActor->UnShrink();
my2DExtActor->UnShrink();
my3DActor->UnShrink();
+ my3DExtActor->UnShrink();
myIsShrunk = false;
Modified();
my2DActor->VisibilityOff();
my2DExtActor->VisibilityOff();
my3DActor->VisibilityOff();
+ my3DExtActor->VisibilityOff();
myScalarBarActor->VisibilityOff();
myPointLabels->VisibilityOff();
my1DExtActor->VisibilityOn();
break;
case eFreeFaces:
+ case eBareBorderFace:
my2DExtActor->VisibilityOn();
break;
+ case eBareBorderVolume:
+ my3DExtActor->VisibilityOn();
+ break;
case eLength2D:
case eMultiConnection2D:
my1DExtActor->VisibilityOn();
//my0DExtActor->SetVisibility(false);
my1DExtActor->SetVisibility(false);
my2DExtActor->SetVisibility(false);
+ my3DExtActor->SetVisibility(false);
// ???
//my0DActor->SetProperty(aProp);
my2DActor->SetImplicitFunctionUsed(theIsImplicitFunctionUsed);
my2DExtActor->SetImplicitFunctionUsed(theIsImplicitFunctionUsed);
my3DActor->SetImplicitFunctionUsed(theIsImplicitFunctionUsed);
+ my3DExtActor->SetImplicitFunctionUsed(theIsImplicitFunctionUsed);
}
vtkIdType
enum eControl{eNone, eLength, eLength2D, eFreeBorders, eFreeEdges, eFreeNodes,
eFreeFaces, eMultiConnection, eArea, eTaper, eAspectRatio,
eMinimumAngle, eWarping, eSkew, eAspectRatio3D, eMultiConnection2D, eVolume3D,
- eMaxElementLength2D, eMaxElementLength3D};
+ eMaxElementLength2D, eMaxElementLength3D, eBareBorderFace, eBareBorderVolume};
virtual void SetControlMode(eControl theMode) = 0;
virtual eControl GetControlMode() = 0;
virtual SMESH::Controls::FunctorPtr GetFunctor() = 0;
SMESH_DeviceActor* my2DActor;
SMESH_DeviceActor* my2DExtActor;
SMESH_DeviceActor* my3DActor;
+ SMESH_DeviceActor* my3DExtActor;
SMESH_DeviceActor* myControlActor;
vtkProperty* myNodeExtProp;
using namespace SMESH::Controls;
if ( dynamic_cast<FreeBorders*>(theFunctor.get()) ||
- dynamic_cast<FreeFaces*>(theFunctor.get()) ) {
+ dynamic_cast<FreeFaces*>(theFunctor.get()) ||
+ dynamic_cast<BareBorderVolume*>(theFunctor.get())||
+ dynamic_cast<BareBorderFace*>(theFunctor.get()))
+ {
Predicate* aFreePredicate = dynamic_cast<Predicate*>(theFunctor.get());
myExtractUnstructuredGrid->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
vtkUnstructuredGrid* aGrid = myVisualObj->GetUnstructuredGrid();
if(!myExtractUnstructuredGrid->IsCellsRegistered())
myExtractUnstructuredGrid->RegisterCell(-1);
SetUnstructuredGrid(myVisualObj->GetUnstructuredGrid());
- }else if(FreeEdges* aFreeEdges = dynamic_cast<FreeEdges*>(theFunctor.get())){
+ }
+ else if(FreeEdges* aFreeEdges = dynamic_cast<FreeEdges*>(theFunctor.get()))
+ {
SMESH::Controls::FreeEdges::TBorders aBorders;
aFreeEdges->GetBoreders(aBorders);
vtkUnstructuredGrid* aDataSet = vtkUnstructuredGrid::New();
SetUnstructuredGrid(aDataSet);
aDataSet->Delete();
- }else if(FreeNodes* aFreeNodes = dynamic_cast<FreeNodes*>(theFunctor.get())){
+ }
+ else if(FreeNodes* aFreeNodes = dynamic_cast<FreeNodes*>(theFunctor.get()))
+ {
myExtractUnstructuredGrid->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
vtkIdType aNbNodes = myVisualObj->GetNbEntities(SMDSAbs_Node);
for( vtkIdType i = 0; i < aNbNodes; i++ ){
type = QObject::tr( "FREE_BORDERS" );
else if ( dynamic_cast< SMESH::Controls::FreeFaces* >( f.get() ) )
type = QObject::tr( "FREE_FACES" );
+ else if ( dynamic_cast< SMESH::Controls::BareBorderVolume* >( f.get() ) )
+ type = QObject::tr( "BARE_BORDER_VOLUME" );
+ else if ( dynamic_cast< SMESH::Controls::BareBorderFace* >( f.get() ) )
+ type = QObject::tr( "BARE_BORDER_FACE" );
return type;
}
case 6023:
aControl = SMESH_Actor::eMaxElementLength3D;
break;
+ case 6024:
+ aControl = SMESH_Actor::eBareBorderVolume;
+ break;
+ case 6025:
+ aControl = SMESH_Actor::eBareBorderFace;
+ break;
}
anActor->SetControlMode(aControl);
anActor->GetScalarBarActor()->SetTitle( functorToString( anActor->GetFunctor() ).toLatin1().constData() );
case 6021:
case 6022:
case 6023:
+ case 6024:
+ case 6025:
if ( vtkwnd ) {
LightApp_SelectionMgr* mgr = selectionMgr();
createSMESHAction( 6021, "FREE_FACES", "ICON_FREE_FACES", 0, true );
createSMESHAction( 6022, "MAX_ELEMENT_LENGTH_2D", "ICON_MAX_ELEMENT_LENGTH_2D", 0, true );
createSMESHAction( 6023, "MAX_ELEMENT_LENGTH_3D", "ICON_MAX_ELEMENT_LENGTH_3D", 0, true );
+ createSMESHAction( 6024, "BARE_BORDER_VOLUME","ICON_BARE_BORDER_VOLUME", 0, true );
+ createSMESHAction( 6025, "BARE_BORDER_FACE","ICON_BARE_BORDER_FACE", 0, true );
createSMESHAction( 6003, "FREE_BORDER", "ICON_FREE_EDGE_2D", 0, true );
createSMESHAction( 6004, "CONNECTION", "ICON_CONNECTION", 0, true );
createSMESHAction( 6005, "FREE_NODE", "ICON_FREE_NODE", 0, true );
createMenu( 6001, edgeId, -1 );
createMenu( 6004, edgeId, -1 );
createMenu( 6021, faceId, -1 );
+ createMenu( 6025, faceId, -1 );
createMenu( 6018, faceId, -1 );
createMenu( 6019, faceId, -1 );
createMenu( 6011, faceId, -1 );
createMenu( 6017, volumeId, -1 );
createMenu( 6009, volumeId, -1 );
createMenu( 6023, volumeId, -1 );
+ createMenu( 6024, volumeId, -1 );
createMenu( 4000, addId, -1 );
createMenu( 4009, addId, -1 );
createTool( 6004, ctrlTb );
createTool( separator(), ctrlTb );
createTool( 6021, ctrlTb );
+ createTool( 6025, ctrlTb );
createTool( 6018, ctrlTb );
createTool( 6019, ctrlTb );
createTool( 6011, ctrlTb );
createTool( 6017, ctrlTb );
createTool( 6009, ctrlTb );
createTool( 6023, ctrlTb );
+ createTool( 6024, ctrlTb );
createTool( separator(), ctrlTb );
createTool( 4000, addRemTb );
aSubId = popupMgr()->insert( tr( "MEN_FACE_CTRL" ), anId, -1 ); // FACE CONTROLS
- popupMgr()->insert( action( 6021 ), aSubId, -1 ); // FREE_FACE
+ popupMgr()->insert ( action( 6021 ), aSubId, -1 ); // FREE_FACE
popupMgr()->setRule( action( 6021 ), aMeshInVtkHasFaces /*aMeshInVtkHasVolumes*/,
QtxPopupMgr::VisibleRule );
popupMgr()->setRule( action( 6021 ), "controlMode = 'eFreeFaces'", QtxPopupMgr::ToggleRule );
- popupMgr()->insert( action( 6018 ), aSubId, -1 ); // LENGTH_2D
+ popupMgr()->insert ( action( 6018 ), aSubId, -1 ); // LENGTH_2D
popupMgr()->setRule( action( 6018 ), aMeshInVtkHasFaces, QtxPopupMgr::VisibleRule );
popupMgr()->setRule( action( 6018 ), "controlMode = 'eLength2D'", QtxPopupMgr::ToggleRule );
- popupMgr()->insert( action( 6019 ), aSubId, -1 ); // CONNECTION_2D
+ popupMgr()->insert ( action( 6019 ), aSubId, -1 ); // CONNECTION_2D
popupMgr()->setRule( action( 6019 ), aMeshInVtkHasFaces, QtxPopupMgr::VisibleRule );
popupMgr()->setRule( action( 6019 ), "controlMode = 'eMultiConnection2D'", QtxPopupMgr::ToggleRule );
- popupMgr()->insert( action( 6011 ), aSubId, -1 ); // AREA
+ popupMgr()->insert ( action( 6011 ), aSubId, -1 ); // AREA
popupMgr()->setRule( action( 6011 ), aMeshInVtkHasFaces, QtxPopupMgr::VisibleRule );
popupMgr()->setRule( action( 6011 ), "controlMode = 'eArea'", QtxPopupMgr::ToggleRule );
- popupMgr()->insert( action( 6012 ), aSubId, -1 ); // TAPER
+ popupMgr()->insert ( action( 6012 ), aSubId, -1 ); // TAPER
popupMgr()->setRule( action( 6012 ), aMeshInVtkHasFaces, QtxPopupMgr::VisibleRule );
popupMgr()->setRule( action( 6012 ), "controlMode = 'eTaper'", QtxPopupMgr::ToggleRule );
- popupMgr()->insert( action( 6013 ), aSubId, -1 ); // ASPECT
+ popupMgr()->insert ( action( 6013 ), aSubId, -1 ); // ASPECT
popupMgr()->setRule( action( 6013 ), aMeshInVtkHasFaces, QtxPopupMgr::VisibleRule );
popupMgr()->setRule( action( 6013 ), "controlMode = 'eAspectRatio'", QtxPopupMgr::ToggleRule );
- popupMgr()->insert( action( 6014 ), aSubId, -1 ); // MIN_ANG
+ popupMgr()->insert ( action( 6014 ), aSubId, -1 ); // MIN_ANG
popupMgr()->setRule( action( 6014 ), aMeshInVtkHasFaces, QtxPopupMgr::VisibleRule );
popupMgr()->setRule( action( 6014 ), "controlMode = 'eMinimumAngle'", QtxPopupMgr::ToggleRule );
- popupMgr()->insert( action( 6015 ), aSubId, -1 ); // WARP
+ popupMgr()->insert ( action( 6015 ), aSubId, -1 ); // WARP
popupMgr()->setRule( action( 6015 ), aMeshInVtkHasFaces, QtxPopupMgr::VisibleRule );
popupMgr()->setRule( action( 6015 ), "controlMode = 'eWarping'", QtxPopupMgr::ToggleRule );
- popupMgr()->insert( action( 6016 ), aSubId, -1 ); // SKEW
+ popupMgr()->insert ( action( 6016 ), aSubId, -1 ); // SKEW
popupMgr()->setRule( action( 6016 ), aMeshInVtkHasFaces, QtxPopupMgr::VisibleRule );
popupMgr()->setRule( action( 6016 ), "controlMode = 'eSkew'", QtxPopupMgr::ToggleRule );
- popupMgr()->insert( action( 6022 ), aSubId, -1 ); // MAX_ELEMENT_LENGTH_2D
+ popupMgr()->insert ( action( 6022 ), aSubId, -1 ); // MAX_ELEMENT_LENGTH_2D
popupMgr()->setRule( action( 6022 ), aMeshInVtkHasFaces, QtxPopupMgr::VisibleRule );
popupMgr()->setRule( action( 6022 ), "controlMode = 'eMaxElementLength2D'", QtxPopupMgr::ToggleRule );
+ popupMgr()->insert ( action( 6025 ), aSubId, -1 ); // BARE_BORDER_FACE
+ popupMgr()->setRule( action( 6025 ), aMeshInVtkHasFaces, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 6025 ), "controlMode = 'eBareBorderFace'", QtxPopupMgr::ToggleRule );
+
aSubId = popupMgr()->insert( tr( "MEN_VOLUME_CTRL" ), anId, -1 ); // VOLUME CONTROLS
- popupMgr()->insert( action( 6017 ), aSubId, -1 ); // ASPECT_3D
+ popupMgr()->insert ( action( 6017 ), aSubId, -1 ); // ASPECT_3D
popupMgr()->setRule( action( 6017 ), aMeshInVtkHasVolumes, QtxPopupMgr::VisibleRule );
popupMgr()->setRule( action( 6017 ), "controlMode = 'eAspectRatio3D'", QtxPopupMgr::ToggleRule );
popupMgr()->setRule( action( 6009 ), aMeshInVtkHasVolumes, QtxPopupMgr::VisibleRule );
popupMgr()->setRule( action( 6009 ), "controlMode = 'eVolume3D'", QtxPopupMgr::ToggleRule );
- popupMgr()->insert( action( 6023 ), aSubId, -1 ); // MAX_ELEMENT_LENGTH_3D
+ popupMgr()->insert ( action( 6023 ), aSubId, -1 ); // MAX_ELEMENT_LENGTH_3D
popupMgr()->setRule( action( 6023 ), aMeshInVtkHasVolumes, QtxPopupMgr::VisibleRule );
popupMgr()->setRule( action( 6023 ), "controlMode = 'eMaxElementLength3D'", QtxPopupMgr::ToggleRule );
+ popupMgr()->insert ( action( 6024 ), aSubId, -1 ); // BARE_BORDER_VOLUME
+ popupMgr()->setRule( action( 6024 ), aMeshInVtkHasVolumes, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 6024 ), "controlMode = 'eBareBorderVolume'", QtxPopupMgr::ToggleRule );
+
popupMgr()->insert( separator(), anId, -1 );
popupMgr()->insert( action( 201 ), anId, -1 ); // SCALAR_BAR_PROP
theCriterion.Type != SMESH::FT_FreeNodes &&
theCriterion.Type != SMESH::FT_FreeFaces &&
theCriterion.Type != SMESH::FT_BadOrientedVolume &&
+ theCriterion.Type != SMESH::FT_BareBorderFace &&
+ theCriterion.Type != SMESH::FT_BareBorderVolume &&
theCriterion.Type != SMESH::FT_LinearOrQuadratic)
aTable->item( theRow, 2 )->setText(QString("%1").arg(theCriterion.Threshold, 0, 'g', 15));
else
ComboItem* anItem = ((ComboItem*)aTable->item(aRow, 0));
int aCriterion = GetCriterionType(aRow);
- bool toEnable = ((ComboItem*)aTable->item(aRow, 1))->value() == SMESH::FT_EqualTo &&
- aCriterion != SMESH::FT_RangeOfIds &&
- aCriterion != SMESH::FT_FreeEdges &&
- aCriterion != SMESH::FT_FreeFaces &&
- aCriterion != SMESH::FT_BadOrientedVolume;
+ bool toEnable = (((ComboItem*)aTable->item(aRow, 1))->value() == SMESH::FT_EqualTo &&
+ aCriterion != SMESH::FT_RangeOfIds &&
+ aCriterion != SMESH::FT_FreeEdges &&
+ aCriterion != SMESH::FT_FreeFaces &&
+ aCriterion != SMESH::FT_BadOrientedVolume &&
+ aCriterion != SMESH::FT_BareBorderFace &&
+ aCriterion != SMESH::FT_BareBorderVolume);
if (!myAddWidgets.contains(anItem))
{
if (aType == SMESH::NODE && aCriterionType == SMESH::FT_FreeNodes ||
aType == SMESH::EDGE && aCriterionType == SMESH::FT_FreeBorders ||
- aType == SMESH::FACE && (aCriterionType == SMESH::FT_FreeEdges ||
+ aType == SMESH::FACE && (aCriterionType == SMESH::FT_BareBorderFace ||
+ aCriterionType == SMESH::FT_FreeEdges ||
aCriterionType == SMESH::FT_FreeFaces) ||
- aType == SMESH::VOLUME && aCriterionType == SMESH::FT_BadOrientedVolume ||
+ aType == SMESH::VOLUME && (aCriterionType == SMESH::FT_BadOrientedVolume ||
+ aCriterionType == SMESH::FT_BareBorderVolume) ||
aCriterionType == SMESH::FT_LinearOrQuadratic ||
aCriterionType == SMESH::FT_GroupColor ||
aCriterionType == SMESH::FT_ElemGeomType)
aCriteria[ SMESH::FT_Length2D ] = tr("LENGTH2D");
aCriteria[ SMESH::FT_MultiConnection2D ] = tr("MULTI2D_BORDERS");
aCriteria[ SMESH::FT_FreeFaces ] = tr("FREE_FACES");
+ aCriteria[ SMESH::FT_BareBorderFace ] = tr("BARE_BORDER_FACE");
aCriteria[ SMESH::FT_LinearOrQuadratic ] = tr("LINEAR");
aCriteria[ SMESH::FT_GroupColor ] = tr("GROUP_COLOR");
aCriteria[ SMESH::FT_ElemGeomType ] = tr("GEOM_TYPE");
aCriteria[ SMESH::FT_BelongToGeom ] = tr("BELONG_TO_GEOM");
aCriteria[ SMESH::FT_LyingOnGeom ] = tr("LYING_ON_GEOM");
aCriteria[ SMESH::FT_BadOrientedVolume ] = tr("BAD_ORIENTED_VOLUME");
+ aCriteria[ SMESH::FT_BareBorderVolume ] = tr("BARE_BORDER_VOLUME");
aCriteria[ SMESH::FT_Volume3D ] = tr("VOLUME_3D");
aCriteria[ SMESH::FT_MaxElementLength3D ] = tr("MAX_ELEMENT_LENGTH_3D");
aCriteria[ SMESH::FT_LinearOrQuadratic ] = tr("LINEAR");
<source>ICON_VOLUME_3D</source>
<translation>mesh_volume_3d.png</translation>
</message>
+ <message>
+ <source>ICON_BARE_BORDER_VOLUME</source>
+ <translation>bare_border_volume.png</translation>
+ </message>
+ <message>
+ <source>ICON_BARE_BORDER_FACE</source>
+ <translation>bare_border_face.png</translation>
+ </message>
<message>
<source>ICON_WARP</source>
<translation>mesh_wrap.png</translation>
<source>TOP_FIND_ELEM</source>
<translation>Find Element by Point</translation>
</message>
+ <message>
+ <source>MEN_BARE_BORDER_VOLUME</source>
+ <translation>Volumes with bare border</translation>
+ </message>
+ <message>
+ <source>MEN_BARE_BORDER_FACE</source>
+ <translation>Faces with bare border</translation>
+ </message>
<message>
<source>MEN_FREE_BORDER</source>
<translation>Free Borders</translation>
<source>STB_FACES</source>
<translation>Faces</translation>
</message>
+ <message>
+ <source>STB_BARE_BORDER_VOLUME</source>
+ <translation>Volumes with bare border</translation>
+ </message>
+ <message>
+ <source>STB_BARE_BORDER_FACE</source>
+ <translation>Faces with bare border</translation>
+ </message>
<message>
<source>STB_FREE_BORDER</source>
<translation>Free Borders</translation>
<source>TOP_FACES</source>
<translation>Faces</translation>
</message>
+ <message>
+ <source>TOP_BARE_BORDER_VOLUME</source>
+ <translation>Volumes with bare border</translation>
+ </message>
+ <message>
+ <source>TOP_BARE_BORDER_FACE</source>
+ <translation>Faces with bare border</translation>
+ </message>
<message>
<source>TOP_FREE_BORDER</source>
<translation>Free Borders</translation>
<source>BAD_ORIENTED_VOLUME</source>
<translation>Bad oriented volume</translation>
</message>
+ <message>
+ <source>BARE_BORDER_VOLUME</source>
+ <translation>Volumes with bare border</translation>
+ </message>
+ <message>
+ <source>BARE_BORDER_FACE</source>
+ <translation>Faces with bare border</translation>
+ </message>
<message>
<source>BELONG_TO_CYLINDER</source>
<translation>Belong to Cylinder</translation>
enum _ListenerDataType
{
WAIT_HYP_MODIF=1, // data indicating awaiting for valid parameters of src hyp
+ LISTEN_SRC_MESH, // data storing submesh depending on source mesh state
SRC_HYP // data storing ImportSource hyp
};
//================================================================================
struct _ListenerData : public SMESH_subMeshEventListenerData
{
const StdMeshers_ImportSource1D* _srcHyp;
- _ListenerData(const StdMeshers_ImportSource1D* h):
+ _ListenerData(const StdMeshers_ImportSource1D* h, _ListenerDataType type=SRC_HYP):
SMESH_subMeshEventListenerData(/*isDeletable=*/true), _srcHyp(h)
{
- myType = SRC_HYP;
+ myType = type;
}
};
//================================================================================
// set a listener to hear events of the source mesh
SMESH_subMesh* smToNotify = importSub;
SMESH_subMesh* smToListen = srcMesh->GetSubMeshContaining(1);
- importSub->SetEventListener
- ( new SMESH_subMeshEventListener(/*isDeletable=*/true),
- SMESH_subMeshEventListenerData::MakeData( smToNotify ),
- smToListen );
+ SMESH_subMeshEventListenerData* data = new _ListenerData(srcHyp, LISTEN_SRC_MESH);
+ data->mySubMeshes.push_back( smToNotify );
+ importSub->SetEventListener( get(), data, smToListen );
// remeber the submesh
_ImportData* iData = _Listener::getImportData( srcMesh, importSub->GetFather());
bool copyMesh = !d->_copyMeshSubM.empty();
if ( copyMesh )
{
+ // remove imported mesh and groups
+ d->removeImportedMesh( sm->GetFather()->GetMeshDS() );
+
+ if ( data )
+ d->removeGroups( sm, data->_srcHyp );
+
// clear submeshes
if ( !d->_computedSubM.empty() )
{
subM->ComputeStateEngine( SMESH_subMesh::CLEAN );
}
}
- // remove imported mesh and groups
- d->removeImportedMesh( sm->GetFather()->GetMeshDS() );
-
- if ( data )
- d->removeGroups( sm, data->_srcHyp );
+ }
+ else
+ {
+ sm->ComputeStateEngine( SMESH_subMesh::CLEAN );
}
}
if ( data )
{
if ( data && data->myType == WAIT_HYP_MODIF )
{
+ // event of Import submesh
if ( SMESH_subMesh::MODIF_HYP == event &&
SMESH_subMesh::ALGO_EVENT == eventType )
{
algo->SetEventListener( subMesh );
}
}
- else
+ else if ( data && data->myType == LISTEN_SRC_MESH )
{
- SMESH_Gen* gen = subMesh->GetFather()->GetGen();
- SMESH_Algo* algo = gen->GetAlgo(*subMesh->GetFather(),subMesh->GetSubShape() );
+ // event of source mesh
+ if ( SMESH_subMesh::COMPUTE_EVENT == eventType )
+ {
+ switch ( event ) {
+ case SMESH_subMesh::CLEAN:
+ clearSubmesh( data->mySubMeshes.front(), (_ListenerData*) data );
+ break;
+ case SMESH_subMesh::COMPUTE:
+ if ( subMesh->GetComputeState() == SMESH_subMesh::COMPUTE_OK )
+ data->mySubMeshes.front()->ComputeStateEngine( SMESH_subMesh::SUBMESH_COMPUTED );
+ break;
+ default:;
+ }
+ }
+ }
+ else // event of Import submesh
+ {
+ bool removeImport = false;
+ if ( subMesh->GetAlgoState() != SMESH_subMesh::HYP_OK )
+ {
+ removeImport = true;
+ }
+ else if ( SMESH_subMesh::REMOVE_ALGO == event ||
+ SMESH_subMesh::REMOVE_FATHER_ALGO == event )
+ {
+ SMESH_Gen* gen = subMesh->GetFather()->GetGen();
+ SMESH_Algo* algo = gen->GetAlgo(*subMesh->GetFather(),subMesh->GetSubShape() );
+ removeImport = ( strncmp( "Import", algo->GetName(), 6 ) != 0 );
+ }
- if ( subMesh->GetAlgoState() != SMESH_subMesh::HYP_OK ||
- strncmp( "Import", algo->GetName(), 6 ) != 0 )
+ if ( removeImport )
{
// treate removal of Import algo from subMesh
removeSubmesh( subMesh, (_ListenerData*) data );
subShapeIDs.insert( shapeID );
// get nodes on vertices
- list < SMESH_MeshEditor::TNodeXYZ > vertexNodes;
- list < SMESH_MeshEditor::TNodeXYZ >::iterator vNIt;
+ list < SMESH_MeshEditor::TNodeXYZ > vertexNodes;
+ list < SMESH_MeshEditor::TNodeXYZ >::iterator vNIt;
TopExp_Explorer vExp( theShape, TopAbs_VERTEX );
for ( ; vExp.More(); vExp.Next() )
{
n2n->clear();
e2e->clear();
+ {
+ cout << "IMPORT SubMesh " << endl << " Elems:";
+ SMDS_ElemIteratorPtr eIt = tgtSubMesh->GetElements();
+ while ( eIt->more() )
+ cout << " " << eIt->next()->GetID();
+ cout << endl << " Nodes:";
+ SMDS_NodeIteratorPtr nIt = tgtSubMesh->GetNodes();
+ while ( nIt->more() )
+ cout << " " << nIt->next()->GetID();
+ cout << endl;
+ }
// Remember created groups in order to remove them as soon as the srcHyp is
// modified or something other similar happens. Store them in a hypothesis
// as it stores its values anyway
const bool toCheckOri = (helper.NbAncestors( geomFace, theMesh, TopAbs_SOLID ) == 1 );
Handle(Geom_Surface) surface = BRep_Tool::Surface( geomFace );
- if ( helper.GetSubShapeOri( tgtMesh->ShapeToMesh(), geomFace) == TopAbs_REVERSED )
- surface->UReverse();
+ const bool reverse =
+ ( helper.GetSubShapeOri( tgtMesh->ShapeToMesh(), geomFace) == TopAbs_REVERSED );
gp_Pnt p; gp_Vec du, dv;
set<int> subShapeIDs;
{
uv = helper.GetNodeUV( geomFace, newNodes[++iNode] );
surface->D1( uv.X(),uv.Y(), p, du,dv );
- geomNorm = du ^ dv;
+ geomNorm = reverse ? dv^du : du^dv;
}
while ( geomNorm.SquareMagnitude() < 1e-6 && iNode+1 < face->NbCornerNodes());
for ( unsigned iE = 0; iE < edges.size(); ++iE )
theMesh.GetSubMesh( edges[iE] )->ComputeStateEngine(SMESH_subMesh::CHECK_COMPUTE_STATE);
+ SMESH_subMesh* sm = theMesh.GetSubMesh(theShape);
+ SMESH_subMeshIteratorPtr smIt = sm->getDependsOnIterator(true,false);
+ cout << endl << string(80,'=') << endl
+ << "Compute( face " << tgtMesh->ShapeToIndex(theShape) << endl;
+ while ( smIt->more() )
+ {
+ sm = smIt->next();
+ TopAbs::Print(sm->GetSubShape().ShapeType(), cout);
+ cout << " " << sm->GetId() << endl << " Elems:";
+ SMDS_ElemIteratorPtr eIt = sm->GetSubMeshDS()->GetElements();
+ while ( eIt->more() )
+ cout << " " << eIt->next()->GetID();
+ cout << endl << " Nodes:";
+ SMDS_NodeIteratorPtr nIt = sm->GetSubMeshDS()->GetNodes();
+ while ( nIt->more() )
+ cout << " " << nIt->next()->GetID();
+ cout << endl;
+ }
+
// ============
// Copy meshes
// ============