1 // Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
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.
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.
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
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 // VISU OBJECT : interactive object for VISU entities implementation
26 #include "VISU_PointMap3dActor.h"
27 #include "VISU_PipeLine.hxx"
28 #include "VISU_ScalarBarActor.hxx"
29 #include "VISU_DeformedGridPL.hxx"
31 #include <SALOME_InteractiveObject.hxx>
33 #include "utilities.h"
34 #include <vtkRenderer.h>
35 #include <vtkObjectFactory.h>
38 static int MYDEBUG = 0;
40 static int MYDEBUG = 0;
43 vtkStandardNewMacro(VISU_PointMap3dActor);
45 //==================================================================
46 // function: Constructor
48 //==================================================================
51 ::VISU_PointMap3dActor()
53 if(MYDEBUG) MESSAGE("VISU_PointMap3dActor::VISU_PointMap3dActor - this = "<<this);
54 myScalarBar = VISU_ScalarBarActor::New();
57 //==================================================================
58 // function: Destructor
60 //==================================================================
63 ::~VISU_PointMap3dActor()
65 if(MYDEBUG) MESSAGE("VISU_PointMap3dActor::~VISU_PointMap3dActor - this = "<<this);
66 myScalarBar->Delete();
69 //==================================================================
70 // function: AddToRender
72 //==================================================================
75 ::AddToRender(vtkRenderer* theRenderer)
77 Superclass::AddToRender(theRenderer);
78 theRenderer->AddActor2D(myScalarBar);
83 ::RemoveFromRender(vtkRenderer* theRenderer)
86 theRenderer->RemoveActor(myScalarBar);
88 Superclass::RemoveFromRender(theRenderer);
91 //==================================================================
92 // function: Set & Get PipeLine
94 //==================================================================
97 ::SetPipeLine(VISU_DeformedGridPL* thePipeLine)
99 myPipeLine = thePipeLine;
100 SetMapper(thePipeLine->GetMapper());
101 myScalarBar->SetLookupTable(thePipeLine->GetBarTable());
108 return myPipeLine.GetPointer();
111 //==================================================================
112 // function: Visibility
114 //==================================================================
118 ::SetVisibility(int theMode)
120 Superclass::SetVisibility( theMode );
122 // myPointsActor->SetVisibility( theMode );
125 myScalarBar->SetVisibility(theMode);
135 //==================================================================
138 //==================================================================
142 ::setIO(const Handle(SALOME_InteractiveObject)& theIO)
144 Superclass::setIO(theIO);
145 myName = theIO->getName();