// ************************************************************************* //
//  File: BinnerViewerPluginInfo.C
// ************************************************************************* //

#include <BinnerPluginInfo.h>
#include <BinnerFilter.h>

#if defined(__APPLE__)
#define GetViewerInfo Binner_GetViewerInfo
#endif

// ****************************************************************************
//  Function:  GetViewerInfo
//
//  Purpose:
//    Return a new ViewerPluginInfo for the Binner operator.
//
//  Programmer: cristina -- generated by xml2info
//  Creation:   Thu Mar 30 12:05:26 PDT 2006
//
// ****************************************************************************
extern "C" ViewerOperatorPluginInfo* GetViewerInfo()
{
    BinnerViewerPluginInfo::InitializeGlobalObjects();
    return new BinnerViewerPluginInfo;
}

//
// Storage for static data elements.
//
Binner *BinnerViewerPluginInfo::clientAtts = NULL;
Binner *BinnerViewerPluginInfo::defaultAtts = NULL;

// ****************************************************************************
//  Method:  BinnerViewerPluginInfo::InitializeGlobalObjects
//
//  Purpose:
//    Initialize the operator atts.
//
//  Programmer: cristina -- generated by xml2info
//  Creation:   Thu Mar 30 12:05:26 PDT 2006
//
// ****************************************************************************
void
BinnerViewerPluginInfo::InitializeGlobalObjects()
{
    BinnerViewerPluginInfo::clientAtts  = new Binner;
    BinnerViewerPluginInfo::defaultAtts = new Binner;
}

// ****************************************************************************
//  Method: BinnerViewerPluginInfo::GetClientAtts
//
//  Purpose:
//    Return a pointer to the viewer client attributes.
//
//  Returns:    A pointer to the viewer client attributes.
//
//  Programmer: cristina -- generated by xml2info
//  Creation:   Thu Mar 30 12:05:26 PDT 2006
//
// ****************************************************************************

AttributeSubject *
BinnerViewerPluginInfo::GetClientAtts()
{
    return clientAtts;
}

// ****************************************************************************
//  Method: BinnerViewerPluginInfo::GetDefaultAtts
//
//  Purpose:
//    Return a pointer to the viewer default attributes.
//
//  Returns:    A pointer to the viewer default attributes.
//
//  Programmer: cristina -- generated by xml2info
//  Creation:   Thu Mar 30 12:05:26 PDT 2006
//
// ****************************************************************************

AttributeSubject *
BinnerViewerPluginInfo::GetDefaultAtts()
{
    return defaultAtts;
}

// ****************************************************************************
//  Method: BinnerViewerPluginInfo::SetClientAtts
//
//  Purpose:
//    Set the viewer client attributes.
//
//  Arguments:
//    atts      A pointer to the new client attributes.
//
//  Programmer: cristina -- generated by xml2info
//  Creation:   Thu Mar 30 12:05:26 PDT 2006
//
// ****************************************************************************

void
BinnerViewerPluginInfo::SetClientAtts(AttributeSubject *atts)
{
    *clientAtts = *(Binner *)atts;
    clientAtts->Notify();
}

// ****************************************************************************
//  Method: BinnerViewerPluginInfo::GetClientAtts
//
//  Purpose:
//    Get the viewer client attributes.
//
//  Arguments:
//    atts      A pointer to return the client default attributes in.
//
//  Programmer: cristina -- generated by xml2info
//  Creation:   Thu Mar 30 12:05:26 PDT 2006
//
// ****************************************************************************

void
BinnerViewerPluginInfo::GetClientAtts(AttributeSubject *atts)
{
    *(Binner *)atts = *clientAtts;
}

// ****************************************************************************
//  Method: BinnerViewerPluginInfo::InitializeOperatorAtts
//
//  Purpose:
//    Initialize the operator attributes to the default attributes.
//
//  Arguments:
//    atts      The attribute subject to initialize.
//    md        The metadata used to initialize.
//    atts      The variable name used to initialize.
//
//  Programmer: cristina -- generated by xml2info
//  Creation:   Thu Mar 30 12:05:26 PDT 2006
//
// ****************************************************************************

void
BinnerViewerPluginInfo::InitializeOperatorAtts(AttributeSubject *atts,
                                              const ViewerPlot *plot,
                                              const bool fromDefault)
{
    if (fromDefault)
        *(Binner*)atts = *defaultAtts;
    else
        *(Binner*)atts = *clientAtts;
}

// ****************************************************************************
//  Method: BinnerViewerPluginInfo::XPMIconData
//
//  Purpose:
//    Return a pointer to the icon data.
//
//  Returns:    A pointer to the icon data.
//
//  Programmer: cristina -- generated by xml2info
//  Creation:   Thu Mar 30 12:05:26 PDT 2006
//
// ****************************************************************************

#include <icon.xpm>
const char **
BinnerViewerPluginInfo::XPMIconData() const
{
    return icon_xpm;
}
