Geom::OptInterval Class Reference

OptInterval is an Interval that can be empty. More...

#include <interval.h>

List of all members.

Public Member Functions

 OptInterval ()
 OptInterval (Interval const &a)
 OptInterval (Coord u)
 OptInterval (Coord u, Coord v)
bool isEmpty ()
 Check whether this OptInterval is empty or not.
void unionWith (const OptInterval &a)
 If this is empty, copy argument a.

Detailed Description

OptInterval is an Interval that can be empty.

Definition at line 231 of file interval.h.


Constructor & Destructor Documentation

Geom::OptInterval::OptInterval (  )  [inline]

Definition at line 233 of file interval.h.

: boost::optional<Interval>() {};

Geom::OptInterval::OptInterval ( Interval const &  a  )  [inline]

Definition at line 234 of file interval.h.

: boost::optional<Interval>(a) {};

Geom::OptInterval::OptInterval ( Coord  u  )  [inline]

Definition at line 235 of file interval.h.

: boost::optional<Interval>(Interval(u)) {};

Geom::OptInterval::OptInterval ( Coord  u,
Coord  v 
) [inline]

Definition at line 236 of file interval.h.

: boost::optional<Interval>(Interval(u,v)) {};


Member Function Documentation

bool Geom::OptInterval::isEmpty (  )  [inline]

Check whether this OptInterval is empty or not.

Definition at line 241 of file interval.h.

{ return (*this == false); };

void Geom::OptInterval::unionWith ( const OptInterval a  )  [inline]

If this is empty, copy argument a.

Otherwise, union with it (and do nothing when a is empty)

Definition at line 246 of file interval.h.

Referenced by Inkscape::UI::ControlPointSelection::align(), and Inkscape::UI::ControlPointSelection::distribute().

                                                 {
        if (a) {
            if (*this) { // check that we are not empty
                (*this)->unionWith(*a);
            } else {
                *this = a;
            }
        }
    }


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