home *** CD-ROM | disk | FTP | other *** search
- /*
- * Copyright (C) 1994, Silicon Graphics, Inc.
- * All Rights Reserved.
- *
- * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
- * the contents of this file may not be disclosed to third parties, copied or
- * duplicated in any form, in whole or in part, without the prior written
- * permission of Silicon Graphics, Inc.
- *
- * RESTRICTED RIGHTS LEGEND:
- * Use, duplication or disclosure by the Government is subject to restrictions
- * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
- * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
- * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
- * rights reserved under the Copyright Laws of the United States.
- */
- /*
- | Description:
- | This file defines the WorldInfo class. This is a separator
- | with a selection node and a set of noodle under it.
- | The WorldInfo class takes care of managing the noodles it contains.
- |
- | Author(s): Paul Isaacs
- |
- */
-
- #ifndef _SO_WORLD_INFO_
- #define _SO_WORLD_INFO_
-
- #include <Inventor/SbLinear.h>
- #include <Inventor/SoLists.h>
- #include <Inventor/nodes/SoSelection.h>
-
- extern class GeneralizedCylinder;
- extern class SoSeparator;
-
- //////////////////////////////////////////////////////////////////////////////
- //
- // Class: WorldInfo
- //
- //////////////////////////////////////////////////////////////////////////////
-
- class WorldInfo {
-
- public:
-
- WorldInfo();
- ~WorldInfo();
-
- SoSeparator *getWorldRoot() { return worldRoot; }
-
- // An argument of NULL will create an empty separator for the scene.
- void setScene( SoSeparator *newScene );
- SoSeparator *getScene() { return sceneRoot; }
- SbBool isSceneEmpty();
-
- char *getFileName() { return fileName; }
- void setFileName( char *newFileName );
-
-
-
- // Noodles may be added or deleted.
- void addNoodle( GeneralizedCylinder *newNoodle );
- void deleteNoodle( GeneralizedCylinder *noodleToRemove );
-
- void deleteCurrentNoodle();
- // Returns tghe new selection.
- GeneralizedCylinder * undeleteNoodle();
-
- GeneralizedCylinder *setFirstNoodleCurrent();
- GeneralizedCylinder *addNewNoodle();
-
- void setCurrentNoodle( GeneralizedCylinder *newNoodle );
- GeneralizedCylinder *getCurrentNoodle() { return currentNoodle; }
-
- SoType getManipType() { return manipType; }
- void setManipType( SoType newType );
-
- SoSeparator *getVanillaSceneCopy();
-
- SoSelection *getSelectorNode() { return selector; }
-
- protected:
-
- SoSeparator *worldRoot;
- SoSelection *selector;
- SoSeparator *sceneRoot;
-
- static void selectionCB( void *, SoPath *);
- static void deselectionCB( void *, SoPath *);
- static SoPath *pickFilterCB( void *, const SoPickedPoint *);
-
- private:
- GeneralizedCylinder *currentNoodle;
- char *fileName;
- SoType manipType;
-
- // Stores deleted pieces, most recently deleted added to end.
- // When undelete() is called, last entry is removed and put into scene.
- SoNodeList *deletedNoodles;
- };
-
- #endif /* _SO_WORLD_INFO_ */
-