class CODGlobal
Global methods for use by all classes. These are all static.
Defined in: OdGlobal.h
VIEWS_API CODGlobal()
Constructor.
VIEWS_API virtual ~CODGlobal()
Destructor.
VIEWS_API static BOOL m_bDebugDraw
Debug drawing mode flag; if enabled, the viewport draws the
VIEWS_API static BOOL GetDebugDraw()
Gets the debug drawing mode; if enabled, the viewport draws the
VIEWS_API static void SetDebugDraw(BOOL bDebugDraw)
Sets the debug drawing mode; if enabled, the viewport draws the
VIEWS_API static void DockControlBarLeftOf(CFrameWnd* pFrameWnd, CControlBar* pBar, CControlBar* pLeftOf)
Docks a control bar to the left of another control bar.
VIEWS_API static void ShowLastError(LPCTSTR lpszCaption)
Shows the last error message produced by resource access functions.
VIEWS_API static bool IsYAxisUp(const CDC& dc)
Determines if positive Y-Axis for the device context is up or down.
VIEWS_API static int Angle(const CPoint pt0, const CPoint pt1)
Calculates the angle between two points. The result is in tenths of a degree.
VIEWS_API static int PointDistance(const CPoint& pt0, const CPoint& pt1)
Calculates the distance between two points.
VIEWS_API static CPoint ClosestPointOnLine(const CPoint& pt0, const CPoint& pt1, const CPoint& ptFind)
Finds the point on a line that is closest to another point.
VIEWS_API static BOOL Intersect(POINT pt0, POINT pt1, POINT pt2, POINT pt3)
Determines if two lines intersect.
VIEWS_API static BOOL IntersectionPt(POINT pt0, POINT pt1, POINT pt2, POINT pt3, LPPOINT lpptIntersection)
Determines if two lines intersect, and if so, the intersection point.
VIEWS_API static int CCW(POINT pt0, POINT pt1, POINT pt2)
Determines if moving between three points you are travelling in a counter clockwise direction.
VIEWS_API static CSize CalcOrthogonalDirection(const CPoint& ptEndPt, const CRect& rcBounds)
Calculates the direction of a point relative to the center of a rectangle.
VIEWS_API static int Round(float fRound)
Rounds a floating point number to an integer.
VIEWS_API static BOOL PtInRect(CPoint point, CRect rect)
Determines if a point is within a rectangle.
VIEWS_API static BOOL RectIntersect(CRect rect1, CRect rect2)
Determines if two rectangles intersect.
VIEWS_API static BOOL RectWithin(CRect rcSmall, CRect rcLarge)
Determines if one rectangle is inside another.
VIEWS_API static void NormalizeRect(CRect& rect)
Normalizes CRect so that both the height and width are positive.
VIEWS_API static CRect UnionRect(CRect rect1, CRect rect2)
Combines two rectangles into one.
VIEWS_API static CRect MakeBoundingRect(LPPOINT lpPoints, int nCount)
Creates a rectangle which includes the points passed in.
VIEWS_API static void GetControlPoint(const CRect& rcBounds, OD_CONTROL_POINT nControlPoint, float& fControlX, float& fControlY)
Get one of the rectangles's 9 standard control points.
VIEWS_API static CPoint GetControlPoint(const CRect& rcBounds, OD_CONTROL_POINT nControlPoint)
Get one of the rectangles's 9 standard control points.
VIEWS_API static int PointsToLogical(const int nPoints, CDC* pDC = NULL, BOOL bVertical = TRUE)
Converts a point size to a logical size.
VIEWS_API static int LogicalToPoints(const int nLog, CDC* pDC = NULL, BOOL bVertical = TRUE)
Converts a logical size to a point size.
VIEWS_API static OD_CONTROL_POINT GetInverseScalingPoint(float fScaleX, float fScaleY, OD_CONTROL_POINT nControl)
Takes a set of scaling information and calculates what control point to use in order to inverse that scaling.
VIEWS_API static const double doPointDistance(const CPoint& pt1, const CPoint& pt2)
Calculates the distance between two points.