Open Inventor Release 2024.2.1
 
Loading...
Searching...
No Matches
SoVectorizeGDIAction Class Reference

HardCopy Vectorize a scene graph to MS-Windows GDI formats. More...

#include <HardCopy/SoVectorizeGDIAction.h>

+ Inheritance diagram for SoVectorizeGDIAction:

Public Member Functions

virtual SoType getTypeId () const
 Returns the type identifier for this specific instance.
 
 SoVectorizeGDIAction ()
 Constructor.
 
virtual ~SoVectorizeGDIAction ()
 Destructor.
 
SoGDIVectorOutputgetGDIVectorOutput () const
 Returns the SoGDIVectorOutput instance in action.
 
SbBool hasPrinter ()
 Returns TRUE if the printer is set.
 
- Public Member Functions inherited from SoVectorizeAction
virtual ~SoVectorizeAction ()
 
virtual SoVectorOutputgetVectorOutput () const
 Output access method.
 
virtual void apply (SoNode *node)
 Initiates an action on the graph specified by a node.
 
virtual void apply (SoPath *path)
 Initiates an action on the graph specified by a path.
 
virtual void apply (const SoPathList &pathList, SbBool obeysRules=FALSE)
 Initiates an action on the graph specified by list of paths.
 
virtual void beginPage (const SbVec2f &startPagePosition, const SbVec2f &pageSize, DimensionUnit u=MM)
 Begin a new page.
 
virtual void endPage ()
 Ends a page.
 
virtual void setDrawingDimensions (float w, float h, DimensionUnit u=MM)
 Sets the dimensions of the drawing on the sheet of paper.
 
virtual void setDrawingDimensions (const SbVec2f &d, DimensionUnit u=MM)
 Sets the dimensions of the drawing on the sheet of paper.
 
virtual SbVec2f getDrawingDimensions (DimensionUnit u=MM) const
 Returns the dimensions of the drawing on the sheet of paper.
 
virtual void setStartPosition (float x, float y, DimensionUnit u=MM)
 Sets the start position of the drawing on the sheet of paper.
 
virtual void setStartPosition (const SbVec2f &p, DimensionUnit u=MM)
 Sets the start position of the drawing on the sheet of paper.
 
virtual SbVec2f getStartPosition (DimensionUnit u=MM) const
 Returns the start position of the drawing on the sheet of paper.
 
virtual void setOrientation (Orientation o)
 Sets the orientation of the drawing on the sheet of paper.
 
virtual Orientation getOrientation () const
 Returns the orientation of the drawing on the sheet of paper.
 
virtual void setBorder (float width)
 Sets the width of the border of the clipping limits.
 
virtual void setBorder (float width, SbColor color)
 Sets the color and the width of the border of the clipping limits.
 
virtual void getBorder (float *w, SbColor *color) const
 Returns the color and the width of the border of the clipping limits.
 
virtual void setBackgroundColor (SbBool bg)
 Enables or disables the background and sets its color to white.
 
virtual void setBackgroundColor (SbBool bg, SbColor color)
 Sets the color of the background.
 
virtual SbBool getBackgroundColor (SbColor *color) const
 Returns the color of the background.
 
virtual void setNominalWidth (float w, DimensionUnit u=MM)
 Sets the nominal width.
 
virtual float getNominalWidth (DimensionUnit u=MM) const
 Returns the nominal width.
 
virtual void setLinePatternSize (float w, DimensionUnit u=MM)
 Sets the line pattern size, i.e., the association between printer pattern (16 printer "points") and the size of the line pattern on the hard copy output.
 
virtual float getLinePatternSize (DimensionUnit u=MM) const
 Returns the line pattern scale factor.
 
virtual void setPixelImageSize (float w, DimensionUnit u=MM)
 Sets the size of a pixel for image primitives.
 
virtual float getPixelImageSize (DimensionUnit u=MM) const
 Returns the size of a pixel.
 
virtual void setColorTranslationMethod (ColorTranslationMethod method)
 Sets the method for choosing the color of the drawing on the sheet of paper.
 
virtual ColorTranslationMethod getColorTranslationMethod () const
 Returns the method for choosing the color of the drawing on the sheet of paper.
 
virtual void setLineEndStyle (EndLineStyle style)
 Sets the style for line ends.
 
virtual EndLineStyle getLineEndStyle () const
 Returns the style for line ends.
 
virtual void setLineJoinsStyle (JoinLineStyle style)
 Sets the style for line joins.
 
virtual JoinLineStyle getLineJoinsStyle () const
 Returns the style for line joins.
 
virtual void setMiterLimit (float limit)
 Sets the miter limit.
 
virtual float getMiterLimit () const
 Returns the miter limit.
 
virtual void setPenDescription (int num_pens, const SbColor *colors=0, const float *widths=0, DimensionUnit u=MM)
 Sets the description of the color and the width of each pen.
 
virtual void getPenDescription (SbColor *colors, float *widths, DimensionUnit u=MM) const
 Returns the description of the color and the width of each pen.
 
virtual int getPenNum () const
 Returns the number of pens.
 
virtual void setColorPriority (SbBool priority)
 Sets the color priority flag.
 
virtual SbBool getColorPriority (void) const
 Returns the color priority.
 
virtual void setHLHSRMode (HLHSRMode mode)
 Sets the Hidden Line and Hidden Surface Removal mode.
 
HLHSRMode getHLHSRMode () const
 Returns the Hidden Line and Hidden Surface Removal mode.
 
void setHLHSRRasterQuality (float quality)
 Sets the quality of the raster image generated to vectorize visible primitives with the HLHSR_RASTER algorithm.
 
float getHLHSRRasterQuality () const
 Returns the raster image quality value.
 
void setHLHSRRasterCaching (SbBool enable)
 Enables/disables the use of OpenGL display lists to generate the raster image with the HLHSR_RASTER algorithm.
 
SbBool getHLHSRRasterCaching () const
 Returns the raster caching flag.
 
virtual void enableLighting (SbBool flag)
 Allows the user to enable/disable the taking into account of lights in the scene graph during the computation of the vectorized file.
 
SbBool isLightingEnabled () const
 Returns TRUE if lighting is enabled.
 
void setShadeModel (ShadeModel model)
 Selects FLAT or SMOOTH shading.
 
ShadeModel getShadeModel ()
 Returns the shade model.
 
void setPolygonOffset (float offset)
 Method to set the Z offset to be applied to polygons in normalized device coordinates (-1 to 1 space).
 
void setLineOffset (float offset)
 Sets line offset.
 
void setMarkerOffset (float offset)
 Sets marker offset.
 
float getPolygonOffset () const
 Returns polygon offset.
 
float getLineOffset () const
 Returns line offset.
 
float getMarkerOffset () const
 Returns marker offset.
 
- 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 ).
 
SoSceneManagergetSceneManager () 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.
 
SoNodegetNodeAppliedTo () const
 Returns the node the action is being applied to.
 
SoPathgetPathAppliedTo () const
 Returns the path the action is being applied to.
 
const SoPathListgetPathListAppliedTo () const
 Returns the path list the action is being applied to.
 
const SoPathListgetOriginalPathListAppliedTo () 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 SoPathgetCurPath ()
 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.
 
SoStategetState () 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 SoVectorizeAction
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.
 

Additional Inherited Members

- Public Types inherited from SoVectorizeAction
enum  DimensionUnit {
  INCH ,
  MM ,
  METER
}
 Dimension unit. More...
 
enum  ShadeModel {
  FLAT ,
  SMOOTH
}
 Shading models. More...
 
enum  Orientation {
  PORTRAIT ,
  LANDSCAPE
}
 Orientation type. More...
 
enum  ColorTranslationMethod {
  REVERSE_ONLY_BLACK_AND_WHITE ,
  AS_IS ,
  REVERSE
}
 Color translation methods. More...
 
enum  JoinLineStyle {
  NO_JOIN ,
  MITERED_JOIN ,
  MITERED_BEVELED_JOIN ,
  BEVELED_JOIN ,
  TRIANGULAR_JOIN ,
  ROUNDED_JOIN
}
 Join line style. More...
 
enum  EndLineStyle {
  BUTT_END ,
  SQUARE_END ,
  TRIANGULAR_END ,
  ROUND_END
}
 End line style. More...
 
enum  HLHSRMode {
  NO_HLHSR ,
  HLHSR_SIMPLE_PAINTER ,
  HLHSR_PAINTER ,
  HLHSR_PAINTER_SURFACE_REMOVAL ,
  HLHSR_RASTER ,
  HIDDEN_LINES_REMOVAL
}
 HLHSR (Hidden Line and Hidden Surface Removal) mode. More...
 
- 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...
 

Detailed Description

HardCopy Vectorize a scene graph to MS-Windows GDI formats.


[Windows only] This class is not implemented on UNIX systems.

This class is used for vectorizing scene graphs to GDI format outputs. It contains an SoGDIVectorOutput instance which writes by default to the standard output (printer). Methods on the SoGDIVectorOutput can be called to specify the output type and its attributes (such as the EMF file name).

NOTE: If margin values are not valid for the targeted printer driver, it will be automatically reset to a correct one by the driver without prompting the user that the resulting output may not be exactly what he expected.

Printer Control:
By default this class controls the printer (making the StartDoc, StartPage, etc Windows system calls) and defines the logical to device coordinate system mapping. In some cases the application, or application framework (e.g. MFC) may wish to control the printer directly. This is possible by setting the preference variable OIV_HCGDI_APPCONTROL to a non-zero value, using either a config file or the SoPreferences class. When this variable is non-zero, the application is responsible for calling StartDoc, StartPage, EndPage and EndDoc to manage the printer. There are two modes, depending on the value of OIV_HCGDI_APPCONTROL:

  • 1 : This is the most flexible mode. The application is responsible for setting the map mode, logical to device mapping, etc. (in addition to managing the printer). This mode is normally used in MFC applications.
  • 2 : This is the most convenient mode if you only need to manage the printer. SoVectorizeGDIAction will set up the mapping as usual. This mode is only available in Open Inventor 7.2 and higher.

NOTE: When OIV_HCGDI_APPCONTROL is set, the methods that take parameters in physical units (e.g. millimeters) actually expect the values in current device units. For example, in this mode most applications call the GDI method SetMapMode() with HI_METRIC, meaning that device units are now .01 millimeter (provides better resolution for detailed drawings). As a result methods like setDrawingDimensions() and setNominalWidth must now be called with HI_METRIC units. For 1 mm, pass the value 100.

Polygon edge width:
GDI uses a "brush" to draw the interior of a polygon and a "pen" to draw the edges of the polygon. By default the action uses a minimum width line for the polygon edges, but it is possible to specify the edge width by setting the environment variable OIV_HCGDI_EDGE_WIDTH (see SoPreferences). Zero means minimum width. Values > 0 are a scale factor applied to the "nominalWidth" (see SoVectorizeAction::setNominalWidth) similar to the line width set with SoDrawStyle::lineWidth. This value is fetched in the constructor so it must be set before creating an SoVectorizeGDIAction.

Limitations:

  • End line style TRIANGULAR is not supported end line style ROUND is assumed instead.
  • Join line style NONE, MITERED_BEVELED, and TRIANGULAR are not supported; join line styles BEVELED, MITERED, and ROUNDED are
    assumed instead.
  • End and Join line styles are only supported for solid lines.
  • User's DC must be of HDC type.
  • Vertical text orientation may not be kept when editing .emf files in third parties applications, for instance MS Word.
  • A big value for the line width (defined with an SoDrawStyle) may result in previewing or printing
    solid lines though they remain patterned. It depends on how big gaps are in the pattern.
  • See additional limitations in SoVectorizeAction.

Definition at line 200 of file SoVectorizeGDIAction.h.

Constructor & Destructor Documentation

◆ SoVectorizeGDIAction()

SoVectorizeGDIAction::SoVectorizeGDIAction ( )

Constructor.

◆ ~SoVectorizeGDIAction()

virtual SoVectorizeGDIAction::~SoVectorizeGDIAction ( )
virtual

Destructor.

Member Function Documentation

◆ getClassTypeId()

static SoType SoVectorizeGDIAction::getClassTypeId ( )
static

Returns the type identifier for this class.


◆ getGDIVectorOutput()

SoGDIVectorOutput * SoVectorizeGDIAction::getGDIVectorOutput ( ) const

Returns the SoGDIVectorOutput instance in action.

◆ getTypeId()

virtual SoType SoVectorizeGDIAction::getTypeId ( ) const
virtual

Returns the type identifier for this specific instance.

Reimplemented from SoVectorizeAction.

◆ hasPrinter()

SbBool SoVectorizeGDIAction::hasPrinter ( )
inline

Returns TRUE if the printer is set.

Initial value is FALSE.

Definition at line 227 of file SoVectorizeGDIAction.h.


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