java.lang.Object
com.trapezium.chisel.Optimizer
com.trapezium.chisel.cleaners.IFS_DupCoordDetector
- All Implemented Interfaces:
- java.util.EventListener, com.trapezium.chisel.NodeLocatorListener, com.trapezium.chisel.OptionHolder
- public class IFS_DupCoordDetector
- extends com.trapezium.chisel.Optimizer
Detects and removes unnecessarily duplicated values in a coord, texCoord, color,
or normal node. These are not removed if the Coordinate/TextureCoordinate/Color/
Normal node are DEFfed and USEd by a ROUTE. This is based on the assumption that
the ROUTE changes the values, therefore editting these affects the corresponding
"index" field, which exists for ROUTEd values and not for the pre-existing values.
- Since:
- 1.0
- Version:
- 1.0, 16 Oct 1998 (really older, just added header)
|
Method Summary |
void |
attemptOptimization(com.trapezium.vrml.node.Node n)
template, subclasses override this if they modify Nodes |
(package private) IFS_DupCoordDetector.CoordMergeData |
attemptOptimization(com.trapezium.vrml.node.Node n,
java.lang.String nodeFieldName,
java.lang.String indexName,
java.lang.String valueName)
This needs some work, when the CoordMergeData gets made, the
offsets need to be readjusted, depending on how the related sets
get merged. |
void |
optimize(com.trapezium.chisel.TokenPrinter tp,
java.lang.Object param,
int startTokenOffset,
int endTokenOffset)
Replace index values so that they only refer to a coordinate with a given
value one way. |
void |
summarize(java.io.PrintStream ps)
default summary (none), used by command line version |
| 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 |
mergedPointCount
int mergedPointCount
modifiedFaceCount
int modifiedFaceCount
totalMadeUnique
int totalMadeUnique
IFS_DupCoordDetector
public IFS_DupCoordDetector()
- Class constructor
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
attemptOptimization
IFS_DupCoordDetector.CoordMergeData attemptOptimization(com.trapezium.vrml.node.Node n,
java.lang.String nodeFieldName,
java.lang.String indexName,
java.lang.String valueName)
- This needs some work, when the CoordMergeData gets made, the
offsets need to be readjusted, depending on how the related sets
get merged. For example, "texCoord" alone map one-to-one with
coordinates if there is no "texCoordIndex". In this case, the
offsets of the two arrays must match exactly. Any place they don't
match must be un-optimized.
optimize
public void optimize(com.trapezium.chisel.TokenPrinter tp,
java.lang.Object param,
int startTokenOffset,
int endTokenOffset)
- Replace index values so that they only refer to a coordinate with a given
value one way. Duplicate coordinates then end up not being referenced, which
allows them to be clean with the IFS_CoordRemover chisel.
summarize
public void summarize(java.io.PrintStream ps)
- Description copied from class:
com.trapezium.chisel.Optimizer
- default summary (none), used by command line version