ConeViewerPluginInfo.C 4.89 KB
Newer Older
hrchilds's avatar
hrchilds committed
1 2 3 4 5 6 7 8 9 10 11 12 13
// ************************************************************************* //
//  File: ConeViewerPluginInfo.C
// ************************************************************************* //

#include <ConePluginInfo.h>
#include <ConeAttributes.h>

// ****************************************************************************
//  Function:  GetViewerInfo
//
//  Purpose:
//    Return a new ViewerPluginInfo for the Cone operator.
//
hrchilds's avatar
hrchilds committed
14 15
//  Programmer: kbonnell -- generated by xml2info
//  Creation:   Tue Sep 9 16:01:28 PST 2003
hrchilds's avatar
hrchilds committed
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
//
// ****************************************************************************
extern "C" ViewerOperatorPluginInfo* GetViewerInfo()
{
    ConeViewerPluginInfo::InitializeGlobalObjects();
    return new ConeViewerPluginInfo;
}

//
// Storage for static data elements.
//
ConeAttributes *ConeViewerPluginInfo::clientAtts = NULL;
ConeAttributes *ConeViewerPluginInfo::defaultAtts = NULL;

// ****************************************************************************
//  Method:  ConeViewerPluginInfo::InitializeGlobalObjects
//
//  Purpose:
//    Initialize the operator atts.
//
hrchilds's avatar
hrchilds committed
36 37
//  Programmer: kbonnell -- generated by xml2info
//  Creation:   Tue Sep 9 16:01:28 PST 2003
hrchilds's avatar
hrchilds committed
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
//
// ****************************************************************************
void
ConeViewerPluginInfo::InitializeGlobalObjects()
{
    ConeViewerPluginInfo::clientAtts  = new ConeAttributes;
    ConeViewerPluginInfo::defaultAtts = new ConeAttributes;
}

// ****************************************************************************
//  Method: ConeViewerPluginInfo::GetClientAtts
//
//  Purpose:
//    Return a pointer to the viewer client attributes.
//
//  Returns:    A pointer to the viewer client attributes.
//
hrchilds's avatar
hrchilds committed
55 56
//  Programmer: kbonnell -- generated by xml2info
//  Creation:   Tue Sep 9 16:01:28 PST 2003
hrchilds's avatar
hrchilds committed
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
//
// ****************************************************************************

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

// ****************************************************************************
//  Method: ConeViewerPluginInfo::GetDefaultAtts
//
//  Purpose:
//    Return a pointer to the viewer default attributes.
//
//  Returns:    A pointer to the viewer default attributes.
//
hrchilds's avatar
hrchilds committed
74 75
//  Programmer: kbonnell -- generated by xml2info
//  Creation:   Tue Sep 9 16:01:28 PST 2003
hrchilds's avatar
hrchilds committed
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
//
// ****************************************************************************

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

// ****************************************************************************
//  Method: ConeViewerPluginInfo::SetClientAtts
//
//  Purpose:
//    Set the viewer client attributes.
//
//  Arguments:
//    atts      A pointer to the new client attributes.
//
hrchilds's avatar
hrchilds committed
94 95
//  Programmer: kbonnell -- generated by xml2info
//  Creation:   Tue Sep 9 16:01:28 PST 2003
hrchilds's avatar
hrchilds committed
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114
//
// ****************************************************************************

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

// ****************************************************************************
//  Method: ConeViewerPluginInfo::GetClientAtts
//
//  Purpose:
//    Get the viewer client attributes.
//
//  Arguments:
//    atts      A pointer to return the client default attributes in.
//
hrchilds's avatar
hrchilds committed
115 116
//  Programmer: kbonnell -- generated by xml2info
//  Creation:   Tue Sep 9 16:01:28 PST 2003
hrchilds's avatar
hrchilds committed
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134
//
// ****************************************************************************

void
ConeViewerPluginInfo::GetClientAtts(AttributeSubject *atts)
{
    *(ConeAttributes *)atts = *clientAtts;
}

// ****************************************************************************
//  Method: ConeViewerPluginInfo::InitializeOperatorAtts
//
//  Purpose:
//    Initialize the operator attributes to the default attributes.
//
//  Arguments:
//    atts      The attribute subject to initialize.
//
hrchilds's avatar
hrchilds committed
135 136
//  Programmer: kbonnell -- generated by xml2info
//  Creation:   Tue Sep 9 16:01:28 PST 2003
hrchilds's avatar
hrchilds committed
137 138 139 140 141
//
// ****************************************************************************

void
ConeViewerPluginInfo::InitializeOperatorAtts(AttributeSubject *atts,
hrchilds's avatar
hrchilds committed
142 143
                                              const ViewerPlot *plot,
                                              const bool fromDefault)
hrchilds's avatar
hrchilds committed
144
{
hrchilds's avatar
hrchilds committed
145 146 147 148
    if (fromDefault)
        *(ConeAttributes*)atts = *defaultAtts;
    else
        *(ConeAttributes*)atts = *clientAtts;
hrchilds's avatar
hrchilds committed
149 150 151 152 153 154 155 156 157 158
}

// ****************************************************************************
//  Method: ConeViewerPluginInfo::XPMIconData
//
//  Purpose:
//    Return a pointer to the icon data.
//
//  Returns:    A pointer to the icon data.
//
hrchilds's avatar
hrchilds committed
159 160
//  Programmer: kbonnell -- generated by xml2info
//  Creation:   Tue Sep 9 16:01:28 PST 2003
hrchilds's avatar
hrchilds committed
161 162 163 164 165 166 167 168 169
//
// ****************************************************************************

#include <Cone.xpm>
const char **
ConeViewerPluginInfo::XPMIconData() const
{
    return Cone_xpm;
}