dxf_line_arc_parser.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017, <copyright holder> <email>
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  * * Redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer.
9  * * Redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution.
12  * * Neither the name of the <organization> nor the
13  * names of its contributors may be used to endorse or promote products
14  * derived from this software without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED BY <copyright holder> <email> ''AS IS'' AND ANY
17  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19  * DISCLAIMED. IN NO EVENT SHALL <copyright holder> <email> BE LIABLE FOR ANY
20  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26  *
27  */
28 
30 #include <iostream>
31 
32 namespace tuw_graph
33 {
34  void DxfLineArcParser::addLine(const DL_LineData &_line)
35  {
36  //Arc: start / end
37  lines_.push_back(_line);
38  }
39 
40  void DxfLineArcParser::addArc(const DL_ArcData &_arc)
41  {
42  //Arc: center / radius / angle in pos rotational direction
43  arcs_.push_back(_arc);
44  }
45 
46  void DxfLineArcParser::addCircle(const DL_CircleData &_circle)
47  {
48  //Arc: center / radius
49  circles_.push_back(_circle);
50  }
51 
53  {
54  lines_.clear();
55  arcs_.clear();
56  circles_.clear();
57  }
58 
59  void DxfLineArcParser::addImage(const DL_ImageData &_image)
60  {
61  //std::cout << "image: h " << _image.height << " w " << _image.width << " ipx " << _image.ipx << " ipy " << _image.ipy << " ref " << _image.ref << " ux " << _image.ux << " uy " << _image.uy << " vx " << _image.vx << " vy " << _image.vy << std::endl;
62  //std::cout << "scale: " << sqrt((_image.ux * _image.ux) + (_image.uy * _image.uy)) << std::endl;
63 
64 
65  images_.push_back(_image);
66 
67  }
68 
69  const std::vector<DL_ImageData> &DxfLineArcParser::getImage()
70  {
71  return images_;
72  }
73 
74  const std::vector< DL_ArcData > &DxfLineArcParser::getArcs()
75  {
76  return arcs_;
77  }
78 
79  const std::vector< DL_CircleData > &DxfLineArcParser::getCircles()
80  {
81  return circles_;
82  }
83 
84  const std::vector< DL_LineData > &DxfLineArcParser::getLines()
85  {
86  return lines_;
87  }
88 
89 }
std::vector< DL_ArcData > arcs_
std::vector< DL_CircleData > circles_
std::vector< DL_ImageData > images_
const std::vector< DL_ArcData > & getArcs()
virtual void addCircle(const DL_CircleData &_circle)
const std::vector< DL_CircleData > & getCircles()
void reset()
resets the creation interface
const std::vector< DL_ImageData > & getImage()
virtual void addArc(const DL_ArcData &_arc)
std::vector< DL_LineData > lines_
virtual void addLine(const DL_LineData &_line)
virtual void addImage(const DL_ImageData &_image)
const std::vector< DL_LineData > & getLines()


tuw_voronoi_graph
Author(s): Benjamin Binder
autogenerated on Mon Jun 10 2019 15:42:44