Salome HOME
Merge branch 'oscar/imps_2017'
[modules/gui.git] / src / SOCC / SOCC_ViewModel.cxx
1 // Copyright (C) 2007-2016  CEA/DEN, EDF R&D, 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
23 #include "SOCC_ViewModel.h"
24
25 #include "SOCC_Prs.h"
26 #include "SOCC_ViewWindow.h"
27
28 #include "SUIT_Session.h"
29 #include "SUIT_ResourceMgr.h"
30 //#include "SUIT_Application.h"
31
32 //#include "ToolsGUI.h"
33
34 // Temporarily commented to avoid awful dependecy on SALOMEDS
35 // TODO: better mechanism of storing display/erse status in a study
36 // should be provided...
37 //#include <SALOMEconfig.h>
38 //#include CORBA_CLIENT_HEADER(SALOMEDS)
39
40 #include <AIS_ListIteratorOfListOfInteractive.hxx>
41
42 #include <SALOME_AISShape.hxx>
43 #include <SALOME_AISObject.hxx>
44 #include <SALOME_InteractiveObject.hxx>
45 #include <SALOME_ListIO.hxx>
46
47 // Temporarily commented to avoid awful dependecy on SALOMEDS
48 // TODO: better mechanism of storing display/erse status in a study
49 // should be provided...
50 //#include <Utils_ORB_INIT.hxx>
51 //#include <Utils_SINGLETON.hxx>
52 //#include <SALOME_ModuleCatalog_impl.hxx>
53 //#include <SALOME_NamingService.hxx>
54
55 //#include "SALOMEDSClient.hxx"
56 //#include "SALOMEDS_StudyManager.hxx"
57
58 #include <AIS_TypeOfIso.hxx>
59 #include <Precision.hxx>
60
61 #include <algorithm>
62
63 // in order NOT TO link with SalomeApp, here the code returns SALOMEDS_Study.
64 // SalomeApp_Study::studyDS() does it as well, but -- here it is retrieved from 
65 // SALOMEDS::StudyManager - no linkage with SalomeApp. 
66
67 // Temporarily commented to avoid awful dependecy on SALOMEDS
68 // TODO: better mechanism of storing display/erse status in a study
69 // should be provided...
70 //static _PTR(Study) getStudyDS() 
71 //{
72 //  SALOMEDSClient_Study* aStudy = NULL;
73 //  _PTR(StudyManager) aMgr( new SALOMEDS_StudyManager() );
74
75   // get id of SUIT_Study, if it's a SalomeApp_Study, it will return
76   //    id of its underlying SALOMEDS::Study
77 //  SUIT_Application* app = SUIT_Session::session()->activeApplication();
78 //  if ( !app )  return _PTR(Study)(aStudy);
79 //  SUIT_Study* stud = app->activeStudy();
80 //  if ( !stud ) return _PTR(Study)(aStudy);  
81 //  const int id = stud->id(); // virtual method, must return SALOMEDS_Study id
82   // get SALOMEDS_Study with this id from StudyMgr
83 //  return aMgr->GetStudyByID( id );
84 //}
85
86 /*!
87   Constructor
88   \param DisplayTrihedron - is trihedron displayed
89 */
90 SOCC_Viewer::SOCC_Viewer( bool DisplayTrihedron )
91 : OCCViewer_Viewer( DisplayTrihedron )
92 {
93 }
94
95 /*!
96   Destructor
97 */
98 SOCC_Viewer::~SOCC_Viewer()
99 {
100 }
101
102 /*!
103   Hilights/unhilights object in viewer
104   \param obj - object to be updated
105   \param hilight - if it is true, object will be hilighted, otherwise it will be unhilighted
106   \param update - update current viewer
107 */
108 bool SOCC_Viewer::highlight( const Handle(SALOME_InteractiveObject)& obj,
109                              bool hilight, bool upd )
110 {
111   bool isInLocal = getAISContext()->HasOpenedContext();
112   //SUIT_Study* ActiveStudy = SUIT_Application::getDesktop()->getActiveStudy();
113   //SALOME_Selection* Sel = SALOME_Selection::Selection( ActiveStudy->getSelection() );
114
115   AIS_ListOfInteractive List;
116   getAISContext()->DisplayedObjects(List);
117   
118   AIS_ListIteratorOfListOfInteractive ite(List);
119   for ( ; ite.More(); ite.Next() )
120   {
121     Handle(SALOME_InteractiveObject) anObj =
122       Handle(SALOME_InteractiveObject)::DownCast( ite.Value()->GetOwner() );
123
124     if ( !anObj.IsNull() && anObj->hasEntry() && anObj->isSame( obj ) )
125     {
126       if ( !isInLocal )
127           OCCViewer_Viewer::highlight( ite.Value(), hilight, false );
128       // highlight sub-shapes only when local selection is active
129       else
130       {
131         /*if ( ite.Value()->IsKind( STANDARD_TYPE( SALOME_AISShape ) ) )
132         {
133           Handle(SALOME_AISShape) aSh = Handle(SALOME_AISShape)::DownCast( ite.Value() );
134           TColStd_IndexedMapOfInteger MapIndex;
135           Sel->GetIndex( IObject, MapIndex );
136           aSh->highlightSubShapes( MapIndex, highlight );
137         }*/
138       }
139       break;
140     }
141   }
142     
143   if( upd )
144     update();
145     
146   return false;
147 }
148
149 /*!
150   \return true if object is in viewer or in collector
151   \param obj - object to be checked
152   \param onlyInViewer - search object only in viewer (so object must be displayed)
153 */
154 bool SOCC_Viewer::isInViewer( const Handle(SALOME_InteractiveObject)& obj,
155                               bool onlyInViewer )
156 {
157   AIS_ListOfInteractive List;
158   getAISContext()->DisplayedObjects(List);
159   AIS_ListIteratorOfListOfInteractive ite(List);
160   for ( ; ite.More(); ite.Next() )
161   {
162     Handle(SALOME_InteractiveObject) anObj =
163         Handle(SALOME_InteractiveObject)::DownCast( ite.Value()->GetOwner() );
164
165     if ( !anObj.IsNull() && anObj->hasEntry() && anObj->isSame( obj ) )
166       return true;
167   }
168   return false;
169 }
170
171 /*!
172   \return true if object is displayed in viewer
173   \param obj - object to be checked
174 */
175 bool SOCC_Viewer::isVisible( const Handle(SALOME_InteractiveObject)& obj )
176 {
177
178   std::map< std::string , std::vector<Handle(AIS_InteractiveObject)> >::iterator it=entry2aisobjects.find(obj->getEntry());
179   if(it != entry2aisobjects.end())
180     {
181       // get context
182       Handle (AIS_InteractiveContext) ic = getAISContext();
183       std::vector<Handle(AIS_InteractiveObject)>& List = it->second;
184       for( unsigned int ind = 0; ind < List.size(); ind++ )
185         {
186           Handle(AIS_InteractiveObject) anAIS=List[ind];
187           if(ic->IsDisplayed(anAIS))
188             return true;
189         }
190   }
191   
192   return false;
193 }
194
195 /*!
196   Sets color of object
197   \param obj - object to be updated
198   \param color - new color
199   \param update - update current viewer
200 */
201 void SOCC_Viewer::setColor( const Handle(SALOME_InteractiveObject)& obj,
202                             const QColor& color, bool update )
203 {
204   if(obj.IsNull() || !obj->hasEntry() )
205     return;
206
207   if(entry2aisobjects.count(obj->getEntry())>0)
208     {
209       // get context
210       Handle (AIS_InteractiveContext) ic = getAISContext();
211       std::vector<Handle(AIS_InteractiveObject)>& List = entry2aisobjects[obj->getEntry()];
212       for( unsigned int ind = 0; ind < List.size(); ind++ )
213         {
214           Handle(AIS_InteractiveObject) anAIS=List[ind];
215           if( !anAIS.IsNull() && ic->IsDisplayed(anAIS))
216             OCCViewer_Viewer::setColor( anAIS, color, update );
217         }
218     }
219 }
220
221 /*!
222   Changes display mode of object
223   \param obj - object to be processed
224   \param mode - new display mode
225   \param update - update current viewer
226 */
227 void SOCC_Viewer::switchRepresentation( const Handle(SALOME_InteractiveObject)& obj,
228                                         int mode, bool update )
229 {
230   if(obj.IsNull() || !obj->hasEntry() )
231     return;
232
233   if(entry2aisobjects.count(obj->getEntry())>0)
234     {
235       // get context
236       Handle (AIS_InteractiveContext) ic = getAISContext();
237       std::vector<Handle(AIS_InteractiveObject)>& List = entry2aisobjects[obj->getEntry()];
238       for( unsigned int ind = 0; ind < List.size(); ind++ )
239         {
240           Handle(AIS_InteractiveObject) anAIS=List[ind];
241           if( !anAIS.IsNull() && ic->IsDisplayed(anAIS))
242             OCCViewer_Viewer::switchRepresentation( anAIS, mode, update );
243         }
244     }
245 }
246
247 /*!
248   Changes transparency of object
249   \param obj - object to be processed
250   \param trans - new transparency
251   \param update - update current viewer
252 */
253 void SOCC_Viewer::setTransparency( const Handle(SALOME_InteractiveObject)& obj,
254                                    float trans, bool update )
255 {
256   if(obj.IsNull() || !obj->hasEntry() )
257     return;
258
259   if(entry2aisobjects.count(obj->getEntry())>0)
260     {
261       // get context
262       Handle (AIS_InteractiveContext) ic = getAISContext();
263       std::vector<Handle(AIS_InteractiveObject)>& List = entry2aisobjects[obj->getEntry()];
264       for( unsigned int ind = 0; ind < List.size(); ind++ )
265         {
266           Handle(AIS_InteractiveObject) anAIS=List[ind];
267           if( !anAIS.IsNull() && ic->IsDisplayed(anAIS))
268             OCCViewer_Viewer::setTransparency( anAIS, trans, update );
269         }
270     }
271 }
272
273 /*!
274   Changes name of object
275   \param obj - object to be renamed
276   \param name - new name
277 */
278 void SOCC_Viewer::rename( const Handle(SALOME_InteractiveObject)& obj,
279                           const QString& name )
280 {
281   AIS_ListOfInteractive List;
282   getAISContext()->DisplayedObjects(List);
283   
284   AIS_ListIteratorOfListOfInteractive ite(List);
285   while (ite.More())
286   {
287     if (ite.Value()->IsKind(STANDARD_TYPE(SALOME_AISShape)))
288     {
289       Handle(SALOME_AISShape) aSh = Handle(SALOME_AISShape)::DownCast(ite.Value());
290       
291       if ( aSh->hasIO() )
292       {
293         Handle(SALOME_InteractiveObject) IO = aSh->getIO();
294         if ( IO->isSame( obj ) )
295         {
296           aSh->setName( name.toLatin1().data() );
297           break;
298         }
299       }
300     }
301     else if ( ite.Value()->IsKind( STANDARD_TYPE( SALOME_AISObject ) ) )
302     {
303       Handle(SALOME_AISObject) aSh = Handle(SALOME_AISObject)::DownCast( ite.Value() );
304
305       // Add code here, if someone create a MODULE_AISObject.
306     }
307     ite.Next();
308   }
309 }
310
311
312 /*!
313   Display presentation
314   \param prs - presentation
315 */
316 void SOCC_Viewer::Display( const SALOME_OCCPrs* prs )
317 {
318   // try do downcast object
319   const SOCC_Prs* anOCCPrs = dynamic_cast<const SOCC_Prs*>( prs );
320   if ( !anOCCPrs || anOCCPrs->IsNull() )
321     return;
322
323   // get SALOMEDS Study
324   // Temporarily commented to avoid awful dependecy on SALOMEDS
325   // TODO: better mechanism of storing display/erse status in a study
326   // should be provided...
327   //  _PTR(Study) study(getStudyDS());
328
329   // get context
330   Handle (AIS_InteractiveContext) ic = getAISContext();
331
332   // get objects to be displayed
333   AIS_ListOfInteractive anAISObjects;
334   anOCCPrs->GetObjects( anAISObjects );
335
336   AIS_ListIteratorOfListOfInteractive aIter( anAISObjects );
337   for ( ; aIter.More(); aIter.Next() )
338   {
339     Handle(AIS_InteractiveObject) anAIS = aIter.Value();
340     if ( !anAIS.IsNull() )
341     {
342       // try to find presentation in the viewer
343
344       // if the object is already displayed - nothing to do more
345       if(ic->IsDisplayed(anAIS))
346         {
347           // Deactivate object if necessary
348           if ( !anOCCPrs->ToActivate() )
349             ic->Deactivate( anAIS );
350           continue;
351         }
352
353       // if object is not displayed and not found in the collector - display it
354       if ( anAIS->IsKind( STANDARD_TYPE(AIS_Trihedron) ) )
355       {
356         Handle(AIS_Trihedron) aTrh = Handle(AIS_Trihedron)::DownCast( anAIS );
357         double aNewSize = 100, aSize = 100;
358         computeTrihedronSize( aNewSize, aSize );
359         aTrh->SetSize( aTrh == getTrihedron() ? aNewSize : 0.5 * aNewSize );
360       }
361
362       ic->Display( anAIS, false );
363       Handle(SALOME_AISShape) aSh = Handle(SALOME_AISShape)::DownCast (anAIS);
364       if (!aSh.IsNull())
365       {
366         aSh->SetClippable (prs->IsClippable());
367         applyExistingClipPlanesToObject (anAIS);
368         bool top = (aSh->isTopLevel() && aSh->switchTopLevel());
369               ic->SetZLayer( aSh, top ? getTopLayerId() : 0 );
370                     if(!aSh->toActivate())
371         {
372                             ic->Deactivate( aSh );
373                     }
374       }
375
376       //Register anAIS (if it has an entry) in entry2aisobjects map
377       Handle(SALOME_InteractiveObject) anObj = Handle(SALOME_InteractiveObject)::DownCast( anAIS->GetOwner() );
378       if ( !anObj.IsNull() && anObj->hasEntry())
379         {
380           std::vector<Handle(AIS_InteractiveObject)>& List = entry2aisobjects[anObj->getEntry()];
381           int found=0;
382           for ( unsigned int ind = 0; ind < List.size(); ind++ )
383           {
384             if(List[ind] == anAIS)
385               {
386                 found=1;
387                 break;
388               }
389           }
390           if(!found)
391             {
392               List.push_back(anAIS);
393             }
394         }
395
396       // Set visibility flag
397       // Temporarily commented to avoid awful dependecy on SALOMEDS
398       // TODO: better mechanism of storing display/erse status in a study
399       // should be provided...
400       //Handle(SALOME_InteractiveObject) anObj =
401       //  Handle(SALOME_InteractiveObject)::DownCast( anAIS->GetOwner() );
402       //if ( !anObj.IsNull() && anObj->hasEntry() )
403       //{
404       //  if ( study  )
405       //    ToolsGUI::SetVisibility( study, anObj->getEntry(), true, this );
406       //}
407
408       // Deactivate object if necessary
409       if ( !anOCCPrs->ToActivate() )
410         ic->Deactivate( anAIS );
411     }
412   }
413   updateTrihedron();
414 }
415
416
417 /*!
418   Erase presentation
419   \param prs - presentation
420   \param forced - removes object from context
421 */
422 void SOCC_Viewer::Erase( const SALOME_OCCPrs* prs, const bool forced )
423 {
424   // try do downcast object
425   const SOCC_Prs* anOCCPrs = dynamic_cast<const SOCC_Prs*>( prs );
426   if ( !anOCCPrs || anOCCPrs->IsNull() )
427     return;
428
429   // get SALOMEDS Study
430   // Temporarily commented to avoid awful dependecy on SALOMEDS
431   // TODO: better mechanism of storing display/erse status in a study
432   // should be provided...
433   //  _PTR(Study) study(getStudyDS());
434
435   // get context
436   Handle(AIS_InteractiveContext) ic = getAISContext();
437
438   // get objects to be erased
439   AIS_ListOfInteractive anAISObjects;
440   anOCCPrs->GetObjects( anAISObjects );
441
442   AIS_ListIteratorOfListOfInteractive aIter( anAISObjects );
443   for ( ; aIter.More(); aIter.Next() ) {
444     Handle(AIS_InteractiveObject) anAIS = aIter.Value();
445     if ( !anAIS.IsNull() ) {
446       // erase the object from context : move it to collector
447       ic->Erase( anAIS, false );
448       // Set visibility flag if necessary
449       // Temporarily commented to avoid awful dependecy on SALOMEDS
450       // TODO: better mechanism of storing display/erse status in a study
451       // should be provided...
452       //if ( !forced )
453       //{
454       //  Handle(SALOME_InteractiveObject) anObj =
455       //    Handle(SALOME_InteractiveObject)::DownCast( anAIS->GetOwner() );
456       //  if ( !anObj.IsNull() && anObj->hasEntry() )
457       //  {
458       //  if ( study )
459       //    ToolsGUI::SetVisibility( study, anObj->getEntry(), true, this );
460       //  }
461       //}
462     }
463   }
464   updateTrihedron();
465 }
466
467
468 /*!
469   Erase all presentations
470   \param forced - removes all objects from context
471 */
472 void SOCC_Viewer::EraseAll( SALOME_Displayer* d, const bool forced )
473 {
474   // get SALOMEDS Study
475   // Temporarily commented to avoid awful dependecy on SALOMEDS
476   // TODO: better mechanism of storing display/erse status in a study
477   // should be provided...
478   //  _PTR(Study) study(getStudyDS());
479
480   // get context
481   Handle(AIS_InteractiveContext) ic = getAISContext();
482
483   // check if trihedron is displayed
484   Standard_Boolean isTrihedronDisplayed = ic->IsDisplayed( getTrihedron() );
485
486   // get objects to be erased (all currently displayed objects)
487   AIS_ListOfInteractive aList;
488   ic->DisplayedObjects( aList );
489   AIS_ListIteratorOfListOfInteractive anIter( aList );
490   for ( ; anIter.More(); anIter.Next() ) {
491     if ( (isTrihedronDisplayed && anIter.Value()->DynamicType() == STANDARD_TYPE( AIS_Trihedron ) ) )
492       continue;
493
494     // erase an object
495     Handle(AIS_InteractiveObject) anIO = anIter.Value();
496     ic->Erase( anIO, false );
497     
498     // Set visibility flag if necessary
499     // Temporarily commented to avoid awful dependecy on SALOMEDS
500     // TODO: better mechanism of storing display/erse status in a study
501     // should be provided...
502     //if ( !forced ) {
503     //  Handle(SALOME_InteractiveObject) anObj =
504     //  Handle(SALOME_InteractiveObject)::DownCast( anIO->GetOwner() );
505
506     //  if ( !anObj.IsNull() && anObj->hasEntry() ) {
507     //  if ( study )
508     //    ToolsGUI::SetVisibility( study, anObj->getEntry(), true, this );
509     //  }
510     //}
511   }
512
513   SALOME_View::EraseAll( d, forced );
514
515   Repaint();
516   updateTrihedron();
517 }
518
519 /*!
520   Create presentation corresponding to the entry
521   \param entry - entry
522 */
523 SALOME_Prs* SOCC_Viewer::CreatePrs( const char* entry )
524 {
525   SOCC_Prs* prs = new SOCC_Prs(entry);
526   if ( entry )
527   {
528     if(entry2aisobjects.count(entry)>0)
529       {
530         //ais object exists
531         std::vector<Handle(AIS_InteractiveObject)> List = entry2aisobjects[entry];
532         // get context
533         Handle(AIS_InteractiveContext) ic = getAISContext();
534         //add all ais
535         for ( unsigned int ind = 0; ind < List.size(); ind++ )
536           {
537             Handle(AIS_InteractiveObject) anAIS=List[ind];
538             if(ic->IsDisplayed(anAIS))
539               {
540                 prs->AddObject( anAIS );
541               }
542           }
543       }
544   }
545   return prs;
546 }
547
548 /*!
549   Activates selection of sub-shapes
550 */
551 void SOCC_Viewer::LocalSelection( const SALOME_OCCPrs* thePrs, const std::list<int> modes )
552 {
553   Handle(AIS_InteractiveContext) ic = getAISContext();
554   
555   const SOCC_Prs* anOCCPrs = dynamic_cast<const SOCC_Prs*>( thePrs );
556   if ( ic.IsNull() )
557     return;
558   
559   // Open local context if there is no one
560   bool allObjects = thePrs == 0 || thePrs->IsNull();
561   if ( !ic->HasOpenedContext() ) {
562     ic->ClearCurrents( false );
563     ic->OpenLocalContext( Standard_False, Standard_True, Standard_True );
564   }
565
566   AIS_ListOfInteractive anObjs;
567   // Get objects to be activated
568   if ( allObjects ) 
569     ic->DisplayedObjects( anObjs );
570   else
571     anOCCPrs->GetObjects( anObjs );
572
573   std::list<int> sel_modes;
574   for ( int i = TopAbs_COMPOUND; i < TopAbs_SHAPE; i++ )
575     if ( std::find(modes.begin(), modes.end(), (int)TopAbs_SHAPE) != modes.end() || std::find(modes.begin(), modes.end(), i) != modes.end())
576       sel_modes.push_back(i);
577
578   // Activate selection of objects from prs
579   AIS_ListIteratorOfListOfInteractive aIter( anObjs );
580   for ( ; aIter.More(); aIter.Next() ) {
581     Handle(AIS_InteractiveObject) anAIS = aIter.Value();
582     if ( !anAIS.IsNull() )
583     {
584       std::list<int>::const_iterator it;
585       if ( anAIS->IsKind( STANDARD_TYPE( AIS_Shape ) ) )
586       {
587         ic->Load( anAIS, -1, false );
588         for( it = sel_modes.begin(); it != sel_modes.end(); ++it )
589           ic->Activate( anAIS, AIS_Shape::SelectionMode( (TopAbs_ShapeEnum)*it ) );
590       }
591       else if ( anAIS->DynamicType() != STANDARD_TYPE(AIS_Trihedron) )
592       {
593         ic->Load( anAIS, -1, false );
594         for( it = sel_modes.begin(); it != sel_modes.end(); ++it )
595           ic->Activate( anAIS, *it );
596       }
597     }
598   }
599 }
600
601 /*!
602   Activates selection of sub-shapes
603 */
604 void SOCC_Viewer::LocalSelection( const SALOME_OCCPrs* thePrs, const int theMode )
605 {
606   std::list<int> modes;
607   modes.push_back( theMode );
608   LocalSelection( thePrs, modes );
609 }
610
611 /*!
612   Deactivates selection of sub-shapes
613 */
614 void SOCC_Viewer::GlobalSelection( const bool update ) const
615 {
616   Handle(AIS_InteractiveContext) ic = getAISContext();
617   if ( !ic.IsNull() )
618   {
619     ic->CloseAllContexts( false );
620     if ( update )
621       ic->CurrentViewer()->Redraw();
622   }
623 }
624
625
626 /*!
627   \Collect objects visible in viewer
628   \param theList - visible objects collection
629 */
630 void SOCC_Viewer::GetVisible( SALOME_ListIO& theList )
631 {
632   AIS_ListOfInteractive List;
633   getAISContext()->DisplayedObjects(List);
634   
635   AIS_ListIteratorOfListOfInteractive ite(List);
636   for ( ; ite.More(); ite.Next() )
637   {
638     Handle(SALOME_InteractiveObject) anObj =
639         Handle(SALOME_InteractiveObject)::DownCast( ite.Value()->GetOwner() );
640
641     if ( !anObj.IsNull() && anObj->hasEntry() )
642       theList.Append( anObj );
643   }
644 }
645
646 /*!
647   Updates current viewer
648 */
649 void SOCC_Viewer::Repaint()
650 {
651 //  onAdjustTrihedron();
652   getViewer3d()->Update();
653 }
654
655
656 /*!
657   create SOCC_ViewWindow
658 */
659 /*SUIT_ViewWindow* SOCC_Viewer::createView( SUIT_Desktop* theDesktop )
660 {
661   SOCC_ViewWindow* view = new SOCC_ViewWindow(theDesktop, this);
662   //initView( view );
663   initView( view->getView(OCCViewer_ViewFrame::MAIN_VIEW) );
664   return view;
665   }*/
666
667 /* 
668  * Returns a new OCCViewer_ViewWindow instance which will be placed as a sub window in ViewFrame
669  */
670 OCCViewer_ViewWindow* SOCC_Viewer::createSubWindow()
671 {
672   return new SOCC_ViewWindow( 0,  this);
673 }