24#ifndef _SO_TO_HTML_ACTION_
25#define _SO_TO_HTML_ACTION_
271 static void initClass() ;
272 static void exitClass() ;
276 static void stencilCB(
void *d,
SoAction* action) ;
277 static void stencilEndCB(
void *d,
SoAction* action) ;
278 static void initStencilCB(
void *d,
SoAction* action) ;
282 void computeAnchorsBBoxList() ;
286 void addCallbackAtFirstForAnchors() ;
287 void removeAnchorsCallbacks() ;
291 void addInitStencilCallback() ;
292 void removeInitStencilCallback() ;
296 const char* retreiveAnchorURL(
int index) ;
299 void readStencilBuffer() ;
302 void writelnHTMLTag(
const char *tag) ;
303 void writeHTMLTag(
const char *tag) ;
304 void writeHTMLMaps() ;
305 void writeHTMLImage() ;
306 void writeHTML(
const char *str) ;
309 void generateHTMLOutput() ;
313 void updateAnchorsList() ;
319 int* computeApproximatePolygon(
const SbVec2s *polygon,
int numPolyPoints,
320 int &numApproxIndices) ;
324 void fillStencilBuffer(
const SbBox2s &box,
int valueToReplace,
int replaceValue) ;
328 const char* getImageURLBaseName()
const ;
354 unsigned char* m_stencilBuffer ;
363 SbColor m_imageBackgroundColor ;
369 float m_imageQuality ;
375 static int m_mapNumber ;
387 char* m_curHTMLBuffer ;
388 size_t m_HTMLBufferSize ;
391 SbBool makeRoomInBuf(
size_t nBytes) ;
#define FALSE
Possible value of SbBool.
#define SO_ACTION_HEADER(className)
Class for smart character strings.
Class for representing a viewport.
Abstract base class for all actions.
Abstract base class for all database nodes.
Maintains a list of pointers to nodes.
Path that points to a list of hierarchical nodes.
Maintains a list of pointers to paths.
Smart pointer for any class inheriting SoRefCounter.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Generates an HTM...
SoNONUNICODE SbBool openHTMLFile(const char *filename)
Opens named file (sets file pointer to result) .
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 resetHTMLBuffer()
Resets buffer of the HTML output for output again.
float getImageQuality() const
Returns the image quality.
virtual void apply(SoNode *scene)
Generate HTML output for the specified root node.
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 ca...
const char * getImageURLName() const
Returns the URL name of image in the HTML file.
const SbColor & getImageBackgroundColor() const
Returns the image background color.
void setHTMLFilePointer(FILE *newFP)
Sets file pointer to write to.
void setImageComponents(Components components)
Sets the components of image.
ImageFormat getImageFormat() const
Returns the image format.
SbBool isMapHighlight()
Returns anchor highlighting.
void setRegionShapeType(ShapeType type)
Sets the region shape type.
SoToHTMLAction()
Constructor.
void setImageFormat(ImageFormat format)
Sets the image format.
void setImageURLName(const char *name)
Sets the URL name of image in the HTML file, ("image.jpg" by default).
ShapeType getRegionShapeType() const
Returns the region shape type.
virtual void apply(SoPath *path)
Generate HTML output for the specified path.
Components getImageComponents() const
Returns the components of image.
ImageFormat
Defines the format of the image
@ JPEG_FORMAT
JPEG_FORMAT.
FILE * getHTMLFilePointer() const
Returns the file pointer in use, or NULL if using a buffer.
Components
Components used to generate the image
@ RGB_TRANSPARENCY
RGB_TRANSPARENCY.
@ LUMINANCE_TRANSPARENCY
LUMINANCE_TRANSPARENCY.
void * SoToHTMLReallocCB(void *ptr, size_t newSize)
void setViewportRegion(const SbViewportRegion ®ion)
Specifies viewport region for the image.
SbBool openHTMLFile(const SbString &filename)
Opens named file (sets file pointer to result) .
void closeHTMLFile()
Closes the HTML output file.
ShapeType
Defines the different shape type for maps.
@ POLYGON
POLYGON(default)
virtual void apply(const SoPathList &pathList, SbBool flag=FALSE)
Generate HTML output for the specified list of path.
~SoToHTMLAction()
Destructor.
void setImageQuality(float quality)
Sets the image quality.
void setImageBackgroundColor(const SbColor &c)
Sets the image background color.
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.
const SbViewportRegion & getViewportRegion() const
Returns viewport region for the image.
void setMapHighlight(SbBool onOff)
Sets anchor highlighting.