KiCad PCB EDA Suite
Loading...
Searching...
No Matches
svg_import_plugin.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KICAD, a free EDA CAD application.
3 *
4 * Copyright (C) 2016 CERN
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 * @author Janito V. Ferreira Filho
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, you may find one here:
20 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21 * or you may search the http://www.gnu.org website for the version 2 license,
22 * or you may write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24 */
25
26#include "svg_import_plugin.h"
27
28#include <nanosvg.h>
29#include <algorithm>
30#include <cmath>
31#include <locale_io.h>
32
33#include <eda_item.h>
34#include "graphics_importer.h"
35
36static const int SVG_DPI = 96;
37
38static VECTOR2D calculateBezierBoundingBoxExtremity( const float* aCurvePoints,
39 std::function< const float&( const float&, const float& ) > comparator );
40static float calculateBezierSegmentationThreshold( const float* aCurvePoints );
41static void segmentBezierCurve( const VECTOR2D& aStart, const VECTOR2D& aEnd, float aOffset,
42 float aStep, const float* aCurvePoints, float aSegmentationThreshold,
43 std::vector< VECTOR2D >& aGeneratedPoints );
44static void createNewBezierCurveSegments( const VECTOR2D& aStart, const VECTOR2D& aMiddle,
45 const VECTOR2D& aEnd, float aOffset, float aStep, const float* aCurvePoints,
46 float aSegmentationThreshold, std::vector< VECTOR2D >& aGeneratedPoints );
47static VECTOR2D getBezierPoint( const float* aCurvePoints, float aStep );
48static VECTOR2D getPoint( const float* aPointCoordinates );
49static VECTOR2D getPointInLine( const VECTOR2D& aLineStart, const VECTOR2D& aLineEnd,
50 float aDistance );
51static float distanceFromPointToLine( const VECTOR2D& aPoint, const VECTOR2D& aLineStart,
52 const VECTOR2D& aLineEnd );
53
54
55bool SVG_IMPORT_PLUGIN::Load( const wxString& aFileName )
56{
57 wxCHECK( m_importer, false );
58
59 LOCALE_IO toggle; // switch on/off the locale "C" notation
60
61 // 1- wxFopen takes care of unicode filenames across platforms
62 // 2 - nanosvg (exactly nsvgParseFromFile) expects a binary file (exactly the CRLF eof must
63 // not be replaced by LF and changes the byte count) in one validity test,
64 // so open it in binary mode.
65 FILE* fp = wxFopen( aFileName, wxT( "rb" ) );
66
67 if( fp == nullptr )
68 return false;
69
70 // nsvgParseFromFile will close the file after reading
71 m_parsedImage = nsvgParseFromFile( fp, "mm", SVG_DPI );
72
73 wxCHECK( m_parsedImage, false );
74
75 return true;
76}
77
78
79bool SVG_IMPORT_PLUGIN::LoadFromMemory( const wxMemoryBuffer& aMemBuffer )
80{
81 wxCHECK( m_importer, false );
82
83 LOCALE_IO toggle; // switch on/off the locale "C" notation
84
85 std::string str( reinterpret_cast<char*>( aMemBuffer.GetData() ), aMemBuffer.GetDataLen() );
86 wxCHECK( str.data()[aMemBuffer.GetDataLen()] == '\0', false );
87
88 // nsvgParse will modify the string data
89 m_parsedImage = nsvgParse( str.data(), "mm", SVG_DPI );
90
91 wxCHECK( m_parsedImage, false );
92
93 return true;
94}
95
96
98{
99 auto alpha =
100 []( unsigned int color )
101 {
102 return color >> 24;
103 };
104
105 for( NSVGshape* shape = m_parsedImage->shapes; shape != nullptr; shape = shape->next )
106 {
107 if( !( shape->flags & NSVG_FLAGS_VISIBLE ) )
108 continue;
109
110 if( shape->stroke.type == NSVG_PAINT_NONE && shape->fill.type == NSVG_PAINT_NONE )
111 continue;
112
113 double lineWidth = shape->stroke.type != NSVG_PAINT_NONE ? shape->strokeWidth : -1;
114 bool filled = shape->fill.type != NSVG_PAINT_NONE && alpha( shape->fill.color ) > 0;
115
116 COLOR4D fillColor = COLOR4D::UNSPECIFIED;
117
118 if( shape->fill.type == NSVG_PAINT_COLOR )
119 {
120 unsigned int icolor = shape->fill.color;
121
122 fillColor.r = std::clamp( ( icolor >> 0 ) & 0xFF, 0u, 255u ) / 255.0;
123 fillColor.g = std::clamp( ( icolor >> 8 ) & 0xFF, 0u, 255u ) / 255.0;
124 fillColor.b = std::clamp( ( icolor >> 16 ) & 0xFF, 0u, 255u ) / 255.0;
125 fillColor.a = std::clamp( ( icolor >> 24 ) & 0xFF, 0u, 255u ) / 255.0;
126
127 // nanosvg probably didn't read it properly, use default
128 if( fillColor == COLOR4D::BLACK )
129 fillColor = COLOR4D::UNSPECIFIED;
130 }
131
132 COLOR4D strokeColor = COLOR4D::UNSPECIFIED;
133
134 if( shape->stroke.type == NSVG_PAINT_COLOR )
135 {
136 unsigned int icolor = shape->stroke.color;
137
138 strokeColor.r = std::clamp( ( icolor >> 0 ) & 0xFF, 0u, 255u ) / 255.0;
139 strokeColor.g = std::clamp( ( icolor >> 8 ) & 0xFF, 0u, 255u ) / 255.0;
140 strokeColor.b = std::clamp( ( icolor >> 16 ) & 0xFF, 0u, 255u ) / 255.0;
141 strokeColor.a = std::clamp( ( icolor >> 24 ) & 0xFF, 0u, 255u ) / 255.0;
142
143 // nanosvg probably didn't read it properly, use default
144 if( strokeColor == COLOR4D::BLACK )
145 strokeColor = COLOR4D::UNSPECIFIED;
146 }
147
148 LINE_STYLE dashType = LINE_STYLE::SOLID;
149
150 if( shape->strokeDashCount > 0 )
151 {
152 float* dashArray = shape->strokeDashArray;
153
154 int dotCount = 0;
155 int dashCount = 0;
156
157 const float dashThreshold = shape->strokeWidth * 1.9f;
158
159 for( int i = 0; i < shape->strokeDashCount; i += 2 )
160 {
161 if( dashArray[i] < dashThreshold )
162 dotCount++;
163 else
164 dashCount++;
165 }
166
167 if( dotCount > 0 && dashCount == 0 )
168 dashType = LINE_STYLE::DOT;
169 else if( dotCount == 0 && dashCount > 0 )
170 dashType = LINE_STYLE::DASH;
171 else if( dotCount == 1 && dashCount == 1 )
172 dashType = LINE_STYLE::DASHDOT;
173 else if( dotCount == 2 && dashCount == 1 )
174 dashType = LINE_STYLE::DASHDOTDOT;
175 }
176
177 IMPORTED_STROKE stroke( lineWidth, dashType, strokeColor );
178
180
181 switch( shape->fillRule )
182 {
183 case NSVG_FILLRULE_NONZERO: rule = GRAPHICS_IMPORTER::PF_NONZERO; break;
184 case NSVG_FILLRULE_EVENODD: rule = GRAPHICS_IMPORTER::PF_EVEN_ODD; break;
185 default: break;
186 }
187
189
190 for( NSVGpath* path = shape->paths; path != nullptr; path = path->next )
191 {
192 if( filled && !path->closed )
193 {
194 // KiCad doesn't support a single object representing a filled shape that is
195 // *not* closed so create a filled, closed shape for the fill, and an unfilled,
196 // open shape for the outline
197 static IMPORTED_STROKE noStroke( -1, LINE_STYLE::SOLID, COLOR4D::UNSPECIFIED );
198 DrawPath( path->pts, path->npts, true, noStroke, true, fillColor );
199 DrawPath( path->pts, path->npts, false, stroke, false, COLOR4D::UNSPECIFIED );
200 }
201 else
202 {
203 // Either the shape has fill and no stroke, so we implicitly close it (for no
204 // difference), or it's really closed.
205 // We could choose to import a not-filled, closed outline as splines to keep the
206 // original editability and control points, but currently we don't.
207 const bool closed = path->closed || filled;
208
209 DrawPath( path->pts, path->npts, closed, stroke, filled, fillColor );
210 }
211 }
212 }
213
215 wxCHECK( m_importer, false );
217
218 return true;
219}
220
221
223{
224 if( !m_parsedImage )
225 {
226 wxASSERT_MSG( false, wxT( "Image must have been loaded before checking height" ) );
227 return 0.0;
228 }
229
230 return m_parsedImage->height / SVG_DPI * inches2mm;
231}
232
233
235{
236 if( !m_parsedImage )
237 {
238 wxASSERT_MSG( false, wxT( "Image must have been loaded before checking width" ) );
239 return 0.0;
240 }
241
242 return m_parsedImage->width / SVG_DPI * inches2mm;
243}
244
245
247{
248 BOX2D bbox;
249
250 if( !m_parsedImage || !m_parsedImage->shapes )
251 {
252 wxASSERT_MSG( false, wxT( "Image must have been loaded before getting bbox" ) );
253 return bbox;
254 }
255
256 for( NSVGshape* shape = m_parsedImage->shapes; shape != nullptr; shape = shape->next )
257 {
258 BOX2D shapeBbox;
259 float( &bounds )[4] = shape->bounds;
260
261 shapeBbox.SetOrigin( bounds[0], bounds[1] );
262 shapeBbox.SetEnd( bounds[2], bounds[3] );
263
264 bbox.Merge( shapeBbox );
265 }
266
267 return bbox;
268}
269
270
271static void GatherInterpolatedCubicBezierCurve( const float* aPoints,
272 std::vector<VECTOR2D>& aGeneratedPoints )
273{
274 auto start = getBezierPoint( aPoints, 0.0f );
275 auto end = getBezierPoint( aPoints, 1.0f );
276 auto segmentationThreshold = calculateBezierSegmentationThreshold( aPoints );
277
278 if( aGeneratedPoints.size() == 0 || aGeneratedPoints.back() != start )
279 aGeneratedPoints.push_back( start );
280
281 segmentBezierCurve( start, end, 0.0f, 0.5f, aPoints, segmentationThreshold, aGeneratedPoints );
282 aGeneratedPoints.push_back( end );
283}
284
285
286static void GatherInterpolatedCubicBezierPath( const float* aPoints, int aNumPoints,
287 std::vector<VECTOR2D>& aGeneratedPoints )
288{
289 const int pointsPerSegment = 4;
290 const int curveSpecificPointsPerSegment = 3;
291 const int curveSpecificCoordinatesPerSegment = 2 * curveSpecificPointsPerSegment;
292 const float* currentPoints = aPoints;
293 int remainingPoints = aNumPoints;
294
295 while( remainingPoints >= pointsPerSegment )
296 {
297 GatherInterpolatedCubicBezierCurve( currentPoints, aGeneratedPoints );
298 currentPoints += curveSpecificCoordinatesPerSegment;
299 remainingPoints -= curveSpecificPointsPerSegment;
300 }
301}
302
303
304void SVG_IMPORT_PLUGIN::DrawPath( const float* aPoints, int aNumPoints, bool aClosedPath,
305 const IMPORTED_STROKE& aStroke, bool aFilled,
306 const COLOR4D& aFillColor )
307{
308 bool drewPolygon = false;
309
310 if( aClosedPath )
311 {
312 // Closed paths are always polygons, which mean they need to be interpolated
313 std::vector<VECTOR2D> collectedPathPoints;
314
315 if( aNumPoints > 0 )
316 GatherInterpolatedCubicBezierPath( aPoints, aNumPoints, collectedPathPoints );
317
318 if( collectedPathPoints.size() > 2 )
319 {
320 DrawPolygon( collectedPathPoints, aStroke, aFilled, aFillColor );
321 drewPolygon = true;
322 }
323 }
324
325 if( !drewPolygon )
326 {
327 DrawSplinePath( aPoints, aNumPoints, aStroke );
328 }
329}
330
331
332void SVG_IMPORT_PLUGIN::DrawSplinePath( const float* aCoords, int aNumPoints,
333 const IMPORTED_STROKE& aStroke )
334{
335 // NanoSVG just gives us the points of the Bezier curves, so we have to
336 // decide whether to draw lines or splines based on the points we have.
337
338 const int pointsPerSegment = 4;
339 const int curveSpecificPointsPerSegment = 3;
340 const int curveSpecificCoordinatesPerSegment = 2 * curveSpecificPointsPerSegment;
341 const float* currentCoords = aCoords;
342 int remainingPoints = aNumPoints;
343
344 while( remainingPoints >= pointsPerSegment )
345 {
346 VECTOR2D start = getPoint( currentCoords );
347 VECTOR2D c1 = getPoint( currentCoords + 2 );
348 VECTOR2D c2 = getPoint( currentCoords + 4 );
349 VECTOR2D end = getPoint( currentCoords + 6 );
350
351 // Add as a spline and the importer will decide whether to draw it as a spline or as lines
352 m_internalImporter.AddSpline( start, c1, c2, end, aStroke );
353
354 currentCoords += curveSpecificCoordinatesPerSegment;
355 remainingPoints -= curveSpecificPointsPerSegment;
356 }
357}
358
359
360void SVG_IMPORT_PLUGIN::DrawPolygon( const std::vector<VECTOR2D>& aPoints,
361 const IMPORTED_STROKE& aStroke, bool aFilled,
362 const COLOR4D& aFillColor )
363{
364 m_internalImporter.AddPolygon( aPoints, aStroke, aFilled, aFillColor );
365}
366
367
368void SVG_IMPORT_PLUGIN::DrawLineSegments( const std::vector<VECTOR2D>& aPoints,
369 const IMPORTED_STROKE& aStroke )
370{
371 unsigned int numLineStartPoints = aPoints.size() - 1;
372
373 for( unsigned int pointIndex = 0; pointIndex < numLineStartPoints; ++pointIndex )
374 m_internalImporter.AddLine( aPoints[pointIndex], aPoints[pointIndex + 1], aStroke );
375}
376
377
378static VECTOR2D getPoint( const float* aPointCoordinates )
379{
380 return VECTOR2D( aPointCoordinates[0], aPointCoordinates[1] );
381}
382
383
384static VECTOR2D getBezierPoint( const float* aPoints, float aStep )
385{
386 const int coordinatesPerPoint = 2;
387
388 auto firstCubicPoint = getPoint( aPoints );
389 auto secondCubicPoint = getPoint( aPoints + 1 * coordinatesPerPoint );
390 auto thirdCubicPoint = getPoint( aPoints + 2 * coordinatesPerPoint );
391 auto fourthCubicPoint = getPoint( aPoints + 3 * coordinatesPerPoint );
392
393 auto firstQuadraticPoint = getPointInLine( firstCubicPoint, secondCubicPoint, aStep );
394 auto secondQuadraticPoint = getPointInLine( secondCubicPoint, thirdCubicPoint, aStep );
395 auto thirdQuadraticPoint = getPointInLine( thirdCubicPoint, fourthCubicPoint, aStep );
396
397 auto firstLinearPoint = getPointInLine( firstQuadraticPoint, secondQuadraticPoint, aStep );
398 auto secondLinearPoint = getPointInLine( secondQuadraticPoint, thirdQuadraticPoint, aStep );
399
400 return getPointInLine( firstLinearPoint, secondLinearPoint, aStep );
401}
402
403
404static VECTOR2D getPointInLine( const VECTOR2D& aLineStart, const VECTOR2D& aLineEnd,
405 float aDistance )
406{
407 return aLineStart + ( aLineEnd - aLineStart ) * aDistance;
408}
409
410
411static float calculateBezierSegmentationThreshold( const float* aCurvePoints )
412{
413 using comparatorFunction = const float&(*)( const float&, const float& );
414
415 auto minimumComparator = static_cast< comparatorFunction >( &std::min );
416 auto maximumComparator = static_cast< comparatorFunction >( &std::max );
417
418 VECTOR2D minimum = calculateBezierBoundingBoxExtremity( aCurvePoints, minimumComparator );
419 VECTOR2D maximum = calculateBezierBoundingBoxExtremity( aCurvePoints, maximumComparator );
420 VECTOR2D boundingBoxDimensions = maximum - minimum;
421
422 return 0.001 * std::max( boundingBoxDimensions.x, boundingBoxDimensions.y );
423}
424
425
426static VECTOR2D calculateBezierBoundingBoxExtremity( const float* aCurvePoints,
427 std::function< const float&( const float&, const float& ) > comparator )
428{
429 float x = aCurvePoints[0];
430 float y = aCurvePoints[1];
431
432 for( int pointIndex = 1; pointIndex < 3; ++pointIndex )
433 {
434 x = comparator( x, aCurvePoints[ 2 * pointIndex ] );
435 y = comparator( y, aCurvePoints[ 2 * pointIndex + 1 ] );
436 }
437
438 return VECTOR2D( x, y );
439}
440
441
442static void segmentBezierCurve( const VECTOR2D& aStart, const VECTOR2D& aEnd, float aOffset,
443 float aStep, const float* aCurvePoints,
444 float aSegmentationThreshold,
445 std::vector< VECTOR2D >& aGeneratedPoints )
446{
447 VECTOR2D middle = getBezierPoint( aCurvePoints, aOffset + aStep );
448 float distanceToPreviousSegment = distanceFromPointToLine( middle, aStart, aEnd );
449
450 if( distanceToPreviousSegment > aSegmentationThreshold )
451 {
452 createNewBezierCurveSegments( aStart, middle, aEnd, aOffset, aStep, aCurvePoints,
453 aSegmentationThreshold, aGeneratedPoints );
454 }
455}
456
457
458static void createNewBezierCurveSegments( const VECTOR2D& aStart, const VECTOR2D& aMiddle,
459 const VECTOR2D& aEnd, float aOffset, float aStep,
460 const float* aCurvePoints, float aSegmentationThreshold,
461 std::vector< VECTOR2D >& aGeneratedPoints )
462{
463 float newStep = aStep / 2.f;
464 float offsetAfterMiddle = aOffset + aStep;
465
466 segmentBezierCurve( aStart, aMiddle, aOffset, newStep, aCurvePoints, aSegmentationThreshold,
467 aGeneratedPoints );
468
469 aGeneratedPoints.push_back( aMiddle );
470
471 segmentBezierCurve( aMiddle, aEnd, offsetAfterMiddle, newStep, aCurvePoints,
472 aSegmentationThreshold, aGeneratedPoints );
473}
474
475
476static float distanceFromPointToLine( const VECTOR2D& aPoint, const VECTOR2D& aLineStart,
477 const VECTOR2D& aLineEnd )
478{
479 auto lineDirection = aLineEnd - aLineStart;
480 auto lineNormal = lineDirection.Perpendicular().Resize( 1.f );
481 auto lineStartToPoint = aPoint - aLineStart;
482
483 auto distance = lineNormal.Dot( lineStartToPoint );
484
485 return fabs( distance );
486}
487
488
489void SVG_IMPORT_PLUGIN::ReportMsg( const wxString& aMessage )
490{
491 // Add message to keep trace of not handled svg entities
492 m_messages += aMessage;
493 m_messages += '\n';
494}
int color
Definition: DXF_plotter.cpp:60
constexpr void SetOrigin(const Vec &pos)
Definition: box2.h:237
constexpr BOX2< Vec > & Merge(const BOX2< Vec > &aRect)
Modify the position and size of the rectangle in order to contain aRect.
Definition: box2.h:658
constexpr void SetEnd(coord_type x, coord_type y)
Definition: box2.h:297
void AddSpline(const VECTOR2D &aStart, const VECTOR2D &aBezierControl1, const VECTOR2D &aBezierControl2, const VECTOR2D &aEnd, const IMPORTED_STROKE &aStroke) override
Create an object representing an arc.
void AddLine(const VECTOR2D &aStart, const VECTOR2D &aEnd, const IMPORTED_STROKE &aStroke) override
Create an object representing a line segment.
void ImportTo(GRAPHICS_IMPORTER &aImporter)
void AddPolygon(const std::vector< VECTOR2D > &aVertices, const IMPORTED_STROKE &aStroke, bool aFilled, const COLOR4D &aFillColor=COLOR4D::UNSPECIFIED) override
Create an object representing a polygon.
virtual void NewShape(POLY_FILL_RULE aFillRule=PF_NONZERO)
GRAPHICS_IMPORTER * m_importer
Importer used to create objects representing the imported shapes.
A clone of IMPORTED_STROKE, but with floating-point width.
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:104
double r
Red component.
Definition: color4d.h:392
double g
Green component.
Definition: color4d.h:393
double a
Alpha component.
Definition: color4d.h:395
double b
Blue component.
Definition: color4d.h:394
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
Definition: locale_io.h:49
void DrawPolygon(const std::vector< VECTOR2D > &aPoints, const IMPORTED_STROKE &aStroke, bool aFilled, const COLOR4D &aFillColor)
virtual BOX2D GetImageBBox() const override
Return image bounding box from original imported file.
GRAPHICS_IMPORTER_BUFFER m_internalImporter
struct NSVGimage * m_parsedImage
void DrawLineSegments(const std::vector< VECTOR2D > &aPoints, const IMPORTED_STROKE &aStroke)
bool Import() override
Actually imports the file.
virtual double GetImageWidth() const override
Return image width from original imported file.
bool LoadFromMemory(const wxMemoryBuffer &aMemBuffer) override
Set memory buffer with content for import.
bool Load(const wxString &aFileName) override
Load file for import.
virtual double GetImageHeight() const override
Return image height from original imported file.
void DrawSplinePath(const float *aPoints, int aNumPoints, const IMPORTED_STROKE &aStroke)
Draw a path made up of cubic Bezier curves, adding them as real bezier curves.
void DrawPath(const float *aPoints, int aNumPoints, bool aClosedPath, const IMPORTED_STROKE &aStroke, bool aFilled, const COLOR4D &aFillColor)
void ReportMsg(const wxString &aMessage) override
constexpr VECTOR2< T > Perpendicular() const
Compute the perpendicular vector.
Definition: vector2d.h:314
VECTOR2< T > Resize(T aNewLength) const
Return a vector of the same direction, but length specified in aNewLength.
Definition: vector2d.h:385
static float distance(const SFVEC2UI &a, const SFVEC2UI &b)
LINE_STYLE
Dashed line types.
Definition: stroke_params.h:46
static void segmentBezierCurve(const VECTOR2D &aStart, const VECTOR2D &aEnd, float aOffset, float aStep, const float *aCurvePoints, float aSegmentationThreshold, std::vector< VECTOR2D > &aGeneratedPoints)
static float distanceFromPointToLine(const VECTOR2D &aPoint, const VECTOR2D &aLineStart, const VECTOR2D &aLineEnd)
static const int SVG_DPI
static VECTOR2D getPointInLine(const VECTOR2D &aLineStart, const VECTOR2D &aLineEnd, float aDistance)
static VECTOR2D getBezierPoint(const float *aCurvePoints, float aStep)
static VECTOR2D calculateBezierBoundingBoxExtremity(const float *aCurvePoints, std::function< const float &(const float &, const float &) > comparator)
static void GatherInterpolatedCubicBezierCurve(const float *aPoints, std::vector< VECTOR2D > &aGeneratedPoints)
static void createNewBezierCurveSegments(const VECTOR2D &aStart, const VECTOR2D &aMiddle, const VECTOR2D &aEnd, float aOffset, float aStep, const float *aCurvePoints, float aSegmentationThreshold, std::vector< VECTOR2D > &aGeneratedPoints)
static VECTOR2D getPoint(const float *aPointCoordinates)
static float calculateBezierSegmentationThreshold(const float *aCurvePoints)
static void GatherInterpolatedCubicBezierPath(const float *aPoints, int aNumPoints, std::vector< VECTOR2D > &aGeneratedPoints)
VECTOR2I end
VECTOR2< double > VECTOR2D
Definition: vector2d.h:694