ADD_DEFINITIONS(-DWNT)
ENDIF(WIN32)
+
+# Common CMake macros
+# ===================
+SET(CONFIGURATION_ROOT_DIR $ENV{CONFIGURATION_ROOT_DIR} CACHE PATH "Path to the Salome CMake configuration files")
+IF(EXISTS ${CONFIGURATION_ROOT_DIR})
+ LIST(APPEND CMAKE_MODULE_PATH "${CONFIGURATION_ROOT_DIR}/cmake")
+ INCLUDE(SalomeMacros)
+ELSE()
+ MESSAGE(FATAL_ERROR "We absolutely need the Salome CMake configuration files, please define CONFIGURATION_ROOT_DIR !")
+ENDIF()
+
# Find KERNEL
# ==============
SET(KERNEL_ROOT_DIR $ENV{KERNEL_ROOT_DIR} CACHE PATH "Path to the Salome KERNEL")
# Qt
IF(NOT SALOME_GUI_BUILD_WITH_QT5)
FIND_PACKAGE(SalomeQt4 REQUIRED COMPONENTS QtCore QtGui QtXml QtWebKit QtOpenGL QtNetwork QtTest)
- SET(QT_ROOT_DIR "${QTDIR}")
+ SET(QT_ROOT_DIR "${QT4_ROOT_DIR}")
SALOME_CONFIGURE_PREPARE(HYDROData HYDROGUI HYDROPy Qt4 PyQt4)
ELSE()
FIND_PACKAGE(SalomeQt5 REQUIRED)
- SET(QT_ROOT_DIR "${QTDIR}")
+ SET(QT_ROOT_DIR "${QT5_ROOT_DIR}")
SALOME_CONFIGURE_PREPARE(HYDROData HYDROGUI HYDROPy Qt5 PyQt5)
ENDIF()
# PyQt
IF(NOT SALOME_GUI_BUILD_WITH_QT5)
FIND_PACKAGE(SalomePyQt4 REQUIRED)
- SET(PYQT_ROOT_DIR "${PYQT_ROOT_DIR}")
+ SET(PYQT_ROOT_DIR "${PYQT4_ROOT_DIR}")
ELSE()
FIND_PACKAGE(SalomePyQt5 REQUIRED)
- SET(PYQT_ROOT_DIR "${PYQT_ROOT_DIR}")
+ SET(PYQT_ROOT_DIR "${PYQT5_ROOT_DIR}")
ENDIF()
# Detection summary:
def set_env( args ):
os.environ["SALOME_MODULES_ORDER"] = "HYDRO,GEOM,SMESH"
+ os.environ["GEOM_IGNORE_RESTORE_SHAPE"] = "2"
pass
theStudy = salome.myStudy
from HYDROPy import *
-from PyQt4.QtCore import *
-from PyQt4.QtGui import *
+from PyQt5.QtCore import *
+from PyQt5.QtGui import *
hydro_doc = HYDROData_Document.Document( theStudy._get_StudyId() )
theStudy = salome.myStudy
from HYDROPy import *
-from PyQt4.QtCore import *
-from PyQt4.QtGui import *
+from PyQt5.QtCore import *
+from PyQt5.QtGui import *
hydro_doc = HYDROData_Document.Document( theStudy._get_StudyId() )
theStudy = salome.myStudy
from HYDROPy import *
-from PyQt4.QtCore import *
-from PyQt4.QtGui import *
+from PyQt5.QtCore import *
+from PyQt5.QtGui import *
hydro_doc = HYDROData_Document.Document( theStudy._get_StudyId() )
theStudy = salome.myStudy
from HYDROPy import *
-from PyQt4.QtCore import *
-from PyQt4.QtGui import *
+from PyQt5.QtCore import *
+from PyQt5.QtGui import *
hydro_doc = HYDROData_Document.Document( theStudy._get_StudyId() )
theStudy = salome.myStudy
from HYDROPy import *
-from PyQt4.QtCore import *
-from PyQt4.QtGui import *
+from PyQt5.QtCore import *
+from PyQt5.QtGui import *
hydro_doc = HYDROData_Document.Document( theStudy._get_StudyId() )
theStudy = salome.myStudy
from HYDROPy import *
-from PyQt4.QtCore import *
-from PyQt4.QtGui import *
+from PyQt5.QtCore import *
+from PyQt5.QtGui import *
hydro_doc = HYDROData_Document.Document( theStudy._get_StudyId() )
theStudy = salome.myStudy
from HYDROPy import *
-from PyQt4.QtCore import *
-from PyQt4.QtGui import *
+from PyQt5.QtCore import *
+from PyQt5.QtGui import *
hydro_doc = HYDROData_Document.Document( theStudy._get_StudyId() )
#----------------------
from HYDROPy import *
-from PyQt4.QtCore import *
-from PyQt4.QtGui import *
+from PyQt5.QtCore import *
+from PyQt5.QtGui import *
hydro_doc = HYDROData_Document.Document( theStudy._get_StudyId() )
#----------------------
from HYDROPy import *
-from PyQt4.QtCore import *
-from PyQt4.QtGui import *
+from PyQt5.QtCore import *
+from PyQt5.QtGui import *
hydro_doc = HYDROData_Document.Document( theStudy._get_StudyId() )
#----------------------
from HYDROPy import *
-from PyQt4.QtCore import *
-from PyQt4.QtGui import *
+from PyQt5.QtCore import *
+from PyQt5.QtGui import *
hydro_doc = HYDROData_Document.Document( theStudy._get_StudyId() )
#----------------------
from HYDROPy import *
-from PyQt4.QtCore import *
-from PyQt4.QtGui import *
+from PyQt5.QtCore import *
+from PyQt5.QtGui import *
hydro_doc = HYDROData_Document.Document( theStudy._get_StudyId() )
#----------------------
from HYDROPy import *
-from PyQt4.QtCore import *
-from PyQt4.QtGui import *
+from PyQt5.QtCore import *
+from PyQt5.QtGui import *
hydro_doc = HYDROData_Document.Document( theStudy._get_StudyId() )
#----------------------
from HYDROPy import *
-from PyQt4.QtCore import *
-from PyQt4.QtGui import *
+from PyQt5.QtCore import *
+from PyQt5.QtGui import *
hydro_doc = HYDROData_Document.Document( theStudy._get_StudyId() )
#----------------------
from HYDROPy import *
-from PyQt4.QtCore import *
-from PyQt4.QtGui import *
+from PyQt5.QtCore import *
+from PyQt5.QtGui import *
hydro_doc = HYDROData_Document.Document( theStudy._get_StudyId() )
#----------------------
from HYDROPy import *
-from PyQt4.QtCore import *
-from PyQt4.QtGui import *
+from PyQt5.QtCore import *
+from PyQt5.QtGui import *
hydro_doc = HYDROData_Document.Document( theStudy._get_StudyId() )
###
from HYDROPy import *
-from PyQt4.QtCore import *
-from PyQt4.QtGui import *
+from PyQt5.QtCore import *
+from PyQt5.QtGui import *
hydro_doc = HYDROData_Document.Document( theStudy._get_StudyId() )
###
from HYDROPy import *
-from PyQt4.QtCore import *
-from PyQt4.QtGui import *
+from PyQt5.QtCore import *
+from PyQt5.QtGui import *
hydro_doc = HYDROData_Document.Document( theStudy._get_StudyId() )
import sys
import salome
+import os
+HYDRO_SAMPLES = os.path.join( os.environ["HYDRO_ROOT_DIR"], "bin/salome/test/HYDRO")
+
+
salome.salome_init()
theStudy = salome.myStudy
#----------------------
from HYDROPy import *
-from PyQt4.QtCore import *
-from PyQt4.QtGui import *
+from PyQt5.QtCore import *
+from PyQt5.QtGui import *
hydro_doc = HYDROData_Document.Document( theStudy._get_StudyId() )
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/SalomeMacros.cmake)
-
SALOME_CONFIGURE_FILE(doxyfile.in doxyfile)
SALOME_CONFIGURE_FILE(static/header.html.in ${CMAKE_CURRENT_BINARY_DIR}/static/header.html)
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/SalomeMacros.cmake)
-
SALOME_CONFIGURE_FILE(doxyfile.in doxyfile)
ADD_CUSTOM_TARGET(dev_docs ${DOXYGEN_EXECUTABLE})
#define _DEVDEBUG_
#include "HYDRO_trace.hxx"
-IMPLEMENT_STANDARD_HANDLE(HYDROData_AltitudeObject, HYDROData_IAltitudeObject)
IMPLEMENT_STANDARD_RTTIEXT(HYDROData_AltitudeObject, HYDROData_IAltitudeObject)
HYDROData_AltitudeObject::HYDROData_AltitudeObject()
#include "HYDROData_IAltitudeObject.h"
-DEFINE_STANDARD_HANDLE(HYDROData_AltitudeObject, HYDROData_IAltitudeObject)
-
/**\class HYDROData_AltitudeObject
* \brief Class that stores/retreives information about the Altitude.
class HYDROData_AltitudeObject : public HYDROData_IAltitudeObject
{
protected:
-
/**
* Enumeration of tags corresponding to the persistent object parameters.
*/
};
public:
-
- DEFINE_STANDARD_RTTI(HYDROData_AltitudeObject);
+ DEFINE_STANDARD_RTTIEXT(HYDROData_AltitudeObject, HYDROData_IAltitudeObject);
/**
* Returns the kind of this object.
#include <TColStd_SequenceOfExtendedString.hxx>
-IMPLEMENT_STANDARD_HANDLE(HYDROData_Application,TDocStd_Application)
IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Application,TDocStd_Application)
static HYDROData_Application* TheApplication = new HYDROData_Application;
HYDRODATA_EXPORT HYDROData_Application();
// CASCADE RTTI
- DEFINE_STANDARD_RTTI(HYDROData_Application)
+ DEFINE_STANDARD_RTTIEXT(HYDROData_Application, TDocStd_Application)
private:
//! Returns document by its study ID, if document doesn't exists return null
friend class HYDROData_Document; // to manipulate documents of application
};
-// Define handle class
-DEFINE_STANDARD_HANDLE(HYDROData_Application,TDocStd_Application)
-
#endif
#include "HYDROData_ArtificialObject.h"
-IMPLEMENT_STANDARD_HANDLE(HYDROData_ArtificialObject,HYDROData_Object)
IMPLEMENT_STANDARD_RTTIEXT(HYDROData_ArtificialObject,HYDROData_Object)
HYDROData_ArtificialObject::HYDROData_ArtificialObject( Geometry theGeometry )
#include <HYDROData_Object.h>
-DEFINE_STANDARD_HANDLE(HYDROData_ArtificialObject, HYDROData_Object)
-
-
/**\class HYDROData_ArtificialObject
* \brief The artificial objects are objects created or planned for creation by human.
*
};
public:
- DEFINE_STANDARD_RTTI(HYDROData_ArtificialObject);
+ DEFINE_STANDARD_RTTIEXT(HYDROData_ArtificialObject, HYDROData_Object);
protected:
const int BLOCK_SIZE = 1000;
-IMPLEMENT_STANDARD_HANDLE(HYDROData_Bathymetry, HYDROData_IAltitudeObject)
IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Bathymetry, HYDROData_IAltitudeObject)
//HYDROData_QuadtreeNode* HYDROData_Bathymetry::myQuadtree = 0;
}
// Convert from global to local CS
- Handle_HYDROData_Document aDoc = HYDROData_Document::Document( myLab );
+ Handle(HYDROData_Document) aDoc = HYDROData_Document::Document( myLab );
HYDROData_Bathymetry::AltitudePoints::iterator anIter = AllPoints.begin(), aLast = AllPoints.end();
for ( ; anIter!=aLast; ++anIter )
{
}
-Handle_HYDROData_PolylineXY HYDROData_Bathymetry::CreateBoundaryPolyline() const
+Handle(HYDROData_PolylineXY) HYDROData_Bathymetry::CreateBoundaryPolyline() const
{
Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( myLab );
- Handle_HYDROData_PolylineXY aResult =
- Handle_HYDROData_PolylineXY::DownCast( aDocument->CreateObject( KIND_POLYLINEXY ) );
+ Handle(HYDROData_PolylineXY) aResult =
+ Handle(HYDROData_PolylineXY)::DownCast( aDocument->CreateObject( KIND_POLYLINEXY ) );
if( aResult.IsNull() )
return aResult;
class QFile;
class gp_XYZ;
class gp_XY;
-class Handle_HYDROData_PolylineXY;
+class HYDROData_PolylineXY;
class HYDROData_QuadtreeNode;
class vtkPolyData;
class vtkIdList;
-DEFINE_STANDARD_HANDLE(HYDROData_Bathymetry, HYDROData_IAltitudeObject)
-
/**\class HYDROData_Bathymetry
* \brief Class that stores/retreives information about the Bathymetry.
};
public:
-
- DEFINE_STANDARD_RTTI(HYDROData_Bathymetry);
+ DEFINE_STANDARD_RTTIEXT(HYDROData_Bathymetry, HYDROData_IAltitudeObject);
/**
* Returns the kind of this object. Must be redefined in all objects of known type.
HYDRODATA_EXPORT virtual bool ImportFromFile( const QString& theFileName );
- HYDRODATA_EXPORT Handle_HYDROData_PolylineXY CreateBoundaryPolyline() const;
+ HYDRODATA_EXPORT Handle(HYDROData_PolylineXY) CreateBoundaryPolyline() const;
HYDRODATA_EXPORT virtual void UpdateLocalCS( double theDx, double theDy );
#define _DEVDEBUG_
#include "HYDRO_trace.hxx"
-IMPLEMENT_STANDARD_HANDLE(HYDROData_CalculationCase, HYDROData_Entity)
IMPLEMENT_STANDARD_RTTIEXT(HYDROData_CalculationCase, HYDROData_Entity)
HYDROData_CalculationCase::HYDROData_CalculationCase()
const TopoDS_Shape& aShape = aShToName.FindKey(i);
if ( aShape.IsNull() )
continue;
-
+
SH2M.Bind(aShape, TopTools_ListOfShape());
TopTools_ListOfShape& LM = SH2M.ChangeFind(aShape);
if ( aShape.ShapeType() == TopAbs_FACE || aShape.ShapeType() == TopAbs_SHELL )
LM.Append(anExp.Current());
}
anExp.Init( aShape, TopAbs_FACE, TopAbs_SHELL );
+ for (; anExp.More(); anExp.Next() )
{
aSewing.Add( anExp.Current() );
LM.Append(anExp.Current());
#ifdef DEB_CALCULATION
BRepTools::Write(aSewedShape ,"Sew.brep");
-#endif
- // Publish the sewed shape
+#endif // Publish the sewed shape
QString aName = EXPORT_NAME;
GEOM::GEOM_Object_ptr aMainShape =
HYDROData_GeomTool::ExplodeShapeInGEOMandPublish( theGeomEngine, theStudy, aSewedShape, aFacesToNameModif, aName, theGeomObjEntry );
class TopoDS_Shape;
class TopoDS_Shell;
-class TopTools_ListOfShape;
-
-class Handle(HYDROData_Object);
-class Handle(HYDROData_Region);
-class Handle(HYDROData_Zone);
-class Handle(HYDROData_PolylineXY);
-class Handle(HYDROData_ShapesGroup);
-class Handle(HYDROData_SplitShapesGroup);
-class Handle(HYDROData_Document);
-class Handle(HYDROData_StricklerTable);
-class Handle(HYDROData_LandCoverMap);
-
-DEFINE_STANDARD_HANDLE(HYDROData_CalculationCase, HYDROData_Entity)
+class HYDROData_Object;
+class HYDROData_Region;
+class HYDROData_Zone;
+class HYDROData_PolylineXY;
+class HYDROData_ShapesGroup;
+class HYDROData_SplitShapesGroup;
+class HYDROData_Document;
+class HYDROData_StricklerTable;
+class HYDROData_LandCoverMap;
/**\class HYDROData_CalculationCase
* \brief Calculation case is defined by selection of Geometry objects with or without �Zone of water�.
};
public:
-
- DEFINE_STANDARD_RTTI(HYDROData_CalculationCase);
+ DEFINE_STANDARD_RTTIEXT(HYDROData_CalculationCase, HYDROData_Entity);
/**
* Returns the kind of this object. Must be redefined in all objects of known type.
#include <TColStd_Array1OfReal.hxx>
#include <TopTools_HArray1OfShape.hxx>
+#include <TopTools_SequenceOfShape.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Wire.hxx>
#define _DEVDEBUG_
#include "HYDRO_trace.hxx"
-IMPLEMENT_STANDARD_HANDLE(HYDROData_Channel,HYDROData_ArtificialObject)
IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Channel,HYDROData_ArtificialObject)
#include <TopoDS_Face.hxx>
#include <TopoDS_Wire.hxx>
-class Handle(HYDROData_Polyline3D);
-class Handle(HYDROData_Profile);
-class TopTools_SequenceOfShape;
-class TopTools_ListOfShape;
-
-DEFINE_STANDARD_HANDLE(HYDROData_Channel, HYDROData_ArtificialObject)
+class HYDROData_Polyline3D;
+class HYDROData_Profile;
/**\class HYDROData_Channel
* \brief
};
public:
-
- DEFINE_STANDARD_RTTI(HYDROData_Channel);
+ DEFINE_STANDARD_RTTIEXT(HYDROData_Channel, HYDROData_ArtificialObject);
public:
#include <gp_Pnt.hxx>
#include <gp_Vec.hxx>
-IMPLEMENT_STANDARD_HANDLE(HYDROData_ChannelAltitude, HYDROData_IAltitudeObject)
IMPLEMENT_STANDARD_RTTIEXT(HYDROData_ChannelAltitude, HYDROData_IAltitudeObject)
HYDROData_ChannelAltitude::HYDROData_ChannelAltitude()
#include "HYDROData_IAltitudeObject.h"
-DEFINE_STANDARD_HANDLE(HYDROData_ChannelAltitude, HYDROData_IAltitudeObject)
-
/**\class HYDROData_ChannelAltitude
* \brief Class that stores/retrieves information about the Channel altitude.
public:
- DEFINE_STANDARD_RTTI(HYDROData_ChannelAltitude);
+ DEFINE_STANDARD_RTTIEXT(HYDROData_ChannelAltitude, HYDROData_IAltitudeObject);
/**
* Returns the kind of this object.
#include <QStringList>
-IMPLEMENT_STANDARD_HANDLE(HYDROData_Confluence,HYDROData_NaturalObject)
IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Confluence,HYDROData_NaturalObject)
#include "HYDROData_NaturalObject.h"
-DEFINE_STANDARD_HANDLE(HYDROData_Confluence, HYDROData_NaturalObject)
-
/**\class HYDROData_Confluence
* \brief
*
};
public:
- DEFINE_STANDARD_RTTI(HYDROData_Confluence);
+ DEFINE_STANDARD_RTTIEXT(HYDROData_Confluence, HYDROData_NaturalObject);
/**
* Returns the kind of this object. Must be redefined in all objects of known type.
#include <BRep_Builder.hxx>
#include <GeomProjLib.hxx>
#include <Geom_TrimmedCurve.hxx>
-#include <Geom_Plane.hxx>
#include <BRepTools_WireExplorer.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <BRepBuilderAPI_MakeFace.hxx>
#include <TopTools_SequenceOfShape.hxx>
#include <assert.h>
-IMPLEMENT_STANDARD_HANDLE( HYDROData_DTM, HYDROData_Bathymetry )
IMPLEMENT_STANDARD_RTTIEXT( HYDROData_DTM, HYDROData_Bathymetry )
HYDROData_DTM::CurveUZ::CurveUZ( double theXCurv, const gp_Vec2d& theProfileDir, double theDeltaZ )
anInterpolator.Perform() ;
if (anInterpolator.IsDone())
{
- Handle(Geom_Curve) C = anInterpolator.Curve();
+ Handle(Geom_BSplineCurve) C = anInterpolator.Curve();
E = BRepBuilderAPI_MakeEdge(C).Edge();
}
}
int aLower = InpProfiles.Lower(), anUpper = InpProfiles.Upper();
size_t n = anUpper - aLower + 1;
- std::vector<Handle_HYDROData_Profile> profiles;
+ std::vector<Handle(HYDROData_Profile)> profiles;
profiles.reserve( n );
for( int i=aLower; i<=anUpper; i++ )
{
return !res;
}
-void HYDROData_DTM::CreateProfiles(const std::vector<Handle_HYDROData_Profile>& theProfiles,
+void HYDROData_DTM::CreateProfiles(const std::vector<Handle(HYDROData_Profile)>& theProfiles,
double theDDZ,
double theSpatialStep,
AltitudePoints& theOutLeft,
-void HYDROData_DTM::GetProperties( const Handle_HYDROData_Profile& theProfile,
+void HYDROData_DTM::GetProperties( const Handle(HYDROData_Profile)& theProfile,
gp_Pnt& theLowestPoint, gp_Vec2d& theDir,
double& theZMin, double& theZMax )
{
aLast2d = To2D( aLastPnt, theTr, theUMin, theUMax );
gp_Vec2d dir( aFirst2d, aLast2d );
- Handle_Geom2d_Line aLine2d = new Geom2d_Line( aFirst2d, gp_Dir2d( dir.X(), dir.Y() ) );
+ Handle(Geom2d_Line) aLine2d = new Geom2d_Line( aFirst2d, gp_Dir2d( dir.X(), dir.Y() ) );
return new Geom2d_TrimmedCurve( aLine2d, 0, aLast2d.Distance( aFirst2d ) );
}
#include <GCE2d_MakeSegment.hxx>
#include <Geom2dAPI_InterCurveCurve.hxx>
-bool IsCooriented( const Handle_HYDROData_Profile& theProfile1,
- const Handle_HYDROData_Profile& theProfile2 )
+bool IsCooriented( const Handle(HYDROData_Profile)& theProfile1,
+ const Handle(HYDROData_Profile)& theProfile2 )
{
if( theProfile1==theProfile2 )
return true;
GCE2d_MakeSegment s2(rp1, rp2);
Geom2dAPI_InterCurveCurve inter;
- inter.Init(s1, s2);
+ inter.Init(s1.Value(), s2.Value());
if (inter.NbPoints() == 0)
return true;
else
return false;
}
-Handle_Geom2d_BSplineCurve HYDROData_DTM::CreateHydraulicAxis(
- const std::vector<Handle_HYDROData_Profile>& theProfiles,
+Handle(Geom2d_BSplineCurve) HYDROData_DTM::CreateHydraulicAxis(
+ const std::vector<Handle(HYDROData_Profile)>& theProfiles,
std::vector<double>& theDistances )
{
size_t n = theProfiles.size();
theProfiles[0]->Update();
for( size_t i = 1; i < n; i++ )
{
- Handle_HYDROData_Profile aProfile = theProfiles[i];
- Handle_HYDROData_Profile aPrevProfile = theProfiles[i-1];
+ Handle(HYDROData_Profile) aProfile = theProfiles[i];
+ Handle(HYDROData_Profile) aPrevProfile = theProfiles[i-1];
if( !IsCooriented( aProfile, aPrevProfile ) )
{
// Stage 2. Calculate normals so that each normal "points" to the next profile
for( size_t i = 0; i < n; i++ )
{
- Handle_HYDROData_Profile aProfile = theProfiles[i];
- Handle_HYDROData_Profile aNextProfile = i==n-1 ? theProfiles[i-1] : theProfiles[i+1];
+ Handle(HYDROData_Profile) aProfile = theProfiles[i];
+ Handle(HYDROData_Profile) aNextProfile = i==n-1 ? theProfiles[i-1] : theProfiles[i+1];
gp_Pnt aLowest;
gp_Vec2d aNormal;
return aResult;
}
-std::vector<Handle_Geom2d_Curve> HYDROData_DTM::ProfileToParametric(
- const Handle_HYDROData_Profile& theProfile,
+std::vector<Handle(Geom2d_Curve)> HYDROData_DTM::ProfileToParametric(
+ const Handle(HYDROData_Profile)& theProfile,
double& theUMin, double& theUMax, gp_Vec2d& theDir )
{
- std::vector<Handle_Geom2d_Curve> curves;
+ std::vector<Handle(Geom2d_Curve)> curves;
// Transformation of the coordinate systems
gp_Pnt aLowest;
return true;
}
-void HYDROData_DTM::ProfileDiscretization( const Handle_HYDROData_Profile& theProfile,
+void HYDROData_DTM::ProfileDiscretization( const Handle(HYDROData_Profile)& theProfile,
double theXCurv, double theMinZ, double theMaxZ, double theDDZ,
CurveUZ& theMidPointCurve,
CurveUZ& theWidthCurve,
aVMax = 1000000;
gp_Vec2d aProfileDir;
- std::vector<Handle_Geom2d_Curve> curves = ProfileToParametric( theProfile, aUMin, aUMax, aProfileDir );
+ std::vector<Handle(Geom2d_Curve)> curves = ProfileToParametric( theProfile, aUMin, aUMax, aProfileDir );
size_t n = curves.size();
if( n==0 )
std::set<double> intersections;
for( size_t i = 0; i < n; i++ )
{
- Handle_Geom2d_Curve aCurve = curves[i];
+ Handle(Geom2d_Curve) aCurve = curves[i];
Geom2dAPI_InterCurveCurve anIntersect( aCurve, aLine, theTolerance );
for( int k=1, m=anIntersect.NbPoints(); k<=m; k++ )
intersections.insert( anIntersect.Point( k ).X() );
theInterpolation.push_back( theCurveB );
}
#include <BRepLib_MakeEdge2d.hxx>
-void HYDROData_DTM::CurveTo3D( const Handle_Geom2d_BSplineCurve& theHydraulicAxis,
+void HYDROData_DTM::CurveTo3D( const Handle(Geom2d_BSplineCurve)& theHydraulicAxis,
const CurveUZ& theMidCurve, const CurveUZ& theWidthCurve,
AltitudePoints& thePoints )
{
#include <BRepLib_MakeWire.hxx>
std::vector<HYDROData_Bathymetry::AltitudePoints> HYDROData_DTM::Interpolate
- ( const Handle_Geom2d_BSplineCurve& theHydraulicAxis,
- const Handle_HYDROData_Profile& theProfileA,
+ ( const Handle(Geom2d_BSplineCurve)& theHydraulicAxis,
+ const Handle(HYDROData_Profile)& theProfileA,
double theXCurvA,
- const Handle_HYDROData_Profile& theProfileB,
+ const Handle(HYDROData_Profile)& theProfileB,
double theXCurvB,
double theDDZ, int theNbSteps, bool isAddSecond,
int& inter_nb_1, int& inter_nb_2)
}
HYDROData_Bathymetry::AltitudePoints HYDROData_DTM::Interpolate
- ( const std::vector<Handle_HYDROData_Profile>& theProfiles,
+ ( const std::vector<Handle(HYDROData_Profile)>& theProfiles,
double theDDZ, double theSpatialStep,
AltitudePoints& theLeft,
AltitudePoints& theRight,
return points;
std::vector<double> distances;
- Handle_Geom2d_BSplineCurve aHydraulicAxis = CreateHydraulicAxis( theProfiles, distances );
+ Handle(Geom2d_BSplineCurve) aHydraulicAxis = CreateHydraulicAxis( theProfiles, distances );
if( aHydraulicAxis.IsNull() )
return points;
return points;
}
-int HYDROData_DTM::EstimateNbPoints( const std::vector<Handle_HYDROData_Profile>& theProfiles,
+int HYDROData_DTM::EstimateNbPoints( const std::vector<Handle(HYDROData_Profile)>& theProfiles,
double theDDZ, double theSpatialStep )
{
size_t n = theProfiles.size();
return 1 << 20;
std::vector<double> distances;
- Handle_Geom2d_BSplineCurve aHydraulicAxis = CreateHydraulicAxis( theProfiles, distances );
+ Handle(Geom2d_BSplineCurve) aHydraulicAxis = CreateHydraulicAxis( theProfiles, distances );
if( aHydraulicAxis.IsNull() )
return 0;
#define HYDROData_DTM_HeaderFile
#include "HYDROData_Bathymetry.h"
+#include "HYDROData_Profile.h"
+
+#include <gp_Pnt2d.hxx>
+
+#include<Geom2d_BSplineCurve.hxx>
+#include<Geom2d_Curve.hxx>
+#include<Geom_Plane.hxx>
+
+#include <TopTools_DataMapOfShapeListOfShape.hxx>
+#include <TopTools_IndexedMapOfOrientedShape.hxx>
+#include <TopTools_SequenceOfShape.hxx>
+
#include <vector>
#include <set>
-#include <gp_Pnt2d.hxx>
-class Handle_HYDROData_Profile;
-class Handle_Geom2d_BSplineCurve;
-class Handle_Geom2d_Curve;
class gp_Pnt;
class gp_Vec2d;
class TopoDS_Edge;
class TopoDS_Wire;
class TopoDS_Face;
class TopoDS_Compound;
-class Handle_Geom_Plane;
-class TopTools_IndexedMapOfOrientedShape;
-class TopTools_DataMapOfShapeListOfShape;
-class TopTools_SequenceOfShape;
-DEFINE_STANDARD_HANDLE( HYDROData_DTM, HYDROData_Bathymetry )
/**\class HYDROData_DTM
* \brief Class that represents the Digital Terrain Model
};
public:
- DEFINE_STANDARD_RTTI( HYDROData_DTM );
+ DEFINE_STANDARD_RTTIEXT( HYDROData_DTM, HYDROData_Bathymetry );
HYDRODATA_EXPORT HYDROData_SequenceOfObjects GetProfiles() const;
HYDRODATA_EXPORT void SetProfiles( const HYDROData_SequenceOfObjects& );
HYDRODATA_EXPORT HYDROData_DTM();
virtual HYDRODATA_EXPORT ~HYDROData_DTM();
- static Handle_Geom2d_BSplineCurve CreateHydraulicAxis(
- const std::vector<Handle_HYDROData_Profile>& theProfiles,
+ static Handle(Geom2d_BSplineCurve) CreateHydraulicAxis(
+ const std::vector<Handle(HYDROData_Profile)>& theProfiles,
std::vector<double>& theDistances );
- static std::vector<Handle_Geom2d_Curve> ProfileToParametric( const Handle_HYDROData_Profile& theProfile,
- double& theUMin, double& theUMax,
- gp_Vec2d& theDir );
+ static std::vector<Handle(Geom2d_Curve)> ProfileToParametric( const Handle(HYDROData_Profile)& theProfile,
+ double& theUMin, double& theUMax,
+ gp_Vec2d& theDir );
- static void GetProperties( const Handle_HYDROData_Profile& theProfile,
+ static void GetProperties( const Handle(HYDROData_Profile)& theProfile,
gp_Pnt& theLowestPoint, gp_Vec2d& theDir,
double& theZMin, double& theZMax );
- static void ProfileDiscretization( const Handle_HYDROData_Profile& theProfile,
+ static void ProfileDiscretization( const Handle(HYDROData_Profile)& theProfile,
double theXCurv, double theMinZ, double theMaxZ, double theDDZ,
CurveUZ& theMidPointCurve,
CurveUZ& theWidthCurve,
int& intersection_nb,
double theTolerance = 1E-6 );
- static void CurveTo3D( const Handle_Geom2d_BSplineCurve& theHydraulicAxis,
+ static void CurveTo3D( const Handle(Geom2d_BSplineCurve)& theHydraulicAxis,
const CurveUZ& theMidCurve, const CurveUZ& theWidthCurve,
AltitudePoints& thePoints );
bool isAddSecond );
static std::vector<AltitudePoints> Interpolate
- ( const Handle_Geom2d_BSplineCurve& theHydraulicAxis,
- const Handle_HYDROData_Profile& theProfileA,
+ ( const Handle(Geom2d_BSplineCurve)& theHydraulicAxis,
+ const Handle(HYDROData_Profile)& theProfileA,
double theXCurvA,
- const Handle_HYDROData_Profile& theProfileB,
+ const Handle(HYDROData_Profile)& theProfileB,
double theXCurvB,
double theDDZ, int theNbSteps, bool isAddSecond,
int& inter_nb_1, int& inter_nb_2 );
- static AltitudePoints Interpolate( const std::vector<Handle_HYDROData_Profile>& theProfiles,
+ static AltitudePoints Interpolate( const std::vector<Handle(HYDROData_Profile)>& theProfiles,
double theDDZ, double theSpatialStep,
AltitudePoints& theLeft,
AltitudePoints& theRight,
const AltitudePoints& right,
const std::vector<AltitudePoints>& main_profiles);
- static void CreateProfiles(const std::vector<Handle_HYDROData_Profile>& theProfiles,
+ static void CreateProfiles(const std::vector<Handle(HYDROData_Profile)>& theProfiles,
double theDDZ,
double theSpatialStep,
AltitudePoints& theOutLeft,
//static bool Get2dFaceFrom3dPres(const TopoDS_Compound& cmp, TopoDS_Face& outF,
//TopTools_SequenceOfShape* Boundr = NULL, std::set<int> ind = std::set<int>() );
- static int EstimateNbPoints( const std::vector<Handle_HYDROData_Profile>& theProfiles,
+ static int EstimateNbPoints( const std::vector<Handle(HYDROData_Profile)>& theProfiles,
double theDDZ, double theSpatialStep );
void GetPresentationShapes( TopoDS_Shape& Out3dPres,
#include <QColor>
#include <QStringList>
-IMPLEMENT_STANDARD_HANDLE(HYDROData_Digue,HYDROData_Channel)
IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Digue,HYDROData_Channel)
#include "HYDROData_Channel.h"
-DEFINE_STANDARD_HANDLE(HYDROData_Digue, HYDROData_Channel)
-
/**\class HYDROData_Digue
* \brief
*
};
public:
- DEFINE_STANDARD_RTTI(HYDROData_Digue);
+ DEFINE_STANDARD_RTTIEXT(HYDROData_Digue, HYDROData_Channel);
/**
* Returns the kind of this object. Must be redefined in all objects of known type.
#include <QTextStream>
#include <QColor>
-IMPLEMENT_STANDARD_HANDLE(HYDROData_Document,MMgt_TShared)
IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Document,MMgt_TShared)
#define PYTHON_DOC_NAME "hydro_doc"
using namespace std;
-typedef QMap<Standard_Integer,Handle_HYDROData_Entity> MapOfOrdered;
-typedef QMap<QString,Handle_HYDROData_Entity> MapOfUnordered;
+typedef QMap<Standard_Integer, Handle(HYDROData_Entity)> MapOfOrdered;
+typedef QMap<QString, Handle(HYDROData_Entity)> MapOfUnordered;
Handle(HYDROData_Document) HYDROData_Document::Document(const int theStudyID)
{
QStringList aResScript;
aResScript << QString( "from HYDROPy import *" );
- aResScript << QString( "from PyQt4.QtCore import *" );
- aResScript << QString( "from PyQt4.QtGui import *" );
+ aResScript << QString( "from PyQt5.QtCore import *" );
+ aResScript << QString( "from PyQt5.QtGui import *" );
if ( theIsMultiFile )
{
}
}
-void HYDROData_Document::Show( const Handle_HYDROData_Entity& theObject )
+void HYDROData_Document::Show( const Handle(HYDROData_Entity)& theObject )
{
HYDROData_SequenceOfObjects anOrder;
anOrder.Append( theObject );
class HYDROData_InterpolatorsFactory;
class HYDROData_IProfilesInterpolator;
-class Handle(HYDROData_StricklerTable);
-class Handle(HYDROData_LandCoverMap);
+class HYDROData_StricklerTable;
+class HYDROData_LandCoverMap;
class QFile;
class gp_Pnt2d;
DocError_UnknownProblem ///< problem has unknown nature
};
-DEFINE_STANDARD_HANDLE(HYDROData_Document, MMgt_TShared)
-
/**\class HYDROData_Document
*
* \brief Document for internal data structure of any object storage. Corresponds to the SALOME study.
class HYDROData_Document : public MMgt_TShared
{
public:
-
- DEFINE_STANDARD_RTTI(HYDROData_Document);
+ DEFINE_STANDARD_RTTIEXT(HYDROData_Document, MMgt_TShared);
//! Returns the existing document or creates new if it is not exist
HYDRODATA_EXPORT static Handle(HYDROData_Document) Document(const int theStudyID);
//! Show object at the top of other model objects. If the object
//! already has the z-level parameter then nothing will be done.
- HYDRODATA_EXPORT void Show( const Handle_HYDROData_Entity& theObject );
+ HYDRODATA_EXPORT void Show( const Handle(HYDROData_Entity)& theObject );
//! Show sequence of objects at the top of other model objects.
//! The objects from the sequence will be sorted alphabetically at first.
#include <QString>
#include <QColor>
-IMPLEMENT_STANDARD_HANDLE(HYDROData_DummyObject3D,HYDROData_Entity)
IMPLEMENT_STANDARD_RTTIEXT(HYDROData_DummyObject3D,HYDROData_Entity)
HYDROData_DummyObject3D::HYDROData_DummyObject3D()
#include <HYDROData_Entity.h>
-DEFINE_STANDARD_HANDLE(HYDROData_DummyObject3D, HYDROData_Entity)
-
-class Handle(HYDROData_Object);
+class HYDROData_Object;
class TopoDS_Shape;
/**\class HYDROData_DummyObject3D
};
public:
- DEFINE_STANDARD_RTTI(HYDROData_DummyObject3D);
+ DEFINE_STANDARD_RTTIEXT(HYDROData_DummyObject3D, HYDROData_Entity);
public:
#include "HYDRO_trace.hxx"
HYDROData_SequenceOfObjects::HYDROData_SequenceOfObjects()
- : NCollection_Sequence<Handle_HYDROData_Entity>()
+ : NCollection_Sequence<Handle(HYDROData_Entity)>()
{
}
HYDROData_SequenceOfObjects::HYDROData_SequenceOfObjects( const HYDROData_SequenceOfObjects& theSequence )
- : NCollection_Sequence<Handle_HYDROData_Entity>( theSequence )
+ : NCollection_Sequence<Handle(HYDROData_Entity)>( theSequence )
{
}
-HYDROData_SequenceOfObjects::HYDROData_SequenceOfObjects( const NCollection_Sequence<Handle_HYDROData_Entity>& theSequence )
- : NCollection_Sequence<Handle_HYDROData_Entity>( theSequence )
+HYDROData_SequenceOfObjects::HYDROData_SequenceOfObjects( const NCollection_Sequence<Handle(HYDROData_Entity)>& theSequence )
+ : NCollection_Sequence<Handle(HYDROData_Entity)>( theSequence )
{
}
-IMPLEMENT_STANDARD_HANDLE(HYDROData_Entity,MMgt_TShared)
IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Entity,MMgt_TShared)
// is equal function for unique object mapping
-bool IsEqual(const Handle_HYDROData_Entity& theObj1, const Handle_HYDROData_Entity& theObj2)
+bool IsEqual(const Handle(HYDROData_Entity)& theObj1, const Handle(HYDROData_Entity)& theObj2)
{
if ( !theObj1.IsNull() && !theObj2.IsNull() )
return theObj1->Label() == theObj2->Label();
return HYDROData_SequenceOfObjects();
}
-Standard_Boolean HYDROData_Entity::GetZLevel( Standard_Integer& theLevel ) const
+bool HYDROData_Entity::GetZLevel( Standard_Integer& theLevel ) const
{
theLevel = -1;
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 )
void HYDROData_Entity::SetLabel( const TDF_Label& theLabel )
{
- myLab = theLabel;
+ myLab = theLabel;
}
void HYDROData_Entity::SaveByteArray( const int theTag,
return aRefs.IsNull() ? 0 : aRefs->Extent();
}
-bool HYDROData_Entity::HasReference( const Handle_HYDROData_Entity& theObj,
+bool HYDROData_Entity::HasReference( const Handle(HYDROData_Entity)& theObj,
const int theTag ) const
{
if ( theObj.IsNull() )
return false;
}
-void HYDROData_Entity::AddReferenceObject( const Handle_HYDROData_Entity& theObj,
+void HYDROData_Entity::AddReferenceObject( const Handle(HYDROData_Entity)& theObj,
const int theTag )
{
if ( theObj.IsNull() )
aRefs->Append( theObj->Label() );
}
-void HYDROData_Entity::SetReferenceObject( const Handle_HYDROData_Entity& theObj,
+void HYDROData_Entity::SetReferenceObject( const Handle(HYDROData_Entity)& theObj,
const int theTag,
const int theIndex )
{
}
}
-void HYDROData_Entity::InsertReferenceObject( const Handle_HYDROData_Entity& theObj,
+void HYDROData_Entity::InsertReferenceObject( const Handle(HYDROData_Entity)& theObj,
const int theTag,
const int theBeforeIndex )
{
return anAttr->Get();
}
+
+bool HYDROData_Entity::CompareLabels(const Handle(HYDROData_Entity)& theOtherObj)
+{
+ if ( !theOtherObj.IsNull() )
+ return this->Label() == theOtherObj->Label();
+ return false;
+}
+
#include <TDF_Label.hxx>
#include <QMap>
#include <QString>
+#include <Standard_Type.hxx>
class QColor;
class QVariant;
class QStringList;
-class Handle(TDataStd_ReferenceList);
-class Handle_HYDROData_Entity;
+class TDataStd_ReferenceList;
+class HYDROData_Entity;
class TopoDS_Shape;
///! Kind of an object in a document
const ObjectKind KIND_DTM = 30;
const ObjectKind KIND_LAST = KIND_LAND_COVER_MAP;
-DEFINE_STANDARD_HANDLE(HYDROData_Entity, MMgt_TShared)
-
class MapOfTreatedObjects : public QMap<QString,Handle(Standard_Transient)>
{
};
-class HYDRODATA_EXPORT HYDROData_SequenceOfObjects : public NCollection_Sequence<Handle_HYDROData_Entity>
+class HYDRODATA_EXPORT HYDROData_SequenceOfObjects : public NCollection_Sequence<Handle(HYDROData_Entity)>
{
public:
HYDROData_SequenceOfObjects();
HYDROData_SequenceOfObjects( const HYDROData_SequenceOfObjects& );
- HYDROData_SequenceOfObjects( const NCollection_Sequence<Handle_HYDROData_Entity>& );
+ HYDROData_SequenceOfObjects( const NCollection_Sequence<Handle(HYDROData_Entity)>& );
};
///! Is Equal for HYDROData_Entity mapping
-HYDRODATA_EXPORT bool IsEqual(const Handle_HYDROData_Entity& theObj1, const Handle_HYDROData_Entity& theObj2);
+HYDRODATA_EXPORT bool IsEqual(const Handle(HYDROData_Entity)& theObj1, const Handle(HYDROData_Entity)& theObj2);
/**\class HYDROData_Entity
* \brief Generic class of any object in the data model.
};
public:
- DEFINE_STANDARD_RTTI(HYDROData_Entity);
+ DEFINE_STANDARD_RTTIEXT(HYDROData_Entity, MMgt_TShared);
/**
* Returns the kind of this object. Must be redefined in all objects of known type.
/**
* 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.
* \param theObj pointer to reference object
* \param theTag tag of a label to store attribute (for 0 this is myLab)
*/
- bool HasReference( const Handle_HYDROData_Entity& theObj,
+ bool HasReference( const Handle(HYDROData_Entity)& theObj,
const int theTag = 0 ) const;
/**
* \param theObj pointer to reference object
* \param theTag tag of a label to store attribute (for 0 this is myLab)
*/
- void AddReferenceObject( const Handle_HYDROData_Entity& theObj,
+ void AddReferenceObject( const Handle(HYDROData_Entity)& theObj,
const int theTag = 0 );
/**
- if less than zero then prepend to the list
- indexing starts from 0
*/
- void SetReferenceObject( const Handle_HYDROData_Entity& theObj,
+ void SetReferenceObject( const Handle(HYDROData_Entity)& theObj,
const int theTag = 0,
const int theIndex = 0 );
- if less than zero then prepend to the list
- indexing starts from 0
*/
- void InsertReferenceObject( const Handle_HYDROData_Entity& theObj,
+ void InsertReferenceObject( const Handle(HYDROData_Entity)& theObj,
const int theTag = 0,
const int theBeforeIndex = 0 );
* - indexing starts from 0
* \returns pointer to reference object or NULL if label is not set
*/
- Handle_HYDROData_Entity GetReferenceObject( const int theTag = 0,
+ Handle(HYDROData_Entity) GetReferenceObject( const int theTag = 0,
const int theIndex = 0 ) const;
HYDROData_SequenceOfObjects GetReferenceObjects( const int theTag = 0 ) const;
* \param theTag tag of a label that keeps the attribute (for 0 this is myLab)
*/
void ClearReferenceObjects( const int theTag = 0 );
+
+public:
+
+ virtual bool CompareLabels(const Handle(HYDROData_Entity)& theOtherObj);
protected:
#define INVALID_ALTITUDE_VALUE -9999.0
-IMPLEMENT_STANDARD_HANDLE(HYDROData_IAltitudeObject, HYDROData_Entity)
IMPLEMENT_STANDARD_RTTIEXT(HYDROData_IAltitudeObject, HYDROData_Entity)
HYDROData_IAltitudeObject::HYDROData_IAltitudeObject()
class gp_XY;
-DEFINE_STANDARD_HANDLE(HYDROData_IAltitudeObject, HYDROData_Entity)
-
/**\class HYDROData_IAltitudeObject
* \briefThe base class for all altitude objects in the HYDRO module.
};
public:
-
- DEFINE_STANDARD_RTTI(HYDROData_IAltitudeObject);
+ DEFINE_STANDARD_RTTIEXT(HYDROData_IAltitudeObject, HYDROData_Entity);
/**
* Returns the kind of this object. Must be redefined in all objects of known type.
*/
HYDRODATA_EXPORT virtual const ObjectKind GetKind() const = 0;
-public:
+public:
// Public methods to work with altitudes.
/**
#include <TopoDS_Shape.hxx>
#include <QColor>
-IMPLEMENT_STANDARD_HANDLE(HYDROData_IPolyline, HYDROData_Entity)
IMPLEMENT_STANDARD_RTTIEXT(HYDROData_IPolyline, HYDROData_Entity)
HYDROData_IPolyline::HYDROData_IPolyline()
#include "HYDROData_Entity.h"
-
-DEFINE_STANDARD_HANDLE(HYDROData_IPolyline, HYDROData_Entity)
-
class gp_XY;
class TopoDS_Shape;
-class Handle(TDataStd_RealList);
-class Handle(TDataStd_ExtStringList);
-class Handle(TDataStd_BooleanList);
-class Handle(TDataStd_IntegerList);
+class TDataStd_RealList;
+class TDataStd_ExtStringList;
+class TDataStd_BooleanList;
+class TDataStd_IntegerList;
/**\class HYDROData_IPolyline
class HYDROData_IPolyline : public HYDROData_Entity
{
public:
-
enum SectionType{ SECTION_POLYLINE = 0, SECTION_SPLINE = 1 };
typedef gp_XY Point;
};
public:
- DEFINE_STANDARD_RTTI(HYDROData_IPolyline);
+ DEFINE_STANDARD_RTTIEXT(HYDROData_IPolyline, HYDROData_Entity);
public:
static const Standard_GUID GUID_HAS_LOCAL_POINTS("FD8841AA-FC44-42fa-B6A7-0F682CCC6F27");
static const Standard_GUID GUID_HAS_GLOBAL_POINTS("330D0E81-742D-4ea3-92D4-484877CFA7C1");
-IMPLEMENT_STANDARD_HANDLE(HYDROData_Image, HYDROData_Entity)
IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Image, HYDROData_Entity)
HYDROData_Image::HYDROData_Image()
#pragma warning ( default: 4251 )
#endif
-DEFINE_STANDARD_HANDLE(HYDROData_Image, HYDROData_Entity)
-
/**\class HYDROData_Image
* \brief Class that stores/retreives information about the image.
*
};
public:
- DEFINE_STANDARD_RTTI(HYDROData_Image);
+ DEFINE_STANDARD_RTTIEXT(HYDROData_Image, HYDROData_Entity);
/**
* Returns the kind of this object. Must be redefined in all objects of known type.
//#define HYDRODATA_IMZONE_DEB 1
-IMPLEMENT_STANDARD_HANDLE(HYDROData_ImmersibleZone,HYDROData_NaturalObject)
IMPLEMENT_STANDARD_RTTIEXT(HYDROData_ImmersibleZone,HYDROData_NaturalObject)
#include <HYDROData_NaturalObject.h>
-DEFINE_STANDARD_HANDLE(HYDROData_ImmersibleZone, HYDROData_NaturalObject)
-
-class Handle(HYDROData_PolylineXY);
+class HYDROData_PolylineXY;
/**\class HYDROData_ImmersibleZone
* \brief
};
public:
- DEFINE_STANDARD_RTTI(HYDROData_ImmersibleZone);
+ DEFINE_STANDARD_RTTIEXT(HYDROData_ImmersibleZone, HYDROData_NaturalObject);
/**
* Returns the kind of this object. Must be redefined in all objects of known type.
#include <NCollection_IndexedDataMap.hxx>
#include <TopoDS_Face.hxx>
#include <NCollection_Map.hxx>
+#include <Geom_Plane.hxx>
class BRepTopAdaptor_FClass2d;
class HYDROData_LandCoverMap;
-class Handle(Geom_Plane);
typedef NCollection_UBTree <Standard_Integer, Bnd_Box2d> HYDROData_FaceClassifier_BndBoxTree;
#include <QColor>
#include <QStringList>
-IMPLEMENT_STANDARD_HANDLE( HYDROData_LandCover, HYDROData_Entity )
IMPLEMENT_STANDARD_RTTIEXT( HYDROData_LandCover, HYDROData_Entity )
HYDROData_LandCover::HYDROData_LandCover()
#include <BRepCheck_Shell.hxx>
#include <BRepCheck_ListOfStatus.hxx>
#include <TopTools_SequenceOfShape.hxx>
-#include <Handle_Geom_Curve.hxx>
-#include <Handle_Geom_Line.hxx>
-#include <Handle_Geom_TrimmedCurve.hxx>
+#include <Geom_Curve.hxx>
+#include <Geom_Line.hxx>
+#include <Geom_TrimmedCurve.hxx>
#include <Geom_TrimmedCurve.hxx>
#include <TopTools_DataMapOfShapeListOfShape.hxx>
#include <NCollection_DoubleMap.hxx>
const int TELEMAC_PRECISION = 3;
-IMPLEMENT_STANDARD_HANDLE(HYDROData_LandCoverMap, HYDROData_Entity)
IMPLEMENT_STANDARD_RTTIEXT(HYDROData_LandCoverMap, HYDROData_Entity)
/**
//
if (!anEdgesToRemove.IsEmpty())
{
- Handle_ShapeBuild_ReShape aReshape = new ShapeBuild_ReShape();
+ Handle(ShapeBuild_ReShape) aReshape = new ShapeBuild_ReShape();
TopoDS_Shape OutF = aReshape->Apply(CurFace);
TopTools_ListIteratorOfListOfShape aIt(anEdgesToRemove);
for (; aIt.More(); aIt.Next())
}
}
//
- Handle_ShapeBuild_ReShape anExtReshape = new ShapeBuild_ReShape();
+ Handle(ShapeBuild_ReShape) anExtReshape = new ShapeBuild_ReShape();
for (int i = 1; i <= aF2FReplace->Extent(); i++)
{
TopoDS_Face aFK = aF2FReplace->FindKey(i);
double HYDROData_LandCoverMap::GetTransparency() const
{
- return GetDouble( DataTag_Transparency, 0.5 );
+ return GetDouble( DataTag_Transparency, 0.25 );
}
bool HYDROData_LandCoverMap::ImportSHP( const QString& theSHPFileName,
{
TopoDS_Edge E = TopoDS::Edge(anEdgeEx.Current());
double aFP, aLP;
- Handle_Geom_Curve aCur = BRep_Tool::Curve(E, aFP, aLP);
+ Handle(Geom_Curve) aCur = BRep_Tool::Curve(E, aFP, aLP);
Handle(Geom_Line) aLine = Handle(Geom_Line)::DownCast(aCur);
if (aLine.IsNull())
{
#include <vector>
#include <set>
-class Handle_HYDROData_StricklerTable;
+class HYDROData_StricklerTable;
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
typedef NCollection_IndexedDataMap<TopoDS_Face, QString> HYDROData_MapOfFaceToStricklerType;
-DEFINE_STANDARD_HANDLE( HYDROData_LandCoverMap, HYDROData_Entity )
-
class TopoDS_Shape;
class TopoDS_Wire;
class TopoDS_Iterator;
-class TopTools_ListOfShape;
-class Handle( HYDROData_PolylineXY );
-class Handle( HYDROData_Object );
+class HYDROData_PolylineXY;
+class HYDROData_Object;
class gp_XY;
class HYDROData_LandCoverMap : public HYDROData_Entity
HYDRODATA_EXPORT bool ExportTelemac( const QString& theFileName,
double theDeflection,
- const Handle_HYDROData_StricklerTable& theTable,
+ const Handle(HYDROData_StricklerTable)& theTable,
QString& statMessage) const;
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& );
double theTolerance = 1E-5 );
public:
- DEFINE_STANDARD_RTTI( HYDROData_LandCoverMap );
+ DEFINE_STANDARD_RTTIEXT( HYDROData_LandCoverMap, HYDROData_Entity );
private:
friend class Explorer;
#include "HYDROData_NaturalObject.h"
-IMPLEMENT_STANDARD_HANDLE(HYDROData_NaturalObject,HYDROData_Object)
IMPLEMENT_STANDARD_RTTIEXT(HYDROData_NaturalObject,HYDROData_Object)
HYDROData_NaturalObject::HYDROData_NaturalObject( Geometry theGeometry )
#include <HYDROData_Object.h>
-DEFINE_STANDARD_HANDLE(HYDROData_NaturalObject, HYDROData_Object)
-
-
/**\class HYDROData_NaturalObject
* \brief The natural objects are objects of environment not created by human.
*
};
public:
- DEFINE_STANDARD_RTTI(HYDROData_NaturalObject);
+ DEFINE_STANDARD_RTTIEXT(HYDROData_NaturalObject, HYDROData_Object);
protected:
#define _DEVDEBUG_
#include "HYDRO_trace.hxx"
-IMPLEMENT_STANDARD_HANDLE(HYDROData_Object,HYDROData_Entity)
IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Object,HYDROData_Entity)
HYDROData_Object::HYDROData_Object( Geometry theGeometry )
{
Handle(HYDROData_ShapesGroup) aGroup =
Handle(HYDROData_ShapesGroup)::DownCast( aGroups.Value( i ) );
- if ( IsEqual( theGroup, aGroup ) )
+ if ( theGroup->CompareLabels ( aGroup ) )
{
aRes = i - 1;
break;
#include <HYDROData_Entity.h>
-DEFINE_STANDARD_HANDLE(HYDROData_Object, HYDROData_Entity)
-
class TopoDS_Shape;
-class Handle(HYDROData_IAltitudeObject);
-class Handle(HYDROData_DummyObject3D);
-class Handle(HYDROData_ShapesGroup);
+class HYDROData_IAltitudeObject;
+class HYDROData_DummyObject3D;
+class HYDROData_ShapesGroup;
/**\class HYDROData_Object
* \brief The base class for all geometrical objects in the HYDRO module.
};
public:
- DEFINE_STANDARD_RTTI(HYDROData_Object);
+ DEFINE_STANDARD_RTTIEXT(HYDROData_Object, HYDROData_Entity);
/**
* Updates the name of this object.
#define _DEVDEBUG_
#include "HYDRO_trace.hxx"
-IMPLEMENT_STANDARD_HANDLE(HYDROData_Obstacle,HYDROData_ArtificialObject)
IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Obstacle,HYDROData_ArtificialObject)
#include "HYDROData_ArtificialObject.h"
-DEFINE_STANDARD_HANDLE(HYDROData_Obstacle, HYDROData_ArtificialObject)
-
/**\class HYDROData_Obstacle
* \brief
*
};
public:
- DEFINE_STANDARD_RTTI(HYDROData_Obstacle);
+ DEFINE_STANDARD_RTTIEXT(HYDROData_Obstacle, HYDROData_ArtificialObject);
/**
* Returns the kind of this object. Must be redefined in all objects of known type.
#include <TopoDS_Shape.hxx>
#include <BRepTools.hxx>
-IMPLEMENT_STANDARD_HANDLE(HYDROData_ObstacleAltitude, HYDROData_IAltitudeObject)
IMPLEMENT_STANDARD_RTTIEXT(HYDROData_ObstacleAltitude, HYDROData_IAltitudeObject)
HYDROData_ObstacleAltitude::HYDROData_ObstacleAltitude()
#include "HYDROData_IAltitudeObject.h"
-DEFINE_STANDARD_HANDLE(HYDROData_ObstacleAltitude, HYDROData_IAltitudeObject)
-
/**\class HYDROData_ObstacleAltitude
* \brief Class that stores/retreives information about the obstacle altitude.
public:
- DEFINE_STANDARD_RTTI(HYDROData_ObstacleAltitude);
+ DEFINE_STANDARD_RTTIEXT(HYDROData_ObstacleAltitude, HYDROData_IAltitudeObject);
/**
* Returns the kind of this object.
#include <QMap>
class ImageComposer_Operator;
-class Handle_HYDROData_Document;
+class HYDROData_Document;
/**\class HYDROData_OperationsFactory
*
* \returns created object related to the data structure
*/
HYDRODATA_EXPORT Handle(HYDROData_Image) CreateImage(
- Handle_HYDROData_Document theDoc, const ImageComposer_Operator* theOperator);
+ Handle(HYDROData_Document) theDoc, const ImageComposer_Operator* theOperator);
/**
* Returns the operator, initialized by the properties of theImage
#include <QColor>
#include <QStringList>
-IMPLEMENT_STANDARD_HANDLE(HYDROData_Polyline3D,HYDROData_Object)
IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Polyline3D,HYDROData_Object)
#include "HYDROData_Object.h"
-DEFINE_STANDARD_HANDLE(HYDROData_Polyline3D, HYDROData_Object)
-
-class Handle(HYDROData_PolylineXY);
-class Handle(HYDROData_ProfileUZ);
+class HYDROData_PolylineXY;
+class HYDROData_ProfileUZ;
class gp_XYZ;
/**\class HYDROData_Polyline3D
};
public:
- DEFINE_STANDARD_RTTI(HYDROData_Polyline3D);
+ DEFINE_STANDARD_RTTIEXT(HYDROData_Polyline3D, HYDROData_Object);
/**
* Returns the kind of this object. Must be redefined in all objects of known type.
#include <gp_Pnt2d.hxx>
#include <vector>
-class Handle( HYDROData_Document );
+class HYDROData_Document;
class HYDROData_TopoCurve;
-class Handle(HYDROData_Object);
+class HYDROData_Object;
class HYDRODATA_EXPORT HYDROData_PolylineOperator
{
return getUniqueSectionName( aNamesSeq );
}
-IMPLEMENT_STANDARD_HANDLE(HYDROData_PolylineXY, HYDROData_IPolyline)
IMPLEMENT_STANDARD_RTTIEXT(HYDROData_PolylineXY, HYDROData_IPolyline)
HYDROData_PolylineXY::HYDROData_PolylineXY()
#include "HYDROData_IPolyline.h"
#include <TopTools_HSequenceOfShape.hxx>
-DEFINE_STANDARD_HANDLE(HYDROData_PolylineXY, HYDROData_IPolyline)
-
class QPainterPath;
class QTransform;
class TopoDS_Wire;
};
public:
- DEFINE_STANDARD_RTTI(HYDROData_PolylineXY);
+ DEFINE_STANDARD_RTTIEXT(HYDROData_PolylineXY, HYDROData_IPolyline);
/**
Standard_Integer aTag );
~HYDROData_PriorityQueue();
- Handle_HYDROData_Entity GetMostPriorityObject( const QStringList& theZoneObjects,
+ Handle(HYDROData_Entity) GetMostPriorityObject( const QStringList& theZoneObjects,
HYDROData_Zone::MergeType& theMergeType ) const;
bool IsMorePriority( const Handle(HYDROData_Entity)& theObj1,
#include <QColor>
#include <QStringList>
-IMPLEMENT_STANDARD_HANDLE(HYDROData_Profile, HYDROData_Object)
IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Profile, HYDROData_Object)
HYDROData_Profile::HYDROData_Profile()
#include "HYDROData_Object.h"
#include "HYDROData_ProfileUZ.h"
-DEFINE_STANDARD_HANDLE(HYDROData_Profile, HYDROData_Object)
-
class gp_XYZ;
class OSD_File;
-class Handle(HYDROData_Document);
+class HYDROData_Document;
/**\class HYDROData_Profile
* \brief Class that stores/retreives information about the profile.
};
public:
- DEFINE_STANDARD_RTTI(HYDROData_Profile);
+ DEFINE_STANDARD_RTTIEXT(HYDROData_Profile, HYDROData_Object);
/**
* Returns the kind of this object. Must be redefined in all objects of known type.
#include <HYDROData_PolylineXY.h>
-IMPLEMENT_STANDARD_HANDLE(HYDROData_ProfileUZ, HYDROData_IPolyline)
IMPLEMENT_STANDARD_RTTIEXT(HYDROData_ProfileUZ, HYDROData_IPolyline)
HYDROData_ProfileUZ::HYDROData_ProfileUZ()
return aResList;
}
-void HYDROData_ProfileUZ::CalculateAndAddPoints(const NCollection_Sequence<gp_XYZ>& theXYZPoints, Handle_HYDROData_PolylineXY& thePolylineXY)
+void HYDROData_ProfileUZ::CalculateAndAddPoints(const NCollection_Sequence<gp_XYZ>& theXYZPoints, Handle(HYDROData_PolylineXY)& thePolylineXY)
{
// Fill 2D polyline
for ( int i = 1; i <= theXYZPoints.Size(); i++ ) {
#include "HYDROData_IPolyline.h"
-DEFINE_STANDARD_HANDLE(HYDROData_ProfileUZ, HYDROData_IPolyline)
-
class gp_XYZ;
-class Handle_HYDROData_PolylineXY;
+class HYDROData_PolylineXY;
/**\class HYDROData_ProfileUZ
* \brief Class that stores/retreives information about the
};
public:
- DEFINE_STANDARD_RTTI(HYDROData_ProfileUZ);
+ DEFINE_STANDARD_RTTIEXT(HYDROData_ProfileUZ, HYDROData_IPolyline);
/**
*/
HYDRODATA_EXPORT virtual PointsList GetPoints( const int theSectionIndex = -1, bool IsConvertToGlobal = false ) const;
- HYDRODATA_EXPORT virtual void CalculateAndAddPoints(const NCollection_Sequence<gp_XYZ>& theXYZPoints, Handle_HYDROData_PolylineXY& thePolylineXY);
+ HYDRODATA_EXPORT virtual void CalculateAndAddPoints(const NCollection_Sequence<gp_XYZ>& theXYZPoints,
+ Handle(HYDROData_PolylineXY)& thePolylineXY);
protected:
#include <TopExp.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopTools_MapOfShape.hxx>
-#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
#include <TopTools_DataMapOfShapeReal.hxx>
HYDROData_Make3dMesh::HYDROData_Make3dMesh( const TopoDS_Shape& aShape,
#include <Standard_Real.hxx>
#include <IntCurvesFace_ShapeIntersector.hxx>
+#include <TopTools_ListOfShape.hxx>
+#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
class TopoDS_Shape;
class TopoDS_Edge;
class TopoDS_Face;
class TopoDS_Wire;
class TopoDS_Vertex;
-class TopTools_ListOfShape;
-class TopTools_IndexedDataMapOfShapeListOfShape;
class gp_Pnt;
class HYDROData_Make3dMesh
#include <QStringList>
#include <QColor>
-#include "Handle_Geom_Plane.hxx"
#include "Geom_Plane.hxx"
#include "gp_Pln.hxx"
#include "BRepTools_ReShape.hxx"
//#define DEB_GET_REGION_SHAPE
-IMPLEMENT_STANDARD_HANDLE(HYDROData_Region, HYDROData_Entity)
IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Region, HYDROData_Entity)
//USD algo will skip such edges and will not perform unifying through them
//(more than 2 faces are connected to one edge + non same domain surfaces)
TopoDS_Wire DW;
- Handle_Geom_Plane DPl = new Geom_Plane(gp_Pln (gp_Pnt(0,0,0), gp_Dir(0,1,0))); //non same domain with the main surf
+ Handle(Geom_Plane) DPl = new Geom_Plane(gp_Pln (gp_Pnt(0,0,0), gp_Dir(0,1,0))); //non same domain with the main surf
BB.MakeFace(DF, DPl, Precision::Confusion());
BB.MakeWire(DW);
for (int i = 1; i <= IE.Extent(); i++)
#include "HYDROData_ShapesGroup.h"
-DEFINE_STANDARD_HANDLE(HYDROData_Region, HYDROData_Entity)
-
-class Handle(HYDROData_Zone);
-class Handle(HYDROData_Document);
+class HYDROData_Zone;
+class HYDROData_Document;
class TopoDS_Shape;
class TopoDS_Face;
class QStringList;
*/
class HYDROData_Region : public HYDROData_Entity
{
-
protected:
-
/**
* Enumeration of tags corresponding to the persistent object parameters.
*/
};
public:
- DEFINE_STANDARD_RTTI(HYDROData_Region);
+ DEFINE_STANDARD_RTTIEXT(HYDROData_Region, HYDROData_Entity);
/**
* Returns the kind of this object. Must be redefined in all objects of known type.
#include <QStringList>
-IMPLEMENT_STANDARD_HANDLE(HYDROData_River,HYDROData_NaturalObject)
IMPLEMENT_STANDARD_RTTIEXT(HYDROData_River,HYDROData_NaturalObject)
#include "HYDROData_NaturalObject.h"
-DEFINE_STANDARD_HANDLE(HYDROData_River, HYDROData_NaturalObject)
-
/**\class HYDROData_River
* \brief
*
};
public:
- DEFINE_STANDARD_RTTI(HYDROData_River);
+ DEFINE_STANDARD_RTTIEXT(HYDROData_River, HYDROData_NaturalObject);
/**
* Returns the kind of this object. Must be redefined in all objects of known type.
#include <BRep_Tool.hxx>
#include <BRepTools.hxx>
#include <Precision.hxx>
-#include <Handle_Geom_Curve.hxx>
-#include <Handle_Geom_Line.hxx>
-#include <Handle_Geom_TrimmedCurve.hxx>
+#include <Geom_Curve.hxx>
+#include <Geom_Line.hxx>
+#include <Geom_TrimmedCurve.hxx>
#include <Geom_TrimmedCurve.hxx>
#include <BRepBuilderAPI_MakeEdge.hxx>
#include <BRepBuilderAPI_MakeWire.hxx>
void HYDROData_ShapeFile::Export(Handle(HYDROData_Document) theDocument,
const QString& aFileName,
- NCollection_Sequence<Handle_HYDROData_PolylineXY> aPolyXYSeq,
- NCollection_Sequence<Handle_HYDROData_Polyline3D> aPoly3DSeq,
+ NCollection_Sequence<Handle(HYDROData_PolylineXY)> aPolyXYSeq,
+ NCollection_Sequence<Handle(HYDROData_Polyline3D)> aPoly3DSeq,
QStringList& aNonExpList)
{
SHPHandle hSHPHandle;
if (!aPolyXYSeq.IsEmpty() && aPoly3DSeq.IsEmpty())
{
- hSHPHandle = SHPCreate( aFileName.toAscii().data(), SHPT_ARC );
+ hSHPHandle = SHPCreate( aFileName.toLatin1().data(), SHPT_ARC );
for (int i = 1; i <= aPolyXYSeq.Size(); i++)
if (WriteObjectPolyXY(theDocument, hSHPHandle, aPolyXYSeq(i)) != 1)
aNonExpList.append(aPolyXYSeq(i)->GetName());
}
else if (aPolyXYSeq.IsEmpty() && !aPoly3DSeq.IsEmpty())
{
- hSHPHandle = SHPCreate( aFileName.toAscii().data(), SHPT_ARCZ );
+ hSHPHandle = SHPCreate( aFileName.toLatin1().data(), SHPT_ARCZ );
for (int i = 1; i <= aPoly3DSeq.Size(); i++)
if (WriteObjectPoly3D(theDocument, hSHPHandle, aPoly3DSeq(i)) != 1)
aNonExpList.append(aPoly3DSeq(i)->GetName());
void HYDROData_ShapeFile::Export(Handle(HYDROData_Document) theDocument,
const QString& aFileName,
- const Handle_HYDROData_LandCoverMap& aLCM,
+ const Handle(HYDROData_LandCoverMap)& aLCM,
QStringList& aNonExpList,
bool bCheckLinear, bool bUseDiscr, double theDefl)
{
SHPHandle hSHPHandle = NULL;
if ( !aLCM.IsNull() && !aLCM->IsEmpty())
{
- hSHPHandle = SHPCreate( aFileName.toAscii().data(), SHPT_POLYGON );
+ hSHPHandle = SHPCreate( aFileName.toLatin1().data(), SHPT_POLYGON );
HYDROData_LandCoverMap::Explorer It( aLCM );
for( ; It.More(); It.Next())
{
int HYDROData_ShapeFile::WriteObjectPolyXY(Handle(HYDROData_Document) theDocument,
SHPHandle theShpHandle,
- Handle_HYDROData_PolylineXY thePoly )
+ Handle(HYDROData_PolylineXY) thePoly )
{
SHPObject *aSHPObj;
std::vector<double> x, y;
int HYDROData_ShapeFile::WriteObjectPoly3D(Handle(HYDROData_Document) theDocument,
SHPHandle theShpHandle,
- Handle_HYDROData_Polyline3D thePoly )
+ Handle(HYDROData_Polyline3D) thePoly )
{
SHPObject *aSHPObj;
std::vector<double> x, y, z;
return;
TopoDS_Edge E;
int nParts = anObj->nParts;
- Handle_Geom_Plane aPlaneSur = new Geom_Plane(gp_Pnt(0,0,0), gp_Dir(0,0,1));
+ Handle(Geom_Plane) aPlaneSur = new Geom_Plane(gp_Pnt(0,0,0), gp_Dir(0,0,1));
BRep_Builder BB;
BB.MakeFace(F);
gp_Pnt P2 = BRep_Tool::Pnt(VPoints(k + 1));
if (P1.Distance(P2) < Precision::Confusion())
continue;
- Handle_Geom_TrimmedCurve aTC = GC_MakeSegment(P1, P2).Value();
+ Handle(Geom_TrimmedCurve) aTC = GC_MakeSegment(P1, P2).Value();
TopoDS_Edge E;
if ( k != VPoints.Size() - 2)
E = BRepLib_MakeEdge(aTC, VPoints(k), VPoints(k + 1)).Edge();
int Stat = TryOpenShapeFile(theFileName);
if (Stat != 0)
return Stat;
- myHSHP = SHPOpen( theFileName.toAscii().data(), "rb" );
+ myHSHP = SHPOpen( theFileName.toLatin1().data(), "rb" );
if (!Parse(myHSHP, HYDROData_ShapeFile::ShapeType_Polygon, theShapeTypeOfFile))
return 0;
for (size_t i = 0; i < mySHPObjects.size(); i++)
void HYDROData_ShapeFile::ReadSHPPolyXY(Handle(HYDROData_Document) theDocument, SHPObject* anObj, QString theFileName,
- int theInd, NCollection_Sequence<Handle_HYDROData_Entity>& theEntities, bool bReadAsPolyline)
+ int theInd, NCollection_Sequence<Handle(HYDROData_Entity)>& theEntities, bool bReadAsPolyline)
{
Handle(HYDROData_PolylineXY) aPolylineXY = Handle(HYDROData_PolylineXY)::DownCast( theDocument->CreateObject( KIND_POLYLINEXY ) );
anObj->padfY[StartIndex] == anObj->padfY[EndIndex - 1] )
{
IsClosed = true;
- aPolylineXY->AddSection( TCollection_AsciiString( ("poly_section_" + QString::number(i)).data()->toAscii()), aSectType, true);
+ aPolylineXY->AddSection( TCollection_AsciiString( ("poly_section_" + QString::number(i)).data()->toLatin1()), aSectType, true);
}
else
- aPolylineXY->AddSection( TCollection_AsciiString( ("poly_section_" + QString::number(i)).data()->toAscii()), aSectType, false);
+ aPolylineXY->AddSection( TCollection_AsciiString( ("poly_section_" + QString::number(i)).data()->toLatin1()), aSectType, false);
if (IsClosed)
EndIndex--;
else
{
//polygon; contours always closed
- aPolylineXY->AddSection( TCollection_AsciiString( ("poly_section_" + QString::number(i)).data()->toAscii()), aSectType, true);
+ aPolylineXY->AddSection( TCollection_AsciiString( ("poly_section_" + QString::number(i)).data()->toLatin1()), aSectType, true);
EndIndex--;
}
for ( int k = StartIndex; k < EndIndex ; k++ )
}
void HYDROData_ShapeFile::ReadSHPPoly3D(Handle(HYDROData_Document) theDocument, SHPObject* anObj, QString theFileName,
- int theInd, NCollection_Sequence<Handle_HYDROData_Entity>& theEntities)
+ int theInd, NCollection_Sequence<Handle(HYDROData_Entity)>& theEntities)
{
Handle(HYDROData_PolylineXY) aPolylineXY = Handle(HYDROData_PolylineXY)::DownCast( theDocument->CreateObject( KIND_POLYLINEXY ) );
anObj->padfZ[StartIndex] == anObj->padfZ[EndIndex - 1])
{
IsClosed = true;
- aPolylineXY->AddSection( TCollection_AsciiString( ("poly_section_" + QString::number(i)).data()->toAscii()), aSectType, true );
+ aPolylineXY->AddSection( TCollection_AsciiString( ("poly_section_" + QString::number(i)).data()->toLatin1()), aSectType, true );
}
else
- aPolylineXY->AddSection( TCollection_AsciiString( ("poly_section_" + QString::number(i)).data()->toAscii()), aSectType, false );
+ aPolylineXY->AddSection( TCollection_AsciiString( ("poly_section_" + QString::number(i)).data()->toLatin1()), aSectType, false );
if (IsClosed)
EndIndex--;
}
int HYDROData_ShapeFile::ImportPolylines(Handle(HYDROData_Document) theDocument, const QString& theFileName,
- NCollection_Sequence<Handle_HYDROData_Entity>& theEntities, int& theShapeTypeOfFile)
+ NCollection_Sequence<Handle(HYDROData_Entity)>& theEntities, int& theShapeTypeOfFile)
{
//Free();
int aStat = TryOpenShapeFile(theFileName);
anExistingNames.push_back(anIter.Current()->GetName());
SHPHandle aHSHP;
- aHSHP = SHPOpen( theFileName.toAscii().data(), "rb" );
+ aHSHP = SHPOpen( theFileName.toLatin1().data(), "rb" );
QFileInfo aFileInfo(theFileName);
QString aBaseFileName = aFileInfo.baseName();
return -3;
FILE* pFileSHP = NULL;
- pFileSHP = fopen (aSHPfile.toAscii().data(), "r");
+ pFileSHP = fopen (aSHPfile.toLatin1().data(), "r");
FILE* pFileSHX = NULL;
- pFileSHX = fopen (aSHXfile.toAscii().data(), "r");
+ pFileSHX = fopen (aSHXfile.toLatin1().data(), "r");
if (pFileSHP == NULL || pFileSHX == NULL)
{
QString aSHPfile = theSHPFilePath.simplified();
QString aDBFfile = theSHPFilePath.simplified().replace( theSHPFilePath.simplified().size() - 4, 4, ".dbf");
FILE* pFileDBF = NULL;
- pFileDBF = fopen (aDBFfile.toAscii().data(), "r");
+ pFileDBF = fopen (aDBFfile.toLatin1().data(), "r");
if (pFileDBF == NULL)
{
bool HYDROData_ShapeFile::DBF_OpenDBF(const QString& thePathToDBFFile)
{
- myHDBF = DBFOpen( thePathToDBFFile.toAscii().data(), "r" );
+ myHDBF = DBFOpen( thePathToDBFFile.toLatin1().data(), "r" );
if(myHDBF != NULL)
return true;
else
#ifndef HYDRODATA_SHAPEFILE_H
#define HYDRODATA_SHAPEFILE_H
-#include <vector>
+#include "HYDROData.h"
+
#include <NCollection_Sequence.hxx>
+
+#include <TopTools_SequenceOfShape.hxx>
+
#include <QStringList>
-#include "HYDROData.h"
+
+#include <vector>
+
//extern "C" {
#include <shapefil.h>
//};
class gp_XYZ;
-class Handle_HYDROData_PolylineXY;
-class Handle_HYDROData_Polyline3D;
-class Handle(HYDROData_Document);
-class TopTools_SequenceOfShape;
+class HYDROData_PolylineXY;
+class HYDROData_Polyline3D;
+class HYDROData_Document;
class TopoDS_Face;
class TopoDS_Shape;
-class Handle_HYDROData_Entity;
-class Handle_HYDROData_LandCoverMap;
+class HYDROData_Entity;
+class HYDROData_LandCoverMap;
class HYDROData_ShapeFile
{
//Export operation
HYDRODATA_EXPORT void Export(Handle(HYDROData_Document) theDocument,
const QString& aFileName,
- NCollection_Sequence<Handle_HYDROData_PolylineXY> aPolyXYSeq,
- NCollection_Sequence<Handle_HYDROData_Polyline3D> aPoly3DSeq,
+ NCollection_Sequence<Handle(HYDROData_PolylineXY)> aPolyXYSeq,
+ NCollection_Sequence<Handle(HYDROData_Polyline3D)> aPoly3DSeq,
QStringList& aNonExpList);
HYDRODATA_EXPORT void Export(Handle(HYDROData_Document) theDocument,
const QString& aFileName,
- const Handle_HYDROData_LandCoverMap& aLCM,
+ const Handle(HYDROData_LandCoverMap)& aLCM,
QStringList& aNonExpList,
bool bCheckLinear = true,
bool bUseDiscr = false,
double theDefl = 0.1);
int WriteObjectPolyXY(Handle(HYDROData_Document) theDocument, SHPHandle theShpHandle,
- Handle_HYDROData_PolylineXY thePoly );
+ Handle(HYDROData_PolylineXY) thePoly );
int WriteObjectPoly3D(Handle(HYDROData_Document) theDocument, SHPHandle theShpHandle,
- Handle_HYDROData_Polyline3D thePoly );
+ Handle(HYDROData_Polyline3D) thePoly );
int WriteObjectPolygon(Handle(HYDROData_Document) theDocument, SHPHandle theShpHandle,
const TopoDS_Shape& theInputShape, bool bUseDiscr, double theDefl );
//Import Polyline
void ReadSHPPolyXY(Handle(HYDROData_Document) theDocument, SHPObject* anObj, QString theFileName,
- int theInd, NCollection_Sequence<Handle_HYDROData_Entity>& theEntities, bool bReadAsPolyline = false);
+ int theInd, NCollection_Sequence<Handle(HYDROData_Entity)>& theEntities,
+ bool bReadAsPolylin = false);
void ReadSHPPoly3D(Handle(HYDROData_Document) theDocument, SHPObject* anObj, QString theFileName,
- int theInd, NCollection_Sequence<Handle_HYDROData_Entity>& theEntities);
+ int theInd, NCollection_Sequence<Handle(HYDROData_Entity)>& theEntities);
HYDRODATA_EXPORT int ImportPolylines(Handle(HYDROData_Document) theDocument, const QString& theFileName,
- NCollection_Sequence<Handle_HYDROData_Entity>& theEntities, int& theShapeTypeOfFile);
+ NCollection_Sequence<Handle(HYDROData_Entity)>& theEntities, int& theShapeTypeOfFile);
HYDRODATA_EXPORT QString GetShapeTypeName(int theType);
#include <ShapeUpgrade_UnifySameDomain.hxx>
#include <BRepTools_ReShape.hxx>
-IMPLEMENT_STANDARD_HANDLE(HYDROData_ShapesGroup,HYDROData_Entity)
IMPLEMENT_STANDARD_RTTIEXT(HYDROData_ShapesGroup,HYDROData_Entity)
void HYDROData_ShapesGroup::GroupDefinition::Update( SeqOfGroupsDefs* theGroupsDefs,
#define HYDROData_ShapesGroup_HeaderFile
#include <HYDROData_Entity.h>
-
#include <TopTools_SequenceOfShape.hxx>
-
+#include <TopTools_ListOfShape.hxx>
#include <QString>
class TopoDS_Shape;
-class TopTools_ListOfShape;
class BRepBuilderAPI_MakeShape;
class ShapeUpgrade_UnifySameDomain;
class BRepTools_ReShape;
-DEFINE_STANDARD_HANDLE(HYDROData_ShapesGroup, HYDROData_Entity)
-
/**\class HYDROData_ShapesGroup
* \brief Class that stores/retreives the sequence of shapes.
*/
};
public:
- DEFINE_STANDARD_RTTI(HYDROData_ShapesGroup);
+ DEFINE_STANDARD_RTTIEXT(HYDROData_ShapesGroup, HYDROData_Entity);
/**
* Returns the kind of this object. Must be redefined in all objects of known type.
#include "HYDROData.h"
#include <TopAbs_ShapeEnum.hxx>
+#include <TopTools_ListOfShape.hxx>
+#include <TopTools_SequenceOfShape.hxx>
class TopoDS_Shape;
class TopoDS_Vertex;
class TopoDS_Edge;
-class TopTools_SequenceOfShape;
-class TopTools_ListOfShape;
class HYDRODATA_EXPORT HYDROData_ShapesTool {
{
}
-void HYDROData_SinusX::CollectExistingNames(Handle_HYDROData_Document theDocument)
+void HYDROData_SinusX::CollectExistingNames(Handle(HYDROData_Document) theDocument)
{
HYDROData_Iterator anIter( theDocument );
int anInd = 0;
}
-bool HYDROData_SinusX::Import(const QString& theFilePath, Handle(HYDROData_Document) theDocument, NCollection_Sequence<Handle_HYDROData_Entity>& theEntities)
+bool HYDROData_SinusX::Import(const QString& theFilePath, Handle(HYDROData_Document) theDocument,
+ NCollection_Sequence<Handle(HYDROData_Entity)>& theEntities)
{
if ( theFilePath.isEmpty() )
{
}
-void HYDROData_SinusX::SXToHydro(Handle(HYDROData_Document) theDocument, NCollection_Sequence<Handle_HYDROData_Entity>& theEntities)
+void HYDROData_SinusX::SXToHydro(Handle(HYDROData_Document) theDocument, NCollection_Sequence<Handle(HYDROData_Entity)>& theEntities)
{
for ( size_t i = 0; i < myCurveBlocks.size(); i++ )
{
}
-bool HYDROData_SinusX::Export(const QString& theFilePath, const NCollection_Sequence<Handle_HYDROData_Entity>& theEntities)
+bool HYDROData_SinusX::Export(const QString& theFilePath, const NCollection_Sequence<Handle(HYDROData_Entity)>& theEntities)
{
if ( theFilePath.isEmpty() )
{
}
-void HYDROData_SinusX::HydroToSX(QFile& theFile, const NCollection_Sequence<Handle_HYDROData_Entity>& theEntities)
+void HYDROData_SinusX::HydroToSX(QFile& theFile, const NCollection_Sequence<Handle(HYDROData_Entity)>& theEntities)
{
QTextStream aTextStream(&theFile);
aTextStream << "C Generated by HYDRO Module\n";
for (int i = 1; i <= theEntities.Size(); i++)
{
- Handle_HYDROData_Entity anEnt = theEntities.Value(i);
+ Handle(HYDROData_Entity) anEnt = theEntities.Value(i);
if (anEnt->IsKind( STANDARD_TYPE(HYDROData_Bathymetry) ))
{
Handle(HYDROData_Bathymetry) aBathy = Handle(HYDROData_Bathymetry)::DownCast( anEnt );
class QFile;
class gp_XYZ;
-class Handle_HYDROData_Entity;
-class Handle_HYDROData_Document;
+class HYDROData_Entity;
+class HYDROData_Document;
struct HYDROGUI_CurveBlock
{
public:
HYDROData_SinusX( );
virtual ~HYDROData_SinusX();
- bool Import (const QString& theFilePath, Handle(HYDROData_Document) theDocument, NCollection_Sequence<Handle_HYDROData_Entity>& theEntities);
- bool Export(const QString& theFilePath, const NCollection_Sequence<Handle_HYDROData_Entity>& theEntities);
+ bool Import (const QString& theFilePath, Handle(HYDROData_Document) theDocument, NCollection_Sequence<Handle(HYDROData_Entity)>& theEntities);
+ bool Export(const QString& theFilePath, const NCollection_Sequence<Handle(HYDROData_Entity)>& theEntities);
private:
- void SXToHydro(Handle(HYDROData_Document) theDocument, NCollection_Sequence<Handle_HYDROData_Entity>& theEntities);
+ void SXToHydro(Handle(HYDROData_Document) theDocument, NCollection_Sequence<Handle(HYDROData_Entity)>& theEntities);
bool Parse( QFile& theFile );
- void CollectExistingNames(Handle_HYDROData_Document theDocument);
+ void CollectExistingNames(Handle(HYDROData_Document) theDocument);
QString GetName(const QString& theName);
- void HydroToSX( QFile& theFile, const NCollection_Sequence<Handle_HYDROData_Entity>& theEntities);
+ void HydroToSX( QFile& theFile, const NCollection_Sequence<Handle(HYDROData_Entity)>& theEntities);
private:
#include "HYDROData_SplitShapesGroup.h"
-IMPLEMENT_STANDARD_HANDLE(HYDROData_SplitShapesGroup,HYDROData_ShapesGroup)
IMPLEMENT_STANDARD_RTTIEXT(HYDROData_SplitShapesGroup,HYDROData_ShapesGroup)
HYDROData_SplitShapesGroup::HYDROData_SplitShapesGroup()
#include <HYDROData_ShapesGroup.h>
-DEFINE_STANDARD_HANDLE(HYDROData_SplitShapesGroup, HYDROData_ShapesGroup)
-
-
/**\class HYDROData_SplitShapesGroup
* \brief Class that stores/retreives the sequence of split shapes.
*/
};
public:
- DEFINE_STANDARD_RTTI(HYDROData_SplitShapesGroup);
+ DEFINE_STANDARD_RTTIEXT(HYDROData_SplitShapesGroup, HYDROData_ShapesGroup);
/**
* Returns the kind of this object. Must be redefined in all objects of known type.
#include <QStringList>
#include <NCollection_DataMap.hxx>
-class Handle(HYDROData_PolylineXY);
+class HYDROData_PolylineXY;
/**
* \class HYDROData_SplitToZonesTool
#include <TColStd_Array1OfReal.hxx>
#include <TColStd_ListOfReal.hxx>
#include <TColStd_ListIteratorOfListOfReal.hxx>
-#include <TCollection_CompareOfReal.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <TColgp_HArray1OfPnt.hxx>
#include <TopTools_SequenceOfShape.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
-#include <SortTools_QuickSortOfReal.hxx>
-
#include <QColor>
#include <QStringList>
+#include <QVector>
//#define DEB_STREAM 1
#ifdef DEB_STREAM
typedef NCollection_DataMap<Standard_Real, Handle(HYDROData_Profile)> HYDROData_DataMapOfRealOfHDProfile;
-IMPLEMENT_STANDARD_HANDLE(HYDROData_Stream,HYDROData_NaturalObject)
IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Stream,HYDROData_NaturalObject)
}
}
- Handle_HYDROData_DTM dtm = DTM();
+ Handle(HYDROData_DTM) dtm = DTM();
dtm->Update();
UpdatePrs( dtm );
return true;
}
-bool HYDROData_Stream::CreatePresentations( const Handle_HYDROData_DTM& theDTM,
+bool HYDROData_Stream::CreatePresentations( const Handle(HYDROData_DTM)& theDTM,
PrsDefinition& thePrs )
{
if ( theDTM.IsNull() )
return true;
}
-void HYDROData_Stream::UpdatePrs( const Handle_HYDROData_DTM& theDTM )
+void HYDROData_Stream::UpdatePrs( const Handle(HYDROData_DTM)& theDTM )
{
HYDROData_NaturalObject::Update();
return HYDROData_Tool::getFirstShapeFromGroup( aGroups, 4);
}
-Handle_HYDROData_DTM HYDROData_Stream::DTM() const
+Handle(HYDROData_DTM) HYDROData_Stream::DTM() const
{
const_cast<HYDROData_Stream*>( this )->checkAndSetAltitudeObject();
return Handle(HYDROData_DTM)::DownCast( GetAltitudeObject() );
if ( aList.IsEmpty() )
return;
- TColStd_Array1OfReal anArr( 1, aList.Extent() );
+ QVector<double> anArr( aList.Extent() );
TColStd_ListIteratorOfListOfReal it( aList );
for ( int j = 1; it.More(); it.Next(), j++ )
- anArr( j ) = it.Value();
+ anArr[j-1] = it.Value();
// sorting
if ( aList.Extent() > 1 )
{
- TCollection_CompareOfReal Compar;
- SortTools_QuickSortOfReal::Sort( anArr, Compar );
+ //TCollection_CompareOfReal Compar;
+ //SortTools_QuickSortOfReal::Sort( anArr, Compar );
+ std::sort( anArr.begin(), anArr.end() );
- for (int j = 1; j <= anArr.Length(); j++) {
- const Standard_Real aKey = anArr(j);
+ for (int j = 1; j <= anArr.size(); j++) {
+ const Standard_Real aKey = anArr[j-1];
const Handle(HYDROData_Profile)& aProfile = aDM.Find(aKey);
insertProfileInToOrder( aProfile );
}
return KIND_DTM;
}
-void HYDROData_Stream::setParametersArray( const TColStd_Array1OfReal& theArray )
+void HYDROData_Stream::setParametersArray( const QVector<double>& theArray )
{
- if ( theArray.Length() == 0 )
+ if ( theArray.size() == 0 )
{
removeParametersArray();
return;
TDF_Label aLabel = myLab.FindChild( DataTag_ParamsArray );
+ int n = theArray.size();
Handle(TDataStd_RealArray) aParamsArray =
- TDataStd_RealArray::Set( aLabel, theArray.Lower(), theArray.Upper() );
-
- for ( int i = theArray.Lower(), n = theArray.Upper(); i <= n; ++i )
+ TDataStd_RealArray::Set( aLabel, 1, n );
+ for ( int i = 0; i < n; ++i )
{
- const Standard_Real& aParam = theArray( i );
- aParamsArray->SetValue( i, aParam );
+ const Standard_Real& aParam = theArray[i];
+ aParamsArray->SetValue( i+1, aParam );
}
}
{
aResIndex = 0;
- TColStd_Array1OfReal aNewArr( anArr->Lower(), anArr->Upper() + 1 );
+ QVector<double> aNewArr( anArr->Upper() );
bool isInserted = false;
for ( int i = anArr->Lower(), j = i, n = anArr->Upper(); i <= n; ++i, ++j )
}
else
{
- aNewArr( j ) = theParam;
+ aNewArr[j-1] = theParam;
isInserted = true;
++j;
}
}
- aNewArr( j ) = aStoredParam;
+ aNewArr[j-1] = aStoredParam;
}
if ( !isInserted )
{
aResIndex = -1;
- aNewArr( aNewArr.Upper() ) = theParam;
+ aNewArr[aNewArr.size()-1] = theParam;
}
setParametersArray( aNewArr );
}
else
{
- TColStd_Array1OfReal aNewArr( 1, 1 );
- aNewArr.SetValue( 1, theParam );
+ QVector<double> aNewArr( 1 );
+ aNewArr[0] = theParam;
setParametersArray( aNewArr );
}
return;
}
- TColStd_Array1OfReal aNewArr( aParamsArray->Lower(), aParamsArray->Upper() - 1 );
+ QVector<double> aNewArr( aParamsArray->Upper() - 2 );
for ( int i = aParamsArray->Lower(), j = i, k = 0, n = aParamsArray->Upper(); i <= n; ++i, ++k )
{
if ( k == theIndex )
continue;
- aNewArr.SetValue( j, aStoredParam );
+ aNewArr[j-1] = aStoredParam;
++j;
}
thePrs.myOutlet = LS(3);
thePrs.myRightBank = LS(4);
-}
\ No newline at end of file
+}
#include <Geom_BSplineCurve.hxx>
#include <vector>
-DEFINE_STANDARD_HANDLE(HYDROData_Stream, HYDROData_NaturalObject)
-
-class Handle(HYDROData_PolylineXY);
-class Handle(HYDROData_Polyline3D);
-class Handle(HYDROData_Profile);
+class HYDROData_DTM;
+class HYDROData_PolylineXY;
+class HYDROData_Polyline3D;
+class HYDROData_Profile;
class HYDROData_IProfilesInterpolator;
-class TColStd_Array1OfReal;
-class Handle(TopTools_HArray1OfShape);
-class Handle_HYDROData_DTM;
-class TopTools_ListOfShape;
+class TopTools_HArray1OfShape;
/**\class HYDROData_Stream
};
public:
-
- DEFINE_STANDARD_RTTI(HYDROData_Stream);
+ DEFINE_STANDARD_RTTIEXT(HYDROData_Stream, HYDROData_NaturalObject);
public:
/**
* Creates the presentations(2D and 3D) by given hydraulic axis and profiles.
*/
- HYDRODATA_EXPORT static bool CreatePresentations( const Handle_HYDROData_DTM& theDTM,
- PrsDefinition& thePrs );
+ HYDRODATA_EXPORT static bool CreatePresentations( const Handle(HYDROData_DTM)& theDTM,
+ PrsDefinition& thePrs );
HYDRODATA_EXPORT static void CreatePresentations( const Handle(TColgp_HArray1OfPnt) theArrayOfFPnt,
const Handle(TColgp_HArray1OfPnt) theArrayOfLPnt,
/**
* Update the shape presentations of stream.
*/
- HYDRODATA_EXPORT void UpdatePrs( const Handle_HYDROData_DTM& );
+ HYDRODATA_EXPORT void UpdatePrs( const Handle(HYDROData_DTM)& );
/**
*
private:
- void setParametersArray( const TColStd_Array1OfReal& theArray );
+ void setParametersArray( const QVector<double>& theArray );
TColStd_Array1OfReal* getParametersArray() const;
void removeParameter( const int& theIndex );
- Handle_HYDROData_DTM DTM() const;
+ Handle(HYDROData_DTM) DTM() const;
protected:
#include <BRep_Builder.hxx>
#include <BRepBuilderAPI_MakeVertex.hxx>
#endif
-IMPLEMENT_STANDARD_HANDLE(HYDROData_StreamAltitude, HYDROData_IAltitudeObject)
+
IMPLEMENT_STANDARD_RTTIEXT(HYDROData_StreamAltitude, HYDROData_IAltitudeObject)
HYDROData_StreamAltitude::HYDROData_StreamAltitude()
#include "HYDROData_IAltitudeObject.h"
-DEFINE_STANDARD_HANDLE(HYDROData_StreamAltitude, HYDROData_IAltitudeObject)
-
class TopoDS_Wire;
/**\class HYDROData_StreamAltitude
public:
- DEFINE_STANDARD_RTTI(HYDROData_StreamAltitude);
+ DEFINE_STANDARD_RTTIEXT(HYDROData_StreamAltitude, HYDROData_IAltitudeObject);
/**
* Returns the kind of this object.
#include <QFile>
#include <QTextStream>
-IMPLEMENT_STANDARD_HANDLE( HYDROData_StricklerTable, HYDROData_Entity )
IMPLEMENT_STANDARD_RTTIEXT( HYDROData_StricklerTable, HYDROData_Entity )
HYDROData_StricklerTable::HYDROData_StricklerTable()
#include <TColStd_SequenceOfExtendedString.hxx>
-class Handle( TDataStd_NamedData );
-
-DEFINE_STANDARD_HANDLE( HYDROData_StricklerTable, HYDROData_Entity )
+class TDataStd_NamedData;
class HYDROData_StricklerTable : public HYDROData_Entity
{
HYDRODATA_EXPORT ~HYDROData_StricklerTable();
public:
- DEFINE_STANDARD_RTTI( HYDROData_StricklerTable );
+ DEFINE_STANDARD_RTTIEXT( HYDROData_StricklerTable, HYDROData_Entity );
HYDRODATA_EXPORT virtual const ObjectKind GetKind() const;
#include <QStringList>
#include <Precision.hxx>
-class Handle_HYDROData_Document;
-class Handle_HYDROData_Entity;
+class HYDROData_Document;
+class HYDROData_Entity;
class HYDROData_SequenceOfObjects;
class MapOfTreatedObjects;
class gp_XY;
class TopoDS_Face;
class TopoDS_Shape;
class TopoDS_Wire;
-class TopTools_SequenceOfShape;
class Quantity_Color;
class HYDRODATA_EXPORT HYDROData_Tool {
* \param theIsTryToUsePurePrefix if true - the prefix will be returned if the name equal to the prefix is not busy
* \return generated name
*/
- static QString GenerateObjectName( const Handle_HYDROData_Document& theDoc,
+ static QString GenerateObjectName( const Handle(HYDROData_Document)& theDoc,
const QString& thePrefix,
const QStringList& theUsedNames = QStringList(),
const bool theIsTryToUsePurePrefix = false );
* \param theObject object to check
* \return true if object is geometry object
*/
- static bool IsGeometryObject( const Handle_HYDROData_Entity& theObject );
+ static bool IsGeometryObject( const Handle(HYDROData_Entity)& theObject );
/**
* \brief Updates the child object name.
*/
static void UpdateChildObjectName( const QString& theOldStr,
const QString& theNewStr,
- const Handle_HYDROData_Entity& theObject );
+ const Handle(HYDROData_Entity)& theObject );
/**
#define HYDRODATA_TOPOCURVE_H
#include <deque>
-#include <Handle_Geom_BSplineCurve.hxx>
+#include <Geom_BSplineCurve.hxx>
#include <HYDROData.h>
#include <list>
#include <TopExp.hxx>
#include <TDataStd_AsciiString.hxx>
-IMPLEMENT_STANDARD_HANDLE(HYDROData_VisualState, HYDROData_Entity)
IMPLEMENT_STANDARD_RTTIEXT(HYDROData_VisualState, HYDROData_Entity)
HYDROData_VisualState::HYDROData_VisualState()
#include <HYDROData_Entity.h>
-DEFINE_STANDARD_HANDLE(HYDROData_VisualState, HYDROData_Entity)
-
/**\class HYDROData_VisualState
* \brief Class that stores/retreives information about the visual state.
*
};
public:
- DEFINE_STANDARD_RTTI(HYDROData_VisualState);
+ DEFINE_STANDARD_RTTIEXT(HYDROData_VisualState, HYDROData_Entity);
/**
* Returns the kind of this object. Must be redefined in all objects of known type.
#define _DEVDEBUG_
#include "HYDRO_trace.hxx"
-IMPLEMENT_STANDARD_HANDLE(HYDROData_Zone, HYDROData_Entity)
IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Zone, HYDROData_Entity)
Handle(HYDROData_Entity) HYDROData_Zone::GetMergeObject() const
{
- return Handle(HYDROData_Entity)::DownCast(
- GetReferenceObject( DataTag_MergeObject ) );
+ return GetReferenceObject( DataTag_MergeObject );
}
void HYDROData_Zone::RemoveMergeObject()
#include "HYDROData_Entity.h"
#include "HYDROData_IInterpolator.h"
-class Handle(HYDROData_LandCover);
+class HYDROData_LandCover;
class TopoDS_Shape;
-DEFINE_STANDARD_HANDLE(HYDROData_Zone, HYDROData_Entity)
-
/**\class HYDROData_Zone
* \brief Class that stores/retreives information about the 2d face.
{
public:
-
// Enumeration of mergin types for conflict altitudes/types
enum MergeType
{
};
public:
- DEFINE_STANDARD_RTTI(HYDROData_Zone);
+ DEFINE_STANDARD_RTTIEXT(HYDROData_Zone, HYDROData_Entity);
/**
* Returns the kind of this object. Must be redefined in all objects of known type.
include(../../CMake/Common.cmake)
include(../../CMake/UseQT4EXT.cmake)
-
+INCLUDE(UseQtExt)
+
set(PROJECT_HEADERS
HYDROGUI.h
HYDROGUI_AbstractDisplayer.h
HYDROGUI_TransparencyDlg.h
)
-QT4_WRAP_CPP(PROJECT_HEADERS_MOC ${PROJECT_HEADERS})
+QT_WRAP_MOC(PROJECT_HEADERS_MOC ${PROJECT_HEADERS})
set(PROJECT_SOURCES
HYDROGUI_AbstractDisplayer.cxx
HYDROGUI_Operations.cxx
HYDROGUI_Poly3DDlg.cxx
HYDROGUI_Poly3DOp.cxx
+ HYDROGUI_Polyline.cxx
HYDROGUI_PolylineDlg.cxx
HYDROGUI_PolylineOp.cxx
HYDROGUI_ProfileDlg.cxx
HYDROGUI_Region.cxx
HYDROGUI_RemoveImageRefsOp.cxx
HYDROGUI_Shape.cxx
- HYDROGUI_Polyline.cxx
HYDROGUI_ShapeBathymetry.cxx
HYDROGUI_ShapeImage.cxx
HYDROGUI_ShapeLandCoverMap.cxx
#include <AIS_DisplayMode.hxx>
#include <Prs3d_IsoAspect.hxx>
#include <Prs3d_LineAspect.hxx>
-#include <StdPrs_WFDeflectionShape.hxx>
+#include <StdPrs_WFShape.hxx>
-IMPLEMENT_STANDARD_HANDLE(HYDROGUI_AISShape, AIS_Shape)
IMPLEMENT_STANDARD_RTTIEXT(HYDROGUI_AISShape, AIS_Shape)
HYDROGUI_AISShape::HYDROGUI_AISShape( const TopoDS_Shape& theShape )
}
if( theMode==AIS_Shaded )
- StdPrs_WFDeflectionShape::Add( thePresentation, Shape(), myDrawer );
+ StdPrs_WFShape::Add( thePresentation, Shape(), myDrawer );
}
#include <AIS_Shape.hxx>
-DEFINE_STANDARD_HANDLE(HYDROGUI_AISShape, AIS_Shape)
-
class HYDROGUI_AISShape : public AIS_Shape
{
public:
- DEFINE_STANDARD_RTTI(HYDROGUI_AISShape);
+ DEFINE_STANDARD_RTTIEXT(HYDROGUI_AISShape, AIS_Shape);
HYDROGUI_AISShape( const TopoDS_Shape& );
virtual ~HYDROGUI_AISShape();
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)
{
}
* \brief AIS trihedron is redefined in order to show U text on the OX axis
* and Z text on the OY axis.
*/
-DEFINE_STANDARD_HANDLE(HYDROGUI_AISTrihedron, AIS_Trihedron)
class HYDROGUI_AISTrihedron : public AIS_Trihedron
{
* \param theTransformation the transformation
* \param thePresentationManager the presentation
*/
- void Compute( const Handle_Prs3d_Projector& theProjector,
- const Handle_Geom_Transformation& theTransformation,
- const Handle_Prs3d_Presentation& thePresentation );
+ void Compute( const Handle(Prs3d_Projector)& theProjector,
+ const Handle(Geom_Transformation)& theTransformation,
+ const Handle(Prs3d_Presentation)& thePresentation );
/**
* AIS trihedron compute selection method. It is empty. We do not select the trihedron
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 ) {
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);
HYDROData_SequenceOfObjects::Iterator anIter( aSeq );
for ( ; anIter.More(); anIter.Next() )
{
- const Handle_HYDROData_Entity& ent = anIter.Value();
+ const Handle(HYDROData_Entity)& ent = anIter.Value();
if (!ent.IsNull())
setObjectVisibility( ent, true );
}
HYDROData_SequenceOfObjects anObjs = myEditedObject->GetGeometryObjects();
for( int anIndex = 1, aLength = anObjs.Length(); anIndex <= aLength; anIndex++ )
{
- Handle_HYDROData_Object anObj = Handle_HYDROData_Object::DownCast( anObjs.Value( anIndex ) );
+ Handle(HYDROData_Object) anObj = Handle(HYDROData_Object)::DownCast( anObjs.Value( anIndex ) );
HYDROData_SequenceOfObjects aGroups = anObj->GetGroups();
for( int aGIndex = 1, aGLength = aGroups.Length(); aGIndex <= aGLength; aGIndex++ )
{
- Handle_HYDROData_ShapesGroup aGroup = Handle_HYDROData_ShapesGroup::DownCast( aGroups.Value( aGIndex ) );
+ Handle(HYDROData_ShapesGroup) aGroup = Handle(HYDROData_ShapesGroup)::DownCast( aGroups.Value( aGIndex ) );
aGroupsNames.append( aGroup->GetName() );
}
}
// 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 );
// Create root objects:
// IMAGES
- LightApp_DataObject* anImageRootObj = createObject( aNewRootObj, tr( partitionName( KIND_IMAGE ).toAscii() ) );
+ LightApp_DataObject* anImageRootObj = createObject( aNewRootObj, tr( partitionName( KIND_IMAGE ).toLatin1() ) );
// BATHYMETRY
- LightApp_DataObject* aBathymetryRootObj = createObject( aNewRootObj, tr( partitionName( KIND_BATHYMETRY ).toAscii() ) );
+ LightApp_DataObject* aBathymetryRootObj = createObject( aNewRootObj, tr( partitionName( KIND_BATHYMETRY ).toLatin1() ) );
// POLYLINES
- LightApp_DataObject* aPolylineRootObj = createObject( aNewRootObj, tr( partitionName( KIND_POLYLINEXY ).toAscii() ) );
+ LightApp_DataObject* aPolylineRootObj = createObject( aNewRootObj, tr( partitionName( KIND_POLYLINEXY ).toLatin1() ) );
// PROFILES
- LightApp_DataObject* aProfileRootObj = createObject( aNewRootObj, tr( partitionName( KIND_PROFILE ).toAscii() ) );
+ LightApp_DataObject* aProfileRootObj = createObject( aNewRootObj, tr( partitionName( KIND_PROFILE ).toLatin1() ) );
// POLYLINES 3D
- LightApp_DataObject* aPolyline3DRootObj = createObject( aNewRootObj, tr( partitionName( KIND_POLYLINE ).toAscii() ) );
+ LightApp_DataObject* aPolyline3DRootObj = createObject( aNewRootObj, tr( partitionName( KIND_POLYLINE ).toLatin1() ) );
// NATURAL OBJECTS
- LightApp_DataObject* aNaturalObjectsRootObj = createObject( aNewRootObj, tr( partitionName( KIND_NATURAL_OBJECT ).toAscii() ) );
+ LightApp_DataObject* aNaturalObjectsRootObj = createObject( aNewRootObj, tr( partitionName( KIND_NATURAL_OBJECT ).toLatin1() ) );
// ARTIFICIAL OBJECTS
- LightApp_DataObject* anArtificialObjectsRootObj = createObject( aNewRootObj, tr( partitionName( KIND_ARTIFICIAL_OBJECT ).toAscii() ) );
+ LightApp_DataObject* anArtificialObjectsRootObj = createObject( aNewRootObj, tr( partitionName( KIND_ARTIFICIAL_OBJECT ).toLatin1() ) );
// OBSTACLES
- LightApp_DataObject* anObstaclesRootObj = createObject( aNewRootObj, tr( partitionName( KIND_OBSTACLE ).toAscii() ) );
+ LightApp_DataObject* anObstaclesRootObj = createObject( aNewRootObj, tr( partitionName( KIND_OBSTACLE ).toLatin1() ) );
// STRICKLER TABLES
- LightApp_DataObject* aStricklerTablesRootObj = createObject( aNewRootObj, tr( partitionName( KIND_STRICKLER_TABLE ).toAscii() ) );
+ LightApp_DataObject* aStricklerTablesRootObj = createObject( aNewRootObj, tr( partitionName( KIND_STRICKLER_TABLE ).toLatin1() ) );
// LAND COVER MAPS
- LightApp_DataObject* aLandCoversRootObj = createObject( aNewRootObj, tr( partitionName( KIND_LAND_COVER_MAP ).toAscii() ) );
+ LightApp_DataObject* aLandCoversRootObj = createObject( aNewRootObj, tr( partitionName( KIND_LAND_COVER_MAP ).toLatin1() ) );
// CALCULATION CASES
- LightApp_DataObject* aCalculRootObj = createObject( aNewRootObj, tr( partitionName( KIND_CALCULATION ).toAscii() ) );
+ LightApp_DataObject* aCalculRootObj = createObject( aNewRootObj, tr( partitionName( KIND_CALCULATION ).toLatin1() ) );
// VISUAL STATES
- LightApp_DataObject* aVisualStateRootObj = createObject( aNewRootObj, tr( partitionName( KIND_VISUAL_STATE ).toAscii() ) );
+ LightApp_DataObject* aVisualStateRootObj = createObject( aNewRootObj, tr( partitionName( KIND_VISUAL_STATE ).toLatin1() ) );
int aNoStricklerTableObj = 0;
HYDROData_Iterator anIterator( aDocument, KIND_UNKNOWN );
createObject( aPolylineSect, aPolyline, aGuiObj->entry(), false );
LightApp_DataObject* aCaseAOSect =
- createObject( aGuiObj, tr( partitionName( KIND_ARTIFICIAL_OBJECT ).toAscii() ),
+ createObject( aGuiObj, tr( partitionName( KIND_ARTIFICIAL_OBJECT ).toLatin1() ),
aGuiObj->entry() );
LightApp_DataObject* aCaseNOSect =
- createObject( aGuiObj, tr( partitionName( KIND_NATURAL_OBJECT ).toAscii() ),
+ createObject( aGuiObj, tr( partitionName( KIND_NATURAL_OBJECT ).toLatin1() ),
aGuiObj->entry() );
HYDROData_SequenceOfObjects aSeq = aCaseObj->GetGeometryObjects();
anObjectKind = aFatherObj->GetKind();
}
- anIcon = QObject::tr( QString("HYDRO_%1TYPE%2_ICO").arg( aNeedUpdate ).arg( anObjectKind ).toAscii() );
+ anIcon = QObject::tr( QString("HYDRO_%1TYPE%2_ICO").arg( aNeedUpdate ).arg( anObjectKind ).toLatin1() );
}
return aResMgr->loadPixmap( "HYDRO", anIcon );
#include <TopoDS_Edge.hxx>
#include <BRep_Tool.hxx>
#include <Precision.hxx>
-#include <Handle_Geom_Curve.hxx>
-#include <Handle_Geom_Line.hxx>
-#include <Handle_Geom_TrimmedCurve.hxx>
+#include <Geom_Curve.hxx>
+#include <Geom_Line.hxx>
+#include <Geom_TrimmedCurve.hxx>
#include <Geom_TrimmedCurve.hxx>
#include <HYDROData_ShapeFile.h>
#include <SUIT_Desktop.h>
Handle(HYDROData_PolylineXY) aPolyXY;
Handle(HYDROData_Polyline3D) aPoly3D;
- NCollection_Sequence<Handle_HYDROData_PolylineXY> aPolyXYSeq;
- NCollection_Sequence<Handle_HYDROData_Polyline3D> aPoly3DSeq;
+ NCollection_Sequence<Handle(HYDROData_PolylineXY)> aPolyXYSeq;
+ NCollection_Sequence<Handle(HYDROData_Polyline3D)> aPoly3DSeq;
//
HYDROData_SequenceOfObjects aSeq = HYDROGUI_Tool::GetSelectedObjects( module() );
for( int anIndex = 1, aLength = aSeq.Length(); anIndex <= aLength; anIndex++ )
{
QStringList aNonExpList;
HYDROData_ShapeFile anExporter;
- Handle_HYDROData_Document aDoc = HYDROData_Document::Document( application()->activeStudy()->id() );
+ Handle(HYDROData_Document) aDoc = HYDROData_Document::Document( application()->activeStudy()->id() );
if (!aPolyXYSeq.IsEmpty() || !aPolyXYSeq.IsEmpty())
//Export polylines
anExporter.Export(aDoc, aFileName, aPolyXYSeq, aPoly3DSeq, aNonExpList);
QStringList SortedListOfAttr = anAttrNames.toList();
SortedListOfAttr.sort();
//
- Handle_HYDROData_LandCoverMap aLCM = Handle(HYDROData_LandCoverMap)::DownCast( aSeq(1) );
+ Handle(HYDROData_LandCoverMap) aLCM = Handle(HYDROData_LandCoverMap)::DownCast( aSeq(1) );
bool IsLinear = aLCM->CheckLinear();
HYDROGUI_ExportLandCoverMapDlg aDlg( module()->getApp()->desktop(), IsLinear, SortedListOfAttr);
if ( aDlg.exec() == HYDROGUI_ExportLandCoverMapDlg::Accepted )
#include <vector>
class SUIT_FileDlg;
-class gp_XYZ;
-class Handle_HYDROData_PolylineXY;
-class Handle_HYDROData_Polyline3D;
-class TopoDS_Face;
class HYDROGUI_ExportFileOp : public HYDROGUI_Operation
{
{
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 );
QString HYDROGUI_GeomObjectDlg::getDefaultName()
{
return myDefaultName;
-}
\ No newline at end of file
+}
#include <TColgp_Array1OfPnt.hxx>
-IMPLEMENT_STANDARD_TYPE(HYDROGUI_ImagePrs)
- IMPLEMENT_STANDARD_SUPERTYPE_ARRAY()
- STANDARD_TYPE(AIS_InteractiveObject),
- STANDARD_TYPE(SelectMgr_SelectableObject),
- STANDARD_TYPE(PrsMgr_PresentableObject),
- STANDARD_TYPE(MMgt_TShared),
- STANDARD_TYPE(Standard_Transient),
- IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_END()
- IMPLEMENT_STANDARD_TYPE_END(HYDROGUI_ImagePrs)
-
- IMPLEMENT_DOWNCAST(HYDROGUI_ImagePrs,Standard_Transient)
- IMPLEMENT_STANDARD_RTTI(HYDROGUI_ImagePrs)
-
- HYDROGUI_ImagePrs::HYDROGUI_ImagePrs()
- : AIS_InteractiveObject()
+IMPLEMENT_STANDARD_RTTIEXT(HYDROGUI_ImagePrs, AIS_InteractiveObject)
+
+HYDROGUI_ImagePrs::HYDROGUI_ImagePrs()
+ : AIS_InteractiveObject()
{
}
class Font_FTFont;
class HYDROGUI_ImagePrs;
-DEFINE_STANDARD_HANDLE(HYDROGUI_ImagePrs, AIS_InteractiveObject)
-
class HYDROGUI_ImagePrs : public AIS_InteractiveObject
{
public:
const Handle(Prs3d_Presentation)&, const Standard_Integer = 0 );
virtual void ComputeSelection( const Handle(SelectMgr_Selection)&, const Standard_Integer );
- DEFINE_STANDARD_RTTI(HYDROGUI_ImagePrs)
+ DEFINE_STANDARD_RTTIEXT(HYDROGUI_ImagePrs, AIS_InteractiveObject)
private:
gp_Pnt convert( const QPointF& ) const;
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++)
{
return false;
}
return true;
-}
\ No newline at end of file
+}
if ( !aPanel->getFileName().isEmpty() )
anObjName = aPanel->getObjectName();
- Handle_HYDROData_Document aDoc = HYDROData_Document::Document( application()->activeStudy()->id() );
+ Handle(HYDROData_Document) aDoc = HYDROData_Document::Document( application()->activeStudy()->id() );
//check if name of LCM is already exists
QSet<QString> aNameList;
//Collect all strickler_types
QSet<QString> aSTSet;
- Handle_HYDROData_Document aDoc = HYDROData_Document::Document( application()->activeStudy()->id() );
+ Handle(HYDROData_Document) aDoc = HYDROData_Document::Document( application()->activeStudy()->id() );
Handle(HYDROData_StricklerTable) DefStricklerTableObj;
if ( aDoc )
{
}
else
{
- Handle(HYDROData_Entity) LCM = Handle(HYDROData_Entity)::DownCast( myLCM );
- LCM->Remove();
+ myLCM->Remove();
module()->setObjectRemoved( myLCM );
abort();
}
} 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() ) );
} 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
}
return aPanel;
-}
\ No newline at end of file
+}
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() ) );
if (anExt == "shp")
{
HYDROData_ShapeFile anImporter;
- NCollection_Sequence<Handle_HYDROData_Entity> theEntities;
+ NCollection_Sequence<Handle(HYDROData_Entity)> theEntities;
int aShapeTypeOfFile = -1;
int aStat = anImporter.ImportPolylines(doc(), aFileName, theEntities, aShapeTypeOfFile );
if (aStat == 1)
QApplication::restoreOverrideCursor();
}
-void HYDROGUI_ImportPolylineOp::UpdateView( NCollection_Sequence<Handle_HYDROData_Entity>& anEntities)
+void HYDROGUI_ImportPolylineOp::UpdateView( NCollection_Sequence<Handle(HYDROData_Entity)>& anEntities)
{
size_t anActiveViewId = HYDROGUI_Tool::GetActiveGraphicsViewId( module() );
if ( anActiveViewId == 0 )
#include <NCollection_Sequence.hxx>
class SUIT_FileDlg;
-class Handle_HYDROData_Entity;
+class HYDROData_Entity;
class HYDROGUI_ImportPolylineOp : public HYDROGUI_Operation
{
protected:
virtual void startOperation();
virtual void onApply();
- void UpdateView( NCollection_Sequence<Handle_HYDROData_Entity>& anEntities);
+ void UpdateView( NCollection_Sequence<Handle(HYDROData_Entity)>& anEntities);
private:
SUIT_FileDlg* myFileDlg;
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() ) );
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() ) );
if (anExt == "sx")
{
HYDROData_SinusX aSinusXImporter;
- NCollection_Sequence<Handle_HYDROData_Entity> anEntities;
+ NCollection_Sequence<Handle(HYDROData_Entity)> anEntities;
if (aSinusXImporter.Import(aFileName, doc(), anEntities))
{
UpdateView(anEntities);
QApplication::restoreOverrideCursor();
}
-void HYDROGUI_ImportSinusXOp::UpdateView( NCollection_Sequence<Handle_HYDROData_Entity>& anEntities)
+void HYDROGUI_ImportSinusXOp::UpdateView( NCollection_Sequence<Handle(HYDROData_Entity)>& anEntities)
{
size_t anActiveViewId = HYDROGUI_Tool::GetActiveGraphicsViewId( module() );
if ( anActiveViewId == 0 )
#include <NCollection_Sequence.hxx>
class SUIT_FileDlg;
-class Handle_HYDROData_Entity;
+class HYDROData_Entity;
class HYDROGUI_ImportSinusXOp : public HYDROGUI_Operation
{
protected:
virtual void startOperation();
virtual void onApply();
- void UpdateView( NCollection_Sequence<Handle_HYDROData_Entity>& anEntities);
+ void UpdateView( NCollection_Sequence<Handle(HYDROData_Entity)>& anEntities);
private:
SUIT_FileDlg* myFileDlg;
};
#include <AIS_DisplayMode.hxx>
#include <Prs3d_IsoAspect.hxx>
#include <SelectMgr_SequenceOfOwner.hxx>
-#include <StdPrs_WFDeflectionShape.hxx>
+#include <StdPrs_WFShape.hxx>
#include <StdSelect_BRepOwner.hxx>
#include <TopoDS_Face.hxx>
#include <QColor>
const Quantity_Color EDGES_COLOR = Quantity_NOC_SLATEGRAY;
const int HILIGHT_ISO_NB = 10;
-IMPLEMENT_STANDARD_HANDLE( HYDROGUI_LandCoverMapPrs, AIS_ColoredShape )
IMPLEMENT_STANDARD_RTTIEXT( HYDROGUI_LandCoverMapPrs, AIS_ColoredShape )
HYDROGUI_LandCoverMapPrs::HYDROGUI_LandCoverMapPrs( const Handle(HYDROData_LandCoverMap)& theMap )
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;
}
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,
{
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 );
#include <HYDROData_LandCoverMap.h>
#include <HYDROData_StricklerTable.h>
#include <AIS_ColoredShape.hxx>
-#include <Aspect_ColorScale.hxx>
+#include <AIS_ColorScale.hxx>
-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();
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)& );
private:
Handle(HYDROData_LandCoverMap) myLCMap;
- Handle(Aspect_ColorScale) myColorScale;
+ Handle(AIS_ColorScale) myColorScale;
Handle(HYDROData_StricklerTable) myTable;
};
myEye = QPixmap( 16, 16 );
myEye.fill( Qt::black );
}
-
- // Set the supported drag actions for the items in the model
- setSupportedDragActions( Qt::MoveAction | Qt::CopyAction );
}
/**
*/
void HYDROGUI_ListModel::setObjects( const Object2VisibleList& theObjects )
{
+ beginResetModel();
myObjects = theObjects;
-
- reset();
+ endResetModel();
}
/**
*/
void HYDROGUI_ListModel::addObject( const Object2Visible& theObject )
{
+ beginResetModel();
myObjects << theObject;
-
- reset();
+ endResetModel();
}
/**
}
}
+ beginResetModel();
myObjects.removeAll(anItem);
-
- reset();
+ endResetModel();
}
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
void HYDROGUI_ListModel::undoLastMove()
{
+ beginResetModel();
myObjects = myPrevObjects;
- reset();
+ endResetModel();
}
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<int> getIds( const QModelIndexList& theIndexes, bool theIsToSort = true ) const;
bool myIsDecorationEnabled;
};
-#endif
\ No newline at end of file
+#endif
class SUIT_ViewWindow;
class SUIT_ViewManager;
-class Handle(HYDROData_StricklerTable);
+class HYDROData_StricklerTable;
class HYDROGUI_DataModel;
class HYDROGUI_Displayer;
#include <AIS_InteractiveContext.hxx>
#include <AIS_ListIteratorOfListOfInteractive.hxx>
#include <AIS_ListOfInteractive.hxx>
-
-#include <Aspect_ColorScale.hxx>
+#include <AIS_ColorScale.hxx>
#include <TColStd_SequenceOfInteger.hxx>
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 );
QList<HYDROGUI_Shape*> aBathShapes = module()->getObjectShapes( aViewerId, KIND_BATHYMETRY );
bool isDisplayColorScale = !aBathShapes.empty() || isLandCoverColoringOn;
- Standard_Real anXPos = 0.05; //TODO
- Standard_Real anYPos = 0.1; //TODO
- Standard_Real aWidth = 0.2; //TODO
- Standard_Real aHeight = 0.5; //TODO
- Standard_Integer aTextHeight = 14; //TODO
- Standard_Integer aNbIntervals = 20; //TODO
- TCollection_ExtendedString aColorScaleTitle = "";//TODO
Standard_Real aColorScaleMin = 0, aColorScaleMax = 1;
}
}
- 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 );
- aColorScale->SetYPosition( anYPos );
- aColorScale->SetWidth( aWidth );
- aColorScale->SetHeight( aHeight );
-
- aColorScale->SetTextHeight( aTextHeight );
- aColorScale->SetNumberOfIntervals( aNbIntervals );
-
+ // Set color scale title
+ TCollection_ExtendedString aColorScaleTitle = ""; //TODO
aColorScale->SetTitle( aColorScaleTitle );
+
+ // Set color scale range
aColorScale->SetRange( aColorScaleMin, aColorScaleMax );
+
+ aColorScale->SetToUpdate();
if ( !isLandCoverColoringOn ) {
foreach( HYDROGUI_Shape* aShape, aBathShapes ) {
aBathShape->UpdateWithColorScale( aColorScale );
}
}
+
+ if ( !aCtx.IsNull()/* && !aCtx->IsDisplayed( aColorScale ) */) {
+ if ( !aCtx->IsDisplayed( aColorScale ) ) {
+ aCtx->Display( aColorScale, Standard_False );
+ }
+
+ aCtx->Update( 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 ) {
myToUpdateColorScale = false;
}
+
+Handle(AIS_ColorScale) HYDROGUI_OCCDisplayer::GetColorScale( const int theViewerId )
+{
+ Handle(AIS_ColorScale) aColorScale;
+
+ aColorScale = myColorScales.value( theViewerId, aColorScale );
+ if ( aColorScale.IsNull() ) {
+ // Create color scale
+ aColorScale = new AIS_ColorScale();
+
+ // Set properties
+ Standard_Integer anXPos = 50; //TODO
+ Standard_Integer anYPos = 100; //TODO
+ Standard_Integer aWidth = 100; //TODO
+ Standard_Integer aHeight = 350; //TODO
+
+ Standard_Integer aTextHeight = 14; //TODO
+ Standard_Integer aNbIntervals = 20; //TODO
+
+ aColorScale->SetTransformPersistence( Graphic3d_TMF_2d, gp_Pnt( -1, -1, 0 ) );
+
+ aColorScale->SetXPosition( anXPos );
+ aColorScale->SetYPosition( anYPos );
+ aColorScale->SetSize( aWidth, aHeight );
+
+ aColorScale->SetTextHeight( aTextHeight );
+ aColorScale->SetNumberOfIntervals( aNbIntervals );
+
+ // Put into the map
+ myColorScales.insert( theViewerId, aColorScale );
+ }
+
+ return aColorScale;
+}
#include "HYDROGUI_AbstractDisplayer.h"
class HYDROGUI_Shape;
-class Handle(AIS_InteractiveContext);
+class AIS_InteractiveContext;
+class AIS_ColorScale;
class OCCViewer_ViewManager;
class OCCViewer_Viewer;
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.
private:
bool myToUpdateColorScale;
+
+ QMap<int, Handle(AIS_ColorScale)> myColorScales;
};
#endif
class HYDROGUI_Module;
class OCCViewer_Viewer;
-class Handle_AIS_InteractiveObject;
+class AIS_InteractiveObject;
class HYDROGUI_OCCSelector : public LightApp_OCCSelector
{
virtual void getSelection( SUIT_DataOwnerPtrList& ) const;
virtual void setSelection( const SUIT_DataOwnerPtrList& );
- virtual QString entry( const Handle_AIS_InteractiveObject& ) const;
+ virtual QString entry( const Handle(AIS_InteractiveObject)& ) const;
private:
HYDROGUI_Module* myModule;
}
}
-Handle_HYDROData_Document HYDROGUI_Operation::doc() const
+Handle(HYDROData_Document) HYDROGUI_Operation::doc() const
{
return HYDROData_Document::Document( myModule->getStudyId() );
}
#define HYDROGUI_OPERATION_H
#include <LightApp_Operation.h>
-
+#include <Standard_DefineHandle.hxx>
#include <QCursor>
class HYDROGUI_Module;
class SUIT_SelectionMgr;
class OCCViewer_ViewManager;
-class Handle_HYDROData_Document;
-class Handle_HYDROData_Object;
+class HYDROData_Document;
+class HYDROData_Object;
class HYDROGUI_Operation : public LightApp_Operation
{
void abortDocOperation();
void commitDocOperation();
- Handle_HYDROData_Document doc() const;
+ Handle(HYDROData_Document) doc() const;
virtual bool isToAbortOnApply() const { return true; }
#include <BRepAdaptor_Curve.hxx>
#include <Prs3d_LineAspect.hxx>
-IMPLEMENT_STANDARD_HANDLE (HYDROGUI_Polyline, AIS_Shape)
IMPLEMENT_STANDARD_RTTIEXT(HYDROGUI_Polyline, AIS_Shape)
#include <Standard.hxx>
#include <Standard_DefineHandle.hxx>
#include <PrsMgr_PresentationManager.hxx>
-#include <Handle_Prs3d_Presentation.hxx>
+#include <Prs3d_Presentation.hxx>
#include <TCollection_AsciiString.hxx>
#include <AIS_DisplayMode.hxx>
const Standard_Integer aMode = 0);
public:
- DEFINE_STANDARD_RTTI(HYDROGUI_Polyline);
+ DEFINE_STANDARD_RTTIEXT(HYDROGUI_Polyline, AIS_Shape);
};
-DEFINE_STANDARD_HANDLE(HYDROGUI_Polyline, AIS_Shape)
-
#endif
beginResetModel();
myRules = myPrevRules;
endResetModel();
- reset();
}
/**
// 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
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();
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 );
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() )
{
void HYDROGUI_Shape::setSelectionMode( int theSelectionMode )
{
mySelectionMode = theSelectionMode;
-}
\ No newline at end of file
+}
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 );
#include <HYDROData_Bathymetry.h>
#include <AIS_InteractiveContext.hxx>
-#include <Aspect_ColorScale.hxx>
+#include <AIS_ColorScale.hxx>
#include <Prs3d_PointAspect.hxx>
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 )
}
-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));
aThat->myColors = new Quantity_HArray1OfColor( aLower, anUpper );
for( int i=aLower; i<=anUpper; i++ )
aThat->myCoords->SetValue( i, gp_Pnt( aBathPoints[i].X, aBathPoints[i].Y, aBathPoints[i].Z ) );
-
- return aPntCloud;
}
- else
- return Handle_AIS_InteractiveObject();
+
+ return aPntCloud;
}
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 )
{
if (!myCoords)
return;
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 );
}
#include <TColgp_HArray1OfPnt.hxx>
#include <Quantity_HArray1OfColor.hxx>
-class Handle_HYDROData_Bathymetry;
-class Handle_Aspect_ColorScale;
+class HYDROData_Bathymetry;
+class AIS_ColorScale;
class HYDROGUI_OCCDisplayer;
class HYDROGUI_ShapeBathymetry : public HYDROGUI_Shape
public:
HYDROGUI_ShapeBathymetry( HYDROGUI_OCCDisplayer* theDisplayer,
const Handle(AIS_InteractiveContext)& theContext,
- const Handle_HYDROData_Bathymetry& theBathymetry,
+ const Handle(HYDROData_Bathymetry)& theBathymetry,
const int theZLayer = -1 );
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 );
virtual void setVisible( const bool theState,
const bool theIsUpdateViewer = true );
protected:
- virtual Handle_AIS_InteractiveObject createShape() const;
+ virtual Handle(AIS_InteractiveObject) createShape() const;
virtual void displayShape( const bool theIsUpdateViewer );
void setToUpdateColorScale( bool isChanged );
private:
HYDROGUI_OCCDisplayer* myDisplayer;
- Handle_TColgp_HArray1OfPnt myCoords;
- Handle_Quantity_HArray1OfColor myColors;
+ Handle(TColgp_HArray1OfPnt) myCoords;
+ Handle(Quantity_HArray1OfColor) myColors;
};
#endif
#include <gp_Pnt.hxx>
HYDROGUI_ShapeImage::HYDROGUI_ShapeImage( const Handle(AIS_InteractiveContext)& theContext,
- const Handle_HYDROData_Image& theImage,
+ const Handle(HYDROData_Image)& theImage,
const int theZLayer )
: HYDROGUI_Shape( theContext, theImage, theZLayer )
{
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
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() )
#include <QPolygonF>
-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
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 ),
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() )
aLandCoverMapPrs->SetTable( aTable );
// Set color scale
- OCCViewer_ViewWindow* aWnd = dynamic_cast<OCCViewer_ViewWindow*>( 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) );
}
}
}
#include <HYDROGUI_Shape.h>
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();
protected:
virtual void displayShape( const bool theIsUpdateViewer );
- virtual Handle_AIS_InteractiveObject createShape() const;
+ virtual Handle(AIS_InteractiveObject) createShape() const;
private:
HYDROGUI_OCCDisplayer* myDisplayer;
HYDROGUI_Tool::FindObjectByName( module(), myHydAxis, KIND_POLYLINEXY ) );
HYDROData_SequenceOfObjects aRefProfiles;
- //std::vector<Handle_HYDROData_Profile> aRefProfiles;
+ //std::vector<Handle(HYDROData_Profile)> aRefProfiles;
int plen = myProfiles.length();
for ( int i = 0; i < plen; ++i )
{
void HYDROGUI_ColorDelegate::paint( QPainter* thePainter, const QStyleOptionViewItem& theOption,
const QModelIndex& theIndex ) const
{
- QColor aColor = qVariantValue<QColor>( theIndex.data( Qt::BackgroundColorRole ) );
+ QColor aColor = theIndex.data( Qt::BackgroundColorRole ).value<QColor>();
thePainter->fillRect( theOption.rect, aColor );
}
const QStyleOptionViewItem& theOption,
const QModelIndex& theIndex ) const
{
- QColor aColor = qVariantValue<QColor>( theIndex.data( Qt::BackgroundColorRole ) );
+ QColor aColor = theIndex.data( Qt::BackgroundColorRole ).value<QColor>();
QColor aNewColor = QColorDialog::getColor( aColor );
if( aNewColor.isValid() )
{
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
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;
}
}
-void HYDROGUI_StricklerTableDlg::setGuiData( const Handle_HYDROData_StricklerTable& theTable )
+void HYDROGUI_StricklerTableDlg::setGuiData( const Handle(HYDROData_StricklerTable)& theTable )
{
myAttrName->setText( theTable->GetAttrName() );
#include "HYDROGUI_InputPanel.h"
#include <QAbstractItemDelegate>
+#include <Standard_Type.hxx>
-class Handle_HYDROData_StricklerTable;
+class HYDROData_StricklerTable;
class QGroupBox;
class QLineEdit;
bool isTableNameReadOnly() const;
void setTableNameReadOnly( bool );
- void getGuiData( Handle_HYDROData_StricklerTable& theTable ) const;
- void setGuiData( const Handle_HYDROData_StricklerTable& theTable );
+ void getGuiData( Handle(HYDROData_StricklerTable)& theTable ) const;
+ void setGuiData( const Handle(HYDROData_StricklerTable)& theTable );
protected:
void updateControls();
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;
}
QMap<QString,HYDROData_SequenceOfObjects> HYDROGUI_Tool::GetObjectsBackReferences(
- const Handle_HYDROData_Document& theDocument, const QStringList& theObjectNames )
+ const Handle(HYDROData_Document)& theDocument, const QStringList& theObjectNames )
{
QMap<QString,HYDROData_SequenceOfObjects> aResMap;
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;
}
#include <QString>
class TCollection_AsciiString;
-class Handle_HYDROData_Document;
-class Handle_Image_PixMap;
-class Handle_TCollection_HAsciiString;
-class Handle_TCollection_HExtendedString;
+class HYDROData_Document;
+class Image_PixMap;
+class TCollection_HAsciiString;
+class TCollection_HExtendedString;
class QDockWidget;
class QImage;
class QWidget;
{
QString ToQString( const TCollection_AsciiString& );
QString ToQString( const TCollection_ExtendedString& );
- QString ToQString( const Handle_TCollection_HAsciiString& );
- QString ToQString( const Handle_TCollection_HExtendedString& );
+ QString ToQString( const Handle(TCollection_HAsciiString)& );
+ QString ToQString( const Handle(TCollection_HExtendedString)& );
TCollection_AsciiString ToAsciiString( const QString& );
TCollection_ExtendedString ToExtString( const QString& );
Handle(TCollection_HAsciiString) ToHAsciiString( const QString& );
QDockWidget* WindowDock( QWidget* wid );
- QStringList FindExistingObjectsNames( const Handle_HYDROData_Document& theDoc,
+ QStringList FindExistingObjectsNames( const Handle(HYDROData_Document)& theDoc,
const ObjectKind theObjectKind,
bool isCheckValidProfile = false );
QString GetCoordinateString( const double theNumber, bool isInLocale );
- Handle_Image_PixMap Pixmap( const QImage& theImage );
+ Handle(Image_PixMap) Pixmap( const QImage& theImage );
void GetObjectReferences( const Handle(HYDROData_Entity)& theObj,
HYDROData_SequenceOfObjects& theRefObjects,
QStringList& theRefNames );
HYDROData_SequenceOfObjects GetObjectBackReferences( const Handle(HYDROData_Entity)& theObj );
QMap<QString,HYDROData_SequenceOfObjects> GetObjectsBackReferences
- ( const Handle_HYDROData_Document& theDocument, const QStringList& theObjectNames );
+ ( const Handle(HYDROData_Document)& theDocument, const QStringList& theObjectNames );
};
#endif
{
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;
}
}
class SUIT_ViewManager;
class GraphicsView_ViewPort;
class OCCViewer_ViewFrame;
-class Handle_HYDROData_Document;
+class HYDROData_Document;
namespace HYDROGUI_Tool
{
HYDROData_SequenceOfObjects GetSelectedObjects( HYDROGUI_Module* theModule );
- bool IsObjectHasPresentation( const Handle_HYDROData_Entity& theObject,
+ bool IsObjectHasPresentation( const Handle(HYDROData_Entity)& theObject,
const QString& theViewerType = "" );
Handle(HYDROData_Entity) GetSelectedObject( HYDROGUI_Module* theModule );
QColor GenerateFillingColor( HYDROGUI_Module* theModule, const QStringList& theZoneNames );
- QColor GenerateFillingColor( const Handle_HYDROData_Document& theDoc,
+ QColor GenerateFillingColor( const Handle(HYDROData_Document)& theDoc,
const QStringList& theZoneNames );
QStringList GetSelectedGeomObjects( HYDROGUI_Module* theModule,
#include <NCollection_Map.hxx>
-class Handle_HYDROData_Entity;
+class HYDROData_Entity;
class HYDROGUI_UpdateObjectOp : public HYDROGUI_Operation
{
virtual void startOperation();
- virtual void updateObject( const Handle_HYDROData_Entity& theObject,
+ virtual void updateObject( const Handle(HYDROData_Entity)& theObject,
NCollection_Map<Handle(HYDROData_Entity)>& theMapOfTreated ) const;
private:
// Define IO for actors to be added:
QString anEntry = HYDROGUI_DataObject::dataObjectEntry( theObject );
myIO = new SALOME_InteractiveObject(
- anEntry.toAscii(), QString::number( theObject->GetKind() ).toAscii(), theObject->GetName().toAscii() );
+ anEntry.toLatin1(), QString::number( theObject->GetKind() ).toLatin1(), theObject->GetName().toLatin1() );
myZRange[0] = HYDROData_IAltitudeObject::GetInvalidAltitude();
myZRange[1] = HYDROData_IAltitudeObject::GetInvalidAltitude();
}
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;
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();
}
}
-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*/ )
{
theViewer3d->SetZLayerSettings( theLayerId, aSettings );
}
-int CreateTopZLayer( const Handle_V3d_Viewer& theViewer3d )
+int CreateTopZLayer( const Handle(V3d_Viewer)& theViewer3d )
{
int aTopZLayer = -1;
}
-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 );
{
}
-void HYDROGUI_ZLayersIterator::Init( const Handle_V3d_Viewer& theViewer )
+void HYDROGUI_ZLayersIterator::Init( const Handle(V3d_Viewer)& theViewer )
{
TColStd_SequenceOfInteger anExistingZLayers;
theViewer->GetAllZLayers( anExistingZLayers );
#include <vector>
#include <V3d_Viewer.hxx>
-class Handle_PrsMgr_PresentableObject;
-class Handle_AIS_InteractiveContext;
+class PrsMgr_PresentableObject;
+class AIS_InteractiveContext;
class HYDROGUI_ZLayersIterator
{
public:
- HYDROGUI_ZLayersIterator( const Handle_V3d_Viewer& );
+ HYDROGUI_ZLayersIterator( const Handle(V3d_Viewer)& );
~HYDROGUI_ZLayersIterator();
- void Init( const Handle_V3d_Viewer& );
+ void Init( const Handle(V3d_Viewer)& );
bool More() const;
void Next();
int LayerId() const;
std::vector<int> myZLayers;
int myIndex;
int myNewZLayer;
- Handle_V3d_Viewer myViewer;
+ Handle(V3d_Viewer) myViewer;
};
-void SetPrsZLayer( const Handle_PrsMgr_PresentableObject& thePresentableObject,
+void SetPrsZLayer( const Handle(PrsMgr_PresentableObject)& thePresentableObject,
const int theMode, const int theLayerId );
-void UpdateZLayersOfHilightPresentationsOfDisplayedObjects( const Handle_AIS_InteractiveContext&, int theLayer );
-void SetZLayerSettings( const Handle_V3d_Viewer&, int theLayerId, bool theIsOrdered );
-int CreateTopZLayer( const Handle_V3d_Viewer& );
+void UpdateZLayersOfHilightPresentationsOfDisplayedObjects( const Handle(AIS_InteractiveContext)&, int theLayer );
+void SetZLayerSettings( const Handle(V3d_Viewer)&, int theLayerId, bool theIsOrdered );
+int CreateTopZLayer( const Handle(V3d_Viewer)& );
#endif
#include <AIS_ListIteratorOfListOfInteractive.hxx>
#include <AIS_Trihedron.hxx>
#include <PrsMgr_PresentationManager3d.hxx>
+#include <Basics_OCCTVersion.hxx>
-void UpdateZLayersOfHilightPresentationsOfDisplayedObjects( const Handle_AIS_InteractiveContext& theContext,
+void UpdateZLayersOfHilightPresentationsOfDisplayedObjects( const Handle(AIS_InteractiveContext)& theContext,
int theLayer )
{
AIS_ListOfInteractive aDisplayedObjects;
if( !aPrsObj.IsNull() && !aPrsObj->IsKind( STANDARD_TYPE(AIS_Trihedron) ) )
{
int aMode = aPrsObj->HasHilightMode() ? aPrsObj->HilightMode() : 0;
- theContext->MainPrsMgr()->Color( aPrsObj, Quantity_NOC_YELLOW, aMode );
+#if OCC_VERSION_LARGE < 0x07010000
+ Quantity_NameOfColor aStyle = Quantity_NOC_YELLOW;
+#else
+ Handle(Graphic3d_HighlightStyle) aStyle = new Graphic3d_HighlightStyle( Aspect_TOHM_COLOR, Quantity_NOC_YELLOW );
+#endif
+ theContext->MainPrsMgr()->Color( aPrsObj, aStyle, aMode );
SetPrsZLayer( aPrsObj, aMode, theLayer );
theContext->MainPrsMgr()->Unhighlight( aPrsObj, aMode );
}
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
include(../../CMake/Common.cmake)
-include(UsePyQt4)
+INCLUDE(UsePyQt)
# additional include directories
INCLUDE_DIRECTORIES(
HYDROData
)
-# --- resources ---
-
-# sip files / to be processed by sip
-SET(_sip_input_file
- HYDROData.sip
-)
-
SET(_add_SOURCES
sipHYDROPycmodule.cc
+ sipHYDROPyNCollection_Sequence0600opencascadehandle0100HYDROData_Entity.cc
sipHYDROPygp_XY.cc
sipHYDROPygp_XYZ.cc
sipHYDROPyHYDROData_AltitudeObject.cc
sipHYDROPyHYDROData_Zone.cc
sipHYDROPyNCollection_Sequence0100gp_XY.cc
sipHYDROPyNCollection_Sequence0100gp_XYZ.cc
- sipHYDROPyNCollection_Sequence0100Handle_HYDROData_Entity.cc
sipHYDROPyNCollection_Sequence0100HYDROData_IPolylineSectionType.cc
sipHYDROPyNCollection_Sequence0100TCollection_AsciiString.cc
sipHYDROPyNCollection_Sequence1800.cc
sipHYDROPyTCollection_AsciiString.cc
)
+set_source_files_properties( ${_add_SOURCES} PROPERTIES GENERATED TRUE )
+
# sources / sip wrappings
-PYQT4_WRAP_SIP(_sip_SOURCES ${_sip_input_file} SOURCES ${_add_SOURCES})
+PYQT_WRAP_SIP( _sip_SOURCES HYDROData.sip )
# sources / to compile
-SET(HYDROPy_SOURCES ${_sip_SOURCES})
-
-ADD_LIBRARY(HYDROPy ${HYDROPy_SOURCES})
+ADD_LIBRARY( HYDROPy ${_sip_SOURCES} ${_add_SOURCES} )
TARGET_LINK_LIBRARIES(HYDROPy ${_link_LIBRARIES})
INSTALL(TARGETS HYDROPy EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
/**
* 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<HYDROData_Object>& )];
%MethodCode
Handle(HYDROData_Object) aRef =
Handle(HYDROData_Object)::DownCast( createHandle( a0 ) );
* Removes reference geometry object from calculation case.
*/
void RemoveGeometryObject( HYDROData_Object theObject )
- [void ( const Handle_HYDROData_Object& )];
+ [void ( const opencascade::handle<HYDROData_Object>& )];
%MethodCode
Handle(HYDROData_Object) aRef =
Handle(HYDROData_Object)::DownCast( createHandle( a0 ) );
/**
* 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<HYDROData_ShapesGroup>& )];
%MethodCode
Handle(HYDROData_ShapesGroup) aRef =
Handle(HYDROData_ShapesGroup)::DownCast( createHandle( a0 ) );
/**
* 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<HYDROData_ShapesGroup>& )];
%MethodCode
Handle(HYDROData_ShapesGroup) aRef =
Handle(HYDROData_ShapesGroup)::DownCast( createHandle( a0 ) );
/**
* 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<HYDROData_PolylineXY>& )];
%MethodCode
Handle(HYDROData_PolylineXY) aRef =
Handle(HYDROData_PolylineXY)::DownCast( createHandle( a0 ) );
/**
* Returns reference boundary polyline object of calculation case.
*/
- HYDROData_PolylineXY GetBoundaryPolyline() const [Handle_HYDROData_PolylineXY ()];
+ HYDROData_PolylineXY GetBoundaryPolyline() const [opencascade::handle<HYDROData_PolylineXY> ()];
%MethodCode
Handle(HYDROData_PolylineXY) aRef;
*/
void RemoveBoundaryPolyline();
- void SetLandCoverMap( HYDROData_LandCoverMap theLandCoverMap ) [void ( const Handle_HYDROData_LandCoverMap& )];
+ void SetLandCoverMap( HYDROData_LandCoverMap theLandCoverMap ) [void ( const opencascade::handle<HYDROData_LandCoverMap>& )];
%MethodCode
Handle(HYDROData_LandCoverMap) aRef =
Handle(HYDROData_LandCoverMap)::DownCast( createHandle( a0 ) );
}
%End
- void SetStricklerTable( HYDROData_StricklerTable theStricklerTable ) [void ( const Handle_HYDROData_StricklerTable& )];
+ void SetStricklerTable( HYDROData_StricklerTable theStricklerTable ) [void ( const opencascade::handle<HYDROData_StricklerTable>& )];
%MethodCode
Handle(HYDROData_StricklerTable) aRef =
Handle(HYDROData_StricklerTable)::DownCast( createHandle( a0 ) );
* 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<HYDROData_Region> ( opencascade::handle<HYDROData_Zone>& )];
%MethodCode
Handle(HYDROData_Zone) aRef =
Handle(HYDROData_Zone)::DownCast( createHandle( a0 ) );
* 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<HYDROData_Region>& )];
%MethodCode
Handle(HYDROData_Region) aRef =
Handle(HYDROData_Region)::DownCast( createHandle( a0 ) );
/**
* Removes reference region from calculation case.
*/
- void RemoveRegion( HYDROData_Region theRegion ) [void ( const Handle_HYDROData_Region& )];
+ void RemoveRegion( HYDROData_Region theRegion ) [void ( opencascade::handle<HYDROData_Region>& )];
%MethodCode
Handle(HYDROData_Region) aRef =
Handle(HYDROData_Region)::DownCast( createHandle( a0 ) );
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<HYDROData_Region>& )];
%MethodCode
gp_XY aPnt( a0, a1 );
Handle(HYDROData_Region) aRefRegion =
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<HYDROData_Zone>& )];
%MethodCode
gp_XY aPnt( a0, a1 );
Handle(HYDROData_Zone) aRefZone =
const NCollection_Sequence<double>& theCoordsY,
HYDROData_Region theRegion,
int theMethod = 0) const
- [NCollection_Sequence<double> ( const NCollection_Sequence<gp_XY>&, const Handle_HYDROData_Region&, int)];
+ [NCollection_Sequence<double> ( const NCollection_Sequence<gp_XY>&, opencascade::handle<HYDROData_Region>&, int)];
%MethodCode
NCollection_Sequence<gp_XY> aPnts;
const NCollection_Sequence<double>& theCoordsY,
HYDROData_Zone theZone,
int theMethod = 0) const
- [NCollection_Sequence<double> ( const NCollection_Sequence<gp_XY>&, const Handle_HYDROData_Zone&, int )];
+ [NCollection_Sequence<double> ( const NCollection_Sequence<gp_XY>&, opencascade::handle<HYDROData_Zone>&, int )];
%MethodCode
NCollection_Sequence<gp_XY> aPnts;
*/
HYDROData_Region GetRegionFromPoint( const double theCoordX,
const double theCoordY ) const
- [Handle_HYDROData_Region ( const gp_XY& )];
+ [opencascade::handle<HYDROData_Region> ( const gp_XY& )];
%MethodCode
Handle(HYDROData_Region) aRes;
*/
HYDROData_Zone GetZoneFromPoint( const double theCoordX,
const double theCoordY ) const
- [Handle_HYDROData_Zone ( const gp_XY& )];
+ [opencascade::handle<HYDROData_Zone> ( const gp_XY& )];
%MethodCode
Handle(HYDROData_Zone) aRes;
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<HYDROData_Zone>& )];
%MethodCode
gp_XY aPnt( a0, a1 );
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_Entity>&, HYDROData_PriorityType, opencascade::handle<HYDROData_Entity>&, 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 ) :
* Sets reference guide line object for channel.
*/
bool SetGuideLine( HYDROData_Polyline3D theGuideLine )
- [bool ( const Handle_HYDROData_Polyline3D& )];
+ [bool ( const opencascade::handle<HYDROData_Polyline3D>& )];
%MethodCode
Handle(HYDROData_Polyline3D) aRef =
Handle(HYDROData_Polyline3D)::DownCast( createHandle( a0 ) );
* Returns reference guide line object of channel.
*/
HYDROData_Polyline3D GetGuideLine() const
- [Handle_HYDROData_Polyline3D ()];
+ [opencascade::handle<HYDROData_Polyline3D> ()];
%MethodCode
Handle(HYDROData_Polyline3D) aRef;
* Sets reference profile object for channel.
*/
bool SetProfile( HYDROData_Profile theProfile )
- [bool ( const Handle_HYDROData_Profile& )];
+ [bool ( const opencascade::handle<HYDROData_Profile>& )];
%MethodCode
Handle(HYDROData_Profile) aRef =
Handle(HYDROData_Profile)::DownCast( createHandle( a0 ) );
* Returns reference profile object of channel.
*/
HYDROData_Profile GetProfile() const
- [Handle_HYDROData_Profile ()];
+ [opencascade::handle<HYDROData_Profile> ()];
%MethodCode
Handle(HYDROData_Profile) aRef;
%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;
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<HYDROData_Document> (const int)] ;
%MethodCode
Handle(HYDROData_Document) aDocument;
//! 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<HYDROData_Entity> (const ObjectKind)] ;
%MethodCode
Handle(HYDROData_Entity) anObject;
HYDROData_Entity FindObjectByName( const QString& theName,
const ObjectKind theKind = KIND_UNKNOWN )
- [Handle_HYDROData_Entity (const QString&, const ObjectKind)] ;
+ [opencascade::handle<HYDROData_Entity> (const QString&, const ObjectKind)] ;
%MethodCode
Handle(HYDROData_Entity) anObject;
* 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<HYDROData_Entity> ()];
%MethodCode
Handle(HYDROData_Entity) aFather;
/**
* 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.
* Sets the altitude object for interpolation.
*/
void SetAltitudeObject( HYDROData_IAltitudeObject theAltitude )
- [void ( const Handle_HYDROData_IAltitudeObject& )];
+ [void ( const opencascade::handle<HYDROData_IAltitudeObject>& )];
%MethodCode
Handle(HYDROData_IAltitudeObject) anAltitude =
Handle(HYDROData_IAltitudeObject)::DownCast( createHandle( a0 ) );
/**
* Returns the altitude object for interpolation.
*/
- HYDROData_IAltitudeObject GetAltitudeObject() const [Handle_HYDROData_IAltitudeObject ()];
+ HYDROData_IAltitudeObject GetAltitudeObject() const [opencascade::handle<HYDROData_IAltitudeObject> ()];
%MethodCode
Handle(HYDROData_IAltitudeObject) aRes;
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<HYDROData_Image>&, const QPointF&, const QPointF&, const QPointF&, const bool )];
%MethodCode
Handle(HYDROData_Image) aRefImage =
Handle(HYDROData_Image)::DownCast( createHandle( a0 ) );
QPointF& thePointA /Out/,
QPointF& thePointB /Out/,
QPointF& thePointC /Out/ ) const
- [bool ( const Handle_HYDROData_Image&, QPointF&, QPointF&, QPointF& )];
+ [bool ( const opencascade::handle<HYDROData_Image>&, QPointF&, QPointF&, QPointF& )];
%MethodCode
Handle(HYDROData_Image) aRefImage =
Handle(HYDROData_Image)::DownCast( createHandle( a0 ) );
*/
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<HYDROData_Image>& )];
%MethodCode
Handle(HYDROData_Image) aRefImage =
Handle(HYDROData_Image)::DownCast( createHandle( a0 ) );
/**
* Returns the reference image for transformation
*/
- HYDROData_Image GetTrsfReferenceImage() const [Handle_HYDROData_Image ()];
+ HYDROData_Image GetTrsfReferenceImage() const [opencascade::handle<HYDROData_Image> ()];
%MethodCode
Handle(HYDROData_Image) aRefImage;
* 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<HYDROData_Entity>& )];
%MethodCode
Handle(HYDROData_Entity) aRef = createHandle( a0 );
if ( !aRef.IsNull() )
* \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<HYDROData_Entity> ()];
%MethodCode
Handle(HYDROData_Entity) aRef;
* \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<HYDROData_Entity>& )];
%MethodCode
Handle(HYDROData_Entity) aRef = createHandle( a1 );
if ( !aRef.IsNull() )
/**
* 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<HYDROData_PolylineXY>&)];
%MethodCode
Handle(HYDROData_PolylineXY) aRefPolyline =
/**
* Returns reference polyline object of zone.
*/
- HYDROData_PolylineXY GetPolyline() const [Handle_HYDROData_PolylineXY ()];
+ HYDROData_PolylineXY GetPolyline() const [opencascade::handle<HYDROData_PolylineXY> ()];
%MethodCode
Handle(HYDROData_PolylineXY) aRefPolyline;
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<HYDROData_StricklerTable>& )];
%MethodCode
Handle(HYDROData_StricklerTable) aRef =
Handle(HYDROData_StricklerTable)::DownCast( createHandle( a2 ) );
%End
bool Add( HYDROData_Object theObject, const QString& theType )
- [bool ( const Handle_HYDROData_Object&, const QString& )];
+ [bool ( const opencascade::handle<HYDROData_Object>&, const QString& )];
%MethodCode
Handle(HYDROData_Object) aRef =
Handle(HYDROData_Object)::DownCast( createHandle( a0 ) );
%End
bool Add( HYDROData_PolylineXY thePolyline, const QString& theType )
- [bool ( const Handle_HYDROData_PolylineXY&, const QString& )];
+ [bool ( const opencascade::handle<HYDROData_PolylineXY>&, const QString& )];
%MethodCode
Handle(HYDROData_PolylineXY) aRef =
Handle(HYDROData_PolylineXY)::DownCast( createHandle( a0 ) );
%End
bool Split( HYDROData_PolylineXY thePolyline )
- [bool ( const Handle_HYDROData_PolylineXY& )];
+ [bool ( const opencascade::handle<HYDROData_PolylineXY>& )];
%MethodCode
Handle(HYDROData_PolylineXY) aRef =
Handle(HYDROData_PolylineXY)::DownCast( createHandle( a0 ) );
/**
* 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<HYDROData_IAltitudeObject>&)];
%MethodCode
Handle(HYDROData_IAltitudeObject) aRefAltitude =
/**
* Returns reference altitude object of geometry object.
*/
- HYDROData_IAltitudeObject GetAltitudeObject() const [Handle_HYDROData_IAltitudeObject ()];
+ HYDROData_IAltitudeObject GetAltitudeObject() const [opencascade::handle<HYDROData_IAltitudeObject> ()];
%MethodCode
Handle(HYDROData_IAltitudeObject) aRefAltitude;
/**
* 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<HYDROData_ShapesGroup> ()];
%MethodCode
Handle(HYDROData_ShapesGroup) aRefGroup;
/**
* 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<HYDROData_ShapesGroup>&)];
%MethodCode
Handle(HYDROData_ShapesGroup) aRefGroup =
*/
bool SetPolylineXY( HYDROData_PolylineXY thePolyline,
const bool theIsUpdateProfile = true )
- [bool ( const Handle_HYDROData_PolylineXY&,
+ [bool ( const opencascade::handle<HYDROData_PolylineXY>&,
const bool = true )];
%MethodCode
Handle(HYDROData_PolylineXY) aRef =
* Returns reference x,y polyline object of 3D polyline.
*/
HYDROData_PolylineXY GetPolylineXY() const
- [Handle_HYDROData_PolylineXY ()];
+ [opencascade::handle<HYDROData_PolylineXY> ()];
%MethodCode
Handle(HYDROData_PolylineXY) aRef;
* Sets reference u,z profile object for 3D polyline.
*/
bool SetProfileUZ( HYDROData_ProfileUZ theProfile )
- [bool ( const Handle_HYDROData_ProfileUZ& )];
+ [bool ( const opencascade::handle<HYDROData_ProfileUZ>& )];
%MethodCode
Handle(HYDROData_ProfileUZ) aRef =
Handle(HYDROData_ProfileUZ)::DownCast( createHandle( a0 ) );
* Returns reference u,z profile object of 3D polyline.
*/
HYDROData_ProfileUZ GetProfileUZ() const
- [Handle_HYDROData_ProfileUZ ()];
+ [Hopencascade::handle<HYDROData_ProfileUZ> ()];
%MethodCode
Handle(HYDROData_ProfileUZ) aRef;
* Reimplemented to remove reference u,z profile.
*/
bool SetAltitudeObject( HYDROData_IAltitudeObject theAltitude )
- [bool ( const Handle_HYDROData_IAltitudeObject& )];
+ [bool ( const opencascade::handle<HYDROData_IAltitudeObject>& )];
%MethodCode
Handle(HYDROData_IAltitudeObject) aRef =
Handle(HYDROData_IAltitudeObject)::DownCast( createHandle( a0 ) );
* 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<HYDROData_ProfileUZ> ( const bool = true )];
%MethodCode
Handle(HYDROData_ProfileUZ) aRef;
/**
* 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<HYDROData_ProfileUZ>& )];
%MethodCode
Handle(HYDROData_ProfileUZ) aRef =
Handle(HYDROData_ProfileUZ)::DownCast( createHandle( a0 ) );
* \return profile U,Z
*/
HYDROData_ProfileUZ GetProfileUZ( const bool theIsCreate = true ) const
- [Handle_HYDROData_ProfileUZ ( const bool theIsCreate = true )];
+ [opencascade::handle<HYDROData_ProfileUZ> ( const bool theIsCreate = true )];
%MethodCode
Handle(HYDROData_ProfileUZ) aRefProfileUZ;
static int ImportFromFile( HYDROData_Document theDoc,
const TCollection_AsciiString& theFileName,
NCollection_Sequence<int>& theBadProfilesIds,
- bool isToProject = true )
- [int ( const Handle_HYDROData_Document&,
+ bool isToProject = true )
+ [int ( const opencascade::handle<HYDROData_Document>&,
const TCollection_AsciiString&,
NCollection_Sequence<int>& )];
%MethodCode
/**
* 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<HYDROData_Zone>&)];
%MethodCode
Handle(HYDROData_Zone) aZone =
/**
* Removes reference zone from region.
*/
- void RemoveZone( HYDROData_Zone theZone ) [void (const Handle_HYDROData_Zone&)];
+ void RemoveZone( HYDROData_Zone theZone ) [void (const opencascade::handle<HYDROData_Zone>&)];
%MethodCode
Handle(HYDROData_Zone) aZone =
#include <NCollection_Sequence.hxx>
%End
-%MappedType NCollection_Sequence<Handle_HYDROData_Entity>
+%MappedType NCollection_Sequence<opencascade::handle<HYDROData_Entity>>
{
%TypeHeaderCode
#include <NCollection_Sequence.hxx>
{
Py_DECREF(l);
{
- Handle_HYDROData_Entity anEnt( aPntr );
+ Handle(HYDROData_Entity) anEnt( aPntr );
}
return NULL;
return 1;
}
- NCollection_Sequence<Handle_HYDROData_Entity> *aSeq =
- new NCollection_Sequence<Handle_HYDROData_Entity>;
+ NCollection_Sequence<Handle(HYDROData_Entity)> *aSeq =
+ new NCollection_Sequence<Handle(HYDROData_Entity)>;
len = PySequence_Size(sipPy);
for (SIP_SSIZE_T i = 0; i < len; ++i)
return 0;
}
- Handle_HYDROData_Entity anEnt( t );
+ Handle(HYDROData_Entity) anEnt( t );
aSeq->Append( anEnt );
//sipReleaseType(t, sipType_HYDROData_Entity, state);
%End
};
-typedef NCollection_Sequence<Handle_HYDROData_Entity> HYDROData_SequenceOfObjects;
+typedef NCollection_Sequence<opencascade::handle<HYDROData_Entity>> HYDROData_SequenceOfObjects;
* Sets reference hydraulic axis object for stream.
*/
bool SetHydraulicAxis( HYDROData_PolylineXY theAxis )
- [bool ( const Handle_HYDROData_PolylineXY& )];
+ [bool ( const opencascade::handle<HYDROData_PolylineXY>& )];
%MethodCode
Handle(HYDROData_PolylineXY) aRef =
Handle(HYDROData_PolylineXY)::DownCast( createHandle( a0 ) );
* Returns reference hydraulic axis object of stream.
*/
HYDROData_PolylineXY GetHydraulicAxis() const
- [Handle_HYDROData_PolylineXY ()];
+ [opencascade::handle<HYDROData_PolylineXY> ()];
%MethodCode
Handle(HYDROData_PolylineXY) aRef;
* Add new one reference profile object for stream.
*/
bool AddProfile( HYDROData_Profile theProfile )
- [bool ( const Handle_HYDROData_Profile& )];
+ [bool ( const opencascade::handle<HYDROData_Profile>& )];
%MethodCode
Handle(HYDROData_Profile) aRef =
Handle(HYDROData_Profile)::DownCast( createHandle( a0 ) );
* Removes reference profile object from stream.
*/
bool RemoveProfile( HYDROData_Profile theProfile )
- [bool ( const Handle_HYDROData_Profile& )];
+ [bool ( const opencascade::handle<HYDROData_Profile>& )];
%MethodCode
Handle(HYDROData_Profile) aRef =
Handle(HYDROData_Profile)::DownCast( createHandle( a0 ) );
* Returns reference bottom polyline object of stream.
*/
HYDROData_Polyline3D GetBottomPolyline() const
- [Handle_HYDROData_Polyline3D ()];
+ [opencascade::handle<HYDROData_Polyline3D> ()];
%MethodCode
Handle(HYDROData_Polyline3D) aRef;
* Sets reference bottom polyline object for stream.
*/
bool SetBottomPolyline( HYDROData_Polyline3D theBottom )
- [bool ( const Handle_HYDROData_Polyline3D& )];
+ [bool ( const opencascade::handle<HYDROData_Polyline3D>& )];
%MethodCode
Handle(HYDROData_Polyline3D) aRef =
Handle(HYDROData_Polyline3D)::DownCast( createHandle( a0 ) );
MergeType GetMergeType() const;
void SetMergeAltitude( HYDROData_IAltitudeObject theAltitude )
- [void (const Handle_HYDROData_IAltitudeObject&)];
+ [void (const opencascade::handle<HYDROData_IAltitudeObject>&)];
%MethodCode
Handle(HYDROData_IAltitudeObject) aRefAltitude =
Handle(HYDROData_IAltitudeObject)::DownCast( createHandle( a0 ) );
}
%End
- HYDROData_IAltitudeObject GetMergeAltitude() const [Handle_HYDROData_IAltitudeObject ()];
+ HYDROData_IAltitudeObject GetMergeAltitude() const [opencascade::handle<HYDROData_IAltitudeObject> ()];
%MethodCode
Handle(HYDROData_IAltitudeObject) aRefAltitude;
Py_BEGIN_ALLOW_THREADS
Py_END_ALLOW_THREADS
%End
- void SetMergeObject( HYDROData_Entity theObject ) [void (const Handle_HYDROData_Entity&)];
+ void SetMergeObject( HYDROData_Entity theObject ) [void (const opencascade::handle<HYDROData_Entity>&)];
%MethodCode
- Handle(HYDROData_Entity) aRefObject =
- Handle(HYDROData_Entity)::DownCast( createHandle( a0 ) );
+ Handle(HYDROData_Entity) aRefObject = createHandle( a0 );
if ( !aRefObject.IsNull() )
{
Py_BEGIN_ALLOW_THREADS
}
%End
- HYDROData_Entity GetMergeObject() const [Handle_HYDROData_Entity ()];
+ HYDROData_Entity GetMergeObject() const [opencascade::handle<HYDROData_Entity> ()];
%MethodCode
Handle(HYDROData_Entity) aRefObject;
Py_BEGIN_ALLOW_THREADS
void RemoveMergeObject();
- void AddObject( HYDROData_Entity theObject ) [void (const Handle_HYDROData_Entity&)];
+ void AddObject( HYDROData_Entity theObject ) [void (const opencascade::handle<HYDROData_Entity>&)];
%MethodCode
- Handle(HYDROData_Entity) anObj =
- Handle(HYDROData_Entity)::DownCast( createHandle( a0 ) );
+ Handle(HYDROData_Entity) anObj = createHandle( a0 );
if ( !anObj.IsNull() )
{
Py_BEGIN_ALLOW_THREADS
print "value: ", vals, " reference: ", valsref
raise ValueError("z interpolation error")
-from MEDLoader import MEDLoader, MEDCouplingFieldDouble, ON_NODES, DataArrayDouble, MEDFileMesh
+import MEDLoader
+from MEDLoader import MEDCouplingFieldDouble, ON_NODES, DataArrayDouble, MEDFileMesh
import os, time
def controlTelemacResult(aMedFile, refs):
# -----------------------------------------------------------------------------
-from MEDLoader import MEDLoader, MEDCouplingFieldDouble, ON_NODES, DataArrayDouble, MEDFileMesh
+import MEDLoader
+from MEDLoader import MEDCouplingFieldDouble, ON_NODES, DataArrayDouble, MEDFileMesh
def createZfield2(fichierMaillage):
"""
+++ /dev/null
-// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-// File : Basics_OCCTVersion.hxx
-// Author : Julia DOROVSKIKH, Open CASCADE S.A.S (julia.dorovskikh@opencascade.com)
-
-#ifndef BASICS_OCCTVERSION_HXX
-#define BASICS_OCCTVERSION_HXX
-
-#include <Standard_Version.hxx>
-
-//
-// NOTE: Since version 6.7.0 OCC_VERSION_DEVELOPMENT macro in the Standard_Version.hxx
-// points to the development status of the OCCT version: for example "dev", "alpha",
-// "beta", "rc1", etc.
-// OCC_VERSION_MAJOR, OCC_VERSION_MINOR and OCC_VERSION_MAINTENANCE macros
-// specify actual (final) version number; for development version it is a future
-// target version number (i.e. version number is incremented immediately after
-// releasing of the stable version).
-//
-
-#ifdef OCC_VERSION_SERVICEPACK
-# define OCC_VERSION_LARGE (OCC_VERSION_MAJOR << 24 | OCC_VERSION_MINOR << 16 | OCC_VERSION_MAINTENANCE << 8 | OCC_VERSION_SERVICEPACK)
-#else
-# ifdef OCC_VERSION_DEVELOPMENT
-# define OCC_VERSION_LARGE ((OCC_VERSION_MAJOR << 24 | OCC_VERSION_MINOR << 16 | OCC_VERSION_MAINTENANCE << 8)-1)
-# else
-# define OCC_VERSION_LARGE (OCC_VERSION_MAJOR << 24 | OCC_VERSION_MINOR << 16 | OCC_VERSION_MAINTENANCE << 8)
-# endif
-#endif
-
-#endif // BASICS_OCCTVERSION_HXX
SET( CPPUNIT_INCLUDES $ENV{CPPUNIT_ROOT}/include )
SET( CAS_INCLUDES $ENV{CASROOT}/inc )
-SET( QT_INCLUDES $ENV{QTDIR}/include $ENV{QTDIR}/include/QtCore $ENV{QTDIR}/include/QtGui $ENV{QTDIR}/include/QtTest )
+SET( QT_INCLUDES $ENV{QT5_ROOT_DIR}/include $ENV{QT5_ROOT_DIR}/include/QtCore $ENV{QT5_ROOT_DIR}/include/QtGui $ENV{QT5_ROOT_DIR}/include/QtTest )
SET( KERNEL_INCLUDES $ENV{KERNEL_ROOT_DIR}/include/salome )
SET( GUI_INCLUDES $ENV{GUI_ROOT_DIR}/include/salome )
SET( GEOM_INCLUDES $ENV{GEOM_ROOT_DIR}/include/salome )
IF( ${WIN32} )
link_directories( $ENV{CASROOT}/win32/libd )
ELSE()
- link_directories( $ENV{CASROOT}/lib )
+ link_directories( $ENV{CASROOT}/lib $ENV{TBB_ROOT_DIR}/lib/intel64/gcc4.4 )
ENDIF()
SET( CAS_LIBRARIES TKernel TKLCAF TKCAF TKCDF TKMath TKG2d TKG3d TKBRep TKGeomBase TKTopAlgo TKGeomAlgo TKBool TKShHealing TKXSBase TKOffset TKHLR TKBO TKV3d TKService TKMesh )
-link_directories( $ENV{QTDIR}/lib )
+link_directories( $ENV{QT5_ROOT_DIR}/lib )
IF( ${WIN32} )
SET( QT_LIBRARIES QtCored4 QtGuid4 QtTestd4 )
ELSE()
-find_package(Qt4 4.8.4 REQUIRED QtCore QtGui )
+find_package( Qt5Core )
+find_package( Qt5Widgets )
set( EXTERNAL_FILES
../HYDROData/HYDROData_AltitudeObject.cxx
../HYDROGUI/HYDROGUI_OrderedListWidget.h
)
-QT4_WRAP_CPP( PROJECT_MOC_HEADERS ${MOC_HEADERS} )
+QT_WRAP_MOC( PROJECT_MOC_HEADERS ${MOC_HEADERS} )
#ifdef WIN32
#pragma warning ( disable: 4251 )
#endif
-#include <AIS_InteractiveContext.hxx>
#include <AIS_Shape.hxx>
-#include <Aspect_ColorScale.hxx>
+#include <AIS_ColorScale.hxx>
#include <Prs3d_PointAspect.hxx>
#include <TopoDS_Iterator.hxx>
#include <QDir>
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;
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 );
}
}
bool TestViewer::ColorScaleIsDisplayed()
{
- Handle(V3d_View) aView = myViewWindow->getViewPort()->getView();
- if( aView.IsNull() )
- return false;
- return aView->ColorScaleIsDisplayed();
+ return context()->IsDisplayed( colorScale() );
}
void TestViewer::select( int theViewX, int theViewY )
#pragma once
+#include <AIS_InteractiveContext.hxx>
+
class OCCViewer_ViewManager;
class OCCViewer_Viewer;
class OCCViewer_ViewWindow;
class QString;
class QColor;
class QImage;
-class Handle_AIS_InteractiveContext;
-class Handle_AIS_InteractiveObject;
-class Handle_Aspect_ColorScale;
+class AIS_InteractiveObject;
+class AIS_ColorScale;
class TestViewer
{
static OCCViewer_ViewManager* viewManager();
static OCCViewer_Viewer* viewer();
static OCCViewer_ViewWindow* viewWindow();
- static Handle_AIS_InteractiveContext context();
+ static Handle(AIS_InteractiveContext) context();
static void eraseAll( bool isUpdate );
- static void show( const Handle_AIS_InteractiveObject& theObject,
+ static void show( const Handle(AIS_InteractiveObject)& theObject,
int theMode, int theSelectionMode, bool isFitAll, const char* theKey );
static void show( const TopoDS_Shape& theShape, int theMode, bool isFitAll, const QColor& theColor,
int theUIANb = 10, int theVIANb = 10);
static bool AssertImages( QString& theMessage, const QImage* = 0, const char* theCase = 0 );
static QColor GetColor(int i);
- static Handle_Aspect_ColorScale colorScale();
+ static Handle(AIS_ColorScale) colorScale();
static void showColorScale( bool );
static bool ColorScaleIsDisplayed();
#include <cppunit/extensions/HelperMacros.h>
-class Handle_HYDROData_Bathymetry;
class QString;
class test_HYDROData_Bathymetry : public CppUnit::TestFixture {
#include <TestShape.h>
#include <TopTools_ListOfShape.hxx>
#include <AIS_DisplayMode.hxx>
-#include <Aspect_ColorScale.hxx>
#include <QString>
#include <QColor>
#include <BRep_Builder.hxx>
#include <AIS_InteractiveContext.hxx>
#include <AIS_PointCloud.hxx>
#include <HYDROGUI_ShapeBathymetry.h>
-#include <Aspect_ColorScale.hxx>
+#include <AIS_ColorScale.hxx>
#include <QGraphicsItem>
#include <QGraphicsScene>
#include <QGraphicsView>
profiles.push_back( aProfile2 );
profiles.push_back( aProfile3 );
- Handle_Geom2d_BSplineCurve HA = HYDROData_DTM::CreateHydraulicAxis( profiles, distances );
+ Handle(Geom2d_BSplineCurve) HA = HYDROData_DTM::CreateHydraulicAxis( profiles, distances );
CPPUNIT_ASSERT_EQUAL( false, (bool)HA.IsNull() );
CPPUNIT_ASSERT_EQUAL( 3, (int)distances.size() );
aUMin2 = aUMin1,
aUMax2 = aUMax1;
gp_Vec2d aProfileDir;
- std::vector<Handle_Geom2d_Curve> curves1 = HYDROData_DTM::ProfileToParametric( aProfile1, aUMin1, aUMax1, aProfileDir );
- std::vector<Handle_Geom2d_Curve> curves2 = HYDROData_DTM::ProfileToParametric( aProfile2, aUMin2, aUMax2, aProfileDir );
+ std::vector<Handle(Geom2d_Curve)> curves1 = HYDROData_DTM::ProfileToParametric( aProfile1, aUMin1, aUMax1, aProfileDir );
+ std::vector<Handle(Geom2d_Curve)> curves2 = HYDROData_DTM::ProfileToParametric( aProfile2, aUMin2, aUMax2, aProfileDir );
gp_Pnt2d aFirst, aLast;
CPPUNIT_ASSERT_EQUAL( 3, (int)curves1.size() );
profiles.push_back( aProfile1 );
profiles.push_back( aProfile2 );
- Handle_Geom2d_BSplineCurve HA = HYDROData_DTM::CreateHydraulicAxis( profiles, distances );
+ Handle(Geom2d_BSplineCurve) HA = HYDROData_DTM::CreateHydraulicAxis( profiles, distances );
HYDROData_DTM::AltitudePoints points;
HYDROData_DTM::CurveUZ mid( 5.0, gp_Vec2d(-10,10), 0 );
mid.push_back( HYDROData_DTM::PointUZ( 0, 5 ) );
CPPUNIT_ASSERT_EQUAL( 9177, (int)DTM->GetAltitudePoints().size() );
- Handle_AIS_InteractiveContext aContext = TestViewer::context();
+ Handle(AIS_InteractiveContext) aContext = TestViewer::context();
HYDROGUI_ShapeBathymetry* aBathPrs = new HYDROGUI_ShapeBathymetry( 0, aContext, DTM );
aBathPrs->update( true, false );
bool ColorScaleIsDisp = TestViewer::ColorScaleIsDisplayed();
TestViewer::showColorScale( true );
- Handle_Aspect_ColorScale aCS = TestViewer::colorScale();
+ Handle(AIS_ColorScale) aCS = TestViewer::colorScale();
aCS->SetMin( 0.0 );
aCS->SetMax( 5.0 );
aCS->SetNumberOfIntervals( 10 );
CPPUNIT_ASSERT_EQUAL( 282338, (int)DTM->GetAltitudePoints().size() );
- Handle_AIS_InteractiveContext aContext = TestViewer::context();
+ Handle(AIS_InteractiveContext) aContext = TestViewer::context();
HYDROGUI_ShapeBathymetry* aBathPrs = new HYDROGUI_ShapeBathymetry( 0, aContext, DTM );
aBathPrs->update( true, false );
bool ColorScaleIsDisp = TestViewer::ColorScaleIsDisplayed();
TestViewer::showColorScale( true );
- Handle_Aspect_ColorScale aCS = TestViewer::colorScale();
+ Handle(AIS_ColorScale) aCS = TestViewer::colorScale();
aCS->SetMin( 0.0 );
aCS->SetMax( 25.0 );
aCS->SetNumberOfIntervals( 30 );
{
TCollection_AsciiString fname = REF_DATA_PATH.toLatin1().data();
fname += "/pb_1066.cbf";
- CPPUNIT_ASSERT_EQUAL( DocError_OK, HYDROData_Document::Load( fname.ToCString(), 1 ) );
+ CPPUNIT_ASSERT_EQUAL( (int)DocError_OK, (int)HYDROData_Document::Load( fname.ToCString(), 1 ) );
Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1);
Handle(HYDROData_CalculationCase) aCase =
Handle(HYDROData_CalculationCase)::DownCast( aDoc->FindObjectByName( "Case_1" ) );
- CPPUNIT_ASSERT_EQUAL( Standard_False, aCase.IsNull() );
+ CPPUNIT_ASSERT_EQUAL( false, aCase.IsNull() );
std::vector<gp_XY> points;
points.push_back( gp_XY( 43.4842, 3.33176 ) );
points.push_back( gp_XY( -125.777, 2.24728 ) );
#include <TestShape.h>
#include <TopTools_ListOfShape.hxx>
#include <AIS_DisplayMode.hxx>
-#include <Aspect_ColorScale.hxx>
#include <BRepMesh_IncrementalMesh.hxx>
#include <QString>
#include <QColor>
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;
#include <cppunit/extensions/HelperMacros.h>
-class Handle_HYDROData_Profile;
class QString;
class test_HYDROData_Profile : public CppUnit::TestFixture {
Handle(HYDROData_Stream) aStream =
Handle(HYDROData_Stream)::DownCast( aDoc->CreateObject( KIND_STREAM ) );
- Handle(HYDROData_DTM) aDTM =
- Handle(HYDROData_DTM)::DownCast( aStream->DTM() );
+ Handle(HYDROData_DTM) aDTM = aStream->DTM();
CPPUNIT_ASSERT_EQUAL( false, (bool)aDTM.IsNull() );
Handle(HYDROData_Profile) aProfile1 =
#include <HYDROData_Document.h>
#include <HYDROGUI_ListModel.h>
-Handle_HYDROData_Document GetDocument()
+Handle(HYDROData_Document) GetDocument()
{
return HYDROData_Document::Document( 0 );
}
for( int i=0; i<theObjCount; i++ )
{
- Handle_HYDROData_Entity anObj = GetDocument()->CreateObject( KIND_IMMERSIBLE_ZONE );
+ Handle(HYDROData_Entity) anObj = GetDocument()->CreateObject( KIND_IMMERSIBLE_ZONE );
std::string aName = " ";
aName[0] = 'A' + i;
aRes = aModel->move( QList<int>() << 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
+}
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, "" );