+ displayPreview();
+}
+
+//=================================================================================
+// function : createOperation
+// purpose :
+//=================================================================================
+GEOM::GEOM_IOperations_ptr PrimitiveGUI_SphereDlg::createOperation()
+{
+ return getGeomEngine()->GetI3DPrimOperations( getStudyId() );
+}
+
+//=================================================================================
+// function : isValid
+// purpose :
+//=================================================================================
+bool PrimitiveGUI_SphereDlg::isValid( QString& msg )
+{
+ return getConstructorId() == 0 ? !myPoint->_is_nil() : true;
+}
+
+//=================================================================================
+// function : execute
+// purpose :
+//=================================================================================
+bool PrimitiveGUI_SphereDlg::execute (ObjectList& objects)
+{
+ bool res = false;
+
+ GEOM::GEOM_Object_var anObj;
+
+ switch (getConstructorId())
+ {
+ case 0:
+ {
+ if (!CORBA::is_nil(myPoint)) {
+ anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->
+ MakeSpherePntR(myPoint, getRadius());
+ res = true;
+ }
+ break;
+ }
+ case 1:
+ {
+ anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->
+ MakeSphereR(getRadius());
+ res = true;
+ break;
+ }
+ }
+
+ if (!anObj->_is_nil())
+ objects.push_back(anObj._retn());
+
+ return res;
+}
+
+//=================================================================================
+// function : closeEvent
+// purpose :
+//=================================================================================
+void PrimitiveGUI_SphereDlg::closeEvent( QCloseEvent* e )
+{
+ GEOMBase_Skeleton::closeEvent( e );
+}
+
+//=================================================================================
+// function : getRadius()
+// purpose :
+//=================================================================================
+double PrimitiveGUI_SphereDlg::getRadius() const
+{
+ int aConstructorId = getConstructorId();
+ if (aConstructorId == 0)
+ return GroupPoints->SpinBox_DX->GetValue();
+ else if (aConstructorId == 1)
+ return GroupDimensions->SpinBox_DX->GetValue();
+ return 0;
+}
+
+//=================================================================================
+// function : addSubshapeToStudy
+// purpose : virtual method to add new SubObjects if local selection
+//=================================================================================
+void PrimitiveGUI_SphereDlg::addSubshapesToStudy()
+{
+ QMap<QString, GEOM::GEOM_Object_var> objMap;
+
+switch (getConstructorId())
+ {
+ case 0:
+ objMap[GroupPoints->LineEdit1->text()] = myPoint;
+ break;
+ case 1:
+ return;