/* groupPlot.m	by Paul Kunz	March 1991
 * Category extending the Group class to handle plot methods
 *
 * Copyright (C)  1992  The Board of Trustees of
 * The Leland Stanford Junior University.  All Rights Reserved.
 */

#import "groupPlot.h"

const char groupPlot_h_rcsid[] = GROUPPLOT_H_RCSID;
const char groupPlot_m_rcsid[] = "$Id: groupPlot.m,v 2.1 1993/02/14 21:55:16 pfkeb Exp $";

#import "Plot.h"

@implementation Group(Plot)

- addCutPlot:cutPlot;
{
    return [self makeGraphicsPerform:@selector(addCutPlot:) with:cutPlot];
}
- addHTupleToList:list
{
    [components makeObjectsPerform:@selector(addHTupleToList:) with:list];
    return self;
}

- addPlotToList:list
{
    [components makeObjectsPerform:@selector(addPlotToList:) with:list];
    return self;
}

- bindAxisW:(int *)dataDim
{
    return [self makeGraphicsPerform:@selector(bindAxisW:) with:dataDim];
}
- bindAxisX:(int *)dataDim
{
    return [self makeGraphicsPerform:@selector(bindAxisX:) with:dataDim];
}
- bindAxisXE:(int *)dataDim
{
    return [self makeGraphicsPerform:@selector(bindAxisXE:) with:dataDim];
}
- bindAxisY:(int *)dataDim
{
    return [self makeGraphicsPerform:@selector(bindAxisY:) with:dataDim];
}
- bindAxisYE:(int *)dataDim
{
    return [self makeGraphicsPerform:@selector(bindAxisYE:) with:dataDim];
}
- bindCuts
{
    [components makeObjectsPerform:@selector(bindCuts)];
    [cache free];
    cache = nil;
    return self;
}
- bindReference
{
    [components makeObjectsPerform:@selector(bindReference)];
    [cache free];
    cache = nil;
    return self;
}
- NameAxisW:(const void *) value
{
    return [self makeGraphicsPerform:@selector(NameAxisW:) with:value];
}
- NameAxisX:(const char *) value
{
    return [self makeGraphicsPerform:@selector(NameAxisX:) with:value];
}
- NameAxisY:(const char *) value
{
    return [self makeGraphicsPerform:@selector(NameAxisY:) with:value];
}
- NameAxisYE:(const void *) value
{
    return [self makeGraphicsPerform:@selector(NameAxisYE:) with:value];
}
- replace:oldTuple with:newTuple
{
    unsigned int	i;
    
    i = [components count];
    while ( i-- ) {
        [[components objectAt:i] replace:oldTuple with:newTuple];
    }
    return self;
} 
- replaceTupleWith:(const void *) value
{
    return [self makeGraphicsPerform:@selector(replaceTupleWith:) with:value];
}
- setAutoScale:(binding_t *)axis to:(const int *) value
{
    return [self makeGraphicsPerform:
                 @selector(setAutoScale:to:) with:axis with:value];
}
- setAxesFlag:(int *) value
{
    return [self makeGraphicsPerform:@selector(setAxesFlag:) with:value];
}
- setColorType:(const int *) value
{
    return [self makeGraphicsPerform:@selector(setColorType:) with:value];
}
- setDispType:(const void *) value
{
    return [self makeGraphicsPerform:@selector(setDispType:) with:value];
}
- setDrawType:(drawtype_t *) type
{
    return [self makeGraphicsPerform:@selector(setDrawType:) with:type];
}
- setGraphicView:view
{
    return [self makeGraphicsPerform:@selector(setGraphicView:) with:view];
}
- setLogScale:(binding_t *)axis to:(int *) value
{
    return [self makeGraphicsPerform:
                    @selector(setLogScale:to:) with:axis with:value];
}
- setNumBins:(binding_t *) axis to:(const int *) value
{
    return [self makeGraphicsPerform:@selector(setNumBins:to:)
				with:axis with:value];
}
- setRange:(binding_t* ) axis to:(const NXPoint *)p
{
    return [self makeGraphicsPerform:@selector(setRange:to:)
                    with:axis with:p];
}
- setTitle:(const char *)aString
{
    return [self makeGraphicsPerform:@selector(setTitle:) with:aString];
}
- setTitlesFlag:(const int *) value
{
    return [self makeGraphicsPerform:@selector(setTitlesFlag:) with:value];
}
- makeGraphicsPerform:(SEL)aSel with:(const void *)arg1 with:(const void *)arg2
{
    Plot		*plot;
    unsigned int	i;
    
    i = [components count];
    while ( i-- ) {
        plot = [components objectAt:i];
	[plot perform:aSel with:(id)arg1 with:(id)arg2];
    }
    [cache free];
    cache = nil;
    return self;
}

@end
