1 // VISU OBJECT : interactive object for VISU entities implementation
3 // Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
23 // File : VISU_PrsObject_i.hxx
24 // Author : Alexey PETROV
27 #ifndef VISU_ScalarMap_i_HeaderFile
28 #define VISU_ScalarMap_i_HeaderFile
30 #include "VISU_Prs3d_i.hh"
32 class VISU_ScalarMapPL;
35 class ScalarMap_i : public virtual POA_VISU::ScalarMap,
36 public virtual Prs3d_i
38 static int myNbPresent;
40 ScalarMap_i(const ScalarMap_i&);
43 ScalarMap_i(Result_i* theResult, bool theAddToStudy = true);
44 virtual void SameAs(const ScalarMap_i* theOrigin);
45 virtual ~ScalarMap_i();
46 virtual void Destroy();
48 virtual VISU::VISUType GetType() { return VISU::TSCALARMAP;};
50 virtual CORBA::Long GetScalarMode();
51 virtual void SetScalarMode(CORBA::Long theScalarMode);
53 virtual VISU::Scaling GetScaling();
54 virtual void SetScaling(VISU::Scaling theScaling);
56 virtual void SetRange(CORBA::Double theMin, CORBA::Double theMax);
57 virtual CORBA::Double GetMin();
58 virtual CORBA::Double GetMax();
60 virtual void SetNbColors(CORBA::Long theNbColors);
61 virtual CORBA::Long GetNbColors();
63 virtual void SetOrientation(VISU::ScalarMap::Orientation theOrientation){
64 myOrientation = theOrientation;
66 virtual VISU::ScalarMap::Orientation GetOrientation() { return myOrientation;}
68 virtual void SetPosition(CORBA::Double X, CORBA::Double Y) { myPosition[0] = X; myPosition[1] = Y;}
69 virtual CORBA::Double GetPosX() { return myPosition[0];}
70 virtual CORBA::Double GetPosY() { return myPosition[1];}
72 virtual void SetSize(CORBA::Double theWidth, CORBA::Double theHeight) {
73 myWidth = theWidth; myHeight = theHeight;
75 virtual CORBA::Double GetWidth() { return myWidth;}
76 virtual CORBA::Double GetHeight() { return myHeight;}
78 virtual void SetLabels(CORBA::Long theNbLabels) { myNumberOfLabels = theNbLabels;}
79 virtual CORBA::Long GetLabels() { return myNumberOfLabels;}
81 virtual void SetTitle(const char* theName) { myTitle = theName;}
82 virtual char* GetTitle() { return CORBA::string_dup(myTitle.c_str());}
84 typedef VISU::ScalarMap TInterface;
85 VISU_ScalarMapPL* GetScalarMapPL(){ return myScalarMapPL;}
88 Storable* Build(int theRestoring);
89 virtual void DoHook();
91 VISU_ScalarMapPL* myScalarMapPL;
92 const TField* myField;
102 int myNumberOfLabels;
103 float myPosition[2], myWidth, myHeight;
104 VISU::ScalarMap::Orientation myOrientation;
107 static int IsPossible(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity,
108 const char* theFieldName, int theIteration);
109 virtual Storable* Create(const char* theMeshName, VISU::Entity theEntity,
110 const char* theFieldName, int theIteration);
112 virtual void ToStream(std::ostringstream& theStr);
114 static const string myComment;
115 virtual const char* GetComment() const;
116 virtual QString GenerateName();
118 virtual Storable* Restore(const Storable::TRestoringMap& theMap)
119 throw(std::logic_error&);
120 static Storable* Restore(SALOMEDS::SObject_ptr theSObject,
121 const string& thePrefix, const Storable::TRestoringMap& theMap)
122 throw(std::logic_error&);
124 virtual void Update();
125 virtual void SetMapScale(double theMapScale = 1.0);
127 const VISU::TField* GetField() const { return myField;}
128 const string& GetFieldName() const { return myFieldName;}
130 virtual bool IsRangeFixed() { return myIsFixedRange; }
131 virtual void SetSourceRange();
133 virtual int GetIteration() { return myIteration; }
135 virtual VISU_Actor* CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL)
136 throw (std::runtime_error&);
137 virtual void UpdateActor(VISU_Actor* theActor);