MeVisLab Toolbox Reference
SoView2DExtensionElement.h
Go to the documentation of this file.
1 /*************************************************************************************
2 **
3 ** Copyright 2007, MeVis Medical Solutions AG
4 **
5 ** The user may use this file in accordance with the license agreement provided with
6 ** the Software or, alternatively, in accordance with the terms contained in a
7 ** written agreement between the user and MeVis Medical Solutions AG.
8 **
9 ** For further information use the contact form at https://www.mevislab.de/contact
10 **
11 **************************************************************************************/
12 
13 
15 
16 #pragma once
17 
18 #include "SoView2DSystem.h"
19 
20 //--------- disable VC++ warnings---------
21 #ifdef WIN32
22 #pragma warning (disable : 4355)
23 #pragma warning (disable : 4275)
24 #pragma warning (disable : 4251)
25 #pragma warning (disable : 4138)
26 #pragma warning (disable : 4800)
27 #endif
28 
29 #include <Inventor/elements/SoReplacedElement.h>
30 #include <Inventor/SoLists.h>
31 
32 class SoView2DExtension;
33 
42 };
43 
44 //=============================================================
49 
50 //=============================================================
51 SoEXTENDER class SOVIEW2D_API SoView2DExtensionElement : public SoReplacedElement
52 {
53  SO_ELEMENT_HEADER(SoView2DExtensionElement);
54 
55 public:
56  void init(SoState *state) override;
57 
58  void pop(SoState *state, const SoElement *prevTopElement) override;
59 
60  void clearList();
62 
63  // These methods are used by the SoView2DExtensionGroup node.
64  // WARNING! For proper caching behavior, the nodeList returned by
65  // ::pushList() must be used ONLY as a later argument to
66  // ::popList(), and you must NOT modify the list between the
67  // push and the pop. If you need the list for any other reason,
68  // you MUST use the ::get() routine.
69  static SoNodeList pushList(SoState *state);
70  static void popList(SoState *state, const SoNodeList &l);
71 
72  static ExtensionDrawingOrder pushDrawingOrder(SoState *state);
73  static void popDrawingOrder(SoState *state, const ExtensionDrawingOrder &d);
74 
75 
76 
78  static void set(SoState *state, SoNode *node, SoView2DExtension *newPrimitive);
79 
81  static void unsetList(SoState *state, SoNode *node);
82 
84  static const SoNodeList* get(SoState *state);
85 
87  static const SoView2DExtensionElement * getInstance(SoState *state);
88 
89  SbBool matches(const SoElement *elt) const override;
90 
91  SoElement *copyMatchInfo() const override;
92 
93  void print(FILE *fp) const override;
94 
95  SoINTERNAL public:
97  static void initClass();
98 
99 protected:
101 
102  // List of collected SoView2dExtensions
103  SoNodeList _data;
104 
106 };
@ PARENT_NORMAL_ORDER
@ PARENT_SOVIEW2D_ORDER
@ PARENT_REVERSED_ORDER
#define SOVIEW2D_API
File to resolve system dependencies in View2D library.
SoView2DExtensionElement collects a list of SoView2DExtensions while the scene graph is traversed The...
ExtensionDrawingOrder _drawingOrder
void print(FILE *fp) const override
static const SoView2DExtensionElement * getInstance(SoState *state)
Returns the top (current) instance of the element in the state.
static const SoNodeList * get(SoState *state)
Get list of SoView2DExtensions from current state.
static SoNodeList pushList(SoState *state)
static void popDrawingOrder(SoState *state, const ExtensionDrawingOrder &d)
static void initClass()
Initializes the SoView2DExtensionElement class.
static ExtensionDrawingOrder pushDrawingOrder(SoState *state)
SbBool matches(const SoElement *elt) const override
void init(SoState *state) override
SoElement * copyMatchInfo() const override
void pop(SoState *state, const SoElement *prevTopElement) override
void setDrawingOrder(ExtensionDrawingOrder d)
static void set(SoState *state, SoNode *node, SoView2DExtension *newPrimitive)
Add extension to element state.
static void popList(SoState *state, const SoNodeList &l)
static void unsetList(SoState *state, SoNode *node)
unset extension list in element state
SoView2DExtension Base class for all View2DExtensions used for drawing and event handling on the View...