| http://www.sim.no/ http://www.coin3d.org/

SoMarkerSet.h
1 #ifndef COIN_SOMARKERSET_H
2 #define COIN_SOMARKERSET_H
3
4 /**************************************************************************\
5 *
6 * This file is part of the Coin 3D visualization library.
7 * Copyright (C) by Kongsberg Oil & Gas Technologies.
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * ("GPL") version 2 as published by the Free Software Foundation.
12 * See the file LICENSE.GPL at the root directory of this source
13 * distribution for additional information about the GNU GPL.
14 *
15 * For using Coin with software that can not be combined with the GNU
16 * GPL, and for taking advantage of the additional benefits of our
17 * support services, please contact Kongsberg Oil & Gas Technologies
18 * about acquiring a Coin Professional Edition License.
19 *
20 * See http://www.coin3d.org/ for more information.
21 *
22 * Kongsberg Oil & Gas Technologies, Bygdoy Alle 5, 0257 Oslo, NORWAY.
23 * http://www.sim.no/ sales@sim.no coin-support@coin3d.org
24 *
25 \**************************************************************************/
26
27 #include <Inventor/nodes/SoSubNode.h>
28 #include <Inventor/nodes/SoPointSet.h>
29 #include <Inventor/fields/SoMFInt32.h>
30
31 class COIN_DLL_API SoMarkerSet : public SoPointSet {
32 typedef SoPointSet inherited;
33
34 SO_NODE_HEADER(SoMarkerSet);
35
36 public:
37 static void initClass(void);
38 SoMarkerSet(void);
39
40 enum MarkerType {
41 NONE = -1,
42 CROSS_5_5, PLUS_5_5, MINUS_5_5, SLASH_5_5, BACKSLASH_5_5, BAR_5_5,
43 STAR_5_5, Y_5_5, LIGHTNING_5_5, WELL_5_5,
44
45 CIRCLE_LINE_5_5, SQUARE_LINE_5_5, DIAMOND_LINE_5_5, TRIANGLE_LINE_5_5,
46 RHOMBUS_LINE_5_5, HOURGLASS_LINE_5_5, SATELLITE_LINE_5_5,
47 PINE_TREE_LINE_5_5, CAUTION_LINE_5_5, SHIP_LINE_5_5,
48
49 CIRCLE_FILLED_5_5, SQUARE_FILLED_5_5, DIAMOND_FILLED_5_5,
50 TRIANGLE_FILLED_5_5, RHOMBUS_FILLED_5_5, HOURGLASS_FILLED_5_5,
51 SATELLITE_FILLED_5_5, PINE_TREE_FILLED_5_5, CAUTION_FILLED_5_5,
52 SHIP_FILLED_5_5,
53
54 CROSS_7_7, PLUS_7_7, MINUS_7_7, SLASH_7_7, BACKSLASH_7_7, BAR_7_7,
55 STAR_7_7, Y_7_7, LIGHTNING_7_7, WELL_7_7,
56
57 CIRCLE_LINE_7_7, SQUARE_LINE_7_7, DIAMOND_LINE_7_7, TRIANGLE_LINE_7_7,
58 RHOMBUS_LINE_7_7, HOURGLASS_LINE_7_7, SATELLITE_LINE_7_7,
59 PINE_TREE_LINE_7_7, CAUTION_LINE_7_7, SHIP_LINE_7_7,
60
61 CIRCLE_FILLED_7_7, SQUARE_FILLED_7_7, DIAMOND_FILLED_7_7,
62 TRIANGLE_FILLED_7_7, RHOMBUS_FILLED_7_7, HOURGLASS_FILLED_7_7,
63 SATELLITE_FILLED_7_7, PINE_TREE_FILLED_7_7, CAUTION_FILLED_7_7,
64 SHIP_FILLED_7_7,
65
66 CROSS_9_9, PLUS_9_9, MINUS_9_9, SLASH_9_9, BACKSLASH_9_9, BAR_9_9,
67 STAR_9_9, Y_9_9, LIGHTNING_9_9, WELL_9_9,
68
69 CIRCLE_LINE_9_9, SQUARE_LINE_9_9, DIAMOND_LINE_9_9, TRIANGLE_LINE_9_9,
70 RHOMBUS_LINE_9_9, HOURGLASS_LINE_9_9, SATELLITE_LINE_9_9,
71 PINE_TREE_LINE_9_9, CAUTION_LINE_9_9, SHIP_LINE_9_9,
72
73 CIRCLE_FILLED_9_9, SQUARE_FILLED_9_9, DIAMOND_FILLED_9_9,
74 TRIANGLE_FILLED_9_9, RHOMBUS_FILLED_9_9, HOURGLASS_FILLED_9_9,
75 SATELLITE_FILLED_9_9, PINE_TREE_FILLED_9_9, CAUTION_FILLED_9_9,
76 SHIP_FILLED_9_9,
77 NUM_MARKERS /* must be last, and is _not_ a marker :) */
78 };
79
80 SoMFInt32 markerIndex;
81
82 virtual void GLRender(SoGLRenderAction * action);
83 virtual void getPrimitiveCount(SoGetPrimitiveCountAction * action);
84
85 static int getNumDefinedMarkers(void);
86 static void addMarker(int idx, const SbVec2s & size,
87 const unsigned char * bytes, SbBool isLSBFirst = TRUE,
88 SbBool isUpToDown = TRUE);
89 static SbBool getMarker(int idx, SbVec2s & size,
90 const unsigned char *& bytes, SbBool & isLSBFirst);
91 static SbBool removeMarker(int idx);
92 static SbBool isMarkerBitSet(int idx, int bitNumber);
93
94 protected:
95 virtual ~SoMarkerSet();
96
97 private:
98 enum Binding {
99 OVERALL = 0,
100 PER_VERTEX
101 };
102 Binding findMaterialBinding(SoState * const state) const;
103 };
104
105 #endif // !COIN_SOMARKERSET_H
SoBase
The SoBase class is the top-level superclass for a number of class-hierarchies.SoBase provides the ba...
Definition: SoBase.h:36
SoMarkerSet::MarkerType
MarkerType
Definition: SoMarkerSet.h:40
SO_NODE_HEADER
#define SO_NODE_HEADER(classname)
SoPointSet::GLRender
virtual void GLRender(SoGLRenderAction *action)
Definition: SoPointSet.cpp:188
SoMFInt32
The SoMFInt32 class is a container for 32-bit integer values.This field is used where nodes...
Definition: SoMFInt32.h:30
SoPointSet::getPrimitiveCount
virtual void getPrimitiveCount(SoGetPrimitiveCountAction *action)
Definition: SoPointSet.cpp:318
SoState
The SoState class manages the Coin scenegraph traversal state data.The SoState class is used by actio...
Definition: SoState.h:35
SoGetPrimitiveCountAction
The SoGetPrimitiveCountAction class counts the primitives in a scene.Apply this action to a scene if ...
Definition: SoGetPrimitiveCountAction.h:34
SoMarkerSet
The SoMarkerSet class displays a set of 2D bitmap markers in 3D.This node uses the coordinates curren...
Definition: SoMarkerSet.h:31
SoPointSet
The SoPointSet class is used to display a set of 3D points.This node either uses the coordinates curr...
Definition: SoPointSet.h:31
SbVec2s
The SbVec2s class is a 2 dimensional vector with short integer coordinates.This vector class is used ...
Definition: SbVec2s.h:41
SoMarkerSet::markerIndex
SoMFInt32 markerIndex
Definition: SoMarkerSet.h:80
SoGLRenderAction
The SoGLRenderAction class renders the scene graph with OpenGL calls.Applying this method at a root n...
Definition: SoGLRenderAction.h:41

Copyright © 1998-2010 by Kongsberg Oil & Gas Technologies. All rights reserved.