Package xj3d.filter
Class AppearanceFilter
java.lang.Object
xj3d.filter.AbstractFilter
xj3d.filter.BaseFilter
xj3d.filter.AppearanceFilter
- All Implemented Interfaces:
BinaryContentHandler
,ContentHandler
,ProtoHandler
,RouteHandler
,ScriptHandler
,StringContentHandler
Search for Shape nodes which do not specify an Appearance node and add a
default appearance or material to those nodes.
If -appAndMat
is specified in the filter options,
will add a Material node to the generated Appearance node.
The diffuse color for the Material node can be specified using -diffuse a b c, for example -diffuse 1.0 0.8 0.2 By default, a 0.8 0.8 0.8 value will be supplied (and the default value will be stripped from the output by the default output processor).
- Version:
- $Revision: 1.9 $
- Author:
- Eric Fickenscher (orig. Brad Vender)
-
Field Summary
Fields inherited from class xj3d.filter.BaseFilter
insideInvalidField, sceneMarker, suppressCalls
Fields inherited from class xj3d.filter.AbstractFilter
contentHandler, documentLocator, errorHandler, fieldHandler, fieldReader, fieldStack, lastErrorCode, majorVersion, minorVersion, nodeStack, parsingType, protoHandler, routeHandler, scriptHandler
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
endNode()
Notification of the end of a node declaration.void
setArguments
(String[] args) Set the argument parameters to control the filter operation.void
Notification of the start of a node.void
The field value is a USE for the given node name.Methods inherited from class xj3d.filter.BaseFilter
componentDecl, endDocument, endExternProtoDecl, endField, endProtoBody, endProtoDecl, endScriptDecl, exportDecl, externProtoURI, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, getContentHandler, getErrorReporter, getLastErrorCode, getProtoHandler, getRouteHandler, getScriptHandler, importDecl, metaDecl, profileDecl, protoFieldDecl, protoIsDecl, routeDecl, scriptFieldDecl, setContentHandler, setDebug, setDocumentLocator, setErrorReporter, setProtoHandler, setRouteHandler, setScriptHandler, startDocument, startExternProtoDecl, startField, startProtoBody, startProtoDecl, startScriptDecl, suppressCalls
Methods inherited from class xj3d.filter.AbstractFilter
setParsingType
-
Constructor Details
-
AppearanceFilter
public AppearanceFilter()Basic constructor. Note that boolean 'addMaterial' is initially set to 'false', which means that we will NOT be adding any material. This boolean may be set to true by calling the setArguments() method, in which case we WILL add a Material node.
-
-
Method Details
-
startNode
Notification of the start of a node. This is the opening statement of a node and it's DEF name. USE declarations are handled in a separate method.- Specified by:
startNode
in interfaceContentHandler
- Overrides:
startNode
in classBaseFilter
- Parameters:
name
- The name of the node that we are about to parsedefName
- The string associated with the DEF name. Null if not given for this node.- Throws:
SAVException
- This call is taken at the wrong time in the structure of the document.VRMLException
- This call is taken at the wrong time in the structure of the document.
-
useDecl
The field value is a USE for the given node name. This is a terminating call for startField as well. The next call will either be anotherstartField()
orendNode()
.- Specified by:
useDecl
in interfaceContentHandler
- Overrides:
useDecl
in classBaseFilter
- Parameters:
defName
- The name of the DEF string to use- Throws:
SAVException
- This call is taken at the wrong time in the structure of the documentVRMLException
- The content provided is invalid for this part of the document or can't be parsed
-
endNode
Notification of the end of a node declaration. If boolean addMaterial is set to TRUE, then when a Shape node ends we reset materialAdded, so that future Shapes can also have Material nodes added if necessary.- Specified by:
endNode
in interfaceContentHandler
- Overrides:
endNode
in classBaseFilter
- Throws:
SAVException
- This call is taken at the wrong time in the structure of the document.VRMLException
- This call is taken at the wrong time in the structure of the document.
-
setArguments
Set the argument parameters to control the filter operation. Note that the boolean 'addMaterial' will remain false unless this method is called and one of the argument parameters contains SET_APPEARANCE_AND_MATERIAL.- Overrides:
setArguments
in classBaseFilter
- Parameters:
args
- The array of argument parameters.
-