Scroom  0.14
TweakSelection Class Referenceabstract
Inheritance diagram for TweakSelection:
Inheritance graph
Collaboration diagram for TweakSelection:
Collaboration graph

Public Types

using Rectangle = Scroom::Utils::Rectangle< double >
 
- Public Types inherited from ITweakSelection
using Ptr = boost::shared_ptr< ITweakSelection >
 
using Point = Scroom::Utils::Point< double >
 

Public Member Functions

virtual Rectangle tweakSelection (Rectangle selection) const =0
 
Selection tweakSelection (Selection selection) const override
 
void setAspectRatio (Point aspectRatio_) override
 
- Public Member Functions inherited from Interface
 Interface ()=default
 
 Interface (const Interface &)=delete
 
Interfaceoperator= (const Interface &)=delete
 
 Interface (const Interface &&)=delete
 
Interfaceoperator= (const Interface &&)=delete
 
virtual ~Interface ()=default
 

Protected Member Functions

 TweakSelection (Point aspectRatio_)
 

Protected Attributes

Point aspectRatio
 

Member Typedef Documentation

◆ Rectangle

Constructor & Destructor Documentation

◆ TweakSelection()

TweakSelection::TweakSelection ( Point  aspectRatio_)
inlineexplicitprotected
199  : aspectRatio(aspectRatio_)
200  {
201  }

Member Function Documentation

◆ setAspectRatio()

void TweakSelection::setAspectRatio ( Point  aspectRatio_)
inlineoverridevirtual

Implements ITweakSelection.

195 { aspectRatio = aspectRatio_; }

◆ tweakSelection() [1/2]

virtual Rectangle TweakSelection::tweakSelection ( Rectangle  selection) const
pure virtual

Implemented in TweakPixelSelection, and TweakGridSelection.

Referenced by tweakSelection().

Here is the caller graph for this function:

◆ tweakSelection() [2/2]

Selection TweakSelection::tweakSelection ( Selection  selection) const
inlineoverridevirtual

Implements ITweakSelection.

182  {
183  const auto original = toRectangle(selection);
184  const auto tweaked = tweakSelection(original);
185 
186  const auto startCorner = find_closest_corner(selection.start, original);
187  const auto endCorner = find_opposed_corner(startCorner);
188 
189  const auto start = corner_getter(startCorner)(tweaked);
190  const auto end = corner_getter(endCorner)(tweaked);
191 
192  return {start, end};
193  }
Here is the call graph for this function:

Member Data Documentation

◆ aspectRatio

Point TweakSelection::aspectRatio
protected

The documentation for this class was generated from the following file:
toRectangle
Scroom::Utils::Rectangle< double > toRectangle(Selection s)
Definition: view.cc:162
TweakSelection::tweakSelection
virtual Rectangle tweakSelection(Rectangle selection) const =0
corner_getter
std::function< Scroom::Utils::Point< double >Scroom::Utils::Rectangle< double >)> corner_getter(Corner c)
Definition: view.cc:118
TweakSelection::aspectRatio
Point aspectRatio
Definition: view.cc:204
Selection::start
Point start
Definition: viewinterface.hh:44
find_opposed_corner
Corner find_opposed_corner(Corner c)
Definition: view.cc:146
find_closest_corner
Corner find_closest_corner(Scroom::Utils::Point< double > p, Scroom::Utils::Rectangle< double > r)
Definition: view.cc:134