Entities
entities/ viewport
#include "dxfio/entities/viewport.hpp"In DxfIO::Entities
struct Port
The AcDbViewport subclass of a VIEWPORT: the window on the paper and the view of model space it shows.
| Field | Type and default | Meaning |
|---|---|---|
Center | Vector | The center of the window, in paper space coordinates. Groups 10, 20, 30. |
Width | double | The width of the window, in paper space units. Group 40. |
Height | double | The height of the window, in paper space units. Group 41. |
Status | int | 0 off, -1 on but not shown, or the viewport's place among those shown, 1 the active one. Group 68. |
Id | int | The viewport's identifier, 1 for the one that shows the paper itself. Group 69. |
View | Vector | The center of the view, in display coordinates. Groups 12, 22, from R2000. |
Base | Vector | The base point of the snap. Groups 13, 23, from R2000. |
Snap | Vector | The spacing of the snap. Groups 14, 24, from R2000. |
Grid | Vector | The spacing of the grid. Groups 15, 25, from R2000. |
Direction | Vector{Up} | The direction the view looks from, toward its target, in world coordinates. Groups 16, 26, 36, from R2000. |
Target | Vector | The point the view looks at, in world coordinates. Groups 17, 27, 37, from R2000. |
Lens | double | The lens length of a perspective view. Group 42, from R2000. |
Front | double | The offset of the front clipping plane from the target. Group 43, from R2000. |
Back | double | The offset of the back clipping plane from the target. Group 44, from R2000. |
Extent | double{-1} | The height of the view, in model space units. Group 45, from R2000. |
Angle | double | The snap angle. Group 50, from R2000. |
Twist | double | The twist of the view. Group 51, from R2000. |
Zoom | int{Roundness} | The circle zoom percent. Group 72, from R2000. |
Frozen | std::vector<Handle> | The layers frozen in this viewport alone. Group 341 before R2004, 331 from it. |
Flags | int{Unflagged} | 1 perspective, 2 front clip, 4 back clip, 8 UCS follows, 256 snap, 512 grid, 16384 scale locked, 65536 clipped by an entity, 131072 off, among others; 32768 always set. Group 90, from R2000. |
Clip | Handle | The entity that clips the viewport when it is not rectangular. Group 340, from R2000. |
Sheet | std::string | The name of the plot style sheet. Group 1, from R2000. |
Render | int | The render mode: 0 2D wireframe, 1 3D wireframe, 2 hidden line, 3 flat shaded, 4 Gouraud shaded, 5 and 6 the same with wireframe. Group 281, from R2000. |
Follows | int{1} | 1 when the viewport keeps its own UCS, made current when it is active. Group 71, from R2000. |
Icon | int | 1 when the UCS icon is drawn at the UCS origin. Group 74, from R2000. |
Axes | Tables::Axes | The viewport's own UCS. Groups 110, 111, 112, 345, 346, 79 and 146, from R2000. |
Shade | int | How the viewport is plotted: 0 as displayed, 1 wireframe, 2 hidden, 3 rendered. Group 170, from R2004. |
Major | int{Gridmajor} | How often a major grid line is drawn, in grid lines. Group 61, from R2007. |
Background | Handle | The background drawn behind the view. Group 332, from R2007. |
Plot | Handle | The visual style or render preset the viewport is shade plotted with. Group 333, from R2007. |
Style | Handle | The visual style the view is drawn in. Group 348, from R2007. |
Lit | bool{true} | Whether the default lighting is on. Group 292, from R2007. |
Lighting | int{1} | The default lighting: 1 one distant light, 2 two distant lights. Group 282, from R2007. |
Brightness | double | The brightness of the view. Group 141, from R2007. |
Contrast | double | The contrast of the view. Group 142, from R2007. |
Ambient | int{Ambience} | The ambient light color, as an AutoCAD Color Index. Group 63, from R2007. |
Rgb | std::optional<int> | The ambient light's true color, as 0xRRGGBB. Group 421, from R2007. |
Book | std::string | The color book of the ambient light, joined to the color's name by a $. Group 431, from R2007. |
Sun | Handle | The SUN that lights the viewport. Group 361, from R2007. |
struct ViewportVIEWPORT
A VIEWPORT: a window on a layout's paper that shows a view of model space.
| Field | Type | Meaning |
|---|---|---|
Record | Entities::Record | The layer, linetype, color and the rest every entity carries. |
Port | Boxed<Entities::Port> | The window and the view, from the AcDbViewport subclass. |
Constants
Roundness | int = 100 | The circle zoom percent a new viewport takes, which sets how smoothly it draws circles and arcs. |
Unflagged | int = 32768 | The status bits of a new viewport: only 32768, which AutoCAD always sets. |
Gridmajor | int = 5 | How often a new viewport draws a major grid line, as $GRIDMAJOR and a VPORT's Tables::Gridmajor: every fifth line. |
Ambience | int = 250 | The ambient light color of a new viewport, as an AutoCAD Color Index: a dark gray. |