public abstract class SoVectorizeAction extends SoAction
SoVectorizeCGMAction
, SoVectorizeGDIAction
(Win32 only), SoVectorizeHPGLAction
, and SoVectorizePSAction
. As with SoWriteAction
, these subclasses contain an SoVectorOutput
instance (or derived) which writes by default to standard output. Methods on SoVectorOutput
can be called to specify what file to write to.
Default values:
PORTRAIT
REVERSE_ONLY_BLACK_AND_WHITE
BUTT_END
NO_JOIN
NO_HLHSR
FLAT
Line end styles description:
Force black and white rendering:
It is possible to force black and white rendering by setting the environment variable OIV_HC_BLACK_AND_WHITE (see SoPreferences
). In this mode all non-white colors are set to full black. This is useful because selecting "black & white" in the printer setup dialog normally produces gray scale rendering and some colors may be difficult to see. This option is applied after color translation (e.g. REVERSE_ONLY_BLACK_AND_WHITE). The variable must be set before creating an instance of the class.
Performance:
The HLHSR modes NO_HLHSR
and HLHSR_SIMPLE_PAINTER
are generally quite fast and should be used whenever possible (when the resulting image quality is acceptable or when a quick preview is desired). The other HLHSR modes involve computations that are very CPU intensive. In other words, the time required to produce an image depends almost entirely on the machine's processor speed. HLHSR_PAINTER_SURFACE_REMOVAL
has a very small dependency on the graphics board (because it does one offscreen render) whereas HLHSR_RASTER
performance is completely linked to the graphics board performance. The other modes are not affected by the graphics board performance. One implication of the CPU dependency is that the release libraries will generally be much faster than the debug libraries (because of compiler optimizations). Benchmarking should always be done using the release libraries.
Performance is directly related to the number of primitives (individual faces and line segments, not the number of nodes in the scene graph) and the number of intersecting or difficult-to-sort primitives. Performance decreases rapidly (worse than linear) for large numbers of primitives. Therefore algorithms that can reduce the number of primitives may be needed for large scenes (see, for example, SoSimplifyAction
).
In some cases setting a small polygon offset can improve performance by reducing interference between faces and lines (used only with the Painter's algorithm HLHSR modes).
HIDDEN_LINES_REMOVAL
mode is very slow and should not be used unless very precise output is required.
Generally HLHSR_RASTER
mode gives the best combination of performance and image quality.
Limitations
SoClipPlane
) is ignored.
SoAnnotation
nodes are handled like SoSeparator
nodes.
SoText2
(and SoAnnoText3
using an xxx_PRINT_RASTER option) will be rendered using native fonts, so the requested font name must be available on the rendering device.
Modifier and Type | Class and Description |
---|---|
static class |
SoVectorizeAction.ColorTranslationMethods
Color translation methods.
|
static class |
SoVectorizeAction.DimensionUnits
Dimension unit.
|
static class |
SoVectorizeAction.EndLineStyles
End line style.
|
static class |
SoVectorizeAction.HLHSRModes
HLHSR (Hidden Line and Hidden Surface Removal) mode.
|
static class |
SoVectorizeAction.JoinLineStyles
Join line style.
|
static class |
SoVectorizeAction.Orientations
Orientation type.
|
static class |
SoVectorizeAction.ShadeModels
Shading models.
|
SoAction.AppliedCodes, SoAction.DistribModes, SoAction.PathCodes, SoAction.PathIndices
Inventor.ConstructorCommand
ALL, BELOW_PATH, CLUSTER_ONLY, IN_PATH, LOCAL_ONLY, NO_PATH, NODE, OFF_PATH, PATH, PATH_LIST
VERBOSE_LEVEL, ZeroHandle
Modifier and Type | Method and Description |
---|---|
void |
beginPage(SbVec2f startPagePosition,
SbVec2f pageSize)
Calls beginPage(startPagePosition, pageSize, SoVectorizeAction.DimensionUnits.valueOf( SoVectorizeAction.DimensionUnits.MM.getValue() )).
|
void |
beginPage(SbVec2f startPagePosition,
SbVec2f pageSize,
SoVectorizeAction.DimensionUnits u)
Begin a new page.
|
static void |
enableElement(java.lang.Class<? extends Inventor> t,
int stkIndex) |
void |
enableLighting(boolean flag)
Allows the user to enable/disable the taking into account of lights in the scene graph during the computation of the vectorized file.
|
void |
endPage()
Ends a page.
|
SbColor |
getBackgroundColor()
Returns the color of the background.
|
boolean |
getColorPriority()
Returns the color priority.
|
SoVectorizeAction.ColorTranslationMethods |
getColorTranslationMethod()
Returns the method for choosing the color of the drawing on the sheet of paper.
|
SbVec2f |
getDrawingDimensions()
Calls getDrawingDimensions(SoVectorizeAction.DimensionUnits.valueOf( SoVectorizeAction.DimensionUnits.MM.getValue() )).
|
SbVec2f |
getDrawingDimensions(SoVectorizeAction.DimensionUnits u)
Returns the dimensions of the drawing on the sheet of paper.
|
SoVectorizeAction.HLHSRModes |
getHLHSRMode()
Returns the Hidden Line and Hidden Surface Removal mode.
|
boolean |
getHLHSRRasterCaching()
Returns the raster caching flag.
|
float |
getHLHSRRasterQuality()
Returns the raster image quality value.
|
SoVectorizeAction.EndLineStyles |
getLineEndStyle()
Returns the style for line ends.
|
SoVectorizeAction.JoinLineStyles |
getLineJoinsStyle()
Returns the style for line joins.
|
float |
getLineOffset()
Returns line offset.
|
float |
getLinePatternSize()
Calls getLinePatternSize(SoVectorizeAction.DimensionUnits.valueOf( SoVectorizeAction.DimensionUnits.MM.getValue() )).
|
float |
getLinePatternSize(SoVectorizeAction.DimensionUnits u)
Returns the line pattern scale factor.
|
float |
getMarkerOffset()
Returns marker offset.
|
float |
getMiterLimit()
Returns the miter limit.
|
float |
getNominalWidth()
Calls getNominalWidth(SoVectorizeAction.DimensionUnits.valueOf( SoVectorizeAction.DimensionUnits.MM.getValue() )).
|
float |
getNominalWidth(SoVectorizeAction.DimensionUnits u)
Returns the nominal width.
|
SoVectorizeAction.Orientations |
getOrientation()
Returns the orientation of the drawing on the sheet of paper.
|
int |
getPenNum()
Returns the number of pens.
|
float |
getPixelImageSize()
Calls getPixelImageSize(SoVectorizeAction.DimensionUnits.valueOf( SoVectorizeAction.DimensionUnits.MM.getValue() )).
|
float |
getPixelImageSize(SoVectorizeAction.DimensionUnits u)
Returns the size of a pixel.
|
float |
getPolygonOffset()
Returns polygon offset.
|
SoVectorizeAction.ShadeModels |
getShadeModel()
Returns the shade model.
|
SbVec2f |
getStartPosition()
Calls getStartPosition(SoVectorizeAction.DimensionUnits.valueOf( SoVectorizeAction.DimensionUnits.MM.getValue() )).
|
SbVec2f |
getStartPosition(SoVectorizeAction.DimensionUnits u)
Returns the start position of the drawing on the sheet of paper.
|
SoVectorOutput |
getVectorOutput()
Output access method.
|
boolean |
isLightingEnabled()
Returns true if lighting is enabled.
|
void |
setBackgroundColor(boolean bg)
Enables or disables the background and sets its color to white.
|
void |
setBackgroundColor(boolean bg,
SbColor color)
Sets the color of the background.
|
void |
setBorder(float width)
Sets the width of the border of the clipping limits.
|
void |
setBorder(float width,
SbColor color)
Sets the color and the width of the border of the clipping limits.
|
void |
setColorPriority(boolean priority)
Sets the color priority flag.
|
void |
setColorTranslationMethod(SoVectorizeAction.ColorTranslationMethods method)
Sets the method for choosing the color of the drawing on the sheet of paper.
|
void |
setDrawingDimensions(float w,
float h)
Calls setDrawingDimensions(w, h, SoVectorizeAction.DimensionUnits.valueOf( SoVectorizeAction.DimensionUnits.MM.getValue() )).
|
void |
setDrawingDimensions(float w,
float h,
SoVectorizeAction.DimensionUnits u)
Sets the dimensions of the drawing on the sheet of paper.
|
void |
setDrawingDimensions(SbVec2f d)
Calls setDrawingDimensions(d, SoVectorizeAction.DimensionUnits.valueOf( SoVectorizeAction.DimensionUnits.MM.getValue() )).
|
void |
setDrawingDimensions(SbVec2f d,
SoVectorizeAction.DimensionUnits u)
Sets the dimensions of the drawing on the sheet of paper.
|
void |
setHLHSRMode(SoVectorizeAction.HLHSRModes mode)
Sets the Hidden Line and Hidden Surface Removal mode.
|
void |
setHLHSRRasterCaching(boolean enable)
Enables/disables the use of OpenGL display lists to generate the raster image with the
HLHSR_RASTER algorithm. |
void |
setHLHSRRasterQuality(float quality)
Sets the quality of the raster image generated to vectorize visible primitives with the
HLHSR_RASTER algorithm. |
void |
setLineEndStyle(SoVectorizeAction.EndLineStyles style)
Sets the style for line ends.
|
void |
setLineJoinsStyle(SoVectorizeAction.JoinLineStyles style)
Sets the style for line joins.
|
void |
setLineOffset(float offset)
Sets line offset.
|
void |
setLinePatternSize(float w)
Calls setLinePatternSize(w, SoVectorizeAction.DimensionUnits.valueOf( SoVectorizeAction.DimensionUnits.MM.getValue() )).
|
void |
setLinePatternSize(float w,
SoVectorizeAction.DimensionUnits u)
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.
|
void |
setMarkerOffset(float offset)
Sets marker offset.
|
void |
setMiterLimit(float limit)
Sets the miter limit.
|
void |
setNominalWidth(float w)
Calls setNominalWidth(w, SoVectorizeAction.DimensionUnits.valueOf( SoVectorizeAction.DimensionUnits.MM.getValue() )).
|
void |
setNominalWidth(float w,
SoVectorizeAction.DimensionUnits u)
Sets the nominal width.
|
void |
setOrientation(SoVectorizeAction.Orientations o)
Sets the orientation of the drawing on the sheet of paper.
|
void |
setPenDescription()
Calls setPenDescription((com.openinventor.inventor.SbColor[])null, (float[])null, SoVectorizeAction.DimensionUnits.valueOf( SoVectorizeAction.DimensionUnits.MM.getValue() )).
|
void |
setPenDescription(SbColor[] colors)
Calls setPenDescription(colors, (float[])null, SoVectorizeAction.DimensionUnits.valueOf( SoVectorizeAction.DimensionUnits.MM.getValue() )).
|
void |
setPenDescription(SbColor[] colors,
float[] widths)
Calls setPenDescription(colors, widths, SoVectorizeAction.DimensionUnits.valueOf( SoVectorizeAction.DimensionUnits.MM.getValue() )).
|
void |
setPenDescription(SbColor[] colors,
float[] widths,
SoVectorizeAction.DimensionUnits u)
Sets the description of the color and the width of each pen.
|
void |
setPixelImageSize(float w)
Calls setPixelImageSize(w, SoVectorizeAction.DimensionUnits.valueOf( SoVectorizeAction.DimensionUnits.MM.getValue() )).
|
void |
setPixelImageSize(float w,
SoVectorizeAction.DimensionUnits u)
Sets the size of a pixel for image primitives.
|
void |
setPolygonOffset(float offset)
Method to set the Z offset to be applied to polygons in normalized device coordinates (-1 to 1 space).
|
void |
setShadeModel(SoVectorizeAction.ShadeModels model)
|
void |
setStartPosition(float x,
float y)
Calls setStartPosition(x, y, SoVectorizeAction.DimensionUnits.valueOf( SoVectorizeAction.DimensionUnits.MM.getValue() )).
|
void |
setStartPosition(float x,
float y,
SoVectorizeAction.DimensionUnits u)
Sets the start position of the drawing on the sheet of paper.
|
void |
setStartPosition(SbVec2f p)
Calls setStartPosition(p, SoVectorizeAction.DimensionUnits.valueOf( SoVectorizeAction.DimensionUnits.MM.getValue() )).
|
void |
setStartPosition(SbVec2f p,
SoVectorizeAction.DimensionUnits u)
Sets the start position of the drawing on the sheet of paper.
|
apply, apply, clearApplyResult, forwardTraversal, getContinueActionInBranchFlag, getCurPath, getNodeAppliedTo, getOriginalPathListAppliedTo, getPathAppliedTo, getPathCode, getPathListAppliedTo, getPipeId, getSceneManager, getState, getWhatAppliedTo, hasTerminated, invalidateState, isBeingApplied, isLastPathListAppliedTo, isUsingAlternateRep, nullAction, postDelayedTraversal, preDelayedTraversal, resetContinueActionInBranchFlag, setPipeId, setSceneManager, setUpState, stopActionInBranch, traverse, useAlternateRep
dispose, getAddress, getNativeResourceHandle, startInternalThreads, stopInternalThreads
@Deprecated public static final int INCH
SoVectorizeAction.DimensionUnits.INCH
instead.@Deprecated public static final int MM
SoVectorizeAction.DimensionUnits.MM
instead.@Deprecated public static final int METER
SoVectorizeAction.DimensionUnits.METER
instead.@Deprecated public static final int FLAT
SoVectorizeAction.ShadeModels.FLAT
instead.@Deprecated public static final int SMOOTH
SoVectorizeAction.ShadeModels.SMOOTH
instead.@Deprecated public static final int PORTRAIT
SoVectorizeAction.Orientations.PORTRAIT
instead.@Deprecated public static final int LANDSCAPE
SoVectorizeAction.Orientations.LANDSCAPE
instead.@Deprecated public static final int REVERSE_ONLY_BLACK_AND_WHITE
SoVectorizeAction.ColorTranslationMethods.REVERSE_ONLY_BLACK_AND_WHITE
instead.@Deprecated public static final int AS_IS
SoVectorizeAction.ColorTranslationMethods.AS_IS
instead.@Deprecated public static final int REVERSE
SoVectorizeAction.ColorTranslationMethods.REVERSE
instead.@Deprecated public static final int NO_JOIN
SoVectorizeAction.JoinLineStyles.NO_JOIN
instead.@Deprecated public static final int MITERED_JOIN
SoVectorizeAction.JoinLineStyles.MITERED_JOIN
instead.@Deprecated public static final int MITERED_BEVELED_JOIN
SoVectorizeAction.JoinLineStyles.MITERED_BEVELED_JOIN
instead.@Deprecated public static final int BEVELED_JOIN
SoVectorizeAction.JoinLineStyles.BEVELED_JOIN
instead.@Deprecated public static final int TRIANGULAR_JOIN
SoVectorizeAction.JoinLineStyles.TRIANGULAR_JOIN
instead.@Deprecated public static final int ROUNDED_JOIN
SoVectorizeAction.JoinLineStyles.ROUNDED_JOIN
instead.@Deprecated public static final int BUTT_END
SoVectorizeAction.EndLineStyles.BUTT_END
instead.@Deprecated public static final int SQUARE_END
SoVectorizeAction.EndLineStyles.SQUARE_END
instead.@Deprecated public static final int TRIANGULAR_END
SoVectorizeAction.EndLineStyles.TRIANGULAR_END
instead.@Deprecated public static final int ROUND_END
SoVectorizeAction.EndLineStyles.ROUND_END
instead.@Deprecated public static final int NO_HLHSR
SoVectorizeAction.HLHSRModes.NO_HLHSR
instead.@Deprecated public static final int HLHSR_SIMPLE_PAINTER
SoVectorizeAction.HLHSRModes.HLHSR_SIMPLE_PAINTER
instead.@Deprecated public static final int HLHSR_PAINTER
SoVectorizeAction.HLHSRModes.HLHSR_PAINTER
instead.@Deprecated public static final int HLHSR_PAINTER_SURFACE_REMOVAL
SoVectorizeAction.HLHSRModes.HLHSR_PAINTER_SURFACE_REMOVAL
instead.@Deprecated public static final int HLHSR_RASTER
SoVectorizeAction.HLHSRModes.HLHSR_RASTER
instead.@Deprecated public static final int HIDDEN_LINES_REMOVAL
SoVectorizeAction.HLHSRModes.HIDDEN_LINES_REMOVAL
instead.public void setDrawingDimensions(float w, float h)
public void setDrawingDimensions(SbVec2f d)
public float getPixelImageSize()
public void setPenDescription()
public float getNominalWidth()
public void setPenDescription(SbColor[] colors)
public void beginPage(SbVec2f startPagePosition, SbVec2f pageSize)
public void setLinePatternSize(float w)
public void setNominalWidth(float w)
public void setPixelImageSize(float w)
public float getLinePatternSize()
public void setStartPosition(float x, float y)
public SbVec2f getDrawingDimensions()
public SbVec2f getStartPosition()
public void setStartPosition(SbVec2f p)
public void setPenDescription(SbColor[] colors, float[] widths)
public void setStartPosition(SbVec2f p, SoVectorizeAction.DimensionUnits u)
public SbVec2f getStartPosition(SoVectorizeAction.DimensionUnits u)
public void setOrientation(SoVectorizeAction.Orientations o)
public SoVectorizeAction.Orientations getOrientation()
public void setBorder(float width)
public SbColor getBackgroundColor()
public void setNominalWidth(float w, SoVectorizeAction.DimensionUnits u)
public void setBackgroundColor(boolean bg, SbColor color)
public void setBorder(float width, SbColor color)
public void setBackgroundColor(boolean bg)
public void setStartPosition(float x, float y, SoVectorizeAction.DimensionUnits u)
public void setHLHSRRasterCaching(boolean enable)
HLHSR_RASTER
algorithm.
Enabled by default.public boolean getHLHSRRasterCaching()
setHLHSRRasterCaching()
.public float getHLHSRRasterQuality()
setHLHSRRasterQuality()
.public float getLineOffset()
setPolygonOffset
.public void setHLHSRRasterQuality(float quality)
HLHSR_RASTER
algorithm.
0 is the worst quality, 1 is the best.public SoVectorOutput getVectorOutput()
SoOutput
instance in action.public void setDrawingDimensions(SbVec2f d, SoVectorizeAction.DimensionUnits u)
public SbVec2f getDrawingDimensions(SoVectorizeAction.DimensionUnits u)
public void setDrawingDimensions(float w, float h, SoVectorizeAction.DimensionUnits u)
public void beginPage(SbVec2f startPagePosition, SbVec2f pageSize, SoVectorizeAction.DimensionUnits u)
SoVectorizePSAction vectPS = new SoVectorizePSAction(); vectPS.beginPage(startPos, pageSize); // Draw the scene graph root1 from the start point // (x1, y1) to the end point(x1+width1, y1+height1) vectPS.setStartPosition(x1, y1); vectPS.setDrawingDimensions(width1, height1); vectPS.setBorder(2.0); vectPS.apply(root1); vectPS.setStartPosition(x2, y2); vectPS.setDrawingDimensions(width2, height2); vectPS.apply(root2); ... vectPS.setStartPosition(xi, yi); vectPS.setDrawingDimensions(widthi, heighti); vectPS.apply(rooti); vectPS.endPage();
public void endPage()
public float getNominalWidth(SoVectorizeAction.DimensionUnits u)
public void enableLighting(boolean flag)
public boolean isLightingEnabled()
public void setShadeModel(SoVectorizeAction.ShadeModels model)
public SoVectorizeAction.HLHSRModes getHLHSRMode()
public void setColorPriority(boolean priority)
public boolean getColorPriority()
public void setHLHSRMode(SoVectorizeAction.HLHSRModes mode)
NO_HLHSR
. Hidden lines and hidden surfaces are not removed.
HLHSR_SIMPLE_PAINTER
. Simple painter's algorithm is used for HLHSR. Lines and surfaces are sorted by their maximum Z depth and displayed in order from front to back so lines and surfaces that are in the foreground are drawn last. If the scene contains interpenetrating primitives, there may be visibility errors in the resulting output.
HLHSR_PAINTER
. Like the simple painter's algorithm, the primitives are depth sorted and displayed from front to back. In addition, some ambiguities where the polygons' Z extents overlap are resolved. Primitives that intersect other primitives are split and the new pieces sorted to provide more correct visual results. This mode is slower than the HLHSR_SIMPLE_PAINTER mode.
HLHSR_PAINTER_SURFACE_REMOVAL
. This mode is the same as the previous, but a first pass removes surfaces that are completely hidden. The method used to remove hidden surfaces is a pixel rendering method, so for very small surfaces, some accuracy errors can occur. Because some surfaces are removed before the painter's algorithm is applied, this method can be significantly faster than the previous one. Generally output files are smaller than using the previous method.
HLHSR_RASTER
. A raster image is generated and vectorized to determine visible primitives.
HIDDEN_LINES_REMOVAL
. This mode removes all hidden lines. Whether the screen render style is FILLED or LINES, the output render style will be lines. This mode is very slow but gives correct results.
public float getPolygonOffset()
setPolygonOffset
.public float getMarkerOffset()
setPolygonOffset
.public static void enableElement(java.lang.Class<? extends Inventor> t, int stkIndex)
public void setMarkerOffset(float offset)
setPolygonOffset
.public SoVectorizeAction.ShadeModels getShadeModel()
public void setPolygonOffset(float offset)
SoPolygonOffset
, a positive offset value moves the primitives away from the camera and a negative value pulls them closer. There are separate methods for lines (setLineOffset
) and markers (setMarkerOffset
). The default value for the offset methods is zero. SoPolygonOffset
can significantly reduce the problem for normal rendering, but has no effect on vectorized rendering. However a Z offset of approximately 0.01 applied to polygons will usually improve the appearance of vectorized coplanar primitives. Applying too large an offset may cause the converse visual artifact where lines that should be hidden become visible.public void setLineOffset(float offset)
setPolygonOffset
.public void setColorTranslationMethod(SoVectorizeAction.ColorTranslationMethods method)
public SoVectorizeAction.ColorTranslationMethods getColorTranslationMethod()
public void setLineEndStyle(SoVectorizeAction.EndLineStyles style)
public float getPixelImageSize(SoVectorizeAction.DimensionUnits u)
public void setLinePatternSize(float w, SoVectorizeAction.DimensionUnits u)
public float getLinePatternSize(SoVectorizeAction.DimensionUnits u)
public void setPixelImageSize(float w, SoVectorizeAction.DimensionUnits u)
public float getMiterLimit()
public void setPenDescription(SbColor[] colors, float[] widths, SoVectorizeAction.DimensionUnits u)
public int getPenNum()
public void setMiterLimit(float limit)
public SoVectorizeAction.EndLineStyles getLineEndStyle()
public void setLineJoinsStyle(SoVectorizeAction.JoinLineStyles style)
public SoVectorizeAction.JoinLineStyles getLineJoinsStyle()
Generated on January 23, 2025, Copyright © Thermo Fisher Scientific. All rights reserved. http://www.openinventor.com