Skip to content

ViewWorldProjection

Canonical path: NemAll_Python_IFW_Input.ViewWorldProjection

Implementation of the view - world projection

Methods:

CreateForUnitTest staticmethod

CreateForUnitTest(doc: DocumentAdapter) -> ViewWorldProjection

Create the object for a unit test

Parameters:

Returns:

GetDocumentID

GetDocumentID() -> int

Get the document ID

Returns:

  • int

    Document ID

GetEyePoint

GetEyePoint() -> Point3D

Get eye point of current projection

Eye point is point where camera is.

Returns:

GetIsoProjection

GetIsoProjection() -> eProjectionType

Get the isometric projection of the view

Returns:

GetMatrix

GetMatrix() -> Matrix3D

Get the view matrix

GetPixelFactor

GetPixelFactor() -> tuple[float, float]

Get factor of pixel to world coordinates

Used when you need calculate how much millimeters are one pixel

Returns:

  • tuple[float, float]

    tuple(Pixel factor in x direction, Pixel factor in y direction)

GetScreenScale

GetScreenScale() -> float

Get the screen scale

Returns:

  • float

    Screen scale

GetSearchRadiusByPixel

GetSearchRadiusByPixel(pixel: int) -> float

Get the search radius by pixel

Parameters:

  • pixel (int) –

    Pixel of the search radius

Returns:

  • float

    Search radius in view size

GetViewAngle

GetViewAngle() -> float

Get the rotation angle of the view

Returns:

  • float

    Rotation angle of the view

GetViewPoint

GetViewPoint() -> Point3D

Get view point of current projection

View point is point where you are looking (focused). View point lie in plain of drawn data.

Returns:

GetViewSize

GetViewSize() -> Vector2D

Get the size of the view

Returns:

GetViewZAngle

GetViewZAngle() -> float

Get the rotation angle of the view in z-direction

Returns:

  • float

    Rotation angle of the view in z-direction

GetWindowNumber

GetWindowNumber() -> int

Get the window number

Returns:

  • int

    Window number

GetZoomWindowNumber

GetZoomWindowNumber() -> int

Get the zoom window number. Numbers 1 and more for active zoom window.

Returns:

  • int

    Window number

GetZoomWndTextFac

GetZoomWndTextFac() -> float

Get the text-factor of the zoom window

Returns:

  • float

    Text-factor of the zoom window

GetZoomWndXFac

GetZoomWndXFac() -> float

Get the x-factor of the zoom window

Returns:

  • float

    X-factor of the zoom window

GetZoomWndYFac

GetZoomWndYFac() -> float

Get the y-factor of the zoom window

Returns:

  • float

    Y-factor of the zoom window

IsAssistWindow

IsAssistWindow() -> bool

Check for assist window

Returns:

  • bool

    The document is an assist window: true/false

IsCentralProjection

IsCentralProjection() -> bool

Check, whether the projection is a central projection

Returns:

  • bool

    Central projection: true/false

IsFreeProjection

IsFreeProjection() -> bool

Check, whether the projection is a free projection

Returns:

  • bool

    Projection is a free view: true/false

IsGroundplanView

IsGroundplanView() -> bool

Check, whether the projection is ground plan view

Returns:

  • bool

    Projection is ground plan view: true/false

IsInView

IsInView(pnt: Point2D) -> bool

Check, whether the point is inside the view

Parameters:

Returns:

  • bool

    Point is inside the view: true/false

IsIsometricProjection

IsIsometricProjection() -> bool

Check, whether the projection is a isometric projection

Returns:

  • bool

    Projection is a isometric projection: true/false

IsSideView

IsSideView() -> bool

Check, whether the projection is a side view

Returns:

  • bool

    Projection is a side view: true/false

IsZoomWindow

IsZoomWindow() -> bool

Check if the input is inside the zoom window

Returns:

  • bool

    Window number

ProjectionToWorld

ProjectionToWorld(pnt: Point2D, refPnt: Point3D) -> Point3D

Get the world 3D point from a projection 2D point and a reference point

Parameters:

  • pnt (Point2D) –

    View Point

  • refPnt (Point3D) –

    Reference point with the additional coordinate

Returns:

SetPointDepth

SetPointDepth(pointWithDepth: Point3D) -> Point3D

Set point depth by current view projection type and pointWithDepth

Parameters:

  • pointWithDepth (Point3D) –

    Point with depth

Returns:

ViewPerpendicularToWorld

ViewPerpendicularToWorld(line3D: Line3D, pnt: Point3D) -> Point3D

Transform a view perpendicular point to a world perpendicular point

Parameters:

  • line3D (Line3D) –

    3D perpendicular line

  • pnt (Point3D) –

    Reference point for the perpendicular

Returns:

  • Point3D

    World perpendicular point

ViewToPixel

ViewToPixel(
    pnt: Point2D, bBottomTop: bool, considerZoomwindow: bool = True
) -> Point2D

Transform a view point to a pixel coordinate

Parameters:

  • pnt (Point2D) –

    View point

  • bBottomTop (bool) –

    The y zero point is on the bottom of the screen: true/false

  • considerZoomwindow (bool, default: True ) –

    if true and the position is in a zoom window, then the zoom window will be used for the calculation

Returns:

ViewToWorld

ViewToWorld(pnt: Point2D, z: float = 0) -> Point3D

Transform a view point to a world point

Parameters:

  • pnt (Point2D) –

    View point

  • z (float, default: 0 ) –

    z-coordinate

Returns:

ViewToWorldBaseZ

ViewToWorldBaseZ(pnt: Point2D, zWorld: float) -> Point3D

Transform a view point to a world point with resulting z-coordinate

Parameters:

  • pnt (Point2D) –

    View point

  • zWorld (float) –

    Z-coordinate

Returns:

  • Point3D

    World point with resulting z-coordinate

ViewToWorldBaseZ0

ViewToWorldBaseZ0(pnt: Point2D) -> Point3D

Transform a view point to a world point with resulting z-world = 0

Parameters:

Returns:

ViewToWorldPlane

ViewToWorldPlane(pnt: Point2D, plane: Plane3D) -> Point3D

Transform the view point to a world plane

Parameters:

Returns:

  • Point3D

    World point at the plane

ViewToWorldRay

ViewToWorldRay(pnt: Point2D) -> tuple[Point3D, Vector3D]

Calculates a ray

Calculates a ray (for non-vanishing-point-projections, rather a line) from the given view 2D point. Can be used for pick-point calculations.

Note that we have a right-hand view coordinate system, so its Z axis points towards the eye.

Parameters:

Returns:

ViewToWorldViewZ

ViewToWorldViewZ(pnt: Point2D, viewZ: float) -> Point3D

Transform a view 2D point with view Z coordinate to a world point

Parameters:

  • pnt (Point2D) –

    View point

  • viewZ (float) –

    z-coordinate in view transformation

Returns:

WorldToPixel

WorldToPixel(pnt: Point3D, bBottomTop: bool) -> Point2D

Transform the world point to a pixel point

Parameters:

  • pnt (Point3D) –

    World point

  • bBottomTop (bool) –

    The y zero point is on the bottom of the screen: true/false

Returns:

WorldToProjection overloaded

WorldToProjection(pnt: Point3D) -> Point2D

Get the projection 2D point from a world 3D point

Parameters:

Returns:

WorldToProjection(line: Line3D) -> Line2D

Get the projection 2D line from a world 3D line

Parameters:

  • line (Line3D) –

    World line

Returns:

  • Line2D

    2D projection line

WorldToProjectionBase0 overloaded

WorldToProjectionBase0(pnt: Point3D) -> Point3D

Get the world projection point with the base 0

Parameters:

Returns:

  • Point3D

    World projection point with the base 0

WorldToProjectionBase0(line: Line3D) -> Line3D

Get the world projection line with the base 0

Parameters:

  • line (Line3D) –

    World coordinate line

Returns:

  • Line3D

    World projection point with the base 0

WorldToView overloaded

WorldToView(pnt: Point3D) -> Point2D

Transform a world point to a view point

Parameters:

Returns:

WorldToView(pnt: Point2D) -> Point2D

Transform a world point to a view point

Parameters:

Returns:

WorldToView(x: float, y: float, z: float) -> Point2D

Transform a world point to a view point

Parameters:

  • x (float) –

    X-coordinate world

  • y (float) –

    Y-coordinate world

  • z (float) –

    Z-coordinate world

Returns:

WorldToView(line: Line3D) -> Line2D

Transform a 3D world line to a 2D view line

Parameters:

  • line (Line3D) –

    World line

Returns:

WorldToView(line: Line2D) -> Line2D

Transform a 2D world line to a 2D view line

Parameters:

  • line (Line2D) –

    World line

Returns:

WorldToView(polyline3D: Polyline3D) -> Polyline2D

Transform a 3D world polyline to a 2D view polyline

Parameters:

Returns:

WorldToView3D

WorldToView3D(pnt: Point3D) -> Point3D

Transform a world point to a view 3D point

If Z coordinate of returned view point is positive, then world point is before eye (i.e. is visible).

Parameters:

Returns:

WorldToWorldPlane overloaded

WorldToWorldPlane(pnt: Point3D, plane: Plane3D) -> Point3D

Transform a world point to a plane point

Parameters:

Returns:

  • Point3D

    Plane point in world coordinates

WorldToWorldPlane(line: Line3D, plane: Plane3D) -> Line3D

Transform a world line to a plane line

Parameters:

Returns:

  • Line3D

    Plane line in world coordinates

__init__ overloaded

__init__()

Initialize

__init__(element: ViewWorldProjection)

Copy constructor

Parameters: