]> SALOME platform Git repositories - modules/visu.git/blob - src/OBJECT/VISU_ScalarMapAct.cxx
Salome HOME
Patch for VTK 5.1 and newer (merge from BR_PARAVIS_DEV)
[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     myEdgeActor->GetProperty()->SetPointSize(anElem0DSize);
261   }
262 }
263
264 //----------------------------------------------------------------------------
265 VISU_ScalarMapAct
266 ::~VISU_ScalarMapAct()
267 {
268   myScalarBar->Delete();
269
270   myPointsActor->Delete();
271
272   mySurfaceActor->Delete();
273   myEdgeActor->Delete();
274 }
275
276 void
277 VISU_ScalarMapAct
278 ::ShallowCopyPL(VISU_PipeLine* thePipeLine)
279 {
280   VISU_DataSetActor::ShallowCopyPL( thePipeLine );
281
282   myEdgeActor->GetMapper()->ScalarVisibilityOff();
283
284   myPointsActor->DoMapperShallowCopy( thePipeLine->GetMapper(), false );
285
286   VISU::CopyMapper( mySurfaceActor->GetMapper(), thePipeLine->GetMapper(), false );
287 }
288
289 //----------------------------------------------------------------------------
290 void
291 VISU_ScalarMapAct
292 ::SetMapperInput(vtkDataSet* theDataSet)
293 {
294   Superclass::SetMapperInput( theDataSet );
295
296 //    myPointsActor->SetInput( theDataSet );
297 //    mySurfaceActor->SetInput( theDataSet );
298 //    myEdgeActor->SetInput( theDataSet );
299
300   if (theDataSet->IsA("vtkPolyData")) {
301     myPointsActor->SetInput( myPolyDataExtractor->GetOutput() );
302     mySurfaceActor->SetInput( myPolyDataExtractor->GetOutput() );
303     myEdgeActor->SetInput( myPolyDataExtractor->GetOutput() );
304   } else {
305     myPointsActor->SetInput( myExtractor->GetOutput() );
306     mySurfaceActor->SetInput( myExtractor->GetOutput() );
307     myEdgeActor->SetInput( myExtractor->GetOutput() );
308   }
309 }
310
311 //----------------------------------------------------------------------------
312 void
313 VISU_ScalarMapAct
314 ::SetTransform(VTKViewer_Transform* theTransform)
315 {
316   Superclass::SetTransform(theTransform);
317
318   myPointsActor->SetTransform(theTransform);
319
320   mySurfaceActor->SetTransform(theTransform);
321   myEdgeActor->SetTransform(theTransform);
322 }
323
324 //----------------------------------------------------------------------------
325 vtkProperty* 
326 VISU_ScalarMapAct
327 ::GetEdgeProperty()
328 {
329   return myEdgeActor->GetProperty();
330 }
331
332 //----------------------------------------------------------------------------
333 void
334 VISU_ScalarMapAct
335 ::SetShrinkable(bool theIsShrinkable)
336 {
337   Superclass::SetShrinkable(theIsShrinkable);
338
339   mySurfaceActor->SetShrinkable(theIsShrinkable);
340 }
341
342 void
343 VISU_ScalarMapAct
344 ::SetShrinkFactor(vtkFloatingPointType theValue)
345 {
346   Superclass::SetShrinkFactor(theValue);
347
348   mySurfaceActor->SetShrinkFactor(theValue);
349 }
350
351 //----------------------------------------------------------------------------
352 void
353 VISU_ScalarMapAct
354 ::SetShrink()
355 {
356   if(myRepresentation == VTK_POINTS)
357     return;
358
359   Superclass::SetShrink();
360
361   mySurfaceActor->SetShrink();
362 }
363
364 void
365 VISU_ScalarMapAct
366 ::UnShrink()
367 {
368   Superclass::UnShrink();
369
370   mySurfaceActor->UnShrink();
371 }
372
373 //----------------------------------------------------------------------------
374 void
375 VISU_ScalarMapAct
376 ::SetFeatureEdgesAllowed(bool theIsFeatureEdgesAllowed)
377 {
378   Superclass::SetFeatureEdgesAllowed(theIsFeatureEdgesAllowed);
379
380   mySurfaceActor->SetFeatureEdgesAllowed(theIsFeatureEdgesAllowed);
381 }
382
383 void
384 VISU_ScalarMapAct
385 ::SetFeatureEdgesAngle(vtkFloatingPointType theValue)
386 {
387   Superclass::SetFeatureEdgesAngle(theValue);
388
389   mySurfaceActor->SetFeatureEdgesAngle(theValue);
390 }
391
392 void
393 VISU_ScalarMapAct
394 ::SetFeatureEdgesFlags(bool theIsFeatureEdges,
395                        bool theIsBoundaryEdges,
396                        bool theIsManifoldEdges,
397                        bool theIsNonManifoldEdges)
398 {
399   Superclass::SetFeatureEdgesFlags(theIsFeatureEdges,
400                                    theIsBoundaryEdges,
401                                    theIsManifoldEdges,
402                                    theIsNonManifoldEdges);
403
404   mySurfaceActor->SetFeatureEdgesFlags(theIsFeatureEdges,
405                                        theIsBoundaryEdges,
406                                        theIsManifoldEdges,
407                                        theIsNonManifoldEdges);
408 }
409
410 void
411 VISU_ScalarMapAct
412 ::SetFeatureEdgesColoring(bool theIsColoring)
413 {
414   Superclass::SetFeatureEdgesColoring(theIsColoring);
415
416   mySurfaceActor->SetFeatureEdgesColoring(theIsColoring);
417 }
418
419 //----------------------------------------------------------------------------
420 void
421 VISU_ScalarMapAct
422 ::SetFeatureEdgesEnabled(bool theIsFeatureEdgesEnabled)
423 {
424   if(theIsFeatureEdgesEnabled && myRepresentation == VTK_POINTS)
425     return;
426
427   Superclass::SetFeatureEdgesEnabled(theIsFeatureEdgesEnabled);
428
429   mySurfaceActor->SetFeatureEdgesEnabled(theIsFeatureEdgesEnabled);
430 }
431
432 //----------------------------------------------------------------------------
433 void
434 VISU_ScalarMapAct
435 ::SetOpacity(vtkFloatingPointType theValue)
436 {
437   mySurfaceActor->GetProperty()->SetOpacity(theValue);
438 }
439
440 vtkFloatingPointType
441 VISU_ScalarMapAct
442 ::GetOpacity()
443 {
444   return mySurfaceActor->GetProperty()->GetOpacity();
445 }
446
447 //----------------------------------------------------------------------------
448 void
449 VISU_ScalarMapAct
450 ::SetLineWidth(vtkFloatingPointType theLineWidth)
451 {
452   mySurfaceActor->GetProperty()->SetLineWidth(theLineWidth);
453 }
454
455 vtkFloatingPointType
456 VISU_ScalarMapAct::GetLineWidth()
457 {
458   return mySurfaceActor->GetProperty()->GetLineWidth();
459 }
460
461 //----------------------------------------------------------------------------
462 void
463 VISU_ScalarMapAct
464 ::DeepCopy(VISU_Actor *theActor)
465 {
466   if(VISU_ScalarMapAct* anActor = dynamic_cast<VISU_ScalarMapAct*>(theActor)){
467     Superclass::DeepCopy(theActor);
468     SetBarVisibility(anActor->GetBarVisibility());
469     myPointsActor->DeepCopy( anActor->myPointsActor );
470     SetShading(anActor->IsShading());
471   }
472 }
473
474
475 //----------------------------------------------------------------------------
476 void
477 VISU_ScalarMapAct
478 ::AddToRender(vtkRenderer* theRenderer)
479 {
480   Superclass::AddToRender(theRenderer);
481
482   myPointsActor->SetInteractor( myInteractor );
483
484   if(myScalarBar)
485     theRenderer->AddActor2D(myScalarBar);
486 }
487
488 //----------------------------------------------------------------------------
489 void
490 VISU_ScalarMapAct
491 ::RemoveFromRender(vtkRenderer* theRenderer)
492 {
493   if(myScalarBar)
494     theRenderer->RemoveActor(myScalarBar);
495
496   if ( vtkWindow* aWindow = theRenderer->GetRenderWindow() ) {
497     myPointsActor->ReleaseGraphicsResources( aWindow );
498     mySurfaceActor->ReleaseGraphicsResources( aWindow );
499     myEdgeActor->ReleaseGraphicsResources( aWindow );
500   }
501
502   Superclass::RemoveFromRender(theRenderer);
503 }
504
505 //----------------------------------------------------------------------------
506 void
507 VISU_ScalarMapAct
508 ::SetVisibility(int theMode)
509 {
510   Superclass::SetVisibility( theMode );
511
512   myPointsActor->SetVisibility( theMode );
513
514   if(myScalarBar) 
515     myScalarBar->SetVisibility(myBarVisibility && theMode);
516 }
517
518 //----------------------------------------------------------------------------
519 int 
520 VISU_ScalarMapAct
521 ::GetBarVisibility()
522 {
523   return myBarVisibility;
524 }
525
526 //----------------------------------------------------------------------------
527 VISU_ScalarBarActor*
528 VISU_ScalarMapAct
529 ::GetScalarBar()
530 {
531   return myScalarBar;
532 }
533
534 //----------------------------------------------------------------------------
535 void
536 VISU_ScalarMapAct
537 ::SetBarVisibility(bool theMode)
538 {
539   myBarVisibility = theMode;
540   if(myScalarBar) 
541     myScalarBar->SetVisibility(myBarVisibility && GetVisibility());
542 }
543
544
545 //----------------------------------------------------------------------------
546 void
547 VISU_ScalarMapAct
548 ::SetRepresentation(int theMode) 
549
550   bool anIsShanding = IsShading();
551
552   Superclass::SetRepresentation(theMode);
553
554   if(theMode == SVTK::Representation::Surfaceframe)
555     mySurfaceActor->SetRepresentation(SVTK::Representation::Surface);
556   else
557     mySurfaceActor->SetRepresentation(theMode);
558
559   myPointsActor->SetProperty( mySurfaceActor->GetProperty() );
560
561   SetShading(anIsShanding);
562 }
563
564
565 //----------------------------------------------------------------------------
566 void
567 VISU_ScalarMapAct
568 ::SetShading(bool theOn)
569 {
570   vtkProperty* aProperty = mySurfaceActor->GetProperty();
571
572   if (theOn) {
573     aProperty->SetAmbient(0.0); 
574     aProperty->SetDiffuse(1.0);
575   } else {
576     aProperty->SetAmbient(1.0); 
577     aProperty->SetDiffuse(0.0);
578   }
579 }
580
581 //----------------------------------------------------------------------------
582 bool
583 VISU_ScalarMapAct
584 ::IsShading()
585 {
586   vtkProperty* aProperty = mySurfaceActor->GetProperty();
587   
588   return (fabs(aProperty->GetAmbient()) < EPS && fabs(aProperty->GetDiffuse() - 1.) < EPS);
589 }
590
591 int
592 VISU_ScalarMapAct
593 ::RenderOpaqueGeometry(vtkViewport *ren)
594 {
595   GetMatrix(myEdgeActor->GetUserMatrix());
596   GetMatrix(mySurfaceActor->GetUserMatrix());
597   GetMatrix(myPointsActor->GetUserMatrix());
598
599   using namespace SVTK::Representation;
600   switch ( GetRepresentation() ) {
601
602   case Surfaceframe:
603     mySurfaceActor->SetAllocatedRenderTime(this->AllocatedRenderTime/2.0,ren);
604     mySurfaceActor->RenderOpaqueGeometry(ren);
605
606     myEdgeActor->SetAllocatedRenderTime(this->AllocatedRenderTime/2.0,ren);
607     myEdgeActor->RenderOpaqueGeometry(ren);
608     break;
609
610   case Points:
611     myPointsActor->SetAllocatedRenderTime(this->AllocatedRenderTime,ren);
612     myPointsActor->RenderOpaqueGeometry(ren);
613     break;
614
615   default:
616     mySurfaceActor->SetAllocatedRenderTime(this->AllocatedRenderTime,ren);
617     mySurfaceActor->RenderOpaqueGeometry(ren);
618   }
619
620   return 1;
621 }
622
623 int
624 VISU_ScalarMapAct
625 ::RenderTranslucentGeometry(vtkViewport *ren)
626 {
627   GetMatrix(myEdgeActor->GetUserMatrix());
628   GetMatrix(mySurfaceActor->GetUserMatrix());
629
630   using namespace SVTK::Representation;
631   switch ( GetRepresentation() ) {
632
633   case Surfaceframe:
634     mySurfaceActor->SetAllocatedRenderTime(this->AllocatedRenderTime,ren);
635 #if (VTK_XVERSION < 0x050100)
636     mySurfaceActor->RenderTranslucentGeometry(ren);
637 #else
638     mySurfaceActor->RenderTranslucentPolygonalGeometry(ren);
639 #endif
640
641     myEdgeActor->SetAllocatedRenderTime(this->AllocatedRenderTime/2.0,ren);
642 #if (VTK_XVERSION < 0x050100)
643     myEdgeActor->RenderTranslucentGeometry(ren);
644 #else
645     myEdgeActor->RenderTranslucentPolygonalGeometry(ren);
646 #endif
647     break;
648
649   case Points:
650     myPointsActor->SetAllocatedRenderTime(this->AllocatedRenderTime,ren);
651 #if (VTK_XVERSION < 0x050100)
652     myPointsActor->RenderTranslucentGeometry(ren);
653 #else
654     myPointsActor->RenderTranslucentPolygonalGeometry(ren);
655 #endif
656     break;
657
658   default:
659     mySurfaceActor->SetAllocatedRenderTime(this->AllocatedRenderTime,ren);
660 #if (VTK_XVERSION < 0x050100)
661     mySurfaceActor->RenderTranslucentGeometry(ren);
662 #else
663     mySurfaceActor->RenderTranslucentPolygonalGeometry(ren);
664 #endif
665   }
666
667   return 1;
668 }
669
670 //----------------------------------------------------------------------------
671 unsigned long int
672 VISU_ScalarMapAct
673 ::GetMemorySize()
674 {
675   unsigned long int aSize = Superclass::GetMemorySize();
676
677   aSize += myPointsActor->GetMemorySize();
678
679   return aSize;
680 }
681
682 //----------------------------------------------------------------------------
683
684 VISU_Actor::EQuadratic2DRepresentation 
685 VISU_ScalarMapAct
686 ::GetQuadratic2DRepresentation() const
687 {
688   bool mode = (mySurfaceActor->GetQuadraticArcMode() && myEdgeActor->GetQuadraticArcMode());
689   if(mode){
690     return VISU_Actor::eArcs;
691   }
692   else
693     return VISU_Actor::eLines;
694 }
695   
696 void VISU_ScalarMapAct::SetQuadratic2DRepresentation( VISU_Actor::EQuadratic2DRepresentation theMode )
697 {
698   Superclass::SetQuadratic2DRepresentation( theMode );
699   switch(theMode) {
700   case VISU_Actor::eArcs:
701     mySurfaceActor->SetQuadraticArcMode(true);
702     myEdgeActor->SetQuadraticArcMode(true);
703     break;
704   case VISU_Actor::eLines:
705     mySurfaceActor->SetQuadraticArcMode(false);
706     myEdgeActor->SetQuadraticArcMode(false);
707     break;
708   default:
709     break;
710   }
711 }