ViewWorldProjection
Canonical path: NemAll_Python_IFW_Input.ViewWorldProjection
Implementation of the view - world projection
Methods:
-
CreateForUnitTest
–Create the object for a unit test
-
GetDocumentID
–Get the document ID
-
GetEyePoint
–Get eye point of current projection
-
GetIsoProjection
–Get the isometric projection of the view
-
GetMatrix
–Get the view matrix
-
GetPixelFactor
–Get factor of pixel to world coordinates
-
GetScreenScale
–Get the screen scale
-
GetSearchRadiusByPixel
–Get the search radius by pixel
-
GetViewAngle
–Get the rotation angle of the view
-
GetViewPoint
–Get view point of current projection
-
GetViewSize
–Get the size of the view
-
GetViewZAngle
–Get the rotation angle of the view in z-direction
-
GetWindowNumber
–Get the window number
-
GetZoomWindowNumber
–Get the zoom window number. Numbers 1 and more for active zoom window.
-
GetZoomWndTextFac
–Get the text-factor of the zoom window
-
GetZoomWndXFac
–Get the x-factor of the zoom window
-
GetZoomWndYFac
–Get the y-factor of the zoom window
-
IsAssistWindow
–Check for assist window
-
IsCentralProjection
–Check, whether the projection is a central projection
-
IsFreeProjection
–Check, whether the projection is a free projection
-
IsGroundplanView
–Check, whether the projection is ground plan view
-
IsInView
–Check, whether the point is inside the view
-
IsIsometricProjection
–Check, whether the projection is a isometric projection
-
IsSideView
–Check, whether the projection is a side view
-
IsZoomWindow
–Check if the input is inside the zoom window
-
ProjectionToWorld
–Get the world 3D point from a projection 2D point and a reference point
-
SetPointDepth
–Set point depth by current view projection type and pointWithDepth
-
ViewPerpendicularToWorld
–Transform a view perpendicular point to a world perpendicular point
-
ViewToPixel
–Transform a view point to a pixel coordinate
-
ViewToWorld
–Transform a view point to a world point
-
ViewToWorldBaseZ
–Transform a view point to a world point with resulting z-coordinate
-
ViewToWorldBaseZ0
–Transform a view point to a world point with resulting z-world = 0
-
ViewToWorldPlane
–Transform the view point to a world plane
-
ViewToWorldRay
–Calculates a ray
-
ViewToWorldViewZ
–Transform a view 2D point with view Z coordinate to a world point
-
WorldToPixel
–Transform the world point to a pixel point
-
WorldToProjection
–Overloaded function. See individual overloads.
-
WorldToProjectionBase0
–Overloaded function. See individual overloads.
-
WorldToView
–Overloaded function. See individual overloads.
-
WorldToView3D
–Transform a world point to a view 3D point
-
WorldToWorldPlane
–Overloaded function. See individual overloads.
-
__init__
–Overloaded function. See individual overloads.
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