X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESH_I%2FSMESH_2smeshpy.hxx;h=e218e8f8220a4da2035f932a99b4f77e9d352e66;hp=9008d0a563f4852302e08b10a745c5cd01bc2884;hb=d9f4b53e489dd5857db264ede6acded7b076c9f1;hpb=7ba6caead509499e353b12ac44a26a9eb7b0eecf diff --git a/src/SMESH_I/SMESH_2smeshpy.hxx b/src/SMESH_I/SMESH_2smeshpy.hxx index 9008d0a56..e218e8f82 100644 --- a/src/SMESH_I/SMESH_2smeshpy.hxx +++ b/src/SMESH_I/SMESH_2smeshpy.hxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2022 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 @@ -6,7 +6,7 @@ // 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. +// version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -33,6 +33,7 @@ #include #include #include +#include #include #include @@ -58,8 +59,6 @@ */ // =========================================================================================== -class Resource_DataMapOfAsciiStringAsciiString; - // =========================================================================================== // ===================== // INTERNAL STUFF @@ -75,16 +74,16 @@ class _pyHypothesis; class _pyAlgorithm; class _pyHypothesisReader; -DEFINE_STANDARD_HANDLE (_pyCommand ,Standard_Transient); -DEFINE_STANDARD_HANDLE (_pyObject ,Standard_Transient); -DEFINE_STANDARD_HANDLE (_pyHypothesisReader,Standard_Transient); -DEFINE_STANDARD_HANDLE (_pyGen ,_pyObject); -DEFINE_STANDARD_HANDLE (_pyMesh ,_pyObject); -DEFINE_STANDARD_HANDLE (_pySubMesh ,_pyObject); -DEFINE_STANDARD_HANDLE (_pyGroup ,_pySubMesh); -DEFINE_STANDARD_HANDLE (_pyMeshEditor ,_pyObject); -DEFINE_STANDARD_HANDLE (_pyHypothesis ,_pyObject); -DEFINE_STANDARD_HANDLE (_pyAlgorithm ,_pyHypothesis); +DEFINE_STANDARD_HANDLE (_pyCommand ,Standard_Transient) +DEFINE_STANDARD_HANDLE (_pyObject ,Standard_Transient) +DEFINE_STANDARD_HANDLE (_pyHypothesisReader,Standard_Transient) +DEFINE_STANDARD_HANDLE (_pyGen ,_pyObject) +DEFINE_STANDARD_HANDLE (_pyMesh ,_pyObject) +DEFINE_STANDARD_HANDLE (_pySubMesh ,_pyObject) +DEFINE_STANDARD_HANDLE (_pyGroup ,_pySubMesh) +DEFINE_STANDARD_HANDLE (_pyMeshEditor ,_pyObject) +DEFINE_STANDARD_HANDLE (_pyHypothesis ,_pyObject) +DEFINE_STANDARD_HANDLE (_pyAlgorithm ,_pyHypothesis) typedef TCollection_AsciiString _pyID; typedef TCollection_AsciiString _AString; @@ -104,7 +103,7 @@ class _pyCommand: public Standard_Transient TColStd_SequenceOfAsciiString myArgs; //!< found arguments TColStd_SequenceOfAsciiString myResults; //!< found results TColStd_SequenceOfInteger myBegPos; //!< where myRes, myObj, ... begin - std::list< Handle(_pyCommand) > myDependentCmds; //!< commands that sould follow me in the script + std::list< Handle(_pyCommand) > myDependentCmds; //!< commands that should follow me in the script enum { UNKNOWN=-1, EMPTY=0, RESULT_IND, OBJECT_IND, METHOD_IND, ARG1_IND }; int GetBegPos( int thePartIndex ) const; @@ -115,19 +114,19 @@ class _pyCommand: public Standard_Transient public: _pyCommand() {}; _pyCommand( const _AString& theString, int theNb=-1 ) - : myString( theString ), myOrderNb( theNb ) {}; + : myOrderNb( theNb ), myString( theString ) {}; _AString & GetString() { return myString; } - int GetOrderNb() const { return myOrderNb; } + int GetOrderNb() const { return myOrderNb; } void SetOrderNb( int theNb ) { myOrderNb = theNb; } typedef void* TAddr; TAddr GetAddress() const { return (void*) this; } - int Length() const { return myString.Length(); } + int Length() const { return myString.Length(); } void Clear() { myString.Clear(); myBegPos.Clear(); myArgs.Clear(); } bool IsEmpty() const { return myString.IsEmpty(); } _AString GetIndentation(); const _AString & GetResultValue(); int GetNbResultValues(); - const _AString& GetResultValue(int res); + const _AString & GetResultValue(int res); const _AString & GetObject(); const _AString & GetMethod(); const _AString & GetArg( int index ); @@ -159,7 +158,7 @@ public: bool AddAccessorMethod( _pyID theObjectID, const char* theAcsMethod ); - DEFINE_STANDARD_RTTI (_pyCommand) + DEFINE_STANDARD_RTTIEXT(_pyCommand,Standard_Transient) }; // ------------------------------------------------------------------------------------- @@ -183,11 +182,11 @@ public: const _pyID& GetID() { return myID.IsEmpty() ? myCreationCmd->GetResultValue() : myID; } static _pyID FatherID(const _pyID & childID); const Handle(_pyCommand)& GetCreationCmd() { return myCreationCmd; } - int GetNbCalls() const { return myProcessedCmds.size(); } + int GetNbCalls() const { return myProcessedCmds.size(); } bool IsInStudy() const { return myIsPublished; } virtual void SetRemovedFromStudy(const bool isRemoved) { myIsPublished = !isRemoved; } void SetCreationCmd( Handle(_pyCommand) cmd ) { myCreationCmd = cmd; } - int GetCommandNb() { return myCreationCmd->GetOrderNb(); } + int GetCommandNb() { return myCreationCmd->GetOrderNb(); } void AddProcessedCmd( const Handle(_pyCommand) & cmd ) { if (myProcessedCmds.empty() || myProcessedCmds.back()!=cmd) myProcessedCmds.push_back( cmd );} std::list< Handle(_pyCommand) >& GetProcessedCmds() { return myProcessedCmds; } @@ -199,7 +198,7 @@ public: virtual void ClearCommands(); virtual void Free() {} - DEFINE_STANDARD_RTTI (_pyObject) + DEFINE_STANDARD_RTTIEXT(_pyObject,Standard_Transient) }; // ------------------------------------------------------------------------------------- @@ -254,7 +253,6 @@ public: _pyGen(Resource_DataMapOfAsciiStringAsciiString& theEntry2AccessorMethod, Resource_DataMapOfAsciiStringAsciiString& theObjectNames, std::set< TCollection_AsciiString >& theRemovedObjIDs, - SALOMEDS::Study_ptr& theStudy, const bool theToKeepAllCommands); Handle(_pyCommand) AddCommand( const _AString& theCommand ); void ExchangeCommands( Handle(_pyCommand) theCmd1, Handle(_pyCommand) theCmd2 ); @@ -325,12 +323,14 @@ private: Handle(_pyCommand) myLastCommand; int myNbFilters; bool myToKeepAllCommands; - SALOMEDS::Study_var myStudy; + // difference of entry and index of this difference int myGeomIDNb, myGeomIDIndex; + // difference of entry and index of this difference, specific for the SHAPER study + int myShaperIDNb, myShaperIDIndex; std::map< _AString, ExportedMeshData > myFile2ExportedMesh; Handle( _pyHypothesisReader ) myHypReader; - DEFINE_STANDARD_RTTI (_pyGen) + DEFINE_STANDARD_RTTIEXT(_pyGen,_pyObject) }; // ------------------------------------------------------------------------------------- @@ -371,7 +371,7 @@ private: static void AddMeshAccess( const Handle(_pyCommand)& theCommand ) { theCommand->SetObject( theCommand->GetObject() + "." _pyMesh_ACCESS_METHOD ); } - DEFINE_STANDARD_RTTI (_pyMesh) + DEFINE_STANDARD_RTTIEXT(_pyMesh,_pyObject) }; #undef _pyMesh_ACCESS_METHOD @@ -391,7 +391,7 @@ public: virtual void Flush() {} virtual bool CanClear(); - DEFINE_STANDARD_RTTI (_pyMesh) + DEFINE_STANDARD_RTTIEXT(_pyMeshEditor,_pyObject) }; // ------------------------------------------------------------------------------------- @@ -422,7 +422,7 @@ protected: std::list myUnusedCommands; std::list myReferredObjs; // maps used to clear commands setting parameters if result of setting is - // discared (e.g. by mesh.Clear()) + // discarded (e.g. by mesh.Clear()) std::map<_AString, std::list > myMeth2Commands; std::map< _pyCommand::TAddr, std::list > myComputeAddr2Cmds; std::list myComputeCmds; @@ -475,7 +475,7 @@ public: //void ComputeSaved ( const Handle(_pyCommand)& theComputeCommand ); - DEFINE_STANDARD_RTTI (_pyHypothesis) + DEFINE_STANDARD_RTTIEXT(_pyHypothesis,_pyObject) }; // ------------------------------------------------------------------------------------- @@ -490,9 +490,9 @@ public: virtual bool Addition2Creation( const Handle(_pyCommand)& theAdditionCmd, const _pyID& theMesh); virtual const char* AccessorMethod() const { return "GetAlgorithm()"; } - virtual bool IsWrappable(const _pyID& theMesh) { return !myIsWrapped; } + virtual bool IsWrappable(const _pyID& /*theMesh*/) { return !myIsWrapped; } - DEFINE_STANDARD_RTTI (_pyAlgorithm) + DEFINE_STANDARD_RTTIEXT(_pyAlgorithm,_pyHypothesis) }; // ------------------------------------------------------------------------------------- @@ -507,9 +507,9 @@ public: virtual void Process( const Handle(_pyCommand)& theCommand); virtual void Flush(); - DEFINE_STANDARD_RTTI (_pyComplexParamHypo) + DEFINE_STANDARD_RTTIEXT(_pyComplexParamHypo,_pyHypothesis) }; -DEFINE_STANDARD_HANDLE (_pyComplexParamHypo, _pyHypothesis); +DEFINE_STANDARD_HANDLE (_pyComplexParamHypo, _pyHypothesis) // ------------------------------------------------------------------------------------- /*! @@ -529,9 +529,9 @@ public: const _pyID& theMesh); virtual void Free() { my1dHyp.Nullify(); } - DEFINE_STANDARD_RTTI (_pyLayerDistributionHypo) + DEFINE_STANDARD_RTTIEXT(_pyLayerDistributionHypo,_pyHypothesis) }; -DEFINE_STANDARD_HANDLE (_pyLayerDistributionHypo, _pyHypothesis); +DEFINE_STANDARD_HANDLE (_pyLayerDistributionHypo, _pyHypothesis) // ------------------------------------------------------------------------------------- /*! @@ -546,9 +546,9 @@ public: const _pyID& theMesh); void Flush(); - DEFINE_STANDARD_RTTI (_pyNumberOfSegmentsHyp) + DEFINE_STANDARD_RTTIEXT(_pyNumberOfSegmentsHyp,_pyHypothesis) }; -DEFINE_STANDARD_HANDLE (_pyNumberOfSegmentsHyp, _pyHypothesis); +DEFINE_STANDARD_HANDLE (_pyNumberOfSegmentsHyp, _pyHypothesis) // ------------------------------------------------------------------------------------- /*! @@ -561,9 +561,9 @@ public: _pySegmentLengthAroundVertexHyp(const Handle(_pyCommand)& theCrCmd): _pyHypothesis(theCrCmd) {} virtual bool Addition2Creation( const Handle(_pyCommand)& theAdditionCmd, const _pyID& theMesh); - DEFINE_STANDARD_RTTI (_pySegmentLengthAroundVertexHyp) + DEFINE_STANDARD_RTTIEXT(_pySegmentLengthAroundVertexHyp,_pyHypothesis) }; -DEFINE_STANDARD_HANDLE (_pySegmentLengthAroundVertexHyp, _pyHypothesis); +DEFINE_STANDARD_HANDLE (_pySegmentLengthAroundVertexHyp, _pyHypothesis) // ------------------------------------------------------------------------------------- /*! @@ -580,9 +580,9 @@ public: virtual bool CanClear(); static bool IsAliveCmd( const Handle(_pyCommand)& theCmd ); - DEFINE_STANDARD_RTTI (_pySelfEraser) + DEFINE_STANDARD_RTTIEXT(_pySelfEraser,_pyObject) }; -DEFINE_STANDARD_HANDLE (_pySelfEraser, _pyObject); +DEFINE_STANDARD_HANDLE (_pySelfEraser, _pyObject) // ------------------------------------------------------------------------------------- /*! @@ -602,7 +602,7 @@ public: void SetCreator( const Handle(_pyObject)& theCreator ) { myCreator = theCreator; } static bool CanBeArgOfMethod(const _AString& theMethodName); - DEFINE_STANDARD_RTTI (_pySubMesh) + DEFINE_STANDARD_RTTIEXT(_pySubMesh,_pyObject) }; // ------------------------------------------------------------------------------------- /*! @@ -622,9 +622,9 @@ public: //virtual void Free() { myUsers.clear(); } const _pyID& GetNewID() const { return myNewID; } - DEFINE_STANDARD_RTTI (_pyFilter) + DEFINE_STANDARD_RTTIEXT(_pyFilter,_pyObject) }; -DEFINE_STANDARD_HANDLE (_pyFilter, _pyObject); +DEFINE_STANDARD_HANDLE (_pyFilter, _pyObject) // ------------------------------------------------------------------------------------- /*! @@ -643,7 +643,7 @@ public: virtual bool CanClear(); void RemovedWithContents(); - DEFINE_STANDARD_RTTI (_pyGroup) + DEFINE_STANDARD_RTTIEXT(_pyGroup,_pySubMesh) }; // ------------------------------------------------------------------------------------- @@ -658,7 +658,7 @@ public: _pyHypothesisReader(); Handle(_pyHypothesis) GetHypothesis(const _AString& hypType, const Handle(_pyCommand)& creationCmd) const; - DEFINE_STANDARD_RTTI (_pyHypothesisReader) + DEFINE_STANDARD_RTTIEXT(_pyHypothesisReader,Standard_Transient) }; #endif