1 // Copyright (C) 2014-2015 EDF-R&D
2 // This library is free software; you can redistribute it and/or
3 // modify it under the terms of the GNU Lesser General Public
4 // License as published by the Free Software Foundation; either
5 // version 2.1 of the License, or (at your option) any later version.
7 // This library is distributed in the hope that it will be useful,
8 // but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10 // Lesser General Public License for more details.
12 // You should have received a copy of the GNU Lesser General Public
13 // License along with this library; if not, write to the Free Software
14 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #include <HYDROData_LandCoverMap.h>
20 #include <HYDROData_Object.h>
21 #include <HYDROData_PolylineXY.h>
22 #include <HYDROData_Tool.h>
23 #include <HYDROData_ShapeFile.h>
25 #include <BOPAlgo_BOP.hxx>
26 #include <BOPAlgo_Builder.hxx>
27 #include <BOPAlgo_PaveFiller.hxx>
28 #include <BOPCol_ListOfShape.hxx>
29 #include <BRep_Builder.hxx>
30 #include <BRepAdaptor_Curve.hxx>
31 #include <BRepAlgoAPI_Fuse.hxx>
32 #include <BRepBuilderAPI_MakeFace.hxx>
33 #include <GCPnts_QuasiUniformDeflection.hxx>
34 #include <NCollection_IndexedMap.hxx>
36 #include <TopoDS_Compound.hxx>
37 #include <TopoDS_Edge.hxx>
38 #include <TopoDS_Face.hxx>
39 #include <TopoDS_Iterator.hxx>
40 #include <TopoDS_Shell.hxx>
41 #include <TopExp_Explorer.hxx>
42 #include <TopTools_ListIteratorOfListOfShape.hxx>
43 #include <BOPAlgo_PaveFiller.hxx>
44 #include <BRepTools.hxx>
45 #include <TopExp_Explorer.hxx>
46 #include <ShapeUpgrade_UnifySameDomain.hxx>
50 #include <QTextStream>
52 const char TELEMAC_FORMAT = 'f';
53 const int TELEMAC_PRECISION = 3;
56 IMPLEMENT_STANDARD_HANDLE(HYDROData_LandCoverMap, HYDROData_Entity)
57 IMPLEMENT_STANDARD_RTTIEXT(HYDROData_LandCoverMap, HYDROData_Entity)
59 class HYDROData_MapOfFaceToStricklerType : public NCollection_IndexedDataMap<TopoDS_Face, QString>
65 @param theMap the land cover map to iterate through
67 HYDROData_LandCoverMap::Iterator::Iterator( const HYDROData_LandCoverMap& theMap )
72 HYDROData_LandCoverMap::Iterator::Iterator( const Handle( HYDROData_LandCoverMap )& theMap )
84 Initialize the iterator
85 @param theMap the land cover map to iterate through
87 void HYDROData_LandCoverMap::Iterator::Init( const HYDROData_LandCoverMap& theMap )
89 TopoDS_Shape aShape = theMap.GetShape();
93 myIterator = new TopoDS_Iterator( aShape );
95 theMap.myLab.FindChild( DataTag_Types ).FindAttribute( TDataStd_ExtStringArray::GetID(), myArray );
96 if( myArray.IsNull() )
99 myIndex = myArray->Lower();
105 HYDROData_LandCoverMap::Iterator::~Iterator()
111 Return the current 0-based index of the iterator
112 @return the current index
114 int HYDROData_LandCoverMap::Iterator::Index() const
116 if( myArray.IsNull() )
119 return myIndex - myArray->Lower();
123 Return if the iterator has more elements
124 @return if the iterator has more elements
126 bool HYDROData_LandCoverMap::Iterator::More() const
128 return !myArray.IsNull() && myIterator && myIterator->More();
132 Move iterator to the next element
134 void HYDROData_LandCoverMap::Iterator::Next()
144 Get the current land cover (face)
145 @return the land cover's face
147 TopoDS_Face HYDROData_LandCoverMap::Iterator::Face() const
150 return TopoDS::Face( myIterator->Value() );
152 return TopoDS_Face();
156 Get the current land cover's Strickler type
157 @return the land cover's Strickler type
159 QString HYDROData_LandCoverMap::Iterator::StricklerType() const
161 if( myArray.IsNull() || myIndex < myArray->Lower() || myIndex > myArray->Upper() )
164 return HYDROData_Tool::toQString( myArray->Value( myIndex ) );
168 Set the Strickler type for the current land cover
169 @param theType the Strickler type
171 void HYDROData_LandCoverMap::Iterator::SetStricklerType( const QString& theType )
173 if( myArray.IsNull() || myIndex < myArray->Lower() || myIndex > myArray->Upper() )
176 myArray->SetValue( myIndex, HYDROData_Tool::toExtString( theType ) );
182 HYDROData_LandCoverMap::HYDROData_LandCoverMap()
183 : HYDROData_Entity( Geom_No )
190 HYDROData_LandCoverMap::~HYDROData_LandCoverMap()
196 @return object's kind
198 const ObjectKind HYDROData_LandCoverMap::GetKind() const
200 return KIND_LAND_COVER_MAP;
203 int HYDROData_LandCoverMap::GetLCCount() const
205 Iterator anIt( *this );
207 for( ; anIt.More(); anIt.Next() )
212 bool HYDROData_LandCoverMap::IsEmpty() const
214 Iterator anIt( *this );
222 Load attributes from DBF File
225 HYDROData_LandCoverMap::DBFStatus HYDROData_LandCoverMap::ImportDBF( const QString& theDBFFileName,
226 const QString& theFieldName,
227 const QStringList& theDBFValues,
228 const QStringList& theStricklerTypes,
229 const QList<int>& theIndices )
231 if (theDBFValues.size() != theStricklerTypes.size())
232 return DBFStatus_DIFF_SIZE_ERROR;
233 HYDROData_ShapeFile aDBFImporter;
234 if (!aDBFImporter.DBF_OpenDBF(theDBFFileName))
235 return DBFStatus_OPEN_FILE_ERROR; //cant open file
237 QStringList FieldList = aDBFImporter.DBF_GetFieldList();
238 int FieldNameIndex = FieldList.indexOf(theFieldName);
239 if (FieldNameIndex == -1)
240 return DBFStatus_NO_SUCH_FIELD_ERROR; //no such field
242 std::vector<HYDROData_ShapeFile::DBF_AttrValue> theAttrV;
243 aDBFImporter.DBF_GetAttributeList(FieldNameIndex, theAttrV );
246 Iterator anIt( *this );
247 for( ; anIt.More(); anIt.Next() )
249 int CurIndex = anIt.Index();
250 HYDROData_ShapeFile::DBF_AttrValue AValue = theAttrV[theIndices[CurIndex]];
251 int StricklerTypesInd = theDBFValues.indexOf(QString(AValue.myStrVal));
252 if ( StricklerTypesInd != -1)
253 anIt.SetStricklerType(theStricklerTypes[StricklerTypesInd]);
260 return DBFStatus_NO_DBFVALUES_CORRESPONDENCE_WARNING;
264 Export attributes to DBF File
267 void HYDROData_LandCoverMap::ExportDBF( const QString& theDBFFileName,
268 const QString& theFieldName,
269 const QStringList& theDBFValues,
270 const QStringList& theStricklerTypes) const
272 HYDROData_ShapeFile anExporter;
273 std::vector<HYDROData_ShapeFile::DBF_AttrValue> theAttrV;
274 Iterator anIt( *this );
275 for( ; anIt.More(); anIt.Next() )
277 QString CurST = anIt.StricklerType();
278 HYDROData_ShapeFile::DBF_AttrValue aCurAttrV;
279 aCurAttrV.myIsNull = false;
280 int StricklerTypesInd = theStricklerTypes.indexOf(CurST);
281 if (StricklerTypesInd != -1)
283 aCurAttrV.myStrVal = theDBFValues[StricklerTypesInd];
284 aCurAttrV.myFieldType = HYDROData_ShapeFile::DBF_FieldType_String;
285 theAttrV.push_back(aCurAttrV);
288 aCurAttrV.myIsNull = true;
291 anExporter.DBF_WriteFieldAndValues(theDBFFileName, theFieldName, HYDROData_ShapeFile::DBF_FieldType_String, theAttrV, true);
295 int HashCode( const gp_Pnt& thePoint, const Standard_Integer theUpper )
297 int aHashX = HashCode( thePoint.X(), theUpper );
298 int aHashY = HashCode( thePoint.Y(), theUpper );
299 return (aHashX^aHashY)%theUpper;
302 bool operator == ( const gp_Pnt& thePoint1, const gp_Pnt& thePoint2 )
304 return thePoint1.IsEqual( thePoint2, Precision::Confusion() );
307 bool EdgeDiscretization( const TopoDS_Edge& theEdge,
308 Standard_Real theDeflection,
309 NCollection_IndexedMap<gp_Pnt>& theVerticesMap,
310 QList<int>& theVerticesIds )
312 BRepAdaptor_Curve aCurve( theEdge );
313 GCPnts_QuasiUniformDeflection aDiscrete( aCurve, theDeflection );
314 if( !aDiscrete.IsDone() )
317 int n = aDiscrete.NbPoints();
318 for( int i=1; i<=n; i++ )
320 gp_Pnt aPnt = aDiscrete.Value( i );
322 if( theVerticesMap.Contains( aPnt ) )
323 anId = theVerticesMap.FindIndex( aPnt );
326 anId = theVerticesMap.Size();
327 theVerticesMap.Add( aPnt );
329 theVerticesIds.append( anId );
335 Export the land cover map for the solver (Telemac)
336 @param theFileName the name of file
337 @return if the export is successful
339 bool HYDROData_LandCoverMap::ExportTelemac( const QString& theFileName, Standard_Real theDeflection ) const
341 TopoDS_Shape aLandCoverMapShape = GetShape();
342 TopTools_ListOfShape aListOfFaces;
343 TopExp_Explorer anExp( aLandCoverMapShape, TopAbs_FACE );
344 for( ; anExp.More(); anExp.Next() )
345 aListOfFaces.Append( anExp.Current() );
347 TopoDS_Shape aShape = MergeFaces( aListOfFaces, false );
349 NCollection_IndexedMap<gp_Pnt> aVerticesMap;
350 NCollection_IndexedDataMap< TopoDS_Edge, QList<int> > anEdgesMap;
351 NCollection_IndexedDataMap< TopoDS_Face, QList<int> > aFacesMap;
353 // add into the map all edges existing in the shell
354 TopExp_Explorer anExp1( aShape, TopAbs_EDGE );
355 for( ; anExp1.More(); anExp1.Next() )
357 TopoDS_Edge anEdge = TopoDS::Edge( anExp1.Current() );
358 QList<int> aVerticesIdsList;
359 if( EdgeDiscretization( anEdge, theDeflection, aVerticesMap, aVerticesIdsList ) )
360 anEdgesMap.Add( anEdge, aVerticesIdsList );
363 // add into the map all faces existing in the shell and correspondence between face and edges ids
364 TopExp_Explorer anExp2( aShape, TopAbs_FACE );
365 for( ; anExp2.More(); anExp2.Next() )
367 TopoDS_Face aFace = TopoDS::Face( anExp2.Current() );
368 TopExp_Explorer anExp3( aFace, TopAbs_EDGE );
369 QList<int> anEdgesIdsList;
370 for( ; anExp3.More(); anExp3.Next() )
372 TopoDS_Edge anEdge = TopoDS::Edge( anExp3.Current() );
373 int anEdgeId = anEdgesMap.FindIndex( anEdge );
374 anEdgesIdsList.append( anEdgeId );
376 aFacesMap.Add( aFace, anEdgesIdsList );
379 QFile aFile( theFileName );
380 if( !aFile.open( QFile::WriteOnly | QFile::Text ) )
383 QTextStream aStream( &aFile );
384 aStream << "# nodes\n";
385 NCollection_IndexedMap<gp_Pnt>::Iterator anIt1( aVerticesMap );
386 for( ; anIt1.More(); anIt1.Next() )
388 gp_Pnt aPnt = anIt1.Value();
389 aStream << QString::number( aPnt.X(), TELEMAC_FORMAT, TELEMAC_PRECISION );
391 aStream << QString::number( aPnt.Y(), TELEMAC_FORMAT, TELEMAC_PRECISION );
393 aStream << QString::number( aPnt.Z(), TELEMAC_FORMAT, TELEMAC_PRECISION );
398 aStream << "# edges\n";
399 NCollection_IndexedDataMap< TopoDS_Edge, QList<int> >::Iterator anIt2( anEdgesMap );
400 for( ; anIt2.More(); anIt2.Next() )
402 QList<int> aVerticesIds = anIt2.Value();
403 foreach( int anId, aVerticesIds )
404 aStream << anId << " ";
409 aStream << "# faces\n";
410 NCollection_IndexedDataMap< TopoDS_Face, QList<int> >::Iterator anIt3( aFacesMap );
411 for( ; anIt3.More(); anIt3.Next() )
413 QList<int> anEdgesIds = anIt3.Value();
414 foreach( int anId, anEdgesIds )
415 aStream << anId << " ";
425 Add a new object as land cover
426 @param theObject the object to add as land cover
427 @param theType the Strickler type for the new land cover
428 @return if the addition is successful
430 bool HYDROData_LandCoverMap::Add( const Handle( HYDROData_Object )& theObject, const QString& theType )
432 if( theObject.IsNull() )
435 TopoDS_Shape aShape = theObject->GetTopShape();
436 if( aShape.ShapeType()!=TopAbs_FACE )
439 TopoDS_Face aFace = TopoDS::Face( aShape );
440 return LocalPartition( aFace, theType );
444 Add a new polyline as land cover
445 @param thePolyline the polyline to add as land cover
446 @param theType the Strickler type for the new land cover
447 @return if the addition is successful
449 bool HYDROData_LandCoverMap::Add( const Handle( HYDROData_PolylineXY )& thePolyline, const QString& theType )
451 if( thePolyline.IsNull() )
454 TopoDS_Shape aShape = thePolyline->GetShape();
455 if( aShape.ShapeType()!=TopAbs_WIRE )
458 TopoDS_Wire aWire = TopoDS::Wire( aShape );
459 if( !aWire.Closed() )
462 TopoDS_Face aFace = BRepBuilderAPI_MakeFace( aWire, Standard_True ).Face();
463 return LocalPartition( aFace, theType );
467 Remove the given face from land cover map
468 @param theFace the face to be removed
469 @return if the removing is successful
471 bool HYDROData_LandCoverMap::Remove( const TopoDS_Face& theFace )
473 TopTools_ListOfShape aList;
474 aList.Append( theFace );
475 return Remove( aList );
479 Remove the given faces from land cover map
480 @param theFacesToRemove the face list to be removed
481 @return if the removing is successful
483 bool HYDROData_LandCoverMap::Remove( const TopTools_ListOfShape& theFacesToRemove )
485 HYDROData_MapOfFaceToStricklerType aFacesToRemove, aNewFaces;
486 TopTools_ListIteratorOfListOfShape aFIt( theFacesToRemove );
487 for( ; aFIt.More(); aFIt.Next() )
489 TopoDS_Shape aShape = aFIt.Value();
490 if( aShape.ShapeType()==TopAbs_FACE )
491 aFacesToRemove.Add( TopoDS::Face( aShape ), "" );
494 Iterator anIt( *this );
495 for( ; anIt.More(); anIt.Next() )
496 if( !aFacesToRemove.Contains( anIt.Face() ) )
497 aNewFaces.Add( anIt.Face(), anIt.StricklerType() );
499 StoreLandCovers( aNewFaces );
504 Split the land cover map by the given polyline
505 @param thePolyline the tool polyline to split the land cover map
506 @return if the removing is successful
508 bool HYDROData_LandCoverMap::Split( const Handle( HYDROData_PolylineXY )& thePolyline )
510 if( thePolyline.IsNull() )
513 TopoDS_Shape aShape = thePolyline->GetShape();
514 return LocalPartition( aShape, "" );
518 Merge the given faces in the land cover
519 @param theFaces the faces to merge in the land cover map
520 @param theType the Strickler type for the merged land cover
521 @return if the merge is successful
523 bool HYDROData_LandCoverMap::Merge( const TopTools_ListOfShape& theFaces, const QString& theType )
525 // 1. to fuse the faces into the new face
526 TopoDS_Shape aMergedFace = MergeFaces( theFaces, true );
527 if( aMergedFace.ShapeType()==TopAbs_FACE )
529 // 2. to remove the merged faces from the current map
532 // 3. to add the face into the map
533 return LocalPartition( TopoDS::Face( aMergedFace ), theType );
539 Merge the given faces into the shell/face
540 @param theFaces the faces to merge
541 @param IsToUnify if the common edges should be removed (fused)
542 @param theTolerance the operation's tolerance
543 @return result shape (face or shell)
545 TopoDS_Shape HYDROData_LandCoverMap::MergeFaces( const TopTools_ListOfShape& theFaces,
546 bool IsToUnify, double theTolerance )
549 TopTools_ListIteratorOfListOfShape anIt;
550 BOPCol_ListOfShape aLC;
551 anIt.Initialize(theFaces);
552 for( ; anIt.More(); anIt.Next() )
554 if (anIt.Value().ShapeType() != TopAbs_FACE)
555 return TopoDS_Shape();
556 aLC.Append( anIt.Value() );
559 BOPAlgo_PaveFiller aPF;
560 aPF.SetArguments( aLC );
561 aPF.SetRunParallel( Standard_False );
562 aPF.SetFuzzyValue( theTolerance );
565 anError = aPF.ErrorStatus();
567 return TopoDS_Shape();
569 BOPAlgo_Builder anAlgo;
570 anIt.Initialize( theFaces );
571 for( ; anIt.More(); anIt.Next() )
572 anAlgo.AddArgument( anIt.Value() );
574 anAlgo.PerformWithFiller( aPF );
575 anError = anAlgo.ErrorStatus();
577 return TopoDS_Shape();
579 const TopoDS_Shape& aMergedShape = anAlgo.Shape();
581 BRep_Builder aBuilder;
583 aBuilder.MakeShell( aShell );
584 aShell.Closed( Standard_False );
585 TopExp_Explorer anExplorer( aMergedShape, TopAbs_FACE );
586 for( ; anExplorer.More(); anExplorer.Next() )
588 const TopoDS_Face& aFace = TopoDS::Face(anExplorer.Current());
591 if( aFace.ShapeType() == TopAbs_FACE )
593 aBuilder.Add( aShell, aFace );
594 aShell.Closed( Standard_False );
598 TopoDS_Shape aResult;
601 ShapeUpgrade_UnifySameDomain aUSD;
602 aUSD.Initialize( aShell );
604 aResult = aUSD.Shape();
609 anExplorer.Init( aResult, TopAbs_FACE );
611 TopoDS_Face anOneFace;
612 for( ; anExplorer.More(); anExplorer.Next(), n++ )
613 anOneFace = TopoDS::Face( anExplorer.Current() );
622 Get the shape of the land cover map
624 TopoDS_Shape HYDROData_LandCoverMap::GetShape() const
626 return HYDROData_Entity::GetShape( DataTag_Shape );
630 Set the shape of the land cover map
631 @param theShape the new shape for the land cover map
633 void HYDROData_LandCoverMap::SetShape( const TopoDS_Shape& theShape )
635 HYDROData_Entity::SetShape( DataTag_Shape, theShape );
639 Perform the local partition algorithm on the land cover
640 @param theNewShape the new shape to add into the land cover
641 @param theNewType the new Strickler type for the new land cover
642 @return if the local partition is successful
644 bool HYDROData_LandCoverMap::LocalPartition( const TopoDS_Shape& theNewShape, const QString& theNewType )
646 if( theNewShape.IsNull() )
649 BOPCol_ListOfShape aShapesList;
650 BOPAlgo_PaveFiller aPaveFiller;
651 HYDROData_MapOfFaceToStricklerType aNewFaces;
653 // add faces to shapes list
654 Iterator anIt( *this );
655 for( ; anIt.More(); anIt.Next() )
656 aShapesList.Append( anIt.Face() );
657 aShapesList.Append( theNewShape );
659 if( aShapesList.Size()==1 && theNewShape.ShapeType()==TopAbs_FACE )
661 aNewFaces.Add( TopoDS::Face( theNewShape ), theNewType );
662 StoreLandCovers( aNewFaces );
666 // prepare pave filler
667 aPaveFiller.SetArguments( aShapesList );
668 aPaveFiller.Perform();
669 Standard_Integer anError = aPaveFiller.ErrorStatus();
673 // add faces to builder
674 BOPAlgo_Builder aBuilder;
676 for( ; anIt.More(); anIt.Next() )
677 aBuilder.AddArgument( anIt.Face() );
678 aBuilder.AddArgument( theNewShape );
680 // perform the partition with the pave filler
681 aBuilder.PerformWithFiller( aPaveFiller );
682 anError = aBuilder.ErrorStatus();
686 //std::cout << "History:" << std::endl;
687 // analysis of the history
688 // a. to fill map of shapes which come from the new face
689 NCollection_IndexedMap<int> aShapesFromNewFace;
690 //std::cout << "from NEW " << theNewShape << ":" << theNewType << std::endl;
691 TopTools_ListOfShape aModified = aBuilder.Modified( theNewShape );
692 TopTools_ListIteratorOfListOfShape aMIt( aModified );
693 for( ; aMIt.More(); aMIt.Next() )
695 //std::cout << " " << aMIt.Value() << std::endl;
696 int aKey = (int)(uintptr_t)aMIt.Value().TShape().operator->();
697 aShapesFromNewFace.Add( aKey );
700 // b. to fill map of parts except parts from new face
702 for( ; anIt.More(); anIt.Next() )
704 QString aSType = anIt.StricklerType();
705 //std::cout << "from " << anIt.Face() << ": " << anIt.StricklerType() << std::endl;
706 TopTools_ListOfShape aModified = aBuilder.Modified( anIt.Face() );
707 if( aModified.Extent() == 0 )
708 aModified.Append( anIt.Face() );
710 TopTools_ListIteratorOfListOfShape aMIt( aModified );
711 for( ; aMIt.More(); aMIt.Next() )
713 TopoDS_Shape aShape = aMIt.Value();
714 bool isFace = aShape.ShapeType()==TopAbs_FACE;
715 int aKey = (int)(uintptr_t)aShape.TShape().operator->();
716 bool isAlsoFromNew = aShapesFromNewFace.Contains( aKey );
717 //std::cout << " " << aShape << " " << isAlsoFromNew << std::endl;
718 if( isFace && !isAlsoFromNew )
719 aNewFaces.Add( TopoDS::Face( aShape ), aSType );
723 // c. add the new shape if it is face with its type
724 if( theNewShape.ShapeType()==TopAbs_FACE )
725 aNewFaces.Add( TopoDS::Face( theNewShape ), theNewType );
727 // convert map of shape to type to compound and list of types
728 StoreLandCovers( aNewFaces );
733 Replace the set of land covers in the land cover map
734 @param theMap the map of shape (face) to Strickler type (string)
736 void HYDROData_LandCoverMap::StoreLandCovers( const HYDROData_MapOfFaceToStricklerType& theMap )
738 TopTools_ListOfShape aListOfFaces;
740 int n = theMap.Size();
742 Handle( TDataStd_ExtStringArray ) aTypes =
743 TDataStd_ExtStringArray::Set( myLab.FindChild( DataTag_Types ), 0, n-1, Standard_True );
745 HYDROData_MapOfFaceToStricklerType::Iterator aNFIt( theMap );
746 for( int i=0; aNFIt.More(); aNFIt.Next(), i++ )
748 TopoDS_Face aFace = aNFIt.Key();
751 QString aType = aNFIt.Value();
752 aListOfFaces.Append(aFace);
753 aTypes->SetValue( i, HYDROData_Tool::toExtString( aType ) );
756 TopoDS_Shape aResult;
757 if( aListOfFaces.Extent() == 1 )
760 BRep_Builder aShellBuilder;
761 aShellBuilder.MakeShell( aShell );
762 aShell.Closed( Standard_False );
763 aShellBuilder.Add( aShell, aListOfFaces.First() );
766 else if( aListOfFaces.Extent() > 1 )
767 aResult = MergeFaces( aListOfFaces, false );
773 Find the land cover for the given point
774 @param thePoint the point laying in some land cover
775 @param theType the returned type
776 @return the found land cover's face
778 TopoDS_Face HYDROData_LandCoverMap::FindByPoint( const gp_Pnt2d& thePoint, QString& theType ) const
780 //TODO: some more optimal algorithm
781 Iterator anIt( *this );
782 for( ; anIt.More(); anIt.Next() )
783 if( HYDROData_Tool::ComputePointState( thePoint.XY(), anIt.Face() ) == TopAbs_IN )
785 theType = anIt.StricklerType();
790 return TopoDS_Face();
795 @param theTreatedObjects the map of treated objects
797 QStringList HYDROData_LandCoverMap::DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const
799 QStringList aResList = dumpObjectCreation( theTreatedObjects );
800 QString aName = GetObjPyName();
802 //Handle(HYDROData_PolylineXY) aHydAxis = GetHydraulicAxis();
803 //setPythonReferenceObject( theTreatedObjects, aResList, aHydAxis, "SetHydraulicAxis" );
805 //HYDROData_SequenceOfObjects aSeqOfProfiles = GetProfiles();
806 //for ( int i = 1, aNb = aSeqOfProfiles.Size(); i <= aNb; ++i )
808 //const Handle(HYDROData_Entity) aProfile = aSeqOfProfiles.Value( i );
809 //setPythonReferenceObject( theTreatedObjects, aResList, aProfile, "AddProfile" );