📄 2dscale.cpp
字号:
/* */
/* Author : Scott Pelger Date Created: 29JAN02 */
/* */
/* Revisions */
/* */
/* Engineer Date Description */
/* */
/* Scott Pelger 29JAN02 initial version */
/* */
/************************************************************************************************/
void C2DScale::SetAxisScale(enum AXIS eAxis, double dMin, double dMax) {
CHART_ASSERT(dMin+DBL_EPSILON<dMax||dMin+DBL_EPSILON==dMax);
switch (eAxis) {
case X_AXIS :
m_dXMin = dMin;
m_dXMax = dMax;
break;
case Y_AXIS :
m_dPrevYMin = m_dYMin;
m_dPrevYMax = m_dYMax;
m_dYMin = dMin;
m_dYMax = dMax;
break;
}
return;
}
/************************************************************************************************/
/* */
/* Function: C2DScale::GetAxisScale() */
/* */
/* Purpose : sets the scales of a axis based on the first arg */
/* */
/* Inputs : enum AXIS eAxis -> determines which axis these scales are for */
/* double dMin -> min scale */
/* double dMax -> max scale */
/* */
/* Outputs : NONE */
/* */
/* Author : Scott Pelger Date Created: 29JAN02 */
/* */
/* Revisions */
/* */
/* Engineer Date Description */
/* */
/* Scott Pelger 29JAN02 initial version */
/* */
/************************************************************************************************/
void C2DScale::GetAxisScale(enum AXIS eAxis, double& dMin, double& dMax) {
switch (eAxis) {
case X_AXIS :
dMin = m_dXMin;
dMax = m_dXMax;
break;
case Y_AXIS :
dMin = m_dYMin;
dMax = m_dYMax;
break;
}
return;
}
/************************************************************************************************/
/* */
/* Function: C2DScale::SetScaleStep() */
/* */
/* Purpose : sets the major and minor scale steps of an axis based on the first arg */
/* */
/* Inputs : enum AXIS eAxis -> determines which axis these scales are for */
/* double dMin -> min scale */
/* double dMax -> max scale */
/* */
/* Outputs : NONE */
/* */
/* Author : Scott Pelger Date Created: 29JAN02 */
/* */
/* Revisions */
/* */
/* Engineer Date Description */
/* */
/* Scott Pelger 29JAN02 initial version */
/* */
/************************************************************************************************/
void C2DScale::SetScaleStep(enum AXIS eAxis, double dMin, double dMax) {
switch (eAxis) {
case X_AXIS :
m_dMinorStepX = dMin;
m_dMajorStepX = dMax;
break;
case Y_AXIS :
m_dMinorStepY = dMin;
m_dMajorStepY = dMax;
break;
}
return;
}
/************************************************************************************************/
/* */
/* Function: C2DScale::GetScaleStep() */
/* */
/* Purpose : gets the major and minor scale steps of an axis based on the first arg */
/* */
/* Inputs : enum AXIS eAxis -> determines which axis these scales are for */
/* double dMin -> min scale */
/* double dMax -> max scale */
/* */
/* Outputs : NONE */
/* */
/* Author : Scott Pelger Date Created: 29JAN02 */
/* */
/* Revisions */
/* */
/* Engineer Date Description */
/* */
/* Scott Pelger 29JAN02 initial version */
/* */
/************************************************************************************************/
void C2DScale::GetScaleStep(enum AXIS eAxis, double& dMin, double& dMax) {
switch (eAxis) {
case X_AXIS :
dMin = m_dMinorStepX;
dMax = m_dMajorStepX;
break;
case Y_AXIS :
dMin = m_dMinorStepY;
dMax = m_dMajorStepY;
break;
}
return;
}
/************************************************************************************************/
/* */
/* Function: C2DScale::SetStyle() */
/* */
/* Purpose : Sets the precision of the specified axis */
/* */
/* Inputs : BYTE yPrecision -> the precision */
/* */
/* Outputs : NONE */
/* */
/* Author : Scott Pelger Date Created: 7FEB02 */
/* */
/* Revisions */
/* */
/* Engineer Date Description */
/* */
/* Scott Pelger 7FEB02 initial version */
/* */
/************************************************************************************************/
void C2DScale::SetStyle(DWORD dwStyle) {
if (X_AXIS&dwStyle)
m_dwXStyle = dwStyle;
if (Y_AXIS&dwStyle)
m_dwYStyle = dwStyle;
if (GENERIC_STYLE&dwStyle)
m_dwGenericStyle = dwStyle;
}
/************************************************************************************************/
/* */
/* Function: C2DScale::ClearStyle() */
/* */
/* Purpose : Sets the precision of the specified axis */
/* */
/* Inputs : BYTE yPrecision -> the precision */
/* */
/* Outputs : NONE */
/* */
/* Author : Scott Pelger Date Created: 7FEB02 */
/* */
/* Revisions */
/* */
/* Engineer Date Description */
/* */
/* Scott Pelger 7FEB02 initial version */
/* */
/************************************************************************************************/
void C2DScale::ClearStyle(DWORD dwStyle) {
if (X_AXIS&dwStyle)
m_dwXStyle &= ~dwStyle;
if (Y_AXIS&dwStyle)
m_dwYStyle &= ~dwStyle;
return;
}
/************************************************************************************************/
/* */
/* Function: C2DScale::GetStyle() */
/* */
/* Purpose : gets the style of the specified axis */
/* */
/* Inputs : DWORD dwStyle -> the axis to retrieve */
/* */
/* Outputs : DWORD <- the style */
/* */
/* Author : Scott Pelger Date Created: 7FEB02 */
/* */
/* Revisions */
/* */
/* Engineer Date Description
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -