Old fashion design for PC-104
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
//----------------------------------------------------------------------------
// Laser Guard Ltd.
// Copyright � 2000-2002. All Rights Reserved.
// Version 1.0 11/05/2000
// Last modification: 08/10/2003
// Project Intruder Position Indicator
// SUBSYSTEM: Polygon
// FILE: Polygon.h
// AUTHOR: Chizhevskiy Sergey
// OVERVIEW
// ~~~~~~~~
// Header file of class CPolygon
//----------------------------------------------------------------------------
#ifndef __POLYGON__H__INCLUDED__
#define __POLYGON__H__INCLUDED__
class CPolygon {public: CPolygon(INT type); CPolygon(HANDLE hFile); ~CPolygon();
CPolygon& operator = (const CPolygon& polygon); LPPOINT operator[] (INT index);
public: void SetVisible(BOOL fVisible); BOOL Save(HANDLE hFile); BOOL Load(HANDLE hFile); void Draw(HDC hDC, POINT& center, const double& scale, double dZeroShift ); void Empty(); BOOL AddPoint(LPPOINT pPoint, const double& diff);
BOOL PtInPolygon(POINT &point) const; HRGN GetSafeHrgn() const; LPPOINT GetPoints() const; INT GetCount() const; INT GetType() const;
private: LPPOINT m_pPoints; LPPOINT m_pPointsDraw; BOOL m_fVisible; HRGN m_hRgn; INT m_nCount; INT m_Type;
};
inlineLPPOINT CPolygon::operator[] (INT index){ return m_nCount > index ? m_pPoints + index : NULL;}
inlineLPPOINT CPolygon::GetPoints() const{ return m_pPoints; }
inlineINT CPolygon::GetCount() const{ return m_nCount; }
inlineINT CPolygon::GetType() const{ return m_Type; }
inlineBOOL CPolygon::PtInPolygon(POINT & point) const{ return m_hRgn ? ::PtInRegion(m_hRgn, point.x, point.y) : FALSE;}
inlineHRGN CPolygon::GetSafeHrgn() const{ return m_hRgn;}
class CPolygons {public: CPolygons(); ~CPolygons();
CPolygon* operator[](INT index);
void SetVisible(INT nType, BOOL fVisible); void SetRayCount(INT nRays); void ProduceHiddenZones(HDC hDC, POINT& center, double range, const double& scale, double dZeroShift ); BOOL Delete(POINT& p); void Draw(HDC hDC, POINT& center, const double& scale, double dZeroShift ); BOOL AddPolygon(CPolygon *pPolygon); BOOL PtInPolygons(POINT &point, BOOL *pFlags) const; BOOL Save(LPCTSTR pName); BOOL Load(LPCTSTR pName); void Empty();
INT GetCount() const;
private: CRITICAL_SECTION cs; // 24/05/2001
CPolygon** m_pPolygons; INT m_nCount; INT m_nRayCount;
};
inlineCPolygon* CPolygons::operator[] (INT index){ return m_nCount > index ? m_pPolygons[index] : NULL;}
inlineINT CPolygons::GetCount() const{ return m_nCount; }
inlinevoid CPolygons::SetRayCount(INT nRays){ m_nRayCount = nRays;}
inlinevoid CPolygon::SetVisible(BOOL fVisible){ m_fVisible = fVisible;}
#endif
|