Provides support for viewport definitions within a vector tree.
This class is used to declare a viewport within a vector scene graph. A master viewport is required as the first object in a VectorScene and it must contain all vector graphics content.
The size of the viewport is initially set to (0,0,100%,100%)
so as to be all inclusive. Setting the X, Y, Width and Height fields will determine the position and clipping of the displayed content (the 'target area'). The ViewX, ViewY, ViewWidth and ViewHeight fields declare the viewbox ('source area') that will be sampled for the target.
To configure the scaling and alignment method that is applied to the viewport content, set the AspectRatio field.
The VectorViewport class consists of the following fields:
Access | Name | Type | Comment | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
AbsX | INT | The horizontal position of the viewport, relative to (0, 0) . | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
This field will return the left-most boundary of the viewport, relative to point | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
AbsY | INT | The vertical position of the viewport, relative to (0, 0) . | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
This field will return the top-most boundary of the viewport, relative to point | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
AspectRatio | INT | Flags that affect the aspect ratio of vectors within the viewport. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
Defining an aspect ratio allows finer control over the position and scale of the viewport's content within its target area.
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Dimensions | INT | Dimension flags define whether individual dimension fields contain fixed or scaled values. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
DragCallback | FUNCTION | Receiver for drag requests originating from the viewport. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
Set the DragCallback field with a callback function to receive drag requests from the viewport's user input. When the user drags the viewport, the callback will receive the user's desired The prototype for the callback function is as follows, where
Setting this field to It is required that the parent VectorScene is associated with a Surface for this feature to work. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Height | DOUBLE | The height of the viewport's target area. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
The height of the viewport's target area is defined here as a fixed or scaled value. The default value is The fixed value is always returned when retrieving the height. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Overflow | INT | Clipping options for the viewport's boundary. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
Choose an overflow option to enforce or disable clipping of the viewport's content. The default state is If the viewport's AspectRatio is set to | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
OverflowX | INT | Clipping options for the viewport's boundary on the x axis. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
Choose an overflow option to enforce or disable clipping of the viewport's content. The default state is This option controls the x axis only. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
OverflowY | INT | Clipping options for the viewport's boundary on the y axis. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
Choose an overflow option to enforce or disable clipping of the viewport's content. The default state is This option controls the y axis only. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ViewHeight | DOUBLE | The height of the viewport's source area. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
The area defined by (ViewX,ViewY) and (ViewWidth,ViewHeight) declare the source area covered by the viewport. The rendered graphics in the source area will be repositioned and scaled to the area defined by | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ViewWidth | DOUBLE | The width of the viewport's source area. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
ViewX | DOUBLE | The horizontal position of the viewport's source area. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
ViewY | DOUBLE | The vertical position of the viewport's source area. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
Width | DOUBLE | The width of the viewport's target area. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
The width of the viewport's target area is defined here as a fixed or scaled value. The default value is | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
X | DOUBLE | Positions the viewport on the x-axis. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
The display position targeted by the viewport is declared by the (X,Y) field values. Coordinates can be expressed as fixed or scaled pixel units. If an offset from the edge of the parent is desired, the XOffset field must be defined. If a X and XOffset value are defined together, the width of the viewport is computed on-the-fly and will change in response to the parent's width. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
XOffset | DOUBLE | Positions the viewport on the x-axis. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
The display position targeted by the viewport is declared by the (X,Y) field values. Coordinates can be expressed as fixed or scaled pixel units. If an offset from the edge of the parent is desired, the XOffset field must be defined. If the X and XOffset values are defined together, the width of the viewport is computed on-the-fly and will change in response to the parent's width. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Y | DOUBLE | Positions the viewport on the y-axis. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
The display position targeted by the viewport is declared by the (X,Y) field values. Coordinates can be expressed as fixed or scaled pixel units. If an offset from the edge of the parent is desired, the YOffset must be defined. If the Y and YOffset values are defined together, the height of the viewport is computed on-the-fly and will change in response to the parent's height. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
YOffset | DOUBLE | Positions the viewport on the y-axis. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
The display position targeted by the viewport is declared by the (X,Y) field values. Coordinates can be expressed as fixed or scaled pixel units. If an offset from the edge of the parent is desired, the YOffset must be defined. If a Y and YOffset value are defined together, the height of the viewport is computed on-the-fly and will change in response to the parent's height. |
The following actions are currently supported:
Name | Comment | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Clear | Free all child objects contained by the viewport. | |||||||||||||||
Move | Move the position of the viewport by delta X, Y. | |||||||||||||||
ERR acMove(*Object, DOUBLE DeltaX, DOUBLE DeltaY, DOUBLE DeltaZ)
| ||||||||||||||||
MoveToPoint | Move the position of the viewport to a fixed point. | |||||||||||||||
ERR acMoveToPoint(*Object, DOUBLE X, DOUBLE Y, DOUBLE Z, MTF Flags)
| ||||||||||||||||
Redimension | Reposition and resize a viewport to a fixed size. | |||||||||||||||
ERR acRedimension(*Object, DOUBLE X, DOUBLE Y, DOUBLE Z, DOUBLE Width, DOUBLE Height, DOUBLE Depth)
| ||||||||||||||||
Resize | Resize a viewport to a fixed size. | |||||||||||||||
ERR acResize(*Object, DOUBLE Width, DOUBLE Height, DOUBLE Depth)
|
Options for drawing arcs.
Name | Description |
---|---|
ARC::LARGE | The arc will take the longest available drawing path rather than the shortest. |
ARC::SWEEP | Inverts the default behaviour in generating the arc path (go clockwise). |
Aspect ratios control alignment, scaling and clipping.
Name | Description |
---|---|
ARF::MEET | Aspect ratio is preserved. The entire viewbox will be visible in the viewport. The viewbox is scaled up as much as possible. |
ARF::NONE | Scale the viewbox to match the size of the viewport. Aspect ratio is not preserved. |
ARF::SLICE | Aspect ratio is preserved. The viewbox can extend beyond the viewport's edges on one axis. The viewbox is scaled up as much as possible. |
ARF::X_MAX | Align to the right. |
ARF::X_MID | Align to the horizontal center. |
ARF::X_MIN | Align to the left. |
ARF::Y_MAX | Align to the bottom. |
ARF::Y_MID | Align to the vertical center. |
ARF::Y_MIN | Align to the top. |
Name | Description |
---|---|
DMF::FIXED_CENTER_X | The CenterX field is a fixed size. |
DMF::FIXED_CENTER_Y | The CenterY field is a fixed size. |
DMF::FIXED_DEPTH | The Depth field is a fixed size. |
DMF::FIXED_HEIGHT | The Height field is a fixed size. |
DMF::FIXED_RADIUS_X | The RadiusX field is a fixed size. |
DMF::FIXED_RADIUS_Y | The RadiusY field is a fixed size. |
DMF::FIXED_WIDTH | The Width field is a fixed suze. |
DMF::FIXED_X | The X field is a fixed coordinate. |
DMF::FIXED_X_OFFSET | The XOffset field is a fixed coordinate. |
DMF::FIXED_Y | The Y field is a fixed coordinate. |
DMF::FIXED_Y_OFFSET | The YOffset field is a fixed coordinate. |
DMF::FIXED_Z | The Z field is a fixed coordinate. |
DMF::SCALED_CENTER_X | The CenterX field is scaled to this object's parent. |
DMF::SCALED_CENTER_Y | The CenterY field is scaled to this object's parent. |
DMF::SCALED_DEPTH | The Depth field is scaled to this object's parent. |
DMF::SCALED_HEIGHT | The Height field is scaled to this object's parent. |
DMF::SCALED_RADIUS_X | The RadiusX field is scaled to this object's parent. |
DMF::SCALED_RADIUS_Y | The RadiusY field is a scaled size to this object's parent. |
DMF::SCALED_WIDTH | The Width field is scaled to this object's parent. |
DMF::SCALED_X | The X field is scaled to this object's parent. |
DMF::SCALED_X_OFFSET | The XOffset field is scaled to this object's parent. |
DMF::SCALED_Y | The Y field is scaled to this object's parent. |
DMF::SCALED_Y_OFFSET | The YOffset field is scaled to this object's parent. |
DMF::SCALED_Z | The Z field is a scaled coordinate to this object's parent. |
DMF::STATUS_CHANGE_H | |
DMF::STATUS_CHANGE_V |
Font metrics, measured in pixels relative to the display
Field | Type | Description |
---|---|---|
Height | LONG | Capitalised font height |
LineSpacing | LONG | Vertical advance from one line to the next |
Ascent | LONG | Height from the baseline to the top of the font, including accents. |
Descent | LONG | Height from the baseline to the bottom of the font |
Vector transformation matrix.
Field | Type | Description |
---|---|---|
Next | struct VectorMatrix * | The next transform in the list. |
Vector | objVector * | The vector associated with the transform. |
ScaleX | DOUBLE | Matrix value A |
ShearY | DOUBLE | Matrix value B |
ShearX | DOUBLE | Matrix value C |
ScaleY | DOUBLE | Matrix value D |
TranslateX | DOUBLE | Matrix value E |
TranslateY | DOUBLE | Matrix value F |
Tag | LONG | An optional tag value defined by the client for matrix identification. |
Deserialised painter information; compliant with SVG painter definitions.
Field | Type | Description |
---|---|---|
Pattern | objVectorPattern * | A VectorPattern object, suitable for pattern based fills. |
Image | objVectorImage * | A VectorImage object, suitable for image fills. |
Gradient | objVectorGradient * | A VectorGradient object, suitable for gradient fills. |
Colour | struct FRGB | A single RGB colour definition, suitable for block colour fills. |
Class Info | |
---|---|
ID | ID_VECTORVIEWPORT |
Category | Graphics |
Include | modules/vectorviewport.h |
Version | 1 |