#include <TColStd_HSequenceOfInteger.hxx>
#include <TCollection_AsciiString.hxx>
+#ifdef _DEBUG_
+static int MYDEBUG = 0;
+#else
+static int MYDEBUG = 0;
+#endif
+
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)
TPythonDump::
operator<<(SMESH::FilterManager_i* theArg)
{
- myStream<<"aFilterManager"<<theArg;
+ myStream<<"aFilterManager";
return *this;
}
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
{
SMESH::FilterManager_i* aFilter = new SMESH::FilterManager_i();
SMESH::FilterManager_var anObj = aFilter->_this();
- TPythonDump()<<aFilter<<" = smesh.CreateFilterManager()";
return anObj._retn();
}
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++ )
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<<"))";
-
+
SMESH::Predicate_ptr aPredicate = SMESH::Predicate::_nil();
SMESH::NumericalFunctor_ptr aFunctor = SMESH::NumericalFunctor::_nil();
aBinaries.push_back( aBinary );
} // end of for
+ TPythonDump()<<this<<".SetCriteria(aCriteria)";
// CREATE ONE PREDICATE FROM PREVIOUSLY CREATED MAP
//=======================================================================
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() )
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);