home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / exampleCode / inventor / noodle / WorldInfo.h < prev   
Encoding:
C/C++ Source or Header  |  1994-08-02  |  3.0 KB  |  104 lines

  1. /*
  2.  * Copyright (C) 1994, Silicon Graphics, Inc.
  3.  * All Rights Reserved.
  4.  *
  5.  * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  6.  * the contents of this file may not be disclosed to third parties, copied or
  7.  * duplicated in any form, in whole or in part, without the prior written
  8.  * permission of Silicon Graphics, Inc.
  9.  *
  10.  * RESTRICTED RIGHTS LEGEND:
  11.  * Use, duplication or disclosure by the Government is subject to restrictions
  12.  * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  13.  * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
  14.  * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
  15.  * rights reserved under the Copyright Laws of the United States.
  16.  */
  17. /*
  18.  |   Description:
  19.  |    This file defines the WorldInfo class. This is a separator
  20.  |      with a selection node and a set of noodle under it.
  21.  |      The WorldInfo class takes care of managing the noodles it contains.
  22.  |
  23.  |   Author(s): Paul Isaacs
  24.  |
  25.  */
  26.  
  27. #ifndef  _SO_WORLD_INFO_
  28. #define  _SO_WORLD_INFO_
  29.  
  30. #include <Inventor/SbLinear.h>
  31. #include <Inventor/SoLists.h>
  32. #include <Inventor/nodes/SoSelection.h>
  33.  
  34. extern class GeneralizedCylinder;
  35. extern class SoSeparator;
  36.  
  37. //////////////////////////////////////////////////////////////////////////////
  38. //
  39. //  Class: WorldInfo
  40. //
  41. //////////////////////////////////////////////////////////////////////////////
  42.  
  43. class WorldInfo {
  44.     
  45.   public:
  46.  
  47.     WorldInfo();
  48.     ~WorldInfo();
  49.  
  50.     SoSeparator *getWorldRoot() { return worldRoot; }
  51.  
  52.     // An argument of NULL will create an empty separator for the scene.
  53.     void setScene( SoSeparator *newScene );
  54.     SoSeparator *getScene() { return sceneRoot; }
  55.     SbBool isSceneEmpty();
  56.  
  57.     char *getFileName() { return fileName; }
  58.     void    setFileName( char *newFileName );
  59.  
  60.  
  61.  
  62.     // Noodles may be added or deleted.
  63.     void addNoodle( GeneralizedCylinder *newNoodle );
  64.     void deleteNoodle( GeneralizedCylinder *noodleToRemove );
  65.  
  66.     void deleteCurrentNoodle();
  67.     // Returns tghe new selection.
  68.     GeneralizedCylinder * undeleteNoodle();
  69.  
  70.     GeneralizedCylinder *setFirstNoodleCurrent();
  71.     GeneralizedCylinder *addNewNoodle();
  72.  
  73.     void setCurrentNoodle( GeneralizedCylinder *newNoodle );
  74.     GeneralizedCylinder *getCurrentNoodle() { return currentNoodle; }
  75.  
  76.     SoType  getManipType() { return manipType; }
  77.     void    setManipType( SoType newType );
  78.  
  79.     SoSeparator *getVanillaSceneCopy();
  80.  
  81.     SoSelection *getSelectorNode() { return selector; }
  82.  
  83.   protected:
  84.  
  85.     SoSeparator  *worldRoot;
  86.     SoSelection  *selector;
  87.     SoSeparator  *sceneRoot;
  88.  
  89.     static void selectionCB( void *, SoPath *);
  90.     static void deselectionCB( void *, SoPath *);
  91.     static SoPath *pickFilterCB( void *, const SoPickedPoint *);
  92.  
  93.   private:
  94.     GeneralizedCylinder *currentNoodle;
  95.     char                *fileName;
  96.     SoType              manipType;
  97.  
  98.     // Stores deleted pieces, most recently deleted added to end.
  99.     // When undelete() is called, last entry is removed and put into scene.
  100.     SoNodeList *deletedNoodles;
  101. };
  102.  
  103. #endif /* _SO_WORLD_INFO_ */
  104.