Skip to content
Permalink
Browse files
fix dxf2shp plugin
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@9043 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Aug 10, 2008
1 parent 8c1ee0f commit 065b256a846bebcc7a34924e4caa9a58d8637eaf
@@ -16,10 +16,6 @@ SET (dxf2shpconverter_UIS dxf2shpconvertergui.ui)
SET (dxf2shpconverter_MOC_HDRS
dxf2shpconverter.h
dxf2shpconvertergui.h
builder.h
getInsertions.h
dxflib/src/dl_dxf.h
dxflib/src/dl_writer_ascii.h
)

SET (dxf2shpconverter_RCCS dxf2shpconverter.qrc)
@@ -225,20 +225,22 @@ void Builder::addLine(const DL_LineData& data) {

SHPObject *psShape;
int dim = polyVertex.size();
double xv[dim];
double yv[dim];
double zv[dim];
double *xv = new double[dim];
double *yv = new double[dim];
double *zv = new double[dim];

for (int i=0; i < dim; i++)
{
xv[i] = polyVertex[i].x;
yv[i] = polyVertex[i].y;
zv[i] = polyVertex[i].z;

}

psShape = SHPCreateObject( shapefileType, fetchedprims, 0, NULL, NULL,
dim, xv, yv, zv, NULL );
psShape = SHPCreateObject( shapefileType, fetchedprims, 0, NULL, NULL, dim, xv, yv, zv, NULL );

delete [] xv;
delete [] yv;
delete [] zv;

shpObjects.push_back(psShape);

@@ -363,9 +365,9 @@ void Builder::addArc(const DL_ArcData& data)

SHPObject *psShape;
int dim = arcPoints.size();
double xv[dim];
double yv[dim];
double zv[dim];
double *xv = new double[dim];
double *yv = new double[dim];
double *zv = new double[dim];

for (int i=0; i < dim; i++)
{
@@ -375,8 +377,11 @@ void Builder::addArc(const DL_ArcData& data)

}

psShape = SHPCreateObject( shapefileType, fetchedprims, 0, NULL, NULL,
dim, xv, yv, zv, NULL );
psShape = SHPCreateObject( shapefileType, fetchedprims, 0, NULL, NULL, dim, xv, yv, zv, NULL );

delete [] xv;
delete [] yv;
delete [] zv;

shpObjects.push_back(psShape);

@@ -427,9 +432,9 @@ void Builder::addCircle(const DL_CircleData& data)

SHPObject *psShape;
int dim = circlePoints.size();
double xv[dim];
double yv[dim];
double zv[dim];
double *xv = new double[dim];
double *yv = new double[dim];
double *zv = new double[dim];

for (int i=0; i < dim; i++)
{
@@ -439,8 +444,11 @@ void Builder::addCircle(const DL_CircleData& data)

}

psShape = SHPCreateObject( shapefileType, fetchedprims, 0, NULL, NULL,
dim, xv, yv, zv, NULL );
psShape = SHPCreateObject( shapefileType, fetchedprims, 0, NULL, NULL, dim, xv, yv, zv, NULL );

delete [] xv;
delete [] yv;
delete [] zv;

shpObjects.push_back(psShape);

@@ -502,9 +510,9 @@ void Builder::FinalizeAnyPolyline()

SHPObject *psObject;
int dim = polyVertex.size();
double xv[dim];
double yv[dim];
double zv[dim];
double *xv = new double[dim];
double *yv = new double[dim];
double *zv = new double[dim];

for (int i=0; i < dim; i++)
{
@@ -514,8 +522,11 @@ void Builder::FinalizeAnyPolyline()

}

psObject = SHPCreateObject( shapefileType, fetchedprims, 0, NULL, NULL,
dim, xv, yv, zv, NULL );
psObject = SHPCreateObject( shapefileType, fetchedprims, 0, NULL, NULL, dim, xv, yv, zv, NULL );

delete [] xv;
delete [] yv;
delete [] zv;

shpObjects.push_back(psObject);

@@ -25,11 +25,8 @@
**
**********************************************************************/

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <stdio.h>
#include <cstdio>
#include <cstring>

#include "dl_writer_ascii.h"
#include "dl_exception.h"

0 comments on commit 065b256

Please sign in to comment.