~ubuntu-branches/ubuntu/intrepid/plplot/intrepid

« back to all changes in this revision

Viewing changes to examples/c++/x11.cc

  • Committer: Bazaar Package Importer
  • Author(s): Rafael Laboissiere
  • Date: 2006-11-04 10:19:34 UTC
  • mfrom: (2.1.8 edgy)
  • Revision ID: james.westby@ubuntu.com-20061104101934-mlirvdg4gpwi6i5q
Tags: 5.6.1-10
* Orphaning the package
* debian/control: Changed the maintainer to the Debian QA Group

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
//---------------------------------------------------------------------------//
2
 
// $Id: x11.cc,v 1.5 2004/03/03 17:41:16 andrewross Exp $
 
2
// $Id: x11.cc,v 1.12 2006/05/12 23:24:02 airwin Exp $
3
3
//---------------------------------------------------------------------------//
4
4
//
5
5
//---------------------------------------------------------------------------//
19
19
//
20
20
// You should have received a copy of the GNU Library General Public License
21
21
// along with PLplot; if not, write to the Free Software
22
 
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
 
22
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
23
23
//---------------------------------------------------------------------------//
24
24
//
25
25
//---------------------------------------------------------------------------//
26
26
// Implementation of PLplot example 11 in C++.
27
27
//---------------------------------------------------------------------------//
28
28
 
29
 
#include "plstream.h"
30
 
 
31
 
#include <iostream>
32
 
#include <cmath>
 
29
#include "plc++demos.h"
33
30
 
34
31
#ifdef USE_NAMESPACE
35
32
using namespace std;
76
73
  PLFLT *h = new PLFLT[2];
77
74
  PLFLT *l = new PLFLT[2];
78
75
  PLFLT *s = new PLFLT[2];
79
 
  int *rev = new int[2];
 
76
  bool *rev = new bool[2];
80
77
 
81
78
  i[0] = 0.0;         // left boundary
82
79
  i[1] = 1.0;         // right boundary
90
87
  s[0] = 0.8;
91
88
  s[1] = 0.8;
92
89
 
93
 
  rev[0] = 0;         // interpolate on front side of colour wheel.
94
 
  rev[1] = 0;         // interpolate on front side of colour wheel.
 
90
  rev[0] = false;         // interpolate on front side of colour wheel.
 
91
  rev[1] = false;         // interpolate on front side of colour wheel.
95
92
 
96
93
  pls->scmap1n(256);
97
 
  pls->scmap1l(0, 2, i, h, l, s, rev);
 
94
  pls->scmap1l(false, 2, i, h, l, s, rev);
98
95
 
99
96
  delete[] i;
100
97
  delete[] h;
124
121
 
125
122
  // Parse and process command line arguments.
126
123
 
127
 
  pls->ParseOpts( &argc, argv, PL_PARSE_FULL );
 
124
  pls->parseopts( &argc, argv, PL_PARSE_FULL );
128
125
 
129
126
 
130
127
  // Initialize plplot.
147
144
        {
148
145
          yy = y[j];
149
146
          z[i][j] = 3. * (1.-xx)*(1.-xx) * exp(-(xx*xx) - (yy+1.)*(yy+1.)) -
150
 
            10. * (xx/5. - pow(xx,3.) - pow(yy,5.)) * exp(-xx*xx-yy*yy) -
 
147
            10. * (xx/5. - pow((double)xx,3.) - pow((double)yy,5.)) * exp(-xx*xx-yy*yy) -
151
148
            1./3. * exp(-(xx+1)*(xx+1) - (yy*yy));
152
149
          if(false) { /* Jungfraujoch/Interlaken */
153
150
            if (z[i][j] < -1.)
190
187
 
191
188
      /* magnitude colored wireframe plot with sides */
192
189
      else if (i==2) {
193
 
        pls->plot3d(x, y, z, XPTS, YPTS, opt[k] | MAG_COLOR, 1);
 
190
        pls->plot3d(x, y, z, XPTS, YPTS, opt[k] | MAG_COLOR, true);
194
191
      }
195
192
 
196
193
      /* magnitude colored wireframe plot with base contour */