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