Class vdLayout
- Namespace
- VectorDraw.Professional.vdPrimaries
- Assembly
- VectorDraw.Professional.dll
Represents a drawing layout view and implements the full layout behavior used by VectorDraw.
public class vdLayout : vdPrimary, IVDSerialise, IBaseObject, IDisposable, IBaseActionContainer
- Inheritance
-
vdLayout
- Implements
-
IBaseActionContainer
- Derived
- Inherited Members
Examples
Example: create a layout, register it with a document and set basic view properties.
var layout = new vdLayout(document, "MyLayout");
layout.ViewSize = 100.0;
layout.ViewCenter = new gPoint(0,0,0);
document.LayOuts.Add(layout);
layout.Entities.Add(new vdLine(new gPoint(0, 0, 0), new gPoint(100, 100, 0)));
document.ActiveLayOut = layout;
See vdPrint examples for document model and layout with viewports management, according to the desired print scale of the design
Remarks
The vdLayout class encapsulates rendering, input-action management, view and viewport handling,
grid and snap configuration, object selection and snapping, and serialization for a document layout.
A single vdDocument can host one model layout and multiple instances of paper layouts.
Responsibilities include:
- Managing the active vdRender and per-layout rendering properties (view size, view center, world-to-view matrices).
- Hosting and dispatching user VectorDraw.Actions.BaseAction instances and providing support for selection previews,
osnaps, polar/ortho tracking and grip handling.
- Providing high-level selection and hit-testing APIs (e.g. Select3d, GetEntityFromPoint).
- Maintaining zoom history and supporting common navigation operations (zoom, pan, extents).
Constructors
- vdLayout()
Initializes the vdLayout object.
- vdLayout(vdDocument)
Initializes the vdLayout object and registers it to the passed Document.
- vdLayout(vdDocument, string)
Initializes the vdLayout 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
- ActionUtility
Gets the Utility instance associated with this layout.
- Actions
Gets a Stack containing all actions that are currently active in the layout.
- ActiveAction
Gets the currently active (topmost) action in the layout's action stack.
- ActiveActionRender
Gets the active action render object for the layout, prioritizing the active viewport's render if available.
- ActiveRender
Gets the active vdRender instance for this layout.
- ActiveViewPort
Get/Set the active viewport of the vdlayout object.
- BkColorEx
Get/Set the background color of the vdLayout object.
- BkGradientAngle
Get/Set the background gradient direction angle in radians.
- BkGradientColor
Get/Set the second color for gradient fading effect of the background.
- ColorPalette
Gets or sets the output color palette used by the layout when rendering.
- ContainsViewPorts
Get a boolean value that represents if the layout contains any non deleted viewport.
- CurveResolution
Get/Set the curve resolution of the vdLayout object.
- Deleted
Get/Set a property that marks the layout as Deleted or not.
- DisableShowPrinterPaper
Get/Set if the default paper printer will be drawn .
- DisplayHeight
Get the height of the layout's rendering device in pixels.
- DisplayWidth
Get the width of the layout's rendering device in pixels.
- EdgeColor
Get/Set the display color for edges of all faces when rendering in 3d.(when RenderMode is Wire3d ,Hide or ShadeOn)
- Entities
Gets the collection of figures that are drawn in this layout.
- FocalLength
Get/Set the focal length of the layout.
- FreezeActions
Gets a value that indicates whether user actions are currently frozen for this layout.
- GridMeasure
Gets the GridMeasured instance used to draw the grid on this layout's rendering area.
- 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
Gets or sets the style used to draw the grid for this layout.
- IsActive
Returns true if this object is reference equals with the Document.ActiveLayout
- IsModel
Gets a value indicating whether this layout object is the document's model layout.
- IsModelLayout
Returns true if this object is reference equal with Document.Model
- IsViewPort
Returns false. This is the implementation of the IgrPrinterProperties Interface used mainly in vdRender object.
- LensAngle
Represents the Lens Angle in degrees of the vdLayout object.
- Limits
Get/Set a box representing the lower-left and upper-right limits of drawing for grid displaying in UCS.
- MemoryBitmap
Gets the Bitmap used by the layout's memory graphics for rendering.
- MemoryGraphics
Gets the Graphics instance used by the layout for rendering.
- MouseElevation
Get/Set a value in Drawing Units used to add a Zvalue to mouse position relative to Current UCS.
- Name
Get/Set the unique name of the vdlayout object.
- NeedRedraw
Gets a value that indicates whether the layout requires redrawing.
- 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.
- OverAllActiveAction
Gets the currently active action for this layout, taking viewport context into account.
- OverAllActiveActions
Gets the stack that represents the active actions for this layout.
- PerspectiveMod
Gets or sets the perspective mode of the layout.
- Pixel2ViewMatrix
Get the matrix used for transformations between pixels and view coordinate system.
- PixelSize
Get the size in Drawing Units of one(1) window pixel.
- 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 PrinterScale of the vdPrint object.Is defined as the ratio of the number of millimeters in the printer paper to the number of drawing units in printable drawing area.
- Printer
Get the vdPrinter object of the layout.
- Render
Gets the renderer used by this layout.
- RenderMode
Gets or sets the render mode for this layout (for example: wire 2D, rendered 3D).
- RenderStatus
Returns an OpenGL status code for diagnostic purposes.
- RenderingFilter
Represents the filter effect that will be applied after the rendering results.
- Sections
Get the sections clipping collection of the layout.
- SelectionPreview
Gets or sets the method used to preview (highlight) entities that are under the mouse when an action is waiting for entity selection.
- ShowHidenEdges
Get/Set a boolean value representing if the edges of the 3dFace and polyface objects 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.
- SpaceMode
Get/Set the space mode of the layout.
- TwistAngle
Get the angle relative to the world to view plane defined in World2ViewMatrix.
- User2WorldMatrix
Get the matrix used for transformations between user and world coordinate system.
- View2WorldMatrix
Get the matrix used for transformations between view and world coordinate system.
- ViewCenter
Gets or sets the coordinates of the center point of the view in the current view coordinate system.
- ViewDir
Get a vector object representing the view direction of the layout defined in World2ViewMatrix.
- ViewSize
Gets or sets the view size of the view window.
- ViewportLTScale
Controls the scaling of linetypes drawn inside a viewport.
- VisibleOnForms
Get/Set a boolean value representing if the vdLayout will be viewed in Vectordraw forms. This takes place to the tab bar of the vdScrollable/vdFramedControl.
- World2UserMatrix
Get/Set the matrix used for trasformations between world and 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 VectorDraw.Actions.BaseAction to the action stack of this layout object. The action is initialized, subscribed to relevant events, and activated if the layout is currently active.
- ActionRemoveLast(bool)
Internally used only. Removes the last action from the layout's action stack and performs required cleanup.
Usually it is called when an action finishes or is cancelled, but it can also be used to manually clear actions when needed.
- 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 vdLayout object when opening in vdml format.
- Dispose()
Performs tasks associated with freeing, releasing, or resetting the necessary memory objects. After calling this method the object is not available.
- DragDrop(object, DragEventArgs)
Internally used to connect the vdLayout object with a control component.
- DragEnter(object, DragEventArgs)
Internally used to connect the vdLayout object with a control component.
- DragLeave(object, EventArgs)
Internally used to connect the vdLayout object with a control component.
- DragOver(object, DragEventArgs)
Internally used to connect the vdLayout object with a control component.
- DrawCCSAxis(vdRender, bool, bool, bool, bool, Color, Color, Color)
This function is used in the Document's OnDrawOverAll event to draw the Axis.
- DrawCCSAxis(vdRender, bool, bool, bool, bool, Color, Color, Color, bool, bool)
This function is used in the Document's OnDrawOverAll event to draw the Axis.
- DrawCCSAxis(vdRender, bool, bool, bool, bool, Color, Color, Color, bool, bool, double, double)
This function is used in the Document's OnDrawOverAll event to draw the Axis.
- DrawCCSAxis(vdRender, bool, bool, bool, bool, Color, Color, Color, Color, bool, bool, double, double)
This function is used in the Document's OnDrawOverAll event to draw the Axis.
- EnsureControl(object)
Internally used to connect the vdLayout object with a control component.
- GetEntityFromPoint(Point, int, bool)
Gets an entity passing through a rectangle with center a given point and given size.
- GetEntityFromPoint(Point, int, bool, LockLayerMethodEnum)
Gets an entity passing through a rectangle with center a given point and given size.
- GetExtents()
Gets the Bounding Box that completely encloses all visible Figure.
- GetInnerEntitiesListFromPoint(vdEntities, Point, int, out vdArray<vdFigure>, out vdArray<Matrix>, bool)
Gets the inner entities passing through a rectangle with center a given point and given size.
- GetInnerEntitiesListFromPoint(vdEntities, Point, int, out vdArray<vdFigure>, out vdArray<Matrix>, bool, LockLayerMethodEnum)
Gets the inner entities of the first figure passing through a rectangle with center a given point and given size.
- GetInnerEntityFromPoint(out Matrix, out vdFigure, Point, int, bool)
Gets the most inner entity passing through a rectangle with center a given point and given size.
- GetOsnapPoints(Point, int, gPoint, gPoint, OsnapMode, OsnapPoint, bool)
Get all Osnap points from all the entities that pass from a rectangle with a given center point and size.
- GetScrollingProperties(out ScrollPropereties, out ScrollPropereties)
Utility method to calculate the horizontal and vertical scroll properties depend of the active view and drawing limits
- GetTableDependecies(vdTableDependeciesArgs)
Fills the passed vdTableDependeciesArgs args with all the table references of this object (vdLayer, vdBlock, vdDimstyle, vdLineType, vdTextstyle, vdImageDef, vdHatchPattern etc).
- GetToolTipFigure(Point, int, bool, out bool)
Returns the first figure found in a rectangle with a given center and size that has a tooltip or URL.
- GetTransformedSelectedObjects(Box)
Gets a collection of SelectedObject type object that represents all the primitives figures that belongs to this layout and passing through a rectangle in current View Co-ordinate system.
- GetTransformedSelectedObjects(gPoints, bool)
Gets a collection of SelectedObject type object that represents all the primitives figures that belongs to this layout and passing through a region in current View Co-ordinate system.
- GetTransformedSelectedObjectsFence(gPoints)
Gets a collection of SelectedObject type object that represents all the primitives figures that belongs to this layout and passing through a region in current View Co-ordinate system.
- GetViewportFromPoint(Point)
Returns a viewport that passed throw the given point in pixels relative to VectorDraw render window.
- GetVisibleViewports()
Gets the collection of viewports that are currently visible.
- GotFocus(object, EventArgs)
Internally used to connect the vdLayout object with a control component.
- HandleDestroyed(object, EventArgs)
Internally used to connect the vdLayout object with a control component.
- InitializeProperties()
Resets the properties of the vdLayout object to the Default values.
- InternalSetOwner(vdBaseObject)
Internally used only.
Set the object owner
- Invalidate()
Post a refresh in the bounding area of the control.
- Invalidated(object, Rectangle)
Internally used to connect the vdLayout object with a control component.
- KeyDown(object, KeyEventArgs)
Internally used to connect the vdLayout object with a control component.
- KeyPress(object, KeyPressEventArgs)
Internally used to connect the vdLayout object with a control component.
- KeyUp(object, KeyEventArgs)
Internally used to connect the vdLayout object with a control component.
- LayoutOrViewPortEntities()
Get the entities used by this layout for drawing and selection.
- LostFocus(object, EventArgs)
Internally used to connect the vdLayout object with a control component.
- MatchProperties(vdPrimary, vdDocument)
Matches all the common properties from an object and sets them to this object.
- MatchPropertiesWithoutEntities(vdPrimary, vdDocument)
Matches all the common properties from a vdLayout and sets them to this object without the references of the Entities.
- ModiFyActiveViewport(Iviewport)
Modify the ActiveViewPort with the passed vport
- MouseClick(object, MouseEventArgs)
Internally used to connect the vdLayout object with a control component.
- MouseDoubleClick(object, MouseEventArgs)
Internally used to connect the vdLayout object with a control component.
- MouseDown(object, MouseEventArgs)
Internally used to connect the vdLayout object with a control component.
- MouseEnter(object, EventArgs)
Internally used to connect the vdLayout object with a control component.
- MouseHover(object, EventArgs)
Internally used to connect the vdLayout object with a control component.
- MouseLeave(object, EventArgs)
Internally used to connect the vdLayout object with a control component.
- MouseMove(object, MouseEventArgs)
Internally used to connect the vdLayout object with a control component.
- MouseUp(object, MouseEventArgs)
Internally used to connect the vdLayout object with a control component.
- MouseWheel(object, MouseEventArgs)
Internally used to connect the vdLayout object with a control component.
- OnIdle(object)
Internally used to connect the vdLayout object with a control component.
- OnOwnerChanged()
This method is called when the object's owner is changed.
- Paint(Control, PaintEventArgs)
Internally used to connect the vdLayout object with a control component.
- Refresh()
Refreshes the graphics by drawing the memory bitmap of the render into the control device.
- RefreshGraphicsControl(Control)
Refreshes the graphics by drawing the memory bitmap of the render into the control device.
- RenderToBitmap(Bitmap)
Render the scene to the passed Bitmap object using this Layout view properties
- RenderToGraphics(Graphics, Box, int, int)
Renders a rectangular area in a different graphics with specified size.
- RenderToGraphics(Graphics, Box, int, int, int, int, int)
Renders a rectangular area in a different graphics with specified size.
- Resize(Control)
Internally used to connect the vdLayout object with a control component.
- Select3d(bool, vdEntities, Point, int, bool, out RenterSelectObjectArray)
Performs a selection operation at the specified device point and returns the drawing selection status.
- Select3d(Point, int, bool)
Selects entities at a given point and a given box size.Returning items are sorted depend of their depth form current eye view from nearest to farest.
- Serialize(Serializer)
This Function is called when saving the vdLayout object to vdml format.
- SetDisableScreenPaint(bool)
Enables or disables the post-render "screen paint" pass for this layout.
- SetFromView(vdView)
Sets the layout's properties equal to the passed vdView object.
- ToString()
Gets a System.String that represents the name of the vdLayout Object.
- UCS(string)
Changes the User coordinate system.
- UCS(Matrix)
Set the active User Coordinate System using a given matrix.
- UCS(gPoint, gPoint, gPoint)
Set the active User Coordinate System using a point and x,y directions.
- UCS(vdNamedUCS)
Set the Current UCS from the passed parameter.
- UCSPrevious()
Set the previous used User Coordinate System.
- Update()
Updates the objects of the vdLayout after change of properties.
- WndProc(MSG)
This is used internally for translating windows messages.
- ZoomAll()
Zooms all drawing area.
- ZoomExtents()
Zooms the drawing area so all drawing extends are visible.
- ZoomPrevious()
Zooms the drawing area to the previous used zoom saved by AddCurentZoomToHistory() method.
- ZoomScale(double)
Zooms the drawing area using a given scale factor relative to view center.
- ZoomScale(int, int, double)
Zooms the drawing area of this Layout or ActiveViewpot, using a given scale factor relative to passed pixel position.
- ZoomWindow(gPoint, gPoint)
Zooms the drawing area to a specified window.
- getGripIndexes(vdFigure, Box)
Gets the indexes of the grips of a figure that lie within the specified selection box.
- getGripIndexes(vdFigure, gPoints)
Gets the zero-based indexes of the grip points of a figure that lie within the specified polygon.