java.lang.Object
com.trapezium.chisel.Optimizer
com.trapezium.chisel.cleaners.IFS_CoordRemover
- All Implemented Interfaces:
- java.util.EventListener, com.trapezium.chisel.NodeLocatorListener, com.trapezium.chisel.OptionHolder
- public class IFS_CoordRemover
- extends com.trapezium.chisel.Optimizer
|
Method Summary |
(package private) void |
adjustIndex(com.trapezium.chisel.TokenPrinter tp,
int[] offsets,
int scannerOffset,
int endTokenOffset,
int keepSize,
int indexLimit)
Rewrite the index field, performing value adjustment along the way. |
void |
attemptOptimization(com.trapezium.vrml.node.Node n)
template, subclasses override this if they modify Nodes |
void |
optimize(com.trapezium.chisel.TokenPrinter tp,
java.lang.Object param,
int startTokenOffset,
int endTokenOffset)
|
(package private) void |
removeCoord(com.trapezium.chisel.TokenPrinter tp,
CoordRemoveData cmd,
int startTokenOffset,
int endTokenOffset)
remove coord, texCoord, color, or normal entries based on the usage bitset |
(package private) void |
removeIndex(com.trapezium.chisel.TokenPrinter tp,
CoordRemoveData cmd,
int startTokenOffset,
int endTokenOffset)
Remove index values based on CoordRemoveData parameter. |
void |
summarize(java.io.PrintStream ps)
default summary (none), used by command line version |
(package private) void |
synchWithCoord(com.trapezium.vrml.node.IndexInfo ii,
int dataType,
java.util.BitSet coordBits,
int coordIndexCount,
int numberFaces)
Synchronize IndexInfo with coord info. |
| Methods inherited from class com.trapezium.chisel.Optimizer |
addAdditionalNode, attemptOptimization, booleanToOptionValue, eofTokens, getActionMessage, getAdditionalName, getNodeName, getNumberAdditionalNames, getNumberOptions, getOptionClass, getOptionConstraints, getOptionLabel, getOptionValue, hasFinalCode, intToOptionValue, isDEFlistener, isDEFUSElistener, isPROTOlistener, isROUTElistener, nodeFound, optimizePossible, optionValueToBoolean, optionValueToInt, printFinalCode, printNumbers, replaceIndexFaceMultiple, replaceRange, replaceStartEnd, replaceValueNodeFaceMultiple, reset, routeFound, setBaseFileName, setBaseFilePath, setDataSource, setNodeName, setOptionConstraints, setOptionValue, setRangeReplacer |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Coord
public static int Coord
CoordIndex
public static int CoordIndex
TexCoord
public static int TexCoord
TexCoordIndex
public static int TexCoordIndex
Color
public static int Color
ColorIndex
public static int ColorIndex
Normal
public static int Normal
NormalIndex
public static int NormalIndex
numberCoordsRemoved
protected int numberCoordsRemoved
numberTexCoordsRemoved
protected int numberTexCoordsRemoved
numberNormalsRemoved
protected int numberNormalsRemoved
numberColorsRemoved
protected int numberColorsRemoved
IFS_CoordRemover
public IFS_CoordRemover()
attemptOptimization
public void attemptOptimization(com.trapezium.vrml.node.Node n)
- Description copied from class:
com.trapezium.chisel.Optimizer
- template, subclasses override this if they modify Nodes
synchWithCoord
void synchWithCoord(com.trapezium.vrml.node.IndexInfo ii,
int dataType,
java.util.BitSet coordBits,
int coordIndexCount,
int numberFaces)
- Synchronize IndexInfo with coord info.
There are three types of synchronization:
1. values are synched with coord values. This means the "perVertex"
setting is true, and there is no "..Index" field.
2. values are synched with index. This means there is an "..Index" field,
with values in synch with the corresponding value node. There are two
mutually exclusive further restrictions on the "..Index" field:
a) the "..Index" field must be in synch with with the coord index,
which happens when the "perVertex" setting is true.
b) the "..Index" field must be in synch with the coord faces, which
happens when the "perVertex" setting is false.
optimize
public void optimize(com.trapezium.chisel.TokenPrinter tp,
java.lang.Object param,
int startTokenOffset,
int endTokenOffset)
removeCoord
void removeCoord(com.trapezium.chisel.TokenPrinter tp,
CoordRemoveData cmd,
int startTokenOffset,
int endTokenOffset)
- remove coord, texCoord, color, or normal entries based on the usage bitset
removeIndex
void removeIndex(com.trapezium.chisel.TokenPrinter tp,
CoordRemoveData cmd,
int startTokenOffset,
int endTokenOffset)
- Remove index values based on CoordRemoveData parameter.
There are three ways index values get removed. For coord/coordIndex,
texCoord/texCoordIndex, color/colorIndex, normal/normalIndex, any removed
coord affects the index. In this case we create an array to adjust all the
offsets.
The second way index values may be affected is in the case of color/colorIndex
and normal/normalIndex when perVertex is true. In this case, there is a one
to one correspondence between the index and the coord.
The third way is when perVertex is false, and there are faces involved. In this
case, the number of index values must match the number of faces. If there are
more index values than faces, we remove the additional index values.
adjustIndex
void adjustIndex(com.trapezium.chisel.TokenPrinter tp,
int[] offsets,
int scannerOffset,
int endTokenOffset,
int keepSize,
int indexLimit)
- Rewrite the index field, performing value adjustment along the way.
Also limits the index field size to the maximum allowed by coordIndex
summarize
public void summarize(java.io.PrintStream ps)
- Description copied from class:
com.trapezium.chisel.Optimizer
- default summary (none), used by command line version