DataNetwork.h 3.92 KB
Newer Older
hrchilds's avatar
hrchilds committed
1 2 3
#ifndef NETWORK_H
#define NETWORK_H

hrchilds's avatar
hrchilds committed
4
#include <avtSILRestriction.h>
hrchilds's avatar
hrchilds committed
5 6
#include <avtDataObject.h>
#include <avtDataObjectWriter.h>
hrchilds's avatar
hrchilds committed
7
#include <avtActor.h>
hrchilds's avatar
hrchilds committed
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
#include <avtPlot.h>
#include <Netnodes.h>
#include <string>
#include <vector>
#include <deque>

// ****************************************************************************
//  Class: DataNetwork
//
//  Purpose:
//      Stores a single AVT network.
//
//  Programmer: Jeremy Meredith
//  Creation:   September 29, 2000
//
//  Modifications:
//
//    Hank Childs, Wed Jan 17 10:26:34 PST 2001
//    Changed networks to be a database followed by a series of filters
//    followed by a plot.
//
//    Hank Childs, Tue Jun 12 14:42:09 PDT 2001
//    Changed type of filter to be the more arbitrary avtFilter.  Also added
//    a field for pipeline specifications.
//
//    Jeremy Meredith, Thu Jul 26 03:37:47 PDT 2001
//    Made networks use avtPluginFilters.
//
//    Jeremy Meredith, Fri Nov  9 10:22:05 PST 2001
//    Added a data specification, a plot type, and a network id.
//    Added a constructor and a method to release the used data.
//
//    Sean Ahern, Tue May 28 09:49:02 PDT 2002
//    Made this a tree.
//
hrchilds's avatar
hrchilds committed
43 44 45
//    Sean Ahern, Mon Dec 23 13:09:50 PST 2002
//    Okay, so it's not a tree.
//
hrchilds's avatar
hrchilds committed
46 47 48
//    Kathleen Bonnell, Wed Mar 31 16:53:03 PST 2004
//    Made some methods virtual, so this class can be inherited from. 
//
hrchilds's avatar
hrchilds committed
49 50 51
//    Mark C. Miller, Thu May 27 11:05:15 PDT 2004
//    Removed window attributes arg from GetActor method
//
hrchilds's avatar
hrchilds committed
52 53 54
//    Kathleen Bonnell, Thu Oct 21 15:55:46 PDT 2004 
//    Added ActorIsNull method. 
//
hrchilds's avatar
hrchilds committed
55 56 57 58 59
//    Mark C. Miller, Tue Jan  4 10:23:19 PST 2005
//    Changed id to nid
//    Added wid for window id 
//    Added methods to set/get window id
//
hrchilds's avatar
hrchilds committed
60 61 62 63
// ****************************************************************************
class DataNetwork
{
public:
hrchilds's avatar
hrchilds committed
64 65
             DataNetwork(void);
    virtual ~DataNetwork(void);
hrchilds's avatar
hrchilds committed
66

hrchilds's avatar
hrchilds committed
67 68
    void SetNetID(int _id) { nid = _id; };
    void SetWinID(int _id) { wid = _id; };
hrchilds's avatar
hrchilds committed
69
    void SetPlottype(const std::string &type) { plottype = type; };
hrchilds's avatar
hrchilds committed
70
    virtual void SetPlot(avtPlot *_plot) { plot = _plot; };
hrchilds's avatar
hrchilds committed
71 72 73 74 75
    void SetTerminalNode(Netnode* t) {terminalNode = t;};
    void AddNode(Netnode *n) { nodeList.push_back(n); };
    void SetPipelineSpec(avtPipelineSpecification_p s) {pspec = s;};
    avtDataObject_p GetOutput(void) { return terminalNode->GetOutput(); };
    void SetDataSpec(avtDataSpecification_p s) {dspec = s;};
hrchilds's avatar
hrchilds committed
76
    void SetTime(int time_) {time = time_;};
hrchilds's avatar
hrchilds committed
77

hrchilds's avatar
hrchilds committed
78
    virtual void ReleaseData(void);
hrchilds's avatar
hrchilds committed
79 80 81 82 83 84

    avtDataSpecification_p& GetDataSpec() {return dspec;};
    avtPipelineSpecification_p GetPipelineSpec() {return pspec;};
    avtDataObjectWriter_p GetWriter(avtDataObject_p dob,
                                    avtPipelineSpecification_p pspec,
                                    WindowAttributes *atts);
hrchilds's avatar
hrchilds committed
85 86
    int GetNetID(void) const { return nid; };
    int GetWinID(void) const { return wid; };
hrchilds's avatar
hrchilds committed
87
    Netnode* GetTerminalNode(void) { return terminalNode; };
hrchilds's avatar
hrchilds committed
88
    virtual avtPlot_p GetPlot(void) { return plot; };
hrchilds's avatar
hrchilds committed
89
    avtActor_p GetActor(avtDataObject_p dob);
hrchilds's avatar
hrchilds committed
90
    bool ActorIsNull(void) { return (*plotActor == NULL); };
hrchilds's avatar
hrchilds committed
91 92
    void SetNetDB(NetnodeDB *d) { netdb = d; };
    NetnodeDB* GetNetDB(void) { return netdb; };
hrchilds's avatar
hrchilds committed
93 94 95
    virtual int GetTime() {return time;};
    std::string &GetPlottype(void) { return plottype; };
    std::vector<Netnode*>       &GetNodeList(void) { return nodeList; }; 
hrchilds's avatar
hrchilds committed
96 97

protected:
hrchilds's avatar
hrchilds committed
98 99
    int                         nid;
    int                         wid;
hrchilds's avatar
hrchilds committed
100 101 102 103
    Netnode                    *terminalNode;
    std::vector<Netnode*>       nodeList;
    avtDataSpecification_p      dspec;
    avtDataObjectWriter_p       writer;
hrchilds's avatar
hrchilds committed
104 105 106
    avtActor_p                  plotActor;
    double                      bgColor[3];
    double                      fgColor[3];
hrchilds's avatar
hrchilds committed
107
    avtPipelineSpecification_p  pspec;
hrchilds's avatar
hrchilds committed
108
    NetnodeDB*                  netdb;
hrchilds's avatar
hrchilds committed
109 110
    avtPlot_p                   plot;
    std::string                 plottype;
hrchilds's avatar
hrchilds committed
111
    int                         time;
hrchilds's avatar
hrchilds committed
112 113 114
};

#endif