27 #ifndef GEOMBASE_HELPER_H
28 #define GEOMBASE_HELPER_H
34 #include <SALOME_ListIO.hxx>
35 #include <SALOMEconfig.h>
36 #include CORBA_CLIENT_HEADER(GEOM_Gen)
38 #include <TColStd_MapOfInteger.hxx>
47 class SalomeApp_Study;
49 class SUIT_ViewWindow;
65 static SUIT_ViewWindow* getActiveView();
70 static GEOM::GEOM_Gen_ptr getGeomEngine();
72 void display (
const ObjectList&,
const bool =
true );
73 void display ( GEOM::GEOM_Object_ptr,
const bool =
true );
74 void erase (
const ObjectList&,
const bool =
true );
75 void erase ( GEOM::GEOM_Object_ptr,
const bool =
true );
76 void redisplay (
const ObjectList&,
const bool =
true,
const bool =
true );
77 void redisplay ( GEOM::GEOM_Object_ptr,
const bool =
true,
const bool =
true );
79 virtual void displayPreview (
const bool display,
80 const bool activate =
false,
81 const bool update =
true,
82 const bool toRemoveFromEngine =
true,
83 const double lineWidth = -1,
84 const int displayMode = -1,
86 const bool append =
false );
90 virtual void displayPreview ( GEOM::GEOM_Object_ptr obj,
91 const bool append =
false,
92 const bool activate =
false,
93 const bool update =
true,
94 const double lineWidth = -1,
95 const int displayMode = -1,
96 const int color = -1 );
97 void displayPreview (
const SALOME_Prs* prs,
98 const bool append =
false,
100 void erasePreview (
const bool =
true );
104 void localSelection(
const ObjectList&,
const std::list<int> );
105 void localSelection(
const ObjectList&,
const int );
106 void localSelection( GEOM::GEOM_Object_ptr,
const std::list<int> );
107 void localSelection( GEOM::GEOM_Object_ptr,
const int );
108 void localSelection(
const std::list<int> );
109 void localSelection(
const int );
110 void activate(
const int );
111 void globalSelection(
const int =
GEOM_ALLOBJECTS,
const bool =
false );
112 void globalSelection(
const TColStd_MapOfInteger&,
const bool =
false );
113 void globalSelection(
const TColStd_MapOfInteger&,
const QList<int>& ,
const bool =
false );
114 void updateViewer ();
116 void prepareSelection(
const ObjectList&,
const int );
117 void prepareSelection( GEOM::GEOM_Object_ptr,
const int );
119 QString addInStudy ( GEOM::GEOM_Object_ptr,
const char* theName );
122 bool abortCommand ();
123 bool commitCommand (
const char* = 0 );
124 bool hasCommand ()
const;
126 void updateObjBrowser()
const;
127 int getStudyId ()
const;
128 SalomeApp_Study* getStudy ()
const;
129 bool checkViewWindow ();
131 bool onAccept(
const bool publish =
true,
const bool useTransaction =
true,
bool erasePreviewFlag =
true);
138 void showError(
const QString& msg );
141 GEOM::GEOM_IOperations_ptr getOperation();
146 inline void setPrefix(
const QString& prefix ) { myPrefix = prefix; }
147 QString getPrefix( GEOM::GEOM_Object_ptr = GEOM::GEOM_Object::_nil() )
const;
156 virtual GEOM::GEOM_IOperations_ptr createOperation();
161 virtual bool isValid( QString& msg );
169 virtual void restoreSubShapes( SALOMEDS::Study_ptr theStudy, SALOMEDS::SObject_ptr theSObject );
172 virtual GEOM::GEOM_Object_ptr getFather( GEOM::GEOM_Object_ptr theObj );
177 virtual QString getNewObjectName (
int CurrObj = -1)
const;
178 virtual QString getObjectName(GEOM::GEOM_Object_ptr
object)
const;
179 virtual bool extractPrefix()
const;
180 virtual void addSubshapesToStudy();
181 virtual QList<GEOM::GeomObjPtr> getSourceObjects();
183 GEOM::GEOM_Object_ptr findObjectInFather( GEOM::GEOM_Object_ptr theFather,
const QString& theName );
184 GEOM::GEOM_Object_ptr findObjectInFather( GEOM::GEOM_Object_ptr theFather,
int theIndex );
189 QList<GEOM::GeomObjPtr> getSelected( TopAbs_ShapeEnum type,
int count,
bool strict =
true );
190 QList<GEOM::GeomObjPtr> getSelected(
const QList<TopAbs_ShapeEnum>& types,
int count,
bool strict =
true );
192 void hideSourceObjects( QList<GEOM::GeomObjPtr> theObjectList );
197 SUIT_Desktop* getDesktop()
const;
199 virtual void setIsApplyAndClose(
const bool theFlag );
200 virtual bool isApplyAndClose()
const;
202 virtual void setIsOptimizedBrowsing(
const bool theFlag );
203 virtual bool isOptimizedBrowsing()
const;
213 QString
getEntry( GEOM::GEOM_Object_ptr )
const;
214 void clearShapeBuffer( GEOM::GEOM_Object_ptr );
235 #endif // GEOMBASE_HELPER_H