public class Constants extends java.lang.Object
Modified by: Joseph A. Huwaldt
Modifier and Type | Field and Description |
---|---|
static boolean |
DEBUG
Sets debug mode.
|
static char |
Delim
Globalized delimiter character.
|
static double |
Grain
Globalized grain value.
|
static java.awt.Color[] |
IGESColor
Standard IGES Colors (Index 0, "undefined" is set to black).
|
static int |
PDID_COL
Column in IGES file Parameter Data delimiting free-form data with DENum of the
entity.
|
static java.util.ResourceBundle |
RESOURCES
The String resources used by this package.
|
static int |
SECTID_COL
Column in IGES file with section identifier ('S', 'G', etc)
|
static char |
Term
Globalized terminate character.
|
static int |
TYPE_CHAR
Character type identifier.
|
static int |
TYPE_FLOAT
Real type identifier.
|
static int |
TYPE_INT
Integer type identifier.
|
static int |
TYPE_STRING
String type identifier.
|
static Unit<Length> |
unit
Globalized length units for the file.
|
static java.util.Locale |
US
The IGES ASCII file format must always be written using the US locale.
|
static int |
X_AXIS
X-Axis
|
static int |
Y_AXIS
Y-Axis
|
static int |
Z_AXIS
Z-Axis
|
Constructor and Description |
---|
Constants() |
Modifier and Type | Method and Description |
---|---|
static double |
dist(double x1,
double y1,
double x2,
double y2)
2D distance.
|
static double |
dist(double x1,
double y1,
double z1,
double x2,
double y2,
double z2)
3D distance.
|
static void |
initGlobals(GlobalSection g)
Set up globals from GlobalSection
|
static java.lang.String |
makeSequenceNumber(int number)
Create a sequence number using the specified integer and padding it with zeros on
the left until it is 7 characters long.
|
static java.lang.String |
myReadLine(java.io.RandomAccessFile in)
Reads in a line of text, 80 characters, ignoring any EOL chars
|
static java.lang.String |
padLeft(java.lang.String string,
char pad,
int length)
Add the specified pad character to the left of the input String until it is the
specified length.
|
static java.lang.String |
padRight(java.lang.String string,
char pad,
int length)
Add the specified pad character to the right of the input String until it is the
specified length.
|
static double |
toDouble(java.lang.String s)
Converts the string to an double.
|
static int |
toInt(java.lang.String s)
Converts the string to an integer.
|
static int |
writeSection(java.io.PrintWriter writer,
int startIndex,
java.lang.String deNumber,
char sectionCode,
java.lang.StringBuilder data)
Write out a single section of an IGES file.
|
public static final boolean DEBUG
public static final java.util.ResourceBundle RESOURCES
public static final java.util.Locale US
public static final int SECTID_COL
public static final int PDID_COL
public static final int TYPE_STRING
public static final int TYPE_INT
public static final int TYPE_FLOAT
public static final int TYPE_CHAR
public static char Term
public static char Delim
public static double Grain
public static Unit<Length> unit
public static final int X_AXIS
public static final int Y_AXIS
public static final int Z_AXIS
public static final java.awt.Color[] IGESColor
public Constants()
public static void initGlobals(GlobalSection g)
g
- Global Section objectpublic static java.lang.String myReadLine(java.io.RandomAccessFile in) throws java.io.IOException
in
- input filejava.io.IOException
- if end of file is reached, or other generic file I/O error.public static int toInt(java.lang.String s)
s
- the string to be parsed. Assumed to be trimmed of whitespace.public static double toDouble(java.lang.String s)
s
- the string to be parsed. Assumed to be trimmed of whitespace.public static double dist(double x1, double y1, double x2, double y2)
x1
- abscissa of first pointy1
- ordinate of first pointx2
- abscissa of 2nd pointy2
- ordinate of second pointpublic static double dist(double x1, double y1, double z1, double x2, double y2, double z2)
x1
- X-coordinate ofy1
- Y-coordinate ofz1
- Z-coordinate of first pointx2
- X-coordinate of second pointy2
- Y-coordinate of second pointz2
- Z-coordinate of second pointpublic static java.lang.String padLeft(java.lang.String string, char pad, int length)
string
- The string to be made the specified length.pad
- The character to insert into the beginning of the string to reach the
specified length.length
- The desired length of the padded string.public static java.lang.String padRight(java.lang.String string, char pad, int length)
string
- The string to be made the specified length.pad
- The character to append onto the string to reach the specified
length.length
- The desired length of the padded string.public static java.lang.String makeSequenceNumber(int number)
number
- The number to turn into a sequence number.public static int writeSection(java.io.PrintWriter writer, int startIndex, java.lang.String deNumber, char sectionCode, java.lang.StringBuilder data) throws java.io.IOException
writer
- The PrintWriter to write the section to.startIndex
- The starting sequence index for this section.deNumber
- The 7 character DE number code (made with "makeSequenceNumber")
for this part or "".sectionCode
- The code used to identify this section's type ('S', 'G', 'P',
etc").data
- A String containing the data for the section.java.io.IOException