Package xj3d.filter.filters
Class TriangleCountInfoFilter
java.lang.Object
xj3d.filter.AbstractFilter
xj3d.filter.BaseFilter
xj3d.filter.node.CommonEncodedBaseFilter
xj3d.filter.filters.TriangleCountInfoFilter
- All Implemented Interfaces:
BinaryContentHandler,ContentHandler,ProtoHandler,RouteHandler,ScriptHandler,StringContentHandler,TriangleCounter
Counts the number of triangles in a world. The current
implementation will process the following nodes:
- ElevationGrid
- IndexedFaceSet
- IndexedQuadSet
- IndexedTriangleFanSet
- IndexedTriangleSet
- IndexedTriangleStripSet
- QuadSet
- TriangleFanSet
- TriangleSet
- TriangleStripSet
none- Version:
- $Revision: 1.0 $
- Author:
- Rex Melton
-
Field Summary
Fields inherited from class xj3d.filter.node.CommonEncodedBaseFilter
encMap, encodeNodes, encodeRoutes, encStack, factory, sceneFields inherited from class xj3d.filter.BaseFilter
insideInvalidField, sceneMarker, suppressCallsFields 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 TypeMethodDescriptionvoidDeclaration of the end of the document.voidendNode()Notification of the end of a node declaration.intGet the triangle count for the whole stream.voidNotification of the start of a node.Methods inherited from class xj3d.filter.node.CommonEncodedBaseFilter
encode, endExternProtoDecl, endField, endProtoBody, endProtoDecl, endScriptDecl, externProtoURI, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, protoFieldDecl, protoIsDecl, routeDecl, scriptFieldDecl, setDebug, startDocument, startExternProtoDecl, startProtoBody, startProtoDecl, startScriptDecl, useDeclMethods inherited from class xj3d.filter.BaseFilter
componentDecl, exportDecl, getContentHandler, getErrorReporter, getLastErrorCode, getProtoHandler, getRouteHandler, getScriptHandler, importDecl, metaDecl, profileDecl, setArguments, setContentHandler, setDocumentLocator, setErrorReporter, setProtoHandler, setRouteHandler, setScriptHandler, startField, suppressCallsMethods inherited from class xj3d.filter.AbstractFilter
setParsingType
-
Constructor Details
-
TriangleCountInfoFilter
public TriangleCountInfoFilter()Create an instance of the filter.
-
-
Method Details
-
endDocument
Declaration of the end of the document. There will be no further parsing and hence events after this.- Specified by:
endDocumentin interfaceContentHandler- Overrides:
endDocumentin classCommonEncodedBaseFilter- 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:
startNodein interfaceContentHandler- Overrides:
startNodein classCommonEncodedBaseFilter- 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 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.- Specified by:
endNodein interfaceContentHandler- Overrides:
endNodein classCommonEncodedBaseFilter- 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.
-
getTriangleCount
public int getTriangleCount()Get the triangle count for the whole stream.- Specified by:
getTriangleCountin interfaceTriangleCounter- Returns:
- The triangle count.
-