Show / Hide Table of Contents

Class Projection

A parallel or perspective projection which is used to convert the 3-dimensional world coordinate system to a 2-dimensional screen coordinate system or to a normalized 3-dimensional cube for the paint or rendering interface (IPaintTo3D). Contains also additional hints for the paint interface and the drawing plane.

Inheritance
System.Object
Projection
Implements
System.Runtime.Serialization.ISerializable
System.Runtime.Serialization.IDeserializationCallback
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: CADability
Assembly: CADability.dll
Syntax
[Serializable]
public class Projection : ISerializable, IDeserializationCallback

Constructors

| Improve this Doc View Source

Projection(CoordSys)

Creates a new parallel projection to the provided coordinate system

Declaration
public Projection(CoordSys ProjectTo)
Parameters
Type Name Description
CoordSys ProjectTo

The target system

| Improve this Doc View Source

Projection(GeoVector, GeoVector)

Creates a new parallel projection with the provided direction and the direction of the vector that should become the vertical direction.

Declaration
public Projection(GeoVector Direction, GeoVector TopDirection)
Parameters
Type Name Description
GeoVector Direction

View direction

GeoVector TopDirection

Vertical direction

| Improve this Doc View Source

Projection(Projection)

Creates a clone of the provided projection

Declaration
public Projection(Projection copyFrom)
Parameters
Type Name Description
Projection copyFrom

Projection being cloned

| Improve this Doc View Source

Projection(Projection.StandardProjection)

Creates a new standard projection according to Projection.StandardProjection

Declaration
public Projection(Projection.StandardProjection Standard)
Parameters
Type Name Description
Projection.StandardProjection Standard

Which direction to use

| Improve this Doc View Source

Projection(SerializationInfo, StreamingContext)

Constructor required by deserialization

Declaration
protected Projection(SerializationInfo info, StreamingContext context)
Parameters
Type Name Description
System.Runtime.Serialization.SerializationInfo info

SerializationInfo

System.Runtime.Serialization.StreamingContext context

StreamingContext

Fields

| Improve this Doc View Source

LayoutFactor

Some Attributes refer to paper bound dimensions: e.g. the linewidth or textsize may be specified in mm on the paper. So we need the posibility to transform linear dimensions from layout to world. This is doune by the LayoutFactor;

Declaration
public double LayoutFactor
Field Value
Type Description
System.Double
| Improve this Doc View Source

LineWidthFactor

A factor for the display line width

Declaration
public double LineWidthFactor
Field Value
Type Description
System.Double
| Improve this Doc View Source

UseLineWidth

Flag indicating the use of line width

Declaration
public bool UseLineWidth
Field Value
Type Description
System.Boolean

Properties

| Improve this Doc View Source

DeviceToWorldFactor

Declaration
public double DeviceToWorldFactor { get; }
Property Value
Type Description
System.Double
| Improve this Doc View Source

Direction

Declaration
public GeoVector Direction { get; set; }
Property Value
Type Description
GeoVector
| Improve this Doc View Source

DrawingPlane

Declaration
public Plane DrawingPlane { get; set; }
Property Value
Type Description
Plane
| Improve this Doc View Source

FromTop

Declaration
public static Projection FromTop { get; }
Property Value
Type Description
Projection
| Improve this Doc View Source

Grid

Declaration
public Grid Grid { get; }
Property Value
Type Description
Grid
| Improve this Doc View Source

Height

