Reference Manual

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

# Inti::Gdk::Segment Class Reference

A GdkSegment C++ wrapper class. More...

`#include <inti/gdk/types.h>`

List of all members.

## Public Member Functions

Constructors

- Segment ()
    Constructs an empty segment with x1, y1, x2 and y2 all set to 0.
- Segment (int x1, int y1, int x2, int y2)
    Construct a new segment.
- Segment (const Point &start, const Point &end)
    Construct a new segemnt.

Accessors

- GdkSegment * gdk_segment () const
    Get a pointer to the GdkSegment structure.
- operator GdkSegment * () const
    Conversion operator; safely converts a Segment to a GdkSegment pointer.
- int x1 () const
    Returns the X coordinate of the starting point of the segment.
- int y1 () const
    Returns the Y coordinate of the starting point of the segment.
- int x2 () const
    Returns the X coordinate of the end point of the segment.
- int y2 () const
    Returns the Y coordinate of the end point of the segment.
- bool equal (const Segment &other) const
    Returns true if this segment and other compare equal.
- bool operator== (const Segment &other) const
    Returns true if this segment and other compare equal.
- bool operator!= (const Segment &other) const
    Returns true if this segment and other compare unequal.

Methods

- void set (int x1, int y1, int x2, int y2)
    Sets the coordinates for the segment.
- void set (const Point &start, const Point &end)
    Sets the coordinates for the segment.
- void set_start (int x, int y)
    Sets the start coordinates of the segment.
- void set_start (const Point &point)
    Sets the start coordinates of the segment.
- void set_end (int x, int y)
    Sets the end coordinates of the segment.
- void set_end (const Point &point)
    Sets the end coordinates of the segment.

## Detailed Description

A GdkSegment C++ wrapper class.

Segment specifies the start and end point of a line for use by the Gdk::Drawable::draw_segments() method. Segment uses default copy, assignment and destruction.

## Constructor & Destructor Documentation

Inti::Gdk::Segment::Segment | ( | int | x1,
|  | int | y1,
|  | int | x2,
|  | int | y2
| ) |

Construct a new segment.

Parameters:

  x1 | The X coordinate at the start of the segment.
  y1 | The Y coordinate at the start of the segment.
  x2 | The X coordinate at the end of the segment.
  y2 | The Y coordinate at the end of the segment.

Inti::Gdk::Segment::Segment | ( | const Point & | start,
|  | const Point & | end
| ) |

Construct a new segemnt.

Parameters:

  start | The x, y coordinates at the start of the segment.
  end | The x, y coordinates at the end of the segment.

## Member Function Documentation

bool Inti::Gdk::Segment::equal | ( | const Segment & | other | ) | const

Returns true if this segment and other compare equal.

Parameters:

  other | A Segment.

bool Inti::Gdk::Segment::operator!= | ( | const Segment & | other | ) | const

Returns true if this segment and other compare unequal.

Parameters:

  other | A Segment.

bool Inti::Gdk::Segment::operator== | ( | const Segment & | other | ) | const

Returns true if this segment and other compare equal.

Parameters:

  other | A Segment.

void Inti::Gdk::Segment::set | ( | const Point & | start,
|  | const Point & | end
| ) |

Sets the coordinates for the segment.

Parameters:

  start | The x, y coordinates at the start of the segment.
  end | The x, y coordinates at the end of the segment.

void Inti::Gdk::Segment::set | ( | int | x1,
|  | int | y1,
|  | int | x2,
|  | int | y2
| ) |

Sets the coordinates for the segment.

Parameters:

  x1 | The X coordinate at the start of the segment.
  y1 | The Y coordinate at the start of the segment.
  x2 | The X coordinate at the end of the segment.
  y2 | The Y coordinate at the end of the segment.

void Inti::Gdk::Segment::set_end | ( | const Point & | point | ) |

Sets the end coordinates of the segment.

Parameters:

  point | The x, y coordinates at the end of the segment.

void Inti::Gdk::Segment::set_end | ( | int | x,
|  | int | y
| ) |

Sets the end coordinates of the segment.

Parameters:

  x | The X coordinate at the end of the segment.
  y | The Y coordinate at the end of the segment.

void Inti::Gdk::Segment::set_start | ( | const Point & | point | ) |

Sets the start coordinates of the segment.

Parameters:

  point | The x, y coordinates at the start of the segment.

void Inti::Gdk::Segment::set_start | ( | int | x,
|  | int | y
| ) |

Sets the start coordinates of the segment.

Parameters:

  x | The X coordinate at the start of the segment.
  y | The Y coordinate at the start of the segment.

The documentation for this class was generated from the following file:

- gdk/types.h

Main Page - Footer