1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 #ifndef SMESHGUI_Utils_HeaderFile
23 #define SMESHGUI_Utils_HeaderFile
25 #include "SMESH_SMESHGUI.hxx"
27 #include <omniORB4/CORBA.h>
29 #include "SALOMEDSClient_definitions.hxx"
30 #include "SALOME_InteractiveObject.hxx"
31 #include "LightApp_DataOwner.h"
35 class SUIT_ViewWindow;
38 class SUIT_ResourceMgr;
42 class SALOMEDSClient_Study;
43 class SALOMEDSClient_SObject;
45 class SalomeApp_Study;
46 class SalomeApp_Module;
47 class LightApp_SelectionMgr;
53 GetDesktop(const CAM_Module* theModule);
56 LightApp_SelectionMgr*
57 GetSelectionMgr(const SalomeApp_Module* theModule);
61 GetAppStudy(const CAM_Module* theModule);
65 GetResourceMgr( const SalomeApp_Module* );
69 GetCStudy(const SalomeApp_Study* theStudy);
72 CORBA::Object_var DataOwnerToObject(const LightApp_DataOwnerPtr& theOwner);
74 template<class TInterface> typename TInterface::_var_type
75 DataOwnerToInterface(const LightApp_DataOwnerPtr& theDataOwner)
77 CORBA::Object_var anObj = DataOwnerToObject(theDataOwner);
78 if(!CORBA::is_nil(anObj))
79 return TInterface::_narrow(anObj);
80 return TInterface::_nil();
85 SUIT_Study* GetActiveStudy();
88 SUIT_ViewWindow* GetActiveWindow();
91 _PTR(Study) GetActiveStudyDocument();
94 _PTR(SObject) FindSObject(CORBA::Object_ptr theObject);
97 void SetName (_PTR(SObject) theSObject, const char* theName);
100 void SetValue (_PTR(SObject) theSObject, const char* theValue);
101 void setFileType (_PTR(SObject) theSObject, const char* theValue);
102 void setFileName (_PTR(SObject) theSObject, const char* theValue);
105 CORBA::Object_var SObjectToObject (_PTR(SObject) theSObject,
106 _PTR(Study) theStudy);
109 CORBA::Object_var SObjectToObject(_PTR(SObject) theSObject);
111 template<class TInterface> typename TInterface::_var_type
112 SObjectToInterface(_PTR(SObject) theSObject)
114 CORBA::Object_var anObj = SObjectToObject(theSObject);
115 if(!CORBA::is_nil(anObj))
116 return TInterface::_narrow(anObj);
117 return TInterface::_nil();
121 CORBA::Object_var IObjectToObject(const Handle(SALOME_InteractiveObject)& theIO);
123 template<class TInterface> typename TInterface::_var_type
124 IObjectToInterface(const Handle(SALOME_InteractiveObject)& theIO)
126 CORBA::Object_var anObj = IObjectToObject(theIO);
127 if(!CORBA::is_nil(anObj))
128 return TInterface::_narrow(anObj);
129 return TInterface::_nil();
133 CORBA::Object_var IORToObject(const char* theIOR);
135 template<class TInterface> typename TInterface::_var_type
136 IORToInterface(const char* theIOR)
138 CORBA::Object_var anObj = IORToObject(theIOR);
139 if(!CORBA::is_nil(anObj))
140 return TInterface::_narrow(anObj);
141 return TInterface::_nil();
145 int GetNameOfSelectedIObjects (LightApp_SelectionMgr*, QString& theName);
148 _PTR(SObject) GetMeshOrSubmesh (_PTR(SObject) theSObject);
151 void ModifiedMesh (_PTR(SObject) theSObject, bool theIsNot, bool isEmptyMesh=false);
154 void ShowHelpFile (QString theHelpFileName);