MeVisLabToolboxReference
MeVisLab/Standard/Sources/Inventor/SoView2D/SoView2DExtensionElement.h
Go to the documentation of this file.
00001 #ifndef __SoView2DExtensionElement_H
00002 #define __SoView2DExtensionElement_H
00003 //----------------------------------------------------------------------------------
00004 // **InsertLicense** code
00005 //----------------------------------------------------------------------------------
00007 
00013 //----------------------------------------------------------------------------------
00014 
00015 #ifndef __SoView2DSystem_H
00016 #include "SoView2DSystem.h"
00017 #endif
00018 
00019 //--------- disable VC++ warnings---------
00020 #ifdef WIN32
00021 #pragma warning (disable : 4355)
00022 #pragma warning (disable : 4275)
00023 #pragma warning (disable : 4251)
00024 #pragma warning (disable : 4138)
00025 #pragma warning (disable : 4800)
00026 #endif
00027 
00028 #include "XVEnterScope.h"
00029 #include <Inventor/elements/SoReplacedElement.h>
00030 #include <Inventor/SoLists.h>
00031 #include "XVLeaveScope.h"
00032 
00033 class SoView2DExtension;
00034 
00035 typedef enum ExtensionDrawingOrder {
00036   NORMAL_ORDER = 0,
00037   REVERSED_ORDER,
00038   SOVIEW2D_ORDER,
00039   PARENT_NORMAL_ORDER,
00040   PARENT_REVERSED_ORDER,
00041   PARENT_SOVIEW2D_ORDER,
00042   UNKNOWN_ORDER
00043 };
00044 
00045 //=============================================================
00051 //=============================================================
00052 SoEXTENDER class SOVIEW2D_API SoView2DExtensionElement : public SoReplacedElement {
00053 
00054     SO_ELEMENT_HEADER(SoView2DExtensionElement);
00055 
00056   public:
00057     virtual void    init(SoState *state);
00058 
00059     void  pop(SoState *state, const SoElement *prevTopElement);
00060     
00061     void  clearList();
00062     void  setDrawingOrder (ExtensionDrawingOrder d);
00063 
00064     // These methods are used by the SoView2DExtensionGroup node.
00065     // WARNING!  For proper caching behavior, the nodeList returned by
00066     // ::pushList() must be used ONLY as a later argument to
00067     // ::popList(), and you must NOT modify the list between the
00068     // push and the pop.  If you need the list for any other reason,
00069     // you MUST use the ::get() routine.
00070     static SoNodeList pushList(SoState *state);
00071     static void       popList (SoState *state, const SoNodeList &l);
00072 
00073     static ExtensionDrawingOrder  pushDrawingOrder(SoState *state);
00074     static void                   popDrawingOrder (SoState *state, const ExtensionDrawingOrder &d);
00075 
00076     
00077 
00079     static void     set(SoState *state, SoNode *node, SoView2DExtension *newPrimitive);
00080 
00082     static void     unsetList(SoState *state, SoNode *node);
00083 
00085     static const SoNodeList* get(SoState *state);
00086 
00088     static const SoView2DExtensionElement * getInstance(SoState *state);
00089 
00090     virtual SbBool matches(const SoElement *elt) const;
00091 
00092     virtual SoElement *copyMatchInfo() const;
00093 
00094     virtual void print(FILE *fp) const;
00095 
00096   SoINTERNAL public:
00098     static void     initClass();
00099 
00100   protected:
00101     virtual ~SoView2DExtensionElement() {}
00102 
00103     // List of collected SoView2dExtensions
00104     SoNodeList _data;
00105 
00106     ExtensionDrawingOrder _drawingOrder;
00107 };
00108 
00109 #endif
00110