~ubuntu-branches/debian/sid/coin2/sid

« back to all changes in this revision

Viewing changes to include/Inventor/SbBox2s.h

  • Committer: Bazaar Package Importer
  • Author(s): Steve M. Robbins
  • Date: 2008-06-28 02:38:17 UTC
  • mfrom: (1.2.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20080628023817-lgrh0u677j1gcqgf
Tags: 2.5.0-2
* debian/control: Change suggests from libopenal0 to libopenal0a.
  Closes: #488001.  Change ${Source-Version} to ${binary:Version}.
  Update to standards version 3.8.0.

* debian/rules: Do not ignore errors in clean rule.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
/**************************************************************************\
5
5
 *
6
6
 *  This file is part of the Coin 3D visualization library.
7
 
 *  Copyright (C) 1998-2006 by Systems in Motion.  All rights reserved.
 
7
 *  Copyright (C) 1998-2007 by Systems in Motion.  All rights reserved.
8
8
 *
9
9
 *  This library is free software; you can redistribute it and/or
10
10
 *  modify it under the terms of the GNU General Public License
24
24
 *
25
25
\**************************************************************************/
26
26
 
27
 
#include <Inventor/SbBasic.h>
28
27
#include <Inventor/SbVec2s.h>
 
28
#include <Inventor/SbVec2f.h>
 
29
 
 
30
class SbBox2i32;
 
31
class SbBox2f;
 
32
class SbBox2d;
29
33
 
30
34
class COIN_DLL_API SbBox2s {
31
35
public:
32
36
  SbBox2s(void);
33
37
  SbBox2s(short xmin, short ymin, short xmax, short ymax);
34
38
  SbBox2s(const SbVec2s & boxmin, const SbVec2s & boxmax);
 
39
  explicit SbBox2s(const SbBox2i32 & box) { setBounds(box); }
 
40
  explicit SbBox2s(const SbBox2f & box) { setBounds(box); }
 
41
  explicit SbBox2s(const SbBox2d & box) { setBounds(box); }
35
42
  ~SbBox2s(void);
36
43
 
 
44
  void setBounds(short xmin, short ymin, short xmax, short ymax);
 
45
  void setBounds(const SbVec2s & boxmin, const SbVec2s & boxmax);
 
46
  SbBox2s & setBounds(const SbBox2i32 & box);
 
47
  SbBox2s & setBounds(const SbBox2f & box);
 
48
  SbBox2s & setBounds(const SbBox2d & box);
 
49
 
 
50
  void getBounds(short & xmin, short & ymin, short & xmax, short & ymax) const;
 
51
  void getBounds(SbVec2s & boxmin, SbVec2s & boxmax) const;
 
52
 
37
53
  const SbVec2s & getMin(void) const;
 
54
  SbVec2s & getMin(void) { return minpt; }
38
55
  const SbVec2s & getMax(void) const;
 
56
  SbVec2s & getMax(void) { return maxpt; }
 
57
 
39
58
  void extendBy(const SbVec2s & point);
40
59
  void extendBy(const SbBox2s & box);
 
60
  void makeEmpty(void);
 
61
  SbBool isEmpty(void) const { return (maxpt[0] < minpt[0]); }
 
62
  SbBool hasArea(void) const;
 
63
 
41
64
  SbBool intersect(const SbVec2s & point) const;
42
65
  SbBool intersect(const SbBox2s & box) const;
43
 
  void setBounds(short xmin, short ymin, short xmax, short ymax);
44
 
  void setBounds(const SbVec2s & boxmin, const SbVec2s & boxmax);
45
 
  void getBounds(short & xmin, short & ymin, short & xmax, short & ymax) const;
46
 
  void getBounds(SbVec2s & boxmin, SbVec2s & boxmax) const;
 
66
 
 
67
  SbVec2f getCenter(void) const { return SbVec2f((minpt[0] + maxpt[0]) * 0.5f, (minpt[1] + maxpt[1]) * 0.5f); }
 
68
 
47
69
  void getOrigin(short & originX, short & originY) const;
48
70
  void getSize(short & sizeX, short & sizeY) const;
49
71
  float getAspectRatio(void) const;
50
 
  void makeEmpty(void);
51
72
  friend COIN_DLL_API int operator ==(const SbBox2s & b1, const SbBox2s & b2);
52
73
  friend COIN_DLL_API int operator !=(const SbBox2s & b1, const SbBox2s & b2);
53
74
 
56
77
 
57
78
  short width(void) const;
58
79
  short height(void) const;
59
 
  SbBool hasArea(void) const;
60
80
};
61
81
 
62
82
COIN_DLL_API int operator ==(const SbBox2s & b1, const SbBox2s & b2);