Salome HOME
0021542: EDF 1699 SMESH: Reorient a group of faces
[modules/smesh.git] / src / SMESH_I / SMESH_2smeshpy.hxx
index 24b769329643942bd41fbd747f9270fcebe9bfd5..f92c285b4c4176cf3463c4afe671db5b35fc7e4a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2011  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  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
@@ -123,7 +123,7 @@ public:
   _AString GetIndentation();
   const _AString & GetResultValue();
   const int GetNbResultValues();
-  const _AString & GetResultValue(int res);
+  _AString GetResultValue(int res);
   const _AString & GetObject();
   const _AString & GetMethod();
   const _AString & GetArg( int index );
@@ -230,9 +230,11 @@ public:
   void SetCommandBefore( Handle(_pyCommand) theCmd, Handle(_pyCommand) theBeforeCmd );
   Handle(_pyCommand)& GetLastCommand();
   std::list< Handle(_pyCommand) >& GetCommands() { return myCommands; }
+  void PlaceSubmeshAfterItsCreation( Handle(_pyCommand) theCmdUsingSubmesh ) const;
 
   _pyID GenerateNewID( const _pyID& theID );
   void AddObject( Handle(_pyObject)& theObj );
+  void SetProxyObject( const _pyID& theID, Handle(_pyObject)& theObj );
   Handle(_pyObject) FindObject( const _pyID& theObjID ) const;
   Handle(_pySubMesh) FindSubMesh( const _pyID& theSubMeshID );
   Handle(_pyHypothesis) FindHyp( const _pyID& theHypID );
@@ -521,7 +523,8 @@ DEFINE_STANDARD_HANDLE (_pySegmentLengthAroundVertexHyp, _pyHypothesis);
 class _pySelfEraser: public _pyObject
 {
 public:
-  _pySelfEraser(const Handle(_pyCommand)& theCreationCmd):_pyObject(theCreationCmd) {}
+  _pySelfEraser(const Handle(_pyCommand)& theCreationCmd)
+    :_pyObject(theCreationCmd) { myIsPublished = true; }
   virtual void Flush();
 
   DEFINE_STANDARD_RTTI (_pySelfEraser)
@@ -544,25 +547,10 @@ public:
   virtual Handle(_pyMesh) GetMesh() { return myMesh; }
   virtual void Free() { myCreator.Nullify(); myMesh.Nullify(); }
   void SetCreator( const Handle(_pyObject)& theCreator ) { myCreator = theCreator; }
+  static bool CanBeArgOfMethod(const _AString& theMethodName);
 
   DEFINE_STANDARD_RTTI (_pySubMesh)
 };
-// -------------------------------------------------------------------------------------
-/*!
- * \brief To convert creation of a group by filter
- */
-// -------------------------------------------------------------------------------------
-class _pyGroup:  public _pySubMesh
-{
-public:
-  _pyGroup(const Handle(_pyCommand)& theCreationCmd, const _pyID & id=_pyID())
-    :_pySubMesh(theCreationCmd) { setID( id ); }
-  virtual void Process( const Handle(_pyCommand)& theCommand);
-  virtual void Flush() {}
-
-  DEFINE_STANDARD_RTTI (_pyGroup)
-};
-
 // -------------------------------------------------------------------------------------
 /*!
  * \brief A filter sets a human readable name to self
@@ -570,7 +558,7 @@ public:
 // -------------------------------------------------------------------------------------
 class _pyFilter:  public _pyObject
 {
-  _pyID myNewID;
+  _pyID myNewID, myMesh;
   std::list< Handle(_pyObject) > myUsers;
 public:
   _pyFilter(const Handle(_pyCommand)& theCreationCmd, const _pyID& newID="");
@@ -585,6 +573,24 @@ public:
 };
 DEFINE_STANDARD_HANDLE (_pyFilter, _pyObject);
 
+// -------------------------------------------------------------------------------------
+/*!
+ * \brief To convert creation of a group by filter
+ */
+// -------------------------------------------------------------------------------------
+class _pyGroup:  public _pySubMesh
+{
+  Handle(_pyFilter) myFilter;
+  bool              myCanClearCreationCmd;
+public:
+  _pyGroup(const Handle(_pyCommand)& theCreationCmd, const _pyID & id=_pyID());
+  virtual void Process( const Handle(_pyCommand)& theCommand);
+  virtual void Flush();
+  virtual void Free() { myFilter.Nullify(); }
+
+  DEFINE_STANDARD_RTTI (_pyGroup)
+};
+
 // -------------------------------------------------------------------------------------
 /*!
  * \brief Class reading _pyHypothesis'es from resource files of mesher Plugins