void CLogoMarkerSymbol::CalcCoords(double dX, double dY)
{
	//This function calculates the required coordinates for each symbol
	//based on the feature's geometry.  These coordinates are in Device units
	double dVal;
	dVal = sqrt(pow(m_dDeviceRadius, 2) / 2.0);
	//We account for the offset in the calculation of the center point. All other
  //points are then calculated from this.  Y coordinates are top to bottom in Y axis.
  m_ptCoords[1].x = lround(dX + m_dDeviceXOffset);
  m_ptCoords[1].y = lround(dY - m_dDeviceYOffset);

  m_ptCoords[0].x = lround(m_ptCoords[1].x - dVal);
  m_ptCoords[0].y = lround(m_ptCoords[1].y - dVal);
  m_ptCoords[3].x = lround(m_ptCoords[1].x + dVal);
  m_ptCoords[3].y = lround(m_ptCoords[1].y + dVal);
  m_ptCoords[2].x = m_ptCoords[0].x;
  m_ptCoords[2].y = m_ptCoords[3].y;
  m_ptCoords[4].x = lround(m_ptCoords[1].x - m_dDeviceRadius);
  m_ptCoords[4].y = lround(m_ptCoords[1].y - m_dDeviceRadius);
  m_ptCoords[5].x = lround(m_ptCoords[1].x + m_dDeviceRadius);
  m_ptCoords[5].y = lround(m_ptCoords[1].y + m_dDeviceRadius);

  RotateCoords();

}
		void CSimpleMarketSymbol::DrawCross(const GPoint& point, IGraphics* pGraphics)
		{
			GPoint coord[4];
			coord[0].x = point.x + m_dDeviceOffsetX;
			coord[0].y = point.y - m_dDeviceSize + m_dDeviceOffsetY;

			coord[1].x = point.x + m_dDeviceOffsetX;
			coord[1].y = point.y + m_dDeviceSize + 1 + m_dDeviceOffsetY;

			coord[2].x = point.x - m_dDeviceSize + m_dDeviceOffsetX;
			coord[2].y = point.y + m_dDeviceOffsetY;

			coord[3].x = point.x + m_dDeviceSize + m_dDeviceOffsetX;
			coord[3].y = point.y + m_dDeviceOffsetY;

			GUnits centerX = point.x + m_dDeviceOffsetX;
			GUnits centerY = point.y + m_dDeviceOffsetY;

			RotateCoords(point, m_dDisplayAngle, coord, 4);

			if (m_bIsOutline)
			{ 
				pGraphics->DrawLineSeg(&m_outlinePen, coord[0], coord[1]);
				pGraphics->DrawLineSeg(&m_outlinePen, coord[2].x, coord[2].y,centerX,centerY);
				pGraphics->DrawLineSeg(&m_outlinePen, coord[3].x, coord[3].y,centerX,centerY);
			}

			pGraphics->DrawLineSeg(&m_outlinePen, coord[0], coord[1]);
			pGraphics->DrawLineSeg(&m_outlinePen, coord[2].x, coord[2].y,centerX,centerY);
			pGraphics->DrawLineSeg(&m_outlinePen, coord[3].x, coord[3].y,centerX,centerY);
		}
		void CSimpleMarketSymbol::DrawDiamond(const GPoint& point, IGraphics* pGraphics)
		{
			GUnits centerX = point.x + m_dDeviceOffsetX;
			GUnits centerY = point.y + m_dDeviceOffsetY;

			GPoint coord[5];
			coord[0].x = centerX;
			coord[0].y = point.y - m_dDeviceSize + m_dDeviceOffsetY;

			coord[1].x = point.x - m_dDeviceSize + m_dDeviceOffsetX;
			coord[1].y = centerY;

			coord[2].x = centerX;
			coord[2].y = point.y + m_dDeviceSize + m_dDeviceOffsetY;

			coord[3].x = point.x + m_dDeviceSize + m_dDeviceOffsetX;
			coord[3].y = centerY;

			coord[4].x = centerX;
			coord[4].y = point.y - m_dDeviceSize + m_dDeviceOffsetY;

			RotateCoords(point, m_dDisplayAngle, coord, 5);

			pGraphics->DrawPolygon(&m_outlinePen, &m_brush, coord, 5);
		}
Exemple #4
0
void BBWin8Game::TouchEvent( int event,int data,float x,float y ){
	RotateCoords( x,y );
	BBGame::TouchEvent( event,data,x,y );
}