#include <LightApp_SelectionMgr.h>
#include <SalomeApp_Tools.h>
#include <LightApp_Application.h>
+#include <SalomeApp_IntSpinBox.h>
#include <SALOME_ListIO.hxx>
#include <QRadioButton>
#include <QCheckBox>
#include <QButtonGroup>
-#include <QSpinBox>
#include <QList>
#include <QDir>
#include <QFileDialog>
mySelEdit[ Ids ] = new QLineEdit( myRefineGrp );
QLabel* aNodeLbl = new QLabel( tr( "NODE_1" ), myRefineGrp );
- myNode1 = new QSpinBox( myRefineGrp );
+ myNode1 = new SalomeApp_IntSpinBox( myRefineGrp );
myNode2Lbl = new QLabel( tr( "NODE_2" ), myRefineGrp );
- myNode2 = new QSpinBox( myRefineGrp );
+ myNode2 = new SalomeApp_IntSpinBox( myRefineGrp );
myRefineGrpLayout->addWidget( mySelLbl[ Ids ], 0, 0 );
myRefineGrpLayout->addWidget( mySelBtn[ Ids ], 0, 1 );
//=======================================================================
bool SMESHGUI_MeshPatternDlg::isValid (const bool theMess)
{
+ if (isRefine())
+ {
+ QString msg;
+ bool ok = true;
+ ok = myNode1->isValid( msg, theMess ) && ok;
+ if (myType == Type_3d)
+ ok = myNode2->isValid( msg, theMess ) && ok;
+ if( !ok ) {
+ if( theMess ) {
+ QString str( tr( "SMESH_INCORRECT_INPUT" ) );
+ if ( !msg.isEmpty() )
+ str += "\n" + msg;
+ SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
+ }
+ return false;
+ }
+ }
+
QList<int> ids;
if ((isRefine() &&
(myMesh->_is_nil() || !getIds(ids) || getNode(false) < 0 ||
? myPattern->ApplyToMeshFaces (myMesh, varIds, getNode(false), myReverseChk->isChecked())
: myPattern->ApplyToHexahedrons(myMesh, varIds, getNode(false), getNode(true));
+ QStringList aParameters;
+ aParameters << myNode1->text();
+ if(myType == Type_3d )
+ aParameters << myNode2->text();
+ myMesh->SetParameters( SMESHGUI::JoinObjectParameters(aParameters) );
+
} else { // Applying a pattern to geometrical object
if (myType == Type_2d)
myPattern->ApplyToFace(myGeomObj[Object], myGeomObj[Vertex1], myReverseChk->isChecked());
void SMESHGUI_MeshPatternDlg::onNodeChanged (int value)
{
if (myType == Type_3d) {
- QSpinBox* first = (QSpinBox*)sender();
- QSpinBox* second = first == myNode1 ? myNode2 : myNode1;
+ SalomeApp_IntSpinBox* first = (SalomeApp_IntSpinBox*)sender();
+ SalomeApp_IntSpinBox* second = first == myNode1 ? myNode2 : myNode1;
int secondVal = second->value();
if (secondVal == value) {
secondVal = value == second->maximum() ? second->minimum() : value + 1;
class QCheckBox;
class QButtonGroup;
class QLabel;
-class QSpinBox;
+class SalomeApp_IntSpinBox;
class vtkUnstructuredGrid;
class SALOME_Actor;
class SVTK_Selector;
QCheckBox* myRefine;
QFrame* myRefineGrp;
- QSpinBox* myNode1;
- QSpinBox* myNode2;
+ SalomeApp_IntSpinBox* myNode1;
+ SalomeApp_IntSpinBox* myNode2;
QLabel* myNode2Lbl;
QFrame* myGeomGrp;
}
}
+ if(it == _objectMap.end()) { // additional check for pattern mapping
+ if(aMethod.IsEqual("ApplyToMeshFaces") ||
+ aMethod.IsEqual("ApplyToHexahedrons"))
+ it = _objectMap.find(aCmd->GetArg(1));
+ }
+
if(it != _objectMap.end()) {
+ if(MYDEBUG)
+ cout << "Found object : " << (*it).first << endl;
ObjectStates *aStates = (*it).second;
// Case for LocalLength hypothesis
if(aStates->GetObjectType().IsEqual("LocalLength") && aStates->GetCurrectState().size() >= 2) {
}
aStates->IncrementState();
}
+ else if(aMethod.IsEqual("ApplyToMeshFaces") ||
+ aMethod.IsEqual("ApplyToHexahedrons")) {
+ int anArgIndex = aCmd->GetNbArgs()-1;
+ for(int j = 0; j < aCurrentStateSize; j++)
+ if(!aCurrentState.at(j).IsEmpty())
+ aCmd->SetArg(anArgIndex+j, aCurrentState.at(j));
+ aStates->IncrementState();
+ }
}
}
+ else {
+ if(MYDEBUG)
+ cout << "Object not found" << endl;
+ }
if(MYDEBUG) {
cout<<"Command after: "<< aCmd->GetString()<<endl;
}
#Registering the new proxy for NETGEN_SimpleParameters_3D
omniORB.registerObjref(NETGENPlugin._objref_NETGENPlugin_SimpleHypothesis_3D._NP_RepositoryId, NETGEN_SimpleParameters_3D)
+
+class Pattern(SMESH._objref_SMESH_Pattern):
+
+ def ApplyToMeshFaces(self, theMesh, theFacesIDs, theNodeIndexOnKeyPoint1, theReverse):
+ flag = False
+ if isinstance(theNodeIndexOnKeyPoint1,str):
+ flag = True
+ theNodeIndexOnKeyPoint1,Parameters = geompyDC.ParseParameters(theNodeIndexOnKeyPoint1)
+ if flag:
+ theNodeIndexOnKeyPoint1 -= 1
+ theMesh.SetParameters(Parameters)
+ return SMESH._objref_SMESH_Pattern.ApplyToMeshFaces( self, theMesh, theFacesIDs, theNodeIndexOnKeyPoint1, theReverse )
+
+ def ApplyToHexahedrons(self, theMesh, theVolumesIDs, theNode000Index, theNode001Index):
+ flag0 = False
+ flag1 = False
+ if isinstance(theNode000Index,str):
+ flag0 = True
+ if isinstance(theNode001Index,str):
+ flag1 = True
+ theNode000Index,theNode001Index,Parameters = geompyDC.ParseParameters(theNode000Index,theNode001Index)
+ if flag0:
+ theNode000Index -= 1
+ if flag1:
+ theNode001Index -= 1
+ theMesh.SetParameters(Parameters)
+ return SMESH._objref_SMESH_Pattern.ApplyToHexahedrons( self, theMesh, theVolumesIDs, theNode000Index, theNode001Index )
+
+#Registering the new proxy for Pattern
+omniORB.registerObjref(SMESH._objref_SMESH_Pattern._NP_RepositoryId, Pattern)