com.partnersoft.formats.dxf
Class DxfPolyline

java.lang.Object
  extended by com.partnersoft.formats.dxf.DxfEntity
      extended by com.partnersoft.formats.dxf.DxfPolyline
All Implemented Interfaces:
DxfStructure

public class DxfPolyline
extends DxfEntity

A DXF POLYLINE entity.

A POLYLINE is a series of segments connecting vertices in 3D space. This is the older type of polyline in DXF; LWPOLYLINE has largely supplanted it.

POLYLINE can also be used to represent a number of other shapes, including various curves, polygons, and polyface meshes.

Primary reference is pages 89-91 of the AutoCAD 2007 DXF Reference, available from the AutoDesk website.

Copyright 2000-2006 Partner Software, Inc.

Version:
$Id: DxfPolyline.java 2328 2010-01-06 15:38:22Z paul $
Author:
Paul Reavis

Nested Class Summary
static class DxfPolyline.SurfaceType
           
 
Constructor Summary
DxfPolyline()
           
 
Method Summary
 double getDefaultEndWidth()
          Default end width, code 41, optional, default 0.
 double getDefaultStartWidth()
          Default start width, code 40, optional, default 0.
 double getElevation()
          Elevation, group 30, optional, default 0.
 double getExtrusionX()
          Extrusion direction X, group 210, optional, default 0.
 double getExtrusionY()
          Extrusion direction Y, group 220, optional, default 0.
 double getExtrusionZ()
          Extrusion direction Z, group 230, optional, default 1.
 java.util.List<DxfGroup> getGroups(DxfVersion version)
          Get the internal state as DXFGroups.
 int getMeshVertexCountM()
          Polygon mesh M vertex count, code 71, optional default 0.
 int getMeshVertexCountN()
          Polygon mesh N vertex count, code 72, optional default 0.
 double getSmoothSurfaceDensityM()
          Smooth surface M density, code 73, optional default 0.
 double getSmoothSurfaceDensityN()
          Smooth surface N density, code 74, optional default 0.
 DxfPolyline.SurfaceType getSurfaceType()
          Curves and smooth surface type, code 75, optional, default NONE.
 double getThickness()
          Thickness, group 39, optional, default 0.
 java.lang.String getType()
          The type name of this structure.
 boolean isClosed()
          Closed flag, optional, default false.
 boolean isCurved()
          Curved flag, optional, default false.
 boolean isLinetypeContinuous()
          Continuous linetype mesh flag, optional, default false.
 boolean isPolyfaceMesh()
          Polyface mesh flag, optional, default false.
 boolean isPolygonMesh()
          3D polygon mesh flag, optional, default false.
 boolean isPolygonMeshClosed()
          Closed polygon mesh flag, optional, default false.
 boolean isPolyline3d()
          3D polyline flag, optional, default false.
 boolean isSplined()
          Splined flag, optional, default false.
 void setClosed(boolean closed)
           
 void setCurved(boolean curved)
           
 void setDefaultEndWidth(double defaultEndWidth)
           
 void setDefaultStartWidth(double defaultStartWidth)
           
 void setElevation(double elevation)
           
 void setExtrusionX(double extrusionX)
           
 void setExtrusionY(double extrusionY)
           
 void setExtrusionZ(double extrusionZ)
           
 void setGroups(java.util.List<DxfGroup> groups)
          Set the internal state based on the given groups.
 void setLinetypeContinuous(boolean linetypeContinuous)
           
 void setMeshVertexCountM(int meshVertexCountM)
           
 void setMeshVertexCountN(int meshVertexCountN)
           
 void setPolyfaceMesh(boolean polyfaceMesh)
           
 void setPolygonMesh(boolean polygonMesh)
           
 void setPolygonMeshClosed(boolean polygonMeshClosed)
           
 void setPolyline3d(boolean polyline3d)
           
 void setSmoothSurfaceDensityM(double smoothSurfaceDensityM)
           
 void setSmoothSurfaceDensityN(double smoothSurfaceDensityN)
           
 void setSplined(boolean splined)
           
 void setSurfaceType(DxfPolyline.SurfaceType surfaceType)
           
 void setThickness(double thickness)
           
 java.lang.String toString()
           
 
Methods inherited from class com.partnersoft.formats.dxf.DxfEntity
getApplicationDefinedStructures, getColor, getColorName, getHandle, getLayer, getLinetype, getLinetypeScale, getLineWeight, getMaterial, getOwnerHandle, getPlotStyle, getProxyEntityGraphics, getRgbColor, getShadowMode, getTransparency, isInvisible, isPaperSpace, setApplicationDefinedStructures, setColor, setColorName, setHandle, setInvisible, setLayer, setLinetype, setLinetypeScale, setLineWeight, setMaterial, setOwnerHandle, setPaperSpace, setPlotStyle, setProxyEntityGraphics, setRgbColor, setShadowMode, setTransparency
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DxfPolyline

public DxfPolyline()
Method Detail

getType

