Package xj3d.filter.filters
Class IndexFilter
java.lang.Object
xj3d.filter.AbstractFilter
xj3d.filter.BaseFilter
xj3d.filter.node.EncodedBaseFilter
xj3d.filter.filters.IndexFilter
- All Implemented Interfaces:
BinaryContentHandler
,ContentHandler
,ProtoHandler
,RouteHandler
,ScriptHandler
,StringContentHandler
Filter for creating indexed versions of non-indexed geometry. This filter
transforms TriangleSet, TriangleStripSet, TriangleFanSet and LineSet nodes
to IndexedTriangleSet, IndexedTriangleStripSet, IndexedTriangleFanSet, and
IndexedLineSet nodes respectively.
- Version:
- $Revision: 1.11 $
- Author:
- Rex Melton
-
Field Summary
Fields inherited from class xj3d.filter.node.EncodedBaseFilter
encMap, encodeNodes, encodeRoutes, encStack, factory, scene
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
Declaration of the end of the document.void
endNode()
Notification of the end of a node declaration.void
Declaration of the start of the document.void
startExternProtoDecl
(String name) Notification of the start of an EXTERNPROTO declaration of the given name.void
Notification of the start of a node.void
startProtoDecl
(String name) Notification of the start of an ordinary (inline) proto declaration.void
The field value is a USE for the given node name.Methods inherited from class xj3d.filter.node.EncodedBaseFilter
encode, endField, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, routeDecl, setDebug
Methods inherited from class xj3d.filter.BaseFilter
componentDecl, endExternProtoDecl, endProtoBody, endProtoDecl, endScriptDecl, exportDecl, externProtoURI, getContentHandler, getErrorReporter, getLastErrorCode, getProtoHandler, getRouteHandler, getScriptHandler, importDecl, metaDecl, profileDecl, protoFieldDecl, protoIsDecl, scriptFieldDecl, setArguments, setContentHandler, setDocumentLocator, setErrorReporter, setProtoHandler, setRouteHandler, setScriptHandler, startField, startProtoBody, startScriptDecl, suppressCalls
Methods inherited from class xj3d.filter.AbstractFilter
setParsingType
-
Constructor Details
-
IndexFilter
public IndexFilter()Default Constructor
-
-
Method Details
-
startDocument
public void startDocument(String uri, String url, String encoding, String type, String version, String comment) throws SAVException, VRMLException Declaration of the start of the document. The parameters are all of the values that are declared on the header line of the file after the#
start. The type string contains the representation of the first few characters of the file after the #. This allows us to work out if it is VRML97 or the later X3D spec.Version numbers change from VRML97 to X3D and aren't logical. In the first, it is
#VRML V2.0
and the second is#X3D V1.0
even though this second header represents a later spec.- Specified by:
startDocument
in interfaceContentHandler
- Overrides:
startDocument
in classEncodedBaseFilter
- Parameters:
uri
- The URI of the file.url
- The base URL of the file for resolving relative URIs contained in the fileencoding
- The encoding of this document - utf8 or binarytype
- The bytes of the first part of the file headerversion
- The VRML version of this documentcomment
- Any trailing text on this line. If there is none, this is null.- 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
-
endDocument
Declaration of the end of the document. There will be no further parsing and hence events after this.- Specified by:
endDocument
in interfaceContentHandler
- Overrides:
endDocument
in classEncodedBaseFilter
- 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
-
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 classEncodedBaseFilter
- 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.
-
endNode
Notification of the end of a node declaration.- Specified by:
endNode
in interfaceContentHandler
- Overrides:
endNode
in classEncodedBaseFilter
- 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 classEncodedBaseFilter
- 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
-
startProtoDecl
Notification of the start of an ordinary (inline) proto declaration. The proto has the given node name.- Specified by:
startProtoDecl
in interfaceProtoHandler
- Overrides:
startProtoDecl
in classBaseFilter
- Parameters:
name
- The name of the proto- Throws:
SAVException
- Always thrownVRMLException
- Never thrown
-
startExternProtoDecl
Notification of the start of an EXTERNPROTO declaration of the given name. Between here and the matchingBaseFilter.endExternProtoDecl()
call you should only receiveBaseFilter.protoFieldDecl(int, java.lang.String, java.lang.String, java.lang.Object)
calls.- Specified by:
startExternProtoDecl
in interfaceProtoHandler
- Overrides:
startExternProtoDecl
in classBaseFilter
- Parameters:
name
- The node name of the extern proto- Throws:
SAVException
- Always thrownVRMLException
- Never thrown
-