SMESH::SMESH_Mesh_var aCompoundMesh;
- if (!myMesh->_is_nil()) {
+ if (!myMesh->_is_nil())
+ {
QStringList aParameters;
aParameters << (CheckBoxMerge->isChecked() ? SpinBoxTol->text() : QString(" "));
+
QStringList anEntryList;
try {
SUIT_OverrideCursor aWaitCursor;
+ myMeshArray[0]->SetParameters( aParameters.join(":").toLatin1().constData() );
+
SMESH::SMESH_Gen_var aSMESHGen = SMESHGUI::GetSMESHGen();
// concatenate meshes
if(CheckBoxCommon->isChecked())
CheckBoxMerge->isChecked(),
SpinBoxTol->GetValue());
- aCompoundMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
-
_PTR(SObject) aSO = SMESH::FindSObject( aCompoundMesh );
if( aSO ) {
SMESH::SetName( aSO, LineEditName->text() );
try {
SUIT_OverrideCursor wc;
- SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
- //if ( LinearAnglesCheck->isChecked() ) {
- // anAngles = aMeshEditor->LinearAnglesVariation( myPathMesh, myPathShape, anAngles );
- //}
+ SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
SMESH::SMESH_MeshEditor::Extrusion_Error retVal;
- /*
- if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() ) {
- if( MeshCheck->isChecked() ) {
- if( GetConstructorId() == 0 )
- SMESH::ListOfGroups_var groups =
- aMeshEditor->ExtrusionAlongPathObject1DMakeGroups(myIDSource, myPathMesh,
- myPathShape, aNodeStart,
- AnglesGrp->isChecked(), anAngles,
- BasePointGrp->isChecked(), aBasePoint, retVal);
- else
- SMESH::ListOfGroups_var groups =
- aMeshEditor->ExtrusionAlongPathObject2DMakeGroups(myIDSource, myPathMesh,
- myPathShape, aNodeStart,
- AnglesGrp->isChecked(), anAngles,
- BasePointGrp->isChecked(), aBasePoint, retVal);
- }
- else
- SMESH::ListOfGroups_var groups =
- aMeshEditor->ExtrusionAlongPathMakeGroups(anElementsId, myPathMesh,
- myPathShape, aNodeStart,
- AnglesGrp->isChecked(), anAngles,
- BasePointGrp->isChecked(), aBasePoint, retVal);
- }
- else {
- if( MeshCheck->isChecked() ) {
- if( GetConstructorId() == 0 )
- retVal = aMeshEditor->ExtrusionAlongPathObject1D(myIDSource, myPathMesh,
- myPathShape, aNodeStart,
- AnglesGrp->isChecked(), anAngles,
- BasePointGrp->isChecked(), aBasePoint);
- else
- retVal = aMeshEditor->ExtrusionAlongPathObject2D(myIDSource, myPathMesh,
- myPathShape, aNodeStart,
- AnglesGrp->isChecked(), anAngles,
- BasePointGrp->isChecked(), aBasePoint);
- }
- else
- retVal = aMeshEditor->ExtrusionAlongPath(anElementsId, myPathMesh,
- myPathShape, aNodeStart,
- AnglesGrp->isChecked(), anAngles,
- BasePointGrp->isChecked(), aBasePoint);
- }
- */
+
+ myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
bool NeedGroups = ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() );
SMESH::ElementType ElemType = SMESH::FACE;
}
- if( retVal == SMESH::SMESH_MeshEditor::EXTR_OK )
- myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
-
- //wc.stop();
wc.suspend();
switch (retVal) {
case SMESH::SMESH_MeshEditor::EXTR_NO_ELEMENTS:
aParameters << SpinBox_Dy->text();
aParameters << SpinBox_Dz->text();
} else if ( RadioButton4->isChecked() ) {
- aParameters << SpinBox_Vx->text();
- aParameters << SpinBox_Vy->text();
- aParameters << SpinBox_Vz->text();
- aParameters << SpinBox_VDist->text();
+ // only 3 coords in a python dump command :(
+ // aParameters << SpinBox_Vx->text();
+ // aParameters << SpinBox_Vy->text();
+ // aParameters << SpinBox_Vz->text();
+ // aParameters << SpinBox_VDist->text();
}
long aNbSteps = (long)SpinBox_NbSteps->value();
SUIT_OverrideCursor aWaitCursor;
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
+ myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
+
if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() ) {
if( CheckBoxMesh->isChecked() )
switch (GetConstructorId() ) {
aMeshEditor->ExtrusionSweep(myElementsId.inout(), aVector, aNbSteps);
}
- myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
-
} catch (...) {
}
{
SMESHType = SMESH::EDGE;
SMDSType = SMDSAbs_Edge;
- break;
+ break;
}
case 2:
{
case 0:
{
aMeshEditor->ExtrusionSweepObject0D(mySelectedObject, aVector, aNbSteps);
- break;
+ break;
}
case 1:
{
aMeshEditor->ExtrusionSweepObject1D(mySelectedObject, aVector, aNbSteps);
- break;
+ break;
}
case 2:
{
aMeshEditor->ExtrusionSweepObject2D(mySelectedObject, aVector, aNbSteps);
- break;
+ break;
}
}
}
{
SalomeApp_IntSpinBox* sb = ( SalomeApp_IntSpinBox* )( *anIt );
item.myValue = sb->value();
+ item.myText = sb->text();
params.append( item );
}
else if( (*anIt)->inherits( "SalomeApp_DoubleSpinBox" ) )
{
SalomeApp_DoubleSpinBox* sb = ( SalomeApp_DoubleSpinBox* )( *anIt );
item.myValue = sb->value();
+ item.myText = sb->text();
params.append( item );
}
else if( (*anIt)->inherits( "QLineEdit" ) )
{
QLineEdit* line = ( QLineEdit* )( *anIt );
- item.myValue = line->text();
+ item.myValue = item.myText = line->text();
params.append( item );
}
else if ( getParamFromCustomWidget( item, *anIt ))
return res;
}
+QString SMESHGUI_GenericHypothesisCreator::getVariableName(const char* methodName) const
+{
+ SMESH::SMESH_Hypothesis_var h = hypothesis();
+ if ( !h->_is_nil() )
+ {
+ CORBA::String_var aVaribaleName = h->GetVarParameter( methodName );
+ return QString( aVaribaleName.in() );
+ }
+ return QString();
+}
QStringList SMESHGUI_GenericHypothesisCreator::getVariablesFromDlg() const
{
QString myName;
QVariant myValue;
bool isVariable;
+ QString myText;
StdParam(){
isVariable = false;
}
+ const char* text() const { return myText.toLatin1().constData(); }
};
typedef QList<StdParam> ListOfStdParams;
const ListOfWidgets& widgets() const;
ListOfWidgets& changeWidgets();
QtxDialog* dlg() const;
+ QString getVariableName(const char* methodName) const;
virtual QFrame* buildFrame() = 0;
QFrame* buildStdFrame();
return false;
}
+ QStringList aParameters;
+ aParameters << myDlg->myX->text();
+ aParameters << myDlg->myY->text();
+ aParameters << myDlg->myZ->text();
try {
SMESH::SMESH_Mesh_var aMesh = SMESH::GetMeshByIO(myMeshActor->getIO());
if (aMeshEditor->_is_nil())
return true;
+ aMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
+
bool ok;
int anId = myDlg->myId->text().toInt( &ok );
if( !ok || anId < 1 )
if (aResult)
{
- QStringList aParameters;
- aParameters << myDlg->myX->text();
- aParameters << myDlg->myY->text();
- aParameters << myDlg->myZ->text();
- aMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
-
myDlg->myCurrentX->SetValue(0);
myDlg->myCurrentY->SetValue(0);
myDlg->myCurrentZ->SetValue(0);
erasePreview();
if (isRefine()) { // Refining existing mesh elements
+ {
+ QStringList aParameters;
+ aParameters << myNode1->text();
+ if(myType == Type_3d )
+ aParameters << myNode2->text();
+ myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
+ }
QList<int> ids;
getIds(ids);
SMESH::long_array_var varIds = new SMESH::long_array();
? 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( aParameters.join(":").toLatin1().constData() );
-
} else { // Applying a pattern to geometrical object
if (myType == Type_2d)
myPattern->ApplyToFace(myGeomObj[Object], myGeomObj[Vertex1], myReverseChk->isChecked());
const SMESH::long_array& theIds,
SMESH::SMESH_IDSource_ptr obj)
{
+ {
+ QStringList aParameters;
+ aParameters << myMaxAngleSpin->text();
+ myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
+ }
SMESH::NumericalFunctor_var aCriterion = getNumericalFunctor();
double aMaxAngle = myMaxAngleSpin->GetValue() * M_PI / 180.0;
bool ok;
ok = theEditor->TriToQuad(theIds, aCriterion, aMaxAngle);
else
ok = theEditor->TriToQuadObject(obj, aCriterion, aMaxAngle);
- if( ok ) {
- QStringList aParameters;
- aParameters << myMaxAngleSpin->text();
- myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
- }
return ok;
}
try {
_PTR(SObject) aSobj = SMESH::FindSObject( theMesh );
SMESH::SMESH_MeshEditor_var aMeshEditor = theMesh->GetMeshEditor();
- aNodeId = aMeshEditor->AddNode( x, y, z );
theMesh->SetParameters( theParameters.join(":").toLatin1().constData() );
+ aNodeId = aMeshEditor->AddNode( x, y, z );
_PTR(Study) aStudy = GetActiveStudyDocument();
CORBA::Long anId = aStudy->StudyId();
if (TVisualObjPtr aVisualObj = SMESH::GetVisualObj( anId, aSobj->GetID().c_str() ) ) {
SUIT_OverrideCursor aWaitCursor;
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
+ myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
+
if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() ) {
if( CheckBoxMesh->isChecked() ) {
if( GetConstructorId() == 0 )
aMeshEditor->RotationSweep(anElementsId.inout(), anAxis, anAngle, aNbSteps, aTolerance);
}
- myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
} catch (...) {
}
try {
SUIT_OverrideCursor aWaitCursor;
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
+
+ myMesh->SetParameters(aParameters.join(":").toLatin1().constData());
+
switch ( actionButton ) {
case MOVE_ELEMS_BUTTON:
if(CheckBoxMesh->isChecked())
aMeshEditor->RotateObject(mySelectedObject, anAxis, anAngle, false);
else
aMeshEditor->Rotate(anElementsId, anAxis, anAngle, false);
- if( !myMesh->_is_nil())
- myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
break;
case COPY_ELEMS_BUTTON:
if ( makeGroups ) {
else
aMeshEditor->Rotate(anElementsId, anAxis, anAngle, true);
}
- if( !myMesh->_is_nil())
- myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
break;
case MAKE_MESH_BUTTON: {
SMESH::SMESH_Mesh_var mesh;
mesh = aMeshEditor->RotateMakeMesh(anElementsId, anAxis, anAngle, makeGroups,
LineEditNewMesh->text().toLatin1().data());
if (!mesh->_is_nil()) {
- mesh->SetParameters(aParameters.join(":").toLatin1().constData());
if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) )
anEntryList.append( aSObject->GetID().c_str() );
#ifdef WITHGENERICOBJ
try {
SUIT_OverrideCursor aWaitCursor;
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
+
+ myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
+
SMESH::SMESH_IDSource_var obj;
if ( CheckBoxMesh->isChecked() )
obj = mySelectedObject;
case MOVE_ELEMS_BUTTON:
aMeshEditor->Scale(obj, aPoint, aScaleFact, false);
- if( !myMesh->_is_nil())
- myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
break;
case COPY_ELEMS_BUTTON:
aMeshEditor->ScaleMakeGroups(obj, aPoint, aScaleFact);
else
aMeshEditor->Scale(obj, aPoint, aScaleFact, true);
- if( !myMesh->_is_nil())
- myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
break;
case MAKE_MESH_BUTTON: {
aMeshEditor->ScaleMakeMesh(obj, aPoint, aScaleFact, makeGroups,
LineEditNewMesh->text().toLatin1().data());
if (!mesh->_is_nil()) {
- mesh->SetParameters(aParameters.join(":").toLatin1().constData());
if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) )
anEntryList.append( aSObject->GetID().c_str() );
#ifdef WITHGENERICOBJ
SUIT_OverrideCursor aWaitCursor;
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
+ myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
+
if ( CheckBoxParametric->isChecked() ) {
if(CheckBoxMesh->isChecked())
aResult = aMeshEditor->SmoothParametricObject(mySelectedObject, aNodesId.inout(),
anIterationLimit, aMaxAspectRatio, aMethod);
}
- myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
-
} catch (...) {
}
SUIT_OverrideCursor aWaitCursor;
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
+ myMesh->SetParameters(aParameters.join(":").toLatin1().constData());
+
switch ( actionButton ) {
case MOVE_ELEMS_BUTTON: {
if(CheckBoxMesh->isChecked())
else
aMeshEditor->Mirror(anElementsId, aMirror, aMirrorType, false );
- if( !myMesh->_is_nil())
- myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
break;
}
case COPY_ELEMS_BUTTON: {
else
aMeshEditor->Mirror(anElementsId, aMirror, aMirrorType, true);
}
- if( !myMesh->_is_nil())
- myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
break;
}
case MAKE_MESH_BUTTON: {
else
mesh = aMeshEditor->MirrorMakeMesh(anElementsId, aMirror, aMirrorType, makeGroups,
LineEditNewMesh->text().toLatin1().data());
- if (!mesh->_is_nil()) {
- mesh->SetParameters(aParameters.join(":").toLatin1().constData());
if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) )
anEntryList.append( aSObject->GetID().c_str() );
#ifdef WITHGENERICOBJ
}
break;
}
- }
} catch (...) {
}
anElementsId[i] = aListElementsId[i].toInt();
SMESH::DirStruct aVector;
+ QStringList aParameters;
if (GetConstructorId() == 0) {
aVector.PS.x = SpinBox2_1->GetValue() - SpinBox1_1->GetValue();
aVector.PS.y = SpinBox2_2->GetValue() - SpinBox1_2->GetValue();
aVector.PS.z = SpinBox2_3->GetValue() - SpinBox1_3->GetValue();
+ // not supported so far
+ // aParameters << QString("%1 - %2").arg( SpinBox2_1->text() ).arg( SpinBox1_1->text() );
+ // aParameters << QString("%1 - %2").arg( SpinBox2_2->text() ).arg( SpinBox1_2->text() );
+ // aParameters << QString("%1 - %2").arg( SpinBox2_3->text() ).arg( SpinBox1_3->text() );
} else if (GetConstructorId() == 1) {
aVector.PS.x = SpinBox1_1->GetValue();
aVector.PS.y = SpinBox1_2->GetValue();
aVector.PS.z = SpinBox1_3->GetValue();
+ aParameters << SpinBox1_1->text();
+ aParameters << SpinBox1_2->text();
+ aParameters << SpinBox1_3->text();
}
- QStringList aParameters;
- aParameters << SpinBox1_1->text();
- if (GetConstructorId() == 0)
- aParameters << SpinBox2_1->text();
- aParameters << SpinBox1_2->text();
- if (GetConstructorId() == 0)
- aParameters << SpinBox2_2->text();
- aParameters << SpinBox1_3->text();
- if (GetConstructorId() == 0)
- aParameters << SpinBox2_3->text();
-
int actionButton = ActionGroup->checkedId();
bool makeGroups = ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() );
QStringList anEntryList;
try {
SUIT_OverrideCursor aWaitCursor;
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
+
+ myMesh->SetParameters(aParameters.join(":").toLatin1().constData());
+
switch ( actionButton ) {
case MOVE_ELEMS_BUTTON:
if(CheckBoxMesh->isChecked())
aMeshEditor->TranslateObject(mySelectedObject, aVector, false);
else
aMeshEditor->Translate(anElementsId, aVector, false);
- if( !myMesh->_is_nil())
- myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
break;
case COPY_ELEMS_BUTTON:
if ( makeGroups ) {
else
aMeshEditor->Translate(anElementsId, aVector, true);
}
- if( !myMesh->_is_nil())
- myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
break;
- case MAKE_MESH_BUTTON:
+ case MAKE_MESH_BUTTON: {
SMESH::SMESH_Mesh_var mesh;
if (CheckBoxMesh->isChecked())
mesh = aMeshEditor->TranslateObjectMakeMesh(mySelectedObject, aVector, makeGroups,
else
mesh = aMeshEditor->TranslateMakeMesh(anElementsId, aVector, makeGroups,
LineEditNewMesh->text().toLatin1().data());
- if (!mesh->_is_nil()) {
- mesh->SetParameters(aParameters.join(":").toLatin1().constData());
if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) )
anEntryList.append( aSObject->GetID().c_str() );
#ifdef WITHGENERICOBJ