NPlot::ArrowItem Class Reference

An Arrow IDrawable, with a text label that is automatically nicely positioned at the non-pointy end of the arrow. More...

Inheritance diagram for NPlot::ArrowItem:

NPlot::IDrawable List of all members.

Public Member Functions

 ArrowItem (PointD position)
 Default constructor : text = "" angle = 45 degrees anticlockwise from horizontal.
 ArrowItem (PointD position, double angle)
 Constructor.
 ArrowItem (PointD position, double angle, string text)
 Constructor.
void Draw (System.Drawing.Graphics g, PhysicalAxis xAxis, PhysicalAxis yAxis)
 Draws the arrow on a plot surface.

Properties

string Text
 Text associated with the arrow.
string text_ = ""
double Angle
 Angle of arrow anti-clockwise to right horizontal in degrees.
double angle_ = -45.0
float PhysicalLength
 Physical length of the arrow.
float physicalLength_ = 40.0f
PointD To
 The point the arrow points to.
PointD to_
float HeadSize
 Size of the arrow head sides in pixels.
float headSize_ = 10.0f
float HeadAngle
 angle between sides of arrow head in degrees
float headAngle_ = 40.0f
Brush TextBrush
 The brush used to draw the text associated with the arrow.
Color TextColor
 Set the text to be drawn with a solid brush of this color.
Color ArrowColor
 The color of the pen used to draw the arrow.
Font TextFont
 The font used to draw the text associated with the arrow.
int HeadOffset
 Offset the whole arrow back in the arrow direction this many pixels from the point it's pointing to.
int headOffset_ = 2
Brush arrowBrush_ = new SolidBrush( Color.Black )
Brush textBrush_ = new SolidBrush( Color.Black )
Pen pen_ = new Pen( Color.Black )
Font font_

Private Member Functions

void Init ()

Detailed Description

An Arrow IDrawable, with a text label that is automatically nicely positioned at the non-pointy end of the arrow.

Future feature idea: have constructor that takes a dataset, and have the arrow know how to automatically set it's angle to avoid the data.

Definition at line 65 of file ArrowItem.cs.


Constructor & Destructor Documentation

NPlot::ArrowItem::ArrowItem PointD  position  )  [inline]
 

Default constructor : text = "" angle = 45 degrees anticlockwise from horizontal.

Parameters:
position The position the arrow points to.

Definition at line 81 of file ArrowItem.cs.

References Init(), and to_.

NPlot::ArrowItem::ArrowItem PointD  position,
double  angle
[inline]
 

Constructor.

Parameters:
position The position the arrow points to.
angle angle of arrow with respect to x axis.

Definition at line 93 of file ArrowItem.cs.

References angle_, Init(), and to_.

NPlot::ArrowItem::ArrowItem PointD  position,
double  angle,
string  text
[inline]
 

Constructor.

Parameters:
position The position the arrow points to.
angle angle of arrow with respect to x axis.
text The text associated with the arrow.

Definition at line 107 of file ArrowItem.cs.

References angle_, Init(), text_, and to_.


Member Function Documentation

void NPlot::ArrowItem::Draw System.Drawing.Graphics  g,
PhysicalAxis  xAxis,
PhysicalAxis  yAxis
[inline]
 

Draws the arrow on a plot surface.

Parameters:
g graphics surface on which to draw
xAxis The X-Axis to draw against.
yAxis The Y-Axis to draw against.

Definition at line 230 of file ArrowItem.cs.

References angle_, arrowBrush_, NPlot::PhysicalAxis::Axis, font_, headAngle_, headOffset_, headSize_, pen_, physicalLength_, text_, TextBrush, textBrush_, To, to_, NPlot::Axis::WorldMax, NPlot::Axis::WorldMin, NPlot::PhysicalAxis::WorldToPhysical(), NPlot::PointD::X, and NPlot::PointD::Y.

void NPlot::ArrowItem::Init  )  [inline, private]
 

Definition at line 68 of file ArrowItem.cs.

References font_.

Referenced by ArrowItem().


Property Documentation

