Class SoToHTMLAction
java.lang.Object
com.openinventor.inventor.Inventor
com.openinventor.inventor.actions.SoAction
com.openinventor.inventor.actions.SoToHTMLAction
Generates an HTML image map and an image from a scene graph.
This action generates an image file and an HTML file containing the image (<IMG>) and image map (<MAP>) tags. Each region of the image map will have a URL associated with it.
With HTML, image maps allow to specify regions of an image and assign a specific action to each region (a link can be associated to each map). When the region is activated by the user, the action is executed.
Each region of the image is determined by a subgraph which is under an SoWWWAnchor group node.
The HTML file generated contains, in the following order:
- An image map tag that defines the regions (maps) corresponding to each subgraph that is under an
SoWWWAnchorgroup node.
For each region, the associated link is the URL defined either by the SoWWWAnchor node.
- An image tag that references the image generated by
SoToHTMLAction.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumComponents used to generate the image.static enumDefines the format of the image.static enumDefines the different shape type for maps.Nested classes/interfaces inherited from class com.openinventor.inventor.actions.SoAction
SoAction.AppliedCodes, SoAction.DistribModes, SoAction.PathCodes, SoAction.PathIndicesNested classes/interfaces inherited from class com.openinventor.inventor.Inventor
Inventor.ConstructorCommand -
Field Summary
Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCloses the HTML output file.static voidenableElement(Class<? extends Inventor> t, int stkIndex) Returns the image background color.Returns the components of image.Returns the image format.floatReturns the image quality.Returns the URL name of image in the HTML file.Returns the region shape type.Returns viewport region for the image.booleanReturns anchor highlighting.booleanopenHTMLFile(String filename) Opens named file.voidResets buffer of the HTML output for output again.voidSets the image background color.voidsetImageComponents(SoToHTMLAction.Components components) Sets the components of image.voidSets the image format.voidsetImageQuality(float quality) Sets the image quality.voidsetImageURLName(String name) Sets the URL name of image in the HTML file, ("image.jpg" by default).voidsetMapHighlight(boolean onOff) Sets anchor highlighting.voidSets the region shape type.voidsetViewportRegion(SbViewportRegion region) Specifies viewport region for the image.Methods inherited from class com.openinventor.inventor.actions.SoAction
apply, apply, clearApplyResult, forwardTraversal, forwardTraversal, getContinueActionInBranchFlag, getCurPath, getDistribMode, getNodeAppliedTo, getOriginalPathListAppliedTo, getPathAppliedTo, getPathCode, getPathListAppliedTo, getPipeId, getSceneManager, getState, getWhatAppliedTo, hasTerminated, invalidateState, isBeingApplied, isLastPathListAppliedTo, isUsingAlternateRep, nullAction, postDelayedTraversal, preDelayedTraversal, resetContinueActionInBranchFlag, setPipeId, setSceneManager, setUpState, stopActionInBranch, traverse, useAlternateRepMethods inherited from class com.openinventor.inventor.Inventor
dispose, getNativeResourceHandle
-
Constructor Details
-
SoToHTMLAction
public SoToHTMLAction()Constructor.
-
-
Method Details
-
setImageURLName
Sets the URL name of image in the HTML file, ("image.jpg" by default). This is the first way to specify the image file name. -
getImageURLName
Returns the URL name of image in the HTML file. -
openHTMLFile
Opens named file. This returns false on error. By default, output goes to stdout . -
getViewportRegion
Returns viewport region for the image. -
closeHTMLFile
public void closeHTMLFile()Closes the HTML output file. -
resetHTMLBuffer
public void resetHTMLBuffer()Resets buffer of the HTML output for output again. Output starts over at beginning of buffer. -
setImageQuality
public void setImageQuality(float quality) Sets the image quality. Used for JPEG image. Quality is a value from 0. to 1., with 0 being the worst quality (maximum compression) and 1 being the best quality (minimum compression). The default is 1. -
enableElement
-
getImageFormat
Returns the image format. -
getImageQuality
public float getImageQuality()Returns the image quality. -
setViewportRegion
Specifies viewport region for the image. Allows the user to specify the image size. -
setMapHighlight
public void setMapHighlight(boolean onOff) Sets anchor highlighting. true by default. -
isMapHighlight
public boolean isMapHighlight()Returns anchor highlighting. -
setImageBackgroundColor
Sets the image background color.SbColor(0,0,0)by default. -
getRegionShapeType
Returns the region shape type. -
setRegionShapeType
Sets the region shape type. POLYGON by default. -
getImageBackgroundColor
Returns the image background color. -
setImageFormat
Sets the image format. JPEG_FORMAT by default. -
getImageComponents
Returns the components of image. -
setImageComponents
Sets the components of image. RGB by default.
-