// Copyright (C) 2008 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License. // // This library is distributed in the hope that it will be useful // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // File : SMESH_NoteBook.hxx // Author : Roman NIKOLAEV () #ifndef SMESH_NoteBook_HeaderFile #define SMESH_NoteBook_HeaderFile #include #include class _pyCommand; #include #include typedef std::vector TState; typedef std::vector TAllStates; typedef TCollection_AsciiString _pyID; class ObjectStates{ public: ObjectStates(TCollection_AsciiString theType); virtual ~ObjectStates(); void AddState(const TState &theState); TState GetCurrectState() const; TAllStates GetAllStates() const; void IncrementState(); TCollection_AsciiString GetObjectType() const; private: TCollection_AsciiString _type; TAllStates _states; int _dumpstate; }; class LayerDistributionStates : public ObjectStates { public: typedef std::map TDistributionMap; LayerDistributionStates(); virtual ~LayerDistributionStates(); void AddDistribution(const TCollection_AsciiString& theDistribution); bool HasDistribution(const TCollection_AsciiString& theDistribution) const; bool SetDistributionType(const TCollection_AsciiString& theDistribution, const TCollection_AsciiString& theType); TCollection_AsciiString GetDistributionType(const TCollection_AsciiString& theDistribution) const; private: TDistributionMap _distributions; }; class SMESH_NoteBook { public: typedef std::map TVariablesMap; typedef std::map TMeshEditorMap; SMESH_NoteBook(); ~SMESH_NoteBook(); void ReplaceVariables(); void AddCommand(const TCollection_AsciiString& theString); TCollection_AsciiString GetResultScript() const; private: void InitObjectMap(); void ProcessLayerDistribution(); bool GetReal(const TCollection_AsciiString& theVarName, double& theValue); private: TVariablesMap _objectMap; std::vector _commands; TMeshEditorMap myMeshEditors; }; #endif //SMESH_NoteBook_HeaderFile