Coin Logo 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) 1998-2007 by Systems in Motion. All rights reserved.
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 Systems in Motion about acquiring
18  * a Coin Professional Edition License.
19  *
20  * See http://www.coin3d.org/ for more information.
21  *
22  * Systems in Motion, Postboks 1283, Pirsenteret, 7462 Trondheim, 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 
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
SoState
The SoState class manages the Coin scenegraph traversal state data.
Definition: SoState.h:35
SoMField::getNum
int getNum(void) const
Definition: SoMField.h:86
SbViewportRegion::getViewportSizePixels
const SbVec2s & getViewportSizePixels(void) const
Definition: SbViewportRegion.cpp:425
SoMFInt32
The SoMFInt32 class is a container for 32-bit integer values.
Definition: SoMFInt32.h:30
SoState::pop
void pop(void)
Definition: SoState.cpp:284
SoMarkerSet::SoMarkerSet
SoMarkerSet(void)
Definition: SoMarkerSet.cpp:115
SbMatrix
The SbMatrix class is a 4x4 dimensional representation of a matrix.
Definition: SbMatrix.h:37
SoMarkerSet::markerIndex
SoMFInt32 markerIndex
Definition: SoMarkerSet.h:80
SoVertexShape::shouldGLRender
virtual SbBool shouldGLRender(SoGLRenderAction *action)
Definition: SoVertexShape.cpp:176
SoMarkerSet::getNumDefinedMarkers
static int getNumDefinedMarkers(void)
Definition: SoMarkerSet.cpp:1288
SoMarkerSet::MarkerType
MarkerType
Definition: SoMarkerSet.h:40
SoNode::GLRender
virtual void GLRender(SoGLRenderAction *action)
Definition: SoNode.cpp:904
SbMatrix::multVecMatrix
void multVecMatrix(const SbVec3f &src, SbVec3f &dst) const
Definition: SbMatrix.cpp:1357
SoState::push
void push(void)
Definition: SoState.cpp:265
SbBox3f
The SbBox3f class is an abstraction for an axis aligned 3 dimensional box.
Definition: SbBox3f.h:37
SoGetPrimitiveCountAction::addNumImage
void addNumImage(const int num)
Definition: SoGetPrimitiveCountAction.cpp:287
SoDebugError::postWarning
static void postWarning(const char *const source, const char *const format,...)
Definition: SoDebugError.cpp:324
SoPointSet::GLRender
virtual void GLRender(SoGLRenderAction *action)
Definition: SoPointSet.cpp:188
SoPointSet::getPrimitiveCount
virtual void getPrimitiveCount(SoGetPrimitiveCountAction *action)
Definition: SoPointSet.cpp:317
SoNode::getPrimitiveCount
virtual void getPrimitiveCount(SoGetPrimitiveCountAction *action)
Definition: SoNode.cpp:846
SoPointSet::numPoints
SoSFInt32 numPoints
Definition: SoPointSet.h:40
SoMarkerSet::~SoMarkerSet
virtual ~SoMarkerSet()
Definition: SoMarkerSet.cpp:124
SoNonIndexedShape::startIndex
SoSFInt32 startIndex
Definition: SoNonIndexedShape.h:40
SbVec2s
The SbVec2s class is a 2 dimensional vector with short integer coordinates.
Definition: SbVec2s.h:37
SoMarkerSet::removeMarker
static SbBool removeMarker(int idx)
Definition: SoMarkerSet.cpp:1461
SbList
The SbList class is a template container class for lists.
Definition: SoType.h:46
SoPointSet
The SoPointSet class is used to display a set of 3D points.
Definition: SoPointSet.h:31
SoShape::shouldPrimitiveCount
SbBool shouldPrimitiveCount(SoGetPrimitiveCountAction *action)
Definition: SoShape.cpp:1485
SoBase
The SoBase class is the top-level superclass for a number of class-hierarchies.
Definition: SoBase.h:41
SoAction::getState
SoState * getState(void) const
Definition: SoAction.cpp:1028
SoMarkerSet::getMarker
static SbBool getMarker(int idx, SbVec2s &size, const unsigned char *&bytes, SbBool &isLSBFirst)
Definition: SoMarkerSet.cpp:1439
SoMarkerSet::GLRender
virtual void GLRender(SoGLRenderAction *action)
Definition: SoMarkerSet.cpp:1125
SbVec3f
The SbVec3f class is a 3 dimensional vector with floating point coordinates.
Definition: SbVec3f.h:37
SoMarkerSet::isMarkerBitSet
static SbBool isMarkerBitSet(int idx, int bitNumber)
Definition: SoMarkerSet.cpp:1476
SbViewportRegion
The SbViewportRegion class is a viewport within a full window.
Definition: SbViewportRegion.h:31
SbViewVolume
The SbViewVolume class is a viewing volume in 3D space.
Definition: SbViewVolume.h:41
SoMarkerSet::getPrimitiveCount
virtual void getPrimitiveCount(SoGetPrimitiveCountAction *action)
Definition: SoMarkerSet.cpp:1253
SoMarkerSet
The SoMarkerSet class displays a set of 2D bitmap markers in 3D.
Definition: SoMarkerSet.h:31
SoVertexShape::vertexProperty
SoSFNode vertexProperty
Definition: SoVertexShape.h:50
SoMarkerSet::addMarker
static void addMarker(int idx, const SbVec2s &size, const unsigned char *bytes, SbBool isLSBFirst=1, SbBool isUpToDown=1)
Definition: SoMarkerSet.cpp:1396
SoGLRenderAction
The SoGLRenderAction class renders the scene graph with OpenGL calls.
Definition: SoGLRenderAction.h:39
SoGetPrimitiveCountAction
The SoGetPrimitiveCountAction class counts the primitives in a scene.
Definition: SoGetPrimitiveCountAction.h:32
SoVertexShape::getVertexData
void getVertexData(SoState *state, const SoCoordinateElement *&coords, const SbVec3f *&normals, const SbBool neednormals)
Definition: SoVertexShape.cpp:268

Copyright © 1998-2007 by Systems in Motion AS. All rights reserved.

Generated on Wed Jul 24 2019 for Coin by Doxygen. 1.8.17