double NPlot::ArrowItem::Angle [get, set]
 

Angle of arrow anti-clockwise to right horizontal in degrees.

The code relating to this property in the Draw method is a bit weird. Internally, all rotations are clockwise [this is by accient, I wasn't concentrating when I was doing it and was half done before I realised]. The simplest way to make angle represent anti-clockwise rotation (as it is normal to do) is to make the get and set methods negate the provided value.

Definition at line 143 of file ArrowItem.cs.

double NPlot::ArrowItem::angle_ = -45.0 [private]
 

Definition at line 153 of file ArrowItem.cs.

Referenced by ArrowItem(), and Draw().

Brush NPlot::ArrowItem::arrowBrush_ = new SolidBrush( Color.Black ) [private]
 

Definition at line 450 of file ArrowItem.cs.

Referenced by Draw().

Color NPlot::ArrowItem::ArrowColor [get, set]
 

The color of the pen used to draw the arrow.

Definition at line 404 of file ArrowItem.cs.

Font NPlot::ArrowItem::font_ [private]
 

Definition at line 453 of file ArrowItem.cs.

Referenced by Draw(), and Init().

float NPlot::ArrowItem::HeadAngle [get, set]
 

angle between sides of arrow head in degrees

Definition at line 211 of file ArrowItem.cs.

float NPlot::ArrowItem::headAngle_ = 40.0f [private]
 

Definition at line 221 of file ArrowItem.cs.

Referenced by Draw().

int NPlot::ArrowItem::HeadOffset [get, set]
 

Offset the whole arrow back in the arrow direction this many pixels from the point it's pointing to.

Definition at line 437 of file ArrowItem.cs.

int NPlot::ArrowItem::headOffset_ = 2 [private]
 

Definition at line 447 of file ArrowItem.cs.

Referenced by Draw().

float NPlot::ArrowItem::HeadSize [get, set]
 

Size of the arrow head sides in pixels.

Definition at line 194 of file ArrowItem.cs.

float NPlot::ArrowItem::headSize_ = 10.0f [private]
 

Definition at line 204 of file ArrowItem.cs.

Referenced by Draw().

Pen NPlot::ArrowItem::pen_ = new Pen( Color.Black ) [private]
 

Definition at line 452 of file ArrowItem.cs.

Referenced by Draw().

float NPlot::ArrowItem::PhysicalLength [get, set]
 

Physical length of the arrow.

Definition at line 160 of file ArrowItem.cs.

float NPlot::ArrowItem::physicalLength_ = 40.0f [private]
 

Definition at line 170 of file ArrowItem.cs.

Referenced by Draw().

string NPlot::ArrowItem::Text [get, set]
 

Text associated with the arrow.

Definition at line 120 of file ArrowItem.cs.

string NPlot::ArrowItem::text_ = "" [private]
 

Definition at line 130 of file ArrowItem.cs.

Referenced by ArrowItem(), and Draw().

Brush NPlot::ArrowItem::TextBrush [get, set]
 

The brush used to draw the text associated with the arrow.

Definition at line 376 of file ArrowItem.cs.

Referenced by Draw().

Brush NPlot::ArrowItem::textBrush_ = new SolidBrush( Color.Black ) [private]
 

Definition at line 451 of file ArrowItem.cs.

Referenced by Draw().

Color NPlot::ArrowItem::TextColor [set]
 

Set the text to be drawn with a solid brush of this color.

Definition at line 392 of file ArrowItem.cs.

Font NPlot::ArrowItem::TextFont [get, set]
 

The font used to draw the text associated with the arrow.

Definition at line 421 of file ArrowItem.cs.

PointD NPlot::ArrowItem::To [get, set]
 

The point the arrow points to.

Definition at line 177 of file ArrowItem.cs.

Referenced by Draw().

PointD NPlot::ArrowItem::to_ [private]
 

Definition at line 187 of file ArrowItem.cs.

Referenced by ArrowItem(), and Draw().


The documentation for this class was generated from the following file:
Generated on Sat Nov 5 01:04:07 2005 for NPlot by  doxygen 1.4.5