public java.lang.String getType()
Description copied from interface: DxfStructure
The type name of this structure. Generally this will be the same for all instances of the same implementing Java class, so a typical example might be:
 \/**
  * Type name of this structure. Always returns "POINT".
  * \@return "POINT"
  *\/
 public String getType() {
     return "POINT";
 }
 

Specified by:
getType in interface DxfStructure
Specified by:
getType in class DxfEntity
Returns:
type name of structure as defined in AutoCAD DXF specification

getGroups

public java.util.List<DxfGroup> getGroups(DxfVersion version)
Description copied from interface: DxfStructure
Get the internal state as DXFGroups.

Specified by:
getGroups in interface DxfStructure
Overrides:
getGroups in class DxfEntity
Returns:
list of groups containing the state data for this structure

setGroups

public void setGroups(java.util.List<DxfGroup> groups)
Description copied from interface: DxfStructure
Set the internal state based on the given groups.

Specified by:
setGroups in interface DxfStructure
Overrides:
setGroups in class DxfEntity
Parameters:
groups - list of groups containing data for this structure

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

isClosed

public boolean isClosed()
Closed flag, optional, default false.

This is derived from the 1-bit in group 70 (polyline flag).


setClosed

public void setClosed(boolean closed)

isCurved

public boolean isCurved()
Curved flag, optional, default false.

This is derived from the 2-bit in group 70 (polyline flag).


setCurved

public void setCurved(boolean curved)

getDefaultEndWidth

public double getDefaultEndWidth()
Default end width, code 41, optional, default 0.


setDefaultEndWidth

public void setDefaultEndWidth(double defaultEndWidth)

getDefaultStartWidth

public double getDefaultStartWidth()
Default start width, code 40, optional, default 0.


setDefaultStartWidth

public void setDefaultStartWidth(double defaultStartWidth)

getElevation

public double getElevation()
Elevation, group 30, optional, default 0.


setElevation

public void setElevation(double elevation)

getExtrusionX

public double getExtrusionX()
Extrusion direction X, group 210, optional, default 0.


setExtrusionX

public void setExtrusionX(double extrusionX)

getExtrusionY

public double getExtrusionY()
Extrusion direction Y, group 220, optional, default 0.


setExtrusionY

public void setExtrusionY(double extrusionY)

getExtrusionZ

public double getExtrusionZ()
Extrusion direction Z, group 230, optional, default 1.


setExtrusionZ

public void setExtrusionZ(double extrusionZ)

isLinetypeContinuous

public boolean isLinetypeContinuous()
Continuous linetype mesh flag, optional, default false.

This is derived from the 128-bit in group 70 (polyline flag).


setLinetypeContinuous

public void setLinetypeContinuous(boolean linetypeContinuous)

getMeshVertexCountM

public int getMeshVertexCountM()
Polygon mesh M vertex count, code 71, optional default 0.


setMeshVertexCountM

public void setMeshVertexCountM(int meshVertexCountM)

getMeshVertexCountN

public int getMeshVertexCountN()
Polygon mesh N vertex count, code 72, optional default 0.


setMeshVertexCountN

public void setMeshVertexCountN(int meshVertexCountN)

isPolyfaceMesh

public boolean isPolyfaceMesh()
Polyface mesh flag, optional, default false.

This is derived from the 64-bit in group 70 (polyline flag).


setPolyfaceMesh

public void setPolyfaceMesh(boolean polyfaceMesh)

isPolygonMesh

public boolean isPolygonMesh()
3D polygon mesh flag, optional, default false.

This is derived from the 16-bit in group 70 (polyline flag).


setPolygonMesh

public void setPolygonMesh(boolean polygonMesh)

isPolygonMeshClosed

public boolean isPolygonMeshClosed()
Closed polygon mesh flag, optional, default false.

This is derived from the 32-bit in group 70 (polyline flag).


setPolygonMeshClosed

public void setPolygonMeshClosed(boolean polygonMeshClosed)

isPolyline3d

public boolean isPolyline3d()
3D polyline flag, optional, default false.

This is derived from the 8-bit in group 70 (polyline flag).


setPolyline3d

public void setPolyline3d(boolean polyline3d)

getSmoothSurfaceDensityM

public double getSmoothSurfaceDensityM()
Smooth surface M density, code 73, optional default 0.


setSmoothSurfaceDensityM

public void setSmoothSurfaceDensityM(double smoothSurfaceDensityM)

getSmoothSurfaceDensityN

public double getSmoothSurfaceDensityN()
Smooth surface N density, code 74, optional default 0.


setSmoothSurfaceDensityN

public void setSmoothSurfaceDensityN(double smoothSurfaceDensityN)

isSplined

public boolean isSplined()
Splined flag, optional, default false.

Indicates that spline-fit vertices have been added.

This is derived from the 4-bit in group 70 (polyline flag).


setSplined

public void setSplined(boolean splined)

getSurfaceType

public DxfPolyline.SurfaceType getSurfaceType()
Curves and smooth surface type, code 75, optional, default NONE.


setSurfaceType

public void setSurfaceType(DxfPolyline.SurfaceType surfaceType)

getThickness

public double getThickness()
Thickness, group 39, optional, default 0.


setThickness

public void setThickness(double thickness)