HYDROData_BSplineOperation.h
HYDROData_CalculationCase.h
HYDROData_Channel.h
+ HYDROData_ChannelAltitude.h
HYDROData_Confluence.h
HYDROData_Digue.h
HYDROData_Document.h
HYDROData_BSplineOperation.cxx
HYDROData_CalculationCase.cxx
HYDROData_Channel.cxx
+ HYDROData_ChannelAltitude.cxx
HYDROData_Confluence.cxx
HYDROData_Digue.cxx
HYDROData_Document.cxx
#include <QStringList>
+#define _DEVDEBUG_
+#include "HYDRO_trace.hxx"
+
IMPLEMENT_STANDARD_HANDLE(HYDROData_AltitudeObject, HYDROData_IAltitudeObject)
IMPLEMENT_STANDARD_RTTIEXT(HYDROData_AltitudeObject, HYDROData_IAltitudeObject)
double HYDROData_AltitudeObject::GetAltitudeForPoint( const gp_XY& thePoint ) const
{
+ DEBTRACE("HYDROData_AltitudeObject::GetAltitudeForPoint");
double aResAltitude = GetInvalidAltitude();
return aResAltitude;
double HYDROData_Bathymetry::GetAltitudeForPoint(const gp_XY& thePoint) const
{
- //DEBTRACE("GetAltitudeForPoint p(" << thePoint.X() << ", " << thePoint.Y() << ")");
+ DEBTRACE("GetAltitudeForPoint p(" << thePoint.X() << ", " << thePoint.Y() << ")");
double anInvalidAltitude = GetInvalidAltitude();
double aResAltitude = anInvalidAltitude;
const HYDROData_SplitToZonesTool::SplitDataList& theZones,
const bool theLandCover )
{
+ DEBTRACE("HYDROData_CalculationCase::CreateRegionsAuto");
QMap<QString, Handle(HYDROData_Region)> aRegionsMap; //object name to region
QMap<QString, QString> aRegionNameToObjNameMap;
QString aZonesPref = theLandCover ? CALCULATION_LANDCOVER_ZONES_PREF : CALCULATION_ZONES_PREF;
if ( !theLandCover ) {
Handle(HYDROData_Object) aMergeObject = Handle(HYDROData_Object)::DownCast( aMergeEntity );
if ( !aMergeObject.IsNull() ) {
+ DEBTRACE("aMergeEntity " << aMergeEntity->GetName().toStdString());
aMergeEntity = aMergeObject->GetAltitudeObject();
}
}
//DEBTRACE("GetAltitudeForPoint Zone " << theZone->GetName().toStdString());
double aResAltitude = HYDROData_IAltitudeObject::GetInvalidAltitude();
if ( theZone.IsNull() )
+ {
+ DEBTRACE("Zone nulle");
return aResAltitude;
+ }
HYDROData_Zone::MergeType aZoneMergeType = theZone->GetMergeType();
+ DEBTRACE("aZoneMergeType " << aZoneMergeType);
if ( !theZone->IsMergingNeed() )
{
aZoneMergeType = HYDROData_Zone::Merge_UNKNOWN;
+ DEBTRACE("---");
}
else if ( aZoneMergeType == HYDROData_Zone::Merge_UNKNOWN )
{
+ DEBTRACE("GetAltitudeForPoint Zone " << theZone->GetName().toStdString() << " Merge_UNKNOWN");
return aResAltitude;
}
{
if ( aZoneInterpolator != NULL )
{
+ DEBTRACE("aZoneInterpolator != NULL");
aZoneInterpolator->SetAltitudeObject( aMergeAltitude );
aResAltitude = aZoneInterpolator->GetAltitudeForPoint( thePoint );
}
else
+ {
+ DEBTRACE("aZoneInterpolator == NULL");
aResAltitude = aMergeAltitude->GetAltitudeForPoint( thePoint );
+ }
}
}
else
{
+ DEBTRACE("aZoneMergeType != HYDROData_Zone::Merge_Object");
HYDROData_SequenceOfObjects aZoneObjects = theZone->GetObjects();
HYDROData_SequenceOfObjects::Iterator anIter( aZoneObjects );
for ( ; anIter.More(); anIter.Next() )
double aPointAltitude = 0.0;
if ( aZoneInterpolator != NULL )
{
+ DEBTRACE("aZoneInterpolator != NULL");
aZoneInterpolator->SetAltitudeObject( anObjAltitude );
aPointAltitude = aZoneInterpolator->GetAltitudeForPoint( thePoint );
}
else
+ {
+ DEBTRACE("aZoneInterpolator == NULL");
aPointAltitude = anObjAltitude->GetAltitudeForPoint( thePoint );
+ }
if ( ValuesEquals( aPointAltitude, HYDROData_IAltitudeObject::GetInvalidAltitude() ) )
continue;
#include <QColor>
#include <QStringList>
+#define _DEVDEBUG_
+#include "HYDRO_trace.hxx"
+
IMPLEMENT_STANDARD_HANDLE(HYDROData_Channel,HYDROData_ArtificialObject)
IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Channel,HYDROData_ArtificialObject)
ObjectKind HYDROData_Channel::getAltitudeObjectType() const
{
- return KIND_OBSTACLE_ALTITUDE;
+ DEBTRACE("HYDROData_Channel::getAltitudeObjectType");
+ return KIND_CHANNEL_ALTITUDE;
}
--- /dev/null
+// Copyright (C) 2014-2015 EDF-R&D
+// 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
+//
+
+#include "HYDROData_ChannelAltitude.h"
+
+#include "HYDROData_Document.h"
+#include "HYDROData_Object.h"
+#include "HYDROData_Projection.h"
+
+#define _DEVDEBUG_
+#include "HYDRO_trace.hxx"
+#include <QString>
+
+#include <Precision.hxx>
+
+#include <TopoDS_Shape.hxx>
+#include <BRepTools.hxx>
+
+IMPLEMENT_STANDARD_HANDLE(HYDROData_ChannelAltitude, HYDROData_IAltitudeObject)
+IMPLEMENT_STANDARD_RTTIEXT(HYDROData_ChannelAltitude, HYDROData_IAltitudeObject)
+
+HYDROData_ChannelAltitude::HYDROData_ChannelAltitude()
+: HYDROData_IAltitudeObject()
+{
+}
+
+HYDROData_ChannelAltitude::~HYDROData_ChannelAltitude()
+{
+}
+
+double HYDROData_ChannelAltitude::GetAltitudeForPoint( const gp_XY& thePoint ) const
+{
+ DEBTRACE("HYDROData_ChannelAltitude::GetAltitudeForPoint");
+ double aResAltitude = GetInvalidAltitude();
+
+ Handle(HYDROData_Object) anObject =
+ Handle(HYDROData_Object)::DownCast( GetFatherObject() );
+ if ( anObject.IsNull() )
+ {
+ DEBTRACE("---");
+ return aResAltitude;
+ }
+
+ TopoDS_Shape anObjectShape3D = anObject->GetShape3D();
+ DEBTRACE("object: " << anObject->GetName().toStdString());
+ if ( anObjectShape3D.IsNull() )
+ {
+ DEBTRACE("---");
+ return aResAltitude;
+ }
+ else
+ {
+ DEBTRACE("anObjectShape3D type " << anObjectShape3D.ShapeType());
+ BRepTools::Write(anObjectShape3D, "digue3D.brep");
+ }
+
+ HYDROData_Make3dMesh aMesher3D( anObjectShape3D, Precision::Intersection() );
+
+ gp_Pnt aHighestPoint;
+ if ( aMesher3D.GetHighestOriginal( thePoint.X(), thePoint.Y(), aHighestPoint ) )
+ aResAltitude = aHighestPoint.Z();
+ DEBTRACE("aResAltitude=" << aResAltitude);
+ return aResAltitude;
+}
+
+
+
+
--- /dev/null
+// Copyright (C) 2014-2015 EDF-R&D
+// 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
+//
+
+#ifndef HYDROData_ChannelAltitude_HeaderFile
+#define HYDROData_ChannelAltitude_HeaderFile
+
+
+#include "HYDROData_IAltitudeObject.h"
+
+#define _DEVDEBUG_
+#include "HYDRO_trace.hxx"
+
+
+DEFINE_STANDARD_HANDLE(HYDROData_ChannelAltitude, HYDROData_IAltitudeObject)
+
+
+/**\class HYDROData_ChannelAltitude
+ * \brief Class that stores/retrieves information about the Channel altitude.
+ *
+ */
+class HYDROData_ChannelAltitude : public HYDROData_IAltitudeObject
+{
+protected:
+
+ /**
+ * Enumeration of tags corresponding to the persistent object parameters.
+ */
+ enum DataTag
+ {
+ DataTag_First = HYDROData_IAltitudeObject::DataTag_First + 100, ///< first tag, to reserve
+ };
+
+public:
+
+ DEFINE_STANDARD_RTTI(HYDROData_ChannelAltitude);
+
+ /**
+ * Returns the kind of this object.
+ */
+ HYDRODATA_EXPORT virtual const ObjectKind GetKind() const { DEBTRACE("GetKind"); return KIND_CHANNEL_ALTITUDE; }
+
+public:
+
+ // Public methods to work with altitudes.
+
+ /**
+ * Returns altitude for given point.
+ * \param thePoint the point to examine
+ * \return altitude value
+ */
+ HYDRODATA_EXPORT virtual double GetAltitudeForPoint( const gp_XY& thePoint ) const;
+
+protected:
+
+ friend class HYDROData_Iterator;
+
+ /**
+ * Creates new object in the internal data structure. Use higher level objects
+ * to create objects with real content.
+ */
+ HYDRODATA_EXPORT HYDROData_ChannelAltitude();
+
+ /**
+ * Destructs properties of the object and object itself, removes it from the document.
+ */
+ HYDRODATA_EXPORT ~HYDROData_ChannelAltitude();
+};
+
+#endif
#include <QStringList>
#include <QVariant>
+#define _DEVDEBUG_
+#include "HYDRO_trace.hxx"
+
static const Standard_GUID GUID_MUST_BE_UPDATED("80f2bb81-3873-4631-8ddd-940d2119f000");
IMPLEMENT_STANDARD_HANDLE(HYDROData_Entity,MMgt_TShared)
QString HYDROData_Entity::getPyTypeID() const
{
+ DEBTRACE("HYDROData_Entity::getPyTypeID " << GetKind());
switch( GetKind() )
{
case KIND_IMAGE: return "KIND_IMAGE";
case KIND_OBSTACLE_ALTITUDE: return "KIND_OBSTACLE_ALTITUDE";
case KIND_STRICKLER_TABLE: return "KIND_STRICKLER_TABLE";
case KIND_LAND_COVER: return "KIND_LAND_COVER";
+ case KIND_CHANNEL_ALTITUDE: return "KIND_CHANNEL_ALTITUDE";
default: return "KIND_UNKNOWN"; ///! Unrecognized object
}
}
const ObjectKind KIND_OBSTACLE_ALTITUDE = 25;
const ObjectKind KIND_STRICKLER_TABLE = 26;
const ObjectKind KIND_LAND_COVER = 27;
-const ObjectKind KIND_LAST = KIND_LAND_COVER;
+const ObjectKind KIND_CHANNEL_ALTITUDE = 28;
+const ObjectKind KIND_LAST = KIND_CHANNEL_ALTITUDE;
DEFINE_STANDARD_HANDLE(HYDROData_Entity, MMgt_TShared)
#include <gp_XY.hxx>
+#define _DEVDEBUG_
+#include "HYDRO_trace.hxx"
+
HYDROData_IInterpolator::HYDROData_IInterpolator()
{
}
double HYDROData_IInterpolator::GetAltitudeForPoint(
const double theCoordX, const double theCoordY ) const
{
+ DEBTRACE("HYDROData_IInterpolator::GetAltitudeForPoint");
return myAltitudeObject.IsNull() ? HYDROData_IAltitudeObject::GetInvalidAltitude() :
myAltitudeObject->GetAltitudeForPoint( gp_XY( theCoordX, theCoordY ) );
}
double HYDROData_IInterpolator::GetAltitudeForPoint( const gp_XY& thePoint ) const
{
+ DEBTRACE("HYDROData_IInterpolator::GetAltitudeForPoint");
return GetAltitudeForPoint( thePoint.X(), thePoint.Y() );
-}
\ No newline at end of file
+}
#include "HYDROData_ImmersibleZone.h"
#include "HYDROData_Obstacle.h"
#include "HYDROData_ObstacleAltitude.h"
+#include "HYDROData_ChannelAltitude.h"
#include "HYDROData_Polyline3D.h"
#include "HYDROData_PolylineXY.h"
#include "HYDROData_Profile.h"
#include <NCollection_DataMap.hxx>
+#define _DEVDEBUG_
+#include "HYDRO_trace.hxx"
+
//! Returns label by root objects kind and the kind of the object
static TDF_Label GetLabelByKind(TDF_Label theRoot, ObjectKind theKind)
{
switch( aKind )
{
+ DEBTRACE("HYDROData_Iterator::Object " << aKind);
case KIND_IMAGE: aResult = new HYDROData_Image(); break;
case KIND_POLYLINE: aResult = new HYDROData_Polyline3D(); break;
case KIND_BATHYMETRY: aResult = new HYDROData_Bathymetry(); break;
case KIND_OBSTACLE_ALTITUDE: aResult = new HYDROData_ObstacleAltitude(); break;
case KIND_STRICKLER_TABLE: aResult = new HYDROData_StricklerTable(); break;
case KIND_LAND_COVER: aResult = new HYDROData_LandCover(); break;
+ case KIND_CHANNEL_ALTITUDE: aResult = new HYDROData_ChannelAltitude(); break;
default: break;
}
#include <QColor>
+#define _DEVDEBUG_
+#include "HYDRO_trace.hxx"
+
IMPLEMENT_STANDARD_HANDLE(HYDROData_Object,HYDROData_Entity)
IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Object,HYDROData_Entity)
Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( myLab );
ObjectKind anAltitudeObjectType = getAltitudeObjectType();
+ DEBTRACE("HYDROData_Object::checkAndSetAltitudeObject anAltitudeObjectType="<< anAltitudeObjectType);
if ( anAltitudeObjectType == KIND_UNKNOWN )
return; // No need to create altitude object
HYDROData_Iterator::CreateObject( aChildLabel, anAltitudeObjectType ) );
QString anAltitudePref = GetName() + "_Altitude";
+ DEBTRACE("anAltitudePref " << anAltitudePref.toStdString());
QString anAltitudeName = HYDROData_Tool::GenerateObjectName( aDocument, anAltitudePref );
anAltitudeObject->SetName( anAltitudeName );
#include <HYDROData_Projection.h>
+#define _DEVDEBUG_
+#include "HYDRO_trace.hxx"
+
IMPLEMENT_STANDARD_HANDLE(HYDROData_Obstacle,HYDROData_ArtificialObject)
IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Obstacle,HYDROData_ArtificialObject)
ObjectKind HYDROData_Obstacle::getAltitudeObjectType() const
{
+ DEBTRACE("HYDROData_Obstacle::getAltitudeObjectType");
return KIND_OBSTACLE_ALTITUDE;
}
#include "HYDROData_Object.h"
#include "HYDROData_Projection.h"
+#define _DEVDEBUG_
+#include "HYDRO_trace.hxx"
+#include <QString>
+
#include <Precision.hxx>
#include <TopoDS_Shape.hxx>
+#include <BRepTools.hxx>
IMPLEMENT_STANDARD_HANDLE(HYDROData_ObstacleAltitude, HYDROData_IAltitudeObject)
IMPLEMENT_STANDARD_RTTIEXT(HYDROData_ObstacleAltitude, HYDROData_IAltitudeObject)
double HYDROData_ObstacleAltitude::GetAltitudeForPoint( const gp_XY& thePoint ) const
{
+ DEBTRACE("HYDROData_ObstacleAltitude::GetAltitudeForPoint");
double aResAltitude = GetInvalidAltitude();
Handle(HYDROData_Object) anObject =
Handle(HYDROData_Object)::DownCast( GetFatherObject() );
if ( anObject.IsNull() )
+ {
+ DEBTRACE("---");
return aResAltitude;
+ }
TopoDS_Shape anObjectShape3D = anObject->GetShape3D();
+ DEBTRACE("object: " << anObject->GetName().toStdString());
if ( anObjectShape3D.IsNull() )
+ {
+ DEBTRACE("---");
return aResAltitude;
+ }
+ else
+ {
+ DEBTRACE("anObjectShape3D type " << anObjectShape3D.ShapeType());
+ BRepTools::Write(anObjectShape3D, "digue3D.brep");
+ }
HYDROData_Make3dMesh aMesher3D( anObjectShape3D, Precision::Intersection() );
gp_Pnt aHighestPoint;
if ( aMesher3D.GetHighestOriginal( thePoint.X(), thePoint.Y(), aHighestPoint ) )
aResAltitude = aHighestPoint.Z();
-
+ DEBTRACE("aResAltitude=" << aResAltitude);
return aResAltitude;
}
#include "HYDROData_IAltitudeObject.h"
+#define _DEVDEBUG_
+#include "HYDRO_trace.hxx"
+
DEFINE_STANDARD_HANDLE(HYDROData_ObstacleAltitude, HYDROData_IAltitudeObject)
/**
* Returns the kind of this object.
*/
- HYDRODATA_EXPORT virtual const ObjectKind GetKind() const { return KIND_OBSTACLE_ALTITUDE; }
+ HYDRODATA_EXPORT virtual const ObjectKind GetKind() const { DEBTRACE("HYDROData_ObstacleAltitude::GetKind"); return KIND_OBSTACLE_ALTITUDE; }
public:
#include <QStringList>
+#define _DEVDEBUG_
+#include "HYDRO_trace.hxx"
+
#ifdef DEB_CLASS2D
#include <BRepTools.hxx>
#include <BRep_Builder.hxx>
double HYDROData_StreamAltitude::GetAltitudeForPoint( const gp_XY& thePoint ) const
{
+ DEBTRACE("GetAltitudeForPoint p(" << thePoint.X() << ", " << thePoint.Y() << ")");
double aResAltitude = GetInvalidAltitude();
Handle(HYDROData_Stream) aStream =
Handle(HYDROData_Stream)::DownCast( GetFatherObject() );
if ( aStream.IsNull() )
+ {
+ DEBTRACE("---");
return aResAltitude;
+ }
TopoDS_Shape aStreamShape = aStream->GetTopShape();
if ( aStreamShape.IsNull() )
+ {
+ DEBTRACE("---");
return aResAltitude;
+ }
TopExp_Explorer aStreamFaceExp( aStreamShape, TopAbs_FACE );
if ( !aStreamFaceExp.More() )
+ {
+ DEBTRACE("---");
return aResAltitude;
+ }
// Get only face because of 2d profile wires is in compound
TopoDS_Face aStreamFace = TopoDS::Face( aStreamFaceExp.Current() );
BRepTools::Write(aCmp, "FCL2d.brep");
#endif
if ( aPointState == TopAbs_OUT )
+ {
+ DEBTRACE("---");
return aResAltitude;
+ }
// Find the two profiles between which the point is lies
Handle(HYDROData_Profile) aLeftProfile, aRightProfile;
if ( !getBoundaryProfilesForPoint( thePoint, aLeftProfile, aRightProfile ) )
+ {
+ DEBTRACE("---");
return aResAltitude;
+ }
// Find the projections of point to borders of stream
gp_XYZ aPointToTest( thePoint.X(), thePoint.Y(), 0.0 );
Standard_Real aSecCoeff = aRightProfileDist / ( aLeftProfileDist + aRightProfileDist );
aResAltitude = aLeftAlt * ( 1 - aFirstCoeff ) + aRightAlt * ( 1 - aSecCoeff );
-
+ DEBTRACE("aResAltitude=" << aResAltitude);
return aResAltitude;
}
#include <TDataStd_Integer.hxx>
+#define _DEVDEBUG_
+#include "HYDRO_trace.hxx"
+
IMPLEMENT_STANDARD_HANDLE(HYDROData_Zone, HYDROData_Entity)
IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Zone, HYDROData_Entity)
void HYDROData_Zone::SetMergeObject( const Handle(HYDROData_Entity)& theObject )
{
+ DEBTRACE("HYDROData_Zone::SetMergeObject");
SetReferenceObject( theObject, DataTag_MergeObject );
}