home *** CD-ROM | disk | FTP | other *** search
/ ftptest.leeds.ac.uk / 2015.02.ftptest.leeds.ac.uk.tar / ftptest.leeds.ac.uk / bionet / CAE-GROUP / SCL-WIN3x / SCL.EXE / MGRNODE.H < prev    next >
C/C++ Source or Header  |  1994-08-06  |  4KB  |  135 lines

  1. #ifndef mgrnode_h
  2. #define mgrnode_h
  3.  
  4. /*
  5. * NIST STEP Editor Class Library
  6. * cleditor/mgrnode.h
  7. * February, 1994
  8. * David Sauder
  9. * K. C. Morris
  10.  
  11. * Development of this software was funded by the United States Government,
  12. * and is not subject to copyright.
  13. */
  14.  
  15. /* $Id: mgrnode.h,v 2.0.1.1 1994/04/05 16:41:57 sauderd Exp $ */ 
  16.  
  17.  
  18. /*#include <STEPattribute.h>*/
  19. #include <sdai.h>
  20. #include <Sentity.h>
  21.  
  22. class GenericNode;
  23. class DisplayNode;
  24. class STEPentity;
  25.  
  26. #include <gennode.h>
  27. #include <gennodelist.h>
  28. #include <gennodeinline.h>
  29. //#include <dispnode.h>
  30.  
  31. #include <editordefines.h>
  32.  
  33. class InstMgr;
  34.  
  35. //////////////////////////////////////////////////////////////////////////////
  36. // class MgrNode
  37. // If you delete this object, it deletes the STEPentity it represents,
  38. // the DisplayNode, and removes itself from any list it is in.
  39. //////////////////////////////////////////////////////////////////////////////
  40.  
  41. class MgrNode : public GenericNode
  42. {
  43.     friend class GenNodeList;
  44.     friend class MgrNodeList;
  45.     friend class InstMgr;
  46.     
  47. protected:
  48.     // currState, next, prev implement several lists
  49.     // based on currState:
  50.     // currState = (completeSE, incompleteSE, newSE, or deleteSE)
  51.     // every node will be on one of the four lists implemented by these:
  52.     stateEnum currState;
  53.  
  54.     // STEPentity this node is representing info for
  55.     STEPentity *se;
  56.     // this is the index (in the InstMgr master array) of the ptr to
  57.     //   this node.
  58.     int arrayIndex;
  59.  
  60.     // display info (SEE, etc) for this node
  61.     DisplayNode *di;
  62.  
  63. public:
  64.     // used for sentinel node on lists of MgrNodes
  65.     MgrNode();
  66.     MgrNode(STEPentity *se);
  67.     // 'listState' ==
  68.     //    completeSE - if reading valid exchange file
  69.     //    incompleteSE or completeSE - if reading working session file
  70.     //    newSE - if instance is created by user using editor (probe)
  71.     MgrNode(STEPentity *se, stateEnum listState);
  72.     MgrNode(STEPentity *se, stateEnum listState, MgrNodeList *list);
  73.     virtual ~MgrNode();
  74.  
  75. // STATE LIST OPERATIONS
  76.     int MgrNodeListMember(stateEnum s)    { return (currState == s); }
  77.     stateEnum  CurrState()        { return  currState;        }
  78.         // returns next or prev member variables
  79.         // i.e. next or previous node on curr state list
  80.             // searches current list for fileId
  81.     MgrNode *StateFindFileId(int fileId);
  82.  
  83.             // deletes from previous cmd list, 
  84.             //    & puts on cmd list cmdList
  85.     int ChangeList(MgrNodeList *cmdList);
  86.     int ChangeState(stateEnum s);
  87.  
  88.     // Removes from current list. 
  89.     //     Called before adding to diff list or when destructor is called.
  90.     void Remove();
  91.  
  92. // DISPLAY LIST OPERATIONS
  93.     void *SEE();
  94.  
  95.     displayStateEnum DisplayState();
  96.     int IsDisplayState(displayStateEnum ds);
  97.  
  98.         // returns next or prev member variables
  99.         // i.e. next or previous node on display state list
  100.     GenericNode *NextDisplay();
  101.     GenericNode *PrevDisplay();
  102.  
  103.             // deletes from previous cmd list, 
  104.             //    & puts on cmd list cmdList
  105.     int ChangeList(DisplayNodeList *cmdList);
  106.             // deletes from previous display list, assigns ds to 
  107.             //    displayState & puts on list dsList
  108.     int ChangeState(displayStateEnum ds);
  109.  
  110. //     might not want these three? since it won't actually map them?
  111.     void MapModifiable(DisplayNodeList *dnList);
  112.     void MapViewable(DisplayNodeList *dnList);
  113.     void UnMap(DisplayNodeList *dnList);
  114.  
  115. // ACCESS FUNCTIONS
  116.     int GetFileId();
  117.     STEPentity *GetSTEPentity()    { return se; }
  118.     DisplayNode *&DisplayNode() { return di; }
  119.     int ArrayIndex()        { return arrayIndex; }
  120.     void ArrayIndex(int index)    { arrayIndex = index; }
  121.  
  122. protected:
  123.  
  124. private:
  125.     void Init(STEPentity *s, stateEnum listState, MgrNodeList *list);
  126. };
  127.  
  128. //////////////////////////////////////////////////////////////////////////////
  129. // class MgrNode inline functions
  130. // these functions don't rely on any inline functions (its own or
  131. //    other classes) that aren't in this file except for Generic functions
  132. //////////////////////////////////////////////////////////////////////////////
  133.  
  134. #endif
  135.