예제 #1
0
void ToolSelectPoly::endPoly()
{
	this->endPaint();

	this->isSelecting = false;

	if( this->poly != NULL ){
		if( this->poly->getCount() > 3 ){
			if( this->mode == ICC_LASMOS ){
				delete this->poly->removeTail();
				this->setSelection(this->poly,true,true,true);
			}
			else {
				GraphicsPath *path = new GraphicsPath();
				path->AddLines(this->poly->toArray(),this->poly->getCount());
				path->Outline();
				this->setSelection(path,true,this->isCtrl);
			}
		}
	}
	else {
		this->setSelection(NULL,true);
	}

	this->resetOldPath();

	delete this->poly;
	this->poly = NULL;
}
예제 #2
0
void CLTriangle::SetRegion()
{
	PointF* pPt = m_ptary.GetData();
	Pen penDraw(Color(255, 0, 255, 0));
	penDraw.SetDashStyle(m_nDashStyle);
	penDraw.SetWidth((float)m_nWidth);
	
	GraphicsPath path;
	path.AddPolygon(pPt,m_nPtCount);
	path.Widen(&penDraw);
	path.Outline();

	m_Region.MakeEmpty();
	m_Region.Union(&path);
}
예제 #3
0
void CFlatBrushPen::SetRegion()
{
	ASSERT(m_bFinish);
	PointF* pPt = m_ptary.GetData();
	float fwidth = m_nWidth * m_fScale;

	Pen penDraw(m_crColor, fwidth);
	penDraw.ScaleTransform(1, 2.0f / fwidth, MatrixOrderAppend);
	penDraw.RotateTransform(m_ftransAngle, MatrixOrderAppend);

	GraphicsPath path;
	path.AddCurve(pPt, m_nPtCount);
	path.Widen(&penDraw);
	path.Outline();

	m_Region.MakeEmpty();
	m_Region.Union(&path);
}
예제 #4
0
void CTransparentPen::SetRegion()
{
	PointF* pPt = m_ptary.GetData();

	Pen penDraw(m_crColor);
	penDraw.SetStartCap(LineCapRound);
	penDraw.SetEndCap(LineCapRound);
	penDraw.SetLineJoin(LineJoinRound);
	penDraw.SetWidth(m_nWidth * m_fScale);

	GraphicsPath path;
	path.AddCurve(pPt,m_nPtCount,0.8f);
	path.Widen(&penDraw);
	path.Outline();

	m_Region.MakeEmpty();
	m_Region.Union(&path);
}
예제 #5
0
void CTriangle::SetRegion()
{
	PointF* pPt = m_ptary.GetData();

	int nWidth = m_nWidth;
	if(m_nWidth < 6)
	{
		nWidth = 6;
	}

	Pen greenPen(Color(255, 0, 255,  0), (float)nWidth);
	GraphicsPath path;
	path.AddPolygon(pPt,m_nPtCount);
	path.Widen(&greenPen);
	path.Outline();

	m_Region.MakeEmpty();
	m_Region.Union(&path);
}
예제 #6
0
void CNormalPen::SetRegion()
{
	ASSERT(m_bFinish);
	PointF* pPt = m_ptary.GetData();
	Pen penDraw(m_crColor);
	penDraw.SetWidth(m_nWidth * m_fScale);

	penDraw.SetEndCap(m_nEndCap);
	penDraw.SetStartCap(m_nStartCap);
	penDraw.SetDashStyle(m_nDashStyle);
	penDraw.SetLineJoin(LineJoinRound);

	GraphicsPath path;
	path.AddCurve(pPt,m_nPtCount);
	path.Widen(&penDraw);
	path.Outline();

	m_Region.MakeEmpty();
	m_Region.Union(&path);
}
예제 #7
0
void CRectangle::SetRegion()
{
	float left = min(m_ptary[0].X,m_ptary[1].X);
	float top = min(m_ptary[0].Y,m_ptary[1].Y);
	float width = fabs(m_ptary[0].X - m_ptary[1].X);
	float height = fabs(m_ptary[0].Y - m_ptary[1].Y);
	/*PointF* pPt = m_ptary.GetData();*/

	int nWidth = m_nWidth;
	if(m_nWidth < 6)
	{
		nWidth = 6;
	}

	Pen greenPen(Color(255, 0, 255,  0), (float)nWidth);
	GraphicsPath path;
	if(RS_ROUND == m_nRStyle)
	{
		CRect rc((int)left,(int)top,(int)(left + width),(int)(top + height));
		INT offsetX = (rc.right - rc.left) * 20/100;  
		INT offsetY = (rc.bottom - rc.top) * 20/100;
		path.AddArc(rc.right - offsetX, rc.top, offsetX, offsetY, 270, 90);
		path.AddArc(rc.right - offsetX, rc.bottom - offsetY, offsetX, offsetY, 0, 90);
		path.AddArc(rc.left, rc.bottom - offsetY, offsetX, offsetY, 90, 90);
		path.AddArc(rc.left, rc.top, offsetX, offsetY, 180, 90);
		path.AddLine(rc.left + offsetX, rc.top, rc.right - offsetX/2, rc.top);
	}
	else
	{

		RectF rcf(left,top,width,height);
		path.AddRectangle(rcf);
	}

	path.Widen(&greenPen);
	path.Outline();

	m_Region.MakeEmpty();
	m_Region.Union(&path);
}
예제 #8
0
void CAngleLabel::SetRegion()
{
	PointF* pPt = m_ptary.GetData();

	PointF ptd[3];
	ptd[0] = pPt[1];
	ptd[1] = pPt[0];
	ptd[2] = pPt[2];

	Pen penDraw(Color(255, 0, 255, 0));
	penDraw.SetDashStyle(m_nDashStyle);
	penDraw.SetWidth((float)m_nWidth);
	
	GraphicsPath path;
	path.AddLines(ptd, m_nPtCount);

	path.Widen(&penDraw);
	path.Outline();

	m_Region.MakeEmpty();
	m_Region.Union(&path);
}
예제 #9
0
void CNormalPen::SetRegion()
{
	PointF* pPt = m_ptary.GetData();

	int nWidth = m_nWidth;
	if(m_nWidth < 3)
	{
		nWidth = 3;
	}

	Pen penDraw(m_crColor,(float)nWidth);
	penDraw.SetDashStyle(m_nDashStyle);
	penDraw.SetStartCap(m_nStartCap);
	penDraw.SetEndCap(m_nEndCap);
	penDraw.SetLineJoin(LineJoinRound);

	GraphicsPath path;
	path.AddCurve(pPt,m_nPtCount);
	path.Widen(&penDraw);
	path.Outline();

	m_Region.MakeEmpty();
	m_Region.Union(&path);
}