1 // Copyright (C) 2007-2013 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 // All this stuff is obsolete since issue 0021308:
27 // "Remove hard-coded dependency of the external mesh plugins from the SMESH module"
28 // is implemented (Mar 2012). It is kept for backward compatibility only.
30 #include <TCollection_AsciiString.hxx>
31 #include <Resource_DataMapOfAsciiStringAsciiString.hxx>
38 typedef std::vector<TCollection_AsciiString> TState;
39 typedef std::vector<TState> TAllStates;
40 typedef TCollection_AsciiString _pyID;
42 class SMESH_ObjectStates{
46 SMESH_ObjectStates(TCollection_AsciiString theType);
47 virtual ~SMESH_ObjectStates();
49 void AddState(const TState &theState);
51 TState GetCurrectState() const;
52 TAllStates GetAllStates() const;
53 void IncrementState();
54 TCollection_AsciiString GetObjectType() const;
59 TCollection_AsciiString _type;
64 class LayerDistributionStates : public SMESH_ObjectStates
67 typedef std::map<TCollection_AsciiString,TCollection_AsciiString> TDistributionMap;
68 LayerDistributionStates();
69 virtual ~LayerDistributionStates();
71 void AddDistribution(const TCollection_AsciiString& theDistribution);
72 bool HasDistribution(const TCollection_AsciiString& theDistribution) const;
74 bool SetDistributionType(const TCollection_AsciiString& theDistribution,
75 const TCollection_AsciiString& theType);
76 TCollection_AsciiString GetDistributionType(const TCollection_AsciiString& theDistribution) const;
80 TDistributionMap _distributions;
90 void ReplaceVariables();
92 void AddCommand(const TCollection_AsciiString& theString);
93 TCollection_AsciiString GetResultScript() const;
98 void ProcessLayerDistribution();
100 bool GetReal(const TCollection_AsciiString& theVarName, double& theValue);
104 typedef std::map<TCollection_AsciiString,SMESH_ObjectStates*> TVariablesMap;
105 typedef std::map<TCollection_AsciiString,TCollection_AsciiString> TMeshEditorMap;
106 typedef std::map<TCollection_AsciiString,std::vector< std::string > > TEntry2VarVecMap;
108 TVariablesMap _objectMap; // old approach - full states are kept
109 TEntry2VarVecMap _entry2VarsMap; // new approach - only var names are kept
110 std::vector<Handle(_pyCommand)> _commands;
111 TMeshEditorMap _meshEditors;
114 #endif //SMESH_NoteBook_HeaderFile