1 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License.
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
20 #ifndef SMESHGUI_Utils_HeaderFile
21 #define SMESHGUI_Utils_HeaderFile
23 #include "SMESH_SMESHGUI.hxx"
25 #include <omniORB4/CORBA.h>
27 #include "SALOMEDSClient_definitions.hxx"
28 #include "SALOME_InteractiveObject.hxx"
29 #include "LightApp_DataOwner.h"
33 class SUIT_ViewWindow;
36 class SUIT_ResourceMgr;
40 class SALOMEDSClient_Study;
41 class SALOMEDSClient_SObject;
43 class SalomeApp_Study;
44 class SalomeApp_Module;
45 class LightApp_SelectionMgr;
51 GetDesktop(const CAM_Module* theModule);
54 LightApp_SelectionMgr*
55 GetSelectionMgr(const SalomeApp_Module* theModule);
59 GetAppStudy(const CAM_Module* theModule);
63 GetResourceMgr( const SalomeApp_Module* );
67 GetCStudy(const SalomeApp_Study* theStudy);
70 CORBA::Object_var DataOwnerToObject(const LightApp_DataOwnerPtr& theOwner);
72 template<class TInterface> typename TInterface::_var_type
73 DataOwnerToInterface(const LightApp_DataOwnerPtr& theDataOwner)
75 CORBA::Object_var anObj = DataOwnerToObject(theDataOwner);
76 if(!CORBA::is_nil(anObj))
77 return TInterface::_narrow(anObj);
78 return TInterface::_nil();
83 SUIT_Study* GetActiveStudy();
86 SUIT_ViewWindow* GetActiveWindow();
89 _PTR(Study) GetActiveStudyDocument();
92 _PTR(SObject) FindSObject(CORBA::Object_ptr theObject);
95 void SetName (_PTR(SObject) theSObject, const char* theName);
98 void SetValue (_PTR(SObject) theSObject, const char* theValue);
101 CORBA::Object_var SObjectToObject (_PTR(SObject) theSObject,
102 _PTR(Study) theStudy);
105 CORBA::Object_var SObjectToObject(_PTR(SObject) theSObject);
107 template<class TInterface> typename TInterface::_var_type
108 SObjectToInterface(_PTR(SObject) theSObject)
110 CORBA::Object_var anObj = SObjectToObject(theSObject);
111 if(!CORBA::is_nil(anObj))
112 return TInterface::_narrow(anObj);
113 return TInterface::_nil();
117 CORBA::Object_var IObjectToObject(const Handle(SALOME_InteractiveObject)& theIO);
119 template<class TInterface> typename TInterface::_var_type
120 IObjectToInterface(const Handle(SALOME_InteractiveObject)& theIO)
122 CORBA::Object_var anObj = IObjectToObject(theIO);
123 if(!CORBA::is_nil(anObj))
124 return TInterface::_narrow(anObj);
125 return TInterface::_nil();
129 CORBA::Object_var IORToObject(const char* theIOR);
131 template<class TInterface> typename TInterface::_var_type
132 IORToInterface(const char* theIOR)
134 CORBA::Object_var anObj = IORToObject(theIOR);
135 if(!CORBA::is_nil(anObj))
136 return TInterface::_narrow(anObj);
137 return TInterface::_nil();
141 int GetNameOfSelectedIObjects (LightApp_SelectionMgr*, QString& theName);
144 _PTR(SObject) GetMeshOrSubmesh (_PTR(SObject) theSObject);
147 void ModifiedMesh (_PTR(SObject) theSObject, bool theIsRight);
149 // void UpdateObjBrowser (bool);