Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.trapezium.chisel.cleaners
Class IFS_DupCoordDetector  view IFS_DupCoordDetector download IFS_DupCoordDetector.java

java.lang.Object
  extended bycom.trapezium.chisel.Optimizer
      extended bycom.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)

Nested Class Summary
(package private)  class IFS_DupCoordDetector.CharArrayContainer
           
(package private)  class IFS_DupCoordDetector.CoordMergeData
           
 
Field Summary
(package private)  int mergedPointCount
           
(package private)  int modifiedFaceCount
           
(package private)  int totalMadeUnique
           
 
Fields inherited from class com.trapezium.chisel.Optimizer
baseFileName, baseFilePath, dataSource
 
Constructor Summary
IFS_DupCoordDetector()
          Class constructor
 
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
 

Field Detail

mergedPointCount

int mergedPointCount

modifiedFaceCount

int modifiedFaceCount

totalMadeUnique

int totalMadeUnique
Constructor Detail

IFS_DupCoordDetector

public IFS_DupCoordDetector()
Class constructor

Method Detail

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