SoToHTMLAction Class Reference
[Actions]

VSG extension Generates an HTML image map and an image from a scene graph. More...

#include <Inventor/actions/SoToHTMLAction.h>

Inheritance diagram for SoToHTMLAction:
SoAction SoTypedObject

List of all members.

Public Types

enum  ShapeType {
  NONE,
  RECTANGLE,
  CIRCLE,
  POLYGON
}
enum  Components {
  LUMINANCE = 1,
  LUMINANCE_TRANSPARENCY = 2,
  RGB = 3,
  RGB_TRANSPARENCY = 4
}
enum  ImageFormat {
  BMP_FORMAT,
  JPEG_FORMAT
}
typedef void * SoToHTMLReallocCB (void *ptr, size_t newSize)

Public Member Functions

virtual SoType getTypeId () const
 SoToHTMLAction ()
 ~SoToHTMLAction ()
SoNONUNICODE SbBool openHTMLFile (const char *filename)
SbBool openHTMLFile (const SbString &filename)
void closeHTMLFile ()
void setHTMLFilePointer (FILE *newFP)
FILE * getHTMLFilePointer () const
void setHTMLBuffer (void *bufPointer, size_t initSize, SoToHTMLReallocCB *reallocFunc, int32_t offset=0)
SbBool getHTMLBuffer (void *&bufPointer, size_t &nBytes) const
void resetHTMLBuffer ()
void setImageURLName (const char *name)
const char * getImageURLName () const
void setImageFilePointer (FILE *newFP)
FILE * getImageFilePointer () const
void setRegionShapeType (ShapeType type)
ShapeType getRegionShapeType () const
void setImageBackgroundColor (const SbColor &c)
const SbColorgetImageBackgroundColor () const
void setImageComponents (Components components)
Components getImageComponents () const
void setImageFormat (ImageFormat format)
ImageFormat getImageFormat () const
void setImageQuality (float quality)
float getImageQuality () const
void setViewportRegion (const SbViewportRegion &region)
const SbViewportRegiongetViewportRegion () const
void setMapHighlight (SbBool onOff)
SbBool isMapHighlight ()
virtual void apply (SoNode *scene)
virtual void apply (SoPath *path)
virtual void apply (const SoPathList &pathList, SbBool flag=FALSE)

Static Public Member Functions

static SoType getClassTypeId ()

Detailed Description

VSG extension 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:

  1. 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.

  1. An image tag that references the image generated by SoToHTMLAction.

SEE ALSO

SoAction

See related examples:

IvToHTMLAction


Member Typedef Documentation

typedef void* SoToHTMLAction::SoToHTMLReallocCB(void *ptr, size_t newSize)

Member Enumeration Documentation

Components used to generate the image.

Enumerator:
LUMINANCE 

LUMINANCE.

LUMINANCE_TRANSPARENCY 

LUMINANCE_TRANSPARENCY.

RGB 

RGB(Default).

RGB_TRANSPARENCY 

RGB_TRANSPARENCY.

Defines the format of the image.

Enumerator:
BMP_FORMAT 

BMP_FORMAT.

JPEG_FORMAT 

JPEG_FORMAT.

Defines the different shape type for maps.

Enumerator:
NONE 

NONE.

RECTANGLE 

RECTANGLE.

CIRCLE 

CIRCLE.

POLYGON 

POLYGON(default).


Constructor & Destructor Documentation

SoToHTMLAction::SoToHTMLAction (  ) 

Constructor.

SoToHTMLAction::~SoToHTMLAction (  ) 

Destructor.


Member Function Documentation

virtual void SoToHTMLAction::apply ( const SoPathList pathList,
SbBool  flag = FALSE 
) [virtual]

Generate HTML output for the specified list of path.

Reimplemented from SoAction.

virtual void SoToHTMLAction::apply ( SoPath path  )  [virtual]

Generate HTML output for the specified path.

Reimplemented from SoAction.

virtual void SoToHTMLAction::apply ( SoNode scene  )  [virtual]

Generate HTML output for the specified root node.

Reimplemented from SoAction.

void SoToHTMLAction::closeHTMLFile (  ) 

Closes the HTML output file.

static SoType SoToHTMLAction::getClassTypeId (  )  [static]

Returns the type identifier for this class.

Reimplemented from SoAction.

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 SoType SoToHTMLAction::getTypeId (  )  const [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.

SbBool SoToHTMLAction::openHTMLFile ( const SbString filename  ) 

Opens named file (sets file pointer to result) .

This returns FALSE on error. By default, output goes to stdout .

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 List:
This function should not be used in a Unicode application.
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.


The documentation for this class was generated from the following file:

Open Inventor Toolkit reference manual, generated on 15 Mar 2023
Copyright © Thermo Fisher Scientific All rights reserved.
http://www.openinventor.com/