Logo Search packages:      
Sourcecode: codeblocks version File versions  Download package

void wxPdfDocument::Arrow ( double  x1,
double  y1,
double  x2,
double  y2,
double  linewidth,
double  height,
double  width 
) [virtual]

Draws an arrow line between two points.

Parameters:
x1Abscissa of first point
y1Ordinate of first point
x2Abscissa of second point
y2Ordinate of second point
linewidthline width
heightheight of the arrow head
widthwidth of the arrow head
See also:
SetLineWidth(), SetDrawColor(), SetFillColor()

Definition at line 2197 of file pdfgraphics.cpp.

References Double2String(), Line(), m_h, m_k, m_lineWidth, OutAscii(), and SetLineWidth().

{
  double saveLineWidth = m_lineWidth;
  double dx = x2 - x1;
  double dy = y2 - y1;
  double dz = sqrt (dx*dx+dy*dy);
  double sina = dy / dz;
  double cosa = dx / dz;
  double x3 = x2 - cosa * height + sina * width;
  double y3 = y2 - sina * height - cosa * width;
  double x4 = x2 - cosa * height - sina * width;
  double y4 = y2 - sina * height + cosa * width;

  SetLineWidth(0.2);

  //Draw a arrow head
  OutAscii(Double2String( x2*m_k,2) + wxString(_T(" ")) +
           Double2String( (m_h-y2)*m_k,2) + wxString(_T(" m ")) +
           Double2String( x3*m_k,2) + wxString(_T(" ")) +
           Double2String( (m_h-y3)*m_k,2) + wxString(_T(" l ")) +
           Double2String( x4*m_k,2) + wxString(_T(" ")) +
           Double2String( (m_h-y4)*m_k,2) + wxString(_T(" l b")));

  SetLineWidth(linewidth);
  Line(x1+cosa*linewidth, y1+sina*linewidth, x2-cosa*height, y2-sina*height);
  SetLineWidth(saveLineWidth);
}

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index