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

flspherplot now compiles

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: 2136
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent fc243b10
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: affpgplot.cc,v 1.5 2005-05-02 14:45:08 tforb Exp $
* $Id: affpgplot.cc,v 1.6 2006-06-20 07:25:28 tforb Exp $
* \author Thomas Forbriger
* \date 29/04/2005
*
......@@ -13,13 +13,14 @@
*
* REVISIONS and CHANGES
* - 29/04/2005 V1.0 Thomas Forbriger
* - 19/06/2006 V1.1 provide series function
*
* ============================================================================
*/
#define TF_AFFPGPLOT_CC_VERSION \
"TF_AFFPGPLOT_CC V1.0 "
"TF_AFFPGPLOT_CC V1.1"
#define TF_AFFPGPLOT_CC_CVSID \
"$Id: affpgplot.cc,v 1.5 2005-05-02 14:45:08 tforb Exp $"
"$Id: affpgplot.cc,v 1.6 2006-06-20 07:25:28 tforb Exp $"
#include<iostream>
#include<affpgplot.h>
......@@ -149,6 +150,11 @@ namespace pgplot {
return(aff::func::util::collect<Tarray::Tcoc, util::Extractrange>(a));
} // array_value_range
Trange series_value_range(const Tseries::Tcoc& a)
{
return(aff::func::util::collect<Tseries::Tcoc, util::Extractrange>(a));
} // array_value_range
} // namespace pgaff
} // namespace pgplot
......
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: affpgplot.h,v 1.4 2005-05-02 13:58:39 tforb Exp $
* $Id: affpgplot.h,v 1.5 2006-06-20 07:25:28 tforb Exp $
* \author Thomas Forbriger
* \date 28/04/2005
*
......@@ -13,6 +13,9 @@
*
* REVISIONS and CHANGES
* - 28/04/2005 V1.0 Thomas Forbriger
* - 19/06/2006 V1.1
* - provide series function
* - added line drawing functionality
*
* ============================================================================
*/
......@@ -21,12 +24,14 @@
#ifndef TF_AFFPGPLOT_H_VERSION
#define TF_AFFPGPLOT_H_VERSION \
"TF_AFFPGPLOT_H V1.0"
"TF_AFFPGPLOT_H V1.1"
#define TF_AFFPGPLOT_H_CVSID \
"$Id: affpgplot.h,v 1.4 2005-05-02 13:58:39 tforb Exp $"
"$Id: affpgplot.h,v 1.5 2006-06-20 07:25:28 tforb Exp $"
#include<pgplotCpp.h>
#include<aff/array.h>
#include<aff/series.h>
#include<aff/iterator.h>
namespace pgplot {
......@@ -38,6 +43,7 @@ namespace pgplot {
//! array type to be passed to gray function
typedef aff::Array<float> Tarray;
typedef aff::Series<float> Tseries;
//! function to plot gray image
pgplot::basic_device& gray(pgplot::basic_device& dev,
......@@ -63,6 +69,86 @@ namespace pgplot {
//! return range of values
Trange array_value_range(const Tarray::Tcoc& a);
Trange series_value_range(const Tseries::Tcoc& a);
/*! \brief draw an open polygon from a dense series
*
* This implements \c cpgline functionality.
*
* \param dev device to be plotted on
* \param x series of x-coordinates
* \param y corresponding series of y-coordinates
*
* \param SX series class for x
* \param SY series class for y
* \param T pgplot device class
*
* \return returns a reference to the device context
*/
template<class T, class SX, class SY>
T& line(T& dev, const SX& x, const SY& y)
{
typename aff::Browser<SX> ix=x;
typename aff::Browser<SY> iy=y;
float fx=float(*ix);
float fy=float(*iy);
dev.move(fx, fy);
while ((ix.valid()) && (iy.valid()))
{ fx=float(*ix); fy=float(*iy); dev.draw(fx, fy); ++ix; ++iy; }
return(dev);
}
/*! \brief error bar directions
*
*/
enum Eerrdir {
//! +x (x to x+e)
Fdirright=1,
//! +y (y to y+e)
Fdirtop=2,
//! -x (x to x-e)
Fdirleft=3,
//! -y (y to y-e)
Fdirbottom=4,
//! +/-x (x-e to x+e)
Fdirhor=5,
//! +/-y (y-e to y+e)
Fdirver=6
};
/*! \brief draw error bars from series
*
* This implements \c cpgerrb functionality.
*
* \param dev device to be plotted on
* \param x series of x-coordinates
* \param y corresponding series of y-coordinates
* \param e corresponding series of error bars
* \param t length of terminals to be drawn
*
* \param SX series class for x
* \param SY series class for y
* \param SE series class for e
* \param T pgplot device class
*
* \return returns a reference to the device context
*/
template<class T, class SX, class SY, class SE>
T& errb(T& dev, const SX& x, const SY& y, const SE& e,
const Eerrdir& dir=Fdirver, const float& t=1.)
{
typename aff::Browser<SX> ix=x;
typename aff::Browser<SY> iy=y;
typename aff::Browser<SE> ie=e;
float fx=float(*ix);
float fy=float(*iy);
float fe=float(*ie);
int idir=int(dir);
while ((ix.valid()) && (iy.valid()) && (ie.valid()))
{ fx=float(*ix); fy=float(*iy); fe=float(*ie);
dev.err1(idir, fx, fy, fe, t); ++ix; ++iy; ++ie; }
return(dev);
}
} // namespace pgaff
......
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: fortranaffio.h,v 1.4 2006-06-14 07:50:25 tforb Exp $
* $Id: fortranaffio.h,v 1.5 2006-06-20 07:25:28 tforb Exp $
* \author Thomas Forbriger
* \date 16/05/2006
*
......@@ -14,6 +14,7 @@
* REVISIONS and CHANGES
* - 16/05/2006 V1.0 Thomas Forbriger
* - 13/06/2006 V1.1 we have to increase the iterator :-)
* - 19/06/2006 V1.2 provide a reading operator
*
* ============================================================================
*/
......@@ -22,25 +23,45 @@
#ifndef TF_FORTRANAFFIO_H_VERSION
#define TF_FORTRANAFFIO_H_VERSION \
"TF_FORTRANAFFIO_H V1.1 "
"TF_FORTRANAFFIO_H V1.2"
#define TF_FORTRANAFFIO_H_CVSID \
"$Id: fortranaffio.h,v 1.4 2006-06-14 07:50:25 tforb Exp $"
"$Id: fortranaffio.h,v 1.5 2006-06-20 07:25:28 tforb Exp $"
#include <aff/array.h>
#include <aff/series.h>
#include <aff/iterator.h>
#include <tfxx/fortranio.h>
namespace tfxx {
namespace fortranio {
namespace fortranio {
//! read an aff container from the file
template<class C>
void readaff(tfxx::fortranio::FortranBinInput& is, C& s)
{
aff::Iterator<C> i(s);
while (i.valid()) { is >> *i; ++i; }
}
//! read an aff container from the file
template<class C>
void readaff(tfxx::fortranio::FortranBinInput& is, C& s)
{
aff::Iterator<C> i(s);
while (i.valid()) { is >> *i; ++i; }
}
} // namespace fortranio
//! reading operator
template<class T>
tfxx::fortranio::FortranBinInput&
operator >>(tfxx::fortranio::FortranBinInput& is, aff::Series<T>& s)
{
readaff(is, s);
return(is);
}
//! reading operator
template<class T>
tfxx::fortranio::FortranBinInput&
operator >>(tfxx::fortranio::FortranBinInput& is, aff::Array<T>& s)
{
readaff(is, s);
return(is);
}
} // namespace fortranio
} // namespace tfxx
#endif // TF_FORTRANAFFIO_H_VERSION (includeguard)
......
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