# Visualization
TKService
PS

# PS_Driver Class Reference

This class defines a PS (Adobe PostScript) plotter Driver.
All necessary information about methods (purpose, level, category, etc.)
can be found in CDL files from the inheritance tree (PlotMgt_PlotterDriver,
Aspect_Driver).
.

`#include <PS_Driver.hxx>`

Inheritance diagram for PS_Driver:

[legend]

## Public Member Functions

Standard_EXPORT | PS_Driver (const Standard_CString aName, const Quantity_Length aDX, const Quantity_Length aDY, const Aspect_TypeOfColorSpace aTypeOfColorSpace=Aspect_TOCS_RGB, const Aspect_FormatOfSheetPaper aSheetFormat=Aspect_FOSP_A4)
Standard_EXPORT | PS_Driver (const Handle(PlotMgt_Plotter)&aPlotter, const Standard_CString aName, const Quantity_Length aPaperX, const Quantity_Length aPaperY, const Aspect_TypeOfColorSpace aTypeOfColorSpace=Aspect_TOCS_RGB)
| Constructs a file called aName as the graphic plotter file. The parameters of the plotter aPlotter are taken into account for defining this plotter file. aPaperX,aPaperY defines the size of the sheet-paper and the value of aTypeOfColorSpace defines the mode for processing colors. .
Standard_EXPORT void | BeginDraw ()
| Begins a new page of graphics in the plotter file called "aName". .
Standard_EXPORT void | EndDraw (const Standard_Boolean dontFlush=Standard_False)
| Flush all graphics and Wait after up to date .
virtual Standard_EXPORT void | SetTextAttrib (const Standard_Integer ColorIndex, const Standard_Integer FontIndex)
virtual Standard_EXPORT void | SetTextAttrib (const Standard_Integer ColorIndex, const Standard_Integer FontIndex, const Quantity_PlaneAngle aSlant, const Quantity_Factor aHScale, const Quantity_Factor aWScale, const Standard_Boolean isUnderlined=Standard_False)
virtual Standard_EXPORT Standard_Boolean | SizeOfImageFile (const Standard_CString anImageFile, Standard_Integer &aWidth, Standard_Integer &aHeight) const
| Returns Standard_True and the Image Size in PIXEL if the image file exist and can be computed by the driver, .
Standard_EXPORT const | Handle (Standard_Type)&DynamicType() const

## Protected Member Functions

virtual Standard_EXPORT void | InitializeColorMap (const Handle(Aspect_ColorMap)&aColorMap)
virtual Standard_EXPORT void | InitializeTypeMap (const Handle(Aspect_TypeMap)&aTypeMap)
virtual Standard_EXPORT void | InitializeWidthMap (const Handle(Aspect_WidthMap)&aWidthMap)
virtual Standard_EXPORT void | InitializeFontMap (const Handle(Aspect_FontMap)&aFontMap)
virtual Standard_EXPORT void | InitializeMarkMap (const Handle(Aspect_MarkMap)&aFontMap)
virtual Standard_EXPORT void | PlotLineAttrib (const Standard_Integer ColorIndex, const Standard_Integer TypeIndex, const Standard_Integer WidthIndex)
| retrieve current line attributes
virtual Standard_EXPORT Standard_Boolean | PlotPoint (const Standard_ShortReal X, const Standard_ShortReal Y)
virtual Standard_EXPORT Standard_Boolean | PlotSegment (const Standard_ShortReal X1, const Standard_ShortReal Y1, const Standard_ShortReal X2, const Standard_ShortReal Y2)
virtual Standard_EXPORT Standard_Boolean | PlotPolyline (const Standard_Address xArray, const Standard_Address yArray, const Standard_Address nPts, const Standard_Integer nParts)
virtual Standard_EXPORT Standard_Boolean | PlotPolygon (const Standard_Address xArray, const Standard_Address yArray, const Standard_Address nPts, const Standard_Integer nParts)
virtual Standard_EXPORT Standard_Boolean | PlotArc (const Standard_ShortReal X, const Standard_ShortReal Y, const Standard_ShortReal anXradius, const Standard_ShortReal anYradius, const Standard_ShortReal sAngle, const Standard_ShortReal oAngle)
virtual Standard_EXPORT Standard_Boolean | PlotPolyArc (const Standard_ShortReal X, const Standard_ShortReal Y, const Standard_ShortReal anXradius, const Standard_ShortReal anYradius, const Standard_ShortReal sAngle, const Standard_ShortReal oAngle)
virtual Standard_EXPORT Standard_Boolean | PlotMarker (const Standard_Integer aMarker, const Standard_ShortReal Xpos, const Standard_ShortReal Ypos, const Standard_ShortReal Width, const Standard_ShortReal Height, const Standard_ShortReal Angle)
virtual Standard_EXPORT Standard_Boolean | PlotText (const TCollection_ExtendedString &aText, const Standard_ShortReal Xpos, const Standard_ShortReal Ypos, const Standard_ShortReal anAngle, const Aspect_TypeOfText aType)
virtual Standard_EXPORT Standard_Boolean | PlotText (const Standard_CString aText, const Standard_ShortReal Xpos, const Standard_ShortReal Ypos, const Standard_ShortReal anAngle, const Aspect_TypeOfText aType)
virtual Standard_EXPORT Standard_Boolean | PlotPolyText (const TCollection_ExtendedString &aText, const Standard_ShortReal Xpos, const Standard_ShortReal Ypos, const Quantity_Ratio aMargin, const Standard_ShortReal anAngle, const Aspect_TypeOfText aType)
virtual Standard_EXPORT Standard_Boolean | PlotPolyText (const Standard_CString aText, const Standard_ShortReal Xpos, const Standard_ShortReal Ypos, const Quantity_Ratio aMargin, const Standard_ShortReal anAngle, const Aspect_TypeOfText aType)
virtual Standard_EXPORT Standard_Boolean | PlotImage (const Standard_ShortReal aX, const Standard_ShortReal aY, const Standard_ShortReal aWidth, const Standard_ShortReal aHeight, const Standard_ShortReal aScale, const Standard_CString anImageFile, const Standard_Address anArrayOfPixels, const Standard_Integer aLineIndex=-1)
virtual Standard_EXPORT Standard_Boolean | DrawCurveCapable () const
| Should be called from PlotMgt_TextManager::Curveto() method to check if the driver is capable to draw curves. .

