Package geomss.geom.reader.iges
Class DirEntry
- java.lang.Object
-
- geomss.geom.reader.iges.DirEntry
-
public class DirEntry extends java.lang.Object
The DirEntry class represents the IGES Directory Entry. This structure contains general attributes for an entity, such as type, form, color, level, etc. The DirEntry is read from the file, and then a new Entity is instantiated and read depending on the type and form in the DirEntry.Modified by: Joseph A. Huwaldt
- Version:
- February 17, 2025
- Author:
- JDN, Version 1.0
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getColor()
Return color of this entity.int
getDENum()
Return Directory Entry number for this entity.int
getFont()
Return line font of this entity.int
getForm()
Return entity form.java.lang.String
getLabel()
Return the label for this entity.int
getLblDsp()
Return label display pointer of this entity.int
getLevel()
Return level of this entity.int
getMatrix()
Return matrix pointer of this entity.int
getPDCnt()
Return Parameter Data line count for this entity.int
getPDNum()
Return Parameter Data number for this entity.java.lang.String
getStatus()
Return status field of this entity.int
getType()
Return entity type.int
getView()
Return view pointer of this entity.int
getWeight()
Return line weight of this entity.boolean
read(java.io.RandomAccessFile in)
Read the Directory Entry from a file.void
setPDNumber(int PDnum, int PDcnt)
Set the first line of parameter data record for the entity as well as number of lines in parameter data record for this entity.java.lang.String
toString()
Dump to String.void
write(java.io.PrintWriter writer)
Write this directory entry out to the exchanged file.
-
-
-
Constructor Detail
-
DirEntry
public DirEntry()
Default constructor.
-
DirEntry
public DirEntry(int type, int form, int DEnum, int matrix, java.lang.String label)
Create a DirEntry from the specified information. Make sure and call "setPDNumber" before writing an IGES file with this directory entry.- Parameters:
type
- The entity type code.form
- The entity type form code or 0 for the default.DEnum
- The line count from the start of the Directory Entry Section for this entry (odd number).matrix
- An Entity124 DE number or 0.label
- A label for this parameter ornull
or "" for none.
-
-
Method Detail
-
read
public boolean read(java.io.RandomAccessFile in) throws java.io.IOException
Read the Directory Entry from a file. This method can handle blank or non-existent fields.- Parameters:
in
- input file- Returns:
- true if the read was successful, false if the Directory Entry was incomplete
- Throws:
java.io.IOException
- if there is any problem reading the directory entry file.
-
write
public void write(java.io.PrintWriter writer) throws java.io.IOException
Write this directory entry out to the exchanged file. Make sure that this directory entry has the correct parameter data index number (PDNum) and line count (PDCnt) before calling this method. This typically means that the parameter data for all the entities must be written first to a temporary buffer so that the PDNum & PDCnt values can be determined for each, then the directory entries are written and finally the buffered parameter data is written.- Parameters:
writer
- The PrintWriter to write the directory entry to.- Throws:
java.io.IOException
- if there is any problem writing the entry.
-
getType
public int getType()
Return entity type.- Returns:
- entity type
-
getForm
public int getForm()
Return entity form.- Returns:
- entity form
-
getPDCnt
public int getPDCnt()
Return Parameter Data line count for this entity.- Returns:
- Parameter Data line count for this entity
-
getDENum
public int getDENum()
Return Directory Entry number for this entity.- Returns:
- DE number
-
getPDNum
public int getPDNum()
Return Parameter Data number for this entity.- Returns:
- PD number
-
getColor
public int getColor()
Return color of this entity.- Returns:
- color of this entity
-
getFont
public int getFont()
Return line font of this entity.- Returns:
- line font of this entity
-
getWeight
public int getWeight()
Return line weight of this entity.- Returns:
- line weight of this entity
-
getLevel
public int getLevel()
Return level of this entity.- Returns:
- level of this entity
-
getView
public int getView()
Return view pointer of this entity.- Returns:
- view pointer of this entity
-
getMatrix
public int getMatrix()
Return matrix pointer of this entity.- Returns:
- matrix pointer of this entity
-
getStatus
public java.lang.String getStatus()
Return status field of this entity. If the field is less than eight characters, the string will be padded on the left with zeros.- Returns:
- status field of this entity
-
getLblDsp
public int getLblDsp()
Return label display pointer of this entity.- Returns:
- label display pointer of this entity
-
getLabel
public java.lang.String getLabel()
Return the label for this entity. Will return an empty String if there is no label.- Returns:
- The label for this entity.
-
setPDNumber
public void setPDNumber(int PDnum, int PDcnt)
Set the first line of parameter data record for the entity as well as number of lines in parameter data record for this entity.- Parameters:
PDnum
- The first line of parameter data record for the entity.PDcnt
- The number of lines in the parameter data for this entity.
-
toString
public java.lang.String toString()
Dump to String.- Overrides:
toString
in classjava.lang.Object
- Returns:
- String containing the resulting text.
-
-