Skip to content

Commit

Permalink
fix dxf2shp plugin
Browse files Browse the repository at this point in the history
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 065b256
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 30 deletions.
4 changes: 0 additions & 4 deletions src/plugins/dxf2shp_converter/CMakeLists.txt
Expand Up @@ -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)
Expand Down
53 changes: 32 additions & 21 deletions src/plugins/dxf2shp_converter/builder.cpp
Expand Up @@ -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);

Expand Down Expand Up @@ -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++)
{
Expand All @@ -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);

Expand Down Expand Up @@ -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++)
{
Expand All @@ -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);

Expand Down Expand Up @@ -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++)
{
Expand All @@ -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);

Expand Down
7 changes: 2 additions & 5 deletions src/plugins/dxf2shp_converter/dxflib/src/dl_writer_ascii.cpp
Expand Up @@ -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"
Expand Down

0 comments on commit 065b256

Please sign in to comment.