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 // File : SMESH_NoteBook.hxx
21 // Author : Roman NIKOLAEV ()
23 #ifndef SMESH_NoteBook_HeaderFile
24 #define SMESH_NoteBook_HeaderFile
26 #include <TCollection_AsciiString.hxx>
27 #include <Resource_DataMapOfAsciiStringAsciiString.hxx>
34 typedef std::vector<TCollection_AsciiString> TState;
35 typedef std::vector<TState> TAllStates;
36 typedef TCollection_AsciiString _pyID;
38 class SMESH_ObjectStates{
42 SMESH_ObjectStates(TCollection_AsciiString theType);
43 virtual ~SMESH_ObjectStates();
45 void AddState(const TState &theState);
47 TState GetCurrectState() const;
48 TAllStates GetAllStates() const;
49 void IncrementState();
50 TCollection_AsciiString GetObjectType() const;
55 TCollection_AsciiString _type;
60 class LayerDistributionStates : public SMESH_ObjectStates
63 typedef std::map<TCollection_AsciiString,TCollection_AsciiString> TDistributionMap;
64 LayerDistributionStates();
65 virtual ~LayerDistributionStates();
67 void AddDistribution(const TCollection_AsciiString& theDistribution);
68 bool HasDistribution(const TCollection_AsciiString& theDistribution) const;
70 bool SetDistributionType(const TCollection_AsciiString& theDistribution,
71 const TCollection_AsciiString& theType);
72 TCollection_AsciiString GetDistributionType(const TCollection_AsciiString& theDistribution) const;
76 TDistributionMap _distributions;
83 typedef std::map<TCollection_AsciiString,SMESH_ObjectStates*> TVariablesMap;
84 typedef std::map<TCollection_AsciiString,TCollection_AsciiString> TMeshEditorMap;
87 void ReplaceVariables();
89 void AddCommand(const TCollection_AsciiString& theString);
90 TCollection_AsciiString GetResultScript() const;
94 void ProcessLayerDistribution();
96 bool GetReal(const TCollection_AsciiString& theVarName, double& theValue);
100 TVariablesMap _objectMap;
101 std::vector<Handle(_pyCommand)> _commands;
102 TMeshEditorMap myMeshEditors;
105 #endif //SMESH_NoteBook_HeaderFile