#include <BRepBndLib.hxx>
#include <Bnd_Box.hxx>
+//#define _DEVDEBUG_
+#include "HYDRO_trace.hxx"
+
#ifdef WIN32
#pragma warning( disable: 4996 )
#endif
NCollection_Sequence<Handle(HYDROData_Polyline3D)> aPoly3DSeq,
QStringList& aNonExpList)
{
+ DEBTRACE("aFileName " << aFileName.toStdString());
SHPHandle hSHPHandle;
+ QStringList anExpList;
if (!aPolyXYSeq.IsEmpty() && aPoly3DSeq.IsEmpty())
{
hSHPHandle = SHPCreate( aFileName.toLatin1().data(), SHPT_ARC );
for (int i = 1; i <= aPolyXYSeq.Size(); i++)
if (WriteObjectPolyXY(theDocument, hSHPHandle, aPolyXYSeq(i)) != 1)
aNonExpList.append(aPolyXYSeq(i)->GetName());
+ else
+ {
+ anExpList.append(aPolyXYSeq(i)->GetName());
+ DEBTRACE(" aName: " << aPolyXYSeq(i)->GetName().toStdString());
+ }
}
else if (aPolyXYSeq.IsEmpty() && !aPoly3DSeq.IsEmpty())
{
for (int i = 1; i <= aPoly3DSeq.Size(); i++)
if (WriteObjectPoly3D(theDocument, hSHPHandle, aPoly3DSeq(i)) != 1)
aNonExpList.append(aPoly3DSeq(i)->GetName());
+ else
+ {
+ anExpList.append(aPoly3DSeq(i)->GetName());
+ DEBTRACE(" aName: " << aPoly3DSeq(i)->GetName().toStdString());
+ }
}
if (hSHPHandle->nRecords > 0)
+ {
SHPClose( hSHPHandle );
+ std::vector<HYDROData_ShapeFile::DBF_AttrValue> theAttrV;
+ for (int i=0; i<anExpList.size(); i++)
+ {
+ HYDROData_ShapeFile::DBF_AttrValue aCurAttrV;
+ aCurAttrV.myStrVal = anExpList[i];
+ aCurAttrV.myFieldType = HYDROData_ShapeFile::DBF_FieldType_String;
+ aCurAttrV.myIsNull = false;
+ theAttrV.push_back(aCurAttrV);
+ }
+ QString theDBFFileName = aFileName.section('.',0,-2) + ".dbf";
+ DEBTRACE("theDBFFileName " << theDBFFileName.toStdString());
+ DBF_WriteFieldAndValues(theDBFFileName, "PartName", HYDROData_ShapeFile::DBF_FieldType_String, theAttrV, false);
+ }
else
{
SHPClose( hSHPHandle );
{
if (bCheckLinear && !aLCM->CheckLinear())
return;
- //
+
SHPHandle hSHPHandle = NULL;
if ( !aLCM.IsNull() && !aLCM->IsEmpty())
{
SHPObject *aSHPObj;
std::vector<double> x, y;
std::vector<int> anPartStart;
-
-// for (int i = 0; i < thePoly->NbSections(); i++)
-// if (thePoly->GetSectionType(i) == HYDROData_IPolyline::SECTION_SPLINE)
-// return -1;
-
for (int i = 0; i < thePoly->NbSections(); i++)
{
anPartStart.push_back(x.size());
std::vector<int> anPartStart;
anPartStart.push_back(0); //one section only
- if (thePoly->GetPolylineXY()->GetSectionType(0) == HYDROData_IPolyline::SECTION_SPLINE)
- return -1;
-
HYDROData_Polyline3D::Polyline3DPoints aPointList3D = thePoly->GetProfilePoints3D(true);
for (int j = 1; j <= aPointList3D.Size(); j++)
{
default:
break;
}
+ DEBTRACE("theAttrV.size() " << theAttrV.size());
if (DBFGetFieldCount( hDBF ) != 1)
{
{
for (size_t i = 0; i < theAttrV.size(); i++)
{
+ DEBTRACE(" rawValue");
if (!theAttrV[i].myIsNull)
stat = DBFWriteStringAttribute(hDBF, (int)i, 0, theAttrV[i].myRawValue.c_str());
else
{
for (size_t i = 0; i < theAttrV.size(); i++)
{
+ DEBTRACE(" typeValue " << theAttrV[i].myIsNull);
if (!theAttrV[i].myIsNull)
switch( theType )
{
case DBF_FieldType_String:
{
+ DEBTRACE(" write dbf " << i << " " << theAttrV[i].myStrVal.toStdString());
stat = DBFWriteStringAttribute(hDBF, (int)i, 0, theAttrV[i].myStrVal.toStdString().c_str());
break;
}
}
else
stat = DBFWriteNULLAttribute(hDBF, (int)i, 0 );
-
+ DEBTRACE(" stat " << stat);
if (stat != 1)
{
DBFClose( hDBF );