From: ouv Date: Wed, 3 Dec 2008 10:59:05 +0000 (+0000) Subject: Dump Python extension X-Git-Tag: TG_DumpPython_Extension_3_1~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a320c15fce5e90fcaee95313ef26ffec1bb21f5d;p=modules%2Fgeom.git Dump Python extension --- diff --git a/idl/GEOM_Gen.idl b/idl/GEOM_Gen.idl index 9a8569e61..39e63a8f6 100644 --- a/idl/GEOM_Gen.idl +++ b/idl/GEOM_Gen.idl @@ -289,17 +289,6 @@ module GEOM * Aborts the previously opened transaction */ void AbortOperation(); - - /*! - * Set list of parameters - * \param theParameters is a string containing the list of parameters separated by ":" symbol - */ - void SetParameters (in string theParameters); - - /*! - * Get list of parameters - */ - string GetParameters(); }; /*! diff --git a/src/BasicGUI/BasicGUI_CircleDlg.cxx b/src/BasicGUI/BasicGUI_CircleDlg.cxx index f457f5a32..ea201026c 100644 --- a/src/BasicGUI/BasicGUI_CircleDlg.cxx +++ b/src/BasicGUI/BasicGUI_CircleDlg.cxx @@ -647,7 +647,7 @@ bool BasicGUI_CircleDlg::execute( ObjectList& objects ) QStringList aParameters; aParameters << GroupPntVecR->SpinBox_DX->text(); anObj = GEOM::GEOM_ICurvesOperations::_narrow( getOperation() )->MakeCirclePntVecR( myPoint, myDir, getRadius() ); - if ( !anObj->_is_nil() ) + if ( !anObj->_is_nil() && !IsPreview() ) anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters)); res = true; break; diff --git a/src/BasicGUI/BasicGUI_EllipseDlg.cxx b/src/BasicGUI/BasicGUI_EllipseDlg.cxx index 5d2fe02c7..715a8d614 100644 --- a/src/BasicGUI/BasicGUI_EllipseDlg.cxx +++ b/src/BasicGUI/BasicGUI_EllipseDlg.cxx @@ -429,9 +429,9 @@ bool BasicGUI_EllipseDlg::execute( ObjectList& objects ) aParameters<SpinBox_DY->text(); GEOM::GEOM_Object_var anObj = GEOM::GEOM_ICurvesOperations::_narrow( getOperation() )->MakeEllipse( myPoint, myDir, aMajorR, aMinorR ); - for(int i = 0;i< aParameters.size();i++) - anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters)); if ( !anObj->_is_nil() ) { + if ( !IsPreview() ) + anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters)); objects.push_back( anObj._retn() ); } return true; diff --git a/src/BasicGUI/BasicGUI_MarkerDlg.cxx b/src/BasicGUI/BasicGUI_MarkerDlg.cxx index b016ac223..3cdd1a32d 100644 --- a/src/BasicGUI/BasicGUI_MarkerDlg.cxx +++ b/src/BasicGUI/BasicGUI_MarkerDlg.cxx @@ -736,7 +736,8 @@ bool BasicGUI_MarkerDlg::execute( ObjectList& objects ) aParameters<text(); if ( !anObj->_is_nil() ) { - anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters)); + if ( !IsPreview() ) + anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters)); objects.push_back( anObj._retn() ); } diff --git a/src/BasicGUI/BasicGUI_PlaneDlg.cxx b/src/BasicGUI/BasicGUI_PlaneDlg.cxx index 8647aa74a..06da54a80 100644 --- a/src/BasicGUI/BasicGUI_PlaneDlg.cxx +++ b/src/BasicGUI/BasicGUI_PlaneDlg.cxx @@ -652,7 +652,8 @@ bool BasicGUI_PlaneDlg::execute( ObjectList& objects ) } if ( !anObj->_is_nil() ) { - anObj->SetParameters(getSizeAsString().toLatin1().constData()); + if ( !IsPreview() ) + anObj->SetParameters(getSizeAsString().toLatin1().constData()); objects.push_back( anObj._retn() ); } return res; diff --git a/src/BasicGUI/BasicGUI_PointDlg.cxx b/src/BasicGUI/BasicGUI_PointDlg.cxx index ada27151d..36027937d 100644 --- a/src/BasicGUI/BasicGUI_PointDlg.cxx +++ b/src/BasicGUI/BasicGUI_PointDlg.cxx @@ -781,10 +781,10 @@ bool BasicGUI_PointDlg::execute( ObjectList& objects ) break; } - if(!anObj->_is_nil() && (getConstructorId()==0 || - getConstructorId() == 1 || - getConstructorId() == 2 || - getConstructorId() == 4) ) { + if(!anObj->_is_nil() && !IsPreview() && (getConstructorId()==0 || + getConstructorId() == 1 || + getConstructorId() == 2 || + getConstructorId() == 4) ) { anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters)); } diff --git a/src/BasicGUI/BasicGUI_VectorDlg.cxx b/src/BasicGUI/BasicGUI_VectorDlg.cxx index 62313e7ec..320e8a95c 100644 --- a/src/BasicGUI/BasicGUI_VectorDlg.cxx +++ b/src/BasicGUI/BasicGUI_VectorDlg.cxx @@ -494,7 +494,7 @@ bool BasicGUI_VectorDlg::execute( ObjectList& objects ) aParameters << GroupDimensions->SpinBox_DZ->text(); anObj = GEOM::GEOM_IBasicOperations::_narrow( getOperation() )->MakeVectorDXDYDZ( dx, dy, dz ); - if ( !anObj->_is_nil() ) + if ( !anObj->_is_nil() && !IsPreview() ) anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters)); res = true; diff --git a/src/BlocksGUI/BlocksGUI_ExplodeDlg.cxx b/src/BlocksGUI/BlocksGUI_ExplodeDlg.cxx index 0a6d834b3..65b0ae7be 100644 --- a/src/BlocksGUI/BlocksGUI_ExplodeDlg.cxx +++ b/src/BlocksGUI/BlocksGUI_ExplodeDlg.cxx @@ -450,7 +450,8 @@ bool BlocksGUI_ExplodeDlg::execute( ObjectList& objects ) CORBA::String_var objStr = myGeomGUI->getApp()->orb()->object_to_string( *anIter ); if ( selected.contains( QString( objStr.in() ) ) ) { - (*anIter)->SetParameters(GeometryGUI::JoinObjectParameters(aParameters)); + if ( !IsPreview() ) + (*anIter)->SetParameters(GeometryGUI::JoinObjectParameters(aParameters)); objects.push_back( *anIter ); } else @@ -469,7 +470,8 @@ bool BlocksGUI_ExplodeDlg::execute( ObjectList& objects ) for ( int i = 0, n = aList->length(); i < n; i++ ) { GEOM::GEOM_Object_var anObj = GEOM::GEOM_Object::_duplicate( aList[i] ); - anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters)); + if ( !IsPreview() ) + anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters)); objects.push_back( anObj._retn() ); } } diff --git a/src/BlocksGUI/BlocksGUI_TrsfDlg.cxx b/src/BlocksGUI/BlocksGUI_TrsfDlg.cxx index ed5eb9973..51fb9be10 100644 --- a/src/BlocksGUI/BlocksGUI_TrsfDlg.cxx +++ b/src/BlocksGUI/BlocksGUI_TrsfDlg.cxx @@ -581,7 +581,7 @@ bool BlocksGUI_TrsfDlg::execute (ObjectList& objects) MakeMultiTransformation1D(myShape, myFaces[Face1], myFaces[Face2], mySpinBox[SpinBox1]->value()); - if (!anObj->_is_nil()) + if (!anObj->_is_nil() && !IsPreview()) { QStringList aParameters; aParameters << "" << ""; @@ -597,7 +597,7 @@ bool BlocksGUI_TrsfDlg::execute (ObjectList& objects) mySpinBox[SpinBox2U]->value(), myFaces[Face1V], myFaces[Face2V], mySpinBox[SpinBox2V]->value()); - if (!anObj->_is_nil()) + if (!anObj->_is_nil() && !IsPreview()) { QStringList aParameters; aParameters << "" << ""; diff --git a/src/GEOM/GEOM_Engine.cxx b/src/GEOM/GEOM_Engine.cxx index 14e813408..cca32c634 100644 --- a/src/GEOM/GEOM_Engine.cxx +++ b/src/GEOM/GEOM_Engine.cxx @@ -804,7 +804,14 @@ void ReplaceVariables(TCollection_AsciiString& theCommand, Standard_Integer aEndCommandPos = aStartCommandPos + aCommand.Length(); //Get Entry of the result object - TCollection_AsciiString anEntry = aCommand.Token("=",1); + TCollection_AsciiString anEntry; + if( aCommand.Search("=") != -1 ) // command returns an object + anEntry = aCommand.Token("=",1); + else { // command modifies the object + int aStartEntryPos = aCommand.Location(1,'(',1,aCommand.Length()); + int aEndEntryPos = aCommand.Location(1,',',aStartEntryPos,aCommand.Length()); + anEntry = aCommand.SubString(aStartEntryPos+1, aEndEntryPos-1); + } //Remove white spaces anEntry.RightAdjust(); @@ -827,18 +834,20 @@ void ReplaceVariables(TCollection_AsciiString& theCommand, } //Find variables used for object construction - vector aVariables; + ObjectStates* aStates = 0; TVariablesList::const_iterator it = theVariables.find(anEntry); - if( it != theVariables.end() ) - aVariables = (*it).second; + if( it != theVariables.end() ) + aStates = (*it).second; - if(aVariables.empty()) { + if(!aStates) { if(MYDEBUG) cout<<"Valiables list empty!!!"<GetCurrectState(); + if(MYDEBUG) { cout<<"Variables from SObject:"<= aVariables.size()) @@ -1003,8 +1012,63 @@ void ReplaceVariables(TCollection_AsciiString& theCommand, theCommand.Insert(aStartCommandPos, aCommand); aCommandIndex++; + + aStates->IncrementState(); } if (MYDEBUG) cout<<"Command : "< _dumpstate) + return _states[_dumpstate]; + return TState(); +} + +//================================================================================ +/*! + * \brief Add new object state + * \param theState - Object state (vector of notebook variable) + */ +//================================================================================ +void ObjectStates::AddState(const TState &theState) +{ + _states.push_back(theState); +} + +//================================================================================ +/*! + * \brief Increment object state + */ +//================================================================================ +void ObjectStates::IncrementState() +{ + _dumpstate++; +} diff --git a/src/GEOM/GEOM_Engine.hxx b/src/GEOM/GEOM_Engine.hxx index 48d7dff45..bc97dedaf 100644 --- a/src/GEOM/GEOM_Engine.hxx +++ b/src/GEOM/GEOM_Engine.hxx @@ -44,7 +44,27 @@ struct TVariable{ isVariable(theFlag){} }; -typedef std::map > TVariablesList; +typedef std::vector TState; +typedef std::vector TAllStates; + +class ObjectStates +{ +public: + ObjectStates(); + ~ObjectStates(); + + TAllStates GetAllStates() const { return _states; } + + TState GetCurrectState() const; + void AddState(const TState &theState); + void IncrementState(); + +private: + TAllStates _states; + int _dumpstate; +}; + +typedef std::map TVariablesList; class GEOM_Engine { diff --git a/src/GEOM/GEOM_IOperations.hxx b/src/GEOM/GEOM_IOperations.hxx index 944c61b59..9e84f0633 100644 --- a/src/GEOM/GEOM_IOperations.hxx +++ b/src/GEOM/GEOM_IOperations.hxx @@ -65,16 +65,6 @@ class GEOM_IOperations return (char*) _errorCode.ToCString(); } - //Sets a parameters of the operation - Standard_EXPORT void SetParameters(const TCollection_AsciiString& theParameters) { - _parameters = theParameters; - } - - //Returns a parameters of the operation - Standard_EXPORT char* GetParameters() { - return (char*) _parameters.ToCString(); - } - //Returns a pointer to GEOM_Engine which this operation interface is associated Standard_EXPORT GEOM_Engine* GetEngine() { return _engine; } diff --git a/src/GEOM/GEOM_Object.cxx b/src/GEOM/GEOM_Object.cxx index 4a3313333..06f3c8b8e 100644 --- a/src/GEOM/GEOM_Object.cxx +++ b/src/GEOM/GEOM_Object.cxx @@ -380,6 +380,31 @@ TCollection_AsciiString GEOM_Object::GetAuxData() return aData; } +//============================================================================= +/*! + * SetParameters + */ +//============================================================================= +void GEOM_Object::SetParameters(const TCollection_AsciiString& theParameters) +{ + if( _parameters.IsEmpty() ) + _parameters = theParameters; + else { + _parameters += "|"; + _parameters += theParameters; + } +} + +//============================================================================= +/*! + * GetParameters + */ +//============================================================================= +TCollection_AsciiString GEOM_Object::GetParameters() const +{ + return _parameters; +} + //============================================================================= /*! diff --git a/src/GEOM/GEOM_Object.hxx b/src/GEOM/GEOM_Object.hxx index 403956933..2b23fbb52 100644 --- a/src/GEOM/GEOM_Object.hxx +++ b/src/GEOM/GEOM_Object.hxx @@ -220,12 +220,10 @@ class GEOM_Object : public MMgt_TShared Standard_EXPORT TCollection_AsciiString GetAuxData(); //Set a notebook variables used for object creation - Standard_EXPORT void SetParameters(const TCollection_AsciiString& theParameters) - {_parameters = theParameters;} + Standard_EXPORT void SetParameters(const TCollection_AsciiString& theParameters); //Get a notebook variables used for object creation - Standard_EXPORT TCollection_AsciiString GetParameters() const - {return _parameters;} + Standard_EXPORT TCollection_AsciiString GetParameters() const; //########################################################### // Sub shape methods diff --git a/src/GEOMBase/GEOMBase_Skeleton.cxx b/src/GEOMBase/GEOMBase_Skeleton.cxx index 0dd5d8605..96c90ed92 100644 --- a/src/GEOMBase/GEOMBase_Skeleton.cxx +++ b/src/GEOMBase/GEOMBase_Skeleton.cxx @@ -31,6 +31,7 @@ #include #include +#include #include #include #include @@ -131,23 +132,21 @@ void GEOMBase_Skeleton::Init() myMainFrame->GroupBoxPublish->hide(); } +//================================================================================= +// function : initSpinBox() +// purpose : +//================================================================================= void GEOMBase_Skeleton::initSpinBox( QSpinBox* spinBox, int min, int max, int step ) { spinBox->setRange( min, max ); spinBox->setSingleStep( step ); } -// TODO: to replace these method: -void GEOMBase_Skeleton::initSpinBox( QDoubleSpinBox* spinBox, - double min, double max, - double step, int decimals ) -{ - spinBox->setDecimals( decimals ); // it's necessary to set decimals before the range setting, - // by default Qt rounds boundaries to 2 decimals at setRange - spinBox->setRange( min, max ); - spinBox->setSingleStep( step ); -} -// TODO: by the following: + +//================================================================================= +// function : initSpinBox() +// purpose : +//================================================================================= void GEOMBase_Skeleton::initSpinBox( SalomeApp_DoubleSpinBox* spinBox, double min, double max, double step, int decimals ) @@ -159,6 +158,33 @@ void GEOMBase_Skeleton::initSpinBox( SalomeApp_DoubleSpinBox* spinBox, spinBox->setSingleStep( step ); } +//================================================================================= +// function : updateAttributes() +// purpose : Workaround for Translation and Rotation operations with unchecked option "Create a copy". +// In this case PublishInStudy isn't called, so we need to update object's attributes manually +//================================================================================= +void GEOMBase_Skeleton::updateAttributes( GEOM::GEOM_Object_ptr theObj, + const QStringList& theParameters) +{ + SALOMEDS::Study_var aStudy = GeometryGUI::ClientStudyToStudy(getStudy()->studyDS()); + SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder(); + SALOMEDS::SObject_var aSObject = aStudy->FindObjectID(theObj->GetStudyEntry()); + SALOMEDS::GenericAttribute_var anAttr = aStudyBuilder->FindOrCreateAttribute(aSObject, "AttributeString"); + SALOMEDS::AttributeString_var aStringAttrib = SALOMEDS::AttributeString::_narrow(anAttr); + + std::string aValue = aStringAttrib->Value(); + if( aValue != "" ) + aValue += "|"; + for( int i = 0, n = theParameters.count(); i < n; i++ ) { + std::string aParameter = theParameters[i].toStdString(); + if(aStudy->IsVariable(aParameter.c_str())) + aValue += aParameter; + if(i != n-1) + aValue += ":"; + } + aStringAttrib->SetValue(aValue.c_str()); +} + //================================================================================= // function : ClickOnCancel() // purpose : diff --git a/src/GEOMBase/GEOMBase_Skeleton.h b/src/GEOMBase/GEOMBase_Skeleton.h index 0252aad94..63aaf9c1c 100644 --- a/src/GEOMBase/GEOMBase_Skeleton.h +++ b/src/GEOMBase/GEOMBase_Skeleton.h @@ -60,11 +60,10 @@ private: protected: void initSpinBox( QSpinBox*, int, int, int = 1 ); - // TODO: to replace these method: - void initSpinBox( QDoubleSpinBox*, double, double, double = 0.1, int = 3 ); - // TODO: by the following: void initSpinBox( SalomeApp_DoubleSpinBox*, double, double, double = 0.1, int = 3 ); + void updateAttributes( GEOM::GEOM_Object_ptr, const QStringList& ); + void closeEvent( QCloseEvent* ); void keyPressEvent( QKeyEvent* ); diff --git a/src/GEOMImpl/GEOMImpl_ITransformOperations.cxx b/src/GEOMImpl/GEOMImpl_ITransformOperations.cxx index d6043d2c5..00db04149 100644 --- a/src/GEOMImpl/GEOMImpl_ITransformOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_ITransformOperations.cxx @@ -178,7 +178,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::TranslateDXDYDZ } //Make a Python command - GEOM::TPythonDump(aFunction) << "geompy.TrsfOp.TranslateDXDYDZ(" + GEOM::TPythonDump(aFunction) << "geompy.TranslateDXDYDZ(" << theObject << ", " << theX << ", " << theY << ", " << theZ << ")"; SetErrorCode(OK); @@ -465,7 +465,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::TranslateVectorDistance return aCopy; } - GEOM::TPythonDump(aFunction) << "geompy.TrsfOp.TranslateVectorDistance(" + GEOM::TPythonDump(aFunction) << "geompy.TranslateVectorDistance(" << theObject << ", " << theVector << ", " << theDistance << ", " << theCopy << ")"; SetErrorCode(OK); return theObject; @@ -1383,7 +1383,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::Rotate (Handle(GEOM_Object) t } //Make a Python command - GEOM::TPythonDump(aFunction) << "geompy.TrsfOp.Rotate(" << theObject + GEOM::TPythonDump(aFunction) << "geompy.Rotate(" << theObject << ", " << theAxis << ", " << theAngle * 180.0 / PI << "*math.pi/180.0)"; SetErrorCode(OK); diff --git a/src/GEOM_I/GEOM_DumpPython.cc b/src/GEOM_I/GEOM_DumpPython.cc index 25ffab45b..ea6a5f7b8 100644 --- a/src/GEOM_I/GEOM_DumpPython.cc +++ b/src/GEOM_I/GEOM_DumpPython.cc @@ -70,20 +70,22 @@ Engines::TMPFile* GEOM_Gen_i::DumpPython(CORBA::Object_ptr theStudy, //Find attribute with list of used notebook variables SALOMEDS::GenericAttribute_var anAttr; SALOMEDS::AttributeString_var anAttrStr; - vector aVariables; if(aValue->FindAttribute(anAttr,"AttributeString")){ anAttrStr = SALOMEDS::AttributeString::_narrow(anAttr); SALOMEDS::ListOfListOfStrings_var aSections = aStudy->ParseVariables(anAttrStr->Value()); + ObjectStates* aStates = new ObjectStates(); for(int i = 0; i < aSections->length(); i++) { + TState aState; SALOMEDS::ListOfStrings aListOfVars = aSections[i]; for(int j = 0; j < aListOfVars.length(); j++) { bool isVar = aStudy->IsVariable(aListOfVars[j].in()); TVariable aVar = TVariable( (char*)aListOfVars[j].in(), isVar ); - aVariables.push_back(aVar); + aState.push_back(aVar); } + aStates->AddState(aState); } + aVariableMap.insert(pair(TCollection_AsciiString(anEntry),aStates)); } - aVariableMap.insert(pair >((char*)anEntry,aVariables)); } } } diff --git a/src/GEOM_I/GEOM_Gen_i.cc b/src/GEOM_I/GEOM_Gen_i.cc index 6c24a00a1..9e338d621 100644 --- a/src/GEOM_I/GEOM_Gen_i.cc +++ b/src/GEOM_I/GEOM_Gen_i.cc @@ -274,27 +274,22 @@ SALOMEDS::SObject_ptr GEOM_Gen_i::PublishInStudy(SALOMEDS::Study_ptr theStudy, aNameAttrib->SetValue(aShapeName.ToCString()); //Set NoteBook variables used in the object creation - bool isFound = false; TCollection_AsciiString aVars; SALOMEDS::ListOfListOfStrings_var aSections = theStudy->ParseVariables(aShape->GetParameters()); for(int i = 0, n = aSections->length(); i < n; i++) { SALOMEDS::ListOfStrings aListOfVars = aSections[i]; for(int j = 0, m = aListOfVars.length(); j < m; j++) { - if(theStudy->IsVariable(aListOfVars[j].in())) { + if(theStudy->IsVariable(aListOfVars[j].in())) aVars += TCollection_AsciiString(aListOfVars[j].in()); - isFound = true; - } if(j != m-1) aVars += ":"; } if(i != n-1) aVars += "|"; } - if(isFound) { - anAttr = aStudyBuilder->FindOrCreateAttribute(aResultSO, "AttributeString"); - SALOMEDS::AttributeString_var aStringAttrib = SALOMEDS::AttributeString::_narrow(anAttr); - aStringAttrib->SetValue(aVars.ToCString()); - } + anAttr = aStudyBuilder->FindOrCreateAttribute(aResultSO, "AttributeString"); + SALOMEDS::AttributeString_var aStringAttrib = SALOMEDS::AttributeString::_narrow(anAttr); + aStringAttrib->SetValue(aVars.ToCString()); //Set a name of the GEOM object aShape->SetName(theName); diff --git a/src/GEOM_I/GEOM_I3DPrimOperations_i.cc b/src/GEOM_I/GEOM_I3DPrimOperations_i.cc index a455d0f5b..8dfc7cb9d 100644 --- a/src/GEOM_I/GEOM_I3DPrimOperations_i.cc +++ b/src/GEOM_I/GEOM_I3DPrimOperations_i.cc @@ -68,7 +68,6 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeBoxDXDYDZ (CORBA::Double the Handle(GEOM_Object) anObject = GetOperations()->MakeBoxDXDYDZ(theDX, theDY, theDZ); if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn(); - GetObject(anObject)->SetParameters(GetParameters()); return GetObject(anObject); } diff --git a/src/GEOM_I/GEOM_IOperations_i.cc b/src/GEOM_I/GEOM_IOperations_i.cc index 12a4eaa74..3d5c87c46 100644 --- a/src/GEOM_I/GEOM_IOperations_i.cc +++ b/src/GEOM_I/GEOM_IOperations_i.cc @@ -122,26 +122,6 @@ void GEOM_IOperations_i::AbortOperation() _impl->AbortOperation(); } -//============================================================================= -/*! - * SetParameters - */ -//============================================================================= -void GEOM_IOperations_i::SetParameters(const char* theParameters) -{ - _impl->SetParameters((char*)theParameters); -} - -//============================================================================= -/*! - * GetParameters - */ -//============================================================================= -char* GEOM_IOperations_i::GetParameters() -{ - return CORBA::string_dup(_impl->GetParameters()); -} - //============================================================================= /*! * GetObject diff --git a/src/GEOM_I/GEOM_IOperations_i.hh b/src/GEOM_I/GEOM_IOperations_i.hh index 22192c3ac..c425449dc 100644 --- a/src/GEOM_I/GEOM_IOperations_i.hh +++ b/src/GEOM_I/GEOM_IOperations_i.hh @@ -53,10 +53,6 @@ class GEOM_I_EXPORT GEOM_IOperations_i : public virtual POA_GEOM::GEOM_IOperatio virtual void AbortOperation(); - virtual void SetParameters(const char* theParameters); - - virtual char* GetParameters(); - ::GEOM_IOperations* GetImpl() { return _impl; } diff --git a/src/GEOM_SWIG/geompyDC.py b/src/GEOM_SWIG/geompyDC.py index f6e2217bd..6dd46edd8 100644 --- a/src/GEOM_SWIG/geompyDC.py +++ b/src/GEOM_SWIG/geompyDC.py @@ -2214,6 +2214,20 @@ class geompyDC(GEOM._objref_GEOM_Gen): RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp) return anObj + ## Translate the given object along the vector, specified by its components. + # @param theObject The object to be translated. + # @param theDX,theDY,theDZ Components of translation vector. + # @return Translated GEOM_Object. + # + # @ref tui_translation "Example" + def TranslateDXDYDZ(self,theObject, theDX, theDY, theDZ): + # Example: see GEOM_TestAll.py + theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ) + anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ) + anObj.SetParameters(Parameters) + RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp) + return anObj + ## Translate the given object along the vector, specified # by its components, creating its copy before the translation. # @param theObject The object to be translated. @@ -2242,6 +2256,22 @@ class geompyDC(GEOM._objref_GEOM_Gen): RaiseIfFailed("TranslateVectorCopy", self.TrsfOp) return anObj + ## Translate the given object along the given vector on given distance. + # @param theObject The object to be translated. + # @param theVector The translation vector. + # @param theDistance The translation distance. + # @param theCopy Flag used to translate object itself or create a copy. + # @return Translated GEOM_Object. + # + # @ref tui_translation "Example" + def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy): + # Example: see GEOM_TestAll.py + theDistance,Parameters = ParseParameters(theDistance) + anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy) + RaiseIfFailed("TranslateVectorDistance", self.TrsfOp) + anObj.SetParameters(Parameters) + return anObj + ## Translate the given object along the given vector on given distance, # creating its copy before the translation. # @param theObject The object to be translated. @@ -2258,6 +2288,26 @@ class geompyDC(GEOM._objref_GEOM_Gen): anObj.SetParameters(Parameters) return anObj + ## Rotate the given object around the given axis on the given angle. + # @param theObject The object to be rotated. + # @param theAxis Rotation axis. + # @param theAngle Rotation angle in radians. + # @return Rotated GEOM_Object. + # + # @ref tui_rotation "Example" + def Rotate(self,theObject, theAxis, theAngle): + # Example: see GEOM_TestAll.py + flag = False + if isinstance(theAngle,str): + flag = True + theAngle, Parameters = ParseParameters(theAngle) + if flag: + theAngle = theAngle*math.pi/180.0 + anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle) + RaiseIfFailed("RotateCopy", self.TrsfOp) + anObj.SetParameters(Parameters) + return anObj + ## Rotate the given object around the given axis # on the given angle, creating its copy before the rotatation. # @param theObject The object to be rotated. diff --git a/src/GenerationGUI/GenerationGUI_FillingDlg.cxx b/src/GenerationGUI/GenerationGUI_FillingDlg.cxx index b0dfacc51..c30d9beb1 100644 --- a/src/GenerationGUI/GenerationGUI_FillingDlg.cxx +++ b/src/GenerationGUI/GenerationGUI_FillingDlg.cxx @@ -360,14 +360,16 @@ bool GenerationGUI_FillingDlg::execute( ObjectList& objects ) myCompound, myMinDeg, myMaxDeg, myTol2D, myTol3D, myNbIter, myIsApprox ); if ( !anObj->_is_nil() ) { - QStringList aParameters; - aParameters << GroupPoints->SpinBox1->text(); - aParameters << GroupPoints->SpinBox2->text(); - aParameters << GroupPoints->SpinBox3->text(); - aParameters << GroupPoints->SpinBox4->text(); - aParameters << GroupPoints->SpinBox5->text(); - anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters)); - + if ( !IsPreview() ) + { + QStringList aParameters; + aParameters << GroupPoints->SpinBox1->text(); + aParameters << GroupPoints->SpinBox2->text(); + aParameters << GroupPoints->SpinBox3->text(); + aParameters << GroupPoints->SpinBox4->text(); + aParameters << GroupPoints->SpinBox5->text(); + anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters)); + } objects.push_back( anObj._retn() ); } diff --git a/src/GenerationGUI/GenerationGUI_PrismDlg.cxx b/src/GenerationGUI/GenerationGUI_PrismDlg.cxx index ebf53a93c..dfa2bcb95 100644 --- a/src/GenerationGUI/GenerationGUI_PrismDlg.cxx +++ b/src/GenerationGUI/GenerationGUI_PrismDlg.cxx @@ -662,7 +662,7 @@ bool GenerationGUI_PrismDlg::execute (ObjectList& objects) MakePrismVecH2Ways(myBase, myVec, getHeight()); } - if (!anObj->_is_nil()) + if (!anObj->_is_nil() && !IsPreview()) { aParameters << GroupPoints->SpinBox_DX->text(); anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters)); @@ -693,7 +693,7 @@ bool GenerationGUI_PrismDlg::execute (ObjectList& objects) MakePrismDXDYDZ2Ways(myBase, dx, dy, dz); } - if (!anObj->_is_nil()) + if (!anObj->_is_nil() && !IsPreview()) { aParameters << GroupPoints3->SpinBox_DX->text(); aParameters << GroupPoints3->SpinBox_DY->text(); diff --git a/src/GenerationGUI/GenerationGUI_RevolDlg.cxx b/src/GenerationGUI/GenerationGUI_RevolDlg.cxx index 9abb8e770..e49afcd79 100644 --- a/src/GenerationGUI/GenerationGUI_RevolDlg.cxx +++ b/src/GenerationGUI/GenerationGUI_RevolDlg.cxx @@ -414,10 +414,12 @@ bool GenerationGUI_RevolDlg::execute (ObjectList& objects) if (!anObj->_is_nil()) { - QStringList aParameters; - aParameters << GroupPoints->SpinBox_DX->text(); - anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters)); - + if (!IsPreview()) + { + QStringList aParameters; + aParameters << GroupPoints->SpinBox_DX->text(); + anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters)); + } objects.push_back(anObj._retn()); } diff --git a/src/OperationGUI/OperationGUI_ArchimedeDlg.cxx b/src/OperationGUI/OperationGUI_ArchimedeDlg.cxx index 909c79444..ec09e01e3 100644 --- a/src/OperationGUI/OperationGUI_ArchimedeDlg.cxx +++ b/src/OperationGUI/OperationGUI_ArchimedeDlg.cxx @@ -274,12 +274,14 @@ bool OperationGUI_ArchimedeDlg::execute( ObjectList& objects ) if ( !anObj->_is_nil() ) { - QStringList aParameters; - aParameters << GroupPoints->SpinBox_DX->text(); - aParameters << GroupPoints->SpinBox_DY->text(); - aParameters << GroupPoints->SpinBox_DZ->text(); - anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters)); - + if ( !IsPreview() ) + { + QStringList aParameters; + aParameters << GroupPoints->SpinBox_DX->text(); + aParameters << GroupPoints->SpinBox_DY->text(); + aParameters << GroupPoints->SpinBox_DZ->text(); + anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters)); + } objects.push_back( anObj._retn() ); } diff --git a/src/OperationGUI/OperationGUI_ChamferDlg.cxx b/src/OperationGUI/OperationGUI_ChamferDlg.cxx index bfb9cf905..066fc7e31 100644 --- a/src/OperationGUI/OperationGUI_ChamferDlg.cxx +++ b/src/OperationGUI/OperationGUI_ChamferDlg.cxx @@ -899,7 +899,8 @@ bool OperationGUI_ChamferDlg::execute (ObjectList& objects) if (!anObj->_is_nil()) { - anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters)); + if (!IsPreview()) + anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters)); objects.push_back(anObj._retn()); } diff --git a/src/OperationGUI/OperationGUI_ClippingDlg.cxx b/src/OperationGUI/OperationGUI_ClippingDlg.cxx index 804ddc6cb..6b7377599 100644 --- a/src/OperationGUI/OperationGUI_ClippingDlg.cxx +++ b/src/OperationGUI/OperationGUI_ClippingDlg.cxx @@ -73,13 +73,13 @@ OperationGUI_ClippingDlg::OperationGUI_ClippingDlg( GeometryGUI* theGeometryGUI, TextLabelNear = new QLabel( tr( "Near" ), GroupArguments ); GroupArgumentsLayout->addWidget( TextLabelNear, 0, 0 ); - SpinBox_Near = new QDoubleSpinBox( GroupArguments ); + SpinBox_Near = new SalomeApp_DoubleSpinBox( GroupArguments ); GroupArgumentsLayout->addWidget( SpinBox_Near, 0, 1 ); TextLabelFar = new QLabel( tr( "Far" ), GroupArguments ); GroupArgumentsLayout->addWidget( TextLabelFar, 0, 2 ); - SpinBox_Far = new QDoubleSpinBox( GroupArguments ); + SpinBox_Far = new SalomeApp_DoubleSpinBox( GroupArguments ); GroupArgumentsLayout->addWidget( SpinBox_Far, 0, 3 ); resetButton = new QPushButton( tr( "Reset" ), GroupArguments ); diff --git a/src/OperationGUI/OperationGUI_ClippingDlg.h b/src/OperationGUI/OperationGUI_ClippingDlg.h index 7197f1386..db7cab0ef 100644 --- a/src/OperationGUI/OperationGUI_ClippingDlg.h +++ b/src/OperationGUI/OperationGUI_ClippingDlg.h @@ -32,7 +32,7 @@ class QGroupBox; class QLabel; class QPushButton; class QComboBox; -class QDoubleSpinBox; +class SalomeApp_DoubleSpinBox; enum ViewerTypes { VTK, OCC, OTHER }; @@ -58,9 +58,9 @@ private: QGroupBox* GroupArguments; QLabel* TextLabelNear; - QDoubleSpinBox* SpinBox_Near; + SalomeApp_DoubleSpinBox* SpinBox_Near; QLabel* TextLabelFar; - QDoubleSpinBox* SpinBox_Far; + SalomeApp_DoubleSpinBox* SpinBox_Far; QPushButton* resetButton; QComboBox* TypeCB; diff --git a/src/OperationGUI/OperationGUI_FilletDlg.cxx b/src/OperationGUI/OperationGUI_FilletDlg.cxx index 7b79a146b..0606fb0ab 100644 --- a/src/OperationGUI/OperationGUI_FilletDlg.cxx +++ b/src/OperationGUI/OperationGUI_FilletDlg.cxx @@ -687,7 +687,8 @@ bool OperationGUI_FilletDlg::execute (ObjectList& objects) if (!anObj->_is_nil()) { - anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters)); + if (!IsPreview()) + anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters)); objects.push_back(anObj._retn()); } diff --git a/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx index 85d3d810b..379c7628f 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx @@ -467,7 +467,7 @@ bool PrimitiveGUI_BoxDlg::execute (ObjectList& objects) double z = GroupDimensions->SpinBox_DZ->value(); anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())->MakeBoxDXDYDZ(x, y, z); - if (!anObj->_is_nil()) + if (!anObj->_is_nil() && !IsPreview()) { QStringList aParameters; aParameters << GroupDimensions->SpinBox_DX->text(); diff --git a/src/PrimitiveGUI/PrimitiveGUI_ConeDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_ConeDlg.cxx index b6cb0ef17..92d1ff099 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_ConeDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_ConeDlg.cxx @@ -470,7 +470,7 @@ bool PrimitiveGUI_ConeDlg::execute (ObjectList& objects) if (!CORBA::is_nil(myPoint) && !CORBA::is_nil(myDir)) { anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())-> MakeConePntVecR1R2H(myPoint, myDir, getRadius1(), getRadius2(), getHeight()); - if (!anObj->_is_nil()) + if (!anObj->_is_nil() && !IsPreview()) { QStringList aParameters; aParameters << GroupPoints->SpinBox_DX->text(); @@ -484,7 +484,7 @@ bool PrimitiveGUI_ConeDlg::execute (ObjectList& objects) case 1: anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())-> MakeConeR1R2H(getRadius1(), getRadius2(), getHeight()); - if (!anObj->_is_nil()) + if (!anObj->_is_nil() && !IsPreview()) { QStringList aParameters; aParameters << GroupDimensions->SpinBox_DX->text(); diff --git a/src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.cxx index 4f2536393..b7c16f897 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.cxx @@ -464,7 +464,7 @@ bool PrimitiveGUI_CylinderDlg::execute (ObjectList& objects) if (!CORBA::is_nil(myPoint) && !CORBA::is_nil(myDir)) { anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())-> MakeCylinderPntVecRH(myPoint, myDir, getRadius(), getHeight()); - if (!anObj->_is_nil()) + if (!anObj->_is_nil() && !IsPreview()) { QStringList aParameters; aParameters << GroupPoints->SpinBox_DX->text(); @@ -477,7 +477,7 @@ bool PrimitiveGUI_CylinderDlg::execute (ObjectList& objects) case 1: anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())-> MakeCylinderRH(getRadius(), getHeight()); - if (!anObj->_is_nil()) + if (!anObj->_is_nil() && !IsPreview()) { QStringList aParameters; aParameters << GroupDimensions->SpinBox_DX->text(); diff --git a/src/PrimitiveGUI/PrimitiveGUI_DiskDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_DiskDlg.cxx index 0cb1a61f3..05069de05 100755 --- a/src/PrimitiveGUI/PrimitiveGUI_DiskDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_DiskDlg.cxx @@ -575,7 +575,7 @@ bool PrimitiveGUI_DiskDlg::execute (ObjectList& objects) case 0: anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())-> MakeDiskR(getRadius(), myOrientationType); - if (!anObj->_is_nil()) + if (!anObj->_is_nil() && !IsPreview()) { aParameters << GroupDimensions->SpinBox_DX->text(); anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters)); @@ -585,7 +585,7 @@ bool PrimitiveGUI_DiskDlg::execute (ObjectList& objects) case 1: anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())-> MakeDiskPntVecR(myPoint, myDir, getRadius()); - if (!anObj->_is_nil()) + if (!anObj->_is_nil() && !IsPreview()) { aParameters << GroupPntVecR->SpinBox_DX->text(); anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters)); diff --git a/src/PrimitiveGUI/PrimitiveGUI_FaceDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_FaceDlg.cxx index e4a77f4fd..7621617f0 100755 --- a/src/PrimitiveGUI/PrimitiveGUI_FaceDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_FaceDlg.cxx @@ -497,7 +497,7 @@ bool PrimitiveGUI_FaceDlg::execute (ObjectList& objects) anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())-> MakeFaceHW(GroupDimensions->SpinBox_DX->value(), GroupDimensions->SpinBox_DY->value(), myOrientationType); - if (!anObj->_is_nil()) + if (!anObj->_is_nil() && !IsPreview()) { aParameters << GroupDimensions->SpinBox_DX->text(); aParameters << GroupDimensions->SpinBox_DY->text(); @@ -512,7 +512,7 @@ bool PrimitiveGUI_FaceDlg::execute (ObjectList& objects) else if (GroupType->RadioButton2->isChecked()) anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())-> MakeFaceObjHW(myFace, GroupPlane->SpinBox_DX->value(), GroupPlane->SpinBox_DY->value()); - if (!anObj->_is_nil()) + if (!anObj->_is_nil() && !IsPreview()) { aParameters << GroupPlane->SpinBox_DX->text(); aParameters << GroupPlane->SpinBox_DY->text(); diff --git a/src/PrimitiveGUI/PrimitiveGUI_SphereDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_SphereDlg.cxx index be4e7ca0b..eea973595 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_SphereDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_SphereDlg.cxx @@ -401,7 +401,7 @@ bool PrimitiveGUI_SphereDlg::execute( ObjectList& objects ) { if ( !CORBA::is_nil( myPoint ) ) { anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeSpherePntR( myPoint, getRadius() ); - if (!anObj->_is_nil()) + if (!anObj->_is_nil() && !IsPreview()) { QStringList aParameters; aParameters << GroupPoints->SpinBox_DX->text(); @@ -414,7 +414,7 @@ bool PrimitiveGUI_SphereDlg::execute( ObjectList& objects ) case 1 : { anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeSphereR( getRadius() ); - if (!anObj->_is_nil()) + if (!anObj->_is_nil() && !IsPreview()) { QStringList aParameters; aParameters << GroupDimensions->SpinBox_DX->text(); diff --git a/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx index ba8288a82..cceeec7b5 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx @@ -460,7 +460,7 @@ bool PrimitiveGUI_TorusDlg::execute (ObjectList& objects) if (!CORBA::is_nil(myPoint) && !CORBA::is_nil(myDir)) { anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())-> MakeTorusPntVecRR(myPoint, myDir, getRadius1(), getRadius2()); - if (!anObj->_is_nil()) + if (!anObj->_is_nil() && !IsPreview()) { QStringList aParameters; aParameters << GroupPoints->SpinBox_DX->text(); @@ -473,7 +473,7 @@ bool PrimitiveGUI_TorusDlg::execute (ObjectList& objects) case 1: anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())-> MakeTorusRR(getRadius1(), getRadius2()); - if (!anObj->_is_nil()) + if (!anObj->_is_nil() && !IsPreview()) { QStringList aParameters; aParameters << GroupDimensions->SpinBox_DX->text(); diff --git a/src/RepairGUI/RepairGUI_DivideEdgeDlg.cxx b/src/RepairGUI/RepairGUI_DivideEdgeDlg.cxx index 90ab2c9b4..1e643e763 100644 --- a/src/RepairGUI/RepairGUI_DivideEdgeDlg.cxx +++ b/src/RepairGUI/RepairGUI_DivideEdgeDlg.cxx @@ -354,12 +354,14 @@ bool RepairGUI_DivideEdgeDlg::execute( ObjectList& objects ) bool aResult = !anObj->_is_nil(); if ( aResult ) { - QStringList aParameters; - aParameters << ""; - aParameters << myValEdt->text(); - aParameters << ""; - anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters)); - + if ( !IsPreview() ) + { + QStringList aParameters; + aParameters << ""; + aParameters << myValEdt->text(); + aParameters << ""; + anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters)); + } objects.push_back( anObj._retn() ); } diff --git a/src/RepairGUI/RepairGUI_GlueDlg.cxx b/src/RepairGUI/RepairGUI_GlueDlg.cxx index bdd2eaabb..029cf78f9 100644 --- a/src/RepairGUI/RepairGUI_GlueDlg.cxx +++ b/src/RepairGUI/RepairGUI_GlueDlg.cxx @@ -413,7 +413,7 @@ bool RepairGUI_GlueDlg::execute( ObjectList& objects ) GEOM::GEOM_Object_var anObj = GEOM::GEOM_IShapesOperations::_narrow ( getOperation() )->MakeGlueFaces( myObject, myTolEdt->value(), true ); aResult = !anObj->_is_nil(); - if ( aResult ) + if ( aResult && !IsPreview() ) { QStringList aParameters; aParameters << myTolEdt->text(); @@ -468,10 +468,12 @@ bool RepairGUI_GlueDlg::execute( ObjectList& objects ) if ( aResult ) { - QStringList aParameters; - aParameters << myTolEdt2->text(); - anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters)); - + if ( !IsPreview() ) + { + QStringList aParameters; + aParameters << myTolEdt2->text(); + anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters)); + } objects.push_back( anObj._retn() ); } diff --git a/src/RepairGUI/RepairGUI_SewingDlg.cxx b/src/RepairGUI/RepairGUI_SewingDlg.cxx index e285fdfac..997d6333e 100644 --- a/src/RepairGUI/RepairGUI_SewingDlg.cxx +++ b/src/RepairGUI/RepairGUI_SewingDlg.cxx @@ -298,10 +298,12 @@ bool RepairGUI_SewingDlg::execute( ObjectList& objects ) aResult = !anObj->_is_nil(); if ( aResult ) { - QStringList aParameters; - aParameters << myTolEdt->text(); - anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters)); - + if ( !IsPreview() ) + { + QStringList aParameters; + aParameters << myTolEdt->text(); + anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters)); + } objects.push_back( anObj._retn() ); } } diff --git a/src/RepairGUI/RepairGUI_ShapeProcessDlg.cxx b/src/RepairGUI/RepairGUI_ShapeProcessDlg.cxx index 9536fefb5..a15e79ed2 100755 --- a/src/RepairGUI/RepairGUI_ShapeProcessDlg.cxx +++ b/src/RepairGUI/RepairGUI_ShapeProcessDlg.cxx @@ -637,17 +637,19 @@ bool RepairGUI_ShapeProcessDlg::execute( ObjectList& objects ) anErrorObjNames << GEOMBase::GetName( obj ); else { - QStringList aParameters; + if ( !IsPreview() ) + { + QStringList aParameters; - for ( int i = 0; i < anOperators->length(); i++ ) - aParameters << QString( anOperators[i] ); + for ( int i = 0; i < anOperators->length(); i++ ) + aParameters << QString( anOperators[i] ); - for ( int i = 0; i < aParams->length(); i++ ) - aParameters << QString( aParams[i] ); - - aParameters << getTexts( aParams ); - anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters)); + for ( int i = 0; i < aParams->length(); i++ ) + aParameters << QString( aParams[i] ); + aParameters << getTexts( aParams ); + anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters)); + } objects.push_back( anObj._retn() ); } } diff --git a/src/TransformationGUI/TransformationGUI_RotationDlg.cxx b/src/TransformationGUI/TransformationGUI_RotationDlg.cxx index de530cc54..9f75f8085 100644 --- a/src/TransformationGUI/TransformationGUI_RotationDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_RotationDlg.cxx @@ -530,6 +530,8 @@ bool TransformationGUI_RotationDlg::execute (ObjectList& objects) switch (getConstructorId()) { case 0: { + QStringList aParameters; + aParameters<SpinBox_DX->text(); if (toCreateCopy) { for (int i = 0; i < myObjects.length(); i++) { myCurrObject = myObjects[i]; @@ -537,7 +539,7 @@ bool TransformationGUI_RotationDlg::execute (ObjectList& objects) RotateCopy(myObjects[i], myAxis, GetAngle() * PI180); if (!anObj->_is_nil()) { if(!IsPreview()) { - anObj->SetParameters(GroupPoints->SpinBox_DX->text().toLatin1().constData()); + anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters)); } objects.push_back(anObj._retn()); } @@ -548,8 +550,13 @@ bool TransformationGUI_RotationDlg::execute (ObjectList& objects) myCurrObject = myObjects[i]; anObj = GEOM::GEOM_ITransformOperations::_narrow(getOperation())-> Rotate(myObjects[i], myAxis, GetAngle() * PI180); - if (!anObj->_is_nil()) + if (!anObj->_is_nil()) { + if(!IsPreview()) { + anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters)); + updateAttributes(anObj, aParameters); + } objects.push_back(anObj._retn()); + } } } res = true; diff --git a/src/TransformationGUI/TransformationGUI_TranslationDlg.cxx b/src/TransformationGUI/TransformationGUI_TranslationDlg.cxx index 6a55d49a6..4267e2a11 100644 --- a/src/TransformationGUI/TransformationGUI_TranslationDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_TranslationDlg.cxx @@ -581,8 +581,13 @@ bool TransformationGUI_TranslationDlg::execute (ObjectList& objects) myCurrObject = myObjects[i]; anObj = GEOM::GEOM_ITransformOperations::_narrow(getOperation())-> TranslateDXDYDZ(myObjects[i], dx, dy, dz); - if (!anObj->_is_nil()) + if (!anObj->_is_nil()) { + if(!IsPreview()) { + anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters)); + updateAttributes(anObj, aParameters); + } objects.push_back(anObj._retn()); + } } } res = true; @@ -614,6 +619,7 @@ bool TransformationGUI_TranslationDlg::execute (ObjectList& objects) case 2: { QStringList aParameters; + aParameters<SpinBox3->text(); bool byDistance = GroupPoints->CheckBox1->isChecked(); if (byDistance) { double aDistance = GroupPoints->SpinBox3->value(); @@ -622,9 +628,10 @@ bool TransformationGUI_TranslationDlg::execute (ObjectList& objects) anObj = GEOM::GEOM_ITransformOperations::_narrow(getOperation())-> TranslateVectorDistance(myObjects[i], myVector, aDistance, toCreateCopy); if (!anObj->_is_nil()) { - if(toCreateCopy) - if(!IsPreview()) - anObj->SetParameters(GroupPoints->SpinBox3->text().toLatin1().constData()); + if(!IsPreview()) { + anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters)); + updateAttributes(anObj, aParameters); + } objects.push_back(anObj._retn()); } }