Generates an HTML image map and an image from a scene graph. More...
#include <Inventor/actions/SoToHTMLAction.h>
Public Types | |
enum | ShapeType { NONE , RECTANGLE , CIRCLE , POLYGON } |
Defines the different shape type for maps. More... | |
enum | Components { LUMINANCE = 1 , LUMINANCE_TRANSPARENCY = 2 , RGB = 3 , RGB_TRANSPARENCY = 4 } |
Components used to generate the image More... | |
enum | ImageFormat { BMP_FORMAT , JPEG_FORMAT } |
Defines the format of the image More... | |
typedef void * | SoToHTMLReallocCB(void *ptr, size_t newSize) |
Public Types inherited from SoAction | |
enum | DistribMode { LOCAL_ONLY , CLUSTER_ONLY , ALL } |
This is used to define the way an action is distributed across a cluster. More... | |
enum | AppliedCode { NODE , PATH , PATH_LIST } |
This enum is used to determine what the action is being applied to. More... | |
enum | PathCode { NO_PATH , IN_PATH , BELOW_PATH , OFF_PATH } |
This enum may be used during traversal of nodes to indicate where the node is with respect to the path being traversed. More... | |
Public Member Functions | |
virtual SoType | getTypeId () const |
Returns the type identifier for this specific instance. | |
SoToHTMLAction () | |
Constructor. | |
~SoToHTMLAction () | |
Destructor. | |
SoNONUNICODE SbBool | openHTMLFile (const char *filename) |
Opens named file (sets file pointer to result) . | |
SbBool | openHTMLFile (const SbString &filename) |
Opens named file (sets file pointer to result) . | |
void | closeHTMLFile () |
Closes the HTML output file. | |
void | setHTMLFilePointer (FILE *newFP) |
Sets file pointer to write to. | |
FILE * | getHTMLFilePointer () const |
Returns the file pointer in use, or NULL if using a buffer. | |
void | setHTMLBuffer (void *bufPointer, size_t initSize, SoToHTMLReallocCB *reallocFunc, int32_t offset=0) |
Sets up memory buffer for writing HTML output, its initial size, a reallocation function (which is called if there is not enough room in the buffer), and an offset in the buffer at which to begin writing. | |
SbBool | getHTMLBuffer (void *&bufPointer, size_t &nBytes) const |
Returns pointer to memory buffer of the HTML output being written to and the new size of the buffer. | |
void | resetHTMLBuffer () |
Resets buffer of the HTML output for output again. | |
void | setImageURLName (const char *name) |
Sets the URL name of image in the HTML file, ("image.jpg" by default). | |
const char * | getImageURLName () const |
Returns the URL name of image in the HTML file. | |
void | setImageFilePointer (FILE *newFP) |
Sets the file pointer to use for the generated image file. | |
FILE * | getImageFilePointer () const |
Returns the file pointer for the generated image file. | |
void | setRegionShapeType (ShapeType type) |
Sets the region shape type. | |
ShapeType | getRegionShapeType () const |
Returns the region shape type. | |
void | setImageBackgroundColor (const SbColor &c) |
Sets the image background color. | |
const SbColor & | getImageBackgroundColor () const |
Returns the image background color. | |
void | setImageComponents (Components components) |
Sets the components of image. | |
Components | getImageComponents () const |
Returns the components of image. | |
void | setImageFormat (ImageFormat format) |
Sets the image format. | |
ImageFormat | getImageFormat () const |
Returns the image format. | |
void | setImageQuality (float quality) |
Sets the image quality. | |
float | getImageQuality () const |
Returns the image quality. | |
void | setViewportRegion (const SbViewportRegion ®ion) |
Specifies viewport region for the image. | |
const SbViewportRegion & | getViewportRegion () const |
Returns viewport region for the image. | |
void | setMapHighlight (SbBool onOff) |
Sets anchor highlighting. | |
SbBool | isMapHighlight () |
Returns anchor highlighting. | |
virtual void | apply (SoNode *scene) |
Generate HTML output for the specified root node. | |
virtual void | apply (SoPath *path) |
Generate HTML output for the specified path. | |
virtual void | apply (const SoPathList &pathList, SbBool flag=FALSE) |
Generate HTML output for the specified list of path. | |
Public Member Functions inherited from SoAction | |
virtual | ~SoAction () |
Destructor. | |
virtual void | clearApplyResult () |
When applied, an action may reference nodes or create objects (e.g. | |
virtual void | invalidateState () |
Invalidates the current traversal state in the action, forcing it to be recreated when the action is next applied. | |
void | stopActionInBranch () |
This function stops the action in the current Scene Graph branch. | |
SbBool | getContinueActionInBranchFlag () const |
This function indicates if the action must stop in the current branch. | |
void | resetContinueActionInBranchFlag () |
This function resets the continue action flag. | |
void | useAlternateRep (const SbBool enable) |
Tell the action to use alternate representations during traversal when available. | |
SbBool | isUsingAlternateRep () const |
Returns TRUE if current action is using alternate representations. | |
void | setSceneManager (SoSceneManager *mgr) |
Set the scene manager associated with this action (if any ). | |
SoSceneManager * | getSceneManager () const |
Return the SoSceneManager associated with this action. | |
virtual void | forwardTraversal (SoNode *node) |
Traverse a node that is not part of the current scenegraph. | |
virtual void | forwardTraversal (SoPath *path) |
Traverse a path that is not part of the current scenegraph. | |
DistribMode | getDistribMode () const |
Returns the distribution mode of this action across a cluster (ScaleViz-Cluster only). | |
AppliedCode | getWhatAppliedTo () const |
Returns code indicating what action is being applied to. | |
SoNode * | getNodeAppliedTo () const |
Returns the node the action is being applied to. | |
SoPath * | getPathAppliedTo () const |
Returns the path the action is being applied to. | |
const SoPathList * | getPathListAppliedTo () const |
Returns the path list the action is being applied to. | |
const SoPathList * | getOriginalPathListAppliedTo () const |
Returns the original path list the action is being applied to. | |
SbBool | isLastPathListAppliedTo () const |
Returns TRUE if the current list is the last one from the original. | |
PathCode | getPathCode (int &numIndices, const int *&indices) |
Returns path code based on where current node (the node at the end of the current path) lies with respect to the path(s) the action is being applied to. | |
PathCode | getPathCodeMI (int &numIndices, const int *&indices, const int *&instanceIndices) |
Extender API: available to programmers who wish to extend the toolkit | |
void | traverse (SoNode *node) |
Does traversal of a graph rooted by a node. | |
SbBool | hasTerminated () const |
Returns TRUE if the traversal has reached a termination condition. | |
const SoPath * | getCurPath () |
Returns the path accumulated during traversal, i.e., the chain of nodes from the root of the traversed graph to the current node being traversed. | |
SoState * | getState () const |
Gets the state from the action. | |
virtual void | setUpState () |
Creates state if it is NULL or it is no longer valid because new elements have been enabled since it was created. | |
void | setPipeId (int id) |
Sets pipe identifier in the range [1..N] associated to this render action while running a ScaleViz Multipipe configuration. | |
int | getPipeId () const |
Gets pipe identifier in the range [1..N] associated to this render action while running a ScaleViz Multipipe configuration. | |
bool | isBeingApplied () |
Returns TRUE if this action is currently being applied. | |
virtual bool | preDelayedTraversal () |
Method called by SoMultiPassManager before delayed pass traversals. | |
virtual void | postDelayedTraversal () |
Method called by SoMultiPassManager after delayed pass traversals. | |
Public Member Functions inherited from SoTypedObject | |
SbBool | isOfType (const SoType &type) const |
Returns TRUE if this object is of the type specified in type or is derived from that type. | |
template<typename TypedObjectClass > | |
SbBool | isOfType () const |
Returns TRUE if this object is of the type of class TypedObjectClass or is derived from that class. | |
Static Public Member Functions | |
static SoType | getClassTypeId () |
Returns the type identifier for this class. | |
Static Public Member Functions inherited from SoAction | |
static SoType | getClassTypeId () |
Returns the type identifier for this class. | |
static void | nullAction (SoAction *, SoNode *) |
Null action method that can be stored in lookup table when desired. | |
Static Public Member Functions inherited from SoTypedObject | |
static SoType | getClassTypeId () |
Returns the type identifier for this class. | |
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:
For each region, the associated link is the URL defined either by the SoWWWAnchor node.
Definition at line 71 of file SoToHTMLAction.h.
typedef void * SoToHTMLAction::SoToHTMLReallocCB(void *ptr, size_t newSize) |
Definition at line 76 of file SoToHTMLAction.h.
Components used to generate the image
Enumerator | |
---|---|
LUMINANCE | LUMINANCE. |
LUMINANCE_TRANSPARENCY | LUMINANCE_TRANSPARENCY. |
RGB | |
RGB_TRANSPARENCY | RGB_TRANSPARENCY. |
Definition at line 91 of file SoToHTMLAction.h.
Defines the format of the image
Enumerator | |
---|---|
BMP_FORMAT | BMP_FORMAT. |
JPEG_FORMAT | JPEG_FORMAT. |
Definition at line 103 of file SoToHTMLAction.h.
Defines the different shape type for maps.
Enumerator | |
---|---|
NONE | NONE. |
RECTANGLE | RECTANGLE. |
CIRCLE | CIRCLE. |
POLYGON |
Definition at line 79 of file SoToHTMLAction.h.
SoToHTMLAction::SoToHTMLAction | ( | ) |
Constructor.
SoToHTMLAction::~SoToHTMLAction | ( | ) |
Destructor.
|
virtual |
Generate HTML output for the specified list of path.
Reimplemented from SoAction.
|
virtual |
Generate HTML output for the specified root node.
Reimplemented from SoAction.
|
virtual |
Generate HTML output for the specified path.
Reimplemented from SoAction.
void SoToHTMLAction::closeHTMLFile | ( | ) |
Closes the HTML output file.
|
static |
Returns the type identifier for this class.
SbBool SoToHTMLAction::getHTMLBuffer | ( | void *& | bufPointer, |
size_t & | nBytes | ||
) | const |
Returns pointer to memory buffer of the HTML output being written to and the new size of the buffer.
Returns FALSE if not writing into a buffer.
FILE * SoToHTMLAction::getHTMLFilePointer | ( | ) | const |
Returns the file pointer in use, or NULL if using a buffer.
const SbColor & SoToHTMLAction::getImageBackgroundColor | ( | ) | const |
Returns the image background color.
Components SoToHTMLAction::getImageComponents | ( | ) | const |
Returns the components of image.
FILE * SoToHTMLAction::getImageFilePointer | ( | ) | const |
Returns the file pointer for the generated image file.
ImageFormat SoToHTMLAction::getImageFormat | ( | ) | const |
Returns the image format.
float SoToHTMLAction::getImageQuality | ( | ) | const |
Returns the image quality.
const char * SoToHTMLAction::getImageURLName | ( | ) | const |
Returns the URL name of image in the HTML file.
ShapeType SoToHTMLAction::getRegionShapeType | ( | ) | const |
Returns the region shape type.
|
virtual |
Returns the type identifier for this specific instance.
Implements SoTypedObject.
const SbViewportRegion & SoToHTMLAction::getViewportRegion | ( | ) | const |
Returns viewport region for the image.
SbBool SoToHTMLAction::isMapHighlight | ( | ) |
Returns anchor highlighting.
SoNONUNICODE SbBool SoToHTMLAction::openHTMLFile | ( | const char * | filename | ) |
Opens named file (sets file pointer to result) .
This returns FALSE on error. By default, output goes to stdout .
Non Unicode: This function should not be used in a Unicode application.
Opens named file (sets file pointer to result) .
This returns FALSE on error. By default, output goes to stdout .
void SoToHTMLAction::resetHTMLBuffer | ( | ) |
Resets buffer of the HTML output for output again.
Output starts over at beginning of buffer.
void SoToHTMLAction::setHTMLBuffer | ( | void * | bufPointer, |
size_t | initSize, | ||
SoToHTMLReallocCB * | reallocFunc, | ||
int32_t | offset = 0 |
||
) |
Sets up memory buffer for writing HTML output, its initial size, a reallocation function (which is called if there is not enough room in the buffer), and an offset in the buffer at which to begin writing.
If the reallocation function returns NULL, writing will be disabled.
void SoToHTMLAction::setHTMLFilePointer | ( | FILE * | newFP | ) |
Sets file pointer to write to.
void SoToHTMLAction::setImageBackgroundColor | ( | const SbColor & | c | ) |
Sets the image background color.
SbColor(0,0,0) by default.
void SoToHTMLAction::setImageComponents | ( | Components | components | ) |
Sets the components of image.
RGB by default.
void SoToHTMLAction::setImageFilePointer | ( | FILE * | newFP | ) |
Sets the file pointer to use for the generated image file.
If newFP is NULL, then the filename is the basename of the image URL name.
This is the second way to define the image file name.
void SoToHTMLAction::setImageFormat | ( | ImageFormat | format | ) |
Sets the image format.
JPEG_FORMAT by default.
void SoToHTMLAction::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.
void SoToHTMLAction::setImageURLName | ( | const char * | 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.
void SoToHTMLAction::setMapHighlight | ( | SbBool | onOff | ) |
Sets anchor highlighting.
TRUE by default.
void SoToHTMLAction::setRegionShapeType | ( | ShapeType | type | ) |
Sets the region shape type.
POLYGON by default.
void SoToHTMLAction::setViewportRegion | ( | const SbViewportRegion & | region | ) |
Specifies viewport region for the image.
Allows the user to specify the image size.