Dump Python Extension

This commit is contained in:
ouv 2008-10-31 13:37:59 +00:00
parent 9f34a7d727
commit 66713229be
6 changed files with 61 additions and 7 deletions

View File

@ -275,6 +275,17 @@ 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();
};
/*!

View File

@ -56,13 +56,13 @@
<number>6</number>
</property>
<item row="2" column="1" >
<widget class="QtxDoubleSpinBox" name="SpinBox_DZ" />
<widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DZ" />
</item>
<item row="1" column="1" >
<widget class="QtxDoubleSpinBox" name="SpinBox_DY" />
<widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DY" />
</item>
<item row="0" column="1" >
<widget class="QtxDoubleSpinBox" name="SpinBox_DX" />
<widget class="SalomeApp_DoubleSpinBox" name="SpinBox_DX" />
</item>
<item row="1" column="0" >
<widget class="QLabel" name="TextLabel2" >
@ -121,9 +121,9 @@
<pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
<customwidgets>
<customwidget>
<class>QtxDoubleSpinBox</class>
<class>SalomeApp_DoubleSpinBox</class>
<extends>QDoubleSpinBox</extends>
<header location="global" >QtxDoubleSpinBox.h</header>
<header location="global" >SalomeApp_DoubleSpinBox.h</header>
</customwidget>
</customwidgets>
<tabstops>

View File

@ -65,6 +65,16 @@ 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; }
@ -80,7 +90,7 @@ class GEOM_IOperations
GEOM_Engine* _engine;
GEOM_Solver* _solver;
int _docID;
TCollection_AsciiString _parameters;
};
#endif

View File

@ -122,6 +122,26 @@ 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

View File

@ -53,6 +53,10 @@ 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; }

View File

@ -427,7 +427,10 @@ GEOM::GEOM_IOperations_ptr PrimitiveGUI_BoxDlg::createOperation()
//=================================================================================
bool PrimitiveGUI_BoxDlg::isValid (QString&)
{
return getConstructorId() == 0 ? !(myPoint1->_is_nil() || myPoint2->_is_nil()) : true;
return getConstructorId() == 0 ? !(myPoint1->_is_nil() || myPoint2->_is_nil()) :
GroupDimensions->SpinBox_DX->isValid() &&
GroupDimensions->SpinBox_DY->isValid() &&
GroupDimensions->SpinBox_DZ->isValid();
}
//=================================================================================
@ -455,6 +458,12 @@ bool PrimitiveGUI_BoxDlg::execute (ObjectList& objects)
double y = GroupDimensions->SpinBox_DY->value();
double z = GroupDimensions->SpinBox_DZ->value();
QStringList aParameters;
aParameters << GroupDimensions->SpinBox_DX->text();
aParameters << GroupDimensions->SpinBox_DY->text();
aParameters << GroupDimensions->SpinBox_DZ->text();
getOperation()->SetParameters( aParameters.join( ":" ).toLatin1().constData() );
anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())->MakeBoxDXDYDZ(x, y, z);
res = true;
}