]> SALOME platform Git repositories - modules/visu.git/blob - src/OBJECT/VISU_ScalarMapAct.cxx
Salome HOME
untabify
[modules/visu.git] / src / OBJECT / VISU_ScalarMapAct.cxx
1 //  Copyright (C) 2007-2008  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.
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 //  VISU OBJECT : interactive object for VISU entities implementation
23 //  File   : VISU_MeshAct.hxx
24 //  Author : Laurent CORNABE with the help of Nicolas REJNERI
25 //  Module : VISU
26 //  $Header$
27 //
28 #include "VISU_ScalarMapAct.h"
29 #include "VISU_LookupTable.hxx"
30 #include "VISU_ScalarBarActor.hxx"
31 #include "VISU_PipeLine.hxx"
32
33 #include "VISU_OpenGLPointSpriteMapper.hxx"
34 #include "VISU_GaussPtsDeviceActor.h"
35 #include "VISU_DeformedShapePL.hxx"
36 #include "VISU_PipeLineUtils.hxx"
37
38
39 #include <SUIT_ResourceMgr.h>
40 #include <SUIT_Session.h>
41
42 #include <SALOME_ExtractGeometry.h>
43 #include <SALOME_ExtractPolyDataGeometry.h>
44
45 #include <vtkObjectFactory.h>
46 #include <vtkRenderer.h>
47 #include <vtkProperty.h>
48 #include <vtkMatrix4x4.h>
49 #include <vtkMapper.h>
50 #include <vtkDataSetMapper.h>
51
52 #include <vtkRenderWindowInteractor.h>
53 #include <vtkCallbackCommand.h>
54 #include <vtkRenderWindow.h>
55 #include <vtkImageData.h>
56
57
58 //============================================================================
59 class VISU_PointsDeviceActor: public VISU_GaussDeviceActorBase
60 {
61  public:
62   vtkTypeMacro(VISU_PointsDeviceActor, VISU_GaussDeviceActorBase);
63
64   static 
65   VISU_PointsDeviceActor* 
66   New();
67  
68
69   //----------------------------------------------------------------------------
70   virtual
71   void
72   SetInput(vtkDataSet* theDataSet)
73   {
74     myGeomFilter->SetInput( theDataSet );
75   }
76
77
78   //----------------------------------------------------------------------------
79   void
80   SetInteractor(vtkRenderWindowInteractor* theInteractor)
81   {
82     if(theInteractor == myInteractor)
83       return;
84
85     if(myInteractor)
86       myInteractor->RemoveObserver(myEventCallbackCommand);
87     
88     if(theInteractor)
89       theInteractor->AddObserver(vtkCommand::CharEvent, 
90                                  myEventCallbackCommand, 
91                                  0.0);
92
93     myInteractor = theInteractor;
94   }
95
96
97   //----------------------------------------------------------------------------
98   void
99   DoMapperShallowCopy( vtkMapper* theMapper,
100                        bool theIsCopyInput )
101   {
102     Superclass::DoMapperShallowCopy( theMapper, theIsCopyInput );
103
104     vtkDataSet* aDataSet = theMapper->GetInput();
105     vtkFloatingPointType aScaleFactor = VISU_DeformedShapePL::GetScaleFactor( aDataSet );
106
107     GetPointSpriteMapper()->SetAverageCellSize( aScaleFactor );
108   }
109
110
111   //----------------------------------------------------------------------------
112   void
113   DeepCopy( VISU_PointsDeviceActor *theActor )
114   {
115     VISU::CopyPointSpriteDataMapper( GetPointSpriteMapper(), theActor->GetPointSpriteMapper(), false );
116   }
117
118  protected:
119   //----------------------------------------------------------------------------
120   VISU_PointsDeviceActor():
121     myGeomFilter( VTKViewer_GeometryFilter::New() ),
122     myEventCallbackCommand( vtkCallbackCommand::New() ),
123     myInteractor( NULL )
124   {
125     myGeomFilter->SetInside(true);
126
127     VISU_OpenGLPointSpriteMapper* aMapper = VISU_OpenGLPointSpriteMapper::New();
128     aMapper->SetInput( myGeomFilter->GetOutput() );
129
130     std::string aRootDir( getenv( "VISU_ROOT_DIR") );
131     std::string aMainTexture = aRootDir + "/share/salome/resources/visu/sprite_texture.bmp";
132     std::string anAlphaTexture = aRootDir + "/share/salome/resources/visu/sprite_alpha.bmp";
133     VISU::TTextureValue aTextureValue = VISU::GetTexture( aMainTexture, anAlphaTexture );
134     aMapper->SetImageData( aTextureValue.GetPointer() );
135
136     aMapper->SetUseLookupTableScalarRange(true);
137     aMapper->SetColorModeToMapScalars();
138     aMapper->SetScalarVisibility(true);
139
140     SetPointSpriteMapper( aMapper );
141
142     aMapper->Delete();
143
144     myEventCallbackCommand->SetClientData( this );
145     myEventCallbackCommand->SetCallback( VISU_PointsDeviceActor::ProcessEvents );
146   }
147
148
149   //----------------------------------------------------------------------------
150   ~VISU_PointsDeviceActor()
151   {
152     SetInteractor( NULL );
153     myGeomFilter->Delete();
154     myEventCallbackCommand->Delete();
155   }
156
157
158   //----------------------------------------------------------------------------
159   static
160   void
161   ProcessEvents(vtkObject* theObject, 
162                 unsigned long theEvent,
163                 void* theClientData, 
164                 void* theCallData)
165   {
166     if ( VISU_PointsDeviceActor* self = reinterpret_cast<VISU_PointsDeviceActor*>( theClientData ) )
167       self->OnInteractorEvent( theEvent );
168   }
169
170
171   //----------------------------------------------------------------------------
172   void
173   OnInteractorEvent(unsigned long theEvent)
174   {
175     switch ( theEvent ) {
176     case vtkCommand::CharEvent: {
177       switch( myInteractor->GetKeyCode() ) {
178       case 'M' :
179       case 'm' : {
180         if ( !GetVisibility() )
181           return;
182
183         static vtkFloatingPointType anIncrement = 2;
184         vtkFloatingPointType aMagnification = GetPointSpriteMapper()->GetPointSpriteMagnification();
185         vtkFloatingPointType coefficient = myInteractor->GetShiftKey() ? anIncrement : 1 / anIncrement;
186
187         GetPointSpriteMapper()->SetPointSpriteMagnification( aMagnification * coefficient );
188
189         myInteractor->CreateTimer(VTKI_TIMER_UPDATE);
190         break;
191       }
192       default:
193         return;
194       }
195       break;
196     }
197     default:
198       return;
199     }
200   }
201
202
203   //----------------------------------------------------------------------------
204   vtkCallbackCommand* myEventCallbackCommand;
205   vtkRenderWindowInteractor* myInteractor;
206   VTKViewer_GeometryFilter* myGeomFilter;
207
208  private:
209   VISU_PointsDeviceActor(const VISU_PointsDeviceActor&); // Not implemented
210   void operator=(const VISU_PointsDeviceActor&); // Not implemented
211 };
212
213 vtkStandardNewMacro(VISU_PointsDeviceActor);
214
215 //----------------------------------------------------------------------------
216 vtkStandardNewMacro(VISU_ScalarMapAct);
217 static vtkFloatingPointType EPS = 1.0 / VTK_LARGE_FLOAT;
218
219 //----------------------------------------------------------------------------
220 VISU_ScalarMapAct
221 ::VISU_ScalarMapAct()
222 {
223   myScalarBar = VISU_ScalarBarActor::New();
224
225   vtkProperty* aProperty = GetProperty();
226   aProperty->SetAmbient(1.0); 
227   aProperty->SetDiffuse(0.0);
228   aProperty->SetSpecular(0.0);
229   
230   myProperty->DeepCopy(aProperty);
231
232   vtkMatrix4x4 *aMatrix = vtkMatrix4x4::New();
233
234   mySurfaceActor= SVTK_DeviceActor::New();
235   mySurfaceActor->SetRepresentation(SVTK::Representation::Surface);
236   mySurfaceActor->SetProperty(aProperty);
237   mySurfaceActor->SetUserMatrix(aMatrix);
238
239   myEdgeActor = SVTK_DeviceActor::New();
240   myEdgeActor->SetRepresentation(SVTK::Representation::Wireframe);
241   myEdgeActor->SetUserMatrix(aMatrix);
242   myEdgeActor->GetProperty()->SetColor(255.,255.,255.);
243
244   myPointsActor = VISU_PointsDeviceActor::New();
245   myPointsActor->SetProperty(aProperty);
246   myPointsActor->SetUserMatrix(aMatrix);
247
248   aMatrix->Delete();
249
250   SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
251   //Quadratic 2D elements representation
252   if(aResourceMgr) {
253     //----------------------------------------------------------------------------
254     int aQuadraticAngle = aResourceMgr->integerValue( "VISU", "max_angle", 2);
255     mySurfaceActor->SetQuadraticArcAngle(aQuadraticAngle);
256     myEdgeActor->SetQuadraticArcAngle(aQuadraticAngle);
257
258     int anElem0DSize = aResourceMgr->integerValue( "VISU", "elem0d_size", 5);
259     mySurfaceActor->GetProperty()->SetPointSize(anElem0DSize);
260   }
261 }
262
263 //----------------------------------------------------------------------------
264 VISU_ScalarMapAct
265 ::~VISU_ScalarMapAct()
266 {
267   myScalarBar->Delete();
268
269   myPointsActor->Delete();
270
271   mySurfaceActor->Delete();
272   myEdgeActor->Delete();
273 }
274
275 void
276 VISU_ScalarMapAct
277 ::ShallowCopyPL(VISU_PipeLine* thePipeLine)
278 {
279   VISU_DataSetActor::ShallowCopyPL( thePipeLine );
280
281   myEdgeActor->GetMapper()->ScalarVisibilityOff();
282
283   myPointsActor->DoMapperShallowCopy( thePipeLine->GetMapper(), false );
284
285   VISU::CopyMapper( mySurfaceActor->GetMapper(), thePipeLine->GetMapper(), false );
286 }
287
288 //----------------------------------------------------------------------------
289 void
290 VISU_ScalarMapAct
291 ::SetMapperInput(vtkDataSet* theDataSet)
292 {
293   Superclass::SetMapperInput( theDataSet );
294
295 //    myPointsActor->SetInput( theDataSet );
296 //    mySurfaceActor->SetInput( theDataSet );
297 //    myEdgeActor->SetInput( theDataSet );
298
299   if (theDataSet->IsA("vtkPolyData")) {
300     myPointsActor->SetInput( myPolyDataExtractor->GetOutput() );
301     mySurfaceActor->SetInput( myPolyDataExtractor->GetOutput() );
302     myEdgeActor->SetInput( myPolyDataExtractor->GetOutput() );
303   } else {
304     myPointsActor->SetInput( myExtractor->GetOutput() );
305     mySurfaceActor->SetInput( myExtractor->GetOutput() );
306     myEdgeActor->SetInput( myExtractor->GetOutput() );
307   }
308 }
309
310 //----------------------------------------------------------------------------
311 void
312 VISU_ScalarMapAct
313 ::SetTransform(VTKViewer_Transform* theTransform)
314 {
315   Superclass::SetTransform(theTransform);
316
317   myPointsActor->SetTransform(theTransform);
318
319   mySurfaceActor->SetTransform(theTransform);
320   myEdgeActor->SetTransform(theTransform);
321 }
322
323 //----------------------------------------------------------------------------
324 vtkProperty* 
325 VISU_ScalarMapAct
326 ::GetEdgeProperty()
327 {
328   return myEdgeActor->GetProperty();
329 }
330
331 //----------------------------------------------------------------------------
332 void
333 VISU_ScalarMapAct
334 ::SetShrinkable(bool theIsShrinkable)
335 {
336   Superclass::SetShrinkable(theIsShrinkable);
337
338   mySurfaceActor->SetShrinkable(theIsShrinkable);
339 }
340
341 void
342 VISU_ScalarMapAct
343 ::SetShrinkFactor(vtkFloatingPointType theValue)
344 {
345   Superclass::SetShrinkFactor(theValue);
346
347   mySurfaceActor->SetShrinkFactor(theValue);
348 }
349
350 //----------------------------------------------------------------------------
351 void
352 VISU_ScalarMapAct
353 ::SetShrink()
354 {
355   if(myRepresentation == VTK_POINTS)
356     return;
357
358   Superclass::SetShrink();
359
360   mySurfaceActor->SetShrink();
361 }
362
363 void
364 VISU_ScalarMapAct
365 ::UnShrink()
366 {
367   Superclass::UnShrink();
368
369   mySurfaceActor->UnShrink();
370 }
371
372 //----------------------------------------------------------------------------
373 void
374 VISU_ScalarMapAct
375 ::SetFeatureEdgesAllowed(bool theIsFeatureEdgesAllowed)
376 {
377   Superclass::SetFeatureEdgesAllowed(theIsFeatureEdgesAllowed);
378
379   mySurfaceActor->SetFeatureEdgesAllowed(theIsFeatureEdgesAllowed);
380 }
381
382 void
383 VISU_ScalarMapAct
384 ::SetFeatureEdgesAngle(vtkFloatingPointType theValue)
385 {
386   Superclass::SetFeatureEdgesAngle(theValue);
387
388   mySurfaceActor->SetFeatureEdgesAngle(theValue);
389 }
390
391 void
392 VISU_ScalarMapAct
393 ::SetFeatureEdgesFlags(bool theIsFeatureEdges,
394                        bool theIsBoundaryEdges,
395                        bool theIsManifoldEdges,
396                        bool theIsNonManifoldEdges)
397 {
398   Superclass::SetFeatureEdgesFlags(theIsFeatureEdges,
399                                    theIsBoundaryEdges,
400                                    theIsManifoldEdges,
401                                    theIsNonManifoldEdges);
402
403   mySurfaceActor->SetFeatureEdgesFlags(theIsFeatureEdges,
404                                        theIsBoundaryEdges,
405                                        theIsManifoldEdges,
406                                        theIsNonManifoldEdges);
407 }
408
409 void
410 VISU_ScalarMapAct
411 ::SetFeatureEdgesColoring(bool theIsColoring)
412 {
413   Superclass::SetFeatureEdgesColoring(theIsColoring);
414
415   mySurfaceActor->SetFeatureEdgesColoring(theIsColoring);
416 }
417
418 //----------------------------------------------------------------------------
419 void
420 VISU_ScalarMapAct
421 ::SetFeatureEdgesEnabled(bool theIsFeatureEdgesEnabled)
422 {
423   if(theIsFeatureEdgesEnabled && myRepresentation == VTK_POINTS)
424     return;
425
426   Superclass::SetFeatureEdgesEnabled(theIsFeatureEdgesEnabled);
427
428   mySurfaceActor->SetFeatureEdgesEnabled(theIsFeatureEdgesEnabled);
429 }
430
431 //----------------------------------------------------------------------------
432 void
433 VISU_ScalarMapAct
434 ::SetOpacity(vtkFloatingPointType theValue)
435 {
436   mySurfaceActor->GetProperty()->SetOpacity(theValue);
437 }
438
439 vtkFloatingPointType
440 VISU_ScalarMapAct
441 ::GetOpacity()
442 {
443   return mySurfaceActor->GetProperty()->GetOpacity();
444 }
445
446 //----------------------------------------------------------------------------
447 void
448 VISU_ScalarMapAct
449 ::SetLineWidth(vtkFloatingPointType theLineWidth)
450 {
451   mySurfaceActor->GetProperty()->SetLineWidth(theLineWidth);
452 }
453
454 vtkFloatingPointType
455 VISU_ScalarMapAct::GetLineWidth()
456 {
457   return mySurfaceActor->GetProperty()->GetLineWidth();
458 }
459
460 //----------------------------------------------------------------------------
461 void
462 VISU_ScalarMapAct
463 ::DeepCopy(VISU_Actor *theActor)
464 {
465   if(VISU_ScalarMapAct* anActor = dynamic_cast<VISU_ScalarMapAct*>(theActor)){
466     Superclass::DeepCopy(theActor);
467     SetBarVisibility(anActor->GetBarVisibility());
468     myPointsActor->DeepCopy( anActor->myPointsActor );
469     SetShading(anActor->IsShading());
470   }
471 }
472
473
474 //----------------------------------------------------------------------------
475 void
476 VISU_ScalarMapAct
477 ::AddToRender(vtkRenderer* theRenderer)
478 {
479   Superclass::AddToRender(theRenderer);
480
481   myPointsActor->SetInteractor( myInteractor );
482
483   if(myScalarBar)
484     theRenderer->AddActor2D(myScalarBar);
485 }
486
487 //----------------------------------------------------------------------------
488 void
489 VISU_ScalarMapAct
490 ::RemoveFromRender(vtkRenderer* theRenderer)
491 {
492   if(myScalarBar)
493     theRenderer->RemoveActor(myScalarBar);
494
495   if ( vtkWindow* aWindow = theRenderer->GetRenderWindow() ) {
496     myPointsActor->ReleaseGraphicsResources( aWindow );
497     mySurfaceActor->ReleaseGraphicsResources( aWindow );
498     myEdgeActor->ReleaseGraphicsResources( aWindow );
499   }
500
501   Superclass::RemoveFromRender(theRenderer);
502 }
503
504 //----------------------------------------------------------------------------
505 void
506 VISU_ScalarMapAct
507 ::SetVisibility(int theMode)
508 {
509   Superclass::SetVisibility( theMode );
510
511   myPointsActor->SetVisibility( theMode );
512
513   if(myScalarBar) 
514     myScalarBar->SetVisibility(myBarVisibility && theMode);
515 }
516
517 //----------------------------------------------------------------------------
518 int 
519 VISU_ScalarMapAct
520 ::GetBarVisibility()
521 {
522   return myBarVisibility;
523 }
524
525 //----------------------------------------------------------------------------
526 VISU_ScalarBarActor*
527 VISU_ScalarMapAct
528 ::GetScalarBar()
529 {
530   return myScalarBar;
531 }
532
533 //----------------------------------------------------------------------------
534 void
535 VISU_ScalarMapAct
536 ::SetBarVisibility(bool theMode)
537 {
538   myBarVisibility = theMode;
539   if(myScalarBar) 
540     myScalarBar->SetVisibility(myBarVisibility && GetVisibility());
541 }
542
543
544 //----------------------------------------------------------------------------
545 void
546 VISU_ScalarMapAct
547 ::SetRepresentation(int theMode) 
548
549   bool anIsShanding = IsShading();
550
551   Superclass::SetRepresentation(theMode);
552
553   if(theMode == SVTK::Representation::Surfaceframe)
554     mySurfaceActor->SetRepresentation(SVTK::Representation::Surface);
555   else
556     mySurfaceActor->SetRepresentation(theMode);
557
558   myPointsActor->SetProperty( mySurfaceActor->GetProperty() );
559
560   SetShading(anIsShanding);
561 }
562
563
564 //----------------------------------------------------------------------------
565 void
566 VISU_ScalarMapAct
567 ::SetShading(bool theOn)
568 {
569   vtkProperty* aProperty = mySurfaceActor->GetProperty();
570
571   if (theOn) {
572     aProperty->SetAmbient(0.0); 
573     aProperty->SetDiffuse(1.0);
574   } else {
575     aProperty->SetAmbient(1.0); 
576     aProperty->SetDiffuse(0.0);
577   }
578 }
579
580 //----------------------------------------------------------------------------
581 bool
582 VISU_ScalarMapAct
583 ::IsShading()
584 {
585   vtkProperty* aProperty = mySurfaceActor->GetProperty();
586   
587   return (fabs(aProperty->GetAmbient()) < EPS && fabs(aProperty->GetDiffuse() - 1.) < EPS);
588 }
589
590 int
591 VISU_ScalarMapAct
592 ::RenderOpaqueGeometry(vtkViewport *ren)
593 {
594   GetMatrix(myEdgeActor->GetUserMatrix());
595   GetMatrix(mySurfaceActor->GetUserMatrix());
596   GetMatrix(myPointsActor->GetUserMatrix());
597
598   using namespace SVTK::Representation;
599   switch ( GetRepresentation() ) {
600
601   case Surfaceframe:
602     mySurfaceActor->SetAllocatedRenderTime(this->AllocatedRenderTime/2.0,ren);
603     mySurfaceActor->RenderOpaqueGeometry(ren);
604
605     myEdgeActor->SetAllocatedRenderTime(this->AllocatedRenderTime/2.0,ren);
606     myEdgeActor->RenderOpaqueGeometry(ren);
607     break;
608
609   case Points:
610     myPointsActor->SetAllocatedRenderTime(this->AllocatedRenderTime,ren);
611     myPointsActor->RenderOpaqueGeometry(ren);
612     break;
613
614   default:
615     mySurfaceActor->SetAllocatedRenderTime(this->AllocatedRenderTime,ren);
616     mySurfaceActor->RenderOpaqueGeometry(ren);
617   }
618
619   return 1;
620 }
621
622 int
623 VISU_ScalarMapAct
624 ::RenderTranslucentGeometry(vtkViewport *ren)
625 {
626   GetMatrix(myEdgeActor->GetUserMatrix());
627   GetMatrix(mySurfaceActor->GetUserMatrix());
628
629   using namespace SVTK::Representation;
630   switch ( GetRepresentation() ) {
631
632   case Surfaceframe:
633     mySurfaceActor->SetAllocatedRenderTime(this->AllocatedRenderTime,ren);
634 #if (VTK_XVERSION < 0x050100)
635     mySurfaceActor->RenderTranslucentGeometry(ren);
636 #else
637     mySurfaceActor->RenderTranslucentPolygonalGeometry(ren);
638 #endif
639
640     myEdgeActor->SetAllocatedRenderTime(this->AllocatedRenderTime/2.0,ren);
641 #if (VTK_XVERSION < 0x050100)
642     myEdgeActor->RenderTranslucentGeometry(ren);
643 #else
644     myEdgeActor->RenderTranslucentPolygonalGeometry(ren);
645 #endif
646     break;
647
648   case Points:
649     myPointsActor->SetAllocatedRenderTime(this->AllocatedRenderTime,ren);
650 #if (VTK_XVERSION < 0x050100)
651     myPointsActor->RenderTranslucentGeometry(ren);
652 #else
653     myPointsActor->RenderTranslucentPolygonalGeometry(ren);
654 #endif
655     break;
656
657   default:
658     mySurfaceActor->SetAllocatedRenderTime(this->AllocatedRenderTime,ren);
659 #if (VTK_XVERSION < 0x050100)
660     mySurfaceActor->RenderTranslucentGeometry(ren);
661 #else
662     mySurfaceActor->RenderTranslucentPolygonalGeometry(ren);
663 #endif
664   }
665
666   return 1;
667 }
668
669 //----------------------------------------------------------------------------
670 unsigned long int
671 VISU_ScalarMapAct
672 ::GetMemorySize()
673 {
674   unsigned long int aSize = Superclass::GetMemorySize();
675
676   aSize += myPointsActor->GetMemorySize();
677
678   return aSize;
679 }
680
681 //----------------------------------------------------------------------------
682
683 VISU_Actor::EQuadratic2DRepresentation 
684 VISU_ScalarMapAct
685 ::GetQuadratic2DRepresentation() const
686 {
687   bool mode = (mySurfaceActor->GetQuadraticArcMode() && myEdgeActor->GetQuadraticArcMode());
688   if(mode){
689     return VISU_Actor::eArcs;
690   }
691   else
692     return VISU_Actor::eLines;
693 }
694   
695 void VISU_ScalarMapAct::SetQuadratic2DRepresentation( VISU_Actor::EQuadratic2DRepresentation theMode )
696 {
697   Superclass::SetQuadratic2DRepresentation( theMode );
698   switch(theMode) {
699   case VISU_Actor::eArcs:
700     mySurfaceActor->SetQuadraticArcMode(true);
701     myEdgeActor->SetQuadraticArcMode(true);
702     break;
703   case VISU_Actor::eLines:
704     mySurfaceActor->SetQuadraticArcMode(false);
705     myEdgeActor->SetQuadraticArcMode(false);
706     break;
707   default:
708     break;
709   }
710 }