mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-03-15 19:31:27 +05:00
DumpPython Filter / Controls
This commit is contained in:
parent
64966917fb
commit
36f8af7f1d
@ -11,6 +11,12 @@
|
||||
#include <TColStd_HSequenceOfInteger.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
||||
#ifdef _DEBUG_
|
||||
static int MYDEBUG = 0;
|
||||
#else
|
||||
static int MYDEBUG = 0;
|
||||
#endif
|
||||
|
||||
namespace SMESH
|
||||
{
|
||||
|
||||
@ -31,10 +37,53 @@ namespace SMESH
|
||||
std::string aString = myStream.str();
|
||||
TCollection_AsciiString aCollection(Standard_CString(aString.c_str()));
|
||||
aSMESHGen->AddToPythonScript(aStudy->StudyId(),aCollection);
|
||||
if(MYDEBUG) MESSAGE(aString);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TPythonDump&
|
||||
TPythonDump::
|
||||
operator<<(long int theArg){
|
||||
myStream<<theArg;
|
||||
return *this;
|
||||
}
|
||||
|
||||
TPythonDump&
|
||||
TPythonDump::
|
||||
operator<<(int theArg){
|
||||
myStream<<theArg;
|
||||
return *this;
|
||||
}
|
||||
|
||||
TPythonDump&
|
||||
TPythonDump::
|
||||
operator<<(double theArg){
|
||||
myStream<<theArg;
|
||||
return *this;
|
||||
}
|
||||
|
||||
TPythonDump&
|
||||
TPythonDump::
|
||||
operator<<(float theArg){
|
||||
myStream<<theArg;
|
||||
return *this;
|
||||
}
|
||||
|
||||
TPythonDump&
|
||||
TPythonDump::
|
||||
operator<<(const void* theArg){
|
||||
myStream<<theArg;
|
||||
return *this;
|
||||
}
|
||||
|
||||
TPythonDump&
|
||||
TPythonDump::
|
||||
operator<<(const char* theArg){
|
||||
myStream<<theArg;
|
||||
return *this;
|
||||
}
|
||||
|
||||
TPythonDump&
|
||||
TPythonDump::
|
||||
operator<<(const SMESH::ElementType& theArg)
|
||||
@ -106,7 +155,7 @@ namespace SMESH
|
||||
TPythonDump::
|
||||
operator<<(SMESH::FilterManager_i* theArg)
|
||||
{
|
||||
myStream<<"aFilterManager"<<theArg;
|
||||
myStream<<"aFilterManager";
|
||||
return *this;
|
||||
}
|
||||
|
||||
@ -439,6 +488,7 @@ TCollection_AsciiString SMESH_Gen_i::DumpPython_impl
|
||||
|
||||
aScript += "def RebuildData(theStudy):";
|
||||
aScript += "\n\tsmesh = salome.lcc.FindOrLoadComponent(\"FactoryServer\", \"SMESH\")";
|
||||
aScript += "\n\taFilterManager = smesh.CreateFilterManager()";
|
||||
if ( isPublished )
|
||||
aScript += "\n\tsmesh.SetCurrentStudy(theStudy)";
|
||||
else
|
||||
|
@ -1554,7 +1554,6 @@ SMESH::FilterManager_ptr SMESH_Gen_i::CreateFilterManager()
|
||||
{
|
||||
SMESH::FilterManager_i* aFilter = new SMESH::FilterManager_i();
|
||||
SMESH::FilterManager_var anObj = aFilter->_this();
|
||||
TPythonDump()<<aFilter<<" = smesh.CreateFilterManager()";
|
||||
return anObj._retn();
|
||||
}
|
||||
|
||||
@ -1846,12 +1845,13 @@ CORBA::Boolean Filter_i::SetCriteria( const SMESH::Filter::Criteria& theCriteria
|
||||
if ( myPredicate != 0 )
|
||||
myPredicate->Destroy();
|
||||
|
||||
SMESH::FilterManager_i* aFilter = new SMESH::FilterManager_i();
|
||||
FilterManager_ptr aFilterMgr = aFilter->_this();
|
||||
SMESH::FilterManager_i* aFilter = new SMESH::FilterManager_i();
|
||||
FilterManager_ptr aFilterMgr = aFilter->_this();
|
||||
|
||||
// CREATE two lists ( PREDICATES and LOG OP )
|
||||
|
||||
// Criterion
|
||||
TPythonDump()<<"aCriteria = []";
|
||||
std::list<SMESH::Predicate_ptr> aPredicates;
|
||||
std::list<int> aBinaries;
|
||||
for ( int i = 0, n = theCriteria.length(); i < n; i++ )
|
||||
@ -1866,7 +1866,7 @@ CORBA::Boolean Filter_i::SetCriteria( const SMESH::Filter::Criteria& theCriteria
|
||||
ElementType aTypeOfElem = theCriteria[ i ].TypeOfElement;
|
||||
long aPrecision = theCriteria[ i ].Precision;
|
||||
|
||||
TPythonDump()<<this<<".SetCriteria(SMESH.Filter.Criteria("<<
|
||||
TPythonDump()<<"aCriteria.append(SMESH.Filter.Criterion("<<
|
||||
aCriterion<<","<<aCompare<<","<<aThreshold<<","<<aUnary<<","<<aBinary<<","<<
|
||||
aTolerance<<",'"<<aThresholdStr<<"',"<<aTypeOfElem<<","<<aPrecision<<"))";
|
||||
|
||||
@ -2007,6 +2007,7 @@ CORBA::Boolean Filter_i::SetCriteria( const SMESH::Filter::Criteria& theCriteria
|
||||
aBinaries.push_back( aBinary );
|
||||
|
||||
} // end of for
|
||||
TPythonDump()<<this<<".SetCriteria(aCriteria)";
|
||||
|
||||
// CREATE ONE PREDICATE FROM PREVIOUSLY CREATED MAP
|
||||
|
||||
@ -2439,7 +2440,7 @@ FilterLibrary_i::~FilterLibrary_i()
|
||||
//=======================================================================
|
||||
Filter_ptr FilterLibrary_i::Copy( const char* theFilterName )
|
||||
{
|
||||
Filter_ptr aRes;
|
||||
Filter_ptr aRes = Filter::_nil();
|
||||
LDOM_Node aFilter = findFilter( theFilterName, myDoc );
|
||||
|
||||
if ( aFilter.isNull() )
|
||||
|
@ -41,40 +41,22 @@ namespace SMESH
|
||||
virtual ~TPythonDump();
|
||||
|
||||
TPythonDump&
|
||||
operator<<(long int theArg){
|
||||
myStream<<theArg;
|
||||
return *this;
|
||||
}
|
||||
operator<<(long int theArg);
|
||||
|
||||
TPythonDump&
|
||||
operator<<(int theArg){
|
||||
myStream<<theArg;
|
||||
return *this;
|
||||
}
|
||||
operator<<(int theArg);
|
||||
|
||||
TPythonDump&
|
||||
operator<<(double theArg){
|
||||
myStream<<theArg;
|
||||
return *this;
|
||||
}
|
||||
operator<<(double theArg);
|
||||
|
||||
TPythonDump&
|
||||
operator<<(float theArg){
|
||||
myStream<<theArg;
|
||||
return *this;
|
||||
}
|
||||
operator<<(float theArg);
|
||||
|
||||
TPythonDump&
|
||||
operator<<(const void* theArg){
|
||||
myStream<<theArg;
|
||||
return *this;
|
||||
}
|
||||
operator<<(const void* theArg);
|
||||
|
||||
TPythonDump&
|
||||
operator<<(const char* theArg){
|
||||
myStream<<theArg;
|
||||
return *this;
|
||||
}
|
||||
operator<<(const char* theArg);
|
||||
|
||||
TPythonDump&
|
||||
operator<<(const SMESH::ElementType& theArg);
|
||||
|
Loading…
x
Reference in New Issue
Block a user