ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
test_creationclass.cpp
Go to the documentation of this file.
1 /*
2  * @file test_creationclass.cpp
3  */
4 
5 /*****************************************************************************
6 ** $Id: test_creationclass.cpp 8865 2008-02-04 18:54:02Z andrew $
7 **
8 ** This is part of the dxflib library
9 ** Copyright (C) 2001 Andrew Mustun
10 **
11 ** This program is free software; you can redistribute it and/or modify
12 ** it under the terms of the GNU Library General Public License as
13 ** published by the Free Software Foundation.
14 **
15 ** This program is distributed in the hope that it will be useful,
16 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ** GNU Library General Public License for more details.
19 **
20 ** You should have received a copy of the GNU Library General Public License
21 ** along with this program; if not, write to the Free Software
22 ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 ******************************************************************************/
24 
25 #include "test_creationclass.h"
26 
27 #include <stdio.h>
28 
29 #include <iostream>
30 
35 
40  printf("LAYER: %s flags: %d\n", data.name.c_str(), data.flags);
42 }
43 
48  printf("POINT (%6.3f, %6.3f, %6.3f)\n", data.x, data.y, data.z);
50 }
51 
56  printf("LINE (%6.3f, %6.3f, %6.3f) (%6.3f, %6.3f, %6.3f)\n", data.x1,
57  data.y1, data.z1, data.x2, data.y2, data.z2);
59 }
60 
65  printf("ARC (%6.3f, %6.3f, %6.3f) %6.3f, %6.3f, %6.3f\n", data.cx,
66  data.cy, data.cz, data.radius, data.angle1, data.angle2);
68 }
69 
74  printf("CIRCLE (%6.3f, %6.3f, %6.3f) %6.3f\n", data.cx, data.cy, data.cz,
75  data.radius);
77 }
78 
83  printf("POLYLINE \n");
84  printf("flags: %d\n", (int)data.flags);
86 }
87 
92  printf("VERTEX (%6.3f, %6.3f, %6.3f) %6.3f\n", data.x, data.y, data.z,
93  data.bulge);
95 }
96 
98  printf("3DFACE\n");
99  for (int i = 0; i < 4; i++) {
100  printf(" corner %d: %6.3f %6.3f %6.3f\n", i, data.x[i], data.y[i],
101  data.z[i]);
102  }
103  printAttributes();
104 }
105 
107  printf(" Attributes: Layer: %s, ", attributes.getLayer().c_str());
108  printf(" Color: ");
109  if (attributes.getColor() == 256) {
110  printf("BYLAYER");
111  } else if (attributes.getColor() == 0) {
112  printf("BYBLOCK");
113  } else {
114  printf("%d", attributes.getColor());
115  }
116  printf(" Width: ");
117  if (attributes.getWidth() == -1) {
118  printf("BYLAYER");
119  } else if (attributes.getWidth() == -2) {
120  printf("BYBLOCK");
121  } else if (attributes.getWidth() == -3) {
122  printf("DEFAULT");
123  } else {
124  printf("%d", attributes.getWidth());
125  }
126  printf(" Type: %s\n", attributes.getLinetype().c_str());
127 }
128 
129 // EOF
std::string getLinetype() const
int getColor() const
int getWidth() const
std::string getLayer() const
virtual void addPoint(const DL_PointData &data)
virtual void add3dFace(const DL_3dFaceData &data)
virtual void addVertex(const DL_VertexData &data)
virtual void addPolyline(const DL_PolylineData &data)
virtual void addCircle(const DL_CircleData &data)
virtual void addArc(const DL_ArcData &data)
virtual void addLine(const DL_LineData &data)
virtual void addLayer(const DL_LayerData &data)
GraphType data
Definition: graph_cut.cc:138