|
|
@@ -1,4 +1,4 @@
|
|
|
-#include "stdafx.h"
|
|
|
+#include "stdafx.h"
|
|
|
|
|
|
#include "otsdataconst.h"
|
|
|
#include "FieldMgr.h"
|
|
|
@@ -420,38 +420,38 @@ namespace OTSIMGPROC {
|
|
|
}
|
|
|
|
|
|
// get measure field centre
|
|
|
- CPoint poiMsrAreaCentre = m_pMeasureArea->GetDomainCenter();
|
|
|
+ //CPoint poiMsrAreaCentre = m_pMeasureArea->GetDomainCenter();
|
|
|
|
|
|
- // move to left top postion.
|
|
|
- a_poiField -= CPoint(a_sizeImageSize.cx / 2, a_sizeImageSize.cy / 2);
|
|
|
+ //// move to left top postion.
|
|
|
+ //a_poiField -= CPoint(a_sizeImageSize.cx / 2, a_sizeImageSize.cy / 2);
|
|
|
|
|
|
- // rectangle of the field
|
|
|
- CRect rectFiled(a_poiField, a_sizeImageSize);
|
|
|
+ //// rectangle of the field
|
|
|
+ //CRect rectFiled(a_poiField, a_sizeImageSize);
|
|
|
|
|
|
|
|
|
- // on the top left side, need to test the bottom right corner
|
|
|
- if (PtInPolygon(CPoint(rectFiled.right, rectFiled.top), ptPolygon))
|
|
|
- {
|
|
|
- return TRUE;
|
|
|
- }
|
|
|
+ // // on the top left side, need to test the bottom right corner
|
|
|
+ // if (PtInPolygon(CPoint(rectFiled.right, rectFiled.top), ptPolygon))
|
|
|
+ // {
|
|
|
+ // return TRUE;
|
|
|
+ // }
|
|
|
|
|
|
- // on the bottom left side, need to test the top right corner
|
|
|
- if (PtInPolygon(rectFiled.BottomRight(), ptPolygon))
|
|
|
- {
|
|
|
- return TRUE;
|
|
|
- }
|
|
|
+ // // on the bottom left side, need to test the top right corner
|
|
|
+ // if (PtInPolygon(rectFiled.BottomRight(), ptPolygon))
|
|
|
+ // {
|
|
|
+ // return TRUE;
|
|
|
+ // }
|
|
|
|
|
|
- // on the top left side, need to test the bottom right corner
|
|
|
- if (PtInPolygon(rectFiled.TopLeft(), ptPolygon))
|
|
|
- {
|
|
|
- return TRUE;
|
|
|
- }
|
|
|
+ // // on the top left side, need to test the bottom right corner
|
|
|
+ // if (PtInPolygon(rectFiled.TopLeft(), ptPolygon))
|
|
|
+ // {
|
|
|
+ // return TRUE;
|
|
|
+ // }
|
|
|
|
|
|
- // on the bottom left side, need to test the top right corner
|
|
|
- if (PtInPolygon(CPoint(rectFiled.left, rectFiled.bottom), ptPolygon))
|
|
|
- {
|
|
|
- return TRUE;
|
|
|
- }
|
|
|
+ // // on the bottom left side, need to test the top right corner
|
|
|
+ // if (PtInPolygon(CPoint(rectFiled.left, rectFiled.bottom), ptPolygon))
|
|
|
+ // {
|
|
|
+ // return TRUE;
|
|
|
+ // }
|
|
|
|
|
|
// this field is not in the area at all, return FALSE.
|
|
|
return FALSE;
|
|
|
@@ -517,74 +517,74 @@ namespace OTSIMGPROC {
|
|
|
return TRUE;
|
|
|
}
|
|
|
|
|
|
- // get measure field centre
|
|
|
- CPoint poiMsrAreaCentre = m_pMeasureArea->GetDomainCenter();
|
|
|
-
|
|
|
- // move to left top postion.
|
|
|
- a_poiField -= CPoint(a_sizeImageSize.cx / 2, a_sizeImageSize.cy / 2);
|
|
|
-
|
|
|
- // rectangle of the field
|
|
|
- CRect rectFiled(a_poiField, a_sizeImageSize);
|
|
|
-
|
|
|
- // check field position
|
|
|
- if (rectFiled.left <= poiMsrAreaCentre.x && rectFiled.right >= poiMsrAreaCentre.x)
|
|
|
- {
|
|
|
- // centre column field or centre field
|
|
|
- return TRUE;
|
|
|
- }
|
|
|
- else if (rectFiled.top <= poiMsrAreaCentre.y && rectFiled.bottom >= poiMsrAreaCentre.y)
|
|
|
- {
|
|
|
- // centre row field?
|
|
|
- return TRUE;
|
|
|
- }
|
|
|
- else if ( rectFiled.right <= poiMsrAreaCentre.x)
|
|
|
- {
|
|
|
- // on the left side
|
|
|
-
|
|
|
- //up
|
|
|
- if (rectFiled.top >= poiMsrAreaCentre.y)
|
|
|
- {
|
|
|
- // on the top left side, need to test the bottom right corner
|
|
|
- if (m_pMeasureArea->PtInDomain(CPoint(rectFiled.right, rectFiled.top)))
|
|
|
- {
|
|
|
- return TRUE;
|
|
|
- }
|
|
|
- }
|
|
|
- else if(rectFiled.bottom <= poiMsrAreaCentre.y) //down//
|
|
|
- {
|
|
|
- // on the bottom left side, need to test the top right corner
|
|
|
- if (m_pMeasureArea->PtInDomain(rectFiled.BottomRight()))
|
|
|
- {
|
|
|
- return TRUE;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- else if(rectFiled.left >= poiMsrAreaCentre.x)
|
|
|
- {
|
|
|
- // on the right side
|
|
|
-
|
|
|
- //up
|
|
|
- if (rectFiled.top >= poiMsrAreaCentre.y)
|
|
|
- {
|
|
|
- // on the top left side, need to test the bottom right corner
|
|
|
- if (m_pMeasureArea->PtInDomain(rectFiled.TopLeft()))
|
|
|
- {
|
|
|
- return TRUE;
|
|
|
- }
|
|
|
- }
|
|
|
- else if (rectFiled.bottom <= poiMsrAreaCentre.y) //down//
|
|
|
- {
|
|
|
- // on the bottom left side, need to test the top right corner
|
|
|
- if (m_pMeasureArea->PtInDomain(CPoint(rectFiled.left, rectFiled.bottom)))
|
|
|
- {
|
|
|
- return TRUE;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- // this field is not in the area at all, return FALSE.
|
|
|
+ //// get measure field centre
|
|
|
+ //CPoint poiMsrAreaCentre = m_pMeasureArea->GetDomainCenter();
|
|
|
+
|
|
|
+ //// move to left top postion.
|
|
|
+ //a_poiField -= CPoint(a_sizeImageSize.cx / 2, a_sizeImageSize.cy / 2);
|
|
|
+
|
|
|
+ //// rectangle of the field
|
|
|
+ //CRect rectFiled(a_poiField, a_sizeImageSize);
|
|
|
+
|
|
|
+ //// check field position
|
|
|
+ //if (rectFiled.left <= poiMsrAreaCentre.x && rectFiled.right >= poiMsrAreaCentre.x)
|
|
|
+ //{
|
|
|
+ // // centre column field or centre field
|
|
|
+ // return TRUE;
|
|
|
+ //}
|
|
|
+ //else if (rectFiled.top <= poiMsrAreaCentre.y && rectFiled.bottom >= poiMsrAreaCentre.y)
|
|
|
+ //{
|
|
|
+ // // centre row field?
|
|
|
+ // return TRUE;
|
|
|
+ //}
|
|
|
+ //else if ( rectFiled.right <= poiMsrAreaCentre.x)
|
|
|
+ //{
|
|
|
+ // // on the left side
|
|
|
+
|
|
|
+ // //up
|
|
|
+ // if (rectFiled.top >= poiMsrAreaCentre.y)
|
|
|
+ // {
|
|
|
+ // // on the top left side, need to test the bottom right corner
|
|
|
+ // if (m_pMeasureArea->PtInDomain(CPoint(rectFiled.right, rectFiled.top)))
|
|
|
+ // {
|
|
|
+ // return TRUE;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // else if(rectFiled.bottom <= poiMsrAreaCentre.y) //down//
|
|
|
+ // {
|
|
|
+ // // on the bottom left side, need to test the top right corner
|
|
|
+ // if (m_pMeasureArea->PtInDomain(rectFiled.BottomRight()))
|
|
|
+ // {
|
|
|
+ // return TRUE;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+
|
|
|
+ //}
|
|
|
+ //else if(rectFiled.left >= poiMsrAreaCentre.x)
|
|
|
+ //{
|
|
|
+ // // on the right side
|
|
|
+
|
|
|
+ // //up
|
|
|
+ // if (rectFiled.top >= poiMsrAreaCentre.y)
|
|
|
+ // {
|
|
|
+ // // on the top left side, need to test the bottom right corner
|
|
|
+ // if (m_pMeasureArea->PtInDomain(rectFiled.TopLeft()))
|
|
|
+ // {
|
|
|
+ // return TRUE;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // else if (rectFiled.bottom <= poiMsrAreaCentre.y) //down//
|
|
|
+ // {
|
|
|
+ // // on the bottom left side, need to test the top right corner
|
|
|
+ // if (m_pMeasureArea->PtInDomain(CPoint(rectFiled.left, rectFiled.bottom)))
|
|
|
+ // {
|
|
|
+ // return TRUE;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+
|
|
|
+ //}
|
|
|
+
|
|
|
+ // this field is not in the area , return FALSE.
|
|
|
return FALSE;
|
|
|
}
|
|
|
|