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
25 #include "SALOMEDSClient_definitions.hxx"
26 #include "SALOME_InteractiveObject.hxx"
27 #include "LightApp_DataOwner.h"
31 class SUIT_ViewWindow;
34 class SUIT_ResourceMgr;
38 class SALOMEDSClient_Study;
39 class SALOMEDSClient_SObject;
41 class SalomeApp_Study;
42 class SalomeApp_Module;
43 class LightApp_SelectionMgr;
48 GetDesktop(const CAM_Module* theModule);
50 LightApp_SelectionMgr*
51 GetSelectionMgr(const SalomeApp_Module* theModule);
54 GetAppStudy(const CAM_Module* theModule);
57 GetResourceMgr( const SalomeApp_Module* );
60 GetCStudy(const SalomeApp_Study* theStudy);
62 CORBA::Object_var DataOwnerToObject(const LightApp_DataOwnerPtr& theOwner);
64 template<class TInterface> typename TInterface::_var_type
65 DataOwnerToInterface(const LightApp_DataOwnerPtr& theDataOwner)
67 CORBA::Object_var anObj = DataOwnerToObject(theDataOwner);
68 if(!CORBA::is_nil(anObj))
69 return TInterface::_narrow(anObj);
70 return TInterface::_nil();
74 SUIT_Study* GetActiveStudy();
76 SUIT_ViewWindow* GetActiveWindow();
78 _PTR(Study) GetActiveStudyDocument();
80 _PTR(SObject) FindSObject(CORBA::Object_ptr theObject);
82 void SetName (_PTR(SObject) theSObject, const char* theName);
83 void SetValue (_PTR(SObject) theSObject, const char* theValue);
84 void setFileType (_PTR(SObject) theSObject, const char* theValue);
85 void setFileName (_PTR(SObject) theSObject, const char* theValue);
87 CORBA::Object_var SObjectToObject (_PTR(SObject) theSObject,
88 _PTR(Study) theStudy);
90 CORBA::Object_var SObjectToObject(_PTR(SObject) theSObject);
92 template<class TInterface> typename TInterface::_var_type
93 SObjectToInterface(_PTR(SObject) theSObject)
95 CORBA::Object_var anObj = SObjectToObject(theSObject);
96 if(!CORBA::is_nil(anObj))
97 return TInterface::_narrow(anObj);
98 return TInterface::_nil();
101 CORBA::Object_var IObjectToObject(const Handle(SALOME_InteractiveObject)& theIO);
103 template<class TInterface> typename TInterface::_var_type
104 IObjectToInterface(const Handle(SALOME_InteractiveObject)& theIO)
106 CORBA::Object_var anObj = IObjectToObject(theIO);
107 if(!CORBA::is_nil(anObj))
108 return TInterface::_narrow(anObj);
109 return TInterface::_nil();
112 CORBA::Object_var IORToObject(const char* theIOR);
114 template<class TInterface> typename TInterface::_var_type
115 IORToInterface(const char* theIOR)
117 CORBA::Object_var anObj = IORToObject(theIOR);
118 if(!CORBA::is_nil(anObj))
119 return TInterface::_narrow(anObj);
120 return TInterface::_nil();
123 int GetNameOfSelectedIObjects (LightApp_SelectionMgr*, QString& theName);
125 _PTR(SObject) GetMeshOrSubmesh (_PTR(SObject) theSObject);
127 void ModifiedMesh (_PTR(SObject) theSObject, bool theIsRight);
129 // void UpdateObjBrowser (bool);