Class Layout
A Layout defines the placement of one or more patches on a paper. A patch is the projection of a model into the two dimensional space with respect to scaling, projection direction, visibility of layers etc. A Layout can be viewed with the LayoutView and can be printed.
Inheritance
Implements
Inherited Members
Namespace: CADability
Assembly: CADability.dll
Syntax
[Serializable]
public class Layout : ISerializable
Constructors
| Improve this Doc View SourceLayout(Project)
Creates an empty Layout
Declaration
public Layout(Project project)
Parameters
| Type | Name | Description |
|---|---|---|
| Project | project | The Project containing the layout |
Layout(SerializationInfo, StreamingContext)
Declaration
protected Layout(SerializationInfo info, StreamingContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Runtime.Serialization.SerializationInfo | info | |
| System.Runtime.Serialization.StreamingContext | context |
Fields
| Improve this Doc View SourcepageSettings
The printer settings.
Declaration
public PageSettings pageSettings
Field Value
| Type | Description |
|---|---|
| System.Drawing.Printing.PageSettings |
Properties
| Improve this Doc View SourceName
Gets or sets the name of the layout.
Declaration
public string Name { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
PaperHeight
Gets or sets the height of the total layout area. When printing the layout this is assumed to be in mm
Declaration
public double PaperHeight { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Double |
PaperWidth
Gets or sets the width of the total layout area. When printing the layout this is assumed to be in mm
Declaration
public double PaperWidth { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Double |
PatchCount
Returns the number of the patches
Declaration
public int PatchCount { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
Methods
| Improve this Doc View SourceAddPatch(Model, Projection, Border)
Adds a "patch" to the layout. A patch is a a model with a certain projection placed on a section of the layout. The projection includes the placement of the model inside the section and the scaling.
Declaration
public void AddPatch(Model model, Projection projection, Border area)
Parameters
| Type | Name | Description |
|---|---|---|
| Model | model | The model for the patch |
| Projection | projection | the projection for the model |
| Border | area | The area on the layout |
AddPatch(Model, Projection, Border, LayoutView)
Declaration
public void AddPatch(Model model, Projection projection, Border area, LayoutView layoutView)
Parameters
| Type | Name | Description |
|---|---|---|
| Model | model | |
| Projection | projection | |
| Border | area | |
| LayoutView | layoutView |
AddVisibleLayer(Int32, Layer)
Marks the given Layer as visible in the context of this ProjectedModel.
Declaration
public void AddVisibleLayer(int index, Layer l)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | index | |
| Layer | l | The layer |
CenterPatch(Int32, Double, Layout.HorizontalCenter, Layout.VerticalCenter)
Centers the patch with the given index according to the horizontal and vertical center mode. If scale is 0.0 the current scaling remains unchanged.
Declaration
public void CenterPatch(int index, double scale, Layout.HorizontalCenter hor, Layout.VerticalCenter ver)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | index | index of the patch |
| System.Double | scale | scaling factor or 0.0 |
| Layout.HorizontalCenter | hor | horizontal position mode |
| Layout.VerticalCenter | ver | vertical position mode |
Finalize()
Declaration
protected void Finalize()
GetPatch(Int32, out Model, out Projection, out Border)
Returns the data that describe the patch with the given index.
Declaration
public void GetPatch(int index, out Model model, out Projection projection, out Border area)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | index | Index of the patch |
| Model | model | The model for the patch |
| Projection | projection | the projection for the model |
| Border | area | The area on the layout |
IsLayerVisible(Int32, Layer)
Determins whether the given Layer is marked visible in the context of this ProjectedModel.
Declaration
public bool IsLayerVisible(int index, Layer l)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | index | |
| Layer | l | The layer |
Returns
| Type | Description |
|---|---|
| System.Boolean |
MovePatch(Int32, Double, Double)
Places the patch on the paper leaving the scalinfactor unchanged. The parameters specify the position of the model origin on the paper.
Declaration
public void MovePatch(int index, double xPos, double yPos)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | index | |
| System.Double | xPos | horizontal position of the origin |
| System.Double | yPos | vertical position of the origin |
RemovePatch(Int32)
Removes the patch with the given index
Declaration
public void RemovePatch(int index)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | index |
RemoveVisibleLayer(Int32, Layer)
Marks the given Layer as invisible in the context of this ProjectedModel.
Declaration
public void RemoveVisibleLayer(int index, Layer l)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | index | |
| Layer | l | The layer |
SetPatch(Int32, Model, Projection, Border)
Changes the data of the patch with the given index.
Declaration
public void SetPatch(int index, Model model, Projection projection, Border area)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | index | Index of the patch |
| Model | model | The model for the patch |
| Projection | projection | the projection for the model |
| Border | area | The area on the layout |
Explicit Interface Implementations
| Improve this Doc View SourceISerializable.GetObjectData(SerializationInfo, StreamingContext)
Declaration
void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Runtime.Serialization.SerializationInfo | info | |
| System.Runtime.Serialization.StreamingContext | context |