X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGEOMGUI%2FGeometryGUI.cxx;h=0aa9b4ffc96f9d7f73eb8fb9fae71462ff1b7946;hb=d761aab4a92c178a7101653fd38e5c39e17b1615;hp=0e86012f5cdc5a009067293864eed40a1b7bc003;hpb=0f1369c27fd6a84ba1149c3c5f3ed181acc055f1;p=modules%2Fgeom.git diff --git a/src/GEOMGUI/GeometryGUI.cxx b/src/GEOMGUI/GeometryGUI.cxx index 0e86012f5..0aa9b4ffc 100644 --- a/src/GEOMGUI/GeometryGUI.cxx +++ b/src/GEOMGUI/GeometryGUI.cxx @@ -179,6 +179,7 @@ using namespace std; #include "GeometryGUI_MirrorDlg.h" // Method MIRROR #include "GeometryGUI_SphereDlg.h" // Method SPHERE #include "GeometryGUI_CircleDlg.h" // Method CIRCLE +#include "GeometryGUI_EllipseDlg.h" // Method ELLIPSE #include "GeometryGUI_RevolDlg.h" // Method REVOL #include "GeometryGUI_RotationDlg.h" // Method ROTATION #include "GeometryGUI_TranslationDlg.h" // Method TRANSLATION @@ -358,7 +359,7 @@ GeometryGUI* GeometryGUI::GetOrCreateGeometryGUI( QAD_Desktop* desktop ) GeomGUI->myShadingColor = Quantity_Color( Quantity_NOC_GOLDENROD ); - Engines::Component_var comp = desktop->getEngine("FactoryServer", "Geometry"); + Engines::Component_var comp = desktop->getEngine("FactoryServer", "GEOM"); GeomGUI->myComponentGeom = GEOM::GEOM_Gen::_narrow(comp); /* GetCurrentStudy */ @@ -1783,6 +1784,35 @@ void GeometryGUI::MakeCircleAndDisplay( const gp_Pnt CenterPoint, const gp_Dir d } +//===================================================================================== +// function : MakeEllipseAndDisplay() +// purpose : +//===================================================================================== +void GeometryGUI::MakeEllipseAndDisplay( const gp_Pnt CenterPoint, + const gp_Dir dir, + const Standard_Real Major_Radius, + const Standard_Real Minor_Radius ) +{ + try { + GEOM::PointStruct pstruct = myComponentGeom->MakePointStruct( CenterPoint.X(), CenterPoint.Y(), CenterPoint.Z() ) ; + GEOM::PointStruct d = myComponentGeom->MakePointStruct( dir.X(), dir.Y(), dir.Z() ) ; + GEOM::DirStruct dstruct = myComponentGeom->MakeDirection(d) ; + + GEOM::GEOM_Shape_var result = myComponentGeom->MakeEllipse(pstruct, dstruct, Major_Radius, Minor_Radius) ; + if ( result->_is_nil() ) { + myDesktop->putInfo(tr("GEOM_PRP_ABORT") ); + return ; + } + result->NameType(tr("GEOM_ELLIPSE")); + if ( Display( result ) ) + myDesktop->putInfo(tr("GEOM_PRP_DONE")); + } + catch (const SALOME::SALOME_Exception& S_ex) { + QtCatchCorbaException(S_ex); + } + return ; +} + //===================================================================================== // function : MakeWireAndDisplay() @@ -3296,6 +3326,14 @@ bool GeometryGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent) break ; } + case 3014: // ELLIPSE + { + GeomGUI->EmitSignalDeactivateDialog() ; + SALOME_Selection* Sel = SALOME_Selection::Selection( GeomGUI->myActiveStudy->getSelection() ); + GeometryGUI_EllipseDlg *aDlg = new GeometryGUI_EllipseDlg( parent, "", Sel ) ; + break ; + } + case 3015: // ARC { GeomGUI->EmitSignalDeactivateDialog() ; @@ -4216,7 +4254,7 @@ bool GeometryGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent) if (!obj->FindAttribute(anAttr, "AttributeIOR") && obj->FindAttribute(anAttr, "AttributePersistentRef")) { // load - Engines::Component_var comp = GeomGUI->myDesktop->getEngine("FactoryServer","Geometry"); + Engines::Component_var comp = GeomGUI->myDesktop->getEngine("FactoryServer","GEOM"); if (!CORBA::is_nil(comp)) { SALOMEDS::Driver_var driver = SALOMEDS::Driver::_narrow(comp); @@ -5011,7 +5049,8 @@ bool GeometryGUI::Import( ) father = aStudyBuilder->NewComponent("GEOM"); anAttr = aStudyBuilder->FindOrCreateAttribute(father, "AttributeName"); aName = SALOMEDS::AttributeName::_narrow(anAttr); - aName->SetValue( tr("GEOM_MEN_COMPONENT") ); + // aName->SetValue( tr("GEOM_MEN_COMPONENT") ); + aName->SetValue( QAD_Application::getDesktop()->getComponentUserName( "GEOM" ) ); anAttr = aStudyBuilder->FindOrCreateAttribute(father, "AttributePixMap"); aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr); aPixmap->SetPixMap( "ICON_OBJBROWSER_Geometry" ); @@ -5215,7 +5254,8 @@ bool GeometryGUI::Display( GEOM::GEOM_Shape_ptr aShape, father = aStudyBuilder->NewComponent("GEOM"); anAttr = aStudyBuilder->FindOrCreateAttribute(father, "AttributeName"); aName = SALOMEDS::AttributeName::_narrow(anAttr); - aName->SetValue( tr("GEOM_MEN_COMPONENT") ); + // aName->SetValue( tr("GEOM_MEN_COMPONENT") ); + aName->SetValue( QAD_Application::getDesktop()->getComponentUserName( "GEOM" ) ); anAttr = aStudyBuilder->FindOrCreateAttribute(father, "AttributePixMap"); aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr); aPixmap->SetPixMap( "ICON_OBJBROWSER_Geometry" ); @@ -5329,7 +5369,8 @@ bool GeometryGUI::AddInStudy( bool selection, father = aStudyBuilder->NewComponent("GEOM"); anAttr = aStudyBuilder->FindOrCreateAttribute(father, "AttributeName"); aName = SALOMEDS::AttributeName::_narrow(anAttr); - aName->SetValue( tr("GEOM_MEN_COMPONENT") ); + // aName->SetValue( tr("GEOM_MEN_COMPONENT") ); + aName->SetValue( QAD_Application::getDesktop()->getComponentUserName( "GEOM" ) ); anAttr = aStudyBuilder->FindOrCreateAttribute(father, "AttributePixMap"); aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr); aPixmap->SetPixMap( "ICON_OBJBROWSER_Geometry" );