C++
virtual void getNumPixelsInUnitSquare( const AcGePoint3d& givenWorldpt, AcGePoint2d& pixelArea, bool includePerspective = true ) const = 0;
Description
Sets pixelArea's X coordinate to the number of pixels in the vertical axis of a WCS unit square and pixelArea's Y coordinate to the number of pixels in the horizontal axis of the unit square.
In perspective mode, the WCS unit square gets smaller and encompasses fewer pixels as it recedes away from the camera, whereas in non-perspective mode, the unit square stays the same size no matter how far away from the camera. So, if perspective mode is on in the viewport, then givenWorldPt is used as the center of the unit square so that the distance from the camera to the point will be reflected in the pixel values. If perspective mode is not on, then givenWorldPt is not used, since location has no effect on pixel count.
This function is typically used to determine when geometry will end up displaying close to the size of a pixel. In these cases, for speed and memory efficiency, the geometry may be displayed in a less complex form without the viewer being able to see any difference.
Parameters
Parameters | Description |
---|---|
pixelArea | Output a 2D point describing the number of pixels in a unit square for the height and width |
includePerspective | Input Boolean indicating perspective mode |
givenWorldPt | Input WCS point for the center point of the display coordinate unit square |