CODGlobal Class

class CODGlobal

Global methods for use by all classes. These are all static.

Defined in: OdGlobal.h

Class Members

 CODGlobal()

Constructor.

virtual  ~CODGlobal()

Destructor.

static BOOL m_bDebugDraw

Debug drawing mode flag; if enabled, the viewport draws the

static BOOL  GetDebugDraw()

Gets the debug drawing mode; if enabled, the viewport draws the

static void  SetDebugDraw(BOOL bDebugDraw)

Sets the debug drawing mode; if enabled, the viewport draws the

static void  DockControlBarLeftOf(CFrameWnd* pFrameWnd, CControlBar* pBar, CControlBar* pLeftOf)

Docks a control bar to the left of another control bar.

static void  ShowLastError(LPCTSTR lpszCaption)

Shows the last error message produced by resource access functions.

static bool  IsYAxisUp(const CDC& dc)

Determines if positive Y-Axis for the device context is up or down.

static int  Angle(const CPoint pt0, const CPoint pt1)

Calculates the angle between two points. The result is in tenths of a degree.

static int  PointDistance(const CPoint& pt0, const CPoint& pt1)

Calculates the distance between two points.

static CPoint  ClosestPointOnLine(const CPoint& pt0, const CPoint& pt1, const CPoint& ptFind)

Finds the point on a line that is closest to another point.

static BOOL  Intersect(POINT pt0, POINT pt1, POINT pt2, POINT pt3)

Determines if two lines intersect.

static BOOL  IntersectionPt(POINT pt0, POINT pt1, POINT pt2, POINT pt3, LPPOINT lpptIntersection)

Determines if two lines intersect, and if so, the intersection point.

static int  CCW(POINT pt0, POINT pt1, POINT pt2)

Determines if moving between three points you are travelling in a counter clockwise direction.

static CSize  CalcOrthogonalDirection(const CPoint& ptEndPt, const CRect& rcBounds)

Calculates the direction of a point relative to the center of a rectangle.

static int  Round(float fRound)

Rounds a floating point number to an integer.

static BOOL  PtInRect(CPoint point, CRect rect)

Determines if a point is within a rectangle.

static BOOL  RectIntersect(CRect rect1, CRect rect2)

Determines if two rectangles intersect.

static BOOL  RectWithin(CRect rcSmall, CRect rcLarge)

Determines if one rectangle is inside another.

static void  NormalizeRect(CRect& rect)

Normalizes CRect so that both the height and width are positive.

static CRect  UnionRect(CRect rect1, CRect rect2)

Combines two rectangles into one.

static CRect  MakeBoundingRect(LPPOINT lpPoints, int nCount)

Creates a rectangle which includes the points passed in.

static void  GetControlPoint(const CRect& rcBounds, OD_CONTROL_POINT nControlPoint, float& fControlX, float& fControlY)

Get one of the rectangles's 9 standard control points.

static CPoint  GetControlPoint(const CRect& rcBounds, OD_CONTROL_POINT nControlPoint)

Get one of the rectangles's 9 standard control points.

static int  PointsToLogical(const int nPoints, CDC* pDC = NULL, BOOL bVertical = TRUE)

Converts a point size to a logical size.

static int  LogicalToPoints(const int nLog, CDC* pDC = NULL, BOOL bVertical = TRUE)

Converts a logical size to a point size.

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.

static const double doPointDistance(const CPoint& pt1, const CPoint& pt2)

Calculates the distance between two points.