~pac72/ubuntu/lucid/ddd/devel

« back to all changes in this revision

Viewing changes to ddd/BoxExtend.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Schepler
  • Date: 2004-07-22 03:49:37 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20040722034937-cysl08t1jvba4jrx
Tags: 1:3.3.9-3
USERINFO has been renamed to USERINFO.txt; adjust debian/rules code
to match, to get correct information on the About DDD dialog.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// $Id: BoxExtend.h,v 1.11 1999/08/19 11:27:07 andreas Exp $  -*- C++ -*-
 
1
// $Id$  -*- C++ -*-
2
2
// BoxExtend class
3
3
 
4
4
// Copyright (C) 1995 Technische Universitaet Braunschweig, Germany.
29
29
#ifndef _DDD_BoxExtend_h
30
30
#define _DDD_BoxExtend_h
31
31
 
32
 
#ifdef __GNUG__
33
 
#pragma interface
34
 
#endif
35
 
 
36
32
// A `BoxExtend' denotes the extensibility of a box - that is, how
37
33
// much the box extends to fill up available space.  An extensibility
38
34
// of 0 means that the box will not extend at all.  The bigger the
62
58
    {}
63
59
 
64
60
    // Horizontal concatenation
65
 
    BoxExtend operator & (const BoxExtend& e) 
 
61
    BoxExtend operator & (const BoxExtend& e) const
66
62
    {
67
 
        if (isValid() && e.isValid())
68
 
            return BoxExtend(point[X] + e.point[X],
69
 
                             min(point[Y],e.point[Y]));
70
 
        else
71
 
            return BoxExtend();
 
63
        return
 
64
          (isValid() && e.isValid())
 
65
          ? BoxExtend(point[X] + e.point[X],
 
66
                      min(point[Y],e.point[Y]))
 
67
          : BoxExtend();
72
68
    }
73
69
 
74
70
    // Vertical concatenation
75
 
    BoxExtend operator | (const BoxExtend& e) 
 
71
    BoxExtend operator | (const BoxExtend& e) const
76
72
    {
77
 
        if (isValid() && e.isValid())
78
 
            return BoxExtend(min(point[X], e.point[X]),
79
 
                             point[Y] + e.point[Y]);
80
 
        else
81
 
            return BoxExtend();
 
73
        return
 
74
          (isValid() && e.isValid())
 
75
          ? BoxExtend(min(point[X], e.point[X]),
 
76
                      point[Y] + e.point[Y])
 
77
          : BoxExtend();
82
78
    }
83
79
 
84
80
    // Stacked concatenation
85
 
    BoxExtend operator ^ (const BoxExtend& e) 
 
81
    BoxExtend operator ^ (const BoxExtend& e) const
86
82
    {
87
 
        if (isValid() && e.isValid())
88
 
            return BoxExtend(max(point[X], e.point[X]),
89
 
                             max(point[Y], e.point[Y]));
90
 
        else
91
 
            return BoxExtend();
 
83
        return
 
84
          (isValid() && e.isValid())
 
85
          ? BoxExtend(max(point[X], e.point[X]),
 
86
                      max(point[Y], e.point[Y]))
 
87
          : BoxExtend();
92
88
    }
93
89
 
94
90
    // Assignment versions
95
 
    void operator &= (const BoxExtend& e) 
 
91
    void operator &= (const BoxExtend& e)
96
92
    {
97
93
        if (isValid() && e.isValid())
98
94
        {
126
122
};
127
123
 
128
124
// I/O
129
 
inline ostream& operator << (ostream& stream, const BoxExtend& extend)
 
125
inline std::ostream& operator << (std::ostream& stream, const BoxExtend& extend)
130
126
{
131
127
    const BoxPoint& p = extend;
132
128
    return operator << (stream, p);