filters_ex37.py
filters_ex38.py
filters_ex39.py
+ filters_node_nb_conn.py
filters_belong2group.py
grouping_elements_ex01.py
grouping_elements_ex02.py
--- /dev/null
+# Number of connectivities of a node
+
+# create a mesh
+from SMESH_mechanic import *
+
+# get nodes connected to more than 6 tetrahedra
+conn_nb_filter = smesh.GetFilter(SMESH.NODE, SMESH.FT_NodeConnectivityNumber,'>', 6 )
+ids = mesh.GetIdsFromFilter( conn_nb_filter )
+print "Number of nodes connected to more than 6 tetrahedra:", len(ids)
To view the <b>Mesh Information</b>, select your mesh, sub-mesh or
group in the <b>Object Browser</b> and invoke <b>Mesh Information</b>
-item from the \b Mesh menu or click <em>"Mesh Information"</em> button
+item from the \b Mesh menu or from the context menu, or click <em>"Mesh Information"</em> button
in the toolbar.
<center>\image html image49.png
- Gravity center (X, Y, Z coordinates);
- Connectivity information (connected nodes); double click in
a line of a node reveals the information about this node;
- - Quality controls (area, aspect ration, volume, etc.);
+ - Quality controls (area, aspect ratio, volume, etc.);
- Position on a shape (for meshes built on a geometry);
- Groups information (names of groups the element belongs to).
- Name;
- Nodes information:
- Number of free nodes;
+ - Maximal number of elements connected to a node;
- Number of double nodes;
- Edges information:
- Number of double edges;
The button \b "Dump" allows printing the information displayed in the
dialog box to a .txt file.
-In case you get <b>Mesh Information</b> via a TUI script, the information is
-displayed in the Python Console.
-
See the \ref tui_viewing_mesh_infos "TUI Example".
*/
<b>Double nodes</b> selects a node coincident with other nodes
(within a given <b>Tolerance</b>).
See also \ref tui_double_nodes_control "Double Nodes quality control".
+</li><li>
+<b>Connectivity number</b> selects nodes with a number of connected
+elements, which is more, less or equal to the predefined <b>Threshold
+ Value</b>. Elements of the highest dimension are countered only.
</li>
</ul>
\tui_script{filters_ex17.py}
+\section filter_node_nb_conn Node connectivity number
+
+filters nodes according to a number of elements of highest dimension connected to a node:
+- element type should be \a SMESH.NODE
+- functor type should be \a SMESH.FT_NodeConnectivityNumber
+- threshold is an integer value (number of elements)
+
+\tui_script{filters_node_nb_conn.py}
+
+
\section filter_borders_multiconnection Borders at multi-connection
filters 1D mesh elements (segments) according to the specified number of
FT_MultiConnection2D,
FT_Length,
FT_Length2D,
+ FT_NodeConnectivityNumber,
FT_BelongToMeshGroup,
FT_BelongToGeom,
FT_BelongToPlane,
Values GetValues();
};
interface BallDiameter : NumericalFunctor{};
+ interface NodeConnectivityNumber : NumericalFunctor{};
/*!
MultiConnection CreateMultiConnection();
MultiConnection2D CreateMultiConnection2D();
BallDiameter CreateBallDiameter();
+ NodeConnectivityNumber CreateNodeConnectivityNumber();
/*!
* Create logical functors ( predicates )
*/
return SMDSAbs_Ball;
}
+//================================================================================
+/*
+ Class : NodeConnectivityNumber
+ Description : Functor returning number of elements connected to a node
+*/
+//================================================================================
+
+double NodeConnectivityNumber::GetValue( long theId )
+{
+ double nb = 0;
+
+ if ( const SMDS_MeshNode* node = myMesh->FindNode( theId ))
+ {
+ SMDSAbs_ElementType type;
+ if ( myMesh->NbVolumes() > 0 )
+ type = SMDSAbs_Volume;
+ else if ( myMesh->NbFaces() > 0 )
+ type = SMDSAbs_Face;
+ else if ( myMesh->NbEdges() > 0 )
+ type = SMDSAbs_Edge;
+ else
+ return 0;
+ nb = node->NbInverseElements( type );
+ }
+ return nb;
+}
+
+double NodeConnectivityNumber::GetBadRate( double Value, int /*nbNodes*/ ) const
+{
+ return Value;
+}
+
+SMDSAbs_ElementType NodeConnectivityNumber::GetType() const
+{
+ return SMDSAbs_Node;
+}
/*
PREDICATES
virtual SMDSAbs_ElementType GetType() const;
};
+ /*
+ Class : NodeConnectivityNumber
+ Description : Functor returning number of elements connected to a node
+ */
+ class SMESHCONTROLS_EXPORT NodeConnectivityNumber: public virtual NumericalFunctor{
+ public:
+ virtual double GetValue( long theNodeId );
+ virtual double GetBadRate( double Value, int nbNodes ) const;
+ virtual SMDSAbs_ElementType GetType() const;
+ };
+
/*
PREDICATES
}
}
-bool SMESH_ActorDef::GetPointsLabeled() {
+bool SMESH_ActorDef::GetPointsLabeled()
+{
return myNodeActor && myNodeActor->GetPointsLabeled();
}
}
-bool SMESH_ActorDef::GetCellsLabeled() {
+bool SMESH_ActorDef::GetCellsLabeled()
+{
bool result = false;
if(my3DActor)
result = result || my3DActor->GetCellsLabeled();
}
-void
-SMESH_ActorDef::
-SetControlMode(eControl theMode)
+void SMESH_ActorDef::SetControlMode(eControl theMode)
{
SetControlMode(theMode,true);
}
-void
-SMESH_ActorDef::
-SetControlMode( eControl theMode, bool theCheckEntityMode )
+void SMESH_ActorDef::SetControlMode( eControl theMode, bool theCheckEntityMode )
{
vtkLookupTable* lookupTable = static_cast<vtkLookupTable*>(myScalarBarActor->GetLookupTable());
bool isLogarithmic = lookupTable->GetScale() == VTK_SCALE_LOG10;
myControlActor = my2DActor;
break;
}
+ case eNodeConnectivityNb:
+ {
+ myFunctor.reset( new SMESH::Controls::NodeConnectivityNumber() );
+ myControlActor = myNodeActor;
+ break;
+ }
default:
return;
}
vtkUnstructuredGrid* aGrid = myControlActor->GetUnstructuredGrid();
vtkIdType aNbCells = aGrid->GetNumberOfCells();
bool aShowOnlyScalarBarTitle = false;
- if(aNbCells){
+ if(aNbCells) {
myControlMode = theMode;
switch(myControlMode){
case eFreeNodes:
}
if(theCheckEntityMode) {
+ // if(myControlActor == myNodeActor) {
+ // if ( myControlMode == eNodeConnectivityNb ) {
+ // if (!myIsEntityModeCache){
+ // myEntityModeCache = GetEntityMode();
+ // myIsEntityModeCache=true;
+ // }
+ // SetEntityMode(0);
+ // }
+ // }
if(myControlActor == my1DActor) {
if (!myIsEntityModeCache){
myEntityModeCache = GetEntityMode();
Update();
}
-int
-SMESH_ActorDef::
-GetNumberControlEntities(){
+int SMESH_ActorDef::GetNumberControlEntities()
+{
SMESH_DeviceActor* anAct = NULL;
switch(myControlMode){
case eFreeNodes:
case eCoincidentElems3D:
anAct = my3DExtActor;
break;
+ default:;
}
return (anAct) ? anAct->GetUnstructuredGrid()->GetNumberOfCells() : -1;
}
-void SMESH_ActorDef::AddToRender(vtkRenderer* theRenderer){
-
+void SMESH_ActorDef::AddToRender(vtkRenderer* theRenderer)
+{
theRenderer->AddActor(myBaseActor);
theRenderer->AddActor(myNodeExtActor);
theRenderer->AddActor(my1DExtActor);
SALOME_Actor::AddToRender(theRenderer);
}
-void SMESH_ActorDef::RemoveFromRender(vtkRenderer* theRenderer){
+void SMESH_ActorDef::RemoveFromRender(vtkRenderer* theRenderer)
+{
SALOME_Actor::RemoveFromRender(theRenderer);
theRenderer->RemoveActor(myBaseActor);
bool SMESH_ActorDef::Init(TVisualObjPtr theVisualObj,
- const char* theEntry,
- const char* theName,
- int theIsClear)
+ const char* theEntry,
+ const char* theName,
+ int theIsClear)
{
Handle(SALOME_InteractiveObject) anIO = new SALOME_InteractiveObject(theEntry,"SMESH",theName);
setIO(anIO);
}
-double* SMESH_ActorDef::GetBounds(){
+double* SMESH_ActorDef::GetBounds()
+{
return myNodeActor->GetBounds();
}
-vtkDataSet* SMESH_ActorDef::GetInput(){
+vtkDataSet* SMESH_ActorDef::GetInput()
+{
return GetUnstructuredGrid();
}
-void SMESH_ActorDef::SetTransform(VTKViewer_Transform* theTransform){
+void SMESH_ActorDef::SetTransform(VTKViewer_Transform* theTransform)
+{
Superclass::SetTransform(theTransform);
myNodeActor->SetTransform(theTransform);
}
-void SMESH_ActorDef::SetMapper(vtkMapper* theMapper){
+void SMESH_ActorDef::SetMapper(vtkMapper* theMapper)
+{
vtkLODActor::SetMapper(theMapper);
}
-void SMESH_ActorDef::ShallowCopy(vtkProp *prop){
+void SMESH_ActorDef::ShallowCopy(vtkProp *prop)
+{
SALOME_Actor::ShallowCopy(prop);
}
-vtkMapper* SMESH_ActorDef::GetMapper(){
+vtkMapper* SMESH_ActorDef::GetMapper()
+{
return myPickableActor->GetMapper();
}
-vtkUnstructuredGrid* SMESH_ActorDef::GetUnstructuredGrid(){
+vtkUnstructuredGrid* SMESH_ActorDef::GetUnstructuredGrid()
+{
return myVisualObj->GetUnstructuredGrid();
}
-bool SMESH_ActorDef::IsInfinitive(){
+bool SMESH_ActorDef::IsInfinitive()
+{
vtkDataSet *aDataSet = myPickableActor->GetUnstructuredGrid();
myIsInfinite = aDataSet->GetNumberOfCells() == 0 ||
( aDataSet->GetNumberOfCells() == 1 &&
}
-void SMESH_ActorDef::SetIsShrunkable(bool theShrunkable){
+void SMESH_ActorDef::SetIsShrunkable(bool theShrunkable)
+{
if ( myIsShrinkable == theShrunkable )
return;
myIsShrinkable = theShrunkable;
Modified();
}
-double SMESH_ActorDef::GetShrinkFactor(){
+double SMESH_ActorDef::GetShrinkFactor()
+{
return myBaseActor->GetShrinkFactor();
}
-void SMESH_ActorDef::SetShrinkFactor(double theValue){
+void SMESH_ActorDef::SetShrinkFactor(double theValue)
+{
myBaseActor->SetShrinkFactor(theValue);
my1DActor->SetShrinkFactor(theValue);
Modified();
}
-void SMESH_ActorDef::SetShrink() {
+void SMESH_ActorDef::SetShrink()
+{
if(!myIsShrinkable) return;
myBaseActor->SetShrink();
Modified();
}
-void SMESH_ActorDef::UnShrink(){
+void SMESH_ActorDef::UnShrink()
+{
if(!myIsShrunk) return;
myBaseActor->UnShrink();
}
-int SMESH_ActorDef::GetNodeObjId(int theVtkID){
+int SMESH_ActorDef::GetNodeObjId(int theVtkID)
+{
return myPickableActor->GetNodeObjId(theVtkID);
}
-double* SMESH_ActorDef::GetNodeCoord(int theObjID){
+double* SMESH_ActorDef::GetNodeCoord(int theObjID)
+{
return myPickableActor->GetNodeCoord(theObjID);
}
-int SMESH_ActorDef::GetElemObjId(int theVtkID){
+int SMESH_ActorDef::GetElemObjId(int theVtkID)
+{
return myPickableActor->GetElemObjId(theVtkID);
}
-vtkCell* SMESH_ActorDef::GetElemCell(int theObjID){
+vtkCell* SMESH_ActorDef::GetElemCell(int theObjID)
+{
return myPickableActor->GetElemCell(theObjID);
}
-void SMESH_ActorDef::SetVisibility(int theMode){
+void SMESH_ActorDef::SetVisibility(int theMode)
+{
SetVisibility(theMode,true);
}
-void SMESH_ActorDef::SetVisibility(int theMode, bool theIsUpdateRepersentation){
+void SMESH_ActorDef::SetVisibility(int theMode, bool theIsUpdateRepersentation)
+{
SALOME_Actor::SetVisibility(theMode);
myNodeActor->VisibilityOff();
if(theIsUpdateRepersentation)
SetRepresentation(GetRepresentation());
- if(myControlMode != eNone){
- switch(myControlMode){
+ if(myControlMode != eNone) {
+ switch(myControlMode) {
case eFreeNodes:
case eCoincidentNodes:
myNodeExtActor->VisibilityOn();
case eMultiConnection2D:
my1DExtActor->VisibilityOn();
break;
+ default:;
}
if(myControlActor->GetUnstructuredGrid()->GetNumberOfCells())
myScalarBarActor->VisibilityOn();
}
-void SMESH_ActorDef::SetPointRepresentation(bool theIsPointsVisible){
+void SMESH_ActorDef::SetPointRepresentation(bool theIsPointsVisible)
+{
if ( myIsPointsVisible == theIsPointsVisible )
return;
myIsPointsVisible = theIsPointsVisible;
SetRepresentation(GetRepresentation());
}
-bool SMESH_ActorDef::GetPointRepresentation(){
+bool SMESH_ActorDef::GetPointRepresentation()
+{
return myIsPointsVisible || myNodeActor->GetPointsLabeled();
}
-void SMESH_ActorDef::UpdateHighlight(){
+void SMESH_ActorDef::UpdateHighlight()
+{
myHighlitableActor->SetHighlited(false);
myHighlitableActor->SetVisibility(false);
bool anIsVisible = GetVisibility();
}
-void SMESH_ActorDef::highlight(bool theHighlight){
+void SMESH_ActorDef::highlight(bool theHighlight)
+{
if ( myIsHighlighted == theHighlight )
return;
myIsHighlighted = theHighlight;
}
-void SMESH_ActorDef::SetPreSelected(bool thePreselect){
+void SMESH_ActorDef::SetPreSelected(bool thePreselect)
+{
if ( myIsPreselected == thePreselect )
return;
myIsPreselected = thePreselect;
}
-void SMESH_ActorDef::Render(vtkRenderer *ren){
+void SMESH_ActorDef::Render(vtkRenderer *ren)
+{
unsigned long aTime = myTimeStamp->GetMTime();
unsigned long anObjTime = myVisualObj->GetUnstructuredGrid()->GetMTime();
unsigned long aClippingTime = myImplicitBoolean->GetMTime();
}
-void SMESH_ActorDef::Update(){
+void SMESH_ActorDef::Update()
+{
if(MYDEBUG) MESSAGE("SMESH_ActorDef::Update");
if(GetControlMode() != eNone) {
}
-void SMESH_ActorDef::ReleaseGraphicsResources(vtkWindow *renWin){
+void SMESH_ActorDef::ReleaseGraphicsResources(vtkWindow *renWin)
+{
SALOME_Actor::ReleaseGraphicsResources(renWin);
myPickableActor->ReleaseGraphicsResources(renWin);
}
-static void GetColor(vtkProperty *theProperty, double& r,double& g,double& b){
+static void GetColor(vtkProperty *theProperty, double& r,double& g,double& b)
+{
double* aColor = theProperty->GetColor();
r = aColor[0];
g = aColor[1];
}
-void SMESH_ActorDef::SetOpacity(double theValue){
+void SMESH_ActorDef::SetOpacity(double theValue)
+{
mySurfaceProp->SetOpacity(theValue);
myBackSurfaceProp->SetOpacity(theValue);
myNormalVProp->SetOpacity(theValue);
}
-double SMESH_ActorDef::GetOpacity(){
+double SMESH_ActorDef::GetOpacity()
+{
return mySurfaceProp->GetOpacity();
}
-void SMESH_ActorDef::SetSufaceColor(double r,double g,double b, int delta){
+void SMESH_ActorDef::SetSufaceColor(double r,double g,double b, int delta)
+{
mySurfaceProp->SetColor(r,g,b);
my2DExtProp->SetColor(1.0-r,1.0-g,1.0-b);
if( SMESH_GroupObj* aGroupObj = dynamic_cast<SMESH_GroupObj*>( myVisualObj.get() ) )
Modified();
}
-void SMESH_ActorDef::GetSufaceColor(double& r,double& g,double& b, int& delta){
+void SMESH_ActorDef::GetSufaceColor(double& r,double& g,double& b, int& delta)
+{
::GetColor(mySurfaceProp,r,g,b);
delta = myDeltaBrightness;
}
-void SMESH_ActorDef::SetVolumeColor(double r,double g,double b, int delta){
+void SMESH_ActorDef::SetVolumeColor(double r,double g,double b, int delta)
+{
myNormalVProp->SetColor(r,g,b);
my3DExtProp->SetColor(1.0-r,1.0-g,1.0-b);
if( SMESH_GroupObj* aGroupObj = dynamic_cast<SMESH_GroupObj*>( myVisualObj.get() ) )
Modified();
}
-void SMESH_ActorDef::GetVolumeColor(double& r,double& g,double& b, int& delta){
+void SMESH_ActorDef::GetVolumeColor(double& r,double& g,double& b, int& delta)
+{
::GetColor(myNormalVProp,r,g,b);
delta = myDeltaVBrightness;
}
-void SMESH_ActorDef::SetEdgeColor(double r,double g,double b){
+void SMESH_ActorDef::SetEdgeColor(double r,double g,double b)
+{
myEdgeProp->SetColor(r,g,b);
my1DProp->SetColor(r,g,b);
my1DExtProp->SetColor(1.0-r,1.0-g,1.0-b);
Modified();
}
-void SMESH_ActorDef::GetEdgeColor(double& r,double& g,double& b){
+void SMESH_ActorDef::GetEdgeColor(double& r,double& g,double& b)
+{
::GetColor(myEdgeProp,r,g,b);
}
-void SMESH_ActorDef::SetOutlineColor(double r,double g,double b){
+void SMESH_ActorDef::SetOutlineColor(double r,double g,double b)
+{
myOutLineProp->SetColor(r,g,b);
Modified();
}
-void SMESH_ActorDef::GetOutlineColor(double& r,double& g,double& b){
+void SMESH_ActorDef::GetOutlineColor(double& r,double& g,double& b)
+{
::GetColor(myOutLineProp,r,g,b);
}
-void SMESH_ActorDef::SetNodeColor(double r,double g,double b){
+void SMESH_ActorDef::SetNodeColor(double r,double g,double b)
+{
myNodeProp->SetColor(r,g,b);
myNodeExtProp->SetColor(1.0-r,1.0-g,1.0-b);
if( SMESH_GroupObj* aGroupObj = dynamic_cast<SMESH_GroupObj*>( myVisualObj.get() ) )
Modified();
}
-void SMESH_ActorDef::GetNodeColor(double& r,double& g,double& b){
+void SMESH_ActorDef::GetNodeColor(double& r,double& g,double& b)
+{
::GetColor(myNodeProp,r,g,b);
}
-void SMESH_ActorDef::Set0DColor(double r,double g,double b){
+void SMESH_ActorDef::Set0DColor(double r,double g,double b)
+{
my0DProp->SetColor(r,g,b);
if( SMESH_GroupObj* aGroupObj = dynamic_cast<SMESH_GroupObj*>( myVisualObj.get() ) )
if( aGroupObj->GetElementType() == SMDSAbs_0DElement )
Modified();
}
-void SMESH_ActorDef::Get0DColor(double& r,double& g,double& b){
+void SMESH_ActorDef::Get0DColor(double& r,double& g,double& b)
+{
::GetColor(my0DProp,r,g,b);
}
-void SMESH_ActorDef::SetBallColor(double r,double g,double b){
+void SMESH_ActorDef::SetBallColor(double r,double g,double b)
+{
myBallProp->SetColor(r,g,b);
if( SMESH_GroupObj* aGroupObj = dynamic_cast<SMESH_GroupObj*>( myVisualObj.get() ) )
if( aGroupObj->GetElementType() == SMDSAbs_Ball )
Modified();
}
-void SMESH_ActorDef::GetBallColor(double& r,double& g,double& b){
+void SMESH_ActorDef::GetBallColor(double& r,double& g,double& b)
+{
::GetColor(myBallProp,r,g,b);
}
-void SMESH_ActorDef::SetHighlightColor(double r,double g,double b){
+void SMESH_ActorDef::SetHighlightColor(double r,double g,double b)
+{
myHighlightProp->SetColor(r,g,b);
Modified();
}
-void SMESH_ActorDef::GetHighlightColor(double& r,double& g,double& b){
+void SMESH_ActorDef::GetHighlightColor(double& r,double& g,double& b)
+{
::GetColor(myHighlightProp,r,g,b);
}
-void SMESH_ActorDef::SetPreHighlightColor(double r,double g,double b){
+void SMESH_ActorDef::SetPreHighlightColor(double r,double g,double b)
+{
myPreselectProp->SetColor(r,g,b);
Modified();
}
-void SMESH_ActorDef::GetPreHighlightColor(double& r,double& g,double& b){
+void SMESH_ActorDef::GetPreHighlightColor(double& r,double& g,double& b)
+{
::GetColor(myPreselectProp,r,g,b);
}
-double SMESH_ActorDef::GetLineWidth(){
+double SMESH_ActorDef::GetLineWidth()
+{
return myEdgeProp->GetLineWidth();
}
-void SMESH_ActorDef::SetLineWidth(double theVal){
+void SMESH_ActorDef::SetLineWidth(double theVal)
+{
myEdgeProp->SetLineWidth(theVal);
my1DProp->SetLineWidth(theVal + aLineWidthInc);
Modified();
}
-void SMESH_ActorDef::Set0DSize(double theVal){
+void SMESH_ActorDef::Set0DSize(double theVal)
+{
my0DProp->SetPointSize(theVal);
myHighlightProp->SetPointSize(theVal);
myPreselectProp->SetPointSize(theVal);
Modified();
}
-double SMESH_ActorDef::Get0DSize(){
+double SMESH_ActorDef::Get0DSize()
+{
return my0DProp->GetPointSize();
}
-void SMESH_ActorDef::SetBallSize(double theVal){
+void SMESH_ActorDef::SetBallSize(double theVal)
+{
myBallProp->SetPointSize(theVal);
if(SMESH_SVTKActor* aCustom = SMESH_SVTKActor::SafeDownCast( myHighlightActor )) {
Modified();
}
-double SMESH_ActorDef::GetBallSize(){
+double SMESH_ActorDef::GetBallSize()
+{
return myBallProp->GetPointSize();
}
return myVisualObj->GetElemDimension( theObjId );
}
-bool
-SMESH_ActorDef::
-IsImplicitFunctionUsed() const
+bool SMESH_ActorDef::IsImplicitFunctionUsed() const
{
return myBaseActor->IsImplicitFunctionUsed();
}
-void
-SMESH_ActorDef::SetImplicitFunctionUsed(bool theIsImplicitFunctionUsed)
+void SMESH_ActorDef::SetImplicitFunctionUsed(bool theIsImplicitFunctionUsed)
{
myNodeActor->SetImplicitFunctionUsed(theIsImplicitFunctionUsed);
myBaseActor->SetImplicitFunctionUsed(theIsImplicitFunctionUsed);
my3DExtActor->SetImplicitFunctionUsed(theIsImplicitFunctionUsed);
}
-vtkIdType
-SMESH_ActorDef::AddClippingPlane(vtkPlane* thePlane)
+vtkIdType SMESH_ActorDef::AddClippingPlane(vtkPlane* thePlane)
{
if(thePlane){
myImplicitBoolean->GetFunction()->AddItem(thePlane);
return myCippingPlaneCont.size();
}
-void
-SMESH_ActorDef::AddOpenGLClippingPlane(vtkPlane* thePlane)
+void SMESH_ActorDef::AddOpenGLClippingPlane(vtkPlane* thePlane)
{
if(thePlane)
myPlaneCollection->AddItem( thePlane );
}
-void
-SMESH_ActorDef::SetOpenGLClippingPlane()
+void SMESH_ActorDef::SetOpenGLClippingPlane()
{
// before use this method you must add clipping planes using method
// SMESH_ActorDef::AddOpenGLClippingPlane(vtkPlane* thePlane)
Modified();
}
-void
-SMESH_ActorDef::
-RemoveAllClippingPlanes()
+void SMESH_ActorDef::RemoveAllClippingPlanes()
{
myPlaneCollection->RemoveAllItems();
myImplicitBoolean->GetFunction()->RemoveAllItems();
myNodeActor->UpdateLabels();
}
-vtkIdType
-SMESH_ActorDef::
-GetNumberOfClippingPlanes()
+vtkIdType SMESH_ActorDef::GetNumberOfClippingPlanes()
{
return myCippingPlaneCont.size();
}
-vtkPlane*
-SMESH_ActorDef::
-GetClippingPlane(vtkIdType theID)
+vtkPlane* SMESH_ActorDef::GetClippingPlane(vtkIdType theID)
{
if ( theID >= (vtkIdType)myCippingPlaneCont.size() )
return NULL;
SMESH_VisualObjDef::TEntityList elems;
if ( ! dynamic_cast<SMESH_MeshObj*>(myVisualObj.get()))
dynamic_cast<SMESH_VisualObjDef*>(myVisualObj.get())->GetEntities( fun->GetType(), elems );
- std::vector<int> elemIds;
+ std::vector<int> elemIds; elemIds.reserve( elems.size() );
for ( SMESH_VisualObjDef::TEntityList::iterator e = elems.begin(); e != elems.end(); ++e)
elemIds.push_back( (*e)->GetID());
vtkLookupTable* lookupTable = static_cast<vtkLookupTable*>(myScalarBarActor->GetLookupTable());
}
#ifndef DISABLE_PLOT2DVIEWER
-SPlot2d_Histogram* SMESH_ActorDef::UpdatePlot2Histogram() {
-
+SPlot2d_Histogram* SMESH_ActorDef::UpdatePlot2Histogram()
+{
if(my2dHistogram)
my2dHistogram->clearAllPoints();
eMinimumAngle, eWarping, eSkew, eAspectRatio3D, eMultiConnection2D, eVolume3D,
eMaxElementLength2D, eMaxElementLength3D, eBareBorderFace, eBareBorderVolume,
eOverConstrainedFace, eOverConstrainedVolume, eCoincidentNodes,
- eCoincidentElems1D, eCoincidentElems2D, eCoincidentElems3D };
+ eCoincidentElems1D, eCoincidentElems2D, eCoincidentElems3D, eNodeConnectivityNb };
virtual void SetControlMode(eControl theMode) = 0;
virtual eControl GetControlMode() = 0;
virtual SMESH::Controls::FunctorPtr GetFunctor() = 0;
type = QObject::tr( "EQUAL_FACE" );
else if ( dynamic_cast< SMESH::Controls::CoincidentElements3D* >( f.get() ) )
type = QObject::tr( "EQUAL_VOLUME" );
+ else if ( dynamic_cast< SMESH::Controls::NodeConnectivityNumber* >( f.get() ) )
+ type = QObject::tr( "NODE_CONNECTIVITY_NB" );
return type;
}
ActionControl.Bind( 0, SMESH_Actor::eNone );
ActionControl.Bind( SMESHOp::OpFreeNode, SMESH_Actor::eFreeNodes );
ActionControl.Bind( SMESHOp::OpEqualNode, SMESH_Actor::eCoincidentNodes );
+ ActionControl.Bind( SMESHOp::OpNodeConnectivityNb, SMESH_Actor::eNodeConnectivityNb );
ActionControl.Bind( SMESHOp::OpFreeEdge, SMESH_Actor::eFreeEdges );
ActionControl.Bind( SMESHOp::OpFreeBorder, SMESH_Actor::eFreeBorders );
ActionControl.Bind( SMESHOp::OpLength, SMESH_Actor::eLength );
// CONTROLS
case SMESHOp::OpFreeNode:
case SMESHOp::OpEqualNode:
+ case SMESHOp::OpNodeConnectivityNb:
case SMESHOp::OpFreeEdge:
case SMESHOp::OpFreeBorder:
case SMESHOp::OpLength:
//update
createSMESHAction( SMESHOp::OpFreeNode, "FREE_NODE", "ICON_FREE_NODE", 0, true );
createSMESHAction( SMESHOp::OpEqualNode, "EQUAL_NODE", "ICON_EQUAL_NODE", 0, true );
+ createSMESHAction( SMESHOp::OpNodeConnectivityNb, "NODE_CONNECTIVITY_NB", "ICON_NODE_CONN_NB", 0, true );
createSMESHAction( SMESHOp::OpFreeEdge, "FREE_EDGE", "ICON_FREE_EDGE", 0, true );
createSMESHAction( SMESHOp::OpFreeBorder, "FREE_BORDER", "ICON_FREE_EDGE_2D", 0, true );
createSMESHAction( SMESHOp::OpLength, "LENGTH", "ICON_LENGTH", 0, true );
createSMESHAction( SMESHOp::OpSortChild, "SORT_CHILD_ITEMS" );
QList<int> aCtrlActions;
- aCtrlActions << SMESHOp::OpFreeNode << SMESHOp::OpEqualNode // node controls
+ aCtrlActions << SMESHOp::OpFreeNode << SMESHOp::OpEqualNode
+ << SMESHOp::OpNodeConnectivityNb // node controls
<< SMESHOp::OpFreeEdge << SMESHOp::OpFreeBorder
<< SMESHOp::OpLength << SMESHOp::OpConnection << SMESHOp::OpEqualEdge // edge controls
<< SMESHOp::OpFreeFace << SMESHOp::OpLength2D << SMESHOp::OpConnection2D
createMenu( SMESHOp::OpFreeNode, nodeId, -1 );
createMenu( SMESHOp::OpEqualNode, nodeId, -1 );
+ //createMenu( SMESHOp::OpNodeConnectivityNb, nodeId, -1 );
createMenu( SMESHOp::OpFreeBorder, edgeId, -1 );
createMenu( SMESHOp::OpLength, edgeId, -1 );
createMenu( SMESHOp::OpConnection, edgeId, -1 );
createTool( SMESHOp::OpFreeNode, ctrl0dTb );
createTool( SMESHOp::OpEqualNode, ctrl0dTb );
+ //createTool( SMESHOp::OpNodeConnectivityNb, ctrl0dTb );
createTool( SMESHOp::OpFreeBorder, ctrl1dTb );
createTool( SMESHOp::OpLength, ctrl1dTb );
popupMgr()->setRule( action( SMESHOp::OpEqualNode ), aMeshInVtkHasNodes, QtxPopupMgr::VisibleRule );
popupMgr()->setRule( action( SMESHOp::OpEqualNode ), "controlMode = 'eCoincidentNodes'", QtxPopupMgr::ToggleRule);
+ // popupMgr()->insert( action( SMESHOp::OpNodeConnectivityNb ), aSubId, -1 );
+ // popupMgr()->setRule( action( SMESHOp::OpNodeConnectivityNb ), aMeshInVtkHasNodes, QtxPopupMgr::VisibleRule );
+ // popupMgr()->setRule( action( SMESHOp::OpNodeConnectivityNb ), "controlMode = 'eNodeConnectivityNb'", QtxPopupMgr::ToggleRule );
+
aSubId = popupMgr()->insert( tr( "MEN_EDGE_CTRL" ), anId, -1 ); // EDGE CONTROLS
popupMgr()->insert( action( SMESHOp::OpFreeBorder ), aSubId, -1 );
case SMESH::FT_EqualFaces:
case SMESH::FT_EqualVolumes: break;
+ case SMESH::FT_NodeConnectivityNumber:
case SMESH::FT_MultiConnection:
case SMESH::FT_MultiConnection2D: anIsIntCriterion = true; nbCompareSigns = 3; break;
aCriteria[ SMESH::FT_GroupColor ] = tr("GROUP_COLOR");
aCriteria[ SMESH::FT_EqualNodes ] = tr("EQUAL_NODE");
aCriteria[ SMESH::FT_ConnectedElements ] = tr("CONNECTED_ELEMS");
+ aCriteria[ SMESH::FT_NodeConnectivityNumber ] = tr("NODE_CONN_NUMBER");
}
return aCriteria;
}
myWidgets << aNodesFree;
myPredicates << aFilterMgr->CreateFreeNodes();
//
+ QLabel* aNodesNbConnLab = new QLabel( tr( "MAX_NODE_CONNECTIVITY" ), this );
+ QLabel* aNodesNbConn = createField();
+ myWidgets << aNodesNbConn;
+ myNodeConnFunctor = aFilterMgr->CreateNodeConnectivityNumber();
+ //
QLabel* aNodesDoubleLab = new QLabel( tr( "NUMBER_OF_THE_DOUBLE_NODES" ), this );
QLabel* aNodesDouble = createField();
myWidgets << aNodesDouble;
aFreeNodesBtn->setIcon(aComputeIcon);
myButtons << aFreeNodesBtn; //0
+ QToolButton* aNodesNbConnBtn = new QToolButton( this );
+ aNodesNbConnBtn->setIcon(aComputeIcon);
+ myButtons << aNodesNbConnBtn; //1
+
QToolButton* aDoubleNodesBtn = new QToolButton( this );
aDoubleNodesBtn->setIcon(aComputeIcon);
- myButtons << aDoubleNodesBtn; //1
+ myButtons << aDoubleNodesBtn; //2
QToolButton* aDoubleEdgesBtn = new QToolButton( this );
aDoubleEdgesBtn->setIcon(aComputeIcon);
- myButtons << aDoubleEdgesBtn; //2
+ myButtons << aDoubleEdgesBtn; //3
QToolButton* aDoubleFacesBtn = new QToolButton( this );
aDoubleFacesBtn->setIcon(aComputeIcon);
- myButtons << aDoubleFacesBtn; //3
+ myButtons << aDoubleFacesBtn; //4
QToolButton* aOverContFacesBtn = new QToolButton( this );
aOverContFacesBtn->setIcon(aComputeIcon);
- myButtons << aOverContFacesBtn; //4
+ myButtons << aOverContFacesBtn; //5
QToolButton* aComputeFaceBtn = new QToolButton( this );
aComputeFaceBtn->setIcon(aComputeIcon);
- myButtons << aComputeFaceBtn; //5
+ myButtons << aComputeFaceBtn; //6
QToolButton* aDoubleVolumesBtn = new QToolButton( this );
aDoubleVolumesBtn->setIcon(aComputeIcon);
- myButtons << aDoubleVolumesBtn; //6
+ myButtons << aDoubleVolumesBtn; //7
QToolButton* aOverContVolumesBtn = new QToolButton( this );
aOverContVolumesBtn->setIcon(aComputeIcon);
- myButtons << aOverContVolumesBtn; //7
+ myButtons << aOverContVolumesBtn; //8
QToolButton* aComputeVolumeBtn = new QToolButton( this );
aComputeVolumeBtn->setIcon(aComputeIcon);
- myButtons << aComputeVolumeBtn; //8
+ myButtons << aComputeVolumeBtn; //9
connect( aComputeFaceBtn, SIGNAL( clicked() ), this, SLOT( computeAspectRatio() ) );
connect( aComputeVolumeBtn, SIGNAL( clicked() ), this, SLOT( computeAspectRatio3D() ) );
- connect( aFreeNodesBtn, SIGNAL( clicked() ), this, SLOT( computeFreeNodesInfo() ) );
- connect( aDoubleNodesBtn, SIGNAL( clicked() ), this, SLOT( computeDoubleNodesInfo() ) );
- connect( aDoubleEdgesBtn, SIGNAL( clicked() ), this, SLOT( computeDoubleEdgesInfo() ) );
- connect( aDoubleFacesBtn, SIGNAL( clicked() ), this, SLOT( computeDoubleFacesInfo() ) );
+ connect( aFreeNodesBtn, SIGNAL( clicked() ), this, SLOT( computeFreeNodesInfo() ) );
+ connect( aNodesNbConnBtn, SIGNAL( clicked() ), this, SLOT( computeNodesNbConnInfo() ) );
+ connect( aDoubleNodesBtn, SIGNAL( clicked() ), this, SLOT( computeDoubleNodesInfo() ) );
+ connect( aDoubleEdgesBtn, SIGNAL( clicked() ), this, SLOT( computeDoubleEdgesInfo() ) );
+ connect( aDoubleFacesBtn, SIGNAL( clicked() ), this, SLOT( computeDoubleFacesInfo() ) );
connect( aOverContFacesBtn, SIGNAL( clicked() ), this, SLOT( computeOverConstrainedFacesInfo() ) );
connect( aDoubleVolumesBtn, SIGNAL( clicked() ), this, SLOT( computeDoubleVolumesInfo() ) );
- connect( aOverContVolumesBtn, SIGNAL( clicked() ), this, SLOT( computeOverConstrainedVolumesInfo() ) );
+ connect( aOverContVolumesBtn,SIGNAL( clicked() ), this, SLOT( computeOverConstrainedVolumesInfo() ) );
connect( myToleranceWidget, SIGNAL(valueChanged(double)), this, SLOT( setTolerance( double )));
setFontAttributes( aNameLab );
myMainLayout->addWidget( aNodesFreeLab, 2, 0 ); //3
myMainLayout->addWidget( aNodesFree, 2, 1 ); //4
myMainLayout->addWidget( aFreeNodesBtn, 2, 2 ); //5
- myMainLayout->addWidget( aNodesDoubleLab, 3, 0 ); //6
- myMainLayout->addWidget( aNodesDouble, 3, 1 ); //7
- myMainLayout->addWidget( aDoubleNodesBtn, 3, 2 ); //8
- myMainLayout->addWidget( aToleranceLab, 4, 0 ); //9
- myMainLayout->addWidget( myToleranceWidget, 4, 1 ); //10
- myMainLayout->addWidget( anEdgesLab, 5, 0, 1, 3 ); //11
- myMainLayout->addWidget( anEdgesDoubleLab, 6, 0 ); //12
- myMainLayout->addWidget( anEdgesDouble, 6, 1 ); //13
- myMainLayout->addWidget( aDoubleEdgesBtn, 6, 2 ); //14
- myMainLayout->addWidget( aFacesLab, 7, 0, 1, 3 ); //15
- myMainLayout->addWidget( aFacesDoubleLab, 8, 0 ); //16
- myMainLayout->addWidget( aFacesDouble, 8, 1 ); //17
- myMainLayout->addWidget( aDoubleFacesBtn, 8, 2 ); //18
- myMainLayout->addWidget( aFacesOverLab, 9, 0 ); //19
- myMainLayout->addWidget( aFacesOver, 9, 1 ); //20
- myMainLayout->addWidget( aOverContFacesBtn, 9, 2 ); //21
- myMainLayout->addWidget( anAspectRatioLab, 10, 0 ); //22
- myMainLayout->addWidget( aComputeFaceBtn, 10, 2 ); //23
- myMainLayout->addWidget( myPlot, 11, 0, 1, 3 );//24
- myMainLayout->addWidget( aVolumesLab, 12, 0, 1, 3 );//25
- myMainLayout->addWidget( aVolumesDoubleLab, 13, 0 ); //26
- myMainLayout->addWidget( aVolumesDouble, 13, 1 ); //27
- myMainLayout->addWidget( aDoubleVolumesBtn, 13, 2 ); //28
- myMainLayout->addWidget( aVolumesOverLab, 14, 0 ); //28
- myMainLayout->addWidget( aVolumesOver, 14, 1 ); //30
- myMainLayout->addWidget( aOverContVolumesBtn,14, 2 ); //31
- myMainLayout->addWidget( anAspectRatio3DLab, 15, 0 ); //32
- myMainLayout->addWidget( aComputeVolumeBtn, 15, 2 ); //33
- myMainLayout->addWidget( myPlot3D, 16, 0, 1, 3 );//34
+ myMainLayout->addWidget( aNodesNbConnLab, 3, 0 ); //6
+ myMainLayout->addWidget( aNodesNbConn, 3, 1 ); //7
+ myMainLayout->addWidget( aNodesNbConnBtn, 3, 2 ); //8
+ myMainLayout->addWidget( aNodesDoubleLab, 4, 0 ); //9
+ myMainLayout->addWidget( aNodesDouble, 4, 1 ); //10
+ myMainLayout->addWidget( aDoubleNodesBtn, 4, 2 ); //11
+ myMainLayout->addWidget( aToleranceLab, 5, 0 ); //12
+ myMainLayout->addWidget( myToleranceWidget, 5, 1 ); //13
+ myMainLayout->addWidget( anEdgesLab, 6, 0, 1, 3 ); //14
+ myMainLayout->addWidget( anEdgesDoubleLab, 7, 0 ); //15
+ myMainLayout->addWidget( anEdgesDouble, 7, 1 ); //16
+ myMainLayout->addWidget( aDoubleEdgesBtn, 7, 2 ); //17
+ myMainLayout->addWidget( aFacesLab, 8, 0, 1, 3 ); //18
+ myMainLayout->addWidget( aFacesDoubleLab, 9, 0 ); //19
+ myMainLayout->addWidget( aFacesDouble, 9, 1 ); //20
+ myMainLayout->addWidget( aDoubleFacesBtn, 9, 2 ); //21
+ myMainLayout->addWidget( aFacesOverLab, 10, 0 ); //22
+ myMainLayout->addWidget( aFacesOver, 10, 1 ); //23
+ myMainLayout->addWidget( aOverContFacesBtn, 10, 2 ); //24
+ myMainLayout->addWidget( anAspectRatioLab, 11, 0 ); //25
+ myMainLayout->addWidget( aComputeFaceBtn, 11, 2 ); //26
+ myMainLayout->addWidget( myPlot, 12, 0, 1, 3 );//27
+ myMainLayout->addWidget( aVolumesLab, 13, 0, 1, 3 );//28
+ myMainLayout->addWidget( aVolumesDoubleLab, 14, 0 ); //29
+ myMainLayout->addWidget( aVolumesDouble, 14, 1 ); //30
+ myMainLayout->addWidget( aDoubleVolumesBtn, 14, 2 ); //31
+ myMainLayout->addWidget( aVolumesOverLab, 15, 0 ); //32
+ myMainLayout->addWidget( aVolumesOver, 15, 1 ); //33
+ myMainLayout->addWidget( aOverContVolumesBtn,15, 2 ); //34
+ myMainLayout->addWidget( anAspectRatio3DLab, 16, 0 ); //35
+ myMainLayout->addWidget( aComputeVolumeBtn, 16, 2 ); //36
+ myMainLayout->addWidget( myPlot3D, 17, 0, 1, 3 );//37
myMainLayout->setColumnStretch( 0, 0 );
myMainLayout->setColumnStretch( 1, 5 );
if ( Max( (int)nbNodes, (int)nbElems ) <= ctrlLimit ) {
// free nodes
computeFreeNodesInfo();
+ computeNodesNbConnInfo();
// double nodes
if ( Max( (int)mesh->NbNodes(), (int)mesh->NbElements() ) <= ctrlLimit )
computeDoubleNodesInfo();
else {
myButtons[0]->setEnabled( true );
myButtons[1]->setEnabled( true );
+ myButtons[2]->setEnabled( true );
}
}
else {
- for( int i=2; i<=10; i++)
+ for( int i=2; i<=11; i++)
myMainLayout->itemAt(i)->widget()->setVisible( false );
}
if( nbElemsByType[ SMESH::EDGE ] <= ctrlLimit )
computeDoubleEdgesInfo();
else
- myButtons[2]->setEnabled( true );
+ myButtons[3]->setEnabled( true );
}
else {
for( int i=11; i<=14; i++)
computeAspectRatio();
}
else {
- myButtons[3]->setEnabled( true );
myButtons[4]->setEnabled( true );
myButtons[5]->setEnabled( true );
+ myButtons[6]->setEnabled( true );
}
#ifdef DISABLE_PLOT2DVIEWER
- myMainLayout->setRowStretch(11,0);
- for( int i=22; i<=24; i++)
+ myMainLayout->setRowStretch(12,0);
+ for( int i=25; i<=27; i++)
myMainLayout->itemAt(i)->widget()->setVisible( false );
#endif
}
else {
- myMainLayout->setRowStretch(11,0);
- for( int i=15; i<=24; i++)
+ myMainLayout->setRowStretch(12,0);
+ for( int i=18; i<=27; i++)
myMainLayout->itemAt(i)->widget()->setVisible( false );
}
computeAspectRatio3D();
}
else {
- myButtons[6]->setEnabled( true );
myButtons[7]->setEnabled( true );
myButtons[8]->setEnabled( true );
+ myButtons[9]->setEnabled( true );
}
#ifdef DISABLE_PLOT2DVIEWER
- myMainLayout->setRowStretch(16,0);
- for( int i=32; i<=34; i++)
+ myMainLayout->setRowStretch(17,0);
+ for( int i=35; i<=37; i++)
myMainLayout->itemAt(i)->widget()->setVisible( false );
#endif
}
else {
- myMainLayout->setRowStretch(16,0);
- for( int i=25; i<=34; i++)
+ myMainLayout->setRowStretch(17,0);
+ for( int i=28; i<=37; i++)
myMainLayout->itemAt(i)->widget()->setVisible( false );
}
}
void SMESHGUI_CtrlInfo::computeDoubleNodesInfo()
{
- computeNb( SMESH::FT_EqualNodes, 1, 2 );
+ computeNb( SMESH::FT_EqualNodes, 2, 3 );
}
void SMESHGUI_CtrlInfo::computeDoubleEdgesInfo()
{
- computeNb( SMESH::FT_EqualEdges, 2, 3 );
+ computeNb( SMESH::FT_EqualEdges, 3, 4 );
}
void SMESHGUI_CtrlInfo::computeDoubleFacesInfo()
{
- computeNb( SMESH::FT_EqualFaces, 3, 4 );
+ computeNb( SMESH::FT_EqualFaces, 4, 5 );
}
void SMESHGUI_CtrlInfo::computeOverConstrainedFacesInfo()
{
- computeNb( SMESH::FT_OverConstrainedFace, 4, 5 );
+ computeNb( SMESH::FT_OverConstrainedFace, 5, 6 );
}
void SMESHGUI_CtrlInfo::computeDoubleVolumesInfo()
{
- computeNb( SMESH::FT_EqualVolumes, 6, 6 );
+ computeNb( SMESH::FT_EqualVolumes, 7, 7 );
}
void SMESHGUI_CtrlInfo::computeOverConstrainedVolumesInfo()
{
- computeNb( SMESH::FT_OverConstrainedVolume, 7, 7 );
+ computeNb( SMESH::FT_OverConstrainedVolume, 8, 8 );
+}
+
+void SMESHGUI_CtrlInfo::computeNodesNbConnInfo()
+{
+ myButtons[ 1 ]->setEnabled( false );
+ myWidgets[ 2 ]->setText( "" );
+ SMESH::SMESH_Mesh_var mesh = myObject->GetMesh();
+ if ( mesh->_is_nil() ) return;
+ if ( !mesh->IsLoaded() )
+ {
+ mesh->Load();
+ this->showInfo( myObject ); // try to show all values
+ if ( !myWidgets[ 2 ]->text().isEmpty() )
+ return; // already computed
+ }
+ myNodeConnFunctor->SetMesh( mesh );
+ SMESH::Histogram_var histogram =
+ myNodeConnFunctor->GetLocalHistogram( 1, /*isLogarithmic=*/false, myObject );
+
+ myWidgets[ 2 ]->setText( QString::number( histogram[0].max ));
}
void SMESHGUI_CtrlInfo::computeAspectRatio()
{
#ifndef DISABLE_PLOT2DVIEWER
- myButtons[5]->setEnabled( false );
+ myButtons[6]->setEnabled( false );
if ( myObject->_is_nil() ) return;
void SMESHGUI_CtrlInfo::computeAspectRatio3D()
{
#ifndef DISABLE_PLOT2DVIEWER
- myButtons[8]->setEnabled( false );
+ myButtons[9]->setEnabled( false );
if ( myObject->_is_nil() ) return;
*/
void SMESHGUI_CtrlInfo::clearInternal()
{
- for( int i=0; i<=34; i++)
+ for( int i=0; i<=35; i++)
myMainLayout->itemAt(i)->widget()->setVisible( true );
- for( int i=0; i<=8; i++)
+ for( int i=0; i<=9; i++)
myButtons[i]->setEnabled( false );
myPlot->detachItems();
myPlot3D->detachItems();
/*!
\brief Constructor
\param parent parent widget
- \param page specifies the dialog page to be shown at the start-up
*/
SMESHGUI_CtrlInfoDlg::SMESHGUI_CtrlInfoDlg( QWidget* parent )
: QDialog( parent )
void computeAspectRatio();
void computeAspectRatio3D();
void computeFreeNodesInfo();
+ void computeNodesNbConnInfo();
void computeDoubleNodesInfo();
void computeDoubleEdgesInfo();
void computeDoubleFacesInfo();
QwtPlot* myPlot3D;
QList<QAbstractButton*> myButtons;
QList<TPredicate> myPredicates;
- TNumFunctor myAspectRatio, myAspectRatio3D;
+ TNumFunctor myAspectRatio, myAspectRatio3D, myNodeConnFunctor;
};
class SMESHGUI_EXPORT SMESHGUI_MeshInfoDlg : public QDialog
// Controls -----------------------//--------------------------------
OpFreeNode = 3000, // MENU CONTROLS - FREE NODES
OpEqualNode = 3001, // MENU CONTROLS - DOUBLE NODES
+ OpNodeConnectivityNb = 3002, // MENU CONTROLS - NODE CONNECTIVITY NUMBER
OpFreeEdge = 3100, // MENU CONTROLS - FREE EDGES
OpFreeBorder = 3101, // MENU CONTROLS - FREE BORDERS
OpLength = 3102, // MENU CONTROLS - LENGTH
<source>FREE_NODES</source>
<translation>Free nodes</translation>
</message>
+ <message>
+ <source>NODE_CONNECTIVITY_NB</source>
+ <translation>Node connectivity number</translation>
+ </message>
<message>
<source>FREE_EDGES</source>
<translation>Free edges</translation>
<source>MEN_FREE_NODE</source>
<translation>Free Nodes</translation>
</message>
+ <message>
+ <source>MEN_NODE_CONNECTIVITY_NB</source>
+ <translation>Node connectivity number</translation>
+ </message>
<message>
<source>MEN_FREE_FACES</source>
<translation>Free Faces</translation>
<source>STB_FREE_NODE</source>
<translation>Free Nodes</translation>
</message>
+ <message>
+ <source>STB_NODE_CONNECTIVITY_NB</source>
+ <translation>Node connectivity number</translation>
+ </message>
<message>
<source>STB_FREE_FACES</source>
<translation>Free Faces</translation>
<source>TOP_FREE_NODE</source>
<translation>Free Nodes</translation>
</message>
+ <message>
+ <source>TOP_NODE_CONNECTIVITY_NB</source>
+ <translation>Node connectivity number</translation>
+ </message>
<message>
<source>TOP_FREE_FACES</source>
<translation>Free Faces</translation>
<source>CONNECTED_ELEMS</source>
<translation>Elements of a domain</translation>
</message>
+ <message>
+ <source>NODE_CONN_NUMBER</source>
+ <translation>Connectivity number</translation>
+ </message>
<message>
<source>NUMBEROFNODESINELEMENT</source>
<translation>Number Of Nodes In Element</translation>
<source>NUMBER_OF_THE_FREE_NODES</source>
<translation>Number of the free nodes</translation>
</message>
+ <message>
+ <source>MAX_NODE_CONNECTIVITY</source>
+ <translation>Max. number of connected elements</translation>
+ </message>
<message>
<source>DOUBLE_NODES_TOLERANCE</source>
<translation>Double nodes tolerance</translation>
// - FT_ConnectedElements = 39
// v 7.6.0: FT_Undefined == 47, new items:
// - FT_BelongToMeshGroup = 22
+ // v 8.1.0: FT_Undefined == 48, new items:
+ // - FT_NodeConnectivityNumber= 22
//
// It's necessary to continue recording this history and to fill
// undef2newItems (see below) accordingly.
undef2newItems[ 45 ].push_back( 36 );
undef2newItems[ 46 ].push_back( 39 );
undef2newItems[ 47 ].push_back( 22 );
+ undef2newItems[ 48 ].push_back( 22 );
ASSERT( undef2newItems.rbegin()->first == SMESH::FT_Undefined );
}
const bool isHyp = theObj->IsKind( STANDARD_TYPE( _pyHypothesis ));
Handle(_pyObject) existing;
if( isHyp )
- existing = Handle(_pyObject)::DownCast( FindHyp( theObj->GetID() ) );
+ existing = FindHyp( theObj->GetID() );
else
existing = FindObject( theObj->GetID() );
if ( !existing.IsNull() && existing != theObj )
return id_obj->second;
}
{
- map< _pyID, Handle(_pyMesh) >::const_iterator id_obj = myMeshes.find( theObjID );
+ _pyGen* me = const_cast< _pyGen* >( this );
+ map< _pyID, Handle(_pyMesh) >::iterator id_obj = me->myMeshes.find( theObjID );
if ( id_obj != myMeshes.end() )
- return Handle(_pyObject)::DownCast( id_obj->second );
+ return id_obj->second;
}
// {
// map< _pyID, Handle(_pyMeshEditor) >::const_iterator id_obj = myMeshEditors.find( theObjID );
case FT_MultiConnection2D: myStream<< "aMultiConnection2D"; break;
case FT_Length: myStream<< "aLength"; break;
case FT_Length2D: myStream<< "aLength2D"; break;
+ case FT_NodeConnectivityNumber:myStream<< "aNodeConnectivityNumber";break;
case FT_BelongToMeshGroup: myStream<< "aBelongToMeshGroup"; break;
case FT_BelongToGeom: myStream<< "aBelongToGeom"; break;
case FT_BelongToPlane: myStream<< "aBelongToPlane"; break;
case FT_LogicalNOT: myStream<< "aLogicalNOT"; break;
case FT_LogicalAND: myStream<< "aLogicalAND"; break;
case FT_LogicalOR: myStream<< "aLogicalOR"; break;
- case FT_Undefined:
- default: myStream<< "anUndefined"; break;
+ case FT_Undefined: myStream<< "anUndefined"; break;
+ //default: -- commented to have a compilation warning
}
myStream<<theArg;
}
return SMESH::FT_BallDiameter;
}
+/*
+ Class : NodeConnectivityNumber_i
+ Description : Functor returning diameter of a ball element
+*/
+NodeConnectivityNumber_i::NodeConnectivityNumber_i()
+{
+ myNumericalFunctorPtr.reset( new Controls::NodeConnectivityNumber() );
+ myFunctorPtr = myNumericalFunctorPtr;
+}
+
+FunctorType NodeConnectivityNumber_i::GetFunctorType()
+{
+ return SMESH::FT_NodeConnectivityNumber;
+}
+
/*
Class : MultiConnection2D_i
Description : Functor for calculating number of faces conneted to the edge
return anObj._retn();
}
+NodeConnectivityNumber_ptr FilterManager_i::CreateNodeConnectivityNumber()
+{
+ SMESH::NodeConnectivityNumber_i* aServant = new SMESH::NodeConnectivityNumber_i();
+ SMESH::NodeConnectivityNumber_var anObj = aServant->_this();
+ TPythonDump()<<aServant<<" = "<<this<<".CreateNodeConnectivityNumber()";
+ return anObj._retn();
+}
+
BelongToMeshGroup_ptr FilterManager_i::CreateBelongToMeshGroup()
{
SMESH::BelongToMeshGroup_i* aServant = new SMESH::BelongToMeshGroup_i();
case SMESH::FT_BallDiameter:
aFunctor = aFilterMgr->CreateBallDiameter();
break;
+ case SMESH::FT_NodeConnectivityNumber:
+ aFunctor = aFilterMgr->CreateNodeConnectivityNumber();
+ break;
// Predicates
"FT_MultiConnection2D",
"FT_Length",
"FT_Length2D",
+ "FT_NodeConnectivityNumber",
"FT_BelongToMeshGroup",
"FT_BelongToGeom",
"FT_BelongToPlane",
FunctorType GetFunctorType();
};
+ /*
+ Class : NodeConnectivityNumber_i
+ Description : Functor returning diameter of a ball element
+ */
+ class SMESH_I_EXPORT NodeConnectivityNumber_i: public virtual POA_SMESH::NodeConnectivityNumber,
+ public virtual NumericalFunctor_i
+ {
+ public:
+ NodeConnectivityNumber_i();
+ FunctorType GetFunctorType();
+ };
+
/*
PREDICATES
MaxElementLength3D_ptr CreateMaxElementLength3D();
Length_ptr CreateLength();
Length2D_ptr CreateLength2D();
+ NodeConnectivityNumber_ptr CreateNodeConnectivityNumber();
MultiConnection_ptr CreateMultiConnection();
MultiConnection2D_ptr CreateMultiConnection2D();
BallDiameter_ptr CreateBallDiameter();
functor = aFilterMgr.CreateLength()
elif theCriterion == FT_Length2D:
functor = aFilterMgr.CreateLength2D()
+ elif theCriterion == FT_NodeConnectivityNumber:
+ functor = aFilterMgr.CreateNodeConnectivityNumber()
+ elif theCriterion == FT_BallDiameter:
+ functor = aFilterMgr.CreateBallDiameter()
else:
print "Error: given parameter is not numerical functor type."
aFilterMgr.UnRegister()