Package org.gvsig.dwg.lib
Class DwgFile
java.lang.Object
org.gvsig.dwg.lib.DwgFile
The DwgFile class provides a revision-neutral interface for reading and handling
DWG files
Reading methods are useful for reading DWG files, and handling methods like
calculateDwgPolylines() are useful for handling more complex
objects in the DWG file
- Author:
- jmorell, azabala
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDwgClass(DwgClass dwgClass) Add a DWG class to the dwgClasses vectorvoidaddDwgClass(DwgClass2004 dwgClass) Add a DWG class to the dwgClasses vectorprotected voidaddDwgLayer(DwgLayer dwgLayer) voidaddDwgObject(DwgObject dwgObject) Add a DWG object to the dwgObject vectorvoidaddDwgObjectOffset(int handle, int offset) Add a DWG object offset to the dwgObjectOffsets vectorvoidaddDwgSectionOffset(String key, int seek, int size) Add a DWG section offset to the dwgSectionOffsets vectorvoidConfigure the geometry of the polylines in a DWG file from the vertex list in this DWG file.voidConfigure the geometry of the polylines in a DWG file from the vertex list in this DWG file.intgetColorByLayer(DwgObject entity) Returns the color of the layer of a DWG objectgetDwgLayer(DwgObject entity) getDwgObject(int index) Returns dwgObjects from its insertion order (position in the dwg file)getDwgObjectFromHandle(int handle) intReturns the offset of DWG section given by its keygetDwgSuperEntity(DwgObject entity) intgetIndexOf(DwgObject dwgObject) getLayerName(DwgObject entity) booleanvoidmanageInsert2(Point2D insPoint, double[] scale, double rot, int bHandle, List dwgObjectsWithoutBlocks, Map handleObjectsWithoutBlocks) voidvoidread()Reads a DWG file and put its objects in the dwgObjects Vector This method is version independentvoidsetDwg3DFile(boolean dwg3DFile) void
-
Constructor Details
-
DwgFile
Constructor.- Parameters:
fileName- an absolute path to the DWG file
-
-
Method Details
-
getDwgVersion
-
read
Reads a DWG file and put its objects in the dwgObjects Vector This method is version independent- Throws:
IOException- If the file location is wrongDwgVersionNotSupportedException
-
setHeader
-
getHeader
-
addDwgLayer
-
getDwgLayer
-
getDwgSuperEntity
-
getLayerName
-
getColorByLayer
Returns the color of the layer of a DWG object- Parameters:
entity- DWG object which we want to know its layer color- Returns:
- int Layer color of the DWG object in the Autocad color code
-
calculateGisModelDwgPolylines
public void calculateGisModelDwgPolylines()Configure the geometry of the polylines in a DWG file from the vertex list in this DWG file. This geometry is given by an array of Points. Besides, manage closed polylines and polylines with bulges in a GIS Data model. It means that the arcs of the polylines will be done through a set of points and a distance between these points. -
blockManagement2
public void blockManagement2()Configure the geometry of the polylines in a DWG file from the vertex list in this DWG file. This geometry is given by an array of Points Besides, manage closed polylines and polylines with bulges in a GIS Data model. It means that the arcs of the polylines will be done through a curvature parameter called bulge associated with the points of the polyline. -
manageInsert2
-
getIndexOf
-
addDwgSectionOffset
Add a DWG section offset to the dwgSectionOffsets vector- Parameters:
key- Define the DWG sectionseek- Offset of the sectionsize- Size of the section
-
getDwgSectionOffset
Returns the offset of DWG section given by its key- Parameters:
key- Define the DWG section- Returns:
- int Offset of the section in the DWG file
-
addDwgObjectOffset
public void addDwgObjectOffset(int handle, int offset) Add a DWG object offset to the dwgObjectOffsets vector- Parameters:
handle- Object handleoffset- Offset of the object data in the DWG file
-
addDwgObject
Add a DWG object to the dwgObject vector- Parameters:
dwgObject- DWG object
-
getDwgObject
Returns dwgObjects from its insertion order (position in the dwg file)- Parameters:
index- order in the dwg file- Returns:
- position
-
getDwgObjectFromHandle
-
addDwgClass
Add a DWG class to the dwgClasses vector- Parameters:
dwgClass- DWG class
-
addDwgClass
Add a DWG class to the dwgClasses vector- Parameters:
dwgClass- DWG class
-
printClasses
public void printClasses() -
getDwgClasses
-
getDwgObjectOffsets
- Returns:
- Returns the dwgObjectOffsets.
-
getDwgObjects
- Returns:
- Returns the dwgObjects.
-
getFileName
- Returns:
- Returns the fileName.
-
isDwg3DFile
public boolean isDwg3DFile()- Returns:
- Returns the dwg3DFile.
-
setDwg3DFile
public void setDwg3DFile(boolean dwg3DFile) - Parameters:
dwg3DFile- The dwg3DFile to set.
-