Declaration
public int Height { get; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

InverseProjection

Declaration
public ModOp InverseProjection { get; }
Property Value
Type Description
ModOp
| Improve this Doc View Source

IsPerspective

Returns true if this projection is a perspective projection in contrast to a parallel projection

Declaration
public bool IsPerspective { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

PerspectiveProjection

Declaration
public Matrix4 PerspectiveProjection { get; }
Property Value
Type Description
Matrix4
| Improve this Doc View Source

PlacementFactor

Declaration
public double PlacementFactor { get; }
Property Value
Type Description
System.Double
| Improve this Doc View Source

Precision

Declaration
public double Precision { get; set; }
Property Value
Type Description
System.Double
| Improve this Doc View Source

ProjectionPlane

Declaration
public Plane ProjectionPlane { get; }
Property Value
Type Description
Plane
| Improve this Doc View Source

ShowDrawingPlane

Display hint, whether to show the drawing plane

Declaration
public bool ShowDrawingPlane { get; set; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

ShowFaces

Declaration
public bool ShowFaces { get; set; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

UnscaledProjection

Declaration
public ModOp UnscaledProjection { get; }
Property Value
Type Description
ModOp
| Improve this Doc View Source

Width

Declaration
public int Width { get; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

WorldToDeviceFactor

Declaration
public double WorldToDeviceFactor { get; }
Property Value
Type Description
System.Double

Methods

| Improve this Doc View Source

BoundingRectWorld2d(Int32, Int32, Int32, Int32)

Returns a BoundingRect in the 2d world coordinate system according to the provided view positions. The view coordinate system is the windows forms system. The 2d world coordinate system is for the parallel projection a plane perpendicular to the projection direction scaled the same way as the model. For the perspective projection it is the back plane of the displayed frustum of pyramid.

Declaration
public BoundingRect BoundingRectWorld2d(int left, int right, int bottom, int top)
Parameters
Type Name Description
System.Int32 left

left position in the view

System.Int32 right

rechter Rand

System.Int32 bottom

unterer Rand

System.Int32 top

oberer Rand

Returns
Type Description
BoundingRect
| Improve this Doc View Source

Clone()

Returns a clone of this projection

Declaration
public Projection Clone()
Returns
Type Description
Projection

The clone

| Improve this Doc View Source

DeviceRect(BoundingRect)

Declaration
public Rectangle DeviceRect(BoundingRect r)
Parameters
Type Name Description
BoundingRect r
Returns
Type Description
System.Drawing.Rectangle
| Improve this Doc View Source

DrawingPlanePoint(GeoPoint2D)

Liefert den Raumpunkt (Welt3D) zum Welt2D Punkt gemäß Zeichenebene (DrawingPlane)

Declaration
public GeoPoint DrawingPlanePoint(GeoPoint2D w2d)
Parameters
Type Name Description
GeoPoint2D w2d
Returns
Type Description
GeoPoint

Welt3D Punkt

| Improve this Doc View Source

DrawingPlanePoint(Point)

Returns the point in the worldcoordinate system corresponding to the (mouse-) position p and the drawingplane

Declaration
public GeoPoint DrawingPlanePoint(Point p)
Parameters
Type Name Description
System.Drawing.Point p

Point in window coordinates

Returns
Type Description
GeoPoint

Point in world coordinates

| Improve this Doc View Source

GetExtent(IGeoObject)

Declaration
public BoundingRect GetExtent(IGeoObject go)
Parameters
Type Name Description
IGeoObject go
Returns
Type Description
BoundingRect
| Improve this Doc View Source

GetObjectData(SerializationInfo, StreamingContext)

Implements System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)

Declaration
public void GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
Type Name Description
System.Runtime.Serialization.SerializationInfo info

The System.Runtime.Serialization.SerializationInfo to populate with data.

System.Runtime.Serialization.StreamingContext context

The destination (System.Runtime.Serialization.StreamingContext) for this serialization.

| Improve this Doc View Source

GetOpenGLProjection(Int32, Int32, Int32, Int32, BoundingCube)

Declaration
public double[, ] GetOpenGLProjection(int left, int right, int bottom, int top, BoundingCube extend)
Parameters
Type Name Description
System.Int32 left
System.Int32 right
System.Int32 bottom
System.Int32 top
BoundingCube extend
Returns
Type Description
System.Double[,]
| Improve this Doc View Source

GetPickSpace(BoundingRect)

Returns a PickArea, rectWorld2D is in 2-d world coordinates

Declaration
public Projection.PickArea GetPickSpace(BoundingRect rectWorld2D)
Parameters
Type Name Description
BoundingRect rectWorld2D

The defining rectangle

Returns
Type Description
Projection.PickArea

The area inside the rectangle

| Improve this Doc View Source

GetPickSpace(Rectangle)

Returns a PickArea, viewRect is in window coordinates

Declaration
public Projection.PickArea GetPickSpace(Rectangle viewRect)
Parameters
Type Name Description
System.Drawing.Rectangle viewRect

The defining rectangle

Returns
Type Description
Projection.PickArea

The area inside the rectangle

| Improve this Doc View Source

GetPickSpace(RectangleF)

Returns a PickArea, viewRect is in window coordinates

Declaration
public Projection.PickArea GetPickSpace(RectangleF viewRect)
Parameters
Type Name Description
System.Drawing.RectangleF viewRect

The defining rectangle

Returns
Type Description
Projection.PickArea

The area inside the rectangle

| Improve this Doc View Source

GetPlacement(out Double, out Double, out Double)

Liefert die Werte für die Platzierung. Achtung: die Y-Werte müssen mit dem negativen Faktor multipliziert werden, denn die Platzierung dreht die y-achse um!

Declaration
public void GetPlacement(out double Factor, out double dx, out double dy)
Parameters
Type Name Description
System.Double Factor

Skalierungsfaktor, Achtung: für y negativ!

System.Double dx

Verschiebung in X

System.Double dy

Verschiebung in X

| Improve this Doc View Source

MovePlacement(Double, Double)

Declaration
public void MovePlacement(double dx, double dy)
Parameters
Type Name Description
System.Double dx
System.Double dy
| Improve this Doc View Source

PlanePoint(Plane, Point)

Gets the position of a given point (usually a mouse position in view coordinates) in a given plane.

Declaration
public GeoPoint2D PlanePoint(Plane pln, Point p)
Parameters
Type Name Description
Plane pln

Plane of the requested point

System.Drawing.Point p

Mouse position or point in view coordinates

Returns
Type Description
GeoPoint2D

Position of the point in the plane

| Improve this Doc View Source

PointBeam(Point)

Returns a beam corresponding to the 2-dimensional mouse position. The mouse position corresponds to a beam in the model which is seen as a point from the viewpoint. The result is in world coordinates of the model. Works for both parallel and perspective projection.

Declaration
public Axis PointBeam(Point p)
Parameters
Type Name Description
System.Drawing.Point p

Point to which the corresponding beam is required

Returns
Type Description
Axis

The corresponding beam

| Improve this Doc View Source

PointWorld2D(Point)

Declaration
public GeoPoint2D PointWorld2D(Point p)
Parameters
Type Name Description
System.Drawing.Point p
Returns
Type Description
GeoPoint2D
| Improve this Doc View Source

PointWorld2D(PointF)

Declaration
public GeoPoint2D PointWorld2D(PointF pf)
Parameters
Type Name Description
System.Drawing.PointF pf
Returns
Type Description
GeoPoint2D
| Improve this Doc View Source

PrependModOp(ModOp)

Declaration
public Projection PrependModOp(ModOp ToPrepend)
Parameters
Type Name Description
ModOp ToPrepend
Returns
Type Description
Projection
| Improve this Doc View Source

Project(GeoPoint)

Declaration
public GeoPoint2D Project(GeoPoint p)
Parameters
Type Name Description
GeoPoint p
Returns
Type Description
GeoPoint2D
| Improve this Doc View Source

Project2D(GeoPoint)

Declaration
public GeoPoint2D Project2D(GeoPoint p)
Parameters
Type Name Description
GeoPoint p
Returns
Type Description
GeoPoint2D
| Improve this Doc View Source

ProjectF(GeoPoint)

Berechnet die Projektion des gegebenen Punktes ins Zweidimensionale mit Berücksichtigung der Skalierung und Platzierung im Zweidimensionalen, also in das zweidimensionale Papierkoordinatensystem und nicht in das Weltkoordinatensystem.

Declaration
public PointF ProjectF(GeoPoint p)
Parameters
Type Name Description
GeoPoint p

der zu projizierende Punkt

Returns
Type Description
System.Drawing.PointF

der in 2-dim projizierte Punkt

| Improve this Doc View Source

ProjectUnscaled(GeoPoint)

Berechnet die Projektion des gegebenen Punktes ins Zweidimensionale ohne Berücksichtigung der Skalierung und Platzierung im Zweidimensionalen, also in das zweidimensionale Weltkoordinatensystem und nicht in das Papierkoordinatensystem.

Declaration
public GeoPoint2D ProjectUnscaled(GeoPoint p)
Parameters
Type Name Description
GeoPoint p

der zu projizierende Punkt

Returns
Type Description
GeoPoint2D

der in 2-dim projizierte Punkt

| Improve this Doc View Source

ProjectUnscaled(GeoVector)

Declaration
public GeoVector2D ProjectUnscaled(GeoVector v)
Parameters
Type Name Description
GeoVector v
Returns
Type Description
GeoVector2D
| Improve this Doc View Source

SetDirection(GeoVector, GeoVector, BoundingCube)

Sets the view direction and the vertical direction of this projection.

Declaration
public void SetDirection(GeoVector Direction, GeoVector TopDirection, BoundingCube extent)
Parameters
Type Name Description
GeoVector Direction

View direction

GeoVector TopDirection

Vertical direction

BoundingCube extent

Extend of the model in world coordinates

| Improve this Doc View Source

SetDirectionAnimated(GeoVector, GeoVector, Model, Boolean, ICanvas, GeoPoint)

Declaration
public void SetDirectionAnimated(GeoVector viewDirection, GeoVector TopDirection, Model model, bool zoomTotal, ICanvas ctrl, GeoPoint fixPoint)
Parameters
Type Name Description
GeoVector viewDirection
GeoVector TopDirection
Model model
System.Boolean zoomTotal
ICanvas ctrl
GeoPoint fixPoint
| Improve this Doc View Source

SetPerspective(GeoPoint, GeoVector, Rectangle, BoundingCube)

Declaration
public void SetPerspective(GeoPoint fromHere, GeoVector dir, Rectangle clientRect, BoundingCube modelExtent)
Parameters
Type Name Description
GeoPoint fromHere
GeoVector dir
System.Drawing.Rectangle clientRect
BoundingCube modelExtent
| Improve this Doc View Source

SetPerspective(GeoPoint, GeoVector, Rectangle, BoundingCube, GeoPoint)

Declaration
public void SetPerspective(GeoPoint fromHere, GeoVector dir, Rectangle clientRect, BoundingCube modelExtent, GeoPoint fixPoint)
Parameters
Type Name Description
GeoPoint fromHere
GeoVector dir
System.Drawing.Rectangle clientRect
BoundingCube modelExtent
GeoPoint fixPoint
| Improve this Doc View Source

SetPlacement(Double, Double, Double)

Declaration
public void SetPlacement(double factor, double dx, double dy)
Parameters
Type Name Description
System.Double factor
System.Double dx
System.Double dy
| Improve this Doc View Source

SetPlacement(Rectangle, BoundingRect)

Stellt die Platzierung im Zweidimensionalen ein: Das Quellrechteck soll in das Zielrechteck passen.

Declaration
public void SetPlacement(Rectangle Destination, BoundingRect Source)
Parameters
Type Name Description
System.Drawing.Rectangle Destination

das Zielrechteck, gewöhnlich ClientRect des Controls

BoundingRect Source

Das Quellrechteck in 2-dimensionalen Weltkoordinaten

| Improve this Doc View Source

SetPlacement(RectangleF, BoundingRect)

Declaration
public void SetPlacement(RectangleF Destination, BoundingRect Source)
Parameters
Type Name Description
System.Drawing.RectangleF Destination
BoundingRect Source
| Improve this Doc View Source

SetUnscaledProjection(ModOp)

Declaration
public void SetUnscaledProjection(ModOp unscaledProjection)
Parameters
Type Name Description
ModOp unscaledProjection
| Improve this Doc View Source

UnProject(Point)

Liefert einen 3D Punkt in der Ebene, die durch den Urprung geht. Ist eigentlich so nicht zu gebrauchen denn es fehlt die Information wie weit vorne oder hinten der Punkt sein soll

Declaration
public GeoPoint UnProject(Point p)
Parameters
Type Name Description
System.Drawing.Point p
Returns
Type Description
GeoPoint
| Improve this Doc View Source

UnProjectUnscaled(GeoPoint2D)

Declaration
public GeoPoint UnProjectUnscaled(GeoPoint2D p)
Parameters
Type Name Description
GeoPoint2D p
Returns
Type Description
GeoPoint
| Improve this Doc View Source

UnProjectUnscaled(GeoVector2D)

Declaration
public GeoVector UnProjectUnscaled(GeoVector2D v)
Parameters
Type Name Description
GeoVector2D v
Returns
Type Description
GeoVector
| Improve this Doc View Source

WindowToWorld(PointF)

Returns the provided point in the world coordinate system

Declaration
public GeoPoint WindowToWorld(PointF windowPoint)
Parameters
Type Name Description
System.Drawing.PointF windowPoint

A point in the windows coordinate system

Returns
Type Description
GeoPoint

Result in world coordinate system

| Improve this Doc View Source

World2DToWindow(BoundingRect)

Declaration
public RectangleF World2DToWindow(BoundingRect br)
Parameters
Type Name Description
BoundingRect br
Returns
Type Description
System.Drawing.RectangleF
| Improve this Doc View Source

World2DToWindow(GeoPoint2D)

Declaration
public GeoPoint2D World2DToWindow(GeoPoint2D p)
Parameters
Type Name Description
GeoPoint2D p
Returns
Type Description
GeoPoint2D
| Improve this Doc View Source

WorldToWindow(GeoPoint)

Returns the window position of a point in the world coordiate system. Point (0,0) is the top left point of the window

Declaration
public GeoPoint2D WorldToWindow(GeoPoint p)
Parameters
Type Name Description
GeoPoint p

Point in world coordinate system

Returns
Type Description
GeoPoint2D

Events

| Improve this Doc View Source

ProjectionChangedEvent

Event beeing issued when the projection changes

Declaration
public event Projection.ProjectionChangedDelegate ProjectionChangedEvent
Event Type
Type Description
Projection.ProjectionChangedDelegate

Explicit Interface Implementations

| Improve this Doc View Source

IDeserializationCallback.OnDeserialization(Object)

Declaration
void IDeserializationCallback.OnDeserialization(object sender)
Parameters
Type Name Description
System.Object sender

Implements

System.Runtime.Serialization.ISerializable
System.Runtime.Serialization.IDeserializationCallback
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX