You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
1.7 KiB
C++

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

/**
* @file UtilityClass.h
* @brief 常用的简单类集合
* @author 沙漠乌鸦
* @time 2010-01-14
*/
#pragma once
/** @brief 深度范围 */
class AFX_EXT_CLASS DEPTHRANGE
{
public:
explicit DEPTHRANGE(double top = 0.0, double bottom = 0.0) {topdepth = top; bottomdepth = bottom;}
/**
* @brief 判断深度范围是否包含另一个深度范围
* @param [in] depthRange 深度范围
* @return 若包含则返回TURE否则返回FALSE
*/
bool Contain(DEPTHRANGE depthRange,int iPrecision = 1) const;
/**
* @brief 判断深度范围是否包含一个深度
* @param [in] dDepth 深度
* @return 若包含则返回TRUE否则返回FALSE
*/
bool Contain(double dDepth,int iPrecision = 1) const;
/**
* @brief 判断深度范围是否包含另一个深度范围,并且顶底或底深不相等
* @param [in] depthRange 深度范围
* @return 若包含并不相等则返回TURE否则返回FALSE
* 1> 776.5--777.2与776.8--777.2返回FALSE,底深相等
* 2> 776.5--777.2与776.5--777.0返回FALSE,顶深相等
* 3> 776.5--777.2与776.8--777.0返回TRUE
*/
bool ContainApart(DEPTHRANGE depthRange,int iPrecision = 1) const;
/**
* @brief 判断深度范围是否包含另一个深度,并且深度不与顶深或底深相等
*/
bool ContainApart(double dDepth,int iPrecision = 1) const;
/** @brief 判断深度范围是否相交 */
bool Overlap(DEPTHRANGE depthRange,int iPrecision = 1) const;
/** @brief 判断两个深度范围是否完全相等 */
bool Equal(DEPTHRANGE depthRange,int iPrecision = 1) const;
/** @brief 判断深度范围是否为空 */
bool IsEmpty() const;
/** @brief 获取深度范围的厚度值 */
double GetThick() const;
/** @brief 获取中间深度 */
double GetCenter() const;
public:
/** @brief 对深度范围进行四舍五入操作 */
DEPTHRANGE GetPrecision(int iPrecision = 1) const;
// operator
bool operator < (const DEPTHRANGE& value);
public:
double topdepth;
double bottomdepth;
};