61 lines
1.4 KiB
C++
61 lines
1.4 KiB
C++
// OperMediumPt.h: interface for the COperMediumPt class.
|
|
//
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
#if !defined(AFX_OPERMEDIUMPT_H__7F74BB48_007F_4B99_8A95_72E7CBCE754F__INCLUDED_)
|
|
#define AFX_OPERMEDIUMPT_H__7F74BB48_007F_4B99_8A95_72E7CBCE754F__INCLUDED_
|
|
|
|
#if _MSC_VER > 1000
|
|
#pragma once
|
|
#endif // _MSC_VER > 1000
|
|
#include <map>
|
|
const float EPSINON = 0.00001;
|
|
typedef struct ST_DEPTH_SORT_KEY
|
|
{
|
|
float fXPos;
|
|
int iLayer;
|
|
ST_DEPTH_SORT_KEY()
|
|
{
|
|
fXPos = 0;
|
|
iLayer = 0;
|
|
}
|
|
bool operator < (const struct ST_DEPTH_SORT_KEY& Obj) const
|
|
{
|
|
if (fXPos < Obj.fXPos && fabsf(fXPos-Obj.fXPos) > EPSINON)
|
|
{
|
|
return true;
|
|
}
|
|
else if(fabsf(fXPos-Obj.fXPos) <= EPSINON)
|
|
{
|
|
if (iLayer < Obj.iLayer)
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
}STDepthSortKey;
|
|
|
|
class COperMediumPt
|
|
{
|
|
public:
|
|
COperMediumPt(int iAR);
|
|
virtual ~COperMediumPt();
|
|
bool InitiSortInfo(int iMethod);
|
|
bool AddSortPtInfo(int iA, int iB, int iM, int iN, int iLayer,int iIndex);
|
|
float GetUniSptXPos(int iA, int iB, int iM, int iN);
|
|
int GetFirstSortID(int iMethod);
|
|
int GetNextSortID();
|
|
int GetSize(){return m_mapDepthSort.size();}
|
|
float GetCurPtXPos(){return m_iterSortDepth->first.fXPos;}
|
|
|
|
protected:
|
|
int m_iAR;
|
|
std::map<STDepthSortKey, int> m_mapDepthSort;
|
|
std::map<STDepthSortKey, int>::iterator m_iterSortDepth;
|
|
|
|
|
|
};
|
|
|
|
#endif // !defined(AFX_OPERMEDIUMPT_H__7F74BB48_007F_4B99_8A95_72E7CBCE754F__INCLUDED_)
|