]> SALOME platform Git repositories - modules/geom.git/blob - src/GEOM_SWIG_WITHIHM/libGEOM_Swig.cxx
Salome HOME
[GITHUB #1] updated TUI command doc for make sphere from point and radius
[modules/geom.git] / src / GEOM_SWIG_WITHIHM / libGEOM_Swig.cxx
1 // Copyright (C) 2007-2024  CEA, EDF, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
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, or (at your option) any later version.
10 //
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.
15 //
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
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 // File   : libGEOM_Swig.cxx
23 // Author : Nicolas REJNERI, Paul RASCLE
24
25 #include "libGEOM_Swig.h"
26
27 #include "GeometryGUI.h"
28 #include "GEOM_Displayer.h"
29 #include "GEOM_Constants.h"
30 #include "Material_Model.h"
31 #include "GEOM_Swig_LocalSelector.h"
32 #include "GEOMGUI_OCCSelector.h"
33 #include "OCCViewer_ViewManager.h"
34
35 #include <SUIT_Desktop.h>
36 #include <SUIT_Session.h>
37 #include <SUIT_ViewManager.h>
38 #include <SUIT_ViewModel.h>
39 #include <SUIT_SelectionMgr.h>
40 #include <LightApp_SelectionMgr.h>
41 #include <SalomeApp_Application.h>
42 #include <SalomeApp_Study.h>
43 #include <OCCViewer_ViewFrame.h>
44 #include <SVTK_ViewWindow.h>
45
46 #include <SALOME_Event.h>
47 #include <utilities.h>
48
49 // IDL Headers
50 #include <SALOMEconfig.h>
51 #include CORBA_SERVER_HEADER(GEOM_Gen)
52
53 GEOM_Swig_LocalSelector* GEOM_Swig::myLocalSelector = 0;
54 GEOMGUI_OCCSelector* GEOM_Swig::myOCCSelector =0;
55
56 /*!
57   \brief Constructor
58 */
59 GEOM_Swig::GEOM_Swig( bool updateOB )
60 {
61   init(updateOB);
62 }
63
64 /*!
65   \brief Destructor
66 */
67 GEOM_Swig::~GEOM_Swig()
68 {
69   // Delete selector because of sigsegv in TEventInitLocalSelection::Execute()
70   // when call GEOM_Swig.initLocalSelection() from Python, close the study, create a new one and
71   // call it again.
72   if (myOCCSelector)
73   {
74     delete myOCCSelector;
75     myOCCSelector = nullptr;
76   }
77 }
78
79 /*!
80   \brief Internal initialization
81 */
82 void GEOM_Swig::init( bool updateOB )
83 {
84   class TEvent: public SALOME_Event
85   {
86     bool myUpdateOB;
87   public:
88     TEvent( bool _updateOB ):
89       myUpdateOB(_updateOB)
90     {}
91     virtual void Execute()
92     {
93       // check active study
94       SUIT_Application* app = SUIT_Session::session()->activeApplication();
95       if (!app) return;
96       
97       SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
98       if ( !study ) return;
99
100       _PTR(Study) studyDS( study->studyDS() );
101       _PTR(StudyBuilder) builder = studyDS->NewBuilder();
102
103       // get/init GEOM engine
104       GEOM::GEOM_Gen_var engine = GeometryGUI::GetGeomGen();
105       if ( CORBA::is_nil( engine ) )
106         return;
107
108       // find GEOM component in the study
109       _PTR(SComponent) component = studyDS->FindComponent( "GEOM" );
110       if ( !component )
111         return;
112
113       // load GEOM data (if it is not done yet)
114       std::string ior;
115       if ( !component->ComponentIOR( ior ) ) {
116         CORBA::String_var engineIOR = SalomeApp_Application::orb()->object_to_string( engine );
117         builder->LoadWith( component, engineIOR.in() );
118       }
119
120       // update Object browser
121       if (myUpdateOB && dynamic_cast<SalomeApp_Application*>( app ) )
122         dynamic_cast<SalomeApp_Application*>( app )->updateObjectBrowser( true );
123
124       //myLocalSelector = 0;
125     }
126   };
127
128   ProcessVoidEvent( new TEvent(updateOB) );
129 }
130
131 /*!
132   \brief Display the presenation in the currently active view
133   \param theEntry geometry object's entry
134   \param theUpdateViewer \c true to update active view's contents
135 */
136 void GEOM_Swig::createAndDisplayGO( const char* theEntry, bool theUpdateViewer )
137 {
138   class TEvent: public SALOME_Event
139   {
140     std::string myEntry;
141     bool        myUpdateViewer;
142   public:
143     TEvent( const char* _entry, bool _update ):
144       myEntry( _entry ), myUpdateViewer( _update )
145     {}
146     virtual void Execute()
147     {
148       Handle(SALOME_InteractiveObject) io = new SALOME_InteractiveObject( myEntry.c_str(), "GEOM", "" );
149
150       GEOM_Displayer().Display( io, myUpdateViewer );
151     }
152   };
153
154   ProcessVoidEvent( new TEvent( theEntry, theUpdateViewer ) );
155 }
156
157 /*!
158   \brief Same as createAndDisplayGO, but also fits the active view to the contents
159   \param theEntry geometry object's entry
160   \param theUpdateViewer \c true to update active view's contents
161 */
162 void GEOM_Swig::createAndDisplayFitAllGO( const char* theEntry )
163 {
164   // display object
165   createAndDisplayGO( theEntry );
166
167   // fit all the view
168   class TEventFitAll: public SALOME_Event
169   {
170   public:
171     TEventFitAll() {}
172     virtual void Execute()
173     {
174       SUIT_Application* app = SUIT_Session::session()->activeApplication();
175       if ( app ) {
176         SUIT_ViewWindow* window = app->desktop()->activeWindow();
177         if ( dynamic_cast<SVTK_ViewWindow*>( window ) )
178           dynamic_cast<SVTK_ViewWindow*>( window )->onFitAll();
179         else if ( dynamic_cast<OCCViewer_ViewFrame*>( window ) )
180           dynamic_cast<OCCViewer_ViewFrame*>( window )->onViewFitAll();
181       }
182     }
183   };
184     
185   ProcessVoidEvent( new TEventFitAll() );
186 }
187
188 /*!
189   \brief Erase presentation in the currently active viewer
190   \param theEntry geometry object's entry
191   \param theUpdateViewer \c true to update active view's contents
192 */
193 void GEOM_Swig::eraseGO( const char* theEntry, bool theUpdateViewer )
194 {
195   class TEvent: public SALOME_Event
196   {
197     std::string myEntry;
198     bool        myUpdateViewer;
199   public:
200     TEvent( const char* _entry, bool _update ):
201       myEntry( _entry ), myUpdateViewer( _update )
202     {}
203     virtual void Execute()
204     {
205       Handle(SALOME_InteractiveObject) io = new SALOME_InteractiveObject( myEntry.c_str(), "GEOM", "" );
206
207       GEOM_Displayer().Erase( io, true, myUpdateViewer );
208     }
209   };
210
211   ProcessVoidEvent( new TEvent( theEntry, theUpdateViewer ) );
212 }
213
214 /*!
215   \brief Update active viewer contents
216 */
217 void GEOM_Swig::UpdateViewer()
218 {
219   class TEventUpdateViewer: public SALOME_Event
220   {
221   public:
222     TEventUpdateViewer()
223     {}
224     virtual void Execute()
225     {
226       GEOM_Displayer().UpdateViewer();
227     }
228   };
229   
230   ProcessVoidEvent(new TEventUpdateViewer());
231 }
232
233 /*!
234   \brief Get sub-shape index inside main shape
235   \param theSubIOR sub-shape geometry object's IOR
236   \param theMainIOR main shape geometry object's IOR
237   \return sub-shape index (-1 in case of error)
238 */
239 int GEOM_Swig::getIndexTopology( const char* theSubIOR, const char* theMainIOR )
240 {
241   int index = -1;
242
243   // get geom engine
244   GEOM::GEOM_Gen_var aGeomGen = GeometryGUI::GetGeomGen();
245
246   // get main shape's geom object by IOR
247   CORBA::Object_var anObject = SalomeApp_Application::orb()->string_to_object( theMainIOR );
248   GEOM::GEOM_Object_var aMainShape = GEOM::GEOM_Object::_narrow( anObject.in() );
249   // get sub-shape's geom object by IOR
250   anObject = SalomeApp_Application::orb()->string_to_object( theSubIOR );
251   GEOM::GEOM_Object_var aSubShape = GEOM::GEOM_Object::_narrow( anObject.in() );
252
253   if ( !CORBA::is_nil( aGeomGen ) && !CORBA::is_nil( aMainShape ) && !CORBA::is_nil( aSubShape ) ) {
254     // get shapes operations interface
255     GEOM::GEOM_IShapesOperations_var anIShapesOperations =
256       aGeomGen->GetIShapesOperations();
257     if ( !CORBA::is_nil( anIShapesOperations ) )
258       index = anIShapesOperations->GetTopologyIndex( aMainShape, aSubShape );
259   }
260
261   return index;
262 }
263
264 /*!
265   \brief Get shape type name
266   \param theIOR geometry object's IOR
267   \return shape type name ("Shape of unknown type" in case of error)
268 */
269 const char* GEOM_Swig::getShapeTypeString( const char* theIOR )
270 {
271   QString aTypeName = "Shape of unknown type";
272
273   // get geom engine
274   GEOM::GEOM_Gen_var aGeomGen = GeometryGUI::GetGeomGen();
275
276   // get shape's geom object by IOR
277   CORBA::Object_var anObject = SalomeApp_Application::orb()->string_to_object( theIOR );
278   GEOM::GEOM_Object_var aShape = GEOM::GEOM_Object::_narrow( anObject.in() );
279
280   if ( !CORBA::is_nil( aGeomGen ) && !CORBA::is_nil( aShape ) ) {
281     // get shapes operations interface
282     GEOM::GEOM_IShapesOperations_var anIShapesOperations =
283       aGeomGen->GetIShapesOperations();
284     if ( !CORBA::is_nil( anIShapesOperations ) )
285       aTypeName = anIShapesOperations->GetShapeTypeString( aShape );
286   }
287
288   return strdup( qPrintable( aTypeName ) );
289 }
290
291 /*!
292   \brief Get shape's icon ID (specified by its type)
293   \param theIOR geometry object's IOR
294   \return icon ID ("None" in case of error)
295 */
296 const char* GEOM_Swig::getShapeTypeIcon( const char* theIOR )
297 {
298   static const char* icons[] = {
299     "ICON_OBJBROWSER_COMPOUND",
300     "ICON_OBJBROWSER_COMPSOLID",
301     "ICON_OBJBROWSER_SOLID",
302     "ICON_OBJBROWSER_SHELL",
303     "ICON_OBJBROWSER_FACE",
304     "ICON_OBJBROWSER_WIRE",
305     "ICON_OBJBROWSER_EDGE",
306     "ICON_OBJBROWSER_VERTEX"
307   };
308
309   const char* anIcon = "None";
310
311   try {
312     CORBA::Object_var anObject = SalomeApp_Application::orb()->string_to_object( theIOR );
313     if ( !CORBA::is_nil( anObject ) ) {
314       GEOM::GEOM_Object_var aShape = GEOM::GEOM_Object::_narrow( anObject.in() );
315       if ( !CORBA::is_nil( aShape ) ) {
316         GEOM::shape_type aType = aShape->GetShapeType();
317         if ( aType >= GEOM::COMPOUND && aType < GEOM::SHAPE )
318           anIcon = icons[ (int)aType ];
319       }
320     }
321   }
322   catch ( CORBA::Exception& ) {
323   }
324
325   return anIcon;
326 }
327
328 class TSetPropertyEvent: public SALOME_Event
329 {
330   QString  myEntry;
331   QString  myProperty;
332   QVariant myValue;
333   bool     myUpdateViewer;
334   
335 public:
336   TSetPropertyEvent( const QString& _entry,
337                      const QString& _property,
338                      const QVariant& _value,
339                      bool _update = true );
340   virtual void Execute();
341 };
342   
343 TSetPropertyEvent::TSetPropertyEvent( const QString& _entry,
344                                       const QString& _property,
345                                       const QVariant& _value,
346                                       bool _update ):
347   myEntry( _entry ),
348   myProperty( _property ),
349   myValue( _value ),
350   myUpdateViewer( _update )
351 {
352 }
353
354 void TSetPropertyEvent::Execute()
355 {
356   SUIT_Application* app = SUIT_Session::session()->activeApplication();
357   if ( !app ) return;
358   
359   SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
360   if ( !study ) return;
361   
362   GEOM_Displayer displayer;
363   
364   SALOME_View* window = displayer.GetActiveView();
365   if ( !window ) return;
366   
367   int mgrId = dynamic_cast<SUIT_ViewModel*>( window )->getViewManager()->getGlobalId();
368
369   study->setObjectProperty( mgrId, myEntry, myProperty, myValue );
370   
371   Handle(SALOME_InteractiveObject) io = new SALOME_InteractiveObject( myEntry.toUtf8().data(), "GEOM" );
372   if ( window->isVisible( io ) ) displayer.Redisplay( io, myUpdateViewer );
373 }
374
375 /*!
376   \brief Set display mode to the presentation
377   \param theEntry geometry object's entry
378   \param theMode display mode: 0 - wireframe, 1 - shading, 2 - shading+edges, 3-textured
379   \param theUpdateViewer \c true to update active view's contents
380 */
381 void GEOM_Swig::setDisplayMode( const char* theEntry, int theMode, bool theUpdateViewer )
382 {
383   ProcessVoidEvent( new TSetPropertyEvent( theEntry, GEOM::propertyName( GEOM::DisplayMode ), 
384                                            theMode, theUpdateViewer ) );
385 }
386
387 /*!
388   \brief Show / hide edges direction vectors for the presentation
389   \param theEntry geometry object's entry
390   \param theOn \c true to show edges direction vectors or \c false otherwise
391   \param theUpdateViewer \c true to update active view's contents
392 */
393 void GEOM_Swig::setVectorsMode( const char* theEntry, bool theOn, bool theUpdateViewer )
394 {
395   ProcessVoidEvent( new TSetPropertyEvent( theEntry, GEOM::propertyName( GEOM::EdgesDirection ), 
396                                            theOn, theUpdateViewer ) );
397 }
398
399 /*!
400   \brief Show / hide vertices for the presentation
401   \param theEntry geometry object's entry
402   \param theOn \c true to show vertices or \c false otherwise
403   \param theUpdateViewer \c true to update active view's contents
404 */
405 void GEOM_Swig::setVerticesMode( const char* theEntry, bool theOn, bool theUpdateViewer )
406 {
407   ProcessVoidEvent( new TSetPropertyEvent( theEntry, GEOM::propertyName( GEOM::Vertices ), 
408                                            theOn, theUpdateViewer ) );
409 }
410
411 /*!
412   \brief Show / hide name of shape for the presentation
413   \param theEntry geometry object's entry
414   \param theOn \c true to show name or \c false otherwise
415   \param theUpdateViewer \c true to update active view's contents
416 */
417 void GEOM_Swig::setNameMode( const char* theEntry, bool theOn, bool theUpdateViewer )
418 {
419   ProcessVoidEvent( new TSetPropertyEvent( theEntry, GEOM::propertyName( GEOM::ShowName ),
420                                            theOn, theUpdateViewer ) );
421 }
422
423 /*!
424   \brief Change color of the presentation
425   \param theEntry geometry object's entry
426   \param theRed red component of the component (0-255)
427   \param theGreen green component of the component (0-255)
428   \param theBlue blue component of the component (0-255)
429   \param theUpdateViewer \c true to update active view's contents
430 */
431 void GEOM_Swig::setColor( const char* theEntry, int theRed, int theGreen, int theBlue, bool theUpdateViewer )
432 {
433   ProcessVoidEvent( new TSetPropertyEvent( theEntry, GEOM::propertyName( GEOM::Color ), 
434                                            QColor( theRed, theGreen, theBlue ), theUpdateViewer ) );
435 }
436
437 /*!
438   \brief Set number of iso-lines to the presentation
439   \param theEntry geometry object's entry
440   \param theNbU number of iso-lines along U axis (integer value >= 0)
441   \param theNbV number of iso-lines along V axis (integer value >= 0)
442   \param theUpdateViewer \c true to update active view's contents
443 */
444 void GEOM_Swig::setIsos( const char* theEntry, int theNbU, int theNbV, bool theUpdateViewer )
445 {
446   ProcessVoidEvent( new TSetPropertyEvent( theEntry, GEOM::propertyName( GEOM::NbIsos ), 
447                                            QString( "%1%2%3" ).arg( theNbU ).arg( GEOM::subSectionSeparator() ).arg( theNbV ), 
448                                            theUpdateViewer ) );
449 }
450
451 /*!
452   \brief Set transparency of the presentation
453   \param theEntry geometry object's entry
454   \param theTransparency transparency (floating point value between 0 and 1)
455   \param theUpdateViewer \c true to update active view's contents
456 */
457 void GEOM_Swig::setTransparency( const char* theEntry, float theTransparency, bool theUpdateViewer )
458 {
459   ProcessVoidEvent( new TSetPropertyEvent( theEntry, GEOM::propertyName( GEOM::Transparency ), 
460                                            theTransparency, theUpdateViewer ) );
461 }
462
463 /*!
464   \brief Set deflection coefficient of the presentation
465   \param theEntry geometry object's entry
466   \param theDeflection deflection coefficient (floating point value)
467   \param theUpdateViewer \c true to update active view's contents
468 */
469 void GEOM_Swig::setDeflection( const char* theEntry, float theDeflection, bool theUpdateViewer )
470 {
471   ProcessVoidEvent( new TSetPropertyEvent( theEntry, GEOM::propertyName( GEOM::Deflection ), 
472                                            theDeflection, theUpdateViewer ) );
473 }
474
475 /*!
476   \brief Set material to the presentation
477   \param theEntry geometry object's entry
478   \param theMaterial material name (string)
479   \param theUpdateViewer \c true to update active view's contents
480 */
481 void GEOM_Swig::setMaterial( const char* theEntry, const char* theMaterial, bool theUpdateViewer )
482 {
483   Material_Model material;
484   material.fromResources( theMaterial );
485   ProcessVoidEvent( new TSetPropertyEvent( theEntry, GEOM::propertyName( GEOM::Material ), 
486                                            material.toProperties(), theUpdateViewer ) );
487 }
488
489 /*!
490   \brief Set material property to the presentation
491   \param theEntry geometry object's entry
492   \param theMaterial material property string
493   \param theUpdateViewer \c true to update active view's contents
494 */
495 void GEOM_Swig::setMaterialProperty( const char* theEntry, const char* theMaterial, bool theUpdateViewer )
496 {
497   ProcessVoidEvent( new TSetPropertyEvent( theEntry, GEOM::propertyName( GEOM::Material ), 
498                                            theMaterial, theUpdateViewer ) );
499 }
500
501 /*!
502   \brief initialize local subShapes selection on a given shape
503   \param theEntry geometry object's entry
504   \param theMode from enum TopAbs_ShapeEnum
505  */
506 void GEOM_Swig::initLocalSelection( const char* theEntry, int theMode)
507 {
508   class TEventInitLocalSelection: public SALOME_Event
509   {
510     std::string myEntry;
511     int myMode;
512   public:
513     TEventInitLocalSelection(const char* _entry, int _mode)
514     : myEntry(_entry), myMode(_mode)
515     {}
516     virtual void Execute()
517     {
518       if (myLocalSelector)
519         return;
520       SUIT_Application* app = SUIT_Session::session()->activeApplication();
521       if ( app )
522         {
523           //SUIT_ViewWindow* window = app->desktop()->activeWindow();
524           SUIT_ViewWindow* wnd = 0;
525           LightApp_Application* lapp = dynamic_cast<LightApp_Application*>(app);
526           if ( lapp )
527             {
528               SUIT_ViewManager* viewMgr = lapp->activeViewManager();
529               if ( viewMgr )
530                 {
531                   wnd = viewMgr->getActiveView();
532                 }
533               LightApp_SelectionMgr* mgr = lapp->selectionMgr();
534               if (!myOCCSelector)
535                 {
536                   myOCCSelector = new GEOMGUI_OCCSelector( ((OCCViewer_ViewManager*)viewMgr)->getOCCViewer(), mgr );
537                 }
538
539               QList<SUIT_Selector*> aSelectorList;
540               mgr->selectors( "OCCViewer", aSelectorList );
541               for (int i=0; i< aSelectorList.size(); ++i)
542                 {
543                   if ( LightApp_OCCSelector* aSelector = dynamic_cast<LightApp_OCCSelector*>( aSelectorList.at(i) ) )
544                     {
545                       aSelector->setEnabled(false);
546                     }
547                   if ( GEOMGUI_OCCSelector* aSelector = dynamic_cast<GEOMGUI_OCCSelector*>( aSelectorList.at(i) ) )
548                     {
549                       aSelector->setEnabled(true);
550                     }
551                 }
552               myOCCSelector->setEnabled(true);
553             }
554
555           myLocalSelector = new GEOM_Swig_LocalSelector(app->desktop(), wnd, myEntry, myMode);
556           MESSAGE("TEventInitLocalSelection myLocalSelector: " << myLocalSelector);
557         }
558     }
559   };
560
561   ProcessVoidEvent(new TEventInitLocalSelection(theEntry, theMode));
562 }
563
564 /*!
565   \brief get local subShapes selection on a given shape
566   \return a list of selected subShapes indexes
567  */
568 std::vector<int> GEOM_Swig::getLocalSelection()
569 {
570   class TEventGetLocalSelection: public SALOME_Event
571   {
572   public:
573     typedef std::vector<int> TResult;
574     TResult myResult;
575
576     TEventGetLocalSelection(){}
577
578     virtual void Execute()
579     {
580       MESSAGE("TEventGetLocalSelection myLocalSelector: " << myLocalSelector);
581       if (myLocalSelector)
582         myResult = myLocalSelector->getSelection();
583     }
584   };
585
586   std::vector<int> result = ProcessEvent(new TEventGetLocalSelection());
587   return result;
588 }
589
590
591 /*!libGEOM_Swig
592   \brief Set local subShapes selection on a given shape
593   \param ids sub-shapes ids
594  */
595 void GEOM_Swig::setLocalSelection(const std::vector<int> ids)
596 {
597   class TEventSetLocalSelection: public SALOME_Event
598   {
599   public:
600     typedef std::vector<int> TResult;
601     TResult myIds;
602     TResult myResult;
603
604     TEventSetLocalSelection(const std::vector<int> _ids) : myIds(_ids) {}
605
606     virtual void Execute()
607     {
608       MESSAGE("TEventSetLocalSelection myLocalSelector: " << myLocalSelector);
609       if (myLocalSelector)
610         myLocalSelector->setSelection(myIds);
611     }
612   };
613
614   ProcessEvent(new TEventSetLocalSelection(ids));
615 }
616
617 /*!
618   \brief close local subShapes selection on a given shape
619  */
620 void GEOM_Swig::closeLocalSelection()
621 {
622   class TEventCloseLocalSelection: public SALOME_Event
623   {
624   public:
625     TEventCloseLocalSelection()
626     {}
627     virtual void Execute()
628     {
629       MESSAGE("TEventCloseLocalSelection myLocalSelector: " << myLocalSelector);
630       if (myLocalSelector)
631         {
632           delete myLocalSelector;
633           myLocalSelector = 0;
634         }
635     }
636   };
637
638   ProcessVoidEvent(new TEventCloseLocalSelection());
639 }
640
641 class TInitGeomGenEvent: public SALOME_Event
642 {
643 public:
644   typedef bool TResult;
645   TResult myResult;
646   TInitGeomGenEvent() : myResult(false)
647   {}
648   virtual void Execute()
649   {
650     myResult = GeometryGUI::InitGeomGen();
651   }
652 };
653
654 /*!
655   \brief Initialize GEOM module's engine
656   \return \c true if initialization succeeds or \c false otherwise
657 */
658 bool GEOM_Swig::initGeomGen()
659 {
660   return ProcessEvent( new TInitGeomGenEvent() );
661 }