From: mkr Date: Mon, 2 Jul 2007 11:19:22 +0000 (+0000) Subject: Porting to Qt4. X-Git-Tag: snapshot_171207~37 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=52be74e46c48f8beff4b773744ce3e0535b81991;p=modules%2Fgeom.git Porting to Qt4. --- diff --git a/src/GEOMFiltersSelection/GEOMFiltersSelection.pro b/src/GEOMFiltersSelection/GEOMFiltersSelection.pro new file mode 100644 index 000000000..83d97dfe4 --- /dev/null +++ b/src/GEOMFiltersSelection/GEOMFiltersSelection.pro @@ -0,0 +1,53 @@ +TEMPLATE = lib +TARGET = GEOMFiltersSelection +DESTDIR = ../../lib +MOC_DIR = ../../moc +OBJECTS_DIR = ../../obj/$$TARGET + +QT_INCLUDES = $$(QTDIR)/include $$(QTDIR)/include/QtCore $$(QTDIR)/include/QtGui $$(QTDIR)/include/QtOpenGL $$(QTDIR)/include/QtXml + +CASROOT = $$(CASROOT) +CAS_CPPFLAGS = $${CASROOT}/inc + +BOOST_CPPFLAGS = $$(BOOSTDIR)/include + +GUI_CXXFLAGS = $$(GUI_ROOT_DIR)/include/salome + +KERNEL_CXXFLAGS = $$(KERNEL_ROOT_DIR)/include/salome + +CORBA_INCLUDES = $$(OMNIORBDIR)/include $$(OMNIORBDIR)/include/omniORB4 $$(OMNIORBDIR)/include/COS + +GUI_LDFLAGS = -L$$(GUI_ROOT_DIR)/lib/salome + +KERNEL_LDFLAGS = -L$$(KERNEL_ROOT_DIR)/lib/salome + +INCLUDEPATH += $${QT_INCLUDES} $${CAS_CPPFLAGS} $${BOOST_CPPFLAGS} $${GUI_CXXFLAGS} $${KERNEL_CXXFLAGS} $${CORBA_CXXFLAGS} $${CORBA_INCLUDES} ../GEOMClient $$(GEOM_ROOT_DIR)/idl $$(GEOM_ROOT_DIR)/salome_adm/unix + +LIBS += -L$$(GEOM_ROOT_DIR)/idl -lSalomeIDLGEOM -L$$(GEOM_ROOT_DIR)/lib -lGEOMClient $${GUI_LDFLAGS} -lsuit -lSalomeApp -lSalomeSession $${KERNEL_LDFLAGS} -lSalomeLifeCycleCORBA -lSalomeContainer -lTOOLSDS + +CONFIG -= debug release debug_and_release +CONFIG += qt thread debug dll shared + +win32:DEFINES += WIN32 +DEFINES += OCC_VERSION_MAJOR=6 OCC_VERSION_MINOR=1 OCC_VERSION_MAINTENANCE=1 LIN LINTEL CSFDB No_exception HAVE_CONFIG_H HAVE_LIMITS_H HAVE_WOK_CONFIG_H OCC_CONVERT_SIGNALS OMNIORB_VERSION=4 __x86__ __linux__ COMP_CORBA_DOUBLE COMP_CORBA_LONG + +HEADERS = GEOM_SelectionFilter.h +HEADERS += GEOM_EdgeFilter.h +HEADERS += GEOM_FaceFilter.h +HEADERS += GEOM_TypeFilter.h +HEADERS += GEOM_PreviewFilter.h +HEADERS += GEOM_LogicalFilter.h +HEADERS += GEOM_OCCFilter.h + +SOURCES = GEOM_SelectionFilter.cxx +SOURCES += GEOM_EdgeFilter.cxx +SOURCES += GEOM_FaceFilter.cxx +SOURCES += GEOM_TypeFilter.cxx +SOURCES += GEOM_PreviewFilter.cxx +SOURCES += GEOM_LogicalFilter.cxx +SOURCES += GEOM_OCCFilter.cxx + +includes.files = $$HEADERS +includes.path = ../../include + +INSTALLS += includes diff --git a/src/GEOMFiltersSelection/GEOM_EdgeFilter.hxx b/src/GEOMFiltersSelection/GEOM_EdgeFilter.hxx index 54a19c1de..3dd94d851 100644 --- a/src/GEOMFiltersSelection/GEOM_EdgeFilter.hxx +++ b/src/GEOMFiltersSelection/GEOM_EdgeFilter.hxx @@ -31,7 +31,6 @@ #include "Handle_GEOM_EdgeFilter.hxx" #endif -#include "SALOME_InteractiveObject.hxx" #include "GEOM_ShapeTypeFilter.hxx" // IDL Headers diff --git a/src/GEOMFiltersSelection/GEOM_LogicalFilter.cxx b/src/GEOMFiltersSelection/GEOM_LogicalFilter.cxx index a67a99219..d9d43d635 100644 --- a/src/GEOMFiltersSelection/GEOM_LogicalFilter.cxx +++ b/src/GEOMFiltersSelection/GEOM_LogicalFilter.cxx @@ -23,7 +23,7 @@ // function : GEOM_LogicalFilter // purpose : //======================================================================= -GEOM_LogicalFilter::GEOM_LogicalFilter( const QPtrList& lst, const int op ) +GEOM_LogicalFilter::GEOM_LogicalFilter( const QList& lst, const int op ) : SUIT_SelectionFilter() { setFilters( lst ); @@ -45,8 +45,12 @@ GEOM_LogicalFilter::~GEOM_LogicalFilter() bool GEOM_LogicalFilter::isOk( const SUIT_DataOwner* owner ) const { GEOM_LogicalFilter* non_const_this = (GEOM_LogicalFilter*)this; - for ( SUIT_SelectionFilter* filter = non_const_this->myFilters.first(); filter; filter = non_const_this->myFilters.next() ) + QListIterator it( non_const_this->myFilters ); + while ( it.hasNext() ) { + SUIT_SelectionFilter* filter = it.next(); + if ( !filter ) continue; + if ( myOperation == LO_OR && filter->isOk( owner ) ) return true; if ( myOperation == LO_AND && !filter->isOk( owner ) ) @@ -62,7 +66,7 @@ bool GEOM_LogicalFilter::isOk( const SUIT_DataOwner* owner ) const // function : setFilters // purpose : //======================================================================= -void GEOM_LogicalFilter::setFilters( const QPtrList& lst ) +void GEOM_LogicalFilter::setFilters( const QList& lst ) { myFilters = lst; } @@ -80,7 +84,7 @@ void GEOM_LogicalFilter::setOperation( const int op ) // function : getFilters // purpose : //======================================================================= -QPtrList GEOM_LogicalFilter::getFilters() const +QList GEOM_LogicalFilter::getFilters() const { return myFilters; } diff --git a/src/GEOMFiltersSelection/GEOM_LogicalFilter.h b/src/GEOMFiltersSelection/GEOM_LogicalFilter.h index dbb590c49..d17469cf8 100644 --- a/src/GEOMFiltersSelection/GEOM_LogicalFilter.h +++ b/src/GEOMFiltersSelection/GEOM_LogicalFilter.h @@ -23,7 +23,7 @@ #include #include -#include +#include class Standard_EXPORT GEOM_LogicalFilter : public SUIT_SelectionFilter { @@ -31,19 +31,19 @@ public: enum { LO_OR, LO_AND, LO_NOT, LO_UNDEFINED }; public: - GEOM_LogicalFilter( const QPtrList& lst, const int op ); + GEOM_LogicalFilter( const QList& lst, const int op ); ~GEOM_LogicalFilter(); virtual bool isOk( const SUIT_DataOwner* ) const; - void setFilters( const QPtrList& lst ); + void setFilters( const QList& lst ); void setOperation( const int ); - QPtrList getFilters() const; + QList getFilters() const; int getOperation() const; private: - QPtrList myFilters; - int myOperation; + QList myFilters; + int myOperation; }; diff --git a/src/GEOMFiltersSelection/GEOM_PreviewFilter.cxx b/src/GEOMFiltersSelection/GEOM_PreviewFilter.cxx index 1be775274..1bd2e4ad4 100644 --- a/src/GEOMFiltersSelection/GEOM_PreviewFilter.cxx +++ b/src/GEOMFiltersSelection/GEOM_PreviewFilter.cxx @@ -45,6 +45,6 @@ GEOM_PreviewFilter::~GEOM_PreviewFilter() bool GEOM_PreviewFilter::isOk( const SUIT_DataOwner* sOwner ) const { const LightApp_DataOwner* owner = dynamic_cast ( sOwner ); - return ( owner && strstr( owner->entry(), "TEMP" ) ); + return ( owner && strstr( owner->entry().toStdString().c_str(), "TEMP" ) ); } diff --git a/src/GEOMFiltersSelection/GEOM_SelectionFilter.cxx b/src/GEOMFiltersSelection/GEOM_SelectionFilter.cxx index 6d20b194c..6fe957291 100644 --- a/src/GEOMFiltersSelection/GEOM_SelectionFilter.cxx +++ b/src/GEOMFiltersSelection/GEOM_SelectionFilter.cxx @@ -29,9 +29,6 @@ #include -#include - - //======================================================================= // function : GEOM_SelectionFilter // purpose : @@ -84,7 +81,7 @@ GEOM::GEOM_Object_ptr GEOM_SelectionFilter::getObject( const SUIT_DataOwner* sOw _PTR(Study) study = appStudy->studyDS(); QString entry = owner->entry(); - _PTR(SObject) aSO (study->FindObjectID(entry.latin1())), aRefSO; + _PTR(SObject) aSO (study->FindObjectID(entry.toStdString())), aRefSO; if( extractReference && aSO && aSO->ReferencedObject( aRefSO ) ) aSO = aRefSO; @@ -164,7 +161,7 @@ void GEOM_SelectionFilter::add( const int type ) void GEOM_SelectionFilter::remove( const int type ) { if ( contains( type ) ) - myTypes.remove( type ); + myTypes.removeAll( type ); } //======================================================================= diff --git a/src/GEOMFiltersSelection/GEOM_SelectionFilter.h b/src/GEOMFiltersSelection/GEOM_SelectionFilter.h index 45b0fd969..ecef4a1ef 100644 --- a/src/GEOMFiltersSelection/GEOM_SelectionFilter.h +++ b/src/GEOMFiltersSelection/GEOM_SelectionFilter.h @@ -24,7 +24,7 @@ #include -#include +#include // IDL Headers #include @@ -52,7 +52,7 @@ protected: bool isShapeOk( const TopoDS_Shape& ) const; private: - QValueList myTypes; + QList myTypes; bool myAll; }; diff --git a/src/src.pro b/src/src.pro index 82cfb647b..a62956e63 100644 --- a/src/src.pro +++ b/src/src.pro @@ -21,7 +21,7 @@ SUBDIRS += GEOMImpl SUBDIRS += GEOM_I SUBDIRS += GEOMClient SUBDIRS += DlgRef -#SUBDIRS += GEOMFiltersSelection +SUBDIRS += GEOMFiltersSelection #SUBDIRS += GEOMGUI #SUBDIRS += GEOMBase #SUBDIRS += GEOMToolsGUI