* 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();
};
/*!
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;
aParameters<<GroupPoints->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;
aParameters<<myData[ DZ2 ]->text();
if ( !anObj->_is_nil() ) {
- anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
+ if ( !IsPreview() )
+ anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
objects.push_back( anObj._retn() );
}
}
if ( !anObj->_is_nil() ) {
- anObj->SetParameters(getSizeAsString().toLatin1().constData());
+ if ( !IsPreview() )
+ anObj->SetParameters(getSizeAsString().toLatin1().constData());
objects.push_back( anObj._retn() );
}
return res;
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));
}
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;
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
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() );
}
}
MakeMultiTransformation1D(myShape,
myFaces[Face1], myFaces[Face2],
mySpinBox[SpinBox1]->value());
- if (!anObj->_is_nil())
+ if (!anObj->_is_nil() && !IsPreview())
{
QStringList aParameters;
aParameters << "" << "";
mySpinBox[SpinBox2U]->value(),
myFaces[Face1V], myFaces[Face2V],
mySpinBox[SpinBox2V]->value());
- if (!anObj->_is_nil())
+ if (!anObj->_is_nil() && !IsPreview())
{
QStringList aParameters;
aParameters << "" << "";
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();
}
//Find variables used for object construction
- vector<TVariable> 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!!!"<<endl;
aCommandIndex++;
continue;
}
-
+
+ TState aVariables = aStates->GetCurrectState();
+
if(MYDEBUG) {
cout<<"Variables from SObject:"<<endl;
for (int i = 0; i < aVariables.size();i++)
} // end of specific case for sketcher
//If parameter is entry or 'None', skip it
- if(theVariables.find(aVar) != theVariables.end() || aVar == PY_NULL)
+ if(theVariables.find(aVar) != theVariables.end() || aVar.Search(":") != -1 || aVar == PY_NULL)
continue;
if(iVar >= aVariables.size())
theCommand.Insert(aStartCommandPos, aCommand);
aCommandIndex++;
+
+ aStates->IncrementState();
}
if (MYDEBUG)
cout<<"Command : "<<theCommand<<endl;
}
+
+//================================================================================
+/*!
+ * \brief Constructor
+ */
+//================================================================================
+ObjectStates::ObjectStates()
+{
+ _dumpstate = 0;
+}
+
+//================================================================================
+/*!
+ * \brief Destructor
+ */
+//================================================================================
+ObjectStates::~ObjectStates()
+{
+}
+
+//================================================================================
+/*!
+ * \brief Return current object state
+ * \retval state - Object state (vector of notebook variable)
+ */
+//================================================================================
+TState ObjectStates::GetCurrectState() const
+{
+ if(_states.size() > _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++;
+}
isVariable(theFlag){}
};
-typedef std::map<TCollection_AsciiString, std::vector<TVariable> > TVariablesList;
+typedef std::vector<TVariable> TState;
+typedef std::vector<TState> 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<TCollection_AsciiString, ObjectStates* > TVariablesList;
class GEOM_Engine
{
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; }
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;
+}
+
//=============================================================================
/*!
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
#include <SalomeApp_Application.h>
#include <SalomeApp_DoubleSpinBox.h>
+#include <SalomeApp_Study.h>
#include <LightApp_Application.h>
#include <LightApp_SelectionMgr.h>
#include <SUIT_Desktop.h>
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 )
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 :
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* );
}
//Make a Python command
- GEOM::TPythonDump(aFunction) << "geompy.TrsfOp.TranslateDXDYDZ("
+ GEOM::TPythonDump(aFunction) << "geompy.TranslateDXDYDZ("
<< theObject << ", " << theX << ", " << theY << ", " << theZ << ")";
SetErrorCode(OK);
return aCopy;
}
- GEOM::TPythonDump(aFunction) << "geompy.TrsfOp.TranslateVectorDistance("
+ GEOM::TPythonDump(aFunction) << "geompy.TranslateVectorDistance("
<< theObject << ", " << theVector << ", " << theDistance << ", " << theCopy << ")";
SetErrorCode(OK);
return theObject;
}
//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);
//Find attribute with list of used notebook variables
SALOMEDS::GenericAttribute_var anAttr;
SALOMEDS::AttributeString_var anAttrStr;
- vector<TVariable> 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,ObjectStates*>(TCollection_AsciiString(anEntry),aStates));
}
- aVariableMap.insert(pair<TCollection_AsciiString,vector<TVariable> >((char*)anEntry,aVariables));
}
}
}
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);
Handle(GEOM_Object) anObject = GetOperations()->MakeBoxDXDYDZ(theDX, theDY, theDZ);
if (!GetOperations()->IsDone() || anObject.IsNull())
return aGEOMObject._retn();
- GetObject(anObject)->SetParameters(GetParameters());
return GetObject(anObject);
}
_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
virtual void AbortOperation();
- virtual void SetParameters(const char* theParameters);
-
- virtual char* GetParameters();
-
::GEOM_IOperations* GetImpl() { return _impl; }
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.
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.
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.
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() );
}
MakePrismVecH2Ways(myBase, myVec, getHeight());
}
- if (!anObj->_is_nil())
+ if (!anObj->_is_nil() && !IsPreview())
{
aParameters << GroupPoints->SpinBox_DX->text();
anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
MakePrismDXDYDZ2Ways(myBase, dx, dy, dz);
}
- if (!anObj->_is_nil())
+ if (!anObj->_is_nil() && !IsPreview())
{
aParameters << GroupPoints3->SpinBox_DX->text();
aParameters << GroupPoints3->SpinBox_DY->text();
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());
}
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() );
}
if (!anObj->_is_nil())
{
- anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
+ if (!IsPreview())
+ anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
objects.push_back(anObj._retn());
}
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 );
class QLabel;
class QPushButton;
class QComboBox;
-class QDoubleSpinBox;
+class SalomeApp_DoubleSpinBox;
enum ViewerTypes { VTK, OCC, OTHER };
QGroupBox* GroupArguments;
QLabel* TextLabelNear;
- QDoubleSpinBox* SpinBox_Near;
+ SalomeApp_DoubleSpinBox* SpinBox_Near;
QLabel* TextLabelFar;
- QDoubleSpinBox* SpinBox_Far;
+ SalomeApp_DoubleSpinBox* SpinBox_Far;
QPushButton* resetButton;
QComboBox* TypeCB;
if (!anObj->_is_nil())
{
- anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
+ if (!IsPreview())
+ anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
objects.push_back(anObj._retn());
}
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();
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();
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();
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();
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();
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));
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));
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();
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();
{
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();
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();
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();
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();
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() );
}
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();
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() );
}
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() );
}
}
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() );
}
}
switch (getConstructorId()) {
case 0:
{
+ QStringList aParameters;
+ aParameters<<GroupPoints->SpinBox_DX->text();
if (toCreateCopy) {
for (int i = 0; i < myObjects.length(); i++) {
myCurrObject = myObjects[i];
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());
}
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;
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;
case 2:
{
QStringList aParameters;
+ aParameters<<GroupPoints->SpinBox3->text();
bool byDistance = GroupPoints->CheckBox1->isChecked();
if (byDistance) {
double aDistance = GroupPoints->SpinBox3->value();
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());
}
}