23303: [EDF 12024] Filter for nodes connectivity

This commit is contained in:
eap 2016-08-11 16:44:16 +03:00
parent b73aa314d8
commit 5c5e1f2368
22 changed files with 427 additions and 175 deletions

View File

@ -98,6 +98,7 @@ SET(GOOD_TESTS
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

View File

@ -0,0 +1,9 @@
# 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)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 42 KiB

View File

@ -7,7 +7,7 @@ The user can obtain information about the selected mesh object
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
@ -60,7 +60,7 @@ information about the selected mesh node(s) or element(s), namely:
- 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).
@ -132,6 +132,7 @@ The <b>Quality Info</b> tab provides overall information about mesh quality cont
- 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;
@ -161,9 +162,6 @@ via the "Mesh information" preferences (zero value means that there is no limit)
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".
*/

View File

@ -144,6 +144,10 @@ The following criteria allow selecting mesh <b>Nodes</b>:
<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>

View File

@ -209,6 +209,16 @@ filters mesh nodes which are coincident with other nodes (within a given toleran
\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

View File

@ -61,6 +61,7 @@ module SMESH
FT_MultiConnection2D,
FT_Length,
FT_Length2D,
FT_NodeConnectivityNumber,
FT_BelongToMeshGroup,
FT_BelongToGeom,
FT_BelongToPlane,
@ -162,6 +163,7 @@ module SMESH
Values GetValues();
};
interface BallDiameter : NumericalFunctor{};
interface NodeConnectivityNumber : NumericalFunctor{};
/*!
@ -586,6 +588,7 @@ module SMESH
MultiConnection CreateMultiConnection();
MultiConnection2D CreateMultiConnection2D();
BallDiameter CreateBallDiameter();
NodeConnectivityNumber CreateNodeConnectivityNumber();
/*!
* Create logical functors ( predicates )
*/

View File

@ -2116,6 +2116,42 @@ SMDSAbs_ElementType BallDiameter::GetType() const
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

View File

