+ bool ok = false;
+ if( getConstructorId() == 0 )
+ ok = GroupPoints->SpinBox_DX->isValid( msg, !IsPreview() ) && myPoint;
+ else if( getConstructorId() == 1 )
+ ok = GroupDimensions->SpinBox_DX->isValid( msg, !IsPreview() );
+ return ok;
+}
+
+//=================================================================================
+// function : execute
+// purpose :
+//=================================================================================
+bool PrimitiveGUI_SphereDlg::execute( ObjectList& objects )
+{
+ bool res = false;
+
+ GEOM::GEOM_Object_var anObj;
+
+ GEOM::GEOM_I3DPrimOperations_var anOper = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation());
+
+ switch ( getConstructorId() ) {
+ case 0 :
+ {
+ if ( myPoint ) {
+ anObj = anOper->MakeSpherePntR( myPoint.get(), getRadius() );
+ if (!anObj->_is_nil() && !IsPreview())
+ {
+ QStringList aParameters;
+ aParameters << GroupPoints->SpinBox_DX->text();
+ anObj->SetParameters(aParameters.join(":").toLatin1().constData());
+ }
+ res = true;
+ }
+ break;
+ }
+ case 1 :
+ {
+ anObj = anOper->MakeSphereR( getRadius() );
+ if (!anObj->_is_nil() && !IsPreview())
+ {
+ QStringList aParameters;
+ aParameters << GroupDimensions->SpinBox_DX->text();
+ anObj->SetParameters(aParameters.join(":").toLatin1().constData());
+ }
+ res = true;
+ break;
+ }
+ }