2 * @file test_creationclass.cpp
5 /*****************************************************************************
6 ** $Id: test_creationclass.cpp 163 2003-07-01 15:51:48Z andrew $
8 ** This is part of the dxflib library
9 ** Copyright (C) 2001 Andrew Mustun
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.
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.
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 ******************************************************************************/
25 #include "test_creationclass.h"
32 * Default constructor.
34 Test_CreationClass::Test_CreationClass() {}
38 * Sample implementation of the method which handles layers.
40 void Test_CreationClass::addLayer(const DL_LayerData& data) {
41 printf("LAYER: %s flags: %d\n", data.name.c_str(), data.flags);
46 * Sample implementation of the method which handles point entities.
48 void Test_CreationClass::addPoint(const DL_PointData& data) {
49 printf("POINT (%6.3f, %6.3f, %6.3f)\n",
50 data.x, data.y, data.z);
55 * Sample implementation of the method which handles line entities.
57 void Test_CreationClass::addLine(const DL_LineData& data) {
58 printf("LINE (%6.3f, %6.3f, %6.3f) (%6.3f, %6.3f, %6.3f)\n",
59 data.x1, data.y1, data.z1, data.x2, data.y2, data.z2);
64 * Sample implementation of the method which handles arc entities.
66 void Test_CreationClass::addArc(const DL_ArcData& data) {
67 printf("ARC (%6.3f, %6.3f, %6.3f) %6.3f, %6.3f, %6.3f\n",
68 data.cx, data.cy, data.cz,
69 data.radius, data.angle1, data.angle2);
74 * Sample implementation of the method which handles circle entities.
76 void Test_CreationClass::addCircle(const DL_CircleData& data) {
77 printf("CIRCLE (%6.3f, %6.3f, %6.3f) %6.3f\n",
78 data.cx, data.cy, data.cz,
85 * Sample implementation of the method which handles polyline entities.
87 void Test_CreationClass::addPolyline(const DL_PolylineData& data) {
88 printf("POLYLINE \n");
89 printf("flags: %d\n", (int)data.flags);
95 * Sample implementation of the method which handles vertices.
97 void Test_CreationClass::addVertex(const DL_VertexData& data) {
98 printf("VERTEX (%6.3f, %6.3f, %6.3f) %6.3f\n",
99 data.x, data.y, data.z,
105 void Test_CreationClass::printAttributes() {
106 printf(" Attributes: Layer: %s, ", attributes.getLayer().c_str());
108 if (attributes.getColor()==256) {
110 } else if (attributes.getColor()==0) {
113 printf("%d", attributes.getColor());
116 if (attributes.getWidth()==-1) {
118 } else if (attributes.getWidth()==-2) {
120 } else if (attributes.getWidth()==-3) {
123 printf("%d", attributes.getWidth());
125 printf(" Type: %s\n", attributes.getLineType().c_str());