1 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License.
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
21 #include "SMESHGUI_VTKUtils.h"
22 #include "SMESHGUI_Utils.h"
23 #include "SMESHGUI_Filter.h"
25 #include <vtkRenderer.h>
26 #include <vtkActorCollection.h>
28 #include <TColStd_IndexedMapOfInteger.hxx>
30 #include "QAD_Config.h"
31 #include "QAD_Desktop.h"
32 #include "QAD_Study.h"
33 #include "QAD_Settings.h"
34 #include "QAD_RightFrame.h"
36 #include "SALOME_Selection.h"
37 #include "SALOME_ListIteratorOfListIO.hxx"
39 #include "VTKViewer_ViewFrame.h"
40 #include "VTKViewer_RenderWindow.h"
41 #include "VTKViewer_InteractorStyleSALOME.h"
42 #include "VTKViewer_RenderWindowInteractor.h"
44 #include "utilities.h"
46 #include "SALOMEconfig.h"
47 #include CORBA_CLIENT_HEADER(SMESH_Gen)
48 #include CORBA_CLIENT_HEADER(SMESH_Mesh)
49 #include CORBA_CLIENT_HEADER(SMESH_Group)
50 #include CORBA_CLIENT_HEADER(SMESH_Hypothesis)
51 #include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
53 #include "SMESH_Actor.h"
54 #include "SMESH_ObjectDef.h"
60 typedef map<TKeyOfVisualObj,TVisualObjPtr> TVisualObjCont;
61 static TVisualObjCont VISUAL_OBJ_CONT;
63 TVisualObjPtr GetVisualObj(int theStudyId, const char* theEntry){
64 TVisualObjPtr aVisualObj;
66 TVisualObjCont::key_type aKey(theStudyId,theEntry);
67 TVisualObjCont::iterator anIter = VISUAL_OBJ_CONT.find(aKey);
68 if(anIter != VISUAL_OBJ_CONT.end()){
69 aVisualObj = anIter->second;
71 SALOMEDS::Study_var aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument();
72 SALOMEDS::SObject_var aSObj = aStudy->FindObjectID(theEntry);
73 if(!CORBA::is_nil(aSObj)){
74 SALOMEDS::GenericAttribute_var anAttr;
75 if(aSObj->FindAttribute(anAttr,"AttributeIOR")){
76 SALOMEDS::AttributeIOR_var anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
77 CORBA::String_var aVal = anIOR->Value();
78 CORBA::Object_var anObj = aStudy->ConvertIORToObject(aVal.in());
79 if(!CORBA::is_nil(anObj)){
80 //Try narrow to SMESH_Mesh interafce
81 SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_narrow(anObj);
82 if(!aMesh->_is_nil()){
83 aVisualObj.reset(new SMESH_MeshObj(aMesh));
85 TVisualObjCont::value_type aValue(aKey,aVisualObj);
86 VISUAL_OBJ_CONT.insert(aValue);
89 //Try narrow to SMESH_Group interafce
90 SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObj);
91 if(!aGroup->_is_nil()){
92 SALOMEDS::SObject_var aFatherSObj = aSObj->GetFather();
93 if(aFatherSObj->_is_nil()) return aVisualObj;
94 aFatherSObj = aFatherSObj->GetFather();
95 if(aFatherSObj->_is_nil()) return aVisualObj;
96 CORBA::String_var anEntry = aFatherSObj->GetID();
97 TVisualObjPtr aVisObj = GetVisualObj(theStudyId,anEntry.in());
98 if(SMESH_MeshObj* aMeshObj = dynamic_cast<SMESH_MeshObj*>(aVisObj.get())){
99 aVisualObj.reset(new SMESH_GroupObj(aGroup,aMeshObj));
100 aVisualObj->Update();
101 TVisualObjCont::value_type aValue(aKey,aVisualObj);
102 VISUAL_OBJ_CONT.insert(aValue);
106 //Try narrow to SMESH_subMesh interafce
107 SMESH::SMESH_subMesh_var aSubMesh = SMESH::SMESH_subMesh::_narrow(anObj);
108 if(!aSubMesh->_is_nil()){
109 SALOMEDS::SObject_var aFatherSObj = aSObj->GetFather();
110 if(aFatherSObj->_is_nil()) return aVisualObj;
111 aFatherSObj = aFatherSObj->GetFather();
112 if(aFatherSObj->_is_nil()) return aVisualObj;
113 CORBA::String_var anEntry = aFatherSObj->GetID();
114 TVisualObjPtr aVisObj = GetVisualObj(theStudyId,anEntry.in());
115 if(SMESH_MeshObj* aMeshObj = dynamic_cast<SMESH_MeshObj*>(aVisObj.get())){
116 aVisualObj.reset(new SMESH_subMeshObj(aSubMesh,aMeshObj));
117 aVisualObj->Update();
118 TVisualObjCont::value_type aValue(aKey,aVisualObj);
119 VISUAL_OBJ_CONT.insert(aValue);
128 INFOS("GetMeshObj - There is no SMESH_Mesh object for the SALOMEDS::Strudy and Entry!!!");
134 VTKViewer_ViewFrame* FindVtkViewFrame(QAD_Study* theStudy,
135 QAD_StudyFrame* theStudyFrame)
137 QList<QAD_Study>& aStudies =
138 QAD_Application::getDesktop()->getActiveApp()->getStudies();
139 if(aStudies.containsRef(theStudy)){
140 const QList<QAD_StudyFrame>& aStudyFrames = theStudy->getStudyFrames();
141 if(aStudyFrames.containsRef(theStudyFrame)){
142 return GetVtkViewFrame(theStudyFrame);
149 VTKViewer_ViewFrame* GetVtkViewFrame(QAD_StudyFrame* theStudyFrame){
150 QAD_ViewFrame* aViewFrame = theStudyFrame->getRightFrame()->getViewFrame();
151 return dynamic_cast<VTKViewer_ViewFrame*>(aViewFrame);
155 VTKViewer_ViewFrame* GetCurrentVtkView(){
156 return GetVtkViewFrame(GetActiveStudy()->getActiveStudyFrame());
160 void RepaintViewFrame(VTKViewer_ViewFrame* theFrame)
166 void RenderViewFrame(VTKViewer_ViewFrame* theFrame)
168 theFrame->getRW()->getRenderWindow()->Render();
173 SMESH_Actor* FindActorByEntry(QAD_StudyFrame *theStudyFrame,
174 const char* theEntry)
176 if(VTKViewer_ViewFrame* aViewFrame = GetVtkViewFrame(theStudyFrame)){
177 vtkRenderer *aRenderer = aViewFrame->getRenderer();
178 vtkActorCollection *aCollection = aRenderer->GetActors();
179 aCollection->InitTraversal();
180 while(vtkActor *anAct = aCollection->GetNextActor()){
181 if(SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)){
182 if(anActor->hasIO()){
183 Handle(SALOME_InteractiveObject) anIO = anActor->getIO();
184 if(anIO->hasEntry() && strcmp(anIO->getEntry(),theEntry) == 0){
195 SMESH_Actor* FindActorByEntry(const char* theEntry){
196 return FindActorByEntry(GetActiveStudy()->getActiveStudyFrame(),theEntry);
200 SMESH_Actor* FindActorByObject(CORBA::Object_ptr theObject){
201 if(!CORBA::is_nil(theObject)){
202 SALOMEDS::Study_var aStudy = GetActiveStudyDocument();
203 CORBA::String_var anIOR = aStudy->ConvertObjectToIOR(theObject);
204 SALOMEDS::SObject_var aSObject = aStudy->FindObjectIOR(anIOR.in());
205 if(!aSObject->_is_nil()){
206 CORBA::String_var anEntry = aSObject->GetID();
207 return FindActorByEntry(anEntry.in());
214 SMESH_Actor* CreateActor(SALOMEDS::Study_ptr theStudy,
215 const char* theEntry,
218 SMESH_Actor *anActor = NULL;
219 CORBA::Long anId = theStudy->StudyId();
220 if(TVisualObjPtr aVisualObj = GetVisualObj(anId,theEntry)){
221 SALOMEDS::SObject_var aSObj = theStudy->FindObjectID(theEntry);
222 if(!aSObj->_is_nil()){
223 SALOMEDS::GenericAttribute_var anAttr;
224 if(aSObj->FindAttribute(anAttr,"AttributeName")){
225 SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr);
226 CORBA::String_var aVal = aName->Value();
227 string aNameVal = aVal.in();
228 anActor = SMESH_Actor::New(aVisualObj,theEntry,aNameVal.c_str(),theIsClear);
236 void DisplayActor(QAD_StudyFrame *theStudyFrame, SMESH_Actor* theActor){
237 if(VTKViewer_ViewFrame* aViewFrame = GetVtkViewFrame(theStudyFrame)){
238 aViewFrame->AddActor(theActor);
239 aViewFrame->Repaint();
244 void RemoveActor(QAD_StudyFrame *theStudyFrame, SMESH_Actor* theActor){
245 if(VTKViewer_ViewFrame* aViewFrame = GetVtkViewFrame(theStudyFrame)){
246 aViewFrame->RemoveActor(theActor);
247 aViewFrame->Repaint();
253 if(VTKViewer_ViewFrame* aViewFrame = GetVtkViewFrame(GetActiveStudy()->getActiveStudyFrame())){
254 aViewFrame->onViewFitAll();
255 aViewFrame->Repaint();
259 vtkRenderer* GetCurrentRenderer(){
260 if(VTKViewer_ViewFrame* aViewFrame = GetVtkViewFrame(GetActiveStudy()->getActiveStudyFrame()))
261 return aViewFrame->getRenderer();
265 void RepaintCurrentView(){
266 if(VTKViewer_ViewFrame* aViewFrame = GetVtkViewFrame(GetActiveStudy()->getActiveStudyFrame())){
267 aViewFrame->getRW()->getRenderWindow()->Render();
268 //aViewFrame->Repaint();
273 void UpdateView(QAD_StudyFrame *theStudyFrame, EDisplaing theAction, const char* theEntry)
275 if(VTKViewer_ViewFrame* aViewFrame = GetVtkViewFrame(theStudyFrame)){
276 vtkRenderer *aRenderer = aViewFrame->getRenderer();
277 vtkActorCollection *aCollection = aRenderer->GetActors();
278 aCollection->InitTraversal();
281 while(vtkActor *anAct = aCollection->GetNextActor()){
282 if(SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)){
283 anActor->SetVisibility(true);
290 while(vtkActor *anAct = aCollection->GetNextActor()){
291 if(SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)){
292 anActor->SetVisibility(false);
297 if(SMESH_Actor *anActor = FindActorByEntry(theStudyFrame,theEntry)){
301 anActor->SetVisibility(true);
304 anActor->SetVisibility(false);
311 QAD_Study* aStudy = theStudyFrame->getStudy();
312 SALOMEDS::Study_var aDocument = aStudy->getStudyDocument();
313 if((anActor = CreateActor(aDocument,theEntry,true))) {
314 DisplayActor(theStudyFrame,anActor);
327 void UpdateView(EDisplaing theAction, const char* theEntry){
328 QAD_Study* aStudy = GetActiveStudy();
329 QAD_StudyFrame *aStudyFrame = aStudy->getActiveStudyFrame();
330 UpdateView(aStudyFrame,theAction,theEntry);
334 if(VTKViewer_ViewFrame* aViewFrame = SMESH::GetCurrentVtkView()){
335 SALOME_Selection *aSel = SALOME_Selection::Selection(GetActiveStudy()->getSelection());
336 if(aSel->IObjectCount() == 0){
337 vtkRenderer* aRenderer = aViewFrame->getRenderer();
338 vtkActorCollection *aCollection = aRenderer->GetActors();
339 aCollection->InitTraversal();
340 while(vtkActor *anAct = aCollection->GetNextActor()){
341 if(SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)){
343 Update(anActor->getIO(),anActor->GetVisibility());
347 SALOME_ListIteratorOfListIO anIter(aSel->StoredIObjects());
348 for(; anIter.More(); anIter.Next()){
349 Handle(SALOME_InteractiveObject) anIO = anIter.Value();
353 RepaintCurrentView();
358 void Update(const Handle(SALOME_InteractiveObject)& theIO,
361 SALOMEDS::Study_var aStudy = GetActiveStudyDocument();
362 CORBA::Long anId = aStudy->StudyId();
363 TVisualObjPtr aVisualObj = SMESH::GetVisualObj(anId,theIO->getEntry());
364 aVisualObj->Update();
366 UpdateView(SMESH::eDisplay,theIO->getEntry());
370 void UpdateSelectionProp() {
371 QAD_Study* aStudy = GetActiveStudy();
372 QList<QAD_StudyFrame> aFrameList = aStudy->getStudyFrames();
374 QString SCr, SCg, SCb;
375 SCr = QAD_CONFIG->getSetting("SMESH:SettingsSelectColorRed");
376 SCg = QAD_CONFIG->getSetting("SMESH:SettingsSelectColorGreen");
377 SCb = QAD_CONFIG->getSetting("SMESH:SettingsSelectColorBlue");
378 QColor aHiColor = Qt::white;
379 if (!SCr.isEmpty() && !SCg.isEmpty() && !SCb.isEmpty())
380 aHiColor = QColor(SCr.toInt(), SCg.toInt(), SCb.toInt());
382 SCr = QAD_CONFIG->getSetting("SMESH:SettingsItemSelectColorRed");
383 SCg = QAD_CONFIG->getSetting("SMESH:SettingsItemSelectColorGreen");
384 SCb = QAD_CONFIG->getSetting("SMESH:SettingsItemSelectColorBlue");
385 QColor aSelColor = Qt::yellow;
386 if (!SCr.isEmpty() && !SCg.isEmpty() && !SCb.isEmpty())
387 aSelColor = QColor(SCr.toInt(), SCg.toInt(), SCb.toInt());
388 QString SW = QAD_CONFIG->getSetting("SMESH:SettingsItemSelectWidth");
389 if (SW.isEmpty()) SW = "5";
391 SCr = QAD_CONFIG->getSetting("SMESH:SettingsPreSelectColorRed");
392 SCg = QAD_CONFIG->getSetting("SMESH:SettingsPreSelectColorGreen");
393 SCb = QAD_CONFIG->getSetting("SMESH:SettingsPreSelectColorBlue");
394 QColor aPreColor = Qt::cyan;
395 if (!SCr.isEmpty() && !SCg.isEmpty() && !SCb.isEmpty())
396 aPreColor = QColor(SCr.toInt(), SCg.toInt(), SCb.toInt());
397 QString PW = QAD_CONFIG->getSetting("SMESH:SettingsPreSelectWidth");
398 if (PW.isEmpty()) PW = "5";
400 QString SP1 = QAD_CONFIG->getSetting("SMESH:SettingsNodeSelectTol");
401 if (SP1.isEmpty()) SP1 = "0.025";
402 QString SP2 = QAD_CONFIG->getSetting("SMESH:SettingsElementsSelectTol");
403 if (SP2.isEmpty()) SP2 = "0.001";
405 for (QAD_StudyFrame* aStudyFrame = aFrameList.first(); aStudyFrame; aStudyFrame = aFrameList.next()) {
406 if (aStudyFrame->getTypeView() == VIEW_VTK) {
407 VTKViewer_ViewFrame* aVtkViewFrame = GetVtkViewFrame(aStudyFrame);
408 if (!aVtkViewFrame) continue;
409 // update VTK viewer properties
410 VTKViewer_RenderWindowInteractor* anInteractor = aVtkViewFrame->getRWInteractor();
412 // mesh element selection
413 anInteractor->SetSelectionProp(aSelColor.red()/255., aSelColor.green()/255.,
414 aSelColor.blue()/255., SW.toInt());
417 anInteractor->SetSelectionTolerance(SP1.toDouble(), SP2.toDouble());
420 VTKViewer_InteractorStyleSALOME* aStyle = anInteractor->GetInteractorStyleSALOME();
422 aStyle->setPreselectionProp(aPreColor.red()/255., aPreColor.green()/255.,
423 aPreColor.blue()/255., PW.toInt());
427 vtkRenderer* aRenderer = aVtkViewFrame->getRenderer();
428 vtkActorCollection *aCollection = aRenderer->GetActors();
429 aCollection->InitTraversal();
430 while(vtkActor *anAct = aCollection->GetNextActor()){
431 if(SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)){
432 anActor->SetHighlightColor(aHiColor.red()/255., aHiColor.green()/255.,
433 aHiColor.blue()/255.);
434 anActor->SetPreHighlightColor(aPreColor.red()/255., aPreColor.green()/255.,
435 aPreColor.blue()/255.);
443 //----------------------------------------------------------------------------
444 VTKViewer_InteractorStyleSALOME* GetInteractorStyle(QAD_StudyFrame *theStudyFrame){
445 if(VTKViewer_ViewFrame* aViewFrame = GetVtkViewFrame(theStudyFrame)){
446 if(VTKViewer_RenderWindowInteractor* anInteractor = aViewFrame->getRWInteractor()){
447 return anInteractor->GetInteractorStyleSALOME();
453 void SetFilter(const Handle(VTKViewer_Filter)& theFilter,
454 VTKViewer_InteractorStyleSALOME* theStyle)
456 theStyle->SetFilter(theFilter);
459 Handle(VTKViewer_Filter) GetFilter(int theId, VTKViewer_InteractorStyleSALOME* theStyle)
461 return theStyle->GetFilter(theId);
464 bool IsFilterPresent(int theId, VTKViewer_InteractorStyleSALOME* theStyle)
466 return theStyle->IsFilterPresent(theId);
469 void RemoveFilter(int theId, VTKViewer_InteractorStyleSALOME* theStyle){
470 theStyle->RemoveFilter(theId);
473 void RemoveFilters(VTKViewer_InteractorStyleSALOME* theStyle){
474 for ( int id = SMESHGUI_NodeFilter; theStyle && id < SMESHGUI_LastFilter; id++ )
475 theStyle->RemoveFilter( id );
478 bool IsValid(SALOME_Actor* theActor, int theCellId,
479 VTKViewer_InteractorStyleSALOME* theStyle)
481 return theStyle->IsValid(theActor,theCellId);
485 //----------------------------------------------------------------------------
486 void SetPointRepresentation(bool theIsVisible){
487 if(VTKViewer_ViewFrame* aViewFrame = GetCurrentVtkView()){
488 vtkRenderer *aRenderer = aViewFrame->getRenderer();
489 vtkActorCollection *aCollection = aRenderer->GetActors();
490 aCollection->InitTraversal();
491 while(vtkActor *anAct = aCollection->GetNextActor()){
492 if(SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)){
493 if(anActor->GetVisibility()){
494 anActor->SetPointRepresentation(theIsVisible);
498 RepaintCurrentView();
503 void SetPickable(SMESH_Actor* theActor){
504 if(VTKViewer_ViewFrame* aViewFrame = GetCurrentVtkView()){
505 int anIsAllPickable = (theActor == NULL);
506 vtkRenderer *aRenderer = aViewFrame->getRenderer();
507 vtkActorCollection *aCollection = aRenderer->GetActors();
508 aCollection->InitTraversal();
509 while(vtkActor *anAct = aCollection->GetNextActor()){
510 if(SALOME_Actor *anActor = dynamic_cast<SALOME_Actor*>(anAct)){
511 if(anActor->GetVisibility()){
512 anActor->SetPickable(anIsAllPickable);
517 theActor->SetPickable(!anIsAllPickable);
518 RepaintCurrentView();
523 int GetNameOfSelectedNodes(SALOME_Selection *theSel,
524 const Handle(SALOME_InteractiveObject)& theIO,
528 if(theIO->hasEntry()){
529 if(FindActorByEntry(theIO->getEntry())){
530 TColStd_IndexedMapOfInteger aMapIndex;
531 theSel->GetIndex(theIO,aMapIndex);
532 for(int i = 1; i <= aMapIndex.Extent(); i++){
533 theName += QString(" %1").arg(aMapIndex(i));
535 return aMapIndex.Extent();
542 int GetNameOfSelectedNodes(SALOME_Selection *theSel, QString& theName){
544 if(theSel->IObjectCount() == 1){
545 Handle(SALOME_InteractiveObject) anIO = theSel->firstIObject();
546 return GetNameOfSelectedNodes(theSel,anIO,theName);
552 int GetNameOfSelectedElements(SALOME_Selection *theSel,
553 const Handle(SALOME_InteractiveObject)& theIO,
557 if(theIO->hasEntry()){
558 if(FindActorByEntry(theIO->getEntry())){
559 TColStd_IndexedMapOfInteger aMapIndex;
560 theSel->GetIndex(theIO,aMapIndex);
561 typedef std::set<int> TIdContainer;
562 TIdContainer anIdContainer;
563 for( int i = 1; i <= aMapIndex.Extent(); i++)
564 anIdContainer.insert(aMapIndex(i));
565 TIdContainer::const_iterator anIter = anIdContainer.begin();
566 for(; anIter != anIdContainer.end(); anIter++){
567 theName += QString(" %1").arg(*anIter);
569 return aMapIndex.Extent();
576 int GetNameOfSelectedElements(SALOME_Selection *theSel, QString& theName)
579 if(theSel->IObjectCount() == 1){
580 Handle(SALOME_InteractiveObject) anIO = theSel->firstIObject();
581 return GetNameOfSelectedElements(theSel,anIO,theName);
587 int GetSelected(SALOME_Selection* theSel,
588 TColStd_IndexedMapOfInteger& theMap,
589 const bool theIsElement)
593 if ( theSel->IObjectCount() == 1 )
595 Handle(SALOME_InteractiveObject) anIO = theSel->firstIObject();
596 if ( anIO->hasEntry() ) {
597 theSel->GetIndex( anIO, theMap );
600 return theMap.Extent();
604 int GetEdgeNodes( SALOME_Selection* theSel, int& theId1, int& theId2 )
606 if ( theSel->IObjectCount() != 1 )
609 Handle(SALOME_InteractiveObject) anIO = theSel->firstIObject();
610 if ( anIO.IsNull() || !anIO->hasEntry() )
613 SMESH_Actor *anActor = SMESH::FindActorByEntry( anIO->getEntry() );
617 TColStd_IndexedMapOfInteger aMapIndex;
618 theSel->GetIndex( anIO, aMapIndex );
619 if ( aMapIndex.Extent() != 2 )
622 int anObjId = -1, anEdgeNum = -1;
623 for ( int i = 1; i <= aMapIndex.Extent(); i++ ) {
624 int aVal = aMapIndex( i );
628 anEdgeNum = abs( aVal );
631 if ( anObjId == -1 || anEdgeNum == -1 )
634 return anActor->GetObject()->GetEdgeNodes( anObjId, anEdgeNum, theId1, theId2 ) ? 1 : -1;
637 void SetControlsPrecision( const long theVal )
639 if( VTKViewer_ViewFrame* aViewFrame = SMESH::GetCurrentVtkView() )
641 vtkRenderer *aRenderer = aViewFrame->getRenderer();
642 vtkActorCollection *aCollection = aRenderer->GetActors();
643 aCollection->InitTraversal();
645 while ( vtkActor *anAct = aCollection->GetNextActor())
647 if ( SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>( anAct ) )
649 anActor->SetControlsPrecision( theVal );
650 anActor->SetControlMode( anActor->GetControlMode() );