mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-18 15:40:33 +05:00
0021308: Remove hard-coded dependency of the external mesh plugins from the SMESH module
Now it's necessary to call myMesh->SetParameters() just before calling a method using parameters that can be defined via notebook variables
This commit is contained in:
parent
4a78d582ba
commit
d4675122f5
@ -295,13 +295,17 @@ bool SMESHGUI_BuildCompoundDlg::ClickOnApply()
|
|||||||
|
|
||||||
SMESH::SMESH_Mesh_var aCompoundMesh;
|
SMESH::SMESH_Mesh_var aCompoundMesh;
|
||||||
|
|
||||||
if (!myMesh->_is_nil()) {
|
if (!myMesh->_is_nil())
|
||||||
|
{
|
||||||
QStringList aParameters;
|
QStringList aParameters;
|
||||||
aParameters << (CheckBoxMerge->isChecked() ? SpinBoxTol->text() : QString(" "));
|
aParameters << (CheckBoxMerge->isChecked() ? SpinBoxTol->text() : QString(" "));
|
||||||
|
|
||||||
QStringList anEntryList;
|
QStringList anEntryList;
|
||||||
try {
|
try {
|
||||||
SUIT_OverrideCursor aWaitCursor;
|
SUIT_OverrideCursor aWaitCursor;
|
||||||
|
|
||||||
|
myMeshArray[0]->SetParameters( aParameters.join(":").toLatin1().constData() );
|
||||||
|
|
||||||
SMESH::SMESH_Gen_var aSMESHGen = SMESHGUI::GetSMESHGen();
|
SMESH::SMESH_Gen_var aSMESHGen = SMESHGUI::GetSMESHGen();
|
||||||
// concatenate meshes
|
// concatenate meshes
|
||||||
if(CheckBoxCommon->isChecked())
|
if(CheckBoxCommon->isChecked())
|
||||||
@ -315,8 +319,6 @@ bool SMESHGUI_BuildCompoundDlg::ClickOnApply()
|
|||||||
CheckBoxMerge->isChecked(),
|
CheckBoxMerge->isChecked(),
|
||||||
SpinBoxTol->GetValue());
|
SpinBoxTol->GetValue());
|
||||||
|
|
||||||
aCompoundMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
|
|
||||||
|
|
||||||
_PTR(SObject) aSO = SMESH::FindSObject( aCompoundMesh );
|
_PTR(SObject) aSO = SMESH::FindSObject( aCompoundMesh );
|
||||||
if( aSO ) {
|
if( aSO ) {
|
||||||
SMESH::SetName( aSO, LineEditName->text() );
|
SMESH::SetName( aSO, LineEditName->text() );
|
||||||
|
@ -533,55 +533,11 @@ bool SMESHGUI_ExtrusionAlongPathDlg::ClickOnApply()
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
SUIT_OverrideCursor wc;
|
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;
|
SMESH::SMESH_MeshEditor::Extrusion_Error retVal;
|
||||||
/*
|
|
||||||
if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() ) {
|
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
|
||||||
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);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
bool NeedGroups = ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() );
|
bool NeedGroups = ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() );
|
||||||
SMESH::ElementType ElemType = SMESH::FACE;
|
SMESH::ElementType ElemType = SMESH::FACE;
|
||||||
@ -603,10 +559,6 @@ bool SMESHGUI_ExtrusionAlongPathDlg::ClickOnApply()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if( retVal == SMESH::SMESH_MeshEditor::EXTR_OK )
|
|
||||||
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
|
|
||||||
|
|
||||||
//wc.stop();
|
|
||||||
wc.suspend();
|
wc.suspend();
|
||||||
switch (retVal) {
|
switch (retVal) {
|
||||||
case SMESH::SMESH_MeshEditor::EXTR_NO_ELEMENTS:
|
case SMESH::SMESH_MeshEditor::EXTR_NO_ELEMENTS:
|
||||||
|
@ -552,10 +552,11 @@ bool SMESHGUI_ExtrusionDlg::ClickOnApply()
|
|||||||
aParameters << SpinBox_Dy->text();
|
aParameters << SpinBox_Dy->text();
|
||||||
aParameters << SpinBox_Dz->text();
|
aParameters << SpinBox_Dz->text();
|
||||||
} else if ( RadioButton4->isChecked() ) {
|
} else if ( RadioButton4->isChecked() ) {
|
||||||
aParameters << SpinBox_Vx->text();
|
// only 3 coords in a python dump command :(
|
||||||
aParameters << SpinBox_Vy->text();
|
// aParameters << SpinBox_Vx->text();
|
||||||
aParameters << SpinBox_Vz->text();
|
// aParameters << SpinBox_Vy->text();
|
||||||
aParameters << SpinBox_VDist->text();
|
// aParameters << SpinBox_Vz->text();
|
||||||
|
// aParameters << SpinBox_VDist->text();
|
||||||
}
|
}
|
||||||
|
|
||||||
long aNbSteps = (long)SpinBox_NbSteps->value();
|
long aNbSteps = (long)SpinBox_NbSteps->value();
|
||||||
@ -566,6 +567,8 @@ bool SMESHGUI_ExtrusionDlg::ClickOnApply()
|
|||||||
SUIT_OverrideCursor aWaitCursor;
|
SUIT_OverrideCursor aWaitCursor;
|
||||||
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
|
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
|
||||||
|
|
||||||
|
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
|
||||||
|
|
||||||
if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() ) {
|
if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() ) {
|
||||||
if( CheckBoxMesh->isChecked() )
|
if( CheckBoxMesh->isChecked() )
|
||||||
switch (GetConstructorId() ) {
|
switch (GetConstructorId() ) {
|
||||||
@ -624,8 +627,6 @@ bool SMESHGUI_ExtrusionDlg::ClickOnApply()
|
|||||||
aMeshEditor->ExtrusionSweep(myElementsId.inout(), aVector, aNbSteps);
|
aMeshEditor->ExtrusionSweep(myElementsId.inout(), aVector, aNbSteps);
|
||||||
}
|
}
|
||||||
|
|
||||||
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
|
|
||||||
|
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -332,18 +332,20 @@ bool SMESHGUI_GenericHypothesisCreator::getStdParamFromDlg( ListOfStdParams& par
|
|||||||
{
|
{
|
||||||
SalomeApp_IntSpinBox* sb = ( SalomeApp_IntSpinBox* )( *anIt );
|
SalomeApp_IntSpinBox* sb = ( SalomeApp_IntSpinBox* )( *anIt );
|
||||||
item.myValue = sb->value();
|
item.myValue = sb->value();
|
||||||
|
item.myText = sb->text();
|
||||||
params.append( item );
|
params.append( item );
|
||||||
}
|
}
|
||||||
else if( (*anIt)->inherits( "SalomeApp_DoubleSpinBox" ) )
|
else if( (*anIt)->inherits( "SalomeApp_DoubleSpinBox" ) )
|
||||||
{
|
{
|
||||||
SalomeApp_DoubleSpinBox* sb = ( SalomeApp_DoubleSpinBox* )( *anIt );
|
SalomeApp_DoubleSpinBox* sb = ( SalomeApp_DoubleSpinBox* )( *anIt );
|
||||||
item.myValue = sb->value();
|
item.myValue = sb->value();
|
||||||
|
item.myText = sb->text();
|
||||||
params.append( item );
|
params.append( item );
|
||||||
}
|
}
|
||||||
else if( (*anIt)->inherits( "QLineEdit" ) )
|
else if( (*anIt)->inherits( "QLineEdit" ) )
|
||||||
{
|
{
|
||||||
QLineEdit* line = ( QLineEdit* )( *anIt );
|
QLineEdit* line = ( QLineEdit* )( *anIt );
|
||||||
item.myValue = line->text();
|
item.myValue = item.myText = line->text();
|
||||||
params.append( item );
|
params.append( item );
|
||||||
}
|
}
|
||||||
else if ( getParamFromCustomWidget( item, *anIt ))
|
else if ( getParamFromCustomWidget( item, *anIt ))
|
||||||
@ -356,6 +358,16 @@ bool SMESHGUI_GenericHypothesisCreator::getStdParamFromDlg( ListOfStdParams& par
|
|||||||
return res;
|
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
|
QStringList SMESHGUI_GenericHypothesisCreator::getVariablesFromDlg() const
|
||||||
{
|
{
|
||||||
|
@ -81,9 +81,11 @@ protected:
|
|||||||
QString myName;
|
QString myName;
|
||||||
QVariant myValue;
|
QVariant myValue;
|
||||||
bool isVariable;
|
bool isVariable;
|
||||||
|
QString myText;
|
||||||
StdParam(){
|
StdParam(){
|
||||||
isVariable = false;
|
isVariable = false;
|
||||||
}
|
}
|
||||||
|
const char* text() const { return myText.toLatin1().constData(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef QList<StdParam> ListOfStdParams;
|
typedef QList<StdParam> ListOfStdParams;
|
||||||
@ -95,6 +97,7 @@ protected:
|
|||||||
const ListOfWidgets& widgets() const;
|
const ListOfWidgets& widgets() const;
|
||||||
ListOfWidgets& changeWidgets();
|
ListOfWidgets& changeWidgets();
|
||||||
QtxDialog* dlg() const;
|
QtxDialog* dlg() const;
|
||||||
|
QString getVariableName(const char* methodName) const;
|
||||||
|
|
||||||
virtual QFrame* buildFrame() = 0;
|
virtual QFrame* buildFrame() = 0;
|
||||||
QFrame* buildStdFrame();
|
QFrame* buildStdFrame();
|
||||||
|
@ -429,6 +429,10 @@ bool SMESHGUI_MakeNodeAtPointOp::onApply()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QStringList aParameters;
|
||||||
|
aParameters << myDlg->myX->text();
|
||||||
|
aParameters << myDlg->myY->text();
|
||||||
|
aParameters << myDlg->myZ->text();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
SMESH::SMESH_Mesh_var aMesh = SMESH::GetMeshByIO(myMeshActor->getIO());
|
SMESH::SMESH_Mesh_var aMesh = SMESH::GetMeshByIO(myMeshActor->getIO());
|
||||||
@ -441,6 +445,8 @@ bool SMESHGUI_MakeNodeAtPointOp::onApply()
|
|||||||
if (aMeshEditor->_is_nil())
|
if (aMeshEditor->_is_nil())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
aMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
|
||||||
|
|
||||||
bool ok;
|
bool ok;
|
||||||
int anId = myDlg->myId->text().toInt( &ok );
|
int anId = myDlg->myId->text().toInt( &ok );
|
||||||
if( !ok || anId < 1 )
|
if( !ok || anId < 1 )
|
||||||
@ -455,12 +461,6 @@ bool SMESHGUI_MakeNodeAtPointOp::onApply()
|
|||||||
|
|
||||||
if (aResult)
|
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->myCurrentX->SetValue(0);
|
||||||
myDlg->myCurrentY->SetValue(0);
|
myDlg->myCurrentY->SetValue(0);
|
||||||
myDlg->myCurrentZ->SetValue(0);
|
myDlg->myCurrentZ->SetValue(0);
|
||||||
|
@ -468,6 +468,13 @@ bool SMESHGUI_MeshPatternDlg::onApply()
|
|||||||
erasePreview();
|
erasePreview();
|
||||||
|
|
||||||
if (isRefine()) { // Refining existing mesh elements
|
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;
|
QList<int> ids;
|
||||||
getIds(ids);
|
getIds(ids);
|
||||||
SMESH::long_array_var varIds = new SMESH::long_array();
|
SMESH::long_array_var varIds = new SMESH::long_array();
|
||||||
@ -479,12 +486,6 @@ bool SMESHGUI_MeshPatternDlg::onApply()
|
|||||||
? myPattern->ApplyToMeshFaces (myMesh, varIds, getNode(false), myReverseChk->isChecked())
|
? myPattern->ApplyToMeshFaces (myMesh, varIds, getNode(false), myReverseChk->isChecked())
|
||||||
: myPattern->ApplyToHexahedrons(myMesh, varIds, getNode(false), getNode(true));
|
: 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
|
} else { // Applying a pattern to geometrical object
|
||||||
if (myType == Type_2d)
|
if (myType == Type_2d)
|
||||||
myPattern->ApplyToFace(myGeomObj[Object], myGeomObj[Vertex1], myReverseChk->isChecked());
|
myPattern->ApplyToFace(myGeomObj[Object], myGeomObj[Vertex1], myReverseChk->isChecked());
|
||||||
|
@ -1205,6 +1205,11 @@ bool SMESHGUI_UnionOfTrianglesDlg::process (SMESH::SMESH_MeshEditor_ptr theEdito
|
|||||||
const SMESH::long_array& theIds,
|
const SMESH::long_array& theIds,
|
||||||
SMESH::SMESH_IDSource_ptr obj)
|
SMESH::SMESH_IDSource_ptr obj)
|
||||||
{
|
{
|
||||||
|
{
|
||||||
|
QStringList aParameters;
|
||||||
|
aParameters << myMaxAngleSpin->text();
|
||||||
|
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
|
||||||
|
}
|
||||||
SMESH::NumericalFunctor_var aCriterion = getNumericalFunctor();
|
SMESH::NumericalFunctor_var aCriterion = getNumericalFunctor();
|
||||||
double aMaxAngle = myMaxAngleSpin->GetValue() * M_PI / 180.0;
|
double aMaxAngle = myMaxAngleSpin->GetValue() * M_PI / 180.0;
|
||||||
bool ok;
|
bool ok;
|
||||||
@ -1212,11 +1217,6 @@ bool SMESHGUI_UnionOfTrianglesDlg::process (SMESH::SMESH_MeshEditor_ptr theEdito
|
|||||||
ok = theEditor->TriToQuad(theIds, aCriterion, aMaxAngle);
|
ok = theEditor->TriToQuad(theIds, aCriterion, aMaxAngle);
|
||||||
else
|
else
|
||||||
ok = theEditor->TriToQuadObject(obj, aCriterion, aMaxAngle);
|
ok = theEditor->TriToQuadObject(obj, aCriterion, aMaxAngle);
|
||||||
if( ok ) {
|
|
||||||
QStringList aParameters;
|
|
||||||
aParameters << myMaxAngleSpin->text();
|
|
||||||
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
|
|
||||||
}
|
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -100,8 +100,8 @@ namespace SMESH
|
|||||||
try {
|
try {
|
||||||
_PTR(SObject) aSobj = SMESH::FindSObject( theMesh );
|
_PTR(SObject) aSobj = SMESH::FindSObject( theMesh );
|
||||||
SMESH::SMESH_MeshEditor_var aMeshEditor = theMesh->GetMeshEditor();
|
SMESH::SMESH_MeshEditor_var aMeshEditor = theMesh->GetMeshEditor();
|
||||||
aNodeId = aMeshEditor->AddNode( x, y, z );
|
|
||||||
theMesh->SetParameters( theParameters.join(":").toLatin1().constData() );
|
theMesh->SetParameters( theParameters.join(":").toLatin1().constData() );
|
||||||
|
aNodeId = aMeshEditor->AddNode( x, y, z );
|
||||||
_PTR(Study) aStudy = GetActiveStudyDocument();
|
_PTR(Study) aStudy = GetActiveStudyDocument();
|
||||||
CORBA::Long anId = aStudy->StudyId();
|
CORBA::Long anId = aStudy->StudyId();
|
||||||
if (TVisualObjPtr aVisualObj = SMESH::GetVisualObj( anId, aSobj->GetID().c_str() ) ) {
|
if (TVisualObjPtr aVisualObj = SMESH::GetVisualObj( anId, aSobj->GetID().c_str() ) ) {
|
||||||
|
@ -519,6 +519,8 @@ bool SMESHGUI_RevolutionDlg::ClickOnApply()
|
|||||||
SUIT_OverrideCursor aWaitCursor;
|
SUIT_OverrideCursor aWaitCursor;
|
||||||
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
|
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
|
||||||
|
|
||||||
|
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
|
||||||
|
|
||||||
if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() ) {
|
if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() ) {
|
||||||
if( CheckBoxMesh->isChecked() ) {
|
if( CheckBoxMesh->isChecked() ) {
|
||||||
if( GetConstructorId() == 0 )
|
if( GetConstructorId() == 0 )
|
||||||
@ -546,7 +548,6 @@ bool SMESHGUI_RevolutionDlg::ClickOnApply()
|
|||||||
aMeshEditor->RotationSweep(anElementsId.inout(), anAxis, anAngle, aNbSteps, aTolerance);
|
aMeshEditor->RotationSweep(anElementsId.inout(), anAxis, anAngle, aNbSteps, aTolerance);
|
||||||
}
|
}
|
||||||
|
|
||||||
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
|
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -433,14 +433,15 @@ bool SMESHGUI_RotationDlg::ClickOnApply()
|
|||||||
try {
|
try {
|
||||||
SUIT_OverrideCursor aWaitCursor;
|
SUIT_OverrideCursor aWaitCursor;
|
||||||
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
|
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
|
||||||
|
|
||||||
|
myMesh->SetParameters(aParameters.join(":").toLatin1().constData());
|
||||||
|
|
||||||
switch ( actionButton ) {
|
switch ( actionButton ) {
|
||||||
case MOVE_ELEMS_BUTTON:
|
case MOVE_ELEMS_BUTTON:
|
||||||
if(CheckBoxMesh->isChecked())
|
if(CheckBoxMesh->isChecked())
|
||||||
aMeshEditor->RotateObject(mySelectedObject, anAxis, anAngle, false);
|
aMeshEditor->RotateObject(mySelectedObject, anAxis, anAngle, false);
|
||||||
else
|
else
|
||||||
aMeshEditor->Rotate(anElementsId, anAxis, anAngle, false);
|
aMeshEditor->Rotate(anElementsId, anAxis, anAngle, false);
|
||||||
if( !myMesh->_is_nil())
|
|
||||||
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
|
|
||||||
break;
|
break;
|
||||||
case COPY_ELEMS_BUTTON:
|
case COPY_ELEMS_BUTTON:
|
||||||
if ( makeGroups ) {
|
if ( makeGroups ) {
|
||||||
@ -456,8 +457,6 @@ bool SMESHGUI_RotationDlg::ClickOnApply()
|
|||||||
else
|
else
|
||||||
aMeshEditor->Rotate(anElementsId, anAxis, anAngle, true);
|
aMeshEditor->Rotate(anElementsId, anAxis, anAngle, true);
|
||||||
}
|
}
|
||||||
if( !myMesh->_is_nil())
|
|
||||||
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
|
|
||||||
break;
|
break;
|
||||||
case MAKE_MESH_BUTTON: {
|
case MAKE_MESH_BUTTON: {
|
||||||
SMESH::SMESH_Mesh_var mesh;
|
SMESH::SMESH_Mesh_var mesh;
|
||||||
@ -468,7 +467,6 @@ bool SMESHGUI_RotationDlg::ClickOnApply()
|
|||||||
mesh = aMeshEditor->RotateMakeMesh(anElementsId, anAxis, anAngle, makeGroups,
|
mesh = aMeshEditor->RotateMakeMesh(anElementsId, anAxis, anAngle, makeGroups,
|
||||||
LineEditNewMesh->text().toLatin1().data());
|
LineEditNewMesh->text().toLatin1().data());
|
||||||
if (!mesh->_is_nil()) {
|
if (!mesh->_is_nil()) {
|
||||||
mesh->SetParameters(aParameters.join(":").toLatin1().constData());
|
|
||||||
if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) )
|
if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) )
|
||||||
anEntryList.append( aSObject->GetID().c_str() );
|
anEntryList.append( aSObject->GetID().c_str() );
|
||||||
#ifdef WITHGENERICOBJ
|
#ifdef WITHGENERICOBJ
|
||||||
|
@ -475,6 +475,9 @@ bool SMESHGUI_ScaleDlg::ClickOnApply()
|
|||||||
try {
|
try {
|
||||||
SUIT_OverrideCursor aWaitCursor;
|
SUIT_OverrideCursor aWaitCursor;
|
||||||
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
|
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
|
||||||
|
|
||||||
|
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
|
||||||
|
|
||||||
SMESH::SMESH_IDSource_var obj;
|
SMESH::SMESH_IDSource_var obj;
|
||||||
if ( CheckBoxMesh->isChecked() )
|
if ( CheckBoxMesh->isChecked() )
|
||||||
obj = mySelectedObject;
|
obj = mySelectedObject;
|
||||||
@ -485,8 +488,6 @@ bool SMESHGUI_ScaleDlg::ClickOnApply()
|
|||||||
|
|
||||||
case MOVE_ELEMS_BUTTON:
|
case MOVE_ELEMS_BUTTON:
|
||||||
aMeshEditor->Scale(obj, aPoint, aScaleFact, false);
|
aMeshEditor->Scale(obj, aPoint, aScaleFact, false);
|
||||||
if( !myMesh->_is_nil())
|
|
||||||
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case COPY_ELEMS_BUTTON:
|
case COPY_ELEMS_BUTTON:
|
||||||
@ -495,8 +496,6 @@ bool SMESHGUI_ScaleDlg::ClickOnApply()
|
|||||||
aMeshEditor->ScaleMakeGroups(obj, aPoint, aScaleFact);
|
aMeshEditor->ScaleMakeGroups(obj, aPoint, aScaleFact);
|
||||||
else
|
else
|
||||||
aMeshEditor->Scale(obj, aPoint, aScaleFact, true);
|
aMeshEditor->Scale(obj, aPoint, aScaleFact, true);
|
||||||
if( !myMesh->_is_nil())
|
|
||||||
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MAKE_MESH_BUTTON: {
|
case MAKE_MESH_BUTTON: {
|
||||||
@ -504,7 +503,6 @@ bool SMESHGUI_ScaleDlg::ClickOnApply()
|
|||||||
aMeshEditor->ScaleMakeMesh(obj, aPoint, aScaleFact, makeGroups,
|
aMeshEditor->ScaleMakeMesh(obj, aPoint, aScaleFact, makeGroups,
|
||||||
LineEditNewMesh->text().toLatin1().data());
|
LineEditNewMesh->text().toLatin1().data());
|
||||||
if (!mesh->_is_nil()) {
|
if (!mesh->_is_nil()) {
|
||||||
mesh->SetParameters(aParameters.join(":").toLatin1().constData());
|
|
||||||
if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) )
|
if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) )
|
||||||
anEntryList.append( aSObject->GetID().c_str() );
|
anEntryList.append( aSObject->GetID().c_str() );
|
||||||
#ifdef WITHGENERICOBJ
|
#ifdef WITHGENERICOBJ
|
||||||
|
@ -380,6 +380,8 @@ bool SMESHGUI_SmoothingDlg::ClickOnApply()
|
|||||||
SUIT_OverrideCursor aWaitCursor;
|
SUIT_OverrideCursor aWaitCursor;
|
||||||
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
|
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
|
||||||
|
|
||||||
|
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
|
||||||
|
|
||||||
if ( CheckBoxParametric->isChecked() ) {
|
if ( CheckBoxParametric->isChecked() ) {
|
||||||
if(CheckBoxMesh->isChecked())
|
if(CheckBoxMesh->isChecked())
|
||||||
aResult = aMeshEditor->SmoothParametricObject(mySelectedObject, aNodesId.inout(),
|
aResult = aMeshEditor->SmoothParametricObject(mySelectedObject, aNodesId.inout(),
|
||||||
@ -397,8 +399,6 @@ bool SMESHGUI_SmoothingDlg::ClickOnApply()
|
|||||||
anIterationLimit, aMaxAspectRatio, aMethod);
|
anIterationLimit, aMaxAspectRatio, aMethod);
|
||||||
}
|
}
|
||||||
|
|
||||||
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
|
|
||||||
|
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -498,6 +498,8 @@ bool SMESHGUI_SymmetryDlg::ClickOnApply()
|
|||||||
SUIT_OverrideCursor aWaitCursor;
|
SUIT_OverrideCursor aWaitCursor;
|
||||||
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
|
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
|
||||||
|
|
||||||
|
myMesh->SetParameters(aParameters.join(":").toLatin1().constData());
|
||||||
|
|
||||||
switch ( actionButton ) {
|
switch ( actionButton ) {
|
||||||
case MOVE_ELEMS_BUTTON: {
|
case MOVE_ELEMS_BUTTON: {
|
||||||
if(CheckBoxMesh->isChecked())
|
if(CheckBoxMesh->isChecked())
|
||||||
@ -505,8 +507,6 @@ bool SMESHGUI_SymmetryDlg::ClickOnApply()
|
|||||||
else
|
else
|
||||||
aMeshEditor->Mirror(anElementsId, aMirror, aMirrorType, false );
|
aMeshEditor->Mirror(anElementsId, aMirror, aMirrorType, false );
|
||||||
|
|
||||||
if( !myMesh->_is_nil())
|
|
||||||
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case COPY_ELEMS_BUTTON: {
|
case COPY_ELEMS_BUTTON: {
|
||||||
@ -523,8 +523,6 @@ bool SMESHGUI_SymmetryDlg::ClickOnApply()
|
|||||||
else
|
else
|
||||||
aMeshEditor->Mirror(anElementsId, aMirror, aMirrorType, true);
|
aMeshEditor->Mirror(anElementsId, aMirror, aMirrorType, true);
|
||||||
}
|
}
|
||||||
if( !myMesh->_is_nil())
|
|
||||||
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case MAKE_MESH_BUTTON: {
|
case MAKE_MESH_BUTTON: {
|
||||||
@ -535,8 +533,6 @@ bool SMESHGUI_SymmetryDlg::ClickOnApply()
|
|||||||
else
|
else
|
||||||
mesh = aMeshEditor->MirrorMakeMesh(anElementsId, aMirror, aMirrorType, makeGroups,
|
mesh = aMeshEditor->MirrorMakeMesh(anElementsId, aMirror, aMirrorType, makeGroups,
|
||||||
LineEditNewMesh->text().toLatin1().data());
|
LineEditNewMesh->text().toLatin1().data());
|
||||||
if (!mesh->_is_nil()) {
|
|
||||||
mesh->SetParameters(aParameters.join(":").toLatin1().constData());
|
|
||||||
if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) )
|
if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) )
|
||||||
anEntryList.append( aSObject->GetID().c_str() );
|
anEntryList.append( aSObject->GetID().c_str() );
|
||||||
#ifdef WITHGENERICOBJ
|
#ifdef WITHGENERICOBJ
|
||||||
@ -548,7 +544,6 @@ bool SMESHGUI_SymmetryDlg::ClickOnApply()
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -480,26 +480,23 @@ bool SMESHGUI_TranslationDlg::ClickOnApply()
|
|||||||
anElementsId[i] = aListElementsId[i].toInt();
|
anElementsId[i] = aListElementsId[i].toInt();
|
||||||
|
|
||||||
SMESH::DirStruct aVector;
|
SMESH::DirStruct aVector;
|
||||||
|
QStringList aParameters;
|
||||||
if (GetConstructorId() == 0) {
|
if (GetConstructorId() == 0) {
|
||||||
aVector.PS.x = SpinBox2_1->GetValue() - SpinBox1_1->GetValue();
|
aVector.PS.x = SpinBox2_1->GetValue() - SpinBox1_1->GetValue();
|
||||||
aVector.PS.y = SpinBox2_2->GetValue() - SpinBox1_2->GetValue();
|
aVector.PS.y = SpinBox2_2->GetValue() - SpinBox1_2->GetValue();
|
||||||
aVector.PS.z = SpinBox2_3->GetValue() - SpinBox1_3->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) {
|
} else if (GetConstructorId() == 1) {
|
||||||
aVector.PS.x = SpinBox1_1->GetValue();
|
aVector.PS.x = SpinBox1_1->GetValue();
|
||||||
aVector.PS.y = SpinBox1_2->GetValue();
|
aVector.PS.y = SpinBox1_2->GetValue();
|
||||||
aVector.PS.z = SpinBox1_3->GetValue();
|
aVector.PS.z = SpinBox1_3->GetValue();
|
||||||
}
|
|
||||||
|
|
||||||
QStringList aParameters;
|
|
||||||
aParameters << SpinBox1_1->text();
|
aParameters << SpinBox1_1->text();
|
||||||
if (GetConstructorId() == 0)
|
|
||||||
aParameters << SpinBox2_1->text();
|
|
||||||
aParameters << SpinBox1_2->text();
|
aParameters << SpinBox1_2->text();
|
||||||
if (GetConstructorId() == 0)
|
|
||||||
aParameters << SpinBox2_2->text();
|
|
||||||
aParameters << SpinBox1_3->text();
|
aParameters << SpinBox1_3->text();
|
||||||
if (GetConstructorId() == 0)
|
}
|
||||||
aParameters << SpinBox2_3->text();
|
|
||||||
|
|
||||||
int actionButton = ActionGroup->checkedId();
|
int actionButton = ActionGroup->checkedId();
|
||||||
bool makeGroups = ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() );
|
bool makeGroups = ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() );
|
||||||
@ -507,14 +504,15 @@ bool SMESHGUI_TranslationDlg::ClickOnApply()
|
|||||||
try {
|
try {
|
||||||
SUIT_OverrideCursor aWaitCursor;
|
SUIT_OverrideCursor aWaitCursor;
|
||||||
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
|
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
|
||||||
|
|
||||||
|
myMesh->SetParameters(aParameters.join(":").toLatin1().constData());
|
||||||
|
|
||||||
switch ( actionButton ) {
|
switch ( actionButton ) {
|
||||||
case MOVE_ELEMS_BUTTON:
|
case MOVE_ELEMS_BUTTON:
|
||||||
if(CheckBoxMesh->isChecked())
|
if(CheckBoxMesh->isChecked())
|
||||||
aMeshEditor->TranslateObject(mySelectedObject, aVector, false);
|
aMeshEditor->TranslateObject(mySelectedObject, aVector, false);
|
||||||
else
|
else
|
||||||
aMeshEditor->Translate(anElementsId, aVector, false);
|
aMeshEditor->Translate(anElementsId, aVector, false);
|
||||||
if( !myMesh->_is_nil())
|
|
||||||
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
|
|
||||||
break;
|
break;
|
||||||
case COPY_ELEMS_BUTTON:
|
case COPY_ELEMS_BUTTON:
|
||||||
if ( makeGroups ) {
|
if ( makeGroups ) {
|
||||||
@ -530,10 +528,8 @@ bool SMESHGUI_TranslationDlg::ClickOnApply()
|
|||||||
else
|
else
|
||||||
aMeshEditor->Translate(anElementsId, aVector, true);
|
aMeshEditor->Translate(anElementsId, aVector, true);
|
||||||
}
|
}
|
||||||
if( !myMesh->_is_nil())
|
|
||||||
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
|
|
||||||
break;
|
break;
|
||||||
case MAKE_MESH_BUTTON:
|
case MAKE_MESH_BUTTON: {
|
||||||
SMESH::SMESH_Mesh_var mesh;
|
SMESH::SMESH_Mesh_var mesh;
|
||||||
if (CheckBoxMesh->isChecked())
|
if (CheckBoxMesh->isChecked())
|
||||||
mesh = aMeshEditor->TranslateObjectMakeMesh(mySelectedObject, aVector, makeGroups,
|
mesh = aMeshEditor->TranslateObjectMakeMesh(mySelectedObject, aVector, makeGroups,
|
||||||
@ -541,8 +537,6 @@ bool SMESHGUI_TranslationDlg::ClickOnApply()
|
|||||||
else
|
else
|
||||||
mesh = aMeshEditor->TranslateMakeMesh(anElementsId, aVector, makeGroups,
|
mesh = aMeshEditor->TranslateMakeMesh(anElementsId, aVector, makeGroups,
|
||||||
LineEditNewMesh->text().toLatin1().data());
|
LineEditNewMesh->text().toLatin1().data());
|
||||||
if (!mesh->_is_nil()) {
|
|
||||||
mesh->SetParameters(aParameters.join(":").toLatin1().constData());
|
|
||||||
if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) )
|
if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) )
|
||||||
anEntryList.append( aSObject->GetID().c_str() );
|
anEntryList.append( aSObject->GetID().c_str() );
|
||||||
#ifdef WITHGENERICOBJ
|
#ifdef WITHGENERICOBJ
|
||||||
|
Loading…
Reference in New Issue
Block a user