1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // VISU OBJECT : interactive object for VISU entities implementation
28 #include "VISU_PointMap3dActor.h"
29 #include "VISU_PipeLine.hxx"
30 #include "VISU_ScalarBarActor.hxx"
31 #include "VISU_DeformedGridPL.hxx"
33 #include <SALOME_InteractiveObject.hxx>
35 #include "utilities.h"
36 #include <vtkRenderer.h>
37 #include <vtkObjectFactory.h>
40 static int MYDEBUG = 0;
42 static int MYDEBUG = 0;
45 vtkStandardNewMacro(VISU_PointMap3dActor);
47 //==================================================================
48 // function: Constructor
50 //==================================================================
53 ::VISU_PointMap3dActor()
55 if(MYDEBUG) MESSAGE("VISU_PointMap3dActor::VISU_PointMap3dActor - this = "<<this);
56 myScalarBar = VISU_ScalarBarActor::New();
59 //==================================================================
60 // function: Destructor
62 //==================================================================
65 ::~VISU_PointMap3dActor()
67 if(MYDEBUG) MESSAGE("VISU_PointMap3dActor::~VISU_PointMap3dActor - this = "<<this);
68 myScalarBar->Delete();
71 //==================================================================
72 // function: AddToRender
74 //==================================================================
77 ::AddToRender(vtkRenderer* theRenderer)
79 Superclass::AddToRender(theRenderer);
80 theRenderer->AddActor2D(myScalarBar);
85 ::RemoveFromRender(vtkRenderer* theRenderer)
88 theRenderer->RemoveActor(myScalarBar);
90 Superclass::RemoveFromRender(theRenderer);
93 //==================================================================
94 // function: Set & Get PipeLine
96 //==================================================================
99 ::SetPipeLine(VISU_DeformedGridPL* thePipeLine)
101 myPipeLine = thePipeLine;
102 SetMapper(thePipeLine->GetMapper());
103 myScalarBar->SetLookupTable(thePipeLine->GetBarTable());
110 return myPipeLine.GetPointer();
113 //==================================================================
114 // function: Visibility
116 //==================================================================
120 ::SetVisibility(int theMode)
122 Superclass::SetVisibility( theMode );
124 // myPointsActor->SetVisibility( theMode );
127 myScalarBar->SetVisibility(theMode);
137 //==================================================================
140 //==================================================================
144 ::setIO(const Handle(SALOME_InteractiveObject)& theIO)
146 Superclass::setIO(theIO);
147 myName = theIO->getName();