From a0f46af000e5038df100106897aa04901ad59e49 Mon Sep 17 00:00:00 2001 From: mzn Date: Fri, 2 Dec 2016 17:30:47 +0300 Subject: [PATCH] Porting on OCCT 7.0 and Qt 5. Make compilable version. --- src/HYDROData/HYDROData_Entity.cxx | 6 +-- src/HYDROData/HYDROData_Entity.h | 2 +- src/HYDROData/HYDROData_LandCoverMap.h | 1 + src/HYDROData/HYDROData_Zone.cxx | 3 +- src/HYDROGUI/CMakeLists.txt | 54 +++++++++---------- src/HYDROGUI/HYDROGUI_AISShape.cxx | 4 +- src/HYDROGUI/HYDROGUI_AISTrihedron.cxx | 6 +-- src/HYDROGUI/HYDROGUI_BathymetryBoundsOp.cxx | 2 +- src/HYDROGUI/HYDROGUI_CalculationDlg.cxx | 2 +- src/HYDROGUI/HYDROGUI_DataBrowser.cxx | 2 +- src/HYDROGUI/HYDROGUI_ExportFileOp.h | 4 -- src/HYDROGUI/HYDROGUI_GeomObjectDlg.cxx | 8 +-- .../HYDROGUI_ImportLandCoverMapDlg.cxx | 4 +- .../HYDROGUI_ImportLandCoverMapOp.cxx | 3 +- .../HYDROGUI_ImportObstacleFromFileOp.cxx | 8 +-- src/HYDROGUI/HYDROGUI_ImportPolylineOp.cxx | 6 +-- src/HYDROGUI/HYDROGUI_ImportProfilesOp.cxx | 2 +- src/HYDROGUI/HYDROGUI_ImportSinusXOp.cxx | 2 +- src/HYDROGUI/HYDROGUI_LandCoverMapPrs.cxx | 10 ++-- src/HYDROGUI/HYDROGUI_LandCoverMapPrs.h | 9 ++-- src/HYDROGUI/HYDROGUI_ListModel.cxx | 26 +++++---- src/HYDROGUI/HYDROGUI_ListModel.h | 3 +- src/HYDROGUI/HYDROGUI_OCCDisplayer.cxx | 39 ++++++++++---- src/HYDROGUI/HYDROGUI_OCCDisplayer.h | 10 ++++ src/HYDROGUI/HYDROGUI_PriorityTableModel.cxx | 1 - src/HYDROGUI/HYDROGUI_PriorityWidget.cxx | 10 ++-- src/HYDROGUI/HYDROGUI_Shape.cxx | 11 ++-- src/HYDROGUI/HYDROGUI_Shape.h | 2 +- src/HYDROGUI/HYDROGUI_ShapeBathymetry.cxx | 22 ++++---- src/HYDROGUI/HYDROGUI_ShapeBathymetry.h | 4 +- src/HYDROGUI/HYDROGUI_ShapeImage.cxx | 15 +++--- src/HYDROGUI/HYDROGUI_ShapeImage.h | 10 ++-- src/HYDROGUI/HYDROGUI_ShapeLandCoverMap.cxx | 12 ++--- src/HYDROGUI/HYDROGUI_ShapeLandCoverMap.h | 6 +-- src/HYDROGUI/HYDROGUI_StricklerTableDlg.cxx | 18 +++---- .../HYDROGUI_StricklerTypeComboBox.cxx | 2 +- src/HYDROGUI/HYDROGUI_Tool.cxx | 4 +- src/HYDROGUI/HYDROGUI_Tool2.cxx | 2 +- src/HYDROGUI/HYDROGUI_VTKPrsShape.cxx | 3 +- src/HYDROGUI/HYDROGUI_ZLayers.cxx | 10 ++-- src/HYDROGUI/HYDROGUI_ZLayers2.cxx | 2 +- src/HYDROGUI/HYDROGUI_Zone.cxx | 3 +- src/HYDROPy/CMakeLists.txt | 2 +- src/HYDROPy/HYDROData_CalculationCase.sip | 40 +++++++------- src/HYDROPy/HYDROData_Channel.sip | 8 +-- src/HYDROPy/HYDROData_Document.sip | 9 ++-- src/HYDROPy/HYDROData_Entity.sip | 4 +- src/HYDROPy/HYDROData_IInterpolator.sip | 4 +- src/HYDROPy/HYDROData_Image.sip | 15 +++--- src/HYDROPy/HYDROData_ImmersibleZone.sip | 4 +- src/HYDROPy/HYDROData_LandCoverMap.sip | 8 +-- src/HYDROPy/HYDROData_Object.sip | 8 +-- src/HYDROPy/HYDROData_Polyline3D.sip | 14 ++--- src/HYDROPy/HYDROData_Profile.sip | 4 +- src/HYDROPy/HYDROData_Region.sip | 4 +- src/HYDROPy/HYDROData_SequenceOfObjects.sip | 12 ++--- src/HYDROPy/HYDROData_Stream.sip | 14 ++--- src/HYDROPy/HYDROData_Zone.sip | 16 +++--- src/HYDRO_tests/TestViewer.cxx | 29 +++++----- src/HYDRO_tests/TestViewer.h | 7 +-- src/HYDRO_tests/test_HYDROData_Bathymetry.h | 1 - .../test_HYDROData_LandCoverMap.cxx | 1 - src/HYDRO_tests/test_HYDROData_Main.cxx | 2 +- src/HYDRO_tests/test_HYDROData_Profile.h | 1 - src/HYDRO_tests/test_HYDROGUI_ListModel.cxx | 6 +-- src/HYDRO_tests/test_HYDROGUI_Shape.cxx | 4 +- 66 files changed, 290 insertions(+), 280 deletions(-) diff --git a/src/HYDROData/HYDROData_Entity.cxx b/src/HYDROData/HYDROData_Entity.cxx index ce654789..c5193f91 100644 --- a/src/HYDROData/HYDROData_Entity.cxx +++ b/src/HYDROData/HYDROData_Entity.cxx @@ -302,7 +302,7 @@ HYDROData_SequenceOfObjects HYDROData_Entity::GetAllReferenceObjects() const return HYDROData_SequenceOfObjects(); } -Standard_Boolean HYDROData_Entity::GetZLevel( Standard_Integer& theLevel ) const +bool HYDROData_Entity::GetZLevel( Standard_Integer& theLevel ) const { theLevel = -1; @@ -313,11 +313,11 @@ Standard_Boolean HYDROData_Entity::GetZLevel( Standard_Integer& theLevel ) const if ( aLabel.FindAttribute( TDataStd_Integer::GetID(), anIntVal ) ) { theLevel = anIntVal->Get(); - return Standard_True; + return true; } } - return Standard_False; + return false; } void HYDROData_Entity::SetZLevel( const Standard_Integer& theLevel ) diff --git a/src/HYDROData/HYDROData_Entity.h b/src/HYDROData/HYDROData_Entity.h index 2422d4fe..3cfa0bc7 100644 --- a/src/HYDROData/HYDROData_Entity.h +++ b/src/HYDROData/HYDROData_Entity.h @@ -241,7 +241,7 @@ public: /** * Returns the z-level for object presentation, -1 if no z-level. */ - HYDRODATA_EXPORT virtual Standard_Boolean GetZLevel( Standard_Integer& theLevel ) const; + HYDRODATA_EXPORT virtual bool GetZLevel( Standard_Integer& theLevel ) const; /** * Set the z-level for object presentation. diff --git a/src/HYDROData/HYDROData_LandCoverMap.h b/src/HYDROData/HYDROData_LandCoverMap.h index d5dfceb1..7abf5e12 100644 --- a/src/HYDROData/HYDROData_LandCoverMap.h +++ b/src/HYDROData/HYDROData_LandCoverMap.h @@ -111,6 +111,7 @@ public: HYDRODATA_EXPORT bool Add( const Handle( HYDROData_Object )&, const QString& theType ); HYDRODATA_EXPORT bool Add( const Handle( HYDROData_PolylineXY )&, const QString& theType ); + using HYDROData_Entity::Remove; HYDRODATA_EXPORT bool Remove( const TopoDS_Face& ); HYDRODATA_EXPORT bool Remove( const TopTools_ListOfShape& ); diff --git a/src/HYDROData/HYDROData_Zone.cxx b/src/HYDROData/HYDROData_Zone.cxx index 15dfd3aa..3e45fb89 100644 --- a/src/HYDROData/HYDROData_Zone.cxx +++ b/src/HYDROData/HYDROData_Zone.cxx @@ -146,8 +146,7 @@ void HYDROData_Zone::SetMergeObject( const Handle(HYDROData_Entity)& theObject ) Handle(HYDROData_Entity) HYDROData_Zone::GetMergeObject() const { - return Handle(HYDROData_Entity)::DownCast( - GetReferenceObject( DataTag_MergeObject ) ); + return GetReferenceObject( DataTag_MergeObject ); } void HYDROData_Zone::RemoveMergeObject() diff --git a/src/HYDROGUI/CMakeLists.txt b/src/HYDROGUI/CMakeLists.txt index 481b0865..96cbffbc 100644 --- a/src/HYDROGUI/CMakeLists.txt +++ b/src/HYDROGUI/CMakeLists.txt @@ -150,10 +150,10 @@ QT_WRAP_MOC(PROJECT_HEADERS_MOC ${PROJECT_HEADERS}) set(PROJECT_SOURCES HYDROGUI_AbstractDisplayer.cxx - #HYDROGUI_AISShape.cxx - #HYDROGUI_AISTrihedron.cxx + HYDROGUI_AISShape.cxx + HYDROGUI_AISTrihedron.cxx HYDROGUI_BathymetryPrs.cxx - #HYDROGUI_CalculationDlg.cxx + HYDROGUI_CalculationDlg.cxx HYDROGUI_CalculationOp.cxx HYDROGUI_ChannelDlg.cxx HYDROGUI_ChannelOp.cxx @@ -161,7 +161,7 @@ set(PROJECT_SOURCES HYDROGUI_CopyPasteOp.cxx HYDROGUI_CopyPastePositionOp.cxx HYDROGUI_CurveCreatorProfile.cxx - #HYDROGUI_DataBrowser.cxx + HYDROGUI_DataBrowser.cxx HYDROGUI_DataModel.cxx HYDROGUI_DataModelSync.cxx HYDROGUI_DataObject.cxx @@ -184,17 +184,17 @@ set(PROJECT_SOURCES HYDROGUI_ImportImageDlg.cxx HYDROGUI_ImportImageOp.cxx HYDROGUI_ImportLandCoverMapOp.cxx - #HYDROGUI_ImportLandCoverMapDlg.cxx - #HYDROGUI_ImportPolylineOp.cxx - #HYDROGUI_ImportSinusXOp.cxx + HYDROGUI_ImportLandCoverMapDlg.cxx + HYDROGUI_ImportPolylineOp.cxx + HYDROGUI_ImportSinusXOp.cxx HYDROGUI_ExportSinusXOp.cxx HYDROGUI_ExportSinusXDlg.cxx HYDROGUI_ExportLandCoverMapDlg.cxx HYDROGUI_InputPanel.cxx HYDROGUI_LandCoverArgsFilter.cxx HYDROGUI_LandCoverMapDlg.cxx - #HYDROGUI_LandCoverMapOp.cxx - #HYDROGUI_LandCoverMapPrs.cxx + HYDROGUI_LandCoverMapOp.cxx + HYDROGUI_LandCoverMapPrs.cxx HYDROGUI_LocalCSDlg.cxx HYDROGUI_LocalCSOp.cxx HYDROGUI_MergePolylinesDlg.cxx @@ -203,8 +203,8 @@ set(PROJECT_SOURCES HYDROGUI_NameValidator.cxx HYDROGUI_ObjSelector.cxx HYDROGUI_ObserveImageOp.cxx - #HYDROGUI_OCCDisplayer.cxx - #HYDROGUI_OCCSelector.cxx + HYDROGUI_OCCDisplayer.cxx + HYDROGUI_OCCSelector.cxx HYDROGUI_Operation.cxx HYDROGUI_Operations.cxx HYDROGUI_Poly3DDlg.cxx @@ -227,25 +227,25 @@ set(PROJECT_SOURCES HYDROGUI_PrsZoneDriver.cxx HYDROGUI_Region.cxx HYDROGUI_RemoveImageRefsOp.cxx - #HYDROGUI_Shape.cxx - #HYDROGUI_ShapeBathymetry.cxx - #HYDROGUI_ShapeImage.cxx - #HYDROGUI_ShapeLandCoverMap.cxx + HYDROGUI_Shape.cxx + HYDROGUI_ShapeBathymetry.cxx + HYDROGUI_ShapeImage.cxx + HYDROGUI_ShapeLandCoverMap.cxx HYDROGUI_ShowHideOp.cxx HYDROGUI_StreamDlg.cxx HYDROGUI_StreamOp.cxx HYDROGUI_LineEditDoubleValidator.cxx - #HYDROGUI_StricklerTableDlg.cxx + HYDROGUI_StricklerTableDlg.cxx HYDROGUI_StricklerTableOp.cxx - #HYDROGUI_StricklerTypeComboBox.cxx + HYDROGUI_StricklerTypeComboBox.cxx HYDROGUI_SplitPolylinesDlg.cxx HYDROGUI_SplitPolylinesOp.cxx HYDROGUI_SubmersibleOp.cxx - #HYDROGUI_Tool.cxx - #HYDROGUI_Tool2.cxx + HYDROGUI_Tool.cxx + HYDROGUI_Tool2.cxx HYDROGUI_TwoImagesDlg.cxx HYDROGUI_TwoImagesOp.cxx - #HYDROGUI_UpdateObjectOp.cxx + HYDROGUI_UpdateObjectOp.cxx HYDROGUI_VisualStateOp.cxx HYDROGUI_VTKPrs.cxx HYDROGUI_VTKPrsBathymetry.cxx @@ -257,19 +257,19 @@ set(PROJECT_SOURCES HYDROGUI_Wizard.cxx HYDROGUI_Zone.cxx HYDROGUI_ImportGeomObjectOp.cxx - #HYDROGUI_ImportObstacleFromFileOp.cxx + HYDROGUI_ImportObstacleFromFileOp.cxx HYDROGUI_ExportCalculationOp.cxx - #HYDROGUI_GeomObjectDlg.cxx + HYDROGUI_GeomObjectDlg.cxx HYDROGUI_SetColorOp.cxx HYDROGUI_ColorDlg.cxx - #HYDROGUI_ImportProfilesOp.cxx + HYDROGUI_ImportProfilesOp.cxx HYDROGUI_GeoreferencementDlg.cxx HYDROGUI_GeoreferencementOp.cxx HYDROGUI_Actor.cxx - #HYDROGUI_BathymetryBoundsOp.cxx + HYDROGUI_BathymetryBoundsOp.cxx HYDROGUI_TranslateObstacleDlg.cxx HYDROGUI_TranslateObstacleOp.cxx - #HYDROGUI_ListModel.cxx + HYDROGUI_ListModel.cxx HYDROGUI_ZLevelsDlg.cxx HYDROGUI_ZLevelsOp.cxx HYDROGUI_OrderedListWidget.cxx @@ -277,8 +277,8 @@ set(PROJECT_SOURCES HYDROGUI_ZLayers.cxx HYDROGUI_ZLayers2.cxx HYDROGUI_ZLayers3.cxx - #HYDROGUI_PriorityWidget.cxx - #HYDROGUI_PriorityTableModel.cxx + HYDROGUI_PriorityWidget.cxx + HYDROGUI_PriorityTableModel.cxx HYDROGUI_RiverBottomDlg.cxx HYDROGUI_RiverBottomOp.cxx HYDROGUI_ViewerDlg.cxx diff --git a/src/HYDROGUI/HYDROGUI_AISShape.cxx b/src/HYDROGUI/HYDROGUI_AISShape.cxx index c6516527..e714a2e6 100644 --- a/src/HYDROGUI/HYDROGUI_AISShape.cxx +++ b/src/HYDROGUI/HYDROGUI_AISShape.cxx @@ -20,7 +20,7 @@ #include #include #include -#include +#include IMPLEMENT_STANDARD_RTTIEXT(HYDROGUI_AISShape, AIS_Shape) @@ -69,5 +69,5 @@ void HYDROGUI_AISShape::Compute( const Handle(PrsMgr_PresentationManager3d)& the } if( theMode==AIS_Shaded ) - StdPrs_WFDeflectionShape::Add( thePresentation, Shape(), myDrawer ); + StdPrs_WFShape::Add( thePresentation, Shape(), myDrawer ); } diff --git a/src/HYDROGUI/HYDROGUI_AISTrihedron.cxx b/src/HYDROGUI/HYDROGUI_AISTrihedron.cxx index 3642aaa8..79959971 100644 --- a/src/HYDROGUI/HYDROGUI_AISTrihedron.cxx +++ b/src/HYDROGUI/HYDROGUI_AISTrihedron.cxx @@ -79,9 +79,9 @@ void HYDROGUI_AISTrihedron::ComputeAxis( const Handle(Prs3d_Presentation)& thePr theParams.myPfirst, theParams.myPlast ); } -void HYDROGUI_AISTrihedron::Compute(const Handle_Prs3d_Projector& aProjector, - const Handle_Geom_Transformation& aTransformation, - const Handle_Prs3d_Presentation& aPresentation) +void HYDROGUI_AISTrihedron::Compute(const Handle(Prs3d_Projector)& aProjector, + const Handle(Geom_Transformation)& aTransformation, + const Handle(Prs3d_Presentation)& aPresentation) { } diff --git a/src/HYDROGUI/HYDROGUI_BathymetryBoundsOp.cxx b/src/HYDROGUI/HYDROGUI_BathymetryBoundsOp.cxx index 2d2f03b7..36b111ec 100644 --- a/src/HYDROGUI/HYDROGUI_BathymetryBoundsOp.cxx +++ b/src/HYDROGUI/HYDROGUI_BathymetryBoundsOp.cxx @@ -52,7 +52,7 @@ void HYDROGUI_BathymetryBoundsOp::startOperation() bool HYDROGUI_BathymetryBoundsOp::processApply( int& theUpdateFlags, QString& theErrorMsg, QStringList& theBrowseObjectsEntries ) { - Handle_HYDROData_PolylineXY aPolyline = myBath->CreateBoundaryPolyline(); + Handle(HYDROData_PolylineXY) aPolyline = myBath->CreateBoundaryPolyline(); bool isOK = !aPolyline.IsNull(); theUpdateFlags = 0; if( isOK ) { diff --git a/src/HYDROGUI/HYDROGUI_CalculationDlg.cxx b/src/HYDROGUI/HYDROGUI_CalculationDlg.cxx index 778ac431..1133fcb1 100644 --- a/src/HYDROGUI/HYDROGUI_CalculationDlg.cxx +++ b/src/HYDROGUI/HYDROGUI_CalculationDlg.cxx @@ -671,7 +671,7 @@ QStringList HYDROGUI_CalculationDlg::getSelectedAvailableGeomObjects() const void HYDROGUI_CalculationDlg::setEditedObject( const Handle(HYDROData_CalculationCase) theCase ) { myEditedObject = theCase; - myValidator->setEditedObject( theCase ); + myValidator->setEditedObject( myEditedObject ); // Build the calculation case subtree module()->getDataModel()->buildCaseTree( myBrowser->root(), myEditedObject); diff --git a/src/HYDROGUI/HYDROGUI_DataBrowser.cxx b/src/HYDROGUI/HYDROGUI_DataBrowser.cxx index eb5f2539..66eec4f6 100644 --- a/src/HYDROGUI/HYDROGUI_DataBrowser.cxx +++ b/src/HYDROGUI/HYDROGUI_DataBrowser.cxx @@ -277,7 +277,7 @@ HYDROGUI_DataBrowser::HYDROGUI_DataBrowser( HYDROGUI_Module* theModule, // Create OBSelector new HYDROGUI_OBSelector( this, theModule->getApp()->selectionMgr() ); - treeView()->header()->setResizeMode(SUIT_DataObject::VisibilityId, QHeaderView::Fixed); + treeView()->header()->setSectionResizeMode(SUIT_DataObject::VisibilityId, QHeaderView::Fixed); treeView()->header()->moveSection(SUIT_DataObject::NameId,SUIT_DataObject::VisibilityId); treeView()->setColumnWidth(SUIT_DataObject::VisibilityId, VISIBILITY_COLUMN_WIDTH); treeView()->hideColumn( SUIT_DataObject::VisibilityId ); diff --git a/src/HYDROGUI/HYDROGUI_ExportFileOp.h b/src/HYDROGUI/HYDROGUI_ExportFileOp.h index e841688e..2f20d768 100644 --- a/src/HYDROGUI/HYDROGUI_ExportFileOp.h +++ b/src/HYDROGUI/HYDROGUI_ExportFileOp.h @@ -23,10 +23,6 @@ #include class SUIT_FileDlg; -class gp_XYZ; -class Handle_HYDROData_PolylineXY; -class Handle_HYDROData_Polyline3D; -class TopoDS_Face; class HYDROGUI_ExportFileOp : public HYDROGUI_Operation { diff --git a/src/HYDROGUI/HYDROGUI_GeomObjectDlg.cxx b/src/HYDROGUI/HYDROGUI_GeomObjectDlg.cxx index 5180be14..1179745d 100644 --- a/src/HYDROGUI/HYDROGUI_GeomObjectDlg.cxx +++ b/src/HYDROGUI/HYDROGUI_GeomObjectDlg.cxx @@ -179,14 +179,14 @@ void HYDROGUI_GeomObjectDlg::onBrowse() { SUIT_FileDlg* aFileDlg = new SUIT_FileDlg( this, true ); aFileDlg->setWindowTitle( tr("IMPORT_OBSTACLE_FROM_FILE") ); - aFileDlg->setFilter( tr("OBSTACLE_FILTER") ); + aFileDlg->setNameFilter( tr("OBSTACLE_FILTER") ); if ( !lastUsedFilter.isEmpty() ) { - aFileDlg->selectFilter( lastUsedFilter ); + aFileDlg->selectNameFilter( lastUsedFilter ); } if ( aFileDlg->exec() == QDialog::Accepted ) { QString aFileName = aFileDlg->selectedFile(); - lastUsedFilter = aFileDlg->selectedFilter(); + lastUsedFilter = aFileDlg->selectedNameFilter(); if ( !aFileName.isEmpty() ) { myFileName->setText( aFileName ); @@ -261,4 +261,4 @@ void HYDROGUI_GeomObjectDlg::setDefaultName( const QString& theName ) QString HYDROGUI_GeomObjectDlg::getDefaultName() { return myDefaultName; -} \ No newline at end of file +} diff --git a/src/HYDROGUI/HYDROGUI_ImportLandCoverMapDlg.cxx b/src/HYDROGUI/HYDROGUI_ImportLandCoverMapDlg.cxx index d99c13e4..8bca4309 100644 --- a/src/HYDROGUI/HYDROGUI_ImportLandCoverMapDlg.cxx +++ b/src/HYDROGUI/HYDROGUI_ImportLandCoverMapDlg.cxx @@ -269,7 +269,7 @@ void HYDROGUI_ImportLandCoverMapDlg::FillCorrespondenceTable(const QStringList& myCorrTableWidget->setHorizontalHeaderItem(0, aHeader_1); myCorrTableWidget->setHorizontalHeaderItem(1, aHeader_2); myCorrTableWidget->setHorizontalHeaderItem(2, aHeader_3); - myCorrTableWidget->horizontalHeader()->setResizeMode( QHeaderView::ResizeToContents ); + myCorrTableWidget->horizontalHeader()->setSectionResizeMode( QHeaderView::ResizeToContents ); // for (int i = 0; i < aFCSize; i++) { @@ -453,4 +453,4 @@ bool HYDROGUI_ImportLandCoverMapDlg::CheckFirstPageFilling() const return false; } return true; -} \ No newline at end of file +} diff --git a/src/HYDROGUI/HYDROGUI_ImportLandCoverMapOp.cxx b/src/HYDROGUI/HYDROGUI_ImportLandCoverMapOp.cxx index deba3d6c..5cb9d947 100644 --- a/src/HYDROGUI/HYDROGUI_ImportLandCoverMapOp.cxx +++ b/src/HYDROGUI/HYDROGUI_ImportLandCoverMapOp.cxx @@ -495,8 +495,7 @@ void HYDROGUI_ImportLandCoverMapOp::onApply() } else { - Handle(HYDROData_Entity) LCM = Handle(HYDROData_Entity)::DownCast( myLCM ); - LCM->Remove(); + myLCM->Remove(); module()->setObjectRemoved( myLCM ); abort(); } diff --git a/src/HYDROGUI/HYDROGUI_ImportObstacleFromFileOp.cxx b/src/HYDROGUI/HYDROGUI_ImportObstacleFromFileOp.cxx index 5a639978..9c0743c0 100644 --- a/src/HYDROGUI/HYDROGUI_ImportObstacleFromFileOp.cxx +++ b/src/HYDROGUI/HYDROGUI_ImportObstacleFromFileOp.cxx @@ -72,9 +72,9 @@ void HYDROGUI_ImportObstacleFromFileOp::startOperation() } else { myFileDlg = new SUIT_FileDlg( module()->getApp()->desktop(), true ); myFileDlg->setWindowTitle( getName() ); - myFileDlg->setFilter( tr("OBSTACLE_FILTER") ); + myFileDlg->setNameFilter( tr("OBSTACLE_FILTER") ); if ( !lastUsedFilter.isEmpty() ) { - myFileDlg->selectFilter( lastUsedFilter ); + myFileDlg->selectNameFilter( lastUsedFilter ); } connect( myFileDlg, SIGNAL( accepted() ), this, SLOT( onApply() ) ); @@ -118,7 +118,7 @@ bool HYDROGUI_ImportObstacleFromFileOp::processApply( int& theUpdateFlags, } else if ( myFileDlg ) { // Get file name and file filter defined by the user aFileName = myFileDlg->selectedFile(); - lastUsedFilter = myFileDlg->selectedFilter(); + lastUsedFilter = myFileDlg->selectedNameFilter(); } // Check the file name @@ -195,4 +195,4 @@ HYDROGUI_InputPanel* HYDROGUI_ImportObstacleFromFileOp::createInputPanel() const } return aPanel; -} \ No newline at end of file +} diff --git a/src/HYDROGUI/HYDROGUI_ImportPolylineOp.cxx b/src/HYDROGUI/HYDROGUI_ImportPolylineOp.cxx index 7cdbd1ed..82b8f24a 100644 --- a/src/HYDROGUI/HYDROGUI_ImportPolylineOp.cxx +++ b/src/HYDROGUI/HYDROGUI_ImportPolylineOp.cxx @@ -58,7 +58,7 @@ void HYDROGUI_ImportPolylineOp::startOperation() myFileDlg = new SUIT_FileDlg( module()->getApp()->desktop(), true ); myFileDlg->setWindowTitle( getName() ); myFileDlg->setFileMode( SUIT_FileDlg::ExistingFiles ); - myFileDlg->setFilter( tr("POLYLINE_FILTER") ); + myFileDlg->setNameFilter( tr("POLYLINE_FILTER") ); connect( myFileDlg, SIGNAL( accepted() ), this, SLOT( onApply() ) ); connect( myFileDlg, SIGNAL( rejected() ), this, SLOT( onCancel() ) ); @@ -89,7 +89,7 @@ void HYDROGUI_ImportPolylineOp::onApply() if (anExt == "shp") { HYDROData_ShapeFile anImporter; - NCollection_Sequence theEntities; + NCollection_Sequence theEntities; int aShapeTypeOfFile = -1; int aStat = anImporter.ImportPolylines(doc(), aFileName, theEntities, aShapeTypeOfFile ); if (aStat == 1) @@ -119,7 +119,7 @@ void HYDROGUI_ImportPolylineOp::onApply() QApplication::restoreOverrideCursor(); } -void HYDROGUI_ImportPolylineOp::UpdateView( NCollection_Sequence& anEntities) +void HYDROGUI_ImportPolylineOp::UpdateView( NCollection_Sequence& anEntities) { size_t anActiveViewId = HYDROGUI_Tool::GetActiveGraphicsViewId( module() ); if ( anActiveViewId == 0 ) diff --git a/src/HYDROGUI/HYDROGUI_ImportProfilesOp.cxx b/src/HYDROGUI/HYDROGUI_ImportProfilesOp.cxx index deaab0c3..9e12b9ee 100644 --- a/src/HYDROGUI/HYDROGUI_ImportProfilesOp.cxx +++ b/src/HYDROGUI/HYDROGUI_ImportProfilesOp.cxx @@ -52,7 +52,7 @@ void HYDROGUI_ImportProfilesOp::startOperation() myFileDlg = new SUIT_FileDlg( module()->getApp()->desktop(), true ); myFileDlg->setWindowTitle( getName() ); myFileDlg->setFileMode( SUIT_FileDlg::ExistingFiles ); - myFileDlg->setFilter( tr("PROFILE_FILTER") ); + myFileDlg->setNameFilter( tr("PROFILE_FILTER") ); connect( myFileDlg, SIGNAL( accepted() ), this, SLOT( onApply() ) ); connect( myFileDlg, SIGNAL( rejected() ), this, SLOT( onCancel() ) ); diff --git a/src/HYDROGUI/HYDROGUI_ImportSinusXOp.cxx b/src/HYDROGUI/HYDROGUI_ImportSinusXOp.cxx index 0d3f217a..38b5cf4c 100644 --- a/src/HYDROGUI/HYDROGUI_ImportSinusXOp.cxx +++ b/src/HYDROGUI/HYDROGUI_ImportSinusXOp.cxx @@ -59,7 +59,7 @@ void HYDROGUI_ImportSinusXOp::startOperation() myFileDlg = new SUIT_FileDlg( module()->getApp()->desktop(), true ); myFileDlg->setWindowTitle( getName() ); myFileDlg->setFileMode( SUIT_FileDlg::ExistingFiles ); - myFileDlg->setFilter( tr("SINUSX_FILTER") ); + myFileDlg->setNameFilter( tr("SINUSX_FILTER") ); connect( myFileDlg, SIGNAL( accepted() ), this, SLOT( onApply() ) ); connect( myFileDlg, SIGNAL( rejected() ), this, SLOT( onCancel() ) ); diff --git a/src/HYDROGUI/HYDROGUI_LandCoverMapPrs.cxx b/src/HYDROGUI/HYDROGUI_LandCoverMapPrs.cxx index 196bd70d..5685a5f2 100644 --- a/src/HYDROGUI/HYDROGUI_LandCoverMapPrs.cxx +++ b/src/HYDROGUI/HYDROGUI_LandCoverMapPrs.cxx @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include #include @@ -79,12 +79,12 @@ void HYDROGUI_LandCoverMapPrs::UpdateColors() SetTransparency( myLCMap->GetTransparency() ); } -Handle(Aspect_ColorScale) HYDROGUI_LandCoverMapPrs::GetColorScale() const +Handle(AIS_ColorScale) HYDROGUI_LandCoverMapPrs::GetColorScale() const { return myColorScale; } -void HYDROGUI_LandCoverMapPrs::SetColorScale( const Handle(Aspect_ColorScale)& theColorScale ) +void HYDROGUI_LandCoverMapPrs::SetColorScale( const Handle(AIS_ColorScale)& theColorScale ) { myColorScale = theColorScale; double aMin = 0, aMax = 0; @@ -152,7 +152,7 @@ void HYDROGUI_LandCoverMapPrs::Compute( const Handle(PrsMgr_PresentationManager3 } if( theMode==AIS_Shaded ) - StdPrs_WFDeflectionShape::Add( thePresentation, Shape(), myDrawer ); + StdPrs_WFShape::Add( thePresentation, Shape(), myDrawer ); } void HYDROGUI_LandCoverMapPrs::HilightSelected( const Handle(PrsMgr_PresentationManager3d)& thePresentationManager, @@ -166,7 +166,7 @@ void HYDROGUI_LandCoverMapPrs::HilightSelected( const Handle(PrsMgr_Presentation { Handle(StdSelect_BRepOwner) anOwner = Handle(StdSelect_BRepOwner)::DownCast( theOwners.Value( i ) ); if( !anOwner.IsNull() ) - StdPrs_WFDeflectionShape::Add( aSelectPrs, anOwner->Shape(), HilightAttributes() ); + StdPrs_WFShape::Add( aSelectPrs, anOwner->Shape(), HilightAttributes() ); } HilightAttributes()->UIsoAspect()->SetNumber( 0 ); diff --git a/src/HYDROGUI/HYDROGUI_LandCoverMapPrs.h b/src/HYDROGUI/HYDROGUI_LandCoverMapPrs.h index acabf5aa..f9fe4a15 100644 --- a/src/HYDROGUI/HYDROGUI_LandCoverMapPrs.h +++ b/src/HYDROGUI/HYDROGUI_LandCoverMapPrs.h @@ -24,12 +24,11 @@ #include #include -DEFINE_STANDARD_HANDLE( HYDROGUI_LandCoverMapPrs, AIS_ColoredShape ) class HYDROGUI_LandCoverMapPrs : public AIS_ColoredShape { public: - DEFINE_STANDARD_RTTI( HYDROGUI_LandCoverMapPrs ); + DEFINE_STANDARD_RTTIEXT( HYDROGUI_LandCoverMapPrs, AIS_ColoredShape ); HYDROGUI_LandCoverMapPrs( const Handle(HYDROData_LandCoverMap)& ); virtual ~HYDROGUI_LandCoverMapPrs(); @@ -37,8 +36,8 @@ public: Handle(HYDROData_LandCoverMap) GetLandCoverMap() const; void SetLandCoverMap( const Handle(HYDROData_LandCoverMap)& ); - Handle(Aspect_ColorScale) GetColorScale() const; - void SetColorScale( const Handle(Aspect_ColorScale)& ); + Handle(AIS_ColorScale) GetColorScale() const; + void SetColorScale( const Handle(AIS_ColorScale)& ); Handle(HYDROData_StricklerTable) GetTable() const; void SetTable( const Handle(HYDROData_StricklerTable)& ); @@ -59,7 +58,7 @@ protected: private: Handle(HYDROData_LandCoverMap) myLCMap; - Handle(Aspect_ColorScale) myColorScale; + Handle(AIS_ColorScale) myColorScale; Handle(HYDROData_StricklerTable) myTable; }; diff --git a/src/HYDROGUI/HYDROGUI_ListModel.cxx b/src/HYDROGUI/HYDROGUI_ListModel.cxx index b112dd34..79f46d95 100644 --- a/src/HYDROGUI/HYDROGUI_ListModel.cxx +++ b/src/HYDROGUI/HYDROGUI_ListModel.cxx @@ -51,9 +51,6 @@ HYDROGUI_ListModel::HYDROGUI_ListModel( QObject* theParent ) myEye = QPixmap( 16, 16 ); myEye.fill( Qt::black ); } - - // Set the supported drag actions for the items in the model - setSupportedDragActions( Qt::MoveAction | Qt::CopyAction ); } /** @@ -128,9 +125,9 @@ int HYDROGUI_ListModel::rowCount( const QModelIndex &theParent ) const */ void HYDROGUI_ListModel::setObjects( const Object2VisibleList& theObjects ) { + beginResetModel(); myObjects = theObjects; - - reset(); + endResetModel(); } /** @@ -154,9 +151,9 @@ HYDROGUI_ListModel::ObjectList HYDROGUI_ListModel::getObjects() const */ void HYDROGUI_ListModel::addObject( const Object2Visible& theObject ) { + beginResetModel(); myObjects << theObject; - - reset(); + endResetModel(); } /** @@ -172,9 +169,9 @@ void HYDROGUI_ListModel::removeObjectByName( const QString& theObjectName ) } } + beginResetModel(); myObjects.removeAll(anItem); - - reset(); + endResetModel(); } @@ -287,6 +284,14 @@ Qt::DropActions HYDROGUI_ListModel::supportedDropActions() const return Qt::MoveAction | Qt::CopyAction; } +/** +*/ +Qt::DropActions HYDROGUI_ListModel::supportedDragActions() const +{ + // Set the supported drag actions for the items in the model + return Qt::MoveAction | Qt::CopyAction; +} + /** Get list of ids by the list model indexes. @param theIsToSort defines if the list of ids should be sorted in ascending order @@ -492,6 +497,7 @@ void HYDROGUI_ListModel::setDecorationEnabled( const bool theIsToEnable ) void HYDROGUI_ListModel::undoLastMove() { + beginResetModel(); myObjects = myPrevObjects; - reset(); + endResetModel(); } diff --git a/src/HYDROGUI/HYDROGUI_ListModel.h b/src/HYDROGUI/HYDROGUI_ListModel.h index adc0e42c..8d19b52f 100644 --- a/src/HYDROGUI/HYDROGUI_ListModel.h +++ b/src/HYDROGUI/HYDROGUI_ListModel.h @@ -57,6 +57,7 @@ public: virtual bool dropMimeData( const QMimeData* theData, Qt::DropAction theAction, int theRow, int theColumn, const QModelIndex& theParent ); virtual Qt::DropActions supportedDropActions() const; + virtual Qt::DropActions supportedDragActions() const; QList getIds( const QModelIndexList& theIndexes, bool theIsToSort = true ) const; @@ -88,4 +89,4 @@ private: bool myIsDecorationEnabled; }; -#endif \ No newline at end of file +#endif diff --git a/src/HYDROGUI/HYDROGUI_OCCDisplayer.cxx b/src/HYDROGUI/HYDROGUI_OCCDisplayer.cxx index b7505b0c..6f508111 100644 --- a/src/HYDROGUI/HYDROGUI_OCCDisplayer.cxx +++ b/src/HYDROGUI/HYDROGUI_OCCDisplayer.cxx @@ -36,8 +36,7 @@ #include #include #include - -#include +#include #include @@ -163,12 +162,12 @@ HYDROGUI_Shape* HYDROGUI_OCCDisplayer::createShape( const int return aResShape; if( theObject->IsKind( STANDARD_TYPE( HYDROData_Image ) ) ) - aResShape = new HYDROGUI_ShapeImage( theContext, Handle_HYDROData_Image::DownCast( theObject ) ); + aResShape = new HYDROGUI_ShapeImage( theContext, Handle(HYDROData_Image)::DownCast( theObject ) ); else if( theObject->IsKind( STANDARD_TYPE( HYDROData_Bathymetry ) ) ) - aResShape = new HYDROGUI_ShapeBathymetry( this, theContext, Handle_HYDROData_Bathymetry::DownCast( theObject ) ); + aResShape = new HYDROGUI_ShapeBathymetry( this, theContext, Handle(HYDROData_Bathymetry)::DownCast( theObject ) ); else if( theObject->IsKind( STANDARD_TYPE( HYDROData_LandCoverMap ) ) ) { bool isScalarMode = module()->isLandCoversScalarMapModeOn( theViewerId ); - aResShape = new HYDROGUI_ShapeLandCoverMap( this, theContext, Handle_HYDROData_LandCoverMap::DownCast( theObject ), -1, isScalarMode ); + aResShape = new HYDROGUI_ShapeLandCoverMap( this, theContext, Handle(HYDROData_LandCoverMap)::DownCast( theObject ), -1, isScalarMode ); } else aResShape = new HYDROGUI_Shape( theContext, theObject ); @@ -465,10 +464,10 @@ void HYDROGUI_OCCDisplayer::UpdateColorScale( const OCCViewer_Viewer* theViewer } } - Handle(Aspect_ColorScale) aColorScale; + Handle(AIS_ColorScale) aColorScale = GetColorScale( aViewerId ); + Handle(AIS_InteractiveContext) aCtx = theViewer->getAISContext(); if( isDisplayColorScale ) { - aColorScale = aView->ColorScale(); if( !aColorScale.IsNull() ) { aColorScale->SetXPosition( anXPos ); @@ -481,6 +480,8 @@ void HYDROGUI_OCCDisplayer::UpdateColorScale( const OCCViewer_Viewer* theViewer aColorScale->SetTitle( aColorScaleTitle ); aColorScale->SetRange( aColorScaleMin, aColorScaleMax ); + + aColorScale->SetToUpdate(); if ( !isLandCoverColoringOn ) { foreach( HYDROGUI_Shape* aShape, aBathShapes ) { @@ -491,14 +492,17 @@ void HYDROGUI_OCCDisplayer::UpdateColorScale( const OCCViewer_Viewer* theViewer aBathShape->UpdateWithColorScale( aColorScale ); } } + + if ( !aCtx.IsNull() && !aCtx->IsDisplayed( aColorScale ) ) { + aCtx->Display( aColorScale ); + } } - if( !aView->ColorScaleIsDisplayed() ) - aView->ColorScaleDisplay(); } else { - if( aView->ColorScaleIsDisplayed() ) - aView->ColorScaleErase(); + if ( !aCtx.IsNull() && aCtx->IsDisplayed( aColorScale ) ) { + aCtx->Erase( aColorScale ); + } } foreach( HYDROGUI_Shape* aShape, aLandCoverMapShapes ) { @@ -526,3 +530,16 @@ void HYDROGUI_OCCDisplayer::UpdateColorScale( const OCCViewer_Viewer* theViewer myToUpdateColorScale = false; } + +Handle(AIS_ColorScale) HYDROGUI_OCCDisplayer::GetColorScale( const int theViewerId ) +{ + Handle(AIS_ColorScale) aColorScale; + + aColorScale = myColorScales.value( theViewerId, aColorScale ); + if ( aColorScale.IsNull() ) { + aColorScale = new AIS_ColorScale(); + myColorScales.insert( theViewerId, aColorScale ); + } + + return aColorScale; +} diff --git a/src/HYDROGUI/HYDROGUI_OCCDisplayer.h b/src/HYDROGUI/HYDROGUI_OCCDisplayer.h index 968e051e..92e20c81 100644 --- a/src/HYDROGUI/HYDROGUI_OCCDisplayer.h +++ b/src/HYDROGUI/HYDROGUI_OCCDisplayer.h @@ -23,6 +23,7 @@ class HYDROGUI_Shape; class AIS_InteractiveContext; +class AIS_ColorScale; class OCCViewer_ViewManager; class OCCViewer_Viewer; @@ -74,6 +75,13 @@ public: void SetToUpdateColorScale(); + /** + * \brief Get color scale for the viewer. + * \param theViewerId viewer identifier + * \return the color scale + */ + Handle(AIS_ColorScale) GetColorScale( const int theViewerId ); + protected: /** * \brief Erase all viewer objects. @@ -145,6 +153,8 @@ private: private: bool myToUpdateColorScale; + + QMap myColorScales; }; #endif diff --git a/src/HYDROGUI/HYDROGUI_PriorityTableModel.cxx b/src/HYDROGUI/HYDROGUI_PriorityTableModel.cxx index 0d7061cb..0b008616 100644 --- a/src/HYDROGUI/HYDROGUI_PriorityTableModel.cxx +++ b/src/HYDROGUI/HYDROGUI_PriorityTableModel.cxx @@ -530,7 +530,6 @@ void HYDROGUI_PriorityTableModel::undoLastChange() beginResetModel(); myRules = myPrevRules; endResetModel(); - reset(); } /** diff --git a/src/HYDROGUI/HYDROGUI_PriorityWidget.cxx b/src/HYDROGUI/HYDROGUI_PriorityWidget.cxx index e6e15e01..2f84a822 100644 --- a/src/HYDROGUI/HYDROGUI_PriorityWidget.cxx +++ b/src/HYDROGUI/HYDROGUI_PriorityWidget.cxx @@ -154,12 +154,12 @@ HYDROGUI_PriorityWidget::HYDROGUI_PriorityWidget( QWidget* theParent ) // Set resize mode myTable->horizontalHeader()->setStretchLastSection( false); - myTable->horizontalHeader()->setResizeMode( 0, QHeaderView::Stretch ); - myTable->horizontalHeader()->setResizeMode( 1, QHeaderView::ResizeToContents ); - myTable->horizontalHeader()->setResizeMode( 2, QHeaderView::Stretch ); - myTable->horizontalHeader()->setResizeMode( 3, QHeaderView::ResizeToContents ); + myTable->horizontalHeader()->setSectionResizeMode( 0, QHeaderView::Stretch ); + myTable->horizontalHeader()->setSectionResizeMode( 1, QHeaderView::ResizeToContents ); + myTable->horizontalHeader()->setSectionResizeMode( 2, QHeaderView::Stretch ); + myTable->horizontalHeader()->setSectionResizeMode( 3, QHeaderView::ResizeToContents ); - myTable->verticalHeader()->setResizeMode( QHeaderView::ResizeToContents ); + myTable->verticalHeader()->setSectionResizeMode( QHeaderView::ResizeToContents ); // Layout // buttons diff --git a/src/HYDROGUI/HYDROGUI_Shape.cxx b/src/HYDROGUI/HYDROGUI_Shape.cxx index 5b73a7ad..f6bc47ae 100644 --- a/src/HYDROGUI/HYDROGUI_Shape.cxx +++ b/src/HYDROGUI/HYDROGUI_Shape.cxx @@ -480,10 +480,10 @@ void HYDROGUI_Shape::setZLayer( const int theZLayer ) myContext->SetZLayer( myShape, myZLayer ); } -Handle_AIS_InteractiveObject HYDROGUI_Shape::createShape() const +Handle(AIS_InteractiveObject) HYDROGUI_Shape::createShape() const { if( myTopoShape.IsNull() ) { - return Handle_AIS_InteractiveObject(); + return Handle(AIS_InteractiveObject)(); } TopAbs_ShapeEnum aShapeType = myTopoShape.ShapeType(); @@ -513,7 +513,7 @@ void HYDROGUI_Shape::buildShape() if( myShape.IsNull() ) return; - Handle_AIS_Shape anAISShape = Handle_AIS_Shape::DownCast( myShape ); + Handle(AIS_Shape) anAISShape = Handle(AIS_Shape)::DownCast( myShape ); if( !anAISShape.IsNull() ) anAISShape ->SetHLRAngleAndDeviation( 0.001 ); @@ -523,9 +523,8 @@ void HYDROGUI_Shape::buildShape() if ( !myObject.IsNull() && !myObject->IsKind( STANDARD_TYPE(HYDROData_LandCoverMap) ) ) myShape->SetTransparency( 0 ); myShape->SetDisplayMode( (AIS_DisplayMode)myDisplayMode ); - myShape->SetSelectionMode( (Standard_Integer)mySelectionMode ); - // Init default params for shape + // Init default params for shape const Handle(Prs3d_Drawer)& anAttributes = myShape->Attributes(); if ( !anAttributes.IsNull() ) { @@ -677,4 +676,4 @@ void HYDROGUI_Shape::setDisplayMode( int theDisplayMode ) void HYDROGUI_Shape::setSelectionMode( int theSelectionMode ) { mySelectionMode = theSelectionMode; -} \ No newline at end of file +} diff --git a/src/HYDROGUI/HYDROGUI_Shape.h b/src/HYDROGUI/HYDROGUI_Shape.h index 5447abb0..76113ba1 100644 --- a/src/HYDROGUI/HYDROGUI_Shape.h +++ b/src/HYDROGUI/HYDROGUI_Shape.h @@ -109,7 +109,7 @@ protected: virtual void eraseShape( const bool theIsUpdateViewer ); virtual QColor getActiveColor() const; - virtual Handle_AIS_InteractiveObject createShape() const; + virtual Handle(AIS_InteractiveObject) createShape() const; void setDisplayMode( int theDisplayMode ); diff --git a/src/HYDROGUI/HYDROGUI_ShapeBathymetry.cxx b/src/HYDROGUI/HYDROGUI_ShapeBathymetry.cxx index cd9e9134..72150112 100644 --- a/src/HYDROGUI/HYDROGUI_ShapeBathymetry.cxx +++ b/src/HYDROGUI/HYDROGUI_ShapeBathymetry.cxx @@ -22,12 +22,12 @@ #include #include -#include +#include #include HYDROGUI_ShapeBathymetry::HYDROGUI_ShapeBathymetry( HYDROGUI_OCCDisplayer* theDisplayer, const Handle(AIS_InteractiveContext)& theContext, - const Handle_HYDROData_Bathymetry& theBathymetry, + const Handle(HYDROData_Bathymetry)& theBathymetry, const int theZLayer ) : HYDROGUI_Shape( theContext, theBathymetry, theZLayer ), myDisplayer( theDisplayer ) @@ -58,12 +58,14 @@ void HYDROGUI_ShapeBathymetry::update( bool theIsUpdateViewer, bool isDeactivate } -Handle_AIS_InteractiveObject HYDROGUI_ShapeBathymetry::createShape() const +Handle(AIS_InteractiveObject) HYDROGUI_ShapeBathymetry::createShape() const { - Handle_HYDROData_Bathymetry aBath = Handle_HYDROData_Bathymetry::DownCast( getObject() ); + Handle(AIS_InteractiveObject) aPntCloud; + + Handle(HYDROData_Bathymetry) aBath = Handle(HYDROData_Bathymetry)::DownCast( getObject() ); if( !aBath.IsNull() ) { - Handle(AIS_PointCloud) aPntCloud = new HYDROGUI_BathymetryPrs(); + aPntCloud = new HYDROGUI_BathymetryPrs(); aPntCloud->SetHilightMode( AIS_PointCloud::DM_BndBox ); aPntCloud->Attributes()->SetPointAspect (new Prs3d_PointAspect (Aspect_TOM_POINT, Quantity_NOC_WHITE, 2.0)); @@ -76,11 +78,9 @@ Handle_AIS_InteractiveObject HYDROGUI_ShapeBathymetry::createShape() const aThat->myColors = new Quantity_HArray1OfColor( aLower, anUpper ); for( int i=aLower; i<=anUpper; i++ ) aThat->myCoords->SetValue( i, aBathPoints.Value( i ) ); - - return aPntCloud; } - else - return Handle_AIS_InteractiveObject(); + + return aPntCloud; } void HYDROGUI_ShapeBathymetry::GetRange( double& theMin, double& theMax ) const @@ -102,7 +102,7 @@ void HYDROGUI_ShapeBathymetry::GetRange( double& theMin, double& theMax ) const } } -void HYDROGUI_ShapeBathymetry::UpdateWithColorScale( const Handle(Aspect_ColorScale)& theColorScale ) +void HYDROGUI_ShapeBathymetry::UpdateWithColorScale( const Handle(AIS_ColorScale)& theColorScale ) { for( int i=myCoords->Lower(), n=myCoords->Upper(); i<=n; i++ ) { @@ -111,7 +111,7 @@ void HYDROGUI_ShapeBathymetry::UpdateWithColorScale( const Handle(Aspect_ColorSc theColorScale->FindColor( z, aColor ); myColors->SetValue( i, aColor ); } - Handle_AIS_PointCloud aPntCloud = Handle_AIS_PointCloud::DownCast( getAISObject() ); + Handle(AIS_PointCloud) aPntCloud = Handle(AIS_PointCloud)::DownCast( getAISObject() ); aPntCloud->SetPoints( myCoords, myColors ); getContext()->Redisplay( aPntCloud, Standard_False ); } diff --git a/src/HYDROGUI/HYDROGUI_ShapeBathymetry.h b/src/HYDROGUI/HYDROGUI_ShapeBathymetry.h index f71e4336..459acd58 100644 --- a/src/HYDROGUI/HYDROGUI_ShapeBathymetry.h +++ b/src/HYDROGUI/HYDROGUI_ShapeBathymetry.h @@ -24,7 +24,7 @@ #include class HYDROData_Bathymetry; -class Aspect_ColorScale; +class AIS_ColorScale; class HYDROGUI_OCCDisplayer; class HYDROGUI_ShapeBathymetry : public HYDROGUI_Shape @@ -37,7 +37,7 @@ public: virtual ~HYDROGUI_ShapeBathymetry(); void GetRange( double& theMin, double& theMax ) const; - void UpdateWithColorScale( const Handle(Aspect_ColorScale)& ); + void UpdateWithColorScale( const Handle(AIS_ColorScale)& ); virtual void display( const bool theIsUpdateViewer = true ); virtual void erase( const bool theIsUpdateViewer = true ); diff --git a/src/HYDROGUI/HYDROGUI_ShapeImage.cxx b/src/HYDROGUI/HYDROGUI_ShapeImage.cxx index e9ecc0c5..4f832399 100644 --- a/src/HYDROGUI/HYDROGUI_ShapeImage.cxx +++ b/src/HYDROGUI/HYDROGUI_ShapeImage.cxx @@ -48,12 +48,15 @@ void HYDROGUI_ShapeImage::update( bool theIsUpdateViewer, bool isDeactivateSelec Handle(AIS_InteractiveObject) HYDROGUI_ShapeImage::createShape() const { - Handle(HYDROData_Image) anImageObj = Handle(HYDROData_Image)::DownCast( getObject() ); - if ( anImageObj.IsNull() ) - return Handle_AIS_InteractiveObject(); + Handle(HYDROGUI_ImagePrs) aPrs; - Handle(HYDROGUI_ImagePrs) aPrs = new HYDROGUI_ImagePrs( imagePixMap( anImageObj ), imageContour( anImageObj ) ); - return aPrs; + Handle(HYDROData_Image) anImageObj = Handle(HYDROData_Image)::DownCast( getObject() ); + if ( !anImageObj.IsNull() ) + { + aPrs = new HYDROGUI_ImagePrs( imagePixMap( anImageObj ), imageContour( anImageObj ) ); + } + + return aPrs; } Handle(Image_PixMap) HYDROGUI_ShapeImage::imagePixMap( const Handle(HYDROData_Image)& theImageObj ) const @@ -81,7 +84,7 @@ Handle(Image_PixMap) HYDROGUI_ShapeImage::imagePixMap( const Handle(HYDROData_Im return aPix; } -QPolygonF HYDROGUI_ShapeImage::imageContour( const Handle_HYDROData_Image& theImageObj ) const +QPolygonF HYDROGUI_ShapeImage::imageContour( const Handle(HYDROData_Image)& theImageObj ) const { QPolygonF aContour; if ( !theImageObj.IsNull() ) diff --git a/src/HYDROGUI/HYDROGUI_ShapeImage.h b/src/HYDROGUI/HYDROGUI_ShapeImage.h index e9cf07a4..aba5b82b 100644 --- a/src/HYDROGUI/HYDROGUI_ShapeImage.h +++ b/src/HYDROGUI/HYDROGUI_ShapeImage.h @@ -23,22 +23,22 @@ #include -class Handle_HYDROData_Image; +class HYDROData_Image; class HYDROGUI_ShapeImage : public HYDROGUI_Shape { public: HYDROGUI_ShapeImage( const Handle(AIS_InteractiveContext)& theContext, - const Handle_HYDROData_Image& theImage, + const Handle(HYDROData_Image)& theImage, const int theZLayer = -1 ); virtual ~HYDROGUI_ShapeImage(); virtual void update( bool isUpdateViewer, bool isDeactivateSelection ); protected: - virtual Handle_AIS_InteractiveObject createShape() const; - Handle(Image_PixMap) imagePixMap( const Handle_HYDROData_Image& ) const; - QPolygonF imageContour( const Handle_HYDROData_Image& ) const; + virtual Handle(AIS_InteractiveObject) createShape() const; + Handle(Image_PixMap) imagePixMap( const Handle(HYDROData_Image)& ) const; + QPolygonF imageContour( const Handle(HYDROData_Image)& ) const; }; #endif diff --git a/src/HYDROGUI/HYDROGUI_ShapeLandCoverMap.cxx b/src/HYDROGUI/HYDROGUI_ShapeLandCoverMap.cxx index 0a6b59ab..3446545e 100644 --- a/src/HYDROGUI/HYDROGUI_ShapeLandCoverMap.cxx +++ b/src/HYDROGUI/HYDROGUI_ShapeLandCoverMap.cxx @@ -34,7 +34,7 @@ HYDROGUI_ShapeLandCoverMap::HYDROGUI_ShapeLandCoverMap( HYDROGUI_OCCDisplayer* theDisplayer, const Handle(AIS_InteractiveContext)& theContext, - const Handle_HYDROData_LandCoverMap& theLandCoverMap, + const Handle(HYDROData_LandCoverMap)& theLandCoverMap, const int theZLayer, const bool theIsScalarMode ) : HYDROGUI_Shape( theContext, theLandCoverMap, theZLayer ), @@ -91,7 +91,7 @@ void HYDROGUI_ShapeLandCoverMap::displayShape( const bool theIsUpdateViewer ) myDisplayer->SetToUpdateColorScale(); } -Handle_AIS_InteractiveObject HYDROGUI_ShapeLandCoverMap::createShape() const +Handle(AIS_InteractiveObject) HYDROGUI_ShapeLandCoverMap::createShape() const { Handle(HYDROData_LandCoverMap) aLandCoverMap = Handle(HYDROData_LandCoverMap)::DownCast( getObject() ); if ( !aLandCoverMap.IsNull() ) @@ -115,13 +115,7 @@ Handle_AIS_InteractiveObject HYDROGUI_ShapeLandCoverMap::createShape() const aLandCoverMapPrs->SetTable( aTable ); // Set color scale - OCCViewer_ViewWindow* aWnd = dynamic_cast( aViewer->getViewManager()->getActiveView() ); - Handle(V3d_View) aView = aWnd->getViewPort()->getView(); - if( !aView.IsNull() ) - { - Handle(Aspect_ColorScale) aColorScale = aView->ColorScale(); - aLandCoverMapPrs->SetColorScale( aColorScale ); - } + aLandCoverMapPrs->SetColorScale( myDisplayer->GetColorScale( aViewerId) ); } } } diff --git a/src/HYDROGUI/HYDROGUI_ShapeLandCoverMap.h b/src/HYDROGUI/HYDROGUI_ShapeLandCoverMap.h index 263c2329..526c52e5 100644 --- a/src/HYDROGUI/HYDROGUI_ShapeLandCoverMap.h +++ b/src/HYDROGUI/HYDROGUI_ShapeLandCoverMap.h @@ -24,14 +24,14 @@ #include class HYDROGUI_OCCDisplayer; -class Handle_HYDROData_LandCoverMap; +class HYDROData_LandCoverMap; class HYDROGUI_ShapeLandCoverMap : public HYDROGUI_Shape { public: HYDROGUI_ShapeLandCoverMap( HYDROGUI_OCCDisplayer* theDisplayer, const Handle(AIS_InteractiveContext)& theContext, - const Handle_HYDROData_LandCoverMap& theLandCoverMap, + const Handle(HYDROData_LandCoverMap)& theLandCoverMap, const int theZLayer = -1, const bool theIsScalarMode = false ); virtual ~HYDROGUI_ShapeLandCoverMap(); @@ -54,7 +54,7 @@ public: protected: virtual void displayShape( const bool theIsUpdateViewer ); - virtual Handle_AIS_InteractiveObject createShape() const; + virtual Handle(AIS_InteractiveObject) createShape() const; private: HYDROGUI_OCCDisplayer* myDisplayer; diff --git a/src/HYDROGUI/HYDROGUI_StricklerTableDlg.cxx b/src/HYDROGUI/HYDROGUI_StricklerTableDlg.cxx index 6c14e957..07bb17ad 100644 --- a/src/HYDROGUI/HYDROGUI_StricklerTableDlg.cxx +++ b/src/HYDROGUI/HYDROGUI_StricklerTableDlg.cxx @@ -46,7 +46,7 @@ HYDROGUI_ColorDelegate::~HYDROGUI_ColorDelegate() void HYDROGUI_ColorDelegate::paint( QPainter* thePainter, const QStyleOptionViewItem& theOption, const QModelIndex& theIndex ) const { - QColor aColor = qVariantValue( theIndex.data( Qt::BackgroundColorRole ) ); + QColor aColor = theIndex.data( Qt::BackgroundColorRole ).value(); thePainter->fillRect( theOption.rect, aColor ); } @@ -54,7 +54,7 @@ QWidget* HYDROGUI_ColorDelegate::createEditor( QWidget* theParent, const QStyleOptionViewItem& theOption, const QModelIndex& theIndex ) const { - QColor aColor = qVariantValue( theIndex.data( Qt::BackgroundColorRole ) ); + QColor aColor = theIndex.data( Qt::BackgroundColorRole ).value(); QColor aNewColor = QColorDialog::getColor( aColor ); if( aNewColor.isValid() ) { @@ -166,13 +166,13 @@ HYDROGUI_StricklerTableDlg::HYDROGUI_StricklerTableDlg( HYDROGUI_Module* theModu myTable->setHorizontalHeaderLabels( aColumnNames ); myTable->horizontalHeader()->setStretchLastSection( false ); - myTable->horizontalHeader()->setResizeMode( 0, QHeaderView::ResizeToContents ); - myTable->horizontalHeader()->setResizeMode( 1, QHeaderView::ResizeToContents ); - myTable->horizontalHeader()->setResizeMode( 2, QHeaderView::ResizeToContents ); - myTable->horizontalHeader()->setResizeMode( 3, QHeaderView::Stretch ); + myTable->horizontalHeader()->setSectionResizeMode( 0, QHeaderView::ResizeToContents ); + myTable->horizontalHeader()->setSectionResizeMode( 1, QHeaderView::ResizeToContents ); + myTable->horizontalHeader()->setSectionResizeMode( 2, QHeaderView::ResizeToContents ); + myTable->horizontalHeader()->setSectionResizeMode( 3, QHeaderView::Stretch ); myTable->horizontalHeader()->setMinimumSectionSize( 50 ); - myTable->verticalHeader()->setResizeMode( QHeaderView::ResizeToContents ); + myTable->verticalHeader()->setSectionResizeMode( QHeaderView::ResizeToContents ); // Layout // buttons @@ -250,7 +250,7 @@ void HYDROGUI_StricklerTableDlg::setTableNameReadOnly( bool on ) myName->setReadOnly( on ); } -void HYDROGUI_StricklerTableDlg::getGuiData( Handle_HYDROData_StricklerTable& theTable ) const +void HYDROGUI_StricklerTableDlg::getGuiData( Handle(HYDROData_StricklerTable)& theTable ) const { if( theTable.IsNull() ) return; @@ -278,7 +278,7 @@ void HYDROGUI_StricklerTableDlg::getGuiData( Handle_HYDROData_StricklerTable& th } } -void HYDROGUI_StricklerTableDlg::setGuiData( const Handle_HYDROData_StricklerTable& theTable ) +void HYDROGUI_StricklerTableDlg::setGuiData( const Handle(HYDROData_StricklerTable)& theTable ) { myAttrName->setText( theTable->GetAttrName() ); diff --git a/src/HYDROGUI/HYDROGUI_StricklerTypeComboBox.cxx b/src/HYDROGUI/HYDROGUI_StricklerTypeComboBox.cxx index 8f592db3..321a72cd 100644 --- a/src/HYDROGUI/HYDROGUI_StricklerTypeComboBox.cxx +++ b/src/HYDROGUI/HYDROGUI_StricklerTypeComboBox.cxx @@ -46,7 +46,7 @@ HYDROGUI_StricklerTypeComboBox::HYDROGUI_StricklerTypeComboBox( HYDROGUI_Module* if ( myModule ) { // Construct a list of unique names of all Strickler types defined within the data model - Handle_HYDROData_Document aDoc = HYDROData_Document::Document( myModule->getStudyId() ); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document( myModule->getStudyId() ); if ( aDoc ) { QStringList aStricklerTypes; diff --git a/src/HYDROGUI/HYDROGUI_Tool.cxx b/src/HYDROGUI/HYDROGUI_Tool.cxx index f86499f2..af925117 100644 --- a/src/HYDROGUI/HYDROGUI_Tool.cxx +++ b/src/HYDROGUI/HYDROGUI_Tool.cxx @@ -200,7 +200,7 @@ HYDROData_SequenceOfObjects HYDROGUI_Tool::GetObjectBackReferences( const Handle } QMap HYDROGUI_Tool::GetObjectsBackReferences( - const Handle_HYDROData_Document& theDocument, const QStringList& theObjectNames ) + const Handle(HYDROData_Document)& theDocument, const QStringList& theObjectNames ) { QMap aResMap; @@ -268,7 +268,7 @@ QStringList HYDROGUI_Tool::FindExistingObjectsNames( const Handle(HYDROData_Docu if( isOK && isCheckValidProfile ) { - Handle_HYDROData_Profile aProfile = Handle_HYDROData_Profile::DownCast( anObject ); + Handle(HYDROData_Profile) aProfile = Handle(HYDROData_Profile)::DownCast( anObject ); if( !aProfile.IsNull() && !aProfile->IsValid() ) isOK = false; } diff --git a/src/HYDROGUI/HYDROGUI_Tool2.cxx b/src/HYDROGUI/HYDROGUI_Tool2.cxx index c87743e0..ef1962e8 100644 --- a/src/HYDROGUI/HYDROGUI_Tool2.cxx +++ b/src/HYDROGUI/HYDROGUI_Tool2.cxx @@ -244,7 +244,7 @@ ObjectKind HYDROGUI_Tool::GetSelectedPartition( HYDROGUI_Module* theModule ) { anEntry.remove( aPrefix ); for( ObjectKind anObjectKind = KIND_UNKNOWN + 1; anObjectKind <= KIND_LAST; anObjectKind++ ) - if( HYDROGUI_DataModel::tr( HYDROGUI_DataModel::partitionName( anObjectKind ).toAscii() ) == anEntry ) + if( HYDROGUI_DataModel::tr( HYDROGUI_DataModel::partitionName( anObjectKind ).toLatin1() ) == anEntry ) return anObjectKind; } } diff --git a/src/HYDROGUI/HYDROGUI_VTKPrsShape.cxx b/src/HYDROGUI/HYDROGUI_VTKPrsShape.cxx index 52969e5e..af8b9bf8 100644 --- a/src/HYDROGUI/HYDROGUI_VTKPrsShape.cxx +++ b/src/HYDROGUI/HYDROGUI_VTKPrsShape.cxx @@ -192,8 +192,7 @@ void HYDROGUI_VTKPrsShape::buildShape() HYDROData_SequenceOfObjects::Iterator anIter( aRefObjects ); for ( ; anIter.More(); anIter.Next() ) { - Handle(HYDROData_Entity) aRefbject = - Handle(HYDROData_Entity)::DownCast( anIter.Value() ); + Handle(HYDROData_Entity) aRefbject = anIter.Value(); if ( aRefbject.IsNull() ) continue; diff --git a/src/HYDROGUI/HYDROGUI_ZLayers.cxx b/src/HYDROGUI/HYDROGUI_ZLayers.cxx index 0fe911d4..4cd49e8b 100644 --- a/src/HYDROGUI/HYDROGUI_ZLayers.cxx +++ b/src/HYDROGUI/HYDROGUI_ZLayers.cxx @@ -23,7 +23,7 @@ void SetZLayerForPrs( const Handle(PrsMgr_Presentation)& thePrs, int theLayerId ); -void SetPrsZLayer( const Handle_PrsMgr_PresentableObject& thePresentableObject, +void SetPrsZLayer( const Handle(PrsMgr_PresentableObject)& thePresentableObject, const int theMode, const int theLayerId ) { PrsMgr_Presentations& aPresentations = thePresentableObject->Presentations(); @@ -37,7 +37,7 @@ void SetPrsZLayer( const Handle_PrsMgr_PresentableObject& thePresentableObject, } } -void SetZLayerSettings( const Handle_V3d_Viewer& theViewer3d, int theLayerId, bool theIsOrdered ) +void SetZLayerSettings( const Handle(V3d_Viewer)& theViewer3d, int theLayerId, bool theIsOrdered ) { if ( theViewer3d.IsNull() /*|| theLayerId < 0*/ ) { @@ -65,7 +65,7 @@ void SetZLayerSettings( const Handle_V3d_Viewer& theViewer3d, int theLayerId, bo theViewer3d->SetZLayerSettings( theLayerId, aSettings ); } -int CreateTopZLayer( const Handle_V3d_Viewer& theViewer3d ) +int CreateTopZLayer( const Handle(V3d_Viewer)& theViewer3d ) { int aTopZLayer = -1; @@ -77,7 +77,7 @@ int CreateTopZLayer( const Handle_V3d_Viewer& theViewer3d ) } -HYDROGUI_ZLayersIterator::HYDROGUI_ZLayersIterator( const Handle_V3d_Viewer& theViewer ) +HYDROGUI_ZLayersIterator::HYDROGUI_ZLayersIterator( const Handle(V3d_Viewer)& theViewer ) : myIndex( 0 ), myNewZLayer( -1 ), myViewer( theViewer ) { Init( theViewer ); @@ -87,7 +87,7 @@ HYDROGUI_ZLayersIterator::~HYDROGUI_ZLayersIterator() { } -void HYDROGUI_ZLayersIterator::Init( const Handle_V3d_Viewer& theViewer ) +void HYDROGUI_ZLayersIterator::Init( const Handle(V3d_Viewer)& theViewer ) { TColStd_SequenceOfInteger anExistingZLayers; theViewer->GetAllZLayers( anExistingZLayers ); diff --git a/src/HYDROGUI/HYDROGUI_ZLayers2.cxx b/src/HYDROGUI/HYDROGUI_ZLayers2.cxx index 76bd41b0..af9391c7 100644 --- a/src/HYDROGUI/HYDROGUI_ZLayers2.cxx +++ b/src/HYDROGUI/HYDROGUI_ZLayers2.cxx @@ -24,7 +24,7 @@ #include #include -void UpdateZLayersOfHilightPresentationsOfDisplayedObjects( const Handle_AIS_InteractiveContext& theContext, +void UpdateZLayersOfHilightPresentationsOfDisplayedObjects( const Handle(AIS_InteractiveContext)& theContext, int theLayer ) { AIS_ListOfInteractive aDisplayedObjects; diff --git a/src/HYDROGUI/HYDROGUI_Zone.cxx b/src/HYDROGUI/HYDROGUI_Zone.cxx index 0d0ab6bc..6da859d9 100644 --- a/src/HYDROGUI/HYDROGUI_Zone.cxx +++ b/src/HYDROGUI/HYDROGUI_Zone.cxx @@ -65,8 +65,7 @@ QString HYDROGUI_Zone::getRefObjectNames() const HYDROData_SequenceOfObjects::Iterator anIter( aSeq ); for ( ; anIter.More(); anIter.Next() ) { - Handle(HYDROData_Entity) aRefGeomObj = - Handle(HYDROData_Entity)::DownCast( anIter.Value() ); + Handle(HYDROData_Entity) aRefGeomObj = anIter.Value(); if ( !aRefGeomObj.IsNull() ) { // Get Ref.Object name diff --git a/src/HYDROPy/CMakeLists.txt b/src/HYDROPy/CMakeLists.txt index 60640097..7a28b970 100644 --- a/src/HYDROPy/CMakeLists.txt +++ b/src/HYDROPy/CMakeLists.txt @@ -74,7 +74,7 @@ SET(_sip_files SET(_add_SOURCES sipHYDROPyNCollection_Sequence0100HYDROData_IPolylineSectionType.cc - sipHYDROPyNCollection_Sequence0100Handle_HYDROData_Entity.cc + sipHYDROPyNCollection_Sequence0600opencascadehandle0100HYDROData_Entity.cc sipHYDROPyNCollection_Sequence0100TCollection_AsciiString.cc sipHYDROPyNCollection_Sequence0100gp_XY.cc sipHYDROPyNCollection_Sequence0100gp_XYZ.cc diff --git a/src/HYDROPy/HYDROData_CalculationCase.sip b/src/HYDROPy/HYDROData_CalculationCase.sip index cbca3857..cc6dbe86 100644 --- a/src/HYDROPy/HYDROData_CalculationCase.sip +++ b/src/HYDROPy/HYDROData_CalculationCase.sip @@ -87,7 +87,7 @@ public: /** * Add new one reference geometry object for calculation case. */ - bool AddGeometryObject( HYDROData_Object theObject ) [bool ( const Handle_HYDROData_Object& )]; + bool AddGeometryObject( HYDROData_Object theObject ) [bool ( const opencascade::handle& )]; %MethodCode Handle(HYDROData_Object) aRef = Handle(HYDROData_Object)::DownCast( createHandle( a0 ) ); @@ -109,7 +109,7 @@ public: * Removes reference geometry object from calculation case. */ void RemoveGeometryObject( HYDROData_Object theObject ) - [void ( const Handle_HYDROData_Object& )]; + [void ( const opencascade::handle& )]; %MethodCode Handle(HYDROData_Object) aRef = Handle(HYDROData_Object)::DownCast( createHandle( a0 ) ); @@ -134,7 +134,7 @@ public: /** * Add new one reference geometry group for calculation case. */ - bool AddGeometryGroup( HYDROData_ShapesGroup theGroup ) [bool ( const Handle_HYDROData_ShapesGroup& )]; + bool AddGeometryGroup( HYDROData_ShapesGroup theGroup ) [bool ( const opencascade::handle& )]; %MethodCode Handle(HYDROData_ShapesGroup) aRef = Handle(HYDROData_ShapesGroup)::DownCast( createHandle( a0 ) ); @@ -155,7 +155,7 @@ public: /** * Removes reference geometry group from calculation case. */ - void RemoveGeometryGroup( HYDROData_ShapesGroup theGroup ) [void ( const Handle_HYDROData_ShapesGroup& )]; + void RemoveGeometryGroup( HYDROData_ShapesGroup theGroup ) [void ( opencascade::handle& )]; %MethodCode Handle(HYDROData_ShapesGroup) aRef = Handle(HYDROData_ShapesGroup)::DownCast( createHandle( a0 ) ); @@ -180,7 +180,7 @@ public: /** * Sets reference boundary polyline object for calculation case. */ - void SetBoundaryPolyline( HYDROData_PolylineXY thePolyline ) [void ( const Handle_HYDROData_PolylineXY& )]; + void SetBoundaryPolyline( HYDROData_PolylineXY thePolyline ) [void ( opencascade::handle& )]; %MethodCode Handle(HYDROData_PolylineXY) aRef = Handle(HYDROData_PolylineXY)::DownCast( createHandle( a0 ) ); @@ -199,7 +199,7 @@ public: /** * Returns reference boundary polyline object of calculation case. */ - HYDROData_PolylineXY GetBoundaryPolyline() const [Handle_HYDROData_PolylineXY ()]; + HYDROData_PolylineXY GetBoundaryPolyline() const [opencascade::handle ()]; %MethodCode Handle(HYDROData_PolylineXY) aRef; @@ -223,7 +223,7 @@ public: * The label of theZone is changed during this operation * because of new region becomes the new parent for this zone. */ - HYDROData_Region AddNewRegion( HYDROData_Zone theZone ) [Handle_HYDROData_Region ( const Handle_HYDROData_Zone& )]; + HYDROData_Region AddNewRegion( HYDROData_Zone theZone ) [opencascade::handle ( opencascade::handle& )]; %MethodCode Handle(HYDROData_Zone) aRef = Handle(HYDROData_Zone)::DownCast( createHandle( a0 ) ); @@ -244,7 +244,7 @@ public: * Add new one reference region for calculation case. * The label of theRegion is changed in case if old parent is not this calculation. */ - bool AddRegion( HYDROData_Region theRegion ) [bool ( const Handle_HYDROData_Region& )]; + bool AddRegion( HYDROData_Region theRegion ) [bool ( opencascade::handle& )]; %MethodCode Handle(HYDROData_Region) aRef = Handle(HYDROData_Region)::DownCast( createHandle( a0 ) ); @@ -270,7 +270,7 @@ public: /** * Removes reference region from calculation case. */ - void RemoveRegion( HYDROData_Region theRegion ) [void ( const Handle_HYDROData_Region& )]; + void RemoveRegion( HYDROData_Region theRegion ) [void ( opencascade::handle& )]; %MethodCode Handle(HYDROData_Region) aRef = Handle(HYDROData_Region)::DownCast( createHandle( a0 ) ); @@ -358,7 +358,7 @@ public: double GetAltitudeForPoint( const double theCoordX, const double theCoordY, HYDROData_Region theRegion ) const - [double ( const gp_XY&, const Handle_HYDROData_Region& )]; + [double ( const gp_XY&, opencascade::handle& )]; %MethodCode gp_XY aPnt( a0, a1 ); Handle(HYDROData_Region) aRefRegion = @@ -379,7 +379,7 @@ public: double GetAltitudeForPoint( const double theCoordX, const double theCoordY, HYDROData_Zone theZone ) const - [double ( const gp_XY&, const Handle_HYDROData_Zone& )]; + [double ( const gp_XY&, opencascade::handle& )]; %MethodCode gp_XY aPnt( a0, a1 ); Handle(HYDROData_Zone) aRefZone = @@ -401,7 +401,7 @@ public: const NCollection_Sequence& theCoordsY, HYDROData_Region theRegion, int theMethod = 0) const - [NCollection_Sequence ( const NCollection_Sequence&, const Handle_HYDROData_Region&, int)]; + [NCollection_Sequence ( const NCollection_Sequence&, opencascade::handle&, int)]; %MethodCode NCollection_Sequence aPnts; @@ -436,7 +436,7 @@ public: const NCollection_Sequence& theCoordsY, HYDROData_Zone theZone, int theMethod = 0) const - [NCollection_Sequence ( const NCollection_Sequence&, const Handle_HYDROData_Zone&, int )]; + [NCollection_Sequence ( const NCollection_Sequence&, opencascade::handle&, int )]; %MethodCode NCollection_Sequence aPnts; @@ -468,7 +468,7 @@ public: */ HYDROData_Region GetRegionFromPoint( const double theCoordX, const double theCoordY ) const - [Handle_HYDROData_Region ( const gp_XY& )]; + [opencascade::handle ( const gp_XY& )]; %MethodCode Handle(HYDROData_Region) aRes; @@ -489,7 +489,7 @@ public: */ HYDROData_Zone GetZoneFromPoint( const double theCoordX, const double theCoordY ) const - [Handle_HYDROData_Zone ( const gp_XY& )]; + [opencascade::handle ( const gp_XY& )]; %MethodCode Handle(HYDROData_Zone) aRes; @@ -512,7 +512,7 @@ public: PointClassification GetPointClassification( const double theCoordX, const double theCoordY, HYDROData_Zone theZone ) const - [PointClassification ( const gp_XY&, const Handle_HYDROData_Zone& )]; + [PointClassification ( const gp_XY&, opencascade::handle& )]; %MethodCode gp_XY aPnt( a0, a1 ); @@ -533,12 +533,10 @@ public: HYDROData_Entity theObject2, HYDROData_Zone::MergeType theMergeType, HYDROData_CalculationCase::DataTag theDataTag ) - [void ( const Handle_HYDROData_Entity&, HYDROData_PriorityType, const Handle_HYDROData_Entity&, HYDROData_Zone::MergeType, HYDROData_CalculationCase::DataTag )]; + [void ( const opencascade::handle&, HYDROData_PriorityType, opencascade::handle&, HYDROData_Zone::MergeType, HYDROData_CalculationCase::DataTag )]; %MethodCode - Handle(HYDROData_Entity) anObject1 = - Handle(HYDROData_Entity)::DownCast( createHandle( a0 ) ); - Handle(HYDROData_Entity) anObject2 = - Handle(HYDROData_Entity)::DownCast( createHandle( a2 ) ); + Handle(HYDROData_Entity) anObject1 = createHandle( a0 ); + Handle(HYDROData_Entity) anObject2 = createHandle( a2 ); Py_BEGIN_ALLOW_THREADS sipSelfWasArg ? sipCpp->HYDROData_CalculationCase::AddRule( anObject1, a1, anObject2, a3, a4 ) : diff --git a/src/HYDROPy/HYDROData_Channel.sip b/src/HYDROPy/HYDROData_Channel.sip index 1ff170ac..f1ef457a 100644 --- a/src/HYDROPy/HYDROData_Channel.sip +++ b/src/HYDROPy/HYDROData_Channel.sip @@ -63,7 +63,7 @@ public: * Sets reference guide line object for channel. */ bool SetGuideLine( HYDROData_Polyline3D theGuideLine ) - [bool ( const Handle_HYDROData_Polyline3D& )]; + [bool ( const opencascade::handle& )]; %MethodCode Handle(HYDROData_Polyline3D) aRef = Handle(HYDROData_Polyline3D)::DownCast( createHandle( a0 ) ); @@ -80,7 +80,7 @@ public: * Returns reference guide line object of channel. */ HYDROData_Polyline3D GetGuideLine() const - [Handle_HYDROData_Polyline3D ()]; + [opencascade::handle ()]; %MethodCode Handle(HYDROData_Polyline3D) aRef; @@ -102,7 +102,7 @@ public: * Sets reference profile object for channel. */ bool SetProfile( HYDROData_Profile theProfile ) - [bool ( const Handle_HYDROData_Profile& )]; + [bool ( const opencascade::handle& )]; %MethodCode Handle(HYDROData_Profile) aRef = Handle(HYDROData_Profile)::DownCast( createHandle( a0 ) ); @@ -119,7 +119,7 @@ public: * Returns reference profile object of channel. */ HYDROData_Profile GetProfile() const - [Handle_HYDROData_Profile ()]; + [opencascade::handle ()]; %MethodCode Handle(HYDROData_Profile) aRef; diff --git a/src/HYDROPy/HYDROData_Document.sip b/src/HYDROPy/HYDROData_Document.sip index 4ebd3353..882fe167 100644 --- a/src/HYDROPy/HYDROData_Document.sip +++ b/src/HYDROPy/HYDROData_Document.sip @@ -42,7 +42,8 @@ class HYDROData_Document %End %ConvertToSubClassCode - if ( !Handle(HYDROData_Document)::DownCast( sipCpp ).IsNull() ) + HYDROData_Document* aDoc = dynamic_cast< HYDROData_Document*>( sipCpp ); + if ( aDoc ) sipClass = sipClass_HYDROData_Document; else sipClass = NULL; @@ -199,7 +200,7 @@ class HYDROData_Document public: //! Returns the existing document or creates new if it is not exist - static HYDROData_Document Document( const int theStudyID ) [Handle_HYDROData_Document (const int)] ; + static HYDROData_Document Document( const int theStudyID ) [opencascade::handle (const int)] ; %MethodCode Handle(HYDROData_Document) aDocument; @@ -273,7 +274,7 @@ public: //! Creates and locates in the document a new object //! \param theKind kind of the created object, can not be UNKNOWN //! \returns the created object - HYDROData_Entity CreateObject( const ObjectKind theKind ) [Handle_HYDROData_Entity (const ObjectKind)] ; + HYDROData_Entity CreateObject( const ObjectKind theKind ) [opencascade::handle (const ObjectKind)] ; %MethodCode Handle(HYDROData_Entity) anObject; @@ -288,7 +289,7 @@ public: HYDROData_Entity FindObjectByName( const QString& theName, const ObjectKind theKind = KIND_UNKNOWN ) - [Handle_HYDROData_Entity (const QString&, const ObjectKind)] ; + [opencascade::handle (const QString&, const ObjectKind)] ; %MethodCode Handle(HYDROData_Entity) anObject; diff --git a/src/HYDROPy/HYDROData_Entity.sip b/src/HYDROPy/HYDROData_Entity.sip index 4eae394f..c9b67667 100644 --- a/src/HYDROPy/HYDROData_Entity.sip +++ b/src/HYDROPy/HYDROData_Entity.sip @@ -222,7 +222,7 @@ public: * Returns father object. For object created under root document label * this method always return NULL object. */ - HYDROData_Entity GetFatherObject() const [Handle_HYDROData_Entity ()]; + HYDROData_Entity GetFatherObject() const [opencascade::handle ()]; %MethodCode Handle(HYDROData_Entity) aFather; @@ -244,7 +244,7 @@ public: /** * Returns the z-level for object presentation, -1 if no z-level. */ - virtual bool GetZLevel( int& theLevel ) const [Standard_Boolean ( Standard_Integer& )]; + virtual bool GetZLevel( int& theLevel ) const [bool ( Standard_Integer& )]; /** * Set the z-level for object presentation. diff --git a/src/HYDROPy/HYDROData_IInterpolator.sip b/src/HYDROPy/HYDROData_IInterpolator.sip index 1b5dfe44..23ed1ad9 100644 --- a/src/HYDROPy/HYDROData_IInterpolator.sip +++ b/src/HYDROPy/HYDROData_IInterpolator.sip @@ -56,7 +56,7 @@ public: * Sets the altitude object for interpolation. */ void SetAltitudeObject( HYDROData_IAltitudeObject theAltitude ) - [void ( const Handle_HYDROData_IAltitudeObject& )]; + [void ( const opencascade::handle& )]; %MethodCode Handle(HYDROData_IAltitudeObject) anAltitude = Handle(HYDROData_IAltitudeObject)::DownCast( createHandle( a0 ) ); @@ -74,7 +74,7 @@ public: /** * Returns the altitude object for interpolation. */ - HYDROData_IAltitudeObject GetAltitudeObject() const [Handle_HYDROData_IAltitudeObject ()]; + HYDROData_IAltitudeObject GetAltitudeObject() const [opencascade::handle ()]; %MethodCode Handle(HYDROData_IAltitudeObject) aRes; diff --git a/src/HYDROPy/HYDROData_Image.sip b/src/HYDROPy/HYDROData_Image.sip index 00e70250..64935d93 100644 --- a/src/HYDROPy/HYDROData_Image.sip +++ b/src/HYDROPy/HYDROData_Image.sip @@ -196,7 +196,7 @@ public: const QPointF& thePointB, const QPointF& thePointC = QPoint( INT_MIN, INT_MIN ), const bool theIsUpdate = true ) - [void ( const Handle_HYDROData_Image&, const QPointF&, const QPointF&, const QPointF&, const bool )]; + [void ( const opencascade::handle&, const QPointF&, const QPointF&, const QPointF&, const bool )]; %MethodCode Handle(HYDROData_Image) aRefImage = Handle(HYDROData_Image)::DownCast( createHandle( a0 ) ); @@ -221,7 +221,7 @@ public: QPointF& thePointA /Out/, QPointF& thePointB /Out/, QPointF& thePointC /Out/ ) const - [bool ( const Handle_HYDROData_Image&, QPointF&, QPointF&, QPointF& )]; + [bool ( const opencascade::handle&, QPointF&, QPointF&, QPointF& )]; %MethodCode Handle(HYDROData_Image) aRefImage = Handle(HYDROData_Image)::DownCast( createHandle( a0 ) ); @@ -239,12 +239,11 @@ public: */ bool HasReferencePoints() const; - /** * Stores the reference image for transformation * \param theRefImage reference image */ - void SetTrsfReferenceImage( HYDROData_Image theRefImage ) [void ( const Handle_HYDROData_Image& )]; + void SetTrsfReferenceImage( HYDROData_Image theRefImage ) [void ( const opencascade::handle& )]; %MethodCode Handle(HYDROData_Image) aRefImage = Handle(HYDROData_Image)::DownCast( createHandle( a0 ) ); @@ -260,7 +259,7 @@ public: /** * Returns the reference image for transformation */ - HYDROData_Image GetTrsfReferenceImage() const [Handle_HYDROData_Image ()]; + HYDROData_Image GetTrsfReferenceImage() const [opencascade::handle ()]; %MethodCode Handle(HYDROData_Image) aRefImage; @@ -299,7 +298,7 @@ public: * Appends reference to other object (image or polyline). * \param theReferenced the object referenced by this */ - void AppendReference( HYDROData_Entity theReferenced ) [void ( const Handle_HYDROData_Entity& )]; + void AppendReference( HYDROData_Entity theReferenced ) [void ( const opencascade::handle& )]; %MethodCode Handle(HYDROData_Entity) aRef = createHandle( a0 ); if ( !aRef.IsNull() ) @@ -316,7 +315,7 @@ public: * \param theIndex number of reference [0; NbReference) * \returns the referenced object, or Null if index is invalid */ - HYDROData_Entity Reference( const int theIndex ) const [Handle_HYDROData_Entity ()]; + HYDROData_Entity Reference( const int theIndex ) const [opencascade::handle ()]; %MethodCode Handle(HYDROData_Entity) aRef; @@ -335,7 +334,7 @@ public: * \param theReferenced the object referenced by this */ void ChangeReference( const int theIndex, HYDROData_Entity theReferenced ) - [void ( const int, const Handle_HYDROData_Entity& )]; + [void ( const int, const opencascade::handle& )]; %MethodCode Handle(HYDROData_Entity) aRef = createHandle( a1 ); if ( !aRef.IsNull() ) diff --git a/src/HYDROPy/HYDROData_ImmersibleZone.sip b/src/HYDROPy/HYDROData_ImmersibleZone.sip index bd9ecd7a..3f5f6116 100644 --- a/src/HYDROPy/HYDROData_ImmersibleZone.sip +++ b/src/HYDROPy/HYDROData_ImmersibleZone.sip @@ -45,7 +45,7 @@ public: /** * Sets reference polyline object for zone. */ - void SetPolyline( HYDROData_PolylineXY thePolyline ) [void (const Handle_HYDROData_PolylineXY&)]; + void SetPolyline( HYDROData_PolylineXY thePolyline ) [void (const opencascade::handle&)]; %MethodCode Handle(HYDROData_PolylineXY) aRefPolyline = @@ -63,7 +63,7 @@ public: /** * Returns reference polyline object of zone. */ - HYDROData_PolylineXY GetPolyline() const [Handle_HYDROData_PolylineXY ()]; + HYDROData_PolylineXY GetPolyline() const [opencascade::handle ()]; %MethodCode Handle(HYDROData_PolylineXY) aRefPolyline; diff --git a/src/HYDROPy/HYDROData_LandCoverMap.sip b/src/HYDROPy/HYDROData_LandCoverMap.sip index a502140d..7b5da210 100644 --- a/src/HYDROPy/HYDROData_LandCoverMap.sip +++ b/src/HYDROPy/HYDROData_LandCoverMap.sip @@ -68,7 +68,7 @@ public: bool ExportTelemac( const QString& theFileName, double theDeflection, HYDROData_StricklerTable theTable ) const - [bool( const QString&, double, const Handle_HYDROData_StricklerTable& )]; + [bool( const QString&, double, const opencascade::handle& )]; %MethodCode Handle(HYDROData_StricklerTable) aRef = Handle(HYDROData_StricklerTable)::DownCast( createHandle( a2 ) ); @@ -82,7 +82,7 @@ public: %End bool Add( HYDROData_Object theObject, const QString& theType ) - [bool ( const Handle_HYDROData_Object&, const QString& )]; + [bool ( const opencascade::handle&, const QString& )]; %MethodCode Handle(HYDROData_Object) aRef = Handle(HYDROData_Object)::DownCast( createHandle( a0 ) ); @@ -96,7 +96,7 @@ public: %End bool Add( HYDROData_PolylineXY thePolyline, const QString& theType ) - [bool ( const Handle_HYDROData_PolylineXY&, const QString& )]; + [bool ( const opencascade::handle&, const QString& )]; %MethodCode Handle(HYDROData_PolylineXY) aRef = Handle(HYDROData_PolylineXY)::DownCast( createHandle( a0 ) ); @@ -110,7 +110,7 @@ public: %End bool Split( HYDROData_PolylineXY thePolyline ) - [bool ( const Handle_HYDROData_PolylineXY& )]; + [bool ( const opencascade::handle& )]; %MethodCode Handle(HYDROData_PolylineXY) aRef = Handle(HYDROData_PolylineXY)::DownCast( createHandle( a0 ) ); diff --git a/src/HYDROPy/HYDROData_Object.sip b/src/HYDROPy/HYDROData_Object.sip index 5e18bd21..9b0fd58e 100644 --- a/src/HYDROPy/HYDROData_Object.sip +++ b/src/HYDROPy/HYDROData_Object.sip @@ -77,7 +77,7 @@ public: /** * Set reference altitude object for geometry object. */ - bool SetAltitudeObject( HYDROData_IAltitudeObject theAltitude ) [void (const Handle_HYDROData_IAltitudeObject&)]; + bool SetAltitudeObject( HYDROData_IAltitudeObject theAltitude ) [void (const opencascade::handle&)]; %MethodCode Handle(HYDROData_IAltitudeObject) aRefAltitude = @@ -95,7 +95,7 @@ public: /** * Returns reference altitude object of geometry object. */ - HYDROData_IAltitudeObject GetAltitudeObject() const [Handle_HYDROData_IAltitudeObject ()]; + HYDROData_IAltitudeObject GetAltitudeObject() const [opencascade::handle ()]; %MethodCode Handle(HYDROData_IAltitudeObject) aRefAltitude; @@ -143,7 +143,7 @@ public: /** * Returns group data model object by it id. */ - HYDROData_ShapesGroup GetGroup( const int theGroupId ) const [Handle_HYDROData_ShapesGroup ()]; + HYDROData_ShapesGroup GetGroup( const int theGroupId ) const [opencascade::handle ()]; %MethodCode Handle(HYDROData_ShapesGroup) aRefGroup; @@ -160,7 +160,7 @@ public: /** * Returns group id by data model object. */ - int GetGroupId( HYDROData_ShapesGroup theGroup ) const [int (const Handle_HYDROData_ShapesGroup&)]; + int GetGroupId( HYDROData_ShapesGroup theGroup ) const [int (const opencascade::handle&)]; %MethodCode Handle(HYDROData_ShapesGroup) aRefGroup = diff --git a/src/HYDROPy/HYDROData_Polyline3D.sip b/src/HYDROPy/HYDROData_Polyline3D.sip index 58de3fd6..9e293a03 100644 --- a/src/HYDROPy/HYDROData_Polyline3D.sip +++ b/src/HYDROPy/HYDROData_Polyline3D.sip @@ -46,7 +46,7 @@ public: */ bool SetPolylineXY( HYDROData_PolylineXY thePolyline, const bool theIsUpdateProfile = true ) - [bool ( const Handle_HYDROData_PolylineXY&, + [bool ( const opencascade::handle&, const bool = true )]; %MethodCode Handle(HYDROData_PolylineXY) aRef = @@ -64,7 +64,7 @@ public: * Returns reference x,y polyline object of 3D polyline. */ HYDROData_PolylineXY GetPolylineXY() const - [Handle_HYDROData_PolylineXY ()]; + [opencascade::handle ()]; %MethodCode Handle(HYDROData_PolylineXY) aRef; @@ -86,7 +86,7 @@ public: * Sets reference u,z profile object for 3D polyline. */ bool SetProfileUZ( HYDROData_ProfileUZ theProfile ) - [bool ( const Handle_HYDROData_ProfileUZ& )]; + [bool ( const opencascade::handle& )]; %MethodCode Handle(HYDROData_ProfileUZ) aRef = Handle(HYDROData_ProfileUZ)::DownCast( createHandle( a0 ) ); @@ -103,7 +103,7 @@ public: * Returns reference u,z profile object of 3D polyline. */ HYDROData_ProfileUZ GetProfileUZ() const - [Handle_HYDROData_ProfileUZ ()]; + [Hopencascade::handle ()]; %MethodCode Handle(HYDROData_ProfileUZ) aRef; @@ -126,7 +126,7 @@ public: * Reimplemented to remove reference u,z profile. */ bool SetAltitudeObject( HYDROData_IAltitudeObject theAltitude ) - [bool ( const Handle_HYDROData_IAltitudeObject& )]; + [bool ( const opencascade::handle& )]; %MethodCode Handle(HYDROData_IAltitudeObject) aRef = Handle(HYDROData_IAltitudeObject)::DownCast( createHandle( a0 ) ); @@ -150,7 +150,7 @@ public: * Returns the child u,z profile which has been generated from bathymetry. */ HYDROData_ProfileUZ GetChildProfileUZ( const bool theIsCreate = true ) const - [Handle_HYDROData_ProfileUZ ( const bool = true )]; + [opencascade::handle ( const bool = true )]; %MethodCode Handle(HYDROData_ProfileUZ) aRef; @@ -166,7 +166,7 @@ public: /** * Sets the child u,z profile for polyline. */ - void SetChildProfileUZ( HYDROData_ProfileUZ theProfile ) [void ( const Handle_HYDROData_ProfileUZ& )]; + void SetChildProfileUZ( HYDROData_ProfileUZ theProfile ) [void ( const opencascade::handle& )]; %MethodCode Handle(HYDROData_ProfileUZ) aRef = Handle(HYDROData_ProfileUZ)::DownCast( createHandle( a0 ) ); diff --git a/src/HYDROPy/HYDROData_Profile.sip b/src/HYDROPy/HYDROData_Profile.sip index 9ecd88d0..c5b91a60 100644 --- a/src/HYDROPy/HYDROData_Profile.sip +++ b/src/HYDROPy/HYDROData_Profile.sip @@ -93,7 +93,7 @@ public: * \return profile U,Z */ HYDROData_ProfileUZ GetProfileUZ( const bool theIsCreate = true ) const - [Handle_HYDROData_ProfileUZ ( const bool theIsCreate = true )]; + [opencascade::handle ( const bool theIsCreate = true )]; %MethodCode Handle(HYDROData_ProfileUZ) aRefProfileUZ; @@ -173,7 +173,7 @@ public: static int ImportFromFile( HYDROData_Document theDoc, const TCollection_AsciiString& theFileName, NCollection_Sequence& theBadProfilesIds ) - [int ( const Handle_HYDROData_Document&, + [int ( const opencascade::handle&, const TCollection_AsciiString&, NCollection_Sequence& )]; %MethodCode diff --git a/src/HYDROPy/HYDROData_Region.sip b/src/HYDROPy/HYDROData_Region.sip index f3af2f81..5917f614 100644 --- a/src/HYDROPy/HYDROData_Region.sip +++ b/src/HYDROPy/HYDROData_Region.sip @@ -45,7 +45,7 @@ public: /** * Add new one reference zone for region. */ - void AddZone( HYDROData_Zone theZone ) [void (const Handle_HYDROData_Zone&)]; + void AddZone( HYDROData_Zone theZone ) [void (const opencascade::handle&)]; %MethodCode Handle(HYDROData_Zone) aZone = @@ -68,7 +68,7 @@ public: /** * Removes reference zone from region. */ - void RemoveZone( HYDROData_Zone theZone ) [void (const Handle_HYDROData_Zone&)]; + void RemoveZone( HYDROData_Zone theZone ) [void (const opencascade::handle&)]; %MethodCode Handle(HYDROData_Zone) aZone = diff --git a/src/HYDROPy/HYDROData_SequenceOfObjects.sip b/src/HYDROPy/HYDROData_SequenceOfObjects.sip index 141a5279..e1832150 100644 --- a/src/HYDROPy/HYDROData_SequenceOfObjects.sip +++ b/src/HYDROPy/HYDROData_SequenceOfObjects.sip @@ -20,7 +20,7 @@ #include %End -%MappedType NCollection_Sequence +%MappedType NCollection_Sequence> { %TypeHeaderCode #include @@ -44,7 +44,7 @@ { Py_DECREF(l); { - Handle_HYDROData_Entity anEnt( aPntr ); + Handle(HYDROData_Entity) anEnt( aPntr ); } return NULL; @@ -79,8 +79,8 @@ return 1; } - NCollection_Sequence *aSeq = - new NCollection_Sequence; + NCollection_Sequence *aSeq = + new NCollection_Sequence; len = PySequence_Size(sipPy); for (SIP_SSIZE_T i = 0; i < len; ++i) @@ -100,7 +100,7 @@ return 0; } - Handle_HYDROData_Entity anEnt( t ); + Handle(HYDROData_Entity) anEnt( t ); aSeq->Append( anEnt ); //sipReleaseType(t, sipType_HYDROData_Entity, state); @@ -112,4 +112,4 @@ %End }; -typedef NCollection_Sequence HYDROData_SequenceOfObjects; +typedef NCollection_Sequence> HYDROData_SequenceOfObjects; diff --git a/src/HYDROPy/HYDROData_Stream.sip b/src/HYDROPy/HYDROData_Stream.sip index 4bb209e6..9461c8e5 100644 --- a/src/HYDROPy/HYDROData_Stream.sip +++ b/src/HYDROPy/HYDROData_Stream.sip @@ -46,7 +46,7 @@ public: * Returns true if given polyline can be used as stream axis. */ static bool IsValidAsAxis( HYDROData_PolylineXY theAxis ) - [bool ( const Handle_HYDROData_PolylineXY& )]; + [bool ( const opencascade::handle& )]; %MethodCode Handle(HYDROData_PolylineXY) aRef = Handle(HYDROData_PolylineXY)::DownCast( createHandle( a0 ) ); @@ -65,7 +65,7 @@ public: * Sets reference hydraulic axis object for stream. */ bool SetHydraulicAxis( HYDROData_PolylineXY theAxis ) - [bool ( const Handle_HYDROData_PolylineXY& )]; + [bool ( const opencascade::handle& )]; %MethodCode Handle(HYDROData_PolylineXY) aRef = Handle(HYDROData_PolylineXY)::DownCast( createHandle( a0 ) ); @@ -82,7 +82,7 @@ public: * Returns reference hydraulic axis object of stream. */ HYDROData_PolylineXY GetHydraulicAxis() const - [Handle_HYDROData_PolylineXY ()]; + [opencascade::handle ()]; %MethodCode Handle(HYDROData_PolylineXY) aRef; @@ -103,7 +103,7 @@ public: * Add new one reference profile object for stream. */ bool AddProfile( HYDROData_Profile theProfile ) - [bool ( const Handle_HYDROData_Profile& )]; + [bool ( const opencascade::handle& )]; %MethodCode Handle(HYDROData_Profile) aRef = Handle(HYDROData_Profile)::DownCast( createHandle( a0 ) ); @@ -125,7 +125,7 @@ public: * Removes reference profile object from stream. */ bool RemoveProfile( HYDROData_Profile theProfile ) - [bool ( const Handle_HYDROData_Profile& )]; + [bool ( const opencascade::handle& )]; %MethodCode Handle(HYDROData_Profile) aRef = Handle(HYDROData_Profile)::DownCast( createHandle( a0 ) ); @@ -152,7 +152,7 @@ public: * Returns reference bottom polyline object of stream. */ HYDROData_Polyline3D GetBottomPolyline() const - [Handle_HYDROData_Polyline3D ()]; + [opencascade::handle ()]; %MethodCode Handle(HYDROData_Polyline3D) aRef; @@ -168,7 +168,7 @@ public: * Sets reference bottom polyline object for stream. */ bool SetBottomPolyline( HYDROData_Polyline3D theBottom ) - [bool ( const Handle_HYDROData_Polyline3D& )]; + [bool ( const opencascade::handle& )]; %MethodCode Handle(HYDROData_Polyline3D) aRef = Handle(HYDROData_Polyline3D)::DownCast( createHandle( a0 ) ); diff --git a/src/HYDROPy/HYDROData_Zone.sip b/src/HYDROPy/HYDROData_Zone.sip index 070354cd..ff034d86 100644 --- a/src/HYDROPy/HYDROData_Zone.sip +++ b/src/HYDROPy/HYDROData_Zone.sip @@ -56,7 +56,7 @@ public: MergeType GetMergeType() const; void SetMergeAltitude( HYDROData_IAltitudeObject theAltitude ) - [void (const Handle_HYDROData_IAltitudeObject&)]; + [void (const opencascade::handle&)]; %MethodCode Handle(HYDROData_IAltitudeObject) aRefAltitude = Handle(HYDROData_IAltitudeObject)::DownCast( createHandle( a0 ) ); @@ -69,7 +69,7 @@ public: } %End - HYDROData_IAltitudeObject GetMergeAltitude() const [Handle_HYDROData_IAltitudeObject ()]; + HYDROData_IAltitudeObject GetMergeAltitude() const [opencascade::handle ()]; %MethodCode Handle(HYDROData_IAltitudeObject) aRefAltitude; Py_BEGIN_ALLOW_THREADS @@ -88,10 +88,9 @@ public: Py_END_ALLOW_THREADS %End - void SetMergeObject( HYDROData_Entity theObject ) [void (const Handle_HYDROData_Entity&)]; + void SetMergeObject( HYDROData_Entity theObject ) [void (const opencascade::handle&)]; %MethodCode - Handle(HYDROData_Entity) aRefObject = - Handle(HYDROData_Entity)::DownCast( createHandle( a0 ) ); + Handle(HYDROData_Entity) aRefObject = createHandle( a0 ); if ( !aRefObject.IsNull() ) { Py_BEGIN_ALLOW_THREADS @@ -101,7 +100,7 @@ public: } %End - HYDROData_Entity GetMergeObject() const [Handle_HYDROData_Entity ()]; + HYDROData_Entity GetMergeObject() const [opencascade::handle ()]; %MethodCode Handle(HYDROData_Entity) aRefObject; Py_BEGIN_ALLOW_THREADS @@ -113,11 +112,10 @@ public: void RemoveMergeObject(); - void AddObject( HYDROData_Entity theObject ) [void (const Handle_HYDROData_Entity&)]; + void AddObject( HYDROData_Entity theObject ) [void (const opencascade::handle&)]; %MethodCode - Handle(HYDROData_Entity) anObj = - Handle(HYDROData_Entity)::DownCast( createHandle( a0 ) ); + Handle(HYDROData_Entity) anObj = createHandle( a0 ); if ( !anObj.IsNull() ) { Py_BEGIN_ALLOW_THREADS diff --git a/src/HYDRO_tests/TestViewer.cxx b/src/HYDRO_tests/TestViewer.cxx index 196df1f0..c5e8e513 100644 --- a/src/HYDRO_tests/TestViewer.cxx +++ b/src/HYDRO_tests/TestViewer.cxx @@ -34,9 +34,8 @@ #ifdef WIN32 #pragma warning ( disable: 4251 ) #endif -#include #include -#include +#include #include #include #include @@ -289,22 +288,16 @@ bool TestViewer::AssertImages( QString& theMessage ) return false; } -Handle_Aspect_ColorScale TestViewer::colorScale() +Handle(AIS_ColorScale) TestViewer::colorScale() { - Handle(V3d_View) aView = myViewWindow->getViewPort()->getView(); - if( aView.IsNull() ) - return Handle(Aspect_ColorScale)(); - else - return aView->ColorScale(); + static Handle(AIS_ColorScale) aColorScale = new AIS_ColorScale(); + + return aColorScale; } void TestViewer::showColorScale( bool isShow ) { - Handle(V3d_View) aView = myViewWindow->getViewPort()->getView(); - if( aView.IsNull() ) - return; - - Handle(Aspect_ColorScale) aColorScale = colorScale(); + Handle(AIS_ColorScale) aColorScale = colorScale(); if( aColorScale.IsNull() ) return; @@ -325,15 +318,17 @@ void TestViewer::showColorScale( bool isShow ) aColorScale->SetTitle( "test" ); aColorScale->SetRange( 0, 1 ); + aColorScale->SetToUpdate(); + if( isShow ) { - if( !aView->ColorScaleIsDisplayed() ) - aView->ColorScaleDisplay(); + if( !context()->IsDisplayed( aColorScale ) ) + context()->Display( aColorScale ); } else { - if( aView->ColorScaleIsDisplayed() ) - aView->ColorScaleErase(); + if( context()->IsDisplayed( aColorScale ) ) + context()->Erase( aColorScale ); } } diff --git a/src/HYDRO_tests/TestViewer.h b/src/HYDRO_tests/TestViewer.h index fbcd7da2..de076a1e 100644 --- a/src/HYDRO_tests/TestViewer.h +++ b/src/HYDRO_tests/TestViewer.h @@ -18,15 +18,16 @@ #pragma once +#include + class OCCViewer_ViewManager; class OCCViewer_Viewer; class OCCViewer_ViewWindow; class TopoDS_Shape; class QString; class QColor; -class AIS_InteractiveContext; class AIS_InteractiveObject; -class Aspect_ColorScale; +class AIS_ColorScale; class TestViewer { @@ -44,7 +45,7 @@ public: static bool AssertImages( QString& theMessage ); static QColor GetColor(int i); - static Handle(Aspect_ColorScale) colorScale(); + static Handle(AIS_ColorScale) colorScale(); static void showColorScale( bool ); static void select( int theViewX, int theViewY ); diff --git a/src/HYDRO_tests/test_HYDROData_Bathymetry.h b/src/HYDRO_tests/test_HYDROData_Bathymetry.h index 421933c0..27bed5c6 100644 --- a/src/HYDRO_tests/test_HYDROData_Bathymetry.h +++ b/src/HYDRO_tests/test_HYDROData_Bathymetry.h @@ -18,7 +18,6 @@ #include -class Handle_HYDROData_Bathymetry; class QString; class test_HYDROData_Bathymetry : public CppUnit::TestFixture { diff --git a/src/HYDRO_tests/test_HYDROData_LandCoverMap.cxx b/src/HYDRO_tests/test_HYDROData_LandCoverMap.cxx index 895a52b6..831a9955 100644 --- a/src/HYDRO_tests/test_HYDROData_LandCoverMap.cxx +++ b/src/HYDRO_tests/test_HYDROData_LandCoverMap.cxx @@ -34,7 +34,6 @@ #include #include #include -#include #include #include #include diff --git a/src/HYDRO_tests/test_HYDROData_Main.cxx b/src/HYDRO_tests/test_HYDROData_Main.cxx index c6a979d0..0610149e 100644 --- a/src/HYDRO_tests/test_HYDROData_Main.cxx +++ b/src/HYDRO_tests/test_HYDROData_Main.cxx @@ -44,7 +44,7 @@ int main( int argc, char* argv[] ) int W = 800, H = 600; aWindow->setGeometry( 200, 200, W, H ); aWindow->show(); - QTest::qWaitForWindowShown( aWindow ); + QTest::qWaitForWindowExposed( aWindow ); int dy = 34; //std::cout << dx << "," << dy << std::endl; diff --git a/src/HYDRO_tests/test_HYDROData_Profile.h b/src/HYDRO_tests/test_HYDROData_Profile.h index 9785cf72..e2177bf4 100644 --- a/src/HYDRO_tests/test_HYDROData_Profile.h +++ b/src/HYDRO_tests/test_HYDROData_Profile.h @@ -18,7 +18,6 @@ #include -class Handle_HYDROData_Profile; class QString; class test_HYDROData_Profile : public CppUnit::TestFixture { diff --git a/src/HYDRO_tests/test_HYDROGUI_ListModel.cxx b/src/HYDRO_tests/test_HYDROGUI_ListModel.cxx index f5b0ea49..2290ed7e 100644 --- a/src/HYDRO_tests/test_HYDROGUI_ListModel.cxx +++ b/src/HYDRO_tests/test_HYDROGUI_ListModel.cxx @@ -22,7 +22,7 @@ #include #include -Handle_HYDROData_Document GetDocument() +Handle(HYDROData_Document) GetDocument() { return HYDROData_Document::Document( 0 ); } @@ -33,7 +33,7 @@ HYDROGUI_ListModel::Object2VisibleList CreateTestObjects( int theObjCount ) for( int i=0; iCreateObject( KIND_IMMERSIBLE_ZONE ); + Handle(HYDROData_Entity) anObj = GetDocument()->CreateObject( KIND_IMMERSIBLE_ZONE ); std::string aName = " "; aName[0] = 'A' + i; @@ -424,4 +424,4 @@ void test_HYDROGUI_ListModel::testDragAndDrop() aRes = aModel->move( QList() << 0 << 2 << 4 << 5 << 7, aDnD, false, 3 ); CPPUNIT_ASSERT_EQUAL( true, aRes ); CPPUNIT_ASSERT_EQUAL( std::string( "F, *A, *G, *C, H, *E, D, B" ), GetObjects( aModel ) ); -} \ No newline at end of file +} diff --git a/src/HYDRO_tests/test_HYDROGUI_Shape.cxx b/src/HYDRO_tests/test_HYDROGUI_Shape.cxx index e99db415..aa6d9c88 100644 --- a/src/HYDRO_tests/test_HYDROGUI_Shape.cxx +++ b/src/HYDRO_tests/test_HYDROGUI_Shape.cxx @@ -31,8 +31,8 @@ void test_HYDROGUI_Shape::test_face_in_preview() 128 << 18 << 140 << 50 << 131 << 89 << 104 << 111 << 31 << 114 ); - Handle_AIS_InteractiveContext aContext = TestViewer::context(); - Handle_HYDROData_Entity anEntity; //it should be null as in preview + Handle(AIS_InteractiveContext) aContext = TestViewer::context(); + Handle(HYDROData_Entity) anEntity; //it should be null as in preview HYDROGUI_Shape* aPreview = new HYDROGUI_Shape( aContext, anEntity ); aPreview->setFace( aFace, true, true, "" ); -- 2.39.2