- int aComboType = ComboItem::Type();
- int aIntSpinType = IntSpinItem::Type();
- int aDoubleSpinType = DoubleSpinItem::Type();
- QTableWidgetItem* aTableItem = aTable->item(row, 2);
- bool isComboItem = false;
- bool isIntSpinItem = false;
- bool isDoubleSpinItem = false;
- if (aTableItem) {
- int aTableType = aTable->item(row, 2)->type();
- isComboItem = ( aTableType == aComboType );
- isIntSpinItem = ( aTableType == aIntSpinType );
- isDoubleSpinItem = ( aTableType == aDoubleSpinType );
+ bool isComboItem = false;
+ bool isIntSpinItem = false;
+ bool isDoubleSpinItem = false;
+ if ( QTableWidgetItem* aTableItem = aTable->item(row, 2) )
+ {
+ int aTableType = aTableItem->type();
+ isComboItem = ( aTableType == ComboItem::Type() );
+ isIntSpinItem = ( aTableType == IntSpinItem::Type() );
+ isDoubleSpinItem = ( aTableType == DoubleSpinItem::Type() );
+ }
+
+ // find out a type of item required by a new criterion and other table features
+ int aCriterionType = GetCriterionType(row);
+ bool anIsDoubleCriterion = false;
+ bool anIsIntCriterion = false;
+ bool anIsComboCriterion = false;
+ // other features:
+ QList<int> comboIDs; // values to show in a combo item
+ int nbCompareSigns = 0; // possible values are 0,1,3
+ bool isThresholdEditable = false; // actual for "simple" item types
+ switch ( aCriterionType )
+ {
+ case SMESH::FT_AspectRatio:
+ case SMESH::FT_AspectRatio3D:
+ case SMESH::FT_Warping:
+ case SMESH::FT_MinimumAngle:
+ case SMESH::FT_Taper:
+ case SMESH::FT_Skew:
+ case SMESH::FT_Area:
+ case SMESH::FT_Volume3D:
+ case SMESH::FT_MaxElementLength2D:
+ case SMESH::FT_MaxElementLength3D: anIsDoubleCriterion = true; break;
+
+ case SMESH::FT_FreeBorders:
+ case SMESH::FT_FreeEdges:
+ case SMESH::FT_FreeNodes:
+ case SMESH::FT_FreeFaces:
+ case SMESH::FT_EqualNodes:
+ case SMESH::FT_EqualEdges:
+ 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;
+
+ case SMESH::FT_Length:
+ case SMESH::FT_Length2D:
+ case SMESH::FT_Length3D:
+ case SMESH::FT_Deflection2D: anIsDoubleCriterion = true; break;
+
+ case SMESH::FT_BelongToMeshGroup: break;
+
+ case SMESH::FT_BelongToGeom:
+ case SMESH::FT_BelongToPlane:
+ case SMESH::FT_BelongToCylinder:
+ case SMESH::FT_BelongToGenSurface:
+ case SMESH::FT_LyingOnGeom: nbCompareSigns = 0; isThresholdEditable = true; break;
+
+ case SMESH::FT_RangeOfIds: nbCompareSigns = 0; isThresholdEditable = true; break;
+
+ case SMESH::FT_BadOrientedVolume:
+ case SMESH::FT_BareBorderVolume:
+ case SMESH::FT_BareBorderFace:
+ case SMESH::FT_OverConstrainedVolume:
+ case SMESH::FT_OverConstrainedFace:
+ case SMESH::FT_LinearOrQuadratic: break;
+
+ case SMESH::FT_GroupColor: nbCompareSigns = 1; isThresholdEditable = true; break;
+
+ case SMESH::FT_ElemGeomType:
+ comboIDs = geomTypes( aType ); anIsComboCriterion = true; nbCompareSigns = 1; break;
+
+ case SMESH::FT_EntityType:
+ comboIDs = entityTypes( aType ); anIsComboCriterion = true; nbCompareSigns = 1; break;
+
+ case SMESH::FT_CoplanarFaces: isThresholdEditable = true; break;
+
+ case SMESH::FT_BallDiameter: anIsDoubleCriterion = true; break;
+
+ case SMESH::FT_ConnectedElements: isThresholdEditable = true; break;
+
+ case SMESH::FT_LessThan:
+ case SMESH::FT_MoreThan:
+ case SMESH::FT_EqualTo:
+ case SMESH::FT_LogicalNOT:
+ case SMESH::FT_LogicalAND:
+ case SMESH::FT_LogicalOR:
+ case SMESH::FT_Undefined:
+ default: return;