- myGeomBase->EraseSimulationShape();
- mySimulationTopoDs.Nullify();
-
- try {
- gp_Ax2 anAxis(myPoint1, myDir);
- gp_Circ circ(anAxis, myRadius);
- BRepBuilderAPI_MakeEdge MakeEdge(circ);
- mySimulationTopoDs = MakeEdge.Shape();
- myGeomBase->DisplaySimulationShape(mySimulationTopoDs);
- }
- catch(Standard_Failure) {
- MESSAGE("Exception catched in MakeCircleSimulationAndDisplay");
+ return getGeomEngine()->GetICurvesOperations( getStudyId() );
+}
+
+//=================================================================================
+// function : isEqual
+// purpose : it may also be needed to check for min distance between gp_Pnt-s...
+//=================================================================================
+static bool isEqual( const GEOM::GEOM_Object_var& thePnt1, const GEOM::GEOM_Object_var& thePnt2 )
+{
+ return thePnt1->_is_equivalent( thePnt2 );
+}
+
+//=================================================================================
+// function : isValid
+// purpose :
+//=================================================================================
+bool BasicGUI_CircleDlg::isValid( QString& msg )
+{
+ const int id = getConstructorId();
+ if ( id == 0 )
+ return !myPoint->_is_nil() && !myDir->_is_nil() && getRadius() > 0;
+ else if ( id == 1 )
+ return !myPoint1->_is_nil() && !myPoint2->_is_nil() && !myPoint3->_is_nil() &&
+ !isEqual( myPoint1, myPoint2 ) && !isEqual( myPoint1, myPoint3 ) && !isEqual( myPoint2, myPoint3 );
+ return false;
+}
+
+//=================================================================================
+// function : execute
+// purpose :
+//=================================================================================
+bool BasicGUI_CircleDlg::execute( ObjectList& objects )
+{
+ bool res = false;
+
+ GEOM::GEOM_Object_var anObj;
+
+ switch ( getConstructorId() )
+ {
+ case 0 :
+ anObj = GEOM::GEOM_ICurvesOperations::_narrow( getOperation() )->MakeCirclePntVecR( myPoint, myDir, getRadius() );
+ res = true;
+ break;
+ case 1 :
+ anObj = GEOM::GEOM_ICurvesOperations::_narrow( getOperation() )->MakeCircleThreePnt( myPoint1, myPoint2, myPoint3 );
+ res = true;
+ break;