svn-gvsig-desktop / branches / v10 / libraries / libDwg / src / com / iver / cit / jdwglib / dwg / objects / DwgVertex2D.java @ 10539
History | View | Annotate | Download (2.91 KB)
1 |
/* jdwglib. Java Library for reading Dwg files.
|
---|---|
2 |
*
|
3 |
* Author: Jose Morell Rama (jose.morell@gmail.com).
|
4 |
* Port from the Pythoncad Dwg library by Art Haas.
|
5 |
*
|
6 |
* Copyright (C) 2005 Jose Morell, IVER TI S.A. and Generalitat Valenciana
|
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, write to the Free Software
|
20 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
21 |
*
|
22 |
* For more information, contact:
|
23 |
*
|
24 |
* Jose Morell (jose.morell@gmail.com)
|
25 |
*
|
26 |
* or
|
27 |
*
|
28 |
* IVER TI S.A.
|
29 |
* C/Salamanca, 50
|
30 |
* 46005 Valencia
|
31 |
* Spain
|
32 |
* +34 963163400
|
33 |
* dac@iver.es
|
34 |
*/
|
35 |
package com.iver.cit.jdwglib.dwg.objects; |
36 |
|
37 |
import com.iver.cit.jdwglib.dwg.DwgObject; |
38 |
|
39 |
/**
|
40 |
* The DwgVertex2D class represents a DWG Vertex2D
|
41 |
*
|
42 |
* @author jmorell
|
43 |
*/
|
44 |
public class DwgVertex2D extends DwgObject { |
45 |
public DwgVertex2D(int index) { |
46 |
super(index);
|
47 |
// TODO Auto-generated constructor stub
|
48 |
} |
49 |
private int flags; |
50 |
private double[] point; |
51 |
private double initWidth; |
52 |
private double endWidth; |
53 |
private double bulge; |
54 |
private double tangentDir; |
55 |
|
56 |
|
57 |
/**
|
58 |
* @return Returns the bulge.
|
59 |
*/
|
60 |
public double getBulge() { |
61 |
return bulge;
|
62 |
} |
63 |
/**
|
64 |
* @param bulge The bulge to set.
|
65 |
*/
|
66 |
public void setBulge(double bulge) { |
67 |
this.bulge = bulge;
|
68 |
} |
69 |
/**
|
70 |
* @return Returns the flags.
|
71 |
*/
|
72 |
public int getFlags() { |
73 |
return flags;
|
74 |
} |
75 |
/**
|
76 |
* @param flags The flags to set.
|
77 |
*/
|
78 |
public void setFlags(int flags) { |
79 |
this.flags = flags;
|
80 |
} |
81 |
/**
|
82 |
* @return Returns the point.
|
83 |
*/
|
84 |
public double[] getPoint() { |
85 |
return point;
|
86 |
} |
87 |
/**
|
88 |
* @param point The point to set.
|
89 |
*/
|
90 |
public void setPoint(double[] point) { |
91 |
this.point = point;
|
92 |
} |
93 |
public double getEndWidth() { |
94 |
return endWidth;
|
95 |
} |
96 |
public void setEndWidth(double endWidth) { |
97 |
this.endWidth = endWidth;
|
98 |
} |
99 |
public double getInitWidth() { |
100 |
return initWidth;
|
101 |
} |
102 |
public void setInitWidth(double initWidth) { |
103 |
this.initWidth = initWidth;
|
104 |
} |
105 |
public double getTangentDir() { |
106 |
return tangentDir;
|
107 |
} |
108 |
public void setTangentDir(double tangentDir) { |
109 |
this.tangentDir = tangentDir;
|
110 |
} |
111 |
public Object clone(){ |
112 |
DwgVertex2D obj = new DwgVertex2D(index);
|
113 |
this.fill(obj);
|
114 |
return obj;
|
115 |
} |
116 |
|
117 |
protected void fill(DwgObject obj){ |
118 |
super.fill(obj);
|
119 |
DwgVertex2D myObj = (DwgVertex2D)obj; |
120 |
|
121 |
myObj.setBulge(bulge); |
122 |
myObj.setEndWidth(endWidth); |
123 |
myObj.setFlags(flags); |
124 |
myObj.setInitWidth(initWidth); |
125 |
myObj.setPoint(point); |
126 |
myObj.setTangentDir(tangentDir); |
127 |
} |
128 |
|
129 |
} |