Commit b81310b3 authored by thomas.forbriger's avatar thomas.forbriger Committed by thomas.forbriger
Browse files

proceeding

This is a legacy commit from before 2015-03-01.
It may be incomplete as well as inconsistent.
See COPYING.legacy and README.history for details.


SVN Path:     http://gpitrsvn.gpi.uni-karlsruhe.de/repos/TFSoftware/trunk
SVN Revision: 1700
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent 594bb6b6
# this is <Makefile>
# ----------------------------------------------------------------------------
# ($Id: Makefile,v 1.14 2005-04-29 19:01:36 tforb Exp $)
# ($Id: Makefile,v 1.15 2005-05-02 09:50:34 tforb Exp $)
#
# 05/06/2001 by Thomas Forbriger (IMGF Frankfurt)
#
......@@ -12,7 +12,7 @@
#
# ============================================================================
#
all: libpgplotCpp.a
all: install libpgplotCpp.a
PGPLOTLIB=-lpgplotCpp -lcpgplot -lpgplot77 -lg2c -lm -lX11 -L$(SERVERLIBDIR) \
-L/usr/X11/lib
......@@ -36,7 +36,7 @@ clean: ; /bin/rm -fv *.bak *.o flist XpgplotCpp
install: $(HEADERS)
newinclude $^
example: XpgplotCpp; XpgplotCpp
example: all XpgplotCpp; XpgplotCpp; rm -fv XpgplotCpp XpgplotCpp.o
libpgplotCpp.a: $(CODE:.cc=.o)
ar rcv $@ $^
......
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: XpgplotCpp.cc,v 1.4 2005-04-29 19:01:36 tforb Exp $
* $Id: XpgplotCpp.cc,v 1.5 2005-05-02 09:50:34 tforb Exp $
*
* Copyright (c) 2001 by Thomas Forbriger (IMGF Frankfurt)
*
......@@ -37,44 +37,58 @@ main()
{
cout << "XpgplotCpp" << endl;
cout << "(example program for the C++ interface for PGPLOT)" << endl;
cout << "($Id: XpgplotCpp.cc,v 1.4 2005-04-29 19:01:36 tforb Exp $)"
cout << "($Id: XpgplotCpp.cc,v 1.5 2005-05-02 09:50:34 tforb Exp $)"
<< endl;
/*
pgplot::device d("/xserve");
d.env(1.,5.,1.,10.,0,2);
*/
pgplot::device d2("/xserve");
d2.subp(2,1);
/*
d2.env(1.,5.,1.,10.,1,2);
pgplot::basic_device::ldev();
*/
//----------------------------------------------------------------------
// go for gray plot
pgplot::pgaff::Tarray A(aff::Shaper(4,10)(-3,3));
pgplot::pgaff::Tarray A(aff::Shaper(0,6)(-3,3));
for (int i=A.first(0); i<=A.last(0); ++i)
{
for (int j=A.first(1); j<=A.last(1); ++j)
{
A(i,j)=float(i+j);
A(i,j)=float(5*i+j);
}
}
pgplot::pgaff::Tarray B1=aff::subarray(A)(4,6)(1,2);
pgplot::pgaff::Tarray B2=aff::subarray(A)(5,10)(1,3);
pgplot::pgaff::Tarray B2=aff::subarray(A)(0,4)(1,3);
pgplot::Trect cwin(pgplot::Trange(-5.,5.),pgplot::Trange(-3.,3.));
pgplot::Trect cwin(pgplot::Trange(-1.,3.),pgplot::Trange(-5.,5.));
/*
d2.ask();
d2.env(cwin);
*/
pgplot::pgaff::Ttransform tr=pgplot::pgaff::create_transform(A,cwin);
pgplot::Trange vrange=pgplot::pgaff::array_value_range(A);
pgplot::pgaff::gray(d2, A, vrange, tr);
pgplot::Trange vrange=pgplot::pgaff::array_value_range(A).swap();
/*
pgplot::pgaff::gray(d2, A, vrange, tr).gwedg(vrange);
*/
d2.env(cwin);
tr=pgplot::pgaff::create_transform(B1,cwin);
vrange=pgplot::pgaff::array_value_range(B1);
pgplot::pgaff::gray(d2, B1, vrange, tr);
tr=pgplot::pgaff::create_transform(B1,cwin,false);
pgplot::pgaff::Ttransform tr2=pgplot::pgaff::create_transform(B1,cwin);
vrange=pgplot::pgaff::array_value_range(B1).swap();
pgplot::pgaff::gray(d2, B1, vrange, tr).gwedg(vrange);
d2.env(cwin);
pgplot::pgaff::gray(d2, B1, vrange, tr2).gwedg(vrange);
/*
d2.env(cwin);
tr=pgplot::pgaff::create_transform(B2,cwin);
vrange=pgplot::pgaff::array_value_range(B2);
pgplot::pgaff::gray(d2, B2, vrange, tr);
vrange=pgplot::pgaff::array_value_range(B2).swap();
pgplot::pgaff::gray(d2, B2, vrange, tr).gwedg(vrange);
*/
}
/* ----- END OF XpgplotCpp.cc ----- */
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: affpgplot.cc,v 1.2 2005-04-29 19:01:36 tforb Exp $
* $Id: affpgplot.cc,v 1.3 2005-05-02 09:50:34 tforb Exp $
* \author Thomas Forbriger
* \date 29/04/2005
*
......@@ -19,7 +19,7 @@
#define TF_AFFPGPLOT_CC_VERSION \
"TF_AFFPGPLOT_CC V1.0 "
#define TF_AFFPGPLOT_CC_CVSID \
"$Id: affpgplot.cc,v 1.2 2005-04-29 19:01:36 tforb Exp $"
"$Id: affpgplot.cc,v 1.3 2005-05-02 09:50:34 tforb Exp $"
#include<iostream>
#include<affpgplot.h>
......@@ -61,23 +61,31 @@ namespace pgplot {
Tarray::Tshape shape(a.shape());
shape.setfirst(Tarray::Tshape::TIndexVec(1));
retval=0.;
int ix=4;
int iy=2;
int ibx=3;
int iby=0;
int ix,iy,ibx,iby,nx,ny,fx,fy;
if (xisfirst)
{
int ix=1;
int iy=5;
int ibx=0;
int iby=3;
ix=1;
iy=5;
ibx=0;
iby=3;
nx=shape.size(0);
ny=shape.size(1);
fx=shape.first(0);
fy=shape.first(1);
}
else
{
ix=4;
iy=2;
ibx=0;
iby=3;
nx=shape.size(1);
ny=shape.size(0);
fx=shape.first(1);
fy=shape.first(0);
}
Trange xrange=rect.x;
Trange yrange=rect.y;
int nx=shape.size(0);
int ny=shape.size(1);
int fx=shape.first(0);
int fy=shape.first(1);
retval[ix]=xrange.absrange()/float(nx);
retval[iy]=yrange.absrange()/float(ny);
retval[ibx]=xrange.min-retval[ix]*(float(fx)-0.5);
......
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: pgplotCpp.h,v 1.20 2005-04-29 19:01:37 tforb Exp $
* $Id: pgplotCpp.h,v 1.21 2005-05-02 09:50:35 tforb Exp $
*
* Copyright (c) 2001 by Thomas Forbriger (IMGF Frankfurt)
*
......@@ -36,7 +36,7 @@
#ifndef TF_PGPLOTCPP_H_
//! include guard
#define TF_PGPLOTCPP_H_ \
"$Id: pgplotCpp.h,v 1.20 2005-04-29 19:01:37 tforb Exp $"
"$Id: pgplotCpp.h,v 1.21 2005-05-02 09:50:35 tforb Exp $"
/*! \brief contains all pgplot stuff
*
......@@ -363,9 +363,10 @@ class basic_device {
//! advance to next output page
basic_device& page()
{ this->select(); cpgpage(); return(*this); }
//! switch to a different panel on the view surface
basic_device& panl(int nxc, int nyc)
{ this->select(); cpgpanl(nxc, nyc); return(*this); }
/*
void panl(int nxc, int nyc)
{ this->select(); }
void pap(float width, float aspect)
{ this->select(); }
void pixl(const int *ia, int idim, int jdim, int i1, int i2, int j1, int
......@@ -529,10 +530,9 @@ class basic_device {
//! set background color index
basic_device& stbg(const int& tbci)
{ this->select(); cpgstbg(tbci); return(*this); }
/*
void subp(int nxsub, int nysub)
{ this->select(); }
*/
//! subdivide view surface into panels
basic_device& subp(int nxsub, int nysub)
{ this->select(); cpgsubp(nxsub, nysub); return(*this); }
//! set viewport (view area)
basic_device& svp(const float& xleft, const float& xright,
const float& ybot, const float& ytop)
......@@ -598,11 +598,29 @@ class basic_device {
//! select standard viewport
basic_device& vstd(void)
{ this->select(); cpgvstd(); return(*this); }
/*
void wedg(const char *side, float disp, float width, float fg, float bg,
const char *label)
{ this->select(); }
*/
//! annotate an image plot with a wedge
basic_device& wedg(const char *side,
const float& disp, const float& width,
const float& fg, const float& bg,
const char *label)
{
this->select();
cpgwedg(side, disp, width, fg, bg, label);
return(*this);
}
//! annotate an image plot with a wedge
basic_device& wedg(const char *side,
const float& disp, const float& width,
const Trange& range,
const char *label)
{ return(this->wedg(side, disp, width, range.min, range.max, label)); }
//! annotate an image plot with a wedge
basic_device& gwedg(const Trange& range,
const char *label="value",
const float& disp=0.3,
const float& width=3.0,
const char *side="RG")
{ return(this->wedg(side, disp, width, range.min, range.max, label)); }
//! set world coordinates and adjust viewport to same aspect ratio
basic_device& wnad(const float& x1, const float& x2,
const float& y1, const float& y2)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment