Porting to Qt4.

This commit is contained in:
mkr 2007-07-02 11:19:22 +00:00
parent 3ffc5a5de6
commit 52be74e46c
8 changed files with 73 additions and 20 deletions

View File

@ -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

View File

@ -31,7 +31,6 @@
#include "Handle_GEOM_EdgeFilter.hxx" #include "Handle_GEOM_EdgeFilter.hxx"
#endif #endif
#include "SALOME_InteractiveObject.hxx"
#include "GEOM_ShapeTypeFilter.hxx" #include "GEOM_ShapeTypeFilter.hxx"
// IDL Headers // IDL Headers

View File

@ -23,7 +23,7 @@
// function : GEOM_LogicalFilter // function : GEOM_LogicalFilter
// purpose : // purpose :
//======================================================================= //=======================================================================
GEOM_LogicalFilter::GEOM_LogicalFilter( const QPtrList<SUIT_SelectionFilter>& lst, const int op ) GEOM_LogicalFilter::GEOM_LogicalFilter( const QList<SUIT_SelectionFilter*>& lst, const int op )
: SUIT_SelectionFilter() : SUIT_SelectionFilter()
{ {
setFilters( lst ); setFilters( lst );
@ -45,8 +45,12 @@ GEOM_LogicalFilter::~GEOM_LogicalFilter()
bool GEOM_LogicalFilter::isOk( const SUIT_DataOwner* owner ) const bool GEOM_LogicalFilter::isOk( const SUIT_DataOwner* owner ) const
{ {
GEOM_LogicalFilter* non_const_this = (GEOM_LogicalFilter*)this; 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<SUIT_SelectionFilter*> it( non_const_this->myFilters );
while ( it.hasNext() )
{ {
SUIT_SelectionFilter* filter = it.next();
if ( !filter ) continue;
if ( myOperation == LO_OR && filter->isOk( owner ) ) if ( myOperation == LO_OR && filter->isOk( owner ) )
return true; return true;
if ( myOperation == LO_AND && !filter->isOk( owner ) ) if ( myOperation == LO_AND && !filter->isOk( owner ) )
@ -62,7 +66,7 @@ bool GEOM_LogicalFilter::isOk( const SUIT_DataOwner* owner ) const
// function : setFilters // function : setFilters
// purpose : // purpose :
//======================================================================= //=======================================================================
void GEOM_LogicalFilter::setFilters( const QPtrList<SUIT_SelectionFilter>& lst ) void GEOM_LogicalFilter::setFilters( const QList<SUIT_SelectionFilter*>& lst )
{ {
myFilters = lst; myFilters = lst;
} }
@ -80,7 +84,7 @@ void GEOM_LogicalFilter::setOperation( const int op )
// function : getFilters // function : getFilters
// purpose : // purpose :
//======================================================================= //=======================================================================
QPtrList<SUIT_SelectionFilter> GEOM_LogicalFilter::getFilters() const QList<SUIT_SelectionFilter*> GEOM_LogicalFilter::getFilters() const
{ {
return myFilters; return myFilters;
} }

View File

@ -23,7 +23,7 @@
#include <SUIT_SelectionFilter.h> #include <SUIT_SelectionFilter.h>
#include <Standard_Macro.hxx> #include <Standard_Macro.hxx>
#include <qptrlist.h> #include <QList>
class Standard_EXPORT GEOM_LogicalFilter : public SUIT_SelectionFilter class Standard_EXPORT GEOM_LogicalFilter : public SUIT_SelectionFilter
{ {
@ -31,19 +31,19 @@ public:
enum { LO_OR, LO_AND, LO_NOT, LO_UNDEFINED }; enum { LO_OR, LO_AND, LO_NOT, LO_UNDEFINED };
public: public:
GEOM_LogicalFilter( const QPtrList<SUIT_SelectionFilter>& lst, const int op ); GEOM_LogicalFilter( const QList<SUIT_SelectionFilter*>& lst, const int op );
~GEOM_LogicalFilter(); ~GEOM_LogicalFilter();
virtual bool isOk( const SUIT_DataOwner* ) const; virtual bool isOk( const SUIT_DataOwner* ) const;
void setFilters( const QPtrList<SUIT_SelectionFilter>& lst ); void setFilters( const QList<SUIT_SelectionFilter*>& lst );
void setOperation( const int ); void setOperation( const int );
QPtrList<SUIT_SelectionFilter> getFilters() const; QList<SUIT_SelectionFilter*> getFilters() const;
int getOperation() const; int getOperation() const;
private: private:
QPtrList<SUIT_SelectionFilter> myFilters; QList<SUIT_SelectionFilter*> myFilters;
int myOperation; int myOperation;
}; };

View File

@ -45,6 +45,6 @@ GEOM_PreviewFilter::~GEOM_PreviewFilter()
bool GEOM_PreviewFilter::isOk( const SUIT_DataOwner* sOwner ) const bool GEOM_PreviewFilter::isOk( const SUIT_DataOwner* sOwner ) const
{ {
const LightApp_DataOwner* owner = dynamic_cast<const LightApp_DataOwner*> ( sOwner ); const LightApp_DataOwner* owner = dynamic_cast<const LightApp_DataOwner*> ( sOwner );
return ( owner && strstr( owner->entry(), "TEMP" ) ); return ( owner && strstr( owner->entry().toStdString().c_str(), "TEMP" ) );
} }

View File

@ -29,9 +29,6 @@
#include <SUIT_Session.h> #include <SUIT_Session.h>
#include <SALOMEDSClient.hxx>
//======================================================================= //=======================================================================
// function : GEOM_SelectionFilter // function : GEOM_SelectionFilter
// purpose : // purpose :
@ -84,7 +81,7 @@ GEOM::GEOM_Object_ptr GEOM_SelectionFilter::getObject( const SUIT_DataOwner* sOw
_PTR(Study) study = appStudy->studyDS(); _PTR(Study) study = appStudy->studyDS();
QString entry = owner->entry(); 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 ) ) if( extractReference && aSO && aSO->ReferencedObject( aRefSO ) )
aSO = aRefSO; aSO = aRefSO;
@ -164,7 +161,7 @@ void GEOM_SelectionFilter::add( const int type )
void GEOM_SelectionFilter::remove( const int type ) void GEOM_SelectionFilter::remove( const int type )
{ {
if ( contains( type ) ) if ( contains( type ) )
myTypes.remove( type ); myTypes.removeAll( type );
} }
//======================================================================= //=======================================================================

View File

@ -24,7 +24,7 @@
#include <TopoDS_Shape.hxx> #include <TopoDS_Shape.hxx>
#include <qvaluelist.h> #include <QList>
// IDL Headers // IDL Headers
#include <SALOMEconfig.h> #include <SALOMEconfig.h>
@ -52,7 +52,7 @@ protected:
bool isShapeOk( const TopoDS_Shape& ) const; bool isShapeOk( const TopoDS_Shape& ) const;
private: private:
QValueList<int> myTypes; QList<int> myTypes;
bool myAll; bool myAll;
}; };

View File

@ -21,7 +21,7 @@ SUBDIRS += GEOMImpl
SUBDIRS += GEOM_I SUBDIRS += GEOM_I
SUBDIRS += GEOMClient SUBDIRS += GEOMClient
SUBDIRS += DlgRef SUBDIRS += DlgRef
#SUBDIRS += GEOMFiltersSelection SUBDIRS += GEOMFiltersSelection
#SUBDIRS += GEOMGUI #SUBDIRS += GEOMGUI
#SUBDIRS += GEOMBase #SUBDIRS += GEOMBase
#SUBDIRS += GEOMToolsGUI #SUBDIRS += GEOMToolsGUI