1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
|
#include "Plot.hxx"
#include "SystemPlots.hxx"
#include "DataTypes.hxx"
#include "Array.hxx"
#include "BPF.hxx"
#include <iostream>
void buildTestArray( CLAM::Array<CLAM::TData>& array )
{
array.Resize( 100 );
array.SetSize( 100 );
for ( int i = 0; i < 100; i++ )
{
array[i] = float(i)*0.005;
}
}
void buildTestBPF( CLAM::BPF& bpf )
{
bpf.Insert( -10.0, 0.0 );
bpf.Insert( -5.0, 0.45 );
bpf.Insert( 0.0, 1.0 );
bpf.Insert( 5.0, 0.75 );
bpf.Insert( 10.0, 0.0 );
}
int main( int argc, char** argv )
{
CLAM::Array<CLAM::TData> population;
CLAM::BPF func;
CLAMVM::Plot myUglyPlot( "igloo" );
myUglyPlot.SetPosition( 100, 100 );
myUglyPlot.SetSize( 640, 480 );
myUglyPlot.SetLabel( "My ugly plot" );
myUglyPlot.SetYRange( 0.0, 1.0 );
myUglyPlot.SetColor( CLAMVM::Color( 150, 150, 0 ) );
CLAMVM::Plot myUglyPlot2( "igloo2" );
myUglyPlot2.SetPosition( 100, 100 );
myUglyPlot2.SetSize( 640, 480 );
myUglyPlot2.SetLabel( "My ugly plot" );
myUglyPlot2.SetYRange( 0.0, 1.0 );
myUglyPlot2.SetTooltipFormat( "x=%3.2f, P(x)=%1.3f" );
myUglyPlot2.SetColor( CLAMVM::Color( 0, 150, 150 ) );
buildTestArray( population );
myUglyPlot.SetData( population, 0, 99 );
//CLAMVM::SystemPlots::Display( "igloo" );
buildTestBPF( func );
myUglyPlot2.SetData( func );
//CLAMVM::SystemPlots::Display( "igloo2" );
CLAMVM::SystemPlots::Display( "igloo" );
return 0;
}
|