]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
specific altitude object for channel and embankment
authorPaul RASCLE <paul.rascle@edf.fr>
Mon, 3 Aug 2015 14:38:09 +0000 (16:38 +0200)
committerPaul RASCLE <paul.rascle@edf.fr>
Mon, 3 Aug 2015 14:38:09 +0000 (16:38 +0200)
17 files changed:
src/HYDROData/CMakeLists.txt
src/HYDROData/HYDROData_AltitudeObject.cxx
src/HYDROData/HYDROData_Bathymetry.cxx
src/HYDROData/HYDROData_CalculationCase.cxx
src/HYDROData/HYDROData_Channel.cxx
src/HYDROData/HYDROData_ChannelAltitude.cxx [new file with mode: 0644]
src/HYDROData/HYDROData_ChannelAltitude.h [new file with mode: 0644]
src/HYDROData/HYDROData_Entity.cxx
src/HYDROData/HYDROData_Entity.h
src/HYDROData/HYDROData_IInterpolator.cxx
src/HYDROData/HYDROData_Iterator.cxx
src/HYDROData/HYDROData_Object.cxx
src/HYDROData/HYDROData_Obstacle.cxx
src/HYDROData/HYDROData_ObstacleAltitude.cxx
src/HYDROData/HYDROData_ObstacleAltitude.h
src/HYDROData/HYDROData_StreamAltitude.cxx
src/HYDROData/HYDROData_Zone.cxx

index 81348916a8809eea00c82f9ff5f4625b0a8a19ec..4ce848b2fb309ff3b884f725e3aa55c18c916fbb 100644 (file)
@@ -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
index deac2dc0cf2d0bcd4970587c4361f63e0bc5d217..5c4edcb8ab02573cc8d77d9e25b115590e9a8c81 100644 (file)
@@ -21,6 +21,9 @@
 
 #include <QStringList>
 
+#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;
index 7f51fe9753420600720dc5d0c0651a006c7f4096..8a5958a12e053c2ff5950f2a1bf80476b599c43d 100644 (file)
@@ -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;
 
index 8814d9aaa28b5c31c4411c0303dfa03aa8c9a5b9..c59b01e33b10330daba54564ca5771021774b3e9 100644 (file)
@@ -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<QString, Handle(HYDROData_Region)> aRegionsMap; //object name to region
   QMap<QString, QString> 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;
index 819e3030d2dd7df1223c628ddb4425aae9517c21..45e0a046ac49ec6a2e8efdf526581d893abe9774 100644 (file)
@@ -67,6 +67,9 @@
 #include <QColor>
 #include <QStringList>
 
+#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 (file)
index 0000000..0070f9c
--- /dev/null
@@ -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 <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;
+}
+
+
+
+
diff --git a/src/HYDROData/HYDROData_ChannelAltitude.h b/src/HYDROData/HYDROData_ChannelAltitude.h
new file mode 100644 (file)
index 0000000..695f855
--- /dev/null
@@ -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
index bd47a0901b01a77cefa535af91340f540d39da8c..ac0c59620697b369915318c24728f6f98c711215 100644 (file)
@@ -38,6 +38,9 @@
 #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)
@@ -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
   }
 }
index 8e4937291bcf518b08e967f2bba8e24f7cf72ca9..8661f3e212fb9ca5e214f27f282105c320911300 100644 (file)
@@ -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)
 
index 72344d9009331b50252b6ccf70e619d4aba93960..d80375117dc2980e87e16b794710a609c3649610 100644 (file)
@@ -20,6 +20,9 @@
 
 #include <gp_XY.hxx>
 
+#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
+}
index a52f932836fc2536b5be1dc6cba83c9ea9cc86c2..beec42dc5ca864249e2c8999eb0f96aa110a6974 100644 (file)
@@ -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 <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)
 {
@@ -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;
   }
 
index 25b9e2625187447f1a6a2ad224eb99c530b2da13..1ffc9cd5024489d17c60f9884dfbaa052c122788 100644 (file)
@@ -32,6 +32,9 @@
 
 #include <QColor>
 
+#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 );
 
index 1218bbc4ed6ae14e24c8b08e8b6bca2439eca375..00f332b94b1c497d7ebecca0e5902b9d3c0595fd 100644 (file)
@@ -57,6 +57,9 @@
 
 #include <HYDROData_Projection.h>
 
+#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;
 }
 
index f8d56d9ffe2d41718d12ae1917b6a1c3f520dd34..92cd90166b973612b122cb3eacfae4d0fceab86f 100644 (file)
 #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)
@@ -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;
 }
 
index ba95ba9b9288f5343c0ee3c17cd431854d7b482d..fcabf5df21b2fe5f90756152b1ae8a0075cd7438 100644 (file)
@@ -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:      
 
index 50443a315d707f139085652189815ade803b395f..30270ee9c58b5eb3c2d046c618ce8d50116012d0 100644 (file)
@@ -49,6 +49,9 @@
 
 #include <QStringList>
 
+#define _DEVDEBUG_
+#include "HYDRO_trace.hxx"
+
 #ifdef DEB_CLASS2D
 #include <BRepTools.hxx>
 #include <BRep_Builder.hxx>
@@ -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;
 }
 
index c6e3da1af9650fb148aa9bdd0946e87c38a3cd7d..69751927c457f5c09491cf2c75deada8c7fc9227 100644 (file)
@@ -33,6 +33,9 @@
 
 #include <TDataStd_Integer.hxx>
 
+#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 );
 }