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
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
SoWWWAnchor
group 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:
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 class
SoToHTMLAction.Components
Components used to generate the image.static class
SoToHTMLAction.ImageFormats
Defines the format of the image.static class
SoToHTMLAction.ShapeTypes
Defines 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 void
closeHTMLFile()
Closes the HTML output file.static void
enableElement(java.lang.Class<? extends Inventor> t, int stkIndex)
SbColor
getImageBackgroundColor()
Returns the image background color.SoToHTMLAction.Components
getImageComponents()
Returns the components of image.SoToHTMLAction.ImageFormats
getImageFormat()
Returns the image format.float
getImageQuality()
Returns the image quality.java.lang.String
getImageURLName()
Returns the URL name of image in the HTML file.SoToHTMLAction.ShapeTypes
getRegionShapeType()
Returns the region shape type.SbViewportRegion
getViewportRegion()
Returns viewport region for the image.boolean
isMapHighlight()
Returns anchor highlighting.boolean
openHTMLFile(java.lang.String filename)
Opens named file.void
resetHTMLBuffer()
Resets buffer of the HTML output for output again.void
setImageBackgroundColor(SbColor c)
Sets the image background color.void
setImageComponents(SoToHTMLAction.Components components)
Sets the components of image.void
setImageFormat(SoToHTMLAction.ImageFormats format)
Sets the image format.void
setImageQuality(float quality)
Sets the image quality.void
setImageURLName(java.lang.String name)
Sets the URL name of image in the HTML file, ("image.jpg" by default).void
setMapHighlight(boolean onOff)
Sets anchor highlighting.void
setRegionShapeType(SoToHTMLAction.ShapeTypes type)
Sets the region shape type.void
setViewportRegion(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.
-
-