• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdegraphics API Reference
  • KDE Home
  • Contact Us
 

okular

  • sources
  • kde-4.12
  • kdegraphics
  • okular
  • core
area.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2004-05 by Enrico Ros <eros.kde@email.it> *
3  * Copyright (C) 2005 by Piotr Szymanski <niedakh@gmail.com> *
4  * This program is free software; you can redistribute it and/or modify *
5  * it under the terms of the GNU General Public License as published by *
6  * the Free Software Foundation; either version 2 of the License, or *
7  * (at your option) any later version. *
8  ***************************************************************************/
9 
10 #include "area.h"
11 
12 #include <QtCore/QRect>
13 #include <QtGui/QPolygonF>
14 #include <kdebug.h>
15 
16 #include <math.h>
17 
18 #include "action.h"
19 #include "annotations.h"
20 #include "annotations_p.h"
21 #include "debug_p.h"
22 #include "sourcereference.h"
23 
24 using namespace Okular;
25 
27 NormalizedPoint::NormalizedPoint()
28  : x( 0.0 ), y( 0.0 ) {}
29 
30 NormalizedPoint::NormalizedPoint( double dX, double dY )
31  : x( dX ), y( dY ) {}
32 
33 NormalizedPoint::NormalizedPoint( int iX, int iY, int xScale, int yScale )
34  : x( (double)iX / (double)xScale ), y( (double)iY / (double)yScale ) {}
35 
36 NormalizedPoint& NormalizedPoint::operator=( const NormalizedPoint & p )
37 {
38  x = p.x;
39  y = p.y;
40  return *this;
41 }
42 
43 void NormalizedPoint::transform( const QTransform &matrix )
44 {
45  qreal tmp_x = (qreal)x;
46  qreal tmp_y = (qreal)y;
47  matrix.map( tmp_x, tmp_y, &tmp_x, &tmp_y );
48  x = tmp_x;
49  y = tmp_y;
50 }
51 
52 double NormalizedPoint::distanceSqr( double x, double y, double xScale, double yScale ) const
53 {
54  return pow( (this->x - x) * xScale, 2 ) + pow( (this->y - y) * yScale, 2 );
55 }
56 
61 NormalizedPoint operator-( const NormalizedPoint& a, const NormalizedPoint& b )
62 {
63  return NormalizedPoint( a.x - b.x, a.y - b.y );
64 }
65 
69 double NormalizedPoint::distanceSqr( double x, double y, double xScale, double yScale, const NormalizedPoint& start, const NormalizedPoint& end )
70 {
71  NormalizedPoint point( x, y );
72  double thisDistance;
73  NormalizedPoint lineSegment( end - start );
74  const double lengthSqr = pow( lineSegment.x, 2 ) + pow( lineSegment.y, 2 );
75 
76  //if the length of the current segment is null, we can just
77  //measure the distance to either end point
78  if ( lengthSqr == 0.0 )
79  {
80  thisDistance = end.distanceSqr( x, y, xScale, yScale );
81  }
82  else
83  {
84  //vector from the start point of the current line segment to the measurement point
85  NormalizedPoint a = point - start;
86  //vector from the same start point to the end point of the current line segment
87  NormalizedPoint b = end - start;
88 
89  //we're using a * b (dot product) := |a| * |b| * cos(phi) and the knowledge
90  //that cos(phi) is adjacent side / hypotenuse (hypotenuse = |b|)
91  //therefore, t becomes the length of the vector that represents the projection of
92  //the point p onto the current line segment
93  //(hint: if this is still unclear, draw it!)
94  float t = (a.x * b.x + a.y * b.y) / lengthSqr;
95 
96  if ( t < 0 )
97  {
98  //projection falls outside the line segment on the side of "start"
99  thisDistance = point.distanceSqr( start.x, start.y, xScale, yScale );
100  }
101  else if ( t > 1 )
102  {
103  //projection falls outside the line segment on the side of the current point
104  thisDistance = point.distanceSqr( end.x, end.y, xScale, yScale );
105  }
106  else
107  {
108  //projection is within [start, *i];
109  //determine the length of the perpendicular distance from the projection to the actual point
110  NormalizedPoint direction = end - start;
111  NormalizedPoint projection = start - NormalizedPoint( -t * direction.x, -t * direction.y );
112  thisDistance = projection.distanceSqr( x, y, xScale, yScale );
113  }
114  }
115  return thisDistance;
116 }
117 
118 QDebug operator<<( QDebug str, const Okular::NormalizedPoint& p )
119 {
120  str.nospace() << "NormPt(" << p.x << "," << p.y << ")";
121  return str.space();
122 }
123 
126 NormalizedRect::NormalizedRect()
127  : left( 0.0 ), top( 0.0 ), right( 0.0 ), bottom( 0.0 ) {}
128 
129 NormalizedRect::NormalizedRect( double l, double t, double r, double b )
130  // note: check for swapping coords?
131  : left( l ), top( t ), right( r ), bottom( b ) {}
132 
133 NormalizedRect::NormalizedRect( const QRect & r, double xScale, double yScale )
134  : left( (double)r.left() / xScale ), top( (double)r.top() / yScale ),
135  right( (double)r.right() / xScale ), bottom( (double)r.bottom() / yScale ) {}
136 
137 NormalizedRect::NormalizedRect( const NormalizedRect & rect )
138  : left( rect.left ), top( rect.top ), right( rect.right ), bottom( rect.bottom ) {}
139 
140 NormalizedRect NormalizedRect::fromQRectF( const QRectF &rect )
141 {
142  QRectF nrect = rect.normalized();
143  NormalizedRect ret;
144  ret.left = nrect.left();
145  ret.top = nrect.top();
146  ret.right = nrect.right();
147  ret.bottom = nrect.bottom();
148  return ret;
149 }
150 
151 bool NormalizedRect::isNull() const
152 {
153  return left == 0 && top== 0 && right == 0 && bottom == 0;
154 }
155 
156 bool NormalizedRect::contains( double x, double y ) const
157 {
158  return x >= left && x <= right && y >= top && y <= bottom;
159 }
160 
161 bool NormalizedRect::intersects( const NormalizedRect & r ) const
162 {
163  return (r.left <= right) && (r.right >= left) && (r.top <= bottom) && (r.bottom >= top);
164 }
165 
166 bool NormalizedRect::intersects( const NormalizedRect * r ) const
167 {
168  return (r->left <= right) && (r->right >= left) && (r->top <= bottom) && (r->bottom >= top);
169 }
170 
171 bool NormalizedRect::intersects( double l, double t, double r, double b ) const
172 {
173  return (l <= right) && (r >= left) && (t <= bottom) && (b >= top);
174 }
175 
176 NormalizedRect NormalizedRect::operator| (const NormalizedRect & r) const
177 {
178  NormalizedRect ret;
179  // todo !
180  ret.left=qMin(left,r.left);
181  ret.top=qMin(top,r.top);
182  ret.bottom=qMax(bottom,r.bottom);
183  ret.right=qMax(right,r.right);
184  return ret;
185 }
186 
187 NormalizedRect& NormalizedRect::operator|= (const NormalizedRect & r)
188 {
189  left = qMin( left, r.left );
190  top = qMin( top, r.top );
191  bottom = qMax( bottom, r.bottom );
192  right = qMax( right, r.right );
193  return *this;
194 }
195 
196 NormalizedRect NormalizedRect::operator&( const NormalizedRect & r ) const
197 {
198  if ( isNull() || r.isNull() )
199  return NormalizedRect();
200 
201  NormalizedRect ret;
202  ret.left = qMax( left, r.left );
203  ret.top = qMax( top, r.top );
204  ret.bottom = qMin( bottom, r.bottom );
205  ret.right = qMin( right, r.right );
206  return ret;
207 }
208 
209 NormalizedRect & NormalizedRect::operator=( const NormalizedRect & r )
210 {
211  left = r.left;
212  right = r.right;
213  top = r.top;
214  bottom = r.bottom;
215  return *this;
216 }
217 
218 bool NormalizedRect::operator==( const NormalizedRect & r ) const
219 {
220  return ( isNull() && r.isNull() ) ||
221  ( fabs( left - r.left ) < 1e-4 &&
222  fabs( right - r.right ) < 1e-4 &&
223  fabs( top - r.top ) < 1e-4 &&
224  fabs( bottom - r.bottom ) < 1e-4 );
225 }
226 
227 NormalizedPoint NormalizedRect::center() const
228 {
229  return NormalizedPoint((left+right)/2.0, (top+bottom)/2.0);
230 }
231 
232 /*
233 QDebug operator << (QDebug str , const NormalizedRect &r)
234 {
235  str << "[" <<r.left() << "," << r.top() << "] x "<< "[" <<r.right() << "," << r.bottom() << "]";
236  return str;
237 }*/
238 
239 QRect NormalizedRect::geometry( int xScale, int yScale ) const
240 {
241  int l = (int)( left * xScale ),
242  t = (int)( top * yScale ),
243  r = (int)( right * xScale ),
244  b = (int)( bottom * yScale );
245 
246  return QRect( l, t, r - l + 1, b - t + 1 );
247 }
248 
249 QRect NormalizedRect::roundedGeometry( int xScale, int yScale ) const
250 {
251  int l = (int)( left * xScale + 0.5 ),
252  t = (int)( top * yScale + 0.5 ),
253  r = (int)( right * xScale + 0.5 ),
254  b = (int)( bottom * yScale + 0.5 );
255 
256  return QRect( l, t, r - l + 1, b - t + 1 );
257 }
258 
259 void NormalizedRect::transform( const QTransform &matrix )
260 {
261  QRectF rect( left, top, right - left, bottom - top );
262  rect = matrix.mapRect( rect );
263 
264  left = rect.left();
265  top = rect.top();
266  right = rect.right();
267  bottom = rect.bottom();
268 }
269 
270 QDebug operator<<( QDebug str, const Okular::NormalizedRect& r )
271 {
272  str.nospace() << "NormRect(" << r.left << "," << r.top << " x " << ( r.right - r.left ) << "+" << ( r.bottom - r.top ) << ")";
273  return str.space();
274 }
275 
276 RegularAreaRect::RegularAreaRect()
277  : RegularArea< NormalizedRect, QRect >(), d( 0 )
278 {
279 }
280 
281 RegularAreaRect::RegularAreaRect( const RegularAreaRect& rar )
282  : RegularArea< NormalizedRect, QRect >( rar ), d( 0 )
283 {
284 }
285 
286 RegularAreaRect::~RegularAreaRect()
287 {
288 }
289 
290 RegularAreaRect& RegularAreaRect::operator=( const RegularAreaRect& rar )
291 {
292  RegularArea< NormalizedRect, QRect >::operator=( rar );
293  return *this;
294 }
295 
296 
297 HighlightAreaRect::HighlightAreaRect( const RegularAreaRect *area )
298  : RegularAreaRect(), s_id( -1 )
299 {
300  if ( area )
301  {
302  RegularAreaRect::ConstIterator it = area->begin();
303  RegularAreaRect::ConstIterator itEnd = area->end();
304  for ( ; it != itEnd; ++it )
305  {
306  append( NormalizedRect( *it ) );
307  }
308  }
309 }
310 
313 ObjectRect::ObjectRect( double l, double t, double r, double b, bool ellipse, ObjectType type, void * pnt )
314  : m_objectType( type ), m_object( pnt )
315 {
316  // assign coordinates swapping them if negative width or height
317  QRectF rect( r > l ? l : r, b > t ? t : b, fabs( r - l ), fabs( b - t ) );
318  if ( ellipse )
319  m_path.addEllipse( rect );
320  else
321  m_path.addRect( rect );
322 
323  m_transformedPath = m_path;
324 }
325 
326 ObjectRect::ObjectRect( const NormalizedRect& x, bool ellipse, ObjectType type, void * pnt )
327  : m_objectType( type ), m_object( pnt )
328 {
329  QRectF rect( x.left, x.top, fabs( x.right - x.left ), fabs( x.bottom - x.top ) );
330  if ( ellipse )
331  m_path.addEllipse( rect );
332  else
333  m_path.addRect( rect );
334 
335  m_transformedPath = m_path;
336 }
337 
338 ObjectRect::ObjectRect( const QPolygonF &poly, ObjectType type, void * pnt )
339  : m_objectType( type ), m_object( pnt )
340 {
341  m_path.addPolygon( poly );
342 
343  m_transformedPath = m_path;
344 }
345 
346 ObjectRect::ObjectType ObjectRect::objectType() const
347 {
348  return m_objectType;
349 }
350 
351 const void * ObjectRect::object() const
352 {
353  return m_object;
354 }
355 
356 const QPainterPath &ObjectRect::region() const
357 {
358  return m_transformedPath;
359 }
360 
361 QRect ObjectRect::boundingRect( double xScale, double yScale ) const
362 {
363  const QRectF &br = m_transformedPath.boundingRect();
364 
365  return QRect( (int)( br.left() * xScale ), (int)( br.top() * yScale ),
366  (int)( br.width() * xScale ), (int)( br.height() * yScale ) );
367 }
368 
369 bool ObjectRect::contains( double x, double y, double, double ) const
370 {
371  return m_transformedPath.contains( QPointF( x, y ) );
372 }
373 
374 void ObjectRect::transform( const QTransform &matrix )
375 {
376  m_transformedPath = matrix.map( m_path );
377 }
378 
379 double ObjectRect::distanceSqr( double x, double y, double xScale, double yScale ) const
380 {
381  switch ( m_objectType )
382  {
383  case Action:
384  case Image:
385  {
386  const QRectF& rect( m_transformedPath.boundingRect() );
387  return NormalizedRect( rect.x(), rect.y(), rect.right(), rect.bottom() ).distanceSqr( x, y, xScale, yScale );
388  }
389  case OAnnotation:
390  {
391  return static_cast<Annotation*>(m_object)->d_func()->distanceSqr( x, y, xScale, yScale );
392  }
393  case SourceRef:
394  {
395  const SourceRefObjectRect * sr = static_cast< const SourceRefObjectRect * >( this );
396  const NormalizedPoint& point = sr->m_point;
397  if ( point.x == -1.0 )
398  {
399  return pow( ( y - point.y ) * yScale, 2 );
400  }
401  else if ( point.y == -1.0 )
402  {
403  return pow( ( x - point.x ) * xScale, 2 );
404  }
405  else
406  {
407  return pow( ( x - point.x ) * xScale, 2 ) + pow( ( y - point.y ) * yScale, 2 );
408  }
409  }
410  }
411  return 0.0;
412 }
413 
414 ObjectRect::~ObjectRect()
415 {
416  if ( !m_object )
417  return;
418 
419  if ( m_objectType == Action )
420  delete static_cast<Okular::Action*>( m_object );
421  else if ( m_objectType == SourceRef )
422  delete static_cast<Okular::SourceReference*>( m_object );
423  else
424  kDebug(OkularDebug).nospace() << "Object deletion not implemented for type '" << m_objectType << "'.";
425 }
426 
429 AnnotationObjectRect::AnnotationObjectRect( Annotation * annotation )
430  : ObjectRect( QPolygonF(), OAnnotation, annotation ), m_annotation( annotation )
431 {
432 }
433 
434 Annotation *AnnotationObjectRect::annotation() const
435 {
436  return m_annotation;
437 }
438 
439 QRect AnnotationObjectRect::boundingRect( double xScale, double yScale ) const
440 {
441  const QRect annotRect = AnnotationUtils::annotationGeometry( m_annotation, xScale, yScale );
442  const QPoint center = annotRect.center();
443 
444  // Make sure that the rectangle has a minimum size, so that it's possible
445  // to click on it
446  const int minSize = 14;
447  const QRect minRect( center.x()-minSize/2, center.y()-minSize/2, minSize, minSize );
448 
449  return annotRect | minRect;
450 }
451 
452 bool AnnotationObjectRect::contains( double x, double y, double xScale, double yScale ) const
453 {
454  return boundingRect( xScale, yScale ).contains( (int)( x * xScale ), (int)( y * yScale ), false );
455 }
456 
457 AnnotationObjectRect::~AnnotationObjectRect()
458 {
459  // the annotation pointer is kept elsewehere (in Page, most probably),
460  // so just release its pointer
461  m_object = 0;
462 }
463 
464 void AnnotationObjectRect::transform( const QTransform &matrix )
465 {
466  m_annotation->d_func()->annotationTransform( matrix );
467 }
468 
471 SourceRefObjectRect::SourceRefObjectRect( const NormalizedPoint& point, void * srcRef )
472  : ObjectRect( point.x, point.y, .0, .0, false, SourceRef, srcRef ), m_point( point )
473 {
474  const double x = m_point.x < 0.0 ? 0.5 : m_point.x;
475  const double y = m_point.y < 0.0 ? 0.5 : m_point.y;
476  const QRectF rect( x - 2, y - 2, 5, 5 );
477  m_path.addRect( rect );
478 
479  m_transformedPath = m_path;
480 }
481 
482 QRect SourceRefObjectRect::boundingRect( double xScale, double yScale ) const
483 {
484  const double x = m_point.x < 0.0 ? 0.5 : m_point.x;
485  const double y = m_point.y < 0.0 ? 0.5 : m_point.y;
486 
487  return QRect( x * xScale, y * yScale, 1, 1 );
488 }
489 
490 bool SourceRefObjectRect::contains( double x, double y, double xScale, double yScale ) const
491 {
492  return distanceSqr( x, y, xScale, yScale ) < ( pow( 7.0 / xScale, 2 ) + pow( 7.0 / yScale, 2 ) );
493 }
Okular::NormalizedPoint
NormalizedPoint is a helper class which stores the coordinates of a normalized point.
Definition: area.h:47
Okular::ObjectRect::OAnnotation
An annotation.
Definition: area.h:347
Okular::AnnotationObjectRect::~AnnotationObjectRect
virtual ~AnnotationObjectRect()
Destroys the annotation object rectangle.
Definition: area.cpp:457
Okular::NormalizedRect::NormalizedRect
NormalizedRect()
Creates a null normalized rectangle.
Definition: area.cpp:126
Okular::ObjectRect::boundingRect
virtual QRect boundingRect(double xScale, double yScale) const
Returns the bounding rect of the object rectangle for the scaling factor xScale and yScale...
Definition: area.cpp:361
Okular::SourceRefObjectRect
This class describes the object rectangle for a source reference.
Definition: area.h:474
Okular::RegularAreaRect::operator=
RegularAreaRect & operator=(const RegularAreaRect &rar)
Definition: area.cpp:290
Okular::NormalizedRect::transform
void transform(const QTransform &matrix)
Transforms the normalized rectangle with the operations defined by matrix.
Definition: area.cpp:259
Okular::NormalizedRect::center
NormalizedPoint center() const
Returns the center of the rectangle.
Definition: area.cpp:227
Okular::NormalizedRect::left
double left
The normalized left coordinate.
Definition: area.h:305
Okular::RegularAreaRect::RegularAreaRect
RegularAreaRect()
Definition: area.cpp:276
Okular::NormalizedRect
NormalizedRect is a helper class which stores the coordinates of a normalized rect, which is a rectangle of.
Definition: area.h:105
debug_p.h
Okular::NormalizedRect::operator&
NormalizedRect operator&(const NormalizedRect &other) const
Returns the intersection of this normalized rectangle with the specified other.
Definition: area.cpp:196
Okular::NormalizedRect::operator|=
NormalizedRect & operator|=(const NormalizedRect &other)
Sets the normalized rectangle to the normalized bounding rectangle of itself combined with the other ...
Definition: area.cpp:187
Okular::ObjectRect::object
const void * object() const
Returns the storable object of the object rectangle.
Definition: area.cpp:351
area.h
Okular::RegularAreaRect
Definition: area.h:860
annotations_p.h
Okular::ObjectRect::objectType
ObjectType objectType() const
Returns the object type of the object rectangle.
Definition: area.cpp:346
Okular::NormalizedPoint::y
double y
The normalized y coordinate.
Definition: area.h:97
Okular::AnnotationObjectRect::AnnotationObjectRect
AnnotationObjectRect(Annotation *annotation)
Creates a new annotation object rectangle with the given annotation.
Definition: area.cpp:429
Okular::RegularAreaRect::~RegularAreaRect
~RegularAreaRect()
Definition: area.cpp:286
Okular::NormalizedRect::operator|
NormalizedRect operator|(const NormalizedRect &other) const
Returns the normalized bounding rectangle of the normalized rectangle combined with the other normali...
Definition: area.cpp:176
Okular::NormalizedRect::intersects
bool intersects(const NormalizedRect &other) const
Returns whether the normalized rectangle intersects the other normalized rectangle.
Definition: area.cpp:161
operator<<
QDebug operator<<(QDebug str, const Okular::NormalizedPoint &p)
Debug operator for normalized point.
Definition: area.cpp:118
Okular::AnnotationObjectRect::transform
virtual void transform(const QTransform &matrix)
Transforms the annotation object rectangle with the operations defined by matrix. ...
Definition: area.cpp:464
Okular::ObjectRect::m_path
QPainterPath m_path
Definition: area.h:424
Okular::AnnotationUtils::annotationGeometry
static QRect annotationGeometry(const Annotation *annotation, double scaleX, double scaleY)
Returns the geometry of the given annotation scaled by scaleX and scaleY.
Definition: annotations.cpp:154
Okular::AnnotationObjectRect::contains
virtual bool contains(double x, double y, double xScale, double yScale) const
Returns whether the annotation object rectangle contains the point x, y for the scaling factor xScale...
Definition: area.cpp:452
Okular::ObjectRect::ObjectRect
ObjectRect(double left, double top, double right, double bottom, bool ellipse, ObjectType type, void *object)
Creates a new object rectangle.
Definition: area.cpp:313
Okular::NormalizedRect::contains
bool contains(double x, double y) const
Returns whether the normalized rectangle contains the normalized coordinates x and y...
Definition: area.cpp:156
Okular::NormalizedRect::right
double right
The normalized right coordinate.
Definition: area.h:315
Okular::NormalizedRect::operator=
NormalizedRect & operator=(const NormalizedRect &other)
Definition: area.cpp:209
operator-
NormalizedPoint operator-(const NormalizedPoint &a, const NormalizedPoint &b)
Returns a vector from the given points a and b.
Definition: area.cpp:61
Okular::ObjectRect
NormalizedRect that contains a reference to an object.
Definition: area.h:337
action.h
annotations.h
Okular::NormalizedPoint::NormalizedPoint
NormalizedPoint()
Creates a new empty normalized point.
Definition: area.cpp:27
OkularDebug
#define OkularDebug
Definition: debug_p.h:13
Okular::SourceRefObjectRect::contains
virtual bool contains(double x, double y, double xScale, double yScale) const
Returns whether the source reference object rectangle contains the point x, y for the scaling factor ...
Definition: area.cpp:490
Okular::ObjectRect::m_objectType
ObjectType m_objectType
Definition: area.h:422
Okular::RegularArea
A regular area of NormalizedShape which normalizes a Shape.
Definition: area.h:557
Okular::ObjectRect::m_transformedPath
QPainterPath m_transformedPath
Definition: area.h:425
Okular::NormalizedRect::operator==
bool operator==(const NormalizedRect &other) const
Returns whether the normalized rectangle is equal to the other normalized rectangle.
Definition: area.cpp:218
Okular::ObjectRect::transform
virtual void transform(const QTransform &matrix)
Transforms the object rectangle with the operations defined by matrix.
Definition: area.cpp:374
Okular::NormalizedPoint::distanceSqr
double distanceSqr(double x, double y, double xScale, double yScale) const
Returns squared distance to point x y xScale yScale.
Definition: area.cpp:52
Okular::NormalizedRect::roundedGeometry
QRect roundedGeometry(int xScale, int yScale) const
Same functionality as geometry, but the output is now rounded before typecasting to int...
Definition: area.cpp:249
Okular::NormalizedRect::geometry
QRect geometry(int xScale, int yScale) const
Returns the rectangle that accrues when the normalized rectangle is multiplyed with the scaling xScal...
Definition: area.cpp:239
Okular::AnnotationObjectRect::boundingRect
virtual QRect boundingRect(double xScale, double yScale) const
Returns the bounding rect of the annotation object rectangle for the scaling factor xScale and yScale...
Definition: area.cpp:439
sourcereference.h
Okular::NormalizedRect::top
double top
The normalized top coordinate.
Definition: area.h:310
Okular::Action
Encapsulates data that describes an action.
Definition: action.h:43
Okular::ObjectRect::contains
virtual bool contains(double x, double y, double xScale, double yScale) const
Returns whether the object rectangle contains the point x, y for the scaling factor xScale and yScale...
Definition: area.cpp:369
Okular::SourceReference
Defines a source reference.
Definition: sourcereference.h:25
Okular::ObjectRect::ObjectType
ObjectType
Describes the type of storable object.
Definition: area.h:343
Okular::NormalizedPoint::x
double x
The normalized x coordinate.
Definition: area.h:92
Okular::ObjectRect::SourceRef
A source reference.
Definition: area.h:348
Okular::ObjectRect::distanceSqr
double distanceSqr(double x, double y, double xScale, double yScale) const
Returns the square of the distance between the object and the point x, y for the scaling factor xScal...
Definition: area.cpp:379
Okular::Annotation
Annotation struct holds properties shared by all annotations.
Definition: annotations.h:90
Okular::NormalizedRect::isNull
bool isNull() const
Returns whether this normalized rectangle is a null normalized rect.
Definition: area.cpp:151
Image
Okular::HighlightAreaRect::HighlightAreaRect
HighlightAreaRect(const RegularAreaRect *area=0)
Creates a new highlight area rect with the coordinates of the given area.
Definition: area.cpp:297
Okular::AnnotationObjectRect::annotation
Annotation * annotation() const
Returns the annotation object of the annotation object rectangle.
Definition: area.cpp:434
Okular::ObjectRect::region
const QPainterPath & region() const
Returns the region that is covered by the object rectangle.
Definition: area.cpp:356
Okular::NormalizedPoint::operator=
NormalizedPoint & operator=(const NormalizedPoint &)
Definition: area.cpp:36
Okular::NormalizedRect::fromQRectF
static NormalizedRect fromQRectF(const QRectF &rect)
Build a normalized rect from a QRectF.
Definition: area.cpp:140
Okular::ObjectRect::m_object
void * m_object
Definition: area.h:423
Okular::NormalizedRect::bottom
double bottom
The normalized bottom coordinate.
Definition: area.h:320
Okular::SourceRefObjectRect::boundingRect
virtual QRect boundingRect(double xScale, double yScale) const
Returns the bounding rect of the source reference object rectangle for the scaling factor xScale and ...
Definition: area.cpp:482
Okular::NormalizedPoint::transform
void transform(const QTransform &matrix)
Transforms the normalized point with the operations defined by matrix.
Definition: area.cpp:43
Okular::SourceRefObjectRect::SourceRefObjectRect
SourceRefObjectRect(const NormalizedPoint &point, void *reference)
Creates a new source reference object rectangle.
Definition: area.cpp:471
Okular::ObjectRect::~ObjectRect
virtual ~ObjectRect()
Destroys the object rectangle.
Definition: area.cpp:414
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:45:02 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

okular

Skip menu "okular"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdegraphics API Reference

Skip menu "kdegraphics API Reference"
  •     libkdcraw
  •     libkexiv2
  •     libkipi
  •     libksane
  • okular

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal