Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
Geom::Zoom Class Reference

Combination of a translation and uniform scale. More...

#include <transforms.h>

Inheritance diagram for Geom::Zoom:
Geom::TransformOperations< Zoom >

Public Member Functions

 Zoom ()=default
 
 Zoom (Coord s)
 Construct a zoom from a scaling factor.
 
 Zoom (Point const &t)
 Construct a zoom from a translation.
 
 Zoom (Translate const &t)
 
 Zoom (Coord s, Point const &t)
 Construct a zoom from a scaling factor and a translation.
 
 Zoom (Coord s, Translate const &t)
 
 operator Affine () const
 
Zoomoperator*= (Zoom const &z)
 
bool operator== (Zoom const &z) const
 
Coord scale () const
 
void setScale (Coord s)
 
Point translation () const
 
void setTranslation (Point const &p)
 
Zoom inverse () const
 
- Public Member Functions inherited from Geom::TransformOperations< Zoom >
Affine operator* (T2 const &t) const
 

Static Public Member Functions

static Zoom identity ()
 
static Zoom map_rect (Rect const &old_r, Rect const &new_r)
 Zoom between rectangles.
 

Private Attributes

Coord _scale = 1
 
Point _trans
 

Friends

class Point
 
class Affine
 

Detailed Description

Combination of a translation and uniform scale.

The translation part is applied first, then the result is scaled from the new origin. This way when the class is used to accumulate a zoom transform, trans always points to the new origin in original coordinates.

Definition at line 290 of file transforms.h.

Constructor & Destructor Documentation

◆ Zoom() [1/6]

Geom::Zoom::Zoom ( )
default

Referenced by inverse().

◆ Zoom() [2/6]

Geom::Zoom::Zoom ( Coord  s)
inlineexplicit

Construct a zoom from a scaling factor.

Definition at line 298 of file transforms.h.

◆ Zoom() [3/6]

Geom::Zoom::Zoom ( Point const &  t)
inlineexplicit

Construct a zoom from a translation.

Definition at line 300 of file transforms.h.

◆ Zoom() [4/6]

Geom::Zoom::Zoom ( Translate const &  t)
inlineexplicit

Definition at line 301 of file transforms.h.

◆ Zoom() [5/6]

Geom::Zoom::Zoom ( Coord  s,
Point const &  t 
)
inline

Construct a zoom from a scaling factor and a translation.

Definition at line 303 of file transforms.h.

◆ Zoom() [6/6]

Geom::Zoom::Zoom ( Coord  s,
Translate const &  t 
)
inline

Definition at line 304 of file transforms.h.

Member Function Documentation

◆ identity()

static Zoom Geom::Zoom::identity ( )
inlinestatic

Definition at line 321 of file transforms.h.

Referenced by Geom::check_transforms().

◆ inverse()

Zoom Geom::Zoom::inverse ( ) const
inline

Definition at line 320 of file transforms.h.

References _scale, _trans, and Zoom().

◆ map_rect()

Zoom Geom::Zoom::map_rect ( Rect const &  old_r,
Rect const &  new_r 
)
static

Zoom between rectangles.

Given two rectangles, compute a zoom that maps one to the other. Rectangles are assumed to have the same aspect ratio.

Definition at line 46 of file transforms.cpp.

References _scale, _trans, Geom::GenericRect< C >::min(), and Geom::GenericRect< C >::width().

◆ operator Affine()

Geom::Zoom::operator Affine ( ) const
inline

Definition at line 306 of file transforms.h.

References _scale, _trans, Affine, Geom::X, and Geom::Y.

◆ operator*=()

Zoom & Geom::Zoom::operator*= ( Zoom const &  z)
inline

Definition at line 309 of file transforms.h.

References _scale, and _trans.

◆ operator==()

bool Geom::Zoom::operator== ( Zoom const &  z) const
inline

Definition at line 314 of file transforms.h.

References _scale, and _trans.

◆ scale()

Coord Geom::Zoom::scale ( ) const
inline

Definition at line 316 of file transforms.h.

References _scale.

Referenced by Geom::are_near(), Geom::Circle::operator*=(), and Geom::Ellipse::operator*=().

◆ setScale()

void Geom::Zoom::setScale ( Coord  s)
inline

Definition at line 317 of file transforms.h.

References _scale.

◆ setTranslation()

void Geom::Zoom::setTranslation ( Point const &  p)
inline

Definition at line 319 of file transforms.h.

References _trans.

◆ translation()

Point Geom::Zoom::translation ( ) const
inline

Definition at line 318 of file transforms.h.

References _trans.

Referenced by Geom::are_near().

Friends And Related Symbol Documentation

◆ Affine

friend class Affine
friend

Definition at line 325 of file transforms.h.

Referenced by operator Affine().

◆ Point

friend class Point
friend

Definition at line 324 of file transforms.h.

Member Data Documentation

◆ _scale

Coord Geom::Zoom::_scale = 1
private

◆ _trans


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