ViewWorldProjection
Canonical path: NemAll_Python_IFW_Input.ViewWorldProjection
Implementation of the view - world projection
CreateForUnitTest
staticmethod
CreateForUnitTest(doc: DocumentAdapter) -> ViewWorldProjection
Create the object for a unit test
Parameters:
-
doc
(DocumentAdapter
) –Document
Returns:
-
ViewWorldProjection
–created object
GetEyePoint
GetEyePoint() -> Point3D
Get eye point of current projection
Eye point is point where camera is.
Returns:
-
Point3D
–Eye point
GetIsoProjection
GetIsoProjection() -> eProjectionType
Get the isometric projection of the view
Returns:
-
eProjectionType
–Isometric projection of the view
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)
GetSearchRadiusByPixel
Get the search radius by pixel
Parameters:
-
pixel
(int
) –Pixel of the search radius
Returns:
-
float
–Search radius in view size
GetViewAngle
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:
-
Point3D
–Eye point
GetViewZAngle
Get the rotation angle of the view in z-direction
Returns:
-
float
–Rotation angle of the view in z-direction
GetZoomWindowNumber
Get the zoom window number. Numbers 1 and more for active zoom window.
Returns:
-
int
–Window number
GetZoomWndTextFac
Get the text-factor of the zoom window
Returns:
-
float
–Text-factor of the zoom window
GetZoomWndXFac
Get the x-factor of the zoom window
Returns:
-
float
–X-factor of the zoom window
GetZoomWndYFac
Get the y-factor of the zoom window
Returns:
-
float
–Y-factor of the zoom window
IsAssistWindow
Check for assist window
Returns:
-
bool
–The document is an assist window: true/false
IsCentralProjection
Check, whether the projection is a central projection
Returns:
-
bool
–Central projection: true/false
IsFreeProjection
Check, whether the projection is a free projection
Returns:
-
bool
–Projection is a free view: true/false
IsGroundplanView
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:
-
pnt
(Point2D
) –View point
Returns:
-
bool
–Point is inside the view: true/false
IsIsometricProjection
Check, whether the projection is a isometric projection
Returns:
-
bool
–Projection is a isometric projection: true/false
IsSideView
Check, whether the projection is a side view
Returns:
-
bool
–Projection is a side view: true/false
IsZoomWindow
Check if the input is inside the zoom window
Returns:
-
bool
–Window number
ProjectionToWorld
SetPointDepth
ViewPerpendicularToWorld
ViewToPixel
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:
-
Point2D
–Pixel view point
ViewToWorld
ViewToWorldBaseZ
ViewToWorldBaseZ0
ViewToWorldPlane
ViewToWorldRay
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:
-
pnt
(Point2D
) –View point
Returns:
ViewToWorldViewZ
WorldToPixel
WorldToProjection
overloaded
WorldToProjectionBase0
overloaded
WorldToView
overloaded
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:
-
Point2D
–View point
WorldToView(polyline3D: Polyline3D) -> Polyline2D
Transform a 3D world polyline to a 2D view polyline
Parameters:
-
polyline3D
(Polyline3D
) –World polyline
Returns:
-
Polyline2D
–View polyline