Class vdViewport
- Namespace
- VectorDraw.Professional.vdFigures
- Assembly
- VectorDraw.Professional.dll
Represents a layout viewport that presents a view of the model space and manages rendering, user-interaction actions, snapping/grid behavior and per-viewport visibility rules.
public sealed class vdViewport : vdFigure, IDisposable, IVDSerialise, IBaseActionContainer, IBaseObject
- Inheritance
-
vdViewport
- Implements
-
IBaseActionContainer
- Inherited Members
Examples
creating a viewport and setting some of its properties:
// 'doc' represents your existing vdDocument object
//first create a circle in model space and then create a layout with a viewport that shows the model space with a scale of 1:1
doc.Model.Entities.AddItem(new vdCircle(doc, new gPoint(), 3.0));
var layout = doc.LayOuts.Add("MyLayout");
var viewport = new vdViewport(doc);
//place the viewport rectangle in the layout
viewport.Center = new gPoint(0,0);
viewport.Width = 12;
viewport.Height = 12;
//set the viewport drawing view center and view scaling relative to the model space
viewport.ViewCenter = new gPoint(0, 0);
viewport.ViewportScale = 1;
//add the viewport to the layout
layout.Entities.AddItem(viewport);
//set the layout as active to show it in the control
doc.ActiveLayOut = layout;
doc.ZoomExtents();
doc.Redraw(false);
See vdPrint examples for document model and layout with viewports management, according to the desired print scale of the design
Remarks
A vdViewport is responsible for rendering model entities inside a layout, handling
view transforms, perspective/panning/zooming operations,
user action for interactive commands, snap/grid/polar settings, clipping with an optional
vdCurve clip object, and per-viewport visibility such as frozen/visible layer lists
or visible-figures filtering.
Constructors
- vdViewport()
Initializes the vdViewport object.
- vdViewport(vdDocument)
Initializes a new instance of the vdViewport object and registers it to the passed Document.
Properties
- ActionProperties
Specifies values that controls some of BaseAction operations
This property is saved by the document
- Actions
The Stack of active Actions in the viewport.
- ActiveAction
Get the active action of the viewport.
- ActiveActionRender
Get the Action render of the viewport.
- BkColorEx
Get/Set The Background of the vdViewport object.
- BkGradientAngle
Get/Set the background gradient direction angle in radians.
- BkGradientColor
Get/Set the second color for gradient fading effect of the background.
- BoundingBox
Gets the Bounding Box of the vdViewport object in WorldCoordinate System.
- Center
Get/Set the position of the viewport.
- ClipBoundaryPoints
Get the Boundary clipping points in World Coord System of active layout.
- ClipObj
Get/Set the vdCurve object in which the viewport is.
- ColorPalette
Get/Set the output Color palette
- ContainsViewPorts
Implements the IgrPrinterProperties Interface used in vdRender object , returns false.
- Deleted
Get/Set a property that marks the object as Deleted or not.
- DisplayHeight
Get the height of the vdViewport's render in pixels.
- DisplayWidth
Get/Set the width of the vdViewport's render in pixels.
- EdgeColor
Get/Set the display color for edges of all faces when rendering in 3d.(when RenderMode is Wire3d ,Hide or ShadeOn)
- FocalLength
Get/Set the focal length of the layout.
- FrozenLayerList
Get/Set a string array contaning the names of the layers to be frozen in the viewport.
- GridMeasure
Get the GridMeasured object.
- GridMode
Get/Set a boolean value representing the display of the grid dots.
- GridSpaceX
Get/Set the space between the grid dots in the x direction.
- GridSpaceY
Get/Set the space between the grid dots in the y direction.
- GridStyle
Get/Set the style that used to draw the grid.
- Height
Get/Set the height of the viewport.
- IgnoreFrozenLayers
Get/Set a boolean value that Ignores or not the default frozen property of document layers.
- IgnoreModelSections
Get/Set a string array contaning the names of the Document Model Sections not to be applied.
- IsModelLayout
Always returns false a vdViewport object.
- IsOn
Get/Set a boolean value that determines whether the viewport will display the model entities or not.
- IsViewPort
Implements the IgrPrinterProperties Interface used in vdRender object , returns true.
- LayoutRender
Returns the Layout render where this object belongs to.
- LensAngle
Represents the Lens Angle in degrees of the vdViewport object.
- MouseElevation
Get/Set a value in Drawing Units used to add a Zvalue to mouse position relative to Current UCS.
- OrthoMode
Get/Set a boolean value that if is true constrains cursor movement to the perpendicular.
- OrthoModeAxis
Defines the axis where the Ortho is limited on when OrthoMode is true.
- PerspectiveMod
Represents if the vdViewport object has Perspective Mode On or Off.
- PolarTrack
Get/Set a boolean value that enables/disables the PolarTrackAngle functionality.
- PolarTrackActionFlag
Get/Set additional flags that controls the PolarTrack with user actions.
- PolarTrackAngle
Get/Set the polar track angle in radians.
- PolarTrackInfinityLineDraw
Get/Set the draw of the infinity line. If true the infinity line will be rendered.
- PolarTrackLock
Get/Set the polar track lock property .If true constrains cursor movement only to the PolarTrackAngle direction.
- PrintScaleValue
Get the OwnerLayout() PrintScaleValue .
- Render
The vdRender object of the viewport.
- RenderMode
Get/Set the render mode for the vdViewport object.
- RenderStatus
Returns an OpenGL status code for diagnostic purposes.
- RenderingFilter
Represents the filter effect that will be applied after the rendering results.
- Sections
Returns the Sections Clipping collection .
- SelectionPreview
Get/Set the preview method vdRenderGlobalProperties.SelectionPreviewFlags of entities that are over the mouse position when an action waiting to select an entity.
- ShareLists
Get/Set a value of vdDocument.ShareListsEnum that controls the sharing of opengl lists between model entities and viewport.
- ShowHidenEdges
Get/Set a boolean value representing if the edges of the 3dFace object will be shown.
- ShowUCSAxis
Get/Set a value representing if the axis will be drawn.
- SnapAngle
Get/Set the snap angle of the vdlayout object.The snap angle affectes the grid angle and also the cursor-axis display angle.
- SnapBase
Get/Set the snap base point.
- SnapIso
Get/Set the snap iso for the vdlayout object. The snap iso affects the cursor-axis display.
- SnapMode
Get/Set a boolean value that enables/disables the mouse movement snaping.
- SnapModeAffect
Defines how Snap affects mouse movements.
- SnapSpaceX
Get/Set the distance that the mouse snaps in x direction.
- SnapSpaceY
Get/Set the distance that the mouse snaps in y direction.
- SnapStyle
Get/Set the snap style of the layout.The snap style affects the cursor-axis display.
- TwistAngle
Get the twist angle of the vdViewport object.
- View2WorldMatrix
Get the Matrix used for trasformations between View and World Coordinative System.
- ViewCenter
Get/Set the view center of the vdViewport object.
- ViewDir
Get the view Direction of the vdViewport object.
- ViewMaximized
Extends the viewport to fit all the layout if it is active and this value is true.
- ViewSize
Get/Set in Display Coordinative System the Size of the Model View that is presented in the Height of the vdViewport object.
- ViewportScale
Gets the viewportsize/viewport's height.
- ViewportVisibilityLogic
Get/Set entities visibilty logic for a viewport.
- VisibleFigures
Contains an array of Figures that will be always visible inside this viewport indepent their visibility.
- VisibleLayerList
Get/Set a string array contaning the names of the layers to be visible in the viewport.
- Width
Get/Set the width of the viewport.
- World2UserMatrix
Get/Set the Matrix used for trasformations of objects from World to User Coordinate System.
- World2ViewMatrix
Get/Set the matrix used for transformations between World Coordinate System(WCS) and View Coordinate System(VCS).
Methods
- ActionAdd(BaseAction)
Adds the specified BaseAction to the action list of this object.
- ActionRemoveLast(bool)
Internally used only.Remove the last action from the action stack.
- AddCurentZoomToHistory()
Add the current zoom (ViewCenter , ViewSize and World2ViewMatrix) in object zoom history in order to reset it with ZoomPrevious() method
- AddCurentZoomToHistory(string)
Add the current zoom (ViewCenter , ViewSize and World2ViewMatrix) in object zoom history in order to reset it with ZoomPrevious() method
- AppliedSections()
Returns a new collection of vdSectionClip that applied to the object's rendering context and contains at maximum limited the first MAX_SECTIONS enabled Section Clips.
- DeSerialize(DeSerializer, string, object)
This Function is called foreach field name of the vdViewport object when opening in vdml format.
- Dispose()
Dispose of the object.
- Draw(vdRender)
Called in order to draw the object in a specified vdRender object.
- Explode()
Explode an entity in sub entities.
- GetExtents()
Gets the Bounding Box that completely encloses all visible Figure.
- GetGripPoints()
A function returning the grip points of the object.
- GetValidGripPointsItems()
Returns the number of valid grip points of the object. Must return the same number of points as the GetGripPoints() method.
- InitializeProperties()
Resets the properties of the vdViewport object to the Default values.
- InternalSetOwner(vdBaseObject)
Internally used only.
Set the object owner
- IsVisible()
Returns if the viewport is visible.
- MatchProperties(vdPrimary, vdDocument)
Matches all the common properties from an object and sets them to this object.
- MoveGripPointsAt(Int32Array, double, double, double)
This function is intended to be called during a grip edit of the object.
- OnOwnerChanged()
This method is called when the object's owner is changed.
- OwnerLayout()
Returns the Layout where this object belongs to.
- PopFrozenLayers()
Pop the stack that previously was pushed by PushFrozenLayers()
- PushFrozenLayers()
Push a stack that mark the layers in FrozenLayerList , as Frozen
- Refresh()
Refreshes the graphics by drawing the memory bitmap of the render into the control device.
- Serialize(Serializer)
This Function is called when saving the vdViewport object to vdml format.
- SetClipHandle(vdHandle)
Set an object as clipping object by it's handle.
- SetFromView(vdView)
Sets the viewport's properties equal to the passed vdView object.
- ToString()
Gets a System.String that represents the type of the vdViewport Object.
- Transformby(Matrix)
Transforms all geometrical properties of this object by the specified Matrix.
- UCS(string)
Set the Coordinate System of the viewport.
- UCS(Matrix)
Sets the matrix used for transformations between World to User Coordinate System (World2UserMatrix).
- UCS(gPoint, gPoint, gPoint)
Sets the matrix used for transformations between World to User Coordinate System (World2UserMatrix).
- UCSPrevious()
Returns to the previous matrix used for transformations between World to User Coordinate System (World2UserMatrix).
- Update()
Updates the object after change of properties.
- ZoomAll()
Zooms to show all objects of the viewport, takes into consideration also the limits of the action Layout and the ViewportVisibilityLogic of the Viewport.
- ZoomExtents()
Zooms to fit the extends of all objects of the viewport.
- ZoomPrevious()
Returns to the previous zoom.
- ZoomScale(double)
Zooms using a specified scale factor,used for zoom in and zoom out.
- ZoomWindow(gPoint, gPoint)
Zooms to a specified window given by the two parameters.
- getOsnapPoints(Matrix, OsnapMode, gPoint, gPoint, int, OsnapPoints)
Overrrides the getOsnapPoints(Matrix, OsnapMode, gPoint, gPoint, int, OsnapPoints).