#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
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 */
GEOM::GEOM_Shape_ptr GeometryGUI::ConvertIOinGEOMShape( const Handle(SALOME_InteractiveObject)& IO,
Standard_Boolean& testResult )
{
- GEOM::GEOM_Shape_var aShape ;
+ GEOM::GEOM_Shape_ptr aShape ;
testResult = false ;
-
+
/* case SObject */
if ( IO->hasEntry() ) {
SALOMEDS::Study_var aStudy = GeomGUI->myActiveStudy->getStudyDocument();
SALOMEDS::GenericAttribute_var anAttr;
SALOMEDS::AttributeIOR_var anIOR;
if ( !obj->_is_nil() ) {
- if (obj->FindAttribute(anAttr, "AttributeIOR")) {
- anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
- aShape = myComponentGeom->GetIORFromString(anIOR->Value()) ;
- if(!CORBA::is_nil(aShape)) testResult = true ;
- return aShape._retn();
- }
+ if (obj->FindAttribute(anAttr, "AttributeIOR")) {
+ anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
+ aShape = myComponentGeom->GetIORFromString(anIOR->Value()) ;
+ testResult = true ;
+ return aShape;
+ }
}
}
/* case Graphical Object */
if ( IO->IsInstance(STANDARD_TYPE(GEOM_InteractiveObject)) ) {
Handle(GEOM_InteractiveObject) GIObject = Handle(GEOM_InteractiveObject)::DownCast( IO );
Standard_CString ior = GIObject->getIOR();
+ testResult = true ;
aShape = myComponentGeom->GetIORFromString(ior) ;
- if(!CORBA::is_nil(aShape)) testResult = true ;
- return aShape._retn();
- }
- return aShape._retn();
+ return aShape;
+ }
+ return aShape ;
}
}
+//=====================================================================================
+// 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()
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() ;
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);
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" );
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" );
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" );