Salome HOME
Correct make file for shared modules script
[modules/geom.git] / src / BasicGUI / BasicGUI_PointDlg.cxx
index af0a6afca4dae8562ff70e8751a306f4dddffb75..9d92f5b99c917ed22331aa72e3add89c7038cf9b 100644 (file)
@@ -1,15 +1,15 @@
-//  GEOM GEOMGUI : GUI for Geometry component
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 //  Lesser General Public License for more details.
 //
 //
 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-//
-//
+//  GEOM GEOMGUI : GUI for Geometry component
 //  File   : BasicGUI_PointDlg.cxx
 //  Author : Lucien PIGNOLONI
 //  Module : GEOM
 //  $Header$
-
+//
 #include "BasicGUI_PointDlg.h"
 
 #include "SUIT_Session.h"
@@ -145,8 +144,7 @@ BasicGUI_PointDlg::BasicGUI_PointDlg(GeometryGUI* theGeometryGUI, QWidget* paren
   myY->setPalette( aPal );
   myZ->setPalette( aPal );
 
-  //  setHelpFileName("create_point_page.html");
-  setHelpFileName("point.htm");
+  setHelpFileName("create_point_page.html");
 
   Init();
 }
@@ -418,11 +416,10 @@ void BasicGUI_PointDlg::SelectionIntoArgument()
     if (!CORBA::is_nil(aSelectedObject) && aRes)
     {
       QString aName = GEOMBase::GetName(aSelectedObject);
-
+      TopAbs_ShapeEnum aNeedType = TopAbs_VERTEX;
       TopoDS_Shape aShape;
       if (GEOMBase::GetShape(aSelectedObject, aShape, TopAbs_SHAPE) && !aShape.IsNull())
       {
-        TopAbs_ShapeEnum aNeedType = TopAbs_VERTEX;
         if (id == 2 || id == 3)
           aNeedType = TopAbs_EDGE;
         if(id == 4)
@@ -448,6 +445,7 @@ void BasicGUI_PointDlg::SelectionIntoArgument()
          }
          else
            aSelectedObject = aFindedObject; // get Object from study
+         GEOMBase::GetShape(aSelectedObject, aShape, TopAbs_SHAPE);
         }
         else // Global Selection
         {
@@ -461,7 +459,8 @@ void BasicGUI_PointDlg::SelectionIntoArgument()
 
       if (id == 0)
       {
-        if (aShape.IsNull()) return;
+        if (aShape.IsNull() || aShape.ShapeType() != aNeedType)
+         return;
         gp_Pnt aPnt = BRep_Tool::Pnt( TopoDS::Vertex( aShape ) );
         GroupXYZ->SpinBox_DX->SetValue( aPnt.X() );
         GroupXYZ->SpinBox_DY->SetValue( aPnt.Y() );