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