27#ifndef SMESHGUI_UTILS_H
28#define SMESHGUI_UTILS_H
34#include <omniORB4/CORBA.h>
37#include <SALOMEDSClient_definitions.hxx>
38#include <SALOME_GenericObj_wrap.hxx>
41#include <SALOME_InteractiveObject.hxx>
42#include <LightApp_DataOwner.h>
47#include <SALOMEconfig.h>
48#include CORBA_CLIENT_HEADER(SMESH_Mesh)
53class SUIT_ResourceMgr;
57class SALOMEDSClient_Study;
58class SALOMEDSClient_SObject;
62class LightApp_SelectionMgr;
73 LightApp_SelectionMgr*
87 template<
class TInterface>
typename TInterface::_var_type
91 if(!CORBA::is_nil(anObj))
92 return TInterface::_narrow(anObj);
93 return TInterface::_nil();
103 _PTR(Study) getStudy();
106 _PTR(SObject) FindSObject( CORBA::Object_ptr );
109 void SetName(
_PTR(SObject),
const QString& name );
119 template<
class TInterface>
typename TInterface::_var_type
123 if(!CORBA::is_nil(anObj))
124 return TInterface::_narrow(anObj);
125 return TInterface::_nil();
129 _PTR(SObject) ObjectToSObject( CORBA::Object_ptr );
134 template<
class TInterface>
typename TInterface::_var_type
138 if(!CORBA::is_nil(anObj))
139 return TInterface::_narrow(anObj);
140 return TInterface::_nil();
144 CORBA::Object_var
IORToObject(
const QString& ior );
146 template<
class TInterface>
typename TInterface::_var_type
150 if ( !CORBA::is_nil( anObj ) )
151 return TInterface::_narrow( anObj );
152 return TInterface::_nil();
158 template<
class TInterface>
typename TInterface::_var_type
162 if ( !CORBA::is_nil( anObj ) )
163 return TInterface::_narrow( anObj );
164 return TInterface::_nil();
171 QString
GetName(
const Handle(SALOME_InteractiveObject)& theIO );
174 _PTR(SObject) GetMeshOrSubmesh(
_PTR(SObject) );
198 template <
class _STRING >
204 operator const char*()
const
205 {
return myStr.in(); }
215 QString
fromUtf8(
const char* txt );
216 QString
fromUtf8(
const std::string& txt );
219 toUtf8(
const QString& txt );
220 operator const char*()
const {
return c_str(); }
#define SMESHGUI_EXPORT
Definition: SMESH_SMESHGUI.hxx:36
Mesh face.
Definition: SMDS_MeshFace.hxx:41
Class useful to convert a string returned from a CORBA call to other string types w/o memory leak.
Definition: SMESHGUI_Utils.h:199
toStrT(char *s)
Definition: SMESHGUI_Utils.h:202
CORBA::String_var myStr
Definition: SMESHGUI_Utils.h:200
Definition: SMESH_ControlsClassifier.cxx:39
TInterface::_var_type DataOwnerToInterface(const LightApp_DataOwnerPtr &theDataOwner)
Definition: SMESHGUI_Utils.h:88
int GetNameOfSelectedIObjects(LightApp_SelectionMgr *theMgr, QString &theName)
Definition: SMESHGUI_Utils.cxx:235
SUIT_ViewWindow * GetActiveWindow()
Definition: SMESHGUI_Utils.cxx:104
TInterface::_var_type IORToInterface(const QString &theIOR)
Definition: SMESHGUI_Utils.h:147
Handle(VTKViewer_Filter) GetFilter(int theId
QString GetName(const Handle(SALOME_InteractiveObject)&theIO)
Definition: SMESHGUI_Utils.cxx:252
void setFileName(_PTR(SObject) theSObject, const QString &theValue)
Definition: SMESHGUI_Utils.cxx:154
_PTR(SObject) getSubShapeSO(int subShapeID
Return SO of a sub-shape.
Definition: SMESHGUI_Utils.cxx:122
SalomeApp_Study * GetAppStudy(const CAM_Module *)
LightApp_SelectionMgr * GetSelectionMgr(const SalomeApp_Module *theModule)
Definition: SMESHGUI_Utils.cxx:68
QString fromUtf8(const char *txt)
Definition: SMESHGUI_Utils.cxx:312
CORBA::Object_var IORToObject(const QString &theIOR)
Definition: SMESHGUI_Utils.cxx:222
void SetValue(_PTR(SObject) theSObject, const QString &theValue)
Definition: SMESHGUI_Utils.cxx:141
CORBA::Object_var EntryToObject(const QString &theEntry)
Definition: SMESHGUI_Utils.cxx:229
CORBA::Object_var DataOwnerToObject(const LightApp_DataOwnerPtr &theOwner)
Definition: SMESHGUI_Utils.cxx:80
SUIT_Study * GetActiveStudy()
Definition: SMESHGUI_Utils.cxx:95
SALOME::GenericObj_wrap< SMESH_IDSource > IDSource_wrap
Definition: SMESHGUI_Utils.h:189
gp_XYZ getNormale(const SMDS_MeshFace *theFace)
Return normale to a given face.
Definition: SMESHGUI_Utils.cxx:305
TInterface::_var_type EntryToInterface(const QString &theEntry)
Definition: SMESHGUI_Utils.h:159
CORBA::Object_var SObjectToObject(_PTR(SObject) theSObject)
Definition: SMESHGUI_Utils.cxx:180
void setFileType(_PTR(SObject) theSObject, const QString &theValue)
Definition: SMESHGUI_Utils.cxx:167
TInterface::_var_type SObjectToInterface(_PTR(SObject) theSObject)
Definition: SMESHGUI_Utils.h:120
SUIT_Desktop * GetDesktop(const CAM_Module *theModule)
Definition: SMESHGUI_Utils.cxx:62
void SetName(_PTR(SObject) theSObject, const QString &theName)
Definition: SMESHGUI_Utils.cxx:134
void ShowHelpFile(const QString &theHelpFileName)
Definition: SMESHGUI_Utils.cxx:283
SUIT_ResourceMgr * GetResourceMgr(const SalomeApp_Module *)
Definition: SMESHGUI_Utils.cxx:74
TInterface::_var_type IObjectToInterface(const Handle(SALOME_InteractiveObject)&theIO)
Definition: SMESHGUI_Utils.h:135
CORBA::Object_var IObjectToObject(const Handle(SALOME_InteractiveObject)&theIO)
Definition: SMESHGUI_Utils.cxx:211
Definition: SMESHGUI_Utils.h:208
toQStr(char *s)
Definition: SMESHGUI_Utils.h:209
Definition: SMESHGUI_Utils.h:211
toStdStr(char *s)
Definition: SMESHGUI_Utils.h:212
Definition: SMESHGUI_Utils.h:218
toUtf8(const QString &txt)
Definition: SMESHGUI_Utils.cxx:326