image_region.hxx 1.43 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
//
// Document layout viewer.
//
// Copyright (C) 2009 Florent D'Halluin.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// The complete GNU General Public Licence Notice can be found as the
// `COPYING' file in the root directory.
//

#ifndef   	IMAGE_REGION_HXX_
# define   	IMAGE_REGION_HXX_

# include "image_region.hh"

inline
void
ImageRegion::setOutline(bool outline)
{
  outline_ = outline;
Florent D'Halluin's avatar
Florent D'Halluin committed
25
  scene()->invalidate();
26
27
28
29
30
31
32
33
  update();
}

inline
void
ImageRegion::setPrecise(bool precise)
{
  precise_ = precise;
Florent D'Halluin's avatar
Florent D'Halluin committed
34
  scene()->invalidate();
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
  update();
}

inline
void
ImageRegion::setFill(bool fill)
{
  fill_ = fill;
  update();
}

inline
void
ImageRegion::setDraw(bool draw)
{
  draw_ = draw;
  update();
}

inline
void
ImageRegion::setDrawIfSameId(int id, bool draw)
{
  if (id == id_)
    draw_ = draw;
Florent D'Halluin's avatar
Florent D'Halluin committed
60
  scene()->invalidate();
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
  update();
}

inline
void
ImageRegion::setFillAlpha(int alpha)
{
  alpha_ = alpha;
  update();
}

inline
QRectF
ImageRegion::boundingRect() const
{
Florent D'Halluin's avatar
Florent D'Halluin committed
76
77
  if (selected_)
    return mapFromScene(scene()->sceneRect()).boundingRect();
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
  return rect_;
}

inline
QPainterPath
ImageRegion::shape() const
{
  return shape_;
}

inline
const QModelIndex&
ImageRegion::index() const
{
  return index_;
}

#endif	    /* !IMAGE_REGION_HXX_ */