~ubuntu-branches/ubuntu/natty/qgis/natty

« back to all changes in this revision

Viewing changes to src/plugins/dxf2shp_converter/getInsertions.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Johan Van de Wauw
  • Date: 2010-07-11 20:23:24 UTC
  • mfrom: (3.1.4 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100711202324-5ktghxa7hracohmr
Tags: 1.4.0+12730-3ubuntu1
* Merge from Debian unstable (LP: #540941).
* Fix compilation issues with QT 4.7
* Add build-depends on libqt4-webkit-dev 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// LICENSE:
 
2
//
 
3
// This code is released under the GPL (GNU Public License) version 2.0.
 
4
// For full details, see the file GPL.txt included with this source code.
 
5
//
 
6
// What this means:
 
7
//
 
8
// This means, in simple terms, that you are free to use this code for any open-source or
 
9
// public domain project. You may NOT use this source code as part of a commercial application.
 
10
// It may be included, in binary form and bearing a GPL notice, along with commercial
 
11
// applications, but the code shall not be compiled directly into a closed-source,
 
12
// commercial application.
 
13
//
 
14
// This code is based on two other products:
 
15
// DXFLIB (http://www.ribbonsoft.com/dxflib.html)
 
16
//    This is a library for reading DXF files, also GPL.
 
17
// MAPWINGIS (http://www.mapwindow.org)
 
18
//    This is a library for many general-purpose GIS and mapping applications. It's
 
19
//    used for the Shapefile functionality. This software is also open source, this one MPL.
 
20
//
 
21
// Questions/Comments/Thoughts?
 
22
//    http://www.happysquirrel.com/index.php?feature=hs_questions
 
23
//
 
24
// Thank you!
 
25
// Christopher Michaelis
 
26
 
 
27
// getInsertions.cpp: The class which retrieves the block insertions from the DXF file
 
28
 
 
29
 
 
30
#include "getInsertions.h"
 
31
 
 
32
InsertRetrClass::InsertRetrClass()
 
33
{
 
34
  Names = new string[MaxInserts];
 
35
  XVals = new double[MaxInserts];
 
36
  YVals = new double[MaxInserts];
 
37
 
 
38
  countInserts = 0;
 
39
}
 
40
 
 
41
InsertRetrClass::~InsertRetrClass()
 
42
{
 
43
  if ( Names != NULL )
 
44
  {
 
45
    delete [] Names;
 
46
    Names = NULL;
 
47
  }
 
48
  if ( XVals != NULL )
 
49
  {
 
50
    delete [] XVals;
 
51
    XVals = NULL;
 
52
  }
 
53
  if ( YVals != NULL )
 
54
  {
 
55
    delete [] YVals;
 
56
    YVals = NULL;
 
57
  }
 
58
}
 
59
 
 
60
void InsertRetrClass::addInsert( const DL_InsertData &data )
 
61
{
 
62
  if ( countInserts < MaxInserts )
 
63
  {
 
64
    Names[countInserts] = data.name;
 
65
    XVals[countInserts] = data.ipx;
 
66
    YVals[countInserts] = data.ipy;
 
67
  }
 
68
  countInserts++;
 
69
}