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