-
+// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 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
+//
#ifndef _GEOM_Engine_HXX_
#define _GEOM_Engine_HXX_
#include <TDocStd_Document.hxx>
#include <TColStd_HArray1OfInteger.hxx>
#include <TColStd_HSequenceOfAsciiString.hxx>
+#include <TDF_Label.hxx>
+
+#include <map>
+#include <vector>
+
+struct TVariable{
+ TCollection_AsciiString myVariable;
+ bool isVariable;
+
+ TVariable(const TCollection_AsciiString& theVariable, bool theFlag = true):
+ myVariable(theVariable),
+ isVariable(theFlag){}
+};
+
+typedef std::vector<TVariable> TState;
+typedef std::vector<TState> TAllStates;
+
+class ObjectStates
+{
+public:
+ Standard_EXPORT ObjectStates();
+ ~ObjectStates();
+
+ TAllStates GetAllStates() const { return _states; }
+
+ TState GetCurrectState() const;
+ Standard_EXPORT void AddState(const TState &theState);
+ void IncrementState();
+
+private:
+ TAllStates _states;
+ int _dumpstate;
+};
+
+typedef std::map<TCollection_AsciiString, ObjectStates* > TVariablesList;
class GEOM_Engine
{
public:
Standard_EXPORT GEOM_Engine();
- Standard_EXPORT ~GEOM_Engine() { _mapIDDocument.Clear(); _objects.Clear(); }
+ Standard_EXPORT virtual ~GEOM_Engine();
//Retuns the engine
Standard_EXPORT static GEOM_Engine* GetEngine();
Standard_EXPORT TCollection_AsciiString DumpPython(int theDocID,
Resource_DataMapOfAsciiStringAsciiString& theObjectNames,
+ TVariablesList theVariables,
bool isPublished,
bool& aValidScript);
protected:
Standard_EXPORT static void SetEngine(GEOM_Engine* theEngine);
-
+
private:
Handle(GEOM_Application) _OCAFApp;
GEOM_DataMapOfAsciiStringTransient _objects;
Resource_DataMapOfAsciiStringAsciiString _studyEntry2NameMap;
+
+ TDF_Label _lastCleared;
};
#endif