## Private Member Functions

Standard_EXPORT void | BeginFile (const Handle(PlotMgt_Plotter)&aPlotter, const Standard_CString aName, const Quantity_Length aDX, const Quantity_Length aDY, const Aspect_TypeOfColorSpace aTypeOfColorSpace, const Quantity_Length aPaperX, const Quantity_Length aPaperY)
Standard_EXPORT Standard_ShortReal | Convert (const Standard_ShortReal aShortReal) const

For this driver
- returns the DPU (device plotter unit) value
corresponding to the number of pixels PV, or
- returns the number of pixels corresponding to the DPU value DV, or
- returns the DPU coordinates (DX,DY)
corresponding to the pixel position (PX,PY), or
- returns the pixel position (PX,PY) corresponding to
the DPU coordinates (DX,DY).
The DPU value is specified in millimeters by default.
Warning
The pixel size is 325mm/1152 by default and can be
changed with the SetPixelSize function.
.

virtual Standard_EXPORT Standard_ShortReal | MapX (const Standard_ShortReal aShortReal) const
virtual Standard_EXPORT Standard_ShortReal | MapY (const Standard_ShortReal aShortReal) const

## Private Attributes

Standard_Integer | myCurrentPage

## Constructor & Destructor Documentation

Standard_EXPORT PS_Driver::PS_Driver | ( | const Standard_CString | aName,
|  | const Quantity_Length | aDX,
|  | const Quantity_Length | aDY,
|  | const Aspect_TypeOfColorSpace | aTypeOfColorSpace = `Aspect_TOCS_RGB`,
|  | const Aspect_FormatOfSheetPaper | aSheetFormat = `Aspect_FOSP_A4`
| ) |

Standard_EXPORT PS_Driver::PS_Driver | ( | const Handle(PlotMgt_Plotter)& | aPlotter,
|  | const Standard_CString | aName,
|  | const Quantity_Length | aPaperX,
|  | const Quantity_Length | aPaperY,
|  | const Aspect_TypeOfColorSpace | aTypeOfColorSpace = `Aspect_TOCS_RGB`
| ) |

## Member Function Documentation

Standard_EXPORT void PS_Driver::BeginDraw | ( |  | ) | `[virtual]`

| Implements PlotMgt_PlotterDriver.

Standard_EXPORT void PS_Driver::BeginFile | ( | const Handle(PlotMgt_Plotter)& | aPlotter,
|  | const Standard_CString | aName,
|  | const Quantity_Length | aDX,
|  | const Quantity_Length | aDY,
|  | const Aspect_TypeOfColorSpace | aTypeOfColorSpace,
|  | const Quantity_Length | aPaperX,
|  | const Quantity_Length | aPaperY
| ) | `[private]`

Standard_EXPORT Standard_ShortReal PS_Driver::Convert | ( | const Standard_ShortReal | aShortReal | ) | const`[private]`

virtual Standard_EXPORT Standard_Boolean PS_Driver::DrawCurveCapable | ( |  | ) | const`[protected, virtual]`

| Reimplemented from PlotMgt_PlotterDriver.

Standard_EXPORT void PS_Driver::EndDraw | ( | const Standard_Boolean | dontFlush = `Standard_False` | ) | `[virtual]`

| Implements Aspect_Driver.

Standard_EXPORT const PS_Driver::Handle | ( | Standard_Type |  | ) | const

| Reimplemented from PlotMgt_PlotterDriver.

virtual Standard_EXPORT void PS_Driver::InitializeColorMap | ( | const Handle(Aspect_ColorMap)& | aColorMap | ) | `[protected, virtual]`

| Reimplemented from PlotMgt_PlotterDriver.

virtual Standard_EXPORT void PS_Driver::InitializeFontMap | ( | const Handle(Aspect_FontMap)& | aFontMap | ) | `[protected, virtual]`

| Reimplemented from PlotMgt_PlotterDriver.

virtual Standard_EXPORT void PS_Driver::InitializeMarkMap | ( | const Handle(Aspect_MarkMap)& | aFontMap | ) | `[protected, virtual]`

| Reimplemented from PlotMgt_PlotterDriver.

virtual Standard_EXPORT void PS_Driver::InitializeTypeMap | ( | const Handle(Aspect_TypeMap)& | aTypeMap | ) | `[protected, virtual]`

| Reimplemented from PlotMgt_PlotterDriver.

virtual Standard_EXPORT void PS_Driver::InitializeWidthMap | ( | const Handle(Aspect_WidthMap)& | aWidthMap | ) | `[protected, virtual]`

| Reimplemented from PlotMgt_PlotterDriver.

virtual Standard_EXPORT Standard_ShortReal PS_Driver::MapX | ( | const Standard_ShortReal | aShortReal | ) | const`[private, virtual]`

| Reimplemented from PlotMgt_PlotterDriver.

virtual Standard_EXPORT Standard_ShortReal PS_Driver::MapY | ( | const Standard_ShortReal | aShortReal | ) | const`[private, virtual]`

| Reimplemented from PlotMgt_PlotterDriver.

virtual Standard_EXPORT Standard_Boolean PS_Driver::PlotArc | ( | const Standard_ShortReal | X,
|  | const Standard_ShortReal | Y,
|  | const Standard_ShortReal | anXradius,
|  | const Standard_ShortReal | anYradius,
|  | const Standard_ShortReal | sAngle,
|  | const Standard_ShortReal | oAngle
| ) | `[protected, virtual]`

| Reimplemented from PlotMgt_PlotterDriver.

virtual Standard_EXPORT Standard_Boolean PS_Driver::PlotImage | ( | const Standard_ShortReal | aX,
|  | const Standard_ShortReal | aY,
|  | const Standard_ShortReal | aWidth,
|  | const Standard_ShortReal | aHeight,
|  | const Standard_ShortReal | aScale,
|  | const Standard_CString | anImageFile,
|  | const Standard_Address | anArrayOfPixels,
|  | const Standard_Integer | aLineIndex = `-1`
| ) | `[protected, virtual]`

| Reimplemented from PlotMgt_PlotterDriver.

virtual Standard_EXPORT void PS_Driver::PlotLineAttrib | ( | const Standard_Integer | ColorIndex,
|  | const Standard_Integer | TypeIndex,
|  | const Standard_Integer | WidthIndex
| ) | `[protected, virtual]`

| Reimplemented from PlotMgt_PlotterDriver.

virtual Standard_EXPORT Standard_Boolean PS_Driver::PlotMarker | ( | const Standard_Integer | aMarker,
|  | const Standard_ShortReal | Xpos,
|  | const Standard_ShortReal | Ypos,
|  | const Standard_ShortReal | Width,
|  | const Standard_ShortReal | Height,
|  | const Standard_ShortReal | Angle
| ) | `[protected, virtual]`

| Reimplemented from PlotMgt_PlotterDriver.

virtual Standard_EXPORT Standard_Boolean PS_Driver::PlotPoint | ( | const Standard_ShortReal | X,
|  | const Standard_ShortReal | Y
| ) | `[protected, virtual]`

| Reimplemented from PlotMgt_PlotterDriver.

virtual Standard_EXPORT Standard_Boolean PS_Driver::PlotPolyArc | ( | const Standard_ShortReal | X,
|  | const Standard_ShortReal | Y,
|  | const Standard_ShortReal | anXradius,
|  | const Standard_ShortReal | anYradius,
|  | const Standard_ShortReal | sAngle,
|  | const Standard_ShortReal | oAngle
| ) | `[protected, virtual]`

| Reimplemented from PlotMgt_PlotterDriver.

virtual Standard_EXPORT Standard_Boolean PS_Driver::PlotPolygon | ( | const Standard_Address | xArray,
|  | const Standard_Address | yArray,
|  | const Standard_Address | nPts,
|  | const Standard_Integer | nParts
| ) | `[protected, virtual]`

| Reimplemented from PlotMgt_PlotterDriver.

virtual Standard_EXPORT Standard_Boolean PS_Driver::PlotPolyline | ( | const Standard_Address | xArray,
|  | const Standard_Address | yArray,
|  | const Standard_Address | nPts,
|  | const Standard_Integer | nParts
| ) | `[protected, virtual]`

| Reimplemented from PlotMgt_PlotterDriver.

virtual Standard_EXPORT Standard_Boolean PS_Driver::PlotPolyText | ( | const Standard_CString | aText,
|  | const Standard_ShortReal | Xpos,
|  | const Standard_ShortReal | Ypos,
|  | const Quantity_Ratio | aMargin,
|  | const Standard_ShortReal | anAngle,
|  | const Aspect_TypeOfText | aType
| ) | `[protected, virtual]`

| Reimplemented from PlotMgt_PlotterDriver.

virtual Standard_EXPORT Standard_Boolean PS_Driver::PlotPolyText | ( | const TCollection_ExtendedString & | aText,
|  | const Standard_ShortReal | Xpos,
|  | const Standard_ShortReal | Ypos,
|  | const Quantity_Ratio | aMargin,
|  | const Standard_ShortReal | anAngle,
|  | const Aspect_TypeOfText | aType
| ) | `[protected, virtual]`

| Reimplemented from PlotMgt_PlotterDriver.

virtual Standard_EXPORT Standard_Boolean PS_Driver::PlotSegment | ( | const Standard_ShortReal | X1,
|  | const Standard_ShortReal | Y1,
|  | const Standard_ShortReal | X2,
|  | const Standard_ShortReal | Y2
| ) | `[protected, virtual]`

| Reimplemented from PlotMgt_PlotterDriver.

virtual Standard_EXPORT Standard_Boolean PS_Driver::PlotText | ( | const Standard_CString | aText,
|  | const Standard_ShortReal | Xpos,
|  | const Standard_ShortReal | Ypos,
|  | const Standard_ShortReal | anAngle,
|  | const Aspect_TypeOfText | aType
| ) | `[protected, virtual]`

| Reimplemented from PlotMgt_PlotterDriver.

virtual Standard_EXPORT Standard_Boolean PS_Driver::PlotText | ( | const TCollection_ExtendedString & | aText,
|  | const Standard_ShortReal | Xpos,
|  | const Standard_ShortReal | Ypos,
|  | const Standard_ShortReal | anAngle,
|  | const Aspect_TypeOfText | aType
| ) | `[protected, virtual]`

| Reimplemented from PlotMgt_PlotterDriver.

virtual Standard_EXPORT void PS_Driver::SetTextAttrib | ( | const Standard_Integer | ColorIndex,
|  | const Standard_Integer | FontIndex,
|  | const Quantity_PlaneAngle | aSlant,
|  | const Quantity_Factor | aHScale,
|  | const Quantity_Factor | aWScale,
|  | const Standard_Boolean | isUnderlined = `Standard_False`
| ) | `[virtual]`

| Reimplemented from PlotMgt_PlotterDriver.

virtual Standard_EXPORT void PS_Driver::SetTextAttrib | ( | const Standard_Integer | ColorIndex,
|  | const Standard_Integer | FontIndex
| ) | `[virtual]`

| Reimplemented from PlotMgt_PlotterDriver.

virtual Standard_EXPORT Standard_Boolean PS_Driver::SizeOfImageFile | ( | const Standard_CString | anImageFile,
|  | Standard_Integer & | aWidth,
|  | Standard_Integer & | aHeight
| ) | const`[virtual]`

| Reimplemented from PlotMgt_PlotterDriver.

## Field Documentation

Standard_Integer PS_Driver::myCurrentPage `[private]`

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

- PS_Driver.hxx