Class SoToHTMLAction
- java.lang.Object
-
- com.openinventor.inventor.Inventor
-
- com.openinventor.inventor.actions.SoAction
-
- com.openinventor.inventor.actions.SoToHTMLAction
-
public class SoToHTMLAction extends SoAction
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
SoWWWAnchorgroup 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
SoWWWAnchornode.- An image tag that references the image generated by
SoToHTMLAction.
- See Also:
SoAction
- An image map tag that defines the regions (maps) corresponding to each subgraph that is under an
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSoToHTMLAction.ComponentsComponents used to generate the image.static classSoToHTMLAction.ImageFormatsDefines the format of the image.static classSoToHTMLAction.ShapeTypesDefines the different shape type for maps.-
Nested classes/interfaces inherited from class com.openinventor.inventor.actions.SoAction
SoAction.AppliedCodes, SoAction.DistribModes, SoAction.PathCodes, SoAction.PathIndices
-
Nested 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 Constructor Description SoToHTMLAction()Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcloseHTMLFile()Closes the HTML output file.static voidenableElement(java.lang.Class<? extends Inventor> t, int stkIndex)SbColorgetImageBackgroundColor()Returns the image background color.SoToHTMLAction.ComponentsgetImageComponents()Returns the components of image.SoToHTMLAction.ImageFormatsgetImageFormat()Returns the image format.floatgetImageQuality()Returns the image quality.java.lang.StringgetImageURLName()Returns the URL name of image in the HTML file.SoToHTMLAction.ShapeTypesgetRegionShapeType()Returns the region shape type.SbViewportRegiongetViewportRegion()Returns viewport region for the image.booleanisMapHighlight()Returns anchor highlighting.booleanopenHTMLFile(java.lang.String filename)Opens named file.voidresetHTMLBuffer()Resets buffer of the HTML output for output again.voidsetImageBackgroundColor(SbColor c)Sets the image background color.voidsetImageComponents(SoToHTMLAction.Components components)Sets the components of image.voidsetImageFormat(SoToHTMLAction.ImageFormats format)Sets the image format.voidsetImageQuality(float quality)Sets the image quality.voidsetImageURLName(java.lang.String name)Sets the URL name of image in the HTML file, ("image.jpg" by default).voidsetMapHighlight(boolean onOff)Sets anchor highlighting.voidsetRegionShapeType(SoToHTMLAction.ShapeTypes type)Sets 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, useAlternateRep
-
Methods inherited from class com.openinventor.inventor.Inventor
dispose, getNativeResourceHandle
-
-
-
-
Method Detail
-
setImageURLName
public void setImageURLName(java.lang.String name)
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
public java.lang.String getImageURLName()
Returns the URL name of image in the HTML file.
-
openHTMLFile
public boolean openHTMLFile(java.lang.String filename)
Opens named file. This returns false on error. By default, output goes to stdout .
-
getViewportRegion
public SbViewportRegion 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
public static void enableElement(java.lang.Class<? extends Inventor> t, int stkIndex)
-
getImageFormat
public SoToHTMLAction.ImageFormats getImageFormat()
Returns the image format.
-
getImageQuality
public float getImageQuality()
Returns the image quality.
-
setViewportRegion
public void setViewportRegion(SbViewportRegion region)
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
public void setImageBackgroundColor(SbColor c)
Sets the image background color.SbColor(0,0,0)by default.
-
getRegionShapeType
public SoToHTMLAction.ShapeTypes getRegionShapeType()
Returns the region shape type.
-
setRegionShapeType
public void setRegionShapeType(SoToHTMLAction.ShapeTypes type)
Sets the region shape type. POLYGON by default.
-
getImageBackgroundColor
public SbColor getImageBackgroundColor()
Returns the image background color.
-
setImageFormat
public void setImageFormat(SoToHTMLAction.ImageFormats format)
Sets the image format. JPEG_FORMAT by default.
-
getImageComponents
public SoToHTMLAction.Components getImageComponents()
Returns the components of image.
-
setImageComponents
public void setImageComponents(SoToHTMLAction.Components components)
Sets the components of image. RGB by default.
-
-