+// 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_SplitToZonesTool.h"
#include "HYDROData_PolylineXY.h"
+#include "HYDROData_LandCover.h"
#include "HYDROData_ShapesGroup.h"
#include <HYDROData_Transform.h>
#include <BRepAlgoAPI_Cut.hxx>
#endif
for( int anIndex = 1, aLength = theObjectList.Length(); anIndex <= aLength; anIndex++ )
{
- Handle(HYDROData_Object) aGeomObj =
- Handle(HYDROData_Object)::DownCast( theObjectList.Value( anIndex ) );
- if( aGeomObj.IsNull() )
- continue;
+ Handle(HYDROData_Entity) anObj = theObjectList.Value( anIndex );
+ TopoDS_Shape aShape;
+
+ Handle(HYDROData_Object) aGeomObj = Handle(HYDROData_Object)::DownCast( anObj );
+ if( !aGeomObj.IsNull() ) {
+ aShape = aGeomObj->GetTopShape();
+ } else {
+ Handle(HYDROData_LandCover) aLandCoverObj = Handle(HYDROData_LandCover)::DownCast( anObj );
+ if ( !aLandCoverObj.IsNull() ) {
+ aShape = aLandCoverObj->GetShape();
+ }
+ }
- TopoDS_Shape aShape = aGeomObj->GetTopShape();
if ( aShape.IsNull() )
continue;
#ifdef DEB_SPLIT_TO_ZONES
for ( ; anExp.More(); anExp.Next() ) {
const TopoDS_Face& aFace = TopoDS::Face( anExp.Current() );
if ( !aFace.IsNull() ) {
- SplitData aSplitData( SplitData::Data_Zone, aFace, aGeomObj->GetName() );
+ SplitData aSplitData( SplitData::Data_Zone, aFace, anObj->GetName() );
anInputSplitDataList.append( aSplitData );
}
}
} else {
- SplitData aSplitData( SplitData::Data_Zone, aShape, aGeomObj->GetName() );
+ SplitData aSplitData( SplitData::Data_Zone, aShape, anObj->GetName() );
anInputSplitDataList.append( aSplitData );
}
}
return anOutputSplitDataList;
}
+HYDROData_SplitToZonesTool::SplitDataList
+ HYDROData_SplitToZonesTool::Split( const HYDROData_SequenceOfObjects& theObjectList )
+{
+ HYDROData_SequenceOfObjects aGeomGroups;
+ Handle(HYDROData_PolylineXY) aPolyline;
+
+ return Split( theObjectList, aGeomGroups, aPolyline );
+}
\ No newline at end of file