@ -351,6 +351,17 @@ namespace SMESH{
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

View File

@ -694,7 +694,8 @@ void SMESH_ActorDef::SetCellsFontProperties( SMESH::LabelFont theFamily, int the
}
}
bool SMESH_ActorDef::GetPointsLabeled() {
bool SMESH_ActorDef::GetPointsLabeled()
{
return myNodeActor && myNodeActor->GetPointsLabeled();
}
@ -719,7 +720,8 @@ void SMESH_ActorDef::SetCellsLabeled(bool theIsCellsLabeled)
}
bool SMESH_ActorDef::GetCellsLabeled() {
bool SMESH_ActorDef::GetCellsLabeled()
{
bool result = false;
if(my3DActor)
result = result || my3DActor->GetCellsLabeled();
@ -789,17 +791,13 @@ bool SMESH_ActorDef::GetFacesOrientation3DVectors()
}
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;
@ -982,6 +980,12 @@ SetControlMode( eControl theMode, bool theCheckEntityMode )
myControlActor = my2DActor;
break;
}
case eNodeConnectivityNb:
{
myFunctor.reset( new SMESH::Controls::NodeConnectivityNumber() );
myControlActor = myNodeActor;
break;
}
default:
return;
}
@ -989,7 +993,7 @@ SetControlMode( eControl theMode, bool theCheckEntityMode )
vtkUnstructuredGrid* aGrid = myControlActor->GetUnstructuredGrid();
vtkIdType aNbCells = aGrid->GetNumberOfCells();
bool aShowOnlyScalarBarTitle = false;
if(aNbCells){
if(aNbCells) {
myControlMode = theMode;
switch(myControlMode){
case eFreeNodes:
@ -1029,6 +1033,15 @@ SetControlMode( eControl theMode, bool theCheckEntityMode )
}
if(theCheckEntityMode) {
// if(myControlActor == myNodeActor) {
// if ( myControlMode == eNodeConnectivityNb ) {
// if (!myIsEntityModeCache){
// myEntityModeCache = GetEntityMode();
// myIsEntityModeCache=true;
// }
// SetEntityMode(0);
// }
// }
if(myControlActor == my1DActor) {
if (!myIsEntityModeCache){
myEntityModeCache = GetEntityMode();
@ -1090,9 +1103,8 @@ SetControlMode( eControl theMode, bool theCheckEntityMode )
Update();
}
int
SMESH_ActorDef::
GetNumberControlEntities(){
int SMESH_ActorDef::GetNumberControlEntities()
{
SMESH_DeviceActor* anAct = NULL;
switch(myControlMode){
case eFreeNodes:
@ -1115,12 +1127,13 @@ GetNumberControlEntities(){
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);
@ -1143,7 +1156,8 @@ void SMESH_ActorDef::AddToRender(vtkRenderer* theRenderer){
SALOME_Actor::AddToRender(theRenderer);
}
void SMESH_ActorDef::RemoveFromRender(vtkRenderer* theRenderer){
void SMESH_ActorDef::RemoveFromRender(vtkRenderer* theRenderer)
{
SALOME_Actor::RemoveFromRender(theRenderer);
theRenderer->RemoveActor(myBaseActor);
@ -1170,9 +1184,9 @@ void SMESH_ActorDef::RemoveFromRender(vtkRenderer* theRenderer){
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);
@ -1258,17 +1272,20 @@ bool SMESH_ActorDef::Init(TVisualObjPtr theVisualObj,
}
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);
@ -1294,27 +1311,32 @@ void SMESH_ActorDef::SetTransform(VTKViewer_Transform* 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 &&
@ -1323,18 +1345,21 @@ bool SMESH_ActorDef::IsInfinitive(){
}
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);
@ -1350,7 +1375,8 @@ void SMESH_ActorDef::SetShrinkFactor(double theValue){
Modified();
}
void SMESH_ActorDef::SetShrink() {
void SMESH_ActorDef::SetShrink()
{
if(!myIsShrinkable) return;
myBaseActor->SetShrink();
@ -1368,7 +1394,8 @@ void SMESH_ActorDef::SetShrink() {
Modified();
}
void SMESH_ActorDef::UnShrink(){
void SMESH_ActorDef::UnShrink()
{
if(!myIsShrunk) return;
myBaseActor->UnShrink();
@ -1387,30 +1414,36 @@ void SMESH_ActorDef::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();
@ -1436,8 +1469,8 @@ void SMESH_ActorDef::SetVisibility(int theMode, bool theIsUpdateRepersentation){
if(theIsUpdateRepersentation)
SetRepresentation(GetRepresentation());
if(myControlMode != eNone){
switch(myControlMode){
if(myControlMode != eNone) {
switch(myControlMode) {
case eFreeNodes:
case eCoincidentNodes:
myNodeExtActor->VisibilityOn();
@ -1462,6 +1495,7 @@ void SMESH_ActorDef::SetVisibility(int theMode, bool theIsUpdateRepersentation){
case eMultiConnection2D:
my1DExtActor->VisibilityOn();
break;
default:;
}
if(myControlActor->GetUnstructuredGrid()->GetNumberOfCells())
myScalarBarActor->VisibilityOn();
@ -1777,19 +1811,22 @@ void SMESH_ActorDef::SetRepresentation (int theMode)
}
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();
@ -1832,7 +1869,8 @@ void SMESH_ActorDef::UpdateHighlight(){
}
void SMESH_ActorDef::highlight(bool theHighlight){
void SMESH_ActorDef::highlight(bool theHighlight)
{
if ( myIsHighlighted == theHighlight )
return;
myIsHighlighted = theHighlight;
@ -1840,7 +1878,8 @@ void SMESH_ActorDef::highlight(bool theHighlight){
}
void SMESH_ActorDef::SetPreSelected(bool thePreselect){
void SMESH_ActorDef::SetPreSelected(bool thePreselect)
{
if ( myIsPreselected == thePreselect )
return;
myIsPreselected = thePreselect;
@ -1873,7 +1912,8 @@ int SMESH_ActorDef::RenderTranslucentGeometry(vtkViewport *vp)
}
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();
@ -1882,7 +1922,8 @@ void SMESH_ActorDef::Render(vtkRenderer *ren){
}
void SMESH_ActorDef::Update(){
void SMESH_ActorDef::Update()
{
if(MYDEBUG) MESSAGE("SMESH_ActorDef::Update");
if(GetControlMode() != eNone) {
@ -1926,14 +1967,16 @@ void SMESH_ActorDef::Update(){
}
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];
@ -1941,7 +1984,8 @@ static void GetColor(vtkProperty *theProperty, double& r,double& g,double& b){
}
void SMESH_ActorDef::SetOpacity(double theValue){
void SMESH_ActorDef::SetOpacity(double theValue)
{
mySurfaceProp->SetOpacity(theValue);
myBackSurfaceProp->SetOpacity(theValue);
myNormalVProp->SetOpacity(theValue);
@ -1956,12 +2000,14 @@ void SMESH_ActorDef::SetOpacity(double 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() ) )
@ -1974,12 +2020,14 @@ void SMESH_ActorDef::SetSufaceColor(double r,double g,double b, int delta){
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() ) )
@ -1992,12 +2040,14 @@ void SMESH_ActorDef::SetVolumeColor(double r,double g,double b, int delta){
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);
@ -2007,21 +2057,25 @@ void SMESH_ActorDef::SetEdgeColor(double r,double g,double 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() ) )
@ -2030,11 +2084,13 @@ void SMESH_ActorDef::SetNodeColor(double r,double g,double b){
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 )
@ -2042,11 +2098,13 @@ void SMESH_ActorDef::Set0DColor(double r,double g,double b){
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 )
@ -2054,35 +2112,42 @@ void SMESH_ActorDef::SetBallColor(double r,double g,double b){
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);
@ -2106,7 +2171,8 @@ void SMESH_ActorDef::SetOutlineWidth(double theVal)
Modified();
}
void SMESH_ActorDef::Set0DSize(double theVal){
void SMESH_ActorDef::Set0DSize(double theVal)
{
my0DProp->SetPointSize(theVal);
myHighlightProp->SetPointSize(theVal);
myPreselectProp->SetPointSize(theVal);
@ -2121,11 +2187,13 @@ void SMESH_ActorDef::Set0DSize(double 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 )) {
@ -2138,7 +2206,8 @@ void SMESH_ActorDef::SetBallSize(double theVal){
Modified();
}
double SMESH_ActorDef::GetBallSize(){
double SMESH_ActorDef::GetBallSize()
{
return myBallProp->GetPointSize();
}
@ -2165,15 +2234,12 @@ int SMESH_ActorDef::GetObjDimension( const int theObjId )
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);
@ -2195,8 +2261,7 @@ SMESH_ActorDef::SetImplicitFunctionUsed(bool theIsImplicitFunctionUsed)
my3DExtActor->SetImplicitFunctionUsed(theIsImplicitFunctionUsed);
}
vtkIdType
SMESH_ActorDef::AddClippingPlane(vtkPlane* thePlane)
vtkIdType SMESH_ActorDef::AddClippingPlane(vtkPlane* thePlane)
{
if(thePlane){
myImplicitBoolean->GetFunction()->AddItem(thePlane);
@ -2208,15 +2273,13 @@ SMESH_ActorDef::AddClippingPlane(vtkPlane* 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)
@ -2267,9 +2330,7 @@ SMESH_ActorDef::SetOpenGLClippingPlane()
Modified();
}
void
SMESH_ActorDef::
RemoveAllClippingPlanes()
void SMESH_ActorDef::RemoveAllClippingPlanes()
{
myPlaneCollection->RemoveAllItems();
myImplicitBoolean->GetFunction()->RemoveAllItems();
@ -2279,16 +2340,12 @@ RemoveAllClippingPlanes()
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;
@ -2437,7 +2494,7 @@ void SMESH_ActorDef::UpdateDistribution()
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());
@ -2493,8 +2550,8 @@ void SMESH_ActorDef::SetMarkerTexture( int theMarkerId, VTK::MarkerTexture theMa
}
#ifndef DISABLE_PLOT2DVIEWER
SPlot2d_Histogram* SMESH_ActorDef::UpdatePlot2Histogram() {
SPlot2d_Histogram* SMESH_ActorDef::UpdatePlot2Histogram()
{
if(my2dHistogram)
my2dHistogram->clearAllPoints();

View File

@ -146,7 +146,7 @@ class SMESHOBJECT_EXPORT SMESH_Actor: public SALOME_Actor
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;

View File

@ -1142,6 +1142,8 @@ namespace
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;
}
@ -1636,6 +1638,7 @@ namespace
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 );
@ -3577,6 +3580,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
// CONTROLS
case SMESHOp::OpFreeNode:
case SMESHOp::OpEqualNode:
case SMESHOp::OpNodeConnectivityNb:
case SMESHOp::OpFreeEdge:
case SMESHOp::OpFreeBorder:
case SMESHOp::OpLength:
@ -3869,6 +3873,7 @@ void SMESHGUI::initialize( CAM_Application* app )
//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 );
@ -4002,7 +4007,8 @@ void SMESHGUI::initialize( CAM_Application* app )
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
@ -4099,6 +4105,7 @@ void SMESHGUI::initialize( CAM_Application* app )
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 );
@ -4244,6 +4251,7 @@ void SMESHGUI::initialize( CAM_Application* app )
createTool( SMESHOp::OpFreeNode, ctrl0dTb );
createTool( SMESHOp::OpEqualNode, ctrl0dTb );
//createTool( SMESHOp::OpNodeConnectivityNb, ctrl0dTb );
createTool( SMESHOp::OpFreeBorder, ctrl1dTb );
createTool( SMESHOp::OpLength, ctrl1dTb );
@ -4586,6 +4594,10 @@ void SMESHGUI::initialize( CAM_Application* app )
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 );

View File

@ -1823,6 +1823,7 @@ void SMESHGUI_FilterTable::onCriterionChanged (const int row, const int col, con
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;
@ -2190,6 +2191,7 @@ const QMap<int, QString>& SMESHGUI_FilterTable::getCriteria (const int theType)
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;
}

View File

@ -3225,6 +3225,11 @@ SMESHGUI_CtrlInfo::SMESHGUI_CtrlInfo( QWidget* parent )
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;
@ -3274,47 +3279,52 @@ SMESHGUI_CtrlInfo::SMESHGUI_CtrlInfo( QWidget* parent )
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 );
@ -3329,35 +3339,38 @@ SMESHGUI_CtrlInfo::SMESHGUI_CtrlInfo( QWidget* parent )
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 );
@ -3460,6 +3473,7 @@ void SMESHGUI_CtrlInfo::showInfo( SMESH::SMESH_IDSource_ptr obj )
if ( Max( (int)nbNodes, (int)nbElems ) <= ctrlLimit ) {
// free nodes
computeFreeNodesInfo();
computeNodesNbConnInfo();
// double nodes
if ( Max( (int)mesh->NbNodes(), (int)mesh->NbElements() ) <= ctrlLimit )
computeDoubleNodesInfo();
@ -3467,10 +3481,11 @@ void SMESHGUI_CtrlInfo::showInfo( SMESH::SMESH_IDSource_ptr obj )
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 );
}
@ -3480,7 +3495,7 @@ void SMESHGUI_CtrlInfo::showInfo( SMESH::SMESH_IDSource_ptr obj )
if( nbElemsByType[ SMESH::EDGE ] <= ctrlLimit )
computeDoubleEdgesInfo();
else
myButtons[2]->setEnabled( true );
myButtons[3]->setEnabled( true );
}
else {
for( int i=11; i<=14; i++)
@ -3498,19 +3513,19 @@ void SMESHGUI_CtrlInfo::showInfo( SMESH::SMESH_IDSource_ptr obj )
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 );
}
@ -3525,19 +3540,19 @@ void SMESHGUI_CtrlInfo::showInfo( SMESH::SMESH_IDSource_ptr obj )
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 );
}
}
@ -3583,38 +3598,58 @@ void SMESHGUI_CtrlInfo::computeFreeNodesInfo()
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;
@ -3633,7 +3668,7 @@ void SMESHGUI_CtrlInfo::computeAspectRatio()
void SMESHGUI_CtrlInfo::computeAspectRatio3D()
{
#ifndef DISABLE_PLOT2DVIEWER
myButtons[8]->setEnabled( false );
myButtons[9]->setEnabled( false );
if ( myObject->_is_nil() ) return;
@ -3654,9 +3689,9 @@ void SMESHGUI_CtrlInfo::computeAspectRatio3D()
*/
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();
@ -3734,7 +3769,6 @@ void SMESHGUI_CtrlInfo::saveInfo( QTextStream &out ) {
/*!
\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 )

View File

@ -324,6 +324,7 @@ private slots:
void computeAspectRatio();
void computeAspectRatio3D();
void computeFreeNodesInfo();
void computeNodesNbConnInfo();
void computeDoubleNodesInfo();
void computeDoubleEdgesInfo();
void computeDoubleFacesInfo();
@ -345,7 +346,7 @@ private:
QwtPlot* myPlot3D;
QList<QAbstractButton*> myButtons;
QList<TPredicate> myPredicates;
TNumFunctor myAspectRatio, myAspectRatio3D;
TNumFunctor myAspectRatio, myAspectRatio3D, myNodeConnFunctor;
};
class SMESHGUI_EXPORT SMESHGUI_MeshInfoDlg : public QDialog

View File

@ -98,6 +98,7 @@ namespace SMESHOp {
// 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

View File

@ -67,6 +67,10 @@
<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>
@ -624,6 +628,10 @@
<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>
@ -3190,6 +3198,10 @@ Use Display Entity menu command to show them.
<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>
@ -3862,6 +3874,10 @@ Use Display Entity menu command to show them.
<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>
@ -5664,6 +5680,10 @@ Please check input data and try again</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>
@ -7714,6 +7734,10 @@ as they are of improper type:
<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>

View File

@ -292,6 +292,8 @@ namespace {
// - 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.
@ -313,6 +315,7 @@ namespace {
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 );
}
@ -1564,7 +1567,7 @@ void _pyGen::CheckObjectIsReCreated( Handle(_pyObject)& theObj )
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 )
@ -1622,9 +1625,10 @@ Handle(_pyObject) _pyGen::FindObject( const _pyID& theObjID ) const
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 );

View File

@ -423,6 +423,7 @@ namespace SMESH
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;
@ -448,8 +449,8 @@ namespace SMESH
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;
}

View File

@ -564,6 +564,21 @@ FunctorType BallDiameter_i::GetFunctorType()
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
@ -2122,6 +2137,14 @@ BallDiameter_ptr FilterManager_i::CreateBallDiameter()
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();
@ -2966,6 +2989,9 @@ CORBA::Boolean Filter_i::SetCriteria( const SMESH::Filter::Criteria& theCriteria
case SMESH::FT_BallDiameter:
aFunctor = aFilterMgr->CreateBallDiameter();
break;
case SMESH::FT_NodeConnectivityNumber:
aFunctor = aFilterMgr->CreateNodeConnectivityNumber();
break;
// Predicates
@ -4052,6 +4078,7 @@ static const char** getFunctNames()
"FT_MultiConnection2D",
"FT_Length",
"FT_Length2D",
"FT_NodeConnectivityNumber",
"FT_BelongToMeshGroup",
"FT_BelongToGeom",
"FT_BelongToPlane",

View File

@ -311,6 +311,18 @@ namespace SMESH
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
@ -1075,6 +1087,7 @@ namespace SMESH
MaxElementLength3D_ptr CreateMaxElementLength3D();
Length_ptr CreateLength();
Length2D_ptr CreateLength2D();
NodeConnectivityNumber_ptr CreateNodeConnectivityNumber();
MultiConnection_ptr CreateMultiConnection();
MultiConnection2D_ptr CreateMultiConnection2D();
BallDiameter_ptr CreateBallDiameter();

View File

@ -964,6 +964,10 @@ class smeshBuilder(object, SMESH._objref_SMESH_Gen):
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()