[CONNECT C++] mdlWindow_globalPointToScreen(). Is there an C++ API equivalent?

Is there a method on a DgnButtonEvent to accomplish the same thing?

UpdatePosition(DgnButtonEventCR ev)
{
	DPoint3d		screenPt3D = { 0 };
	ev.GetViewport()->ViewToScreen(&screenPt3D, ev.GetViewPoint(), 1);	// Transfrom an array of points in DgnCoordSystem::View into DgnCoordSystem::Screen.
	Point2d			globalPt = { (int)screenPt3D.x, (int)screenPt3D.y };
	Point2d			screenPt2d = { 0 };

    // Can I do this somehow directly without calling mdlWindow_globalPointToScreen() ?
	mdlWindow_globalPointToScreen(&screenPt2d, mdlWindow_viewWindowGet(ev.GetViewNum()), &globalPt);	// Converts a point in global coordinates to a point in screen coordinates for the screen number specified by windowP.
}

Bruce

Parents
  • How about ViewPort::ViewToScreen()?

     
    Regards, Jon Summers
    LA Solutions

  • How about ViewPort::ViewToScreen()?

    That's the first call I make, which converts the cursor location from DGN units to a "window" location. The second call (  mdlWindow_globalPointToScreen() ) coverts that "window" location to a "screen" location (I have three monitors), so I think the MDL call return the position relative to the collection/arrangement of monitors, not the "window". I'm wondering if the API has a method to do that so I can skip calling the MDL function. Ultimately, I'm using a WIndows API function, so it needs the position in what I'm calling "screen" coordinates (which is not the definition of "screen" that MicroStation is using).

    It would be helpful to have a summary of the concept of  "location" types used by MicroStation (Screen, Global, NPT?, etc) and how they relate to the concept of Windows positioning.

    Bruce

Reply
  • How about ViewPort::ViewToScreen()?

    That's the first call I make, which converts the cursor location from DGN units to a "window" location. The second call (  mdlWindow_globalPointToScreen() ) coverts that "window" location to a "screen" location (I have three monitors), so I think the MDL call return the position relative to the collection/arrangement of monitors, not the "window". I'm wondering if the API has a method to do that so I can skip calling the MDL function. Ultimately, I'm using a WIndows API function, so it needs the position in what I'm calling "screen" coordinates (which is not the definition of "screen" that MicroStation is using).

    It would be helpful to have a summary of the concept of  "location" types used by MicroStation (Screen, Global, NPT?, etc) and how they relate to the concept of Windows positioning.

    Bruce

Children
No Data