return false;
}
-void HYDROData_ShapeFile::ReadSHPPolygon(SHPObject* anObj, int i, TopoDS_Face& F)
+void HYDROData_ShapeFile::ReadSHPPolygon(Handle(HYDROData_Document) theDocument, SHPObject* anObj, int i, TopoDS_Face& F)
{
if (!anObj)
return;
for ( int k = StartIndex; k < EndIndex; k++ )
{
gp_Pnt P (anObj->padfX[k], anObj->padfY[k], 0);
+ theDocument->Transform(P, true);
VPoints.ChangeValue(j) = BRepLib_MakeVertex(P).Vertex();
j--;
}
F.Closed(Standard_True);
}
-int HYDROData_ShapeFile::ImportPolygons(const QString theFileName, QStringList& thePolygonsList, TopTools_SequenceOfShape& theFaces, int& theShapeTypeOfFile)
+int HYDROData_ShapeFile::ImportPolygons(Handle(HYDROData_Document) theDocument, const QString theFileName, QStringList& thePolygonsList, TopTools_SequenceOfShape& theFaces, int& theShapeTypeOfFile)
{
Free();
int Stat = TryOpenShapeFile(theFileName);
#endif
for (size_t i = 0; i < mySHPObjects.size(); i++)
{
- ReadSHPPolygon(mySHPObjects[i], i, aF);
+ ReadSHPPolygon(theDocument, mySHPObjects[i], i, aF);
theFaces.Append(aF);
}
#ifdef OSD_TIMER
//Import
bool Parse(SHPHandle theHandle, ShapeType theType, int& theShapeTypeOfFile);
//Import Landcover
- void ReadSHPPolygon(SHPObject* anObj, int i, TopoDS_Face& F);
+ void ReadSHPPolygon(Handle(HYDROData_Document) theDocument, SHPObject* anObj, int i, TopoDS_Face& F);
- HYDRODATA_EXPORT int ImportPolygons(const QString theFileName,
+ HYDRODATA_EXPORT int ImportPolygons(Handle(HYDROData_Document) theDocument,
+ const QString theFileName,
QStringList& thePolygonsList,
TopTools_SequenceOfShape& theFaces,
int& theShapeTypeOfFile);
QStringList PolygonList;
TopTools_SequenceOfShape PolygonFaces;
int Type = -1;
- int aStat = anImporter.ImportPolygons(aFileName, PolygonList, PolygonFaces, Type);
+ int aStat = anImporter.ImportPolygons(aDoc, aFileName, PolygonList, PolygonFaces, Type);
CPPUNIT_ASSERT(aStat == 1);
CPPUNIT_ASSERT_EQUAL(5, Type);
CPPUNIT_ASSERT_EQUAL(268, PolygonFaces.Length());
QStringList PolygonList;
TopTools_SequenceOfShape PolygonFaces;
int Type = -1;
- int aStat = anImporter.ImportPolygons(aFileName, PolygonList, PolygonFaces, Type);
+ int aStat = anImporter.ImportPolygons(aDoc, aFileName, PolygonList, PolygonFaces, Type);
CPPUNIT_ASSERT(aStat == 1);
CPPUNIT_ASSERT_EQUAL(5, Type);
CPPUNIT_ASSERT_EQUAL(625, PolygonFaces.Length());
QStringList PolygonList;
TopTools_SequenceOfShape PolygonFaces;
int Type = -1;
- int aStat = anImporter.ImportPolygons(aFileName, PolygonList, PolygonFaces, Type);
+ int aStat = anImporter.ImportPolygons(aDoc, aFileName, PolygonList, PolygonFaces, Type);
CPPUNIT_ASSERT(aStat == 1);
CPPUNIT_ASSERT_EQUAL(5, Type);
CPPUNIT_ASSERT_EQUAL(127, PolygonFaces.Length());
int Type = -1;
//import LCM from file (#2-4; #12-14 polygons)
- CPPUNIT_ASSERT( anImporter.ImportPolygons(aFFileName, PolygonList, PolygonFaces, Type));
+ CPPUNIT_ASSERT( anImporter.ImportPolygons(aDoc, aFFileName, PolygonList, PolygonFaces, Type));
Handle(HYDROData_LandCoverMap) LCM = Handle(HYDROData_LandCoverMap)::DownCast( aDoc->CreateObject( KIND_LAND_COVER_MAP ) );
HYDROData_MapOfFaceToStricklerType aMapFace2ST;
int Type = -1;
//import all
- CPPUNIT_ASSERT( anImporter.ImportPolygons(aSFileName, PolygonList, PolygonFaces, Type));
+ CPPUNIT_ASSERT( anImporter.ImportPolygons(aDoc, aSFileName, PolygonList, PolygonFaces, Type));
Handle(HYDROData_LandCoverMap) LCM = Handle(HYDROData_LandCoverMap)::DownCast( aDoc->CreateObject( KIND_LAND_COVER_MAP ) );
HYDROData_MapOfFaceToStricklerType aMapFace2ST;
CPPUNIT_ASSERT_EQUAL(PolygonFaces.Length(), 6);