From: Paul RASCLE Date: Mon, 3 Aug 2015 14:38:09 +0000 (+0200) Subject: specific altitude object for channel and embankment X-Git-Tag: BR_quadtree_20150925~13 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=13dcd7edcf93135429fce003da064297775ac11d;p=modules%2Fhydro.git specific altitude object for channel and embankment --- diff --git a/src/HYDROData/CMakeLists.txt b/src/HYDROData/CMakeLists.txt index 81348916..4ce848b2 100644 --- a/src/HYDROData/CMakeLists.txt +++ b/src/HYDROData/CMakeLists.txt @@ -10,6 +10,7 @@ set(PROJECT_HEADERS HYDROData_BSplineOperation.h HYDROData_CalculationCase.h HYDROData_Channel.h + HYDROData_ChannelAltitude.h HYDROData_Confluence.h HYDROData_Digue.h HYDROData_Document.h @@ -72,6 +73,7 @@ set(PROJECT_SOURCES HYDROData_BSplineOperation.cxx HYDROData_CalculationCase.cxx HYDROData_Channel.cxx + HYDROData_ChannelAltitude.cxx HYDROData_Confluence.cxx HYDROData_Digue.cxx HYDROData_Document.cxx diff --git a/src/HYDROData/HYDROData_AltitudeObject.cxx b/src/HYDROData/HYDROData_AltitudeObject.cxx index deac2dc0..5c4edcb8 100644 --- a/src/HYDROData/HYDROData_AltitudeObject.cxx +++ b/src/HYDROData/HYDROData_AltitudeObject.cxx @@ -21,6 +21,9 @@ #include +#define _DEVDEBUG_ +#include "HYDRO_trace.hxx" + IMPLEMENT_STANDARD_HANDLE(HYDROData_AltitudeObject, HYDROData_IAltitudeObject) IMPLEMENT_STANDARD_RTTIEXT(HYDROData_AltitudeObject, HYDROData_IAltitudeObject) @@ -49,6 +52,7 @@ QStringList HYDROData_AltitudeObject::DumpToPython( MapOfTreatedObjects& theTrea double HYDROData_AltitudeObject::GetAltitudeForPoint( const gp_XY& thePoint ) const { + DEBTRACE("HYDROData_AltitudeObject::GetAltitudeForPoint"); double aResAltitude = GetInvalidAltitude(); return aResAltitude; diff --git a/src/HYDROData/HYDROData_Bathymetry.cxx b/src/HYDROData/HYDROData_Bathymetry.cxx index 7f51fe97..8a5958a1 100644 --- a/src/HYDROData/HYDROData_Bathymetry.cxx +++ b/src/HYDROData/HYDROData_Bathymetry.cxx @@ -252,7 +252,7 @@ void interpolateAltitudeForPoints( const gp_XY& th 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; diff --git a/src/HYDROData/HYDROData_CalculationCase.cxx b/src/HYDROData/HYDROData_CalculationCase.cxx index 8814d9aa..c59b01e3 100644 --- a/src/HYDROData/HYDROData_CalculationCase.cxx +++ b/src/HYDROData/HYDROData_CalculationCase.cxx @@ -376,6 +376,7 @@ void HYDROData_CalculationCase::CreateRegionsAuto( const Handle(HYDROData_Docume const HYDROData_SplitToZonesTool::SplitDataList& theZones, const bool theLandCover ) { + DEBTRACE("HYDROData_CalculationCase::CreateRegionsAuto"); QMap aRegionsMap; //object name to region QMap aRegionNameToObjNameMap; QString aZonesPref = theLandCover ? CALCULATION_LANDCOVER_ZONES_PREF : CALCULATION_ZONES_PREF; @@ -419,6 +420,7 @@ void HYDROData_CalculationCase::CreateRegionsAuto( const Handle(HYDROData_Docume if ( !theLandCover ) { Handle(HYDROData_Object) aMergeObject = Handle(HYDROData_Object)::DownCast( aMergeEntity ); if ( !aMergeObject.IsNull() ) { + DEBTRACE("aMergeEntity " << aMergeEntity->GetName().toStdString()); aMergeEntity = aMergeObject->GetAltitudeObject(); } } @@ -822,15 +824,21 @@ double HYDROData_CalculationCase::GetAltitudeForPoint( const gp_XY& //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; } @@ -843,15 +851,20 @@ double HYDROData_CalculationCase::GetAltitudeForPoint( const gp_XY& { 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() ) @@ -868,11 +881,15 @@ double HYDROData_CalculationCase::GetAltitudeForPoint( const gp_XY& 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; diff --git a/src/HYDROData/HYDROData_Channel.cxx b/src/HYDROData/HYDROData_Channel.cxx index 819e3030..45e0a046 100644 --- a/src/HYDROData/HYDROData_Channel.cxx +++ b/src/HYDROData/HYDROData_Channel.cxx @@ -67,6 +67,9 @@ #include #include +#define _DEVDEBUG_ +#include "HYDRO_trace.hxx" + IMPLEMENT_STANDARD_HANDLE(HYDROData_Channel,HYDROData_ArtificialObject) IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Channel,HYDROData_ArtificialObject) @@ -456,6 +459,7 @@ void HYDROData_Channel::RemoveProfile() ObjectKind HYDROData_Channel::getAltitudeObjectType() const { - return KIND_OBSTACLE_ALTITUDE; + DEBTRACE("HYDROData_Channel::getAltitudeObjectType"); + return KIND_CHANNEL_ALTITUDE; } diff --git a/src/HYDROData/HYDROData_ChannelAltitude.cxx b/src/HYDROData/HYDROData_ChannelAltitude.cxx new file mode 100644 index 00000000..0070f9c3 --- /dev/null +++ b/src/HYDROData/HYDROData_ChannelAltitude.cxx @@ -0,0 +1,83 @@ +// 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 + +#include + +#include +#include + +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; +} + + + + diff --git a/src/HYDROData/HYDROData_ChannelAltitude.h b/src/HYDROData/HYDROData_ChannelAltitude.h new file mode 100644 index 00000000..695f855e --- /dev/null +++ b/src/HYDROData/HYDROData_ChannelAltitude.h @@ -0,0 +1,84 @@ +// 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 diff --git a/src/HYDROData/HYDROData_Entity.cxx b/src/HYDROData/HYDROData_Entity.cxx index bd47a090..ac0c5962 100644 --- a/src/HYDROData/HYDROData_Entity.cxx +++ b/src/HYDROData/HYDROData_Entity.cxx @@ -38,6 +38,9 @@ #include #include +#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) @@ -572,6 +575,7 @@ QStringList HYDROData_Entity::dumpObjectCreation( MapOfTreatedObjects& theTreate QString HYDROData_Entity::getPyTypeID() const { + DEBTRACE("HYDROData_Entity::getPyTypeID " << GetKind()); switch( GetKind() ) { case KIND_IMAGE: return "KIND_IMAGE"; @@ -601,6 +605,7 @@ QString HYDROData_Entity::getPyTypeID() const 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 } } diff --git a/src/HYDROData/HYDROData_Entity.h b/src/HYDROData/HYDROData_Entity.h index 8e493729..8661f3e2 100644 --- a/src/HYDROData/HYDROData_Entity.h +++ b/src/HYDROData/HYDROData_Entity.h @@ -65,7 +65,8 @@ const ObjectKind KIND_STREAM_ALTITUDE = 24; 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) diff --git a/src/HYDROData/HYDROData_IInterpolator.cxx b/src/HYDROData/HYDROData_IInterpolator.cxx index 72344d90..d8037511 100644 --- a/src/HYDROData/HYDROData_IInterpolator.cxx +++ b/src/HYDROData/HYDROData_IInterpolator.cxx @@ -20,6 +20,9 @@ #include +#define _DEVDEBUG_ +#include "HYDRO_trace.hxx" + HYDROData_IInterpolator::HYDROData_IInterpolator() { } @@ -42,11 +45,13 @@ Handle(HYDROData_IAltitudeObject) HYDROData_IInterpolator::GetAltitudeObject() c 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 +} diff --git a/src/HYDROData/HYDROData_Iterator.cxx b/src/HYDROData/HYDROData_Iterator.cxx index a52f9328..beec42dc 100644 --- a/src/HYDROData/HYDROData_Iterator.cxx +++ b/src/HYDROData/HYDROData_Iterator.cxx @@ -30,6 +30,7 @@ #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" @@ -49,6 +50,9 @@ #include +#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) { @@ -128,6 +132,7 @@ Handle(HYDROData_Entity) HYDROData_Iterator::Object( const TDF_Label& theLabel ) 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; @@ -153,6 +158,7 @@ Handle(HYDROData_Entity) HYDROData_Iterator::Object( const TDF_Label& theLabel ) 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; } diff --git a/src/HYDROData/HYDROData_Object.cxx b/src/HYDROData/HYDROData_Object.cxx index 25b9e262..1ffc9cd5 100644 --- a/src/HYDROData/HYDROData_Object.cxx +++ b/src/HYDROData/HYDROData_Object.cxx @@ -32,6 +32,9 @@ #include +#define _DEVDEBUG_ +#include "HYDRO_trace.hxx" + IMPLEMENT_STANDARD_HANDLE(HYDROData_Object,HYDROData_Entity) IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Object,HYDROData_Entity) @@ -299,6 +302,7 @@ void HYDROData_Object::checkAndSetAltitudeObject() 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 @@ -313,6 +317,7 @@ void HYDROData_Object::checkAndSetAltitudeObject() HYDROData_Iterator::CreateObject( aChildLabel, anAltitudeObjectType ) ); QString anAltitudePref = GetName() + "_Altitude"; + DEBTRACE("anAltitudePref " << anAltitudePref.toStdString()); QString anAltitudeName = HYDROData_Tool::GenerateObjectName( aDocument, anAltitudePref ); anAltitudeObject->SetName( anAltitudeName ); diff --git a/src/HYDROData/HYDROData_Obstacle.cxx b/src/HYDROData/HYDROData_Obstacle.cxx index 1218bbc4..00f332b9 100644 --- a/src/HYDROData/HYDROData_Obstacle.cxx +++ b/src/HYDROData/HYDROData_Obstacle.cxx @@ -57,6 +57,9 @@ #include +#define _DEVDEBUG_ +#include "HYDRO_trace.hxx" + IMPLEMENT_STANDARD_HANDLE(HYDROData_Obstacle,HYDROData_ArtificialObject) IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Obstacle,HYDROData_ArtificialObject) @@ -470,6 +473,7 @@ QColor HYDROData_Obstacle::getDefaultBorderColor() const ObjectKind HYDROData_Obstacle::getAltitudeObjectType() const { + DEBTRACE("HYDROData_Obstacle::getAltitudeObjectType"); return KIND_OBSTACLE_ALTITUDE; } diff --git a/src/HYDROData/HYDROData_ObstacleAltitude.cxx b/src/HYDROData/HYDROData_ObstacleAltitude.cxx index f8d56d9f..92cd9016 100644 --- a/src/HYDROData/HYDROData_ObstacleAltitude.cxx +++ b/src/HYDROData/HYDROData_ObstacleAltitude.cxx @@ -22,9 +22,14 @@ #include "HYDROData_Object.h" #include "HYDROData_Projection.h" +#define _DEVDEBUG_ +#include "HYDRO_trace.hxx" +#include + #include #include +#include IMPLEMENT_STANDARD_HANDLE(HYDROData_ObstacleAltitude, HYDROData_IAltitudeObject) IMPLEMENT_STANDARD_RTTIEXT(HYDROData_ObstacleAltitude, HYDROData_IAltitudeObject) @@ -40,23 +45,36 @@ HYDROData_ObstacleAltitude::~HYDROData_ObstacleAltitude() 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; } diff --git a/src/HYDROData/HYDROData_ObstacleAltitude.h b/src/HYDROData/HYDROData_ObstacleAltitude.h index ba95ba9b..fcabf5df 100644 --- a/src/HYDROData/HYDROData_ObstacleAltitude.h +++ b/src/HYDROData/HYDROData_ObstacleAltitude.h @@ -22,6 +22,9 @@ #include "HYDROData_IAltitudeObject.h" +#define _DEVDEBUG_ +#include "HYDRO_trace.hxx" + DEFINE_STANDARD_HANDLE(HYDROData_ObstacleAltitude, HYDROData_IAltitudeObject) @@ -49,7 +52,7 @@ public: /** * 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: diff --git a/src/HYDROData/HYDROData_StreamAltitude.cxx b/src/HYDROData/HYDROData_StreamAltitude.cxx index 50443a31..30270ee9 100644 --- a/src/HYDROData/HYDROData_StreamAltitude.cxx +++ b/src/HYDROData/HYDROData_StreamAltitude.cxx @@ -49,6 +49,9 @@ #include +#define _DEVDEBUG_ +#include "HYDRO_trace.hxx" + #ifdef DEB_CLASS2D #include #include @@ -214,20 +217,30 @@ bool HYDROData_StreamAltitude::getBoundaryProfilesForPoint( 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() ); @@ -247,12 +260,18 @@ double HYDROData_StreamAltitude::GetAltitudeForPoint( const gp_XY& thePoint ) co 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 ); @@ -302,7 +321,7 @@ double HYDROData_StreamAltitude::GetAltitudeForPoint( const gp_XY& thePoint ) co Standard_Real aSecCoeff = aRightProfileDist / ( aLeftProfileDist + aRightProfileDist ); aResAltitude = aLeftAlt * ( 1 - aFirstCoeff ) + aRightAlt * ( 1 - aSecCoeff ); - + DEBTRACE("aResAltitude=" << aResAltitude); return aResAltitude; } diff --git a/src/HYDROData/HYDROData_Zone.cxx b/src/HYDROData/HYDROData_Zone.cxx index c6e3da1a..69751927 100644 --- a/src/HYDROData/HYDROData_Zone.cxx +++ b/src/HYDROData/HYDROData_Zone.cxx @@ -33,6 +33,9 @@ #include +#define _DEVDEBUG_ +#include "HYDRO_trace.hxx" + IMPLEMENT_STANDARD_HANDLE(HYDROData_Zone, HYDROData_Entity) IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Zone, HYDROData_Entity) @@ -178,6 +181,7 @@ HYDROData_Zone::MergeType HYDROData_Zone::GetMergeType() const void HYDROData_Zone::SetMergeObject( const Handle(HYDROData_Entity)& theObject ) { + DEBTRACE("HYDROData_Zone::SetMergeObject"); SetReferenceObject( theObject, DataTag_MergeObject ); }