Scroom  0.14
Selection Struct Reference

#include <viewinterface.hh>

Collaboration diagram for Selection:
Collaboration graph

Public Types

using Point = Scroom::Utils::Point< double >
 

Public Member Functions

 Selection (double x, double y)
 
 Selection (Point point)
 
 Selection (Point start_, Point end_)
 
Selectionoperator= (const Point &p)
 
double width () const
 
double height () const
 
double length () const
 

Public Attributes

Point start
 
Point end
 

Detailed Description

Structure that represents a selection made by the user.

Member Typedef Documentation

◆ Point

Constructor & Destructor Documentation

◆ Selection() [1/3]

Selection::Selection ( double  x,
double  y 
)
inline
50  {
51  }

◆ Selection() [2/3]

Selection::Selection ( Point  point)
inlineexplicit
54  : Selection(point, point)
55  {
56  }

◆ Selection() [3/3]

Selection::Selection ( Point  start_,
Point  end_ 
)
inline
59  : start(start_)
60  , end(end_)
61  {
62  }

Member Function Documentation

◆ height()

double Selection::height ( ) const
inline
72 { return abs(end.y - start.y); }

Referenced by MeasureHandler::displayMeasurement(), and length().

Here is the caller graph for this function:

◆ length()

double Selection::length ( ) const
inline
73 { return std::hypot(width(), height()); }

Referenced by MeasureHandler::displayMeasurement().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=()

Selection& Selection::operator= ( const Point p)
inline
65  {
66  start = p;
67  end = p;
68  return *this;
69  }

◆ width()

double Selection::width ( ) const
inline
71 { return abs(end.x - start.x); }

Referenced by MeasureHandler::displayMeasurement(), and length().

Here is the caller graph for this function:

Member Data Documentation

◆ end

◆ start


The documentation for this struct was generated from the following file:
Selection::width
double width() const
Definition: viewinterface.hh:71
Scroom::Utils::Point::x
value_type x
Definition: point.hh:111
Scroom::Utils::make_point
Point< T > make_point(T x, T y)
Definition: point.hh:116
Selection::start
Point start
Definition: viewinterface.hh:44
Selection::height
double height() const
Definition: viewinterface.hh:72
Scroom::Utils::Point::y
value_type y
Definition: point.hh:112
Selection::end
Point end
Definition: viewinterface.hh:45
Selection::Selection
Selection(double x, double y)
Definition: viewinterface.hh:48