Scroom 0.14-48-ga0fee447
Loading...
Searching...
No Matches
Scroom::Utils::TweakRulers Class Reference

#include <tweak-view.hh>

Inheritance diagram for Scroom::Utils::TweakRulers:
Inheritance graph
Collaboration diagram for Scroom::Utils::TweakRulers:
Collaboration graph

Public Types

using Ptr = std::shared_ptr< TweakRulers >
 
- Public Types inherited from Scroom::Utils::ITweakRulers
using Ptr = std::shared_ptr< ITweakRulers >
 

Public Member Functions

Rectangle< double > tweakRulers (const Point< double > &currentPosition, const Point< int > &drawingAreaSize, int zoom) const override
 
- Public Member Functions inherited from Interface
 Interface ()=default
 
 Interface (const Interface &)=delete
 
Interfaceoperator= (const Interface &)=delete
 
 Interface (Interface &&)=delete
 
Interfaceoperator= (Interface &&)=delete
 
virtual ~Interface ()=default
 

Static Public Member Functions

static ITweakRulers::Ptr create (const Point< double > &aspectRatio_={1.0, 1.0})
 

Private Member Functions

 TweakRulers (const Point< double > &aspectRatio_)
 

Private Attributes

Point< double > aspectRatio
 

Member Typedef Documentation

◆ Ptr

using Scroom::Utils::TweakRulers::Ptr = std::shared_ptr<TweakRulers>

Constructor & Destructor Documentation

◆ TweakRulers()

Scroom::Utils::TweakRulers::TweakRulers ( const Point< double > &  aspectRatio_)
explicitprivate
118 : aspectRatio(aspectRatio_)
119 {
120 }
Point< double > aspectRatio
Definition tweak-view.hh:101

Member Function Documentation

◆ create()

ITweakRulers::Ptr Scroom::Utils::TweakRulers::create ( const Point< double > &  aspectRatio_ = {1.0, 1.0})
static
122{ return Ptr(new TweakRulers(aspectRatio_)); }
std::shared_ptr< TweakRulers > Ptr
Definition tweak-view.hh:90
TweakRulers(const Point< double > &aspectRatio_)
Definition tweak-view.cc:117

Referenced by Scroom::Utils::getDefaultTweakRulers(), and TransformPresentation::TransformPresentation().

Here is the caller graph for this function:

◆ tweakRulers()

Rectangle< double > Scroom::Utils::TweakRulers::tweakRulers ( const Point< double > &  currentPosition,
const Point< int > &  drawingAreaSize,
int  zoom 
) const
overridevirtual

Implements Scroom::Utils::ITweakRulers.

126 {
127 return make_rect(currentPosition, drawingAreaSize.to<double>() / pixelSizeFromZoom(zoom)) / aspectRatio;
128 }
double pixelSizeFromZoom(int zoom)
Definition cairo-helpers.cc:123
Point< U > to() const
Definition point.hh:103
Rectangle< T > make_rect(T x, T y, T width, T height)
Definition rectangle.hh:284
Here is the call graph for this function:

Member Data Documentation

◆ aspectRatio

Point<double> Scroom::Utils::TweakRulers::aspectRatio
private

Referenced by tweakRulers().


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