org.kabeja.dxf
Class DXFPolyline

java.lang.Object
  extended by org.kabeja.dxf.DXFEntity
      extended by org.kabeja.dxf.DXFPolyline
Direct Known Subclasses:
DXFLWPolyline

public class DXFPolyline
extends DXFEntity

Author:
Field Summary
protected  int columns
           
protected  boolean constantWidth
           
protected  double endWidth
           
protected static double QUARTER_CIRCLE_ANGLE
           
protected  int rows
           
protected  double startWidth
           
protected  int surefaceDensityColumns
           
protected  int surefaceDensityRows
           
protected  int surefaceType
           
protected  java.util.ArrayList vertices
           
 
Fields inherited from class org.kabeja.dxf.DXFEntity
block, color, colorRGB, doc, extrusion, flags, id, layerID, lineType, linetypeScaleFactor, lineWeight, modelSpace, thickness, transparency, visibile
 
Constructor Summary
DXFPolyline()
           
 
Method Summary
protected  void addToBounds(DXFVertex start, DXFVertex end, Bounds bounds)
           
 void addVertex(DXFVertex vertex)
           
 Bounds getBounds()
           
 int getColumns()
           
 double getEndWidth()
           
 double getLength()
          Returns the length of the entity or 0 if the entity has no length
protected  double getLength(DXFPoint start, DXFPoint end)
          Returns the distance between 2 DXFPoints
protected  double getMeshLength()
           
protected  double getPolyfaceLength()
           
 DXFVertex getPolyFaceMeshVertex(int index)
           
 double getRadius(double bulge, double length)
          Caculate the radius of a cut circle segment between 2 DXFVertex
 int getRows()
           
protected  double getSegmentLength(DXFVertex start, DXFVertex end)
           
protected  double getSplineApproximationLength()
           
 double getStartWidth()
           
 int getSurefaceDensityColumns()
           
 int getSurefaceDensityRows()
           
 int getSurefaceType()
           
 java.lang.String getType()
           
 DXFVertex getVertex(int i)
           
 int getVertexCount()
           
 java.util.Iterator getVertexIterator()
           
 boolean is3DPolygon()
           
 boolean is3DPolygonMesh()
           
 boolean isBezierSurefaceMesh()
           
 boolean isClosed()
           
 boolean isClosedMeshMDirection()
           
 boolean isClosedMeshNDirection()
           
 boolean isConstantWidth()
           
 boolean isCubicSpline()
           
 boolean isCubicSurefaceMesh()
           
 boolean isCurveFitVerticesAdded()
           
 boolean isPolyfaceMesh()
           
 boolean isQuadSpline()
           
 boolean isQuadSurefaceMesh()
           
 boolean isSimpleMesh()
           
 boolean isSplineFitVerticesAdded()
           
 void removeVertex(DXFVertex vertex)
           
 void removeVertex(int index)
           
 void setColumns(int column)
           
 void setEndWidth(double endWidth)
           
 void setRows(int rows)
           
 void setStartWidth(double startWidth)
           
 void setSurefaceDensityColumns(int columns)
           
 void setSurefaceDensityRows(int rows)
           
 void setSurefaceType(int surefaceType)
           
 
Methods inherited from class org.kabeja.dxf.DXFEntity
getColor, getColorRGB, getDXFDocument, getExtrusion, getFlags, getID, getLayerName, getLineType, getLinetypeScaleFactor, getLineWeight, getThickness, getTransparency, isBlockEntity, isModelSpace, isOmitLineType, isVisibile, setBlockEntity, setColor, setColorRGB, setDXFDocument, setExtrusion, setExtrusionX, setExtrusionY, setExtrusionZ, setFlags, setID, setLayerName, setLineType, setLinetypeScaleFactor, setLineWeight, setModelSpace, setThickness, setTransparency, setVisibile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

QUARTER_CIRCLE_ANGLE

protected static final double QUARTER_CIRCLE_ANGLE

vertices

protected java.util.ArrayList vertices

startWidth

protected double startWidth

endWidth

protected double endWidth

constantWidth

protected boolean constantWidth

surefaceType

protected int surefaceType

surefaceDensityRows

protected int surefaceDensityRows

surefaceDensityColumns

protected int surefaceDensityColumns

rows

protected int rows

columns

protected int columns
Constructor Detail

DXFPolyline

public DXFPolyline()
Method Detail

getBounds

public Bounds getBounds()
Specified by:
getBounds in class DXFEntity

addVertex

public void addVertex(DXFVertex vertex)

getVertexCount

public int getVertexCount()

getVertexIterator

public java.util.Iterator getVertexIterator()

removeVertex

public void removeVertex(DXFVertex vertex)

removeVertex

public void removeVertex(int index)

getVertex

public DXFVertex getVertex(int i)

getLength

protected double getLength(DXFPoint start,
                           DXFPoint end)
Returns the distance between 2 DXFPoints

Parameters:
start -
end -
Returns:
the length between the two points

getRadius

public double getRadius(double bulge,
                        double length)
Caculate the radius of a cut circle segment between 2 DXFVertex

Parameters:
bulge - the vertex bulge
length - the length of the circle cut

getType

public java.lang.String getType()
Specified by:
getType in class DXFEntity

getEndWidth

public double getEndWidth()
Returns:
Returns the endWidth.

setEndWidth

public void setEndWidth(double endWidth)
Parameters:
endWidth - The endWidth to set.

getStartWidth

public double getStartWidth()
Returns:
Returns the startWidth.

setStartWidth

public void setStartWidth(double startWidth)
Parameters:
startWidth - The startWidth to set.

isClosed

public boolean isClosed()

isCurveFitVerticesAdded

public boolean isCurveFitVerticesAdded()

isSplineFitVerticesAdded

public boolean isSplineFitVerticesAdded()

is3DPolygon

public boolean is3DPolygon()

is3DPolygonMesh

public boolean is3DPolygonMesh()

isPolyfaceMesh

public boolean isPolyfaceMesh()

isClosedMeshNDirection

public boolean isClosedMeshNDirection()

isClosedMeshMDirection

public boolean isClosedMeshMDirection()

isQuadSpline

public boolean isQuadSpline()

isCubicSpline

public boolean isCubicSpline()

isConstantWidth

public boolean isConstantWidth()

getSurefaceType

public int getSurefaceType()
Returns:
Returns the surefaceType.

setSurefaceType

public void setSurefaceType(int surefaceType)
Parameters:
surefaceType - The surefaceType to set.

getSurefaceDensityColumns

public int getSurefaceDensityColumns()
Returns:
Returns the columns.

setSurefaceDensityColumns

public void setSurefaceDensityColumns(int columns)
Parameters:
columns - The columns to set.

getSurefaceDensityRows

public int getSurefaceDensityRows()
Returns:
Returns the rows.

setSurefaceDensityRows

public void setSurefaceDensityRows(int rows)
Parameters:
rows - The rows to set.

addToBounds

protected void addToBounds(DXFVertex start,
                           DXFVertex end,
                           Bounds bounds)

getPolyFaceMeshVertex

public DXFVertex getPolyFaceMeshVertex(int index)

getColumns

public int getColumns()
Returns:
Returns the column.

setColumns

public void setColumns(int column)
Parameters:
column - The column to set.

getRows

public int getRows()
Returns:
Returns the rows.

setRows

public void setRows(int rows)
Parameters:
rows - The rows to set.

isSimpleMesh

public boolean isSimpleMesh()

isQuadSurefaceMesh

public boolean isQuadSurefaceMesh()

isCubicSurefaceMesh

public boolean isCubicSurefaceMesh()

isBezierSurefaceMesh

public boolean isBezierSurefaceMesh()

getLength

public double getLength()
Description copied from class: DXFEntity
Returns the length of the entity or 0 if the entity has no length

Specified by:
getLength in class DXFEntity
Returns:

getSegmentLength

protected double getSegmentLength(DXFVertex start,
                                  DXFVertex end)

getSplineApproximationLength

protected double getSplineApproximationLength()

getPolyfaceLength

protected double getPolyfaceLength()

getMeshLength

protected double getMeshLength()