Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef GEOMBASE_H
00028 #define GEOMBASE_H
00029
00030 #include "GEOM_GEOMBase.hxx"
00031
00032
00033 #include <GEOM_AISShape.hxx>
00034
00035
00036 #include <SALOMEconfig.h>
00037 #include CORBA_SERVER_HEADER(SALOMEDS)
00038 #include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
00039 #include CORBA_SERVER_HEADER(GEOM_Gen)
00040
00041
00042 #include <QString>
00043
00044 class GEOM_Actor;
00045 class SALOME_ListIO;
00046
00047 class QWidget;
00048
00049
00050
00051
00052
00053 class GEOMBASE_EXPORT GEOMBase
00054 {
00055 public :
00056
00057 static int GetIndex( const TopoDS_Shape& subshape, const TopoDS_Shape& shape );
00058 static TopoDS_Shape GetShapeFromIOR( const QString& IOR );
00059 static bool GetShape( GEOM::GEOM_Object_ptr object,
00060 TopoDS_Shape& shape,
00061 const TopAbs_ShapeEnum type = TopAbs_SHAPE );
00062 static TopoDS_Shape GetTopoFromSelection( const SALOME_ListIO& IObjects );
00063 static int GetNameOfSelectedIObjects( const SALOME_ListIO& IObjects,
00064 QString& name,
00065 const bool shapesOnly = false );
00066 static QString GetShapeTypeString( const TopoDS_Shape& shape );
00067
00068
00069 static Handle(GEOM_AISShape)
00070 ConvertIOinGEOMAISShape( const Handle(SALOME_InteractiveObject)& IO,
00071 bool onlyInActiveView = false );
00072
00073 static Handle(AIS_InteractiveObject)
00074 GetAIS( const Handle(SALOME_InteractiveObject)& IO,
00075 bool onlyInActiveView = false,
00076 bool onlyGeom = false );
00077 static QStringList ConvertListOfIOInListOfIOR( const SALOME_ListIO& IObjects );
00078
00079 static Handle(GEOM_AISShape)
00080 ConvertIORinGEOMAISShape( const QString& IOR,
00081 bool onlyInActiveView = false );
00082 static GEOM_Actor* ConvertIORinGEOMActor( const QString& IOR,
00083 bool onlyInActiveView = false );
00084
00085 static GEOM::GEOM_Object_ptr
00086 ConvertIOinGEOMObject( const Handle(SALOME_InteractiveObject)& IO );
00087
00088 static void ConvertListOfIOInListOfGO( const SALOME_ListIO& IObjects,
00089 GEOM::ListOfGO& geomObjects,
00090 bool shapesOnly = false );
00091
00092 static GEOM::GEOM_Object_ptr
00093 GetObjectFromIOR( const QString& IOR );
00094
00095 static QString GetIORFromObject( GEOM::GEOM_Object_ptr object );
00096
00097
00098 static bool VertexToPoint( const TopoDS_Shape& shape, gp_Pnt& point );
00099
00100
00101 static bool LinearEdgeExtremities( const TopoDS_Shape& shape,
00102 gp_Pnt& point1, gp_Pnt& point2 );
00103 static void GetBipointDxDyDz( const gp_Pnt& point1, const gp_Pnt& point2,
00104 double& dx, double& dy, double& dz );
00105
00106
00107 static TopoDS_Shape CreateArrowForLinearEdge( const TopoDS_Shape& tds );
00108
00109
00110 static bool SelectionByNameInDialogs( QWidget* widget,
00111 const QString& userObjectName,
00112 const SALOME_ListIO& IObjects );
00113
00114 static void DefineDlgPosition( QWidget* dlg, int& x, int& y );
00115
00116
00117 static QString GetDefaultName( const QString& operation, bool extractPrefix = false );
00118
00119
00120 static void ShowErrorMessage( const QString& errorCode, const QString& comment = QString() );
00121
00122
00123 static QString GetName( GEOM::GEOM_Object_ptr object );
00124
00125
00126 static bool IsShape( GEOM::GEOM_Object_ptr object );
00127
00128
00129 static QString TypeName( TopAbs_ShapeEnum type );
00130
00131
00132 static QString GetEntry( GEOM::GEOM_Object_ptr object );
00133
00134
00135 static void PublishSubObject( GEOM::GEOM_Object_ptr object );
00136 };
00137
00138 #endif // GEOMBASE_H