Salome HOME
ea8783a0764b4d24cfb0dd48bfbc923f2b5593f7
[modules/gui.git] / src / SVTK / SVTK_Trihedron.cxx
1 // Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
2 // 
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either 
6 // version 2.1 of the License.
7 // 
8 // This library is distributed in the hope that it will be useful 
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of 
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public  
14 // License along with this library; if not, write to the Free Software 
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/
18 //
19 #include "SVTK_Trihedron.h"
20 #include "SALOME_Actor.h"
21
22 #include <vtkObjectFactory.h>
23 #include <vtkActorCollection.h>
24 #include <vtkRenderer.h>
25
26 //****************************************************************
27 vtkStandardNewMacro(SVTK_Trihedron);
28
29 //****************************************************************
30 SVTK_Trihedron
31 ::SVTK_Trihedron()
32 {
33 }
34
35 //****************************************************************
36 int 
37 SVTK_Trihedron
38 ::GetVisibleActorCount(vtkRenderer* theRenderer)
39 {
40   vtkActorCollection* aCollection = theRenderer->GetActors();
41   aCollection->InitTraversal();
42   int aCount = 0;
43   while(vtkActor* aProp = aCollection->GetNextActor()) {
44     if(aProp->GetVisibility())
45       if(SALOME_Actor* anActor = SALOME_Actor::SafeDownCast(aProp))
46         if(!anActor->IsInfinitive()) 
47           aCount++;
48   }
49   return aCount;
50 }