Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

SoMarkerSet.h

00001 /**************************************************************************\
00002  *
00003  *  This file is part of the Coin 3D visualization library.
00004  *  Copyright (C) 1998-2002 by Systems in Motion. All rights reserved.
00005  *
00006  *  This library is free software; you can redistribute it and/or
00007  *  modify it under the terms of the GNU Lesser General Public License
00008  *  version 2.1 as published by the Free Software Foundation. See the
00009  *  file LICENSE.LGPL at the root directory of the distribution for
00010  *  more details.
00011  *
00012  *  If you want to use Coin for applications not compatible with the
00013  *  LGPL, please contact SIM to acquire a Professional Edition license.
00014  *
00015  *  Systems in Motion, Prof Brochs gate 6, 7030 Trondheim, NORWAY
00016  *  http://www.sim.no support@sim.no Voice: +47 22114160 Fax: +47 22207097
00017  *
00018 \**************************************************************************/
00019 
00020 #ifndef COIN_SOMARKERSET_H
00021 #define COIN_SOMARKERSET_H
00022 
00023 #include <Inventor/nodes/SoSubNode.h>
00024 #include <Inventor/nodes/SoPointSet.h>
00025 #include <Inventor/fields/SoMFInt32.h>
00026 
00027 
00028 class COIN_DLL_API SoMarkerSet : public SoPointSet {
00029   typedef SoPointSet inherited;
00030 
00031   SO_NODE_HEADER(SoMarkerSet);
00032 
00033 public:
00034   static void initClass(void);
00035   SoMarkerSet(void);
00036 
00037   enum MarkerType {
00038     CROSS_5_5, PLUS_5_5, MINUS_5_5, SLASH_5_5, BACKSLASH_5_5, BAR_5_5,
00039     STAR_5_5, Y_5_5, LIGHTNING_5_5, WELL_5_5,
00040 
00041     CIRCLE_LINE_5_5, SQUARE_LINE_5_5, DIAMOND_LINE_5_5, TRIANGLE_LINE_5_5,
00042     RHOMBUS_LINE_5_5, HOURGLASS_LINE_5_5, SATELLITE_LINE_5_5,
00043     PINE_TREE_LINE_5_5, CAUTION_LINE_5_5, SHIP_LINE_5_5,
00044 
00045     CIRCLE_FILLED_5_5, SQUARE_FILLED_5_5, DIAMOND_FILLED_5_5,
00046     TRIANGLE_FILLED_5_5, RHOMBUS_FILLED_5_5, HOURGLASS_FILLED_5_5,
00047     SATELLITE_FILLED_5_5, PINE_TREE_FILLED_5_5, CAUTION_FILLED_5_5,
00048     SHIP_FILLED_5_5,
00049 
00050     CROSS_7_7, PLUS_7_7, MINUS_7_7, SLASH_7_7, BACKSLASH_7_7, BAR_7_7,
00051     STAR_7_7, Y_7_7, LIGHTNING_7_7, WELL_7_7,
00052 
00053     CIRCLE_LINE_7_7, SQUARE_LINE_7_7, DIAMOND_LINE_7_7, TRIANGLE_LINE_7_7,
00054     RHOMBUS_LINE_7_7, HOURGLASS_LINE_7_7, SATELLITE_LINE_7_7,
00055     PINE_TREE_LINE_7_7, CAUTION_LINE_7_7, SHIP_LINE_7_7,
00056 
00057     CIRCLE_FILLED_7_7, SQUARE_FILLED_7_7, DIAMOND_FILLED_7_7,
00058     TRIANGLE_FILLED_7_7, RHOMBUS_FILLED_7_7, HOURGLASS_FILLED_7_7,
00059     SATELLITE_FILLED_7_7, PINE_TREE_FILLED_7_7, CAUTION_FILLED_7_7,
00060     SHIP_FILLED_7_7,
00061 
00062     CROSS_9_9, PLUS_9_9, MINUS_9_9, SLASH_9_9, BACKSLASH_9_9, BAR_9_9,
00063     STAR_9_9, Y_9_9, LIGHTNING_9_9, WELL_9_9,
00064 
00065     CIRCLE_LINE_9_9, SQUARE_LINE_9_9, DIAMOND_LINE_9_9, TRIANGLE_LINE_9_9,
00066     RHOMBUS_LINE_9_9, HOURGLASS_LINE_9_9, SATELLITE_LINE_9_9,
00067     PINE_TREE_LINE_9_9, CAUTION_LINE_9_9, SHIP_LINE_9_9,
00068 
00069     CIRCLE_FILLED_9_9, SQUARE_FILLED_9_9, DIAMOND_FILLED_9_9,
00070     TRIANGLE_FILLED_9_9, RHOMBUS_FILLED_9_9, HOURGLASS_FILLED_9_9,
00071     SATELLITE_FILLED_9_9, PINE_TREE_FILLED_9_9, CAUTION_FILLED_9_9,
00072     SHIP_FILLED_9_9,
00073     NUM_MARKERS /* must be last, and is _not_ a marker :) */
00074   };
00075 
00076   SoMFInt32 markerIndex;
00077 
00078   virtual void GLRender(SoGLRenderAction * action);
00079   virtual void getPrimitiveCount(SoGetPrimitiveCountAction * action);
00080 
00081   static int getNumDefinedMarkers(void);
00082   static void addMarker(int markerIndex, const SbVec2s & size,
00083                         const unsigned char * bytes, SbBool isLSBFirst = TRUE,
00084                         SbBool isUpToDown = TRUE);
00085   static SbBool getMarker(int markerIndex, SbVec2s & size,
00086                           const unsigned char *& bytes, SbBool & isLSBFirst);
00087   static SbBool removeMarker(int markerIndex);
00088   static SbBool isMarkerBitSet(int markerIndex, int bitNumber);
00089 
00090 protected:
00091   virtual ~SoMarkerSet();
00092 
00093 private:
00094   enum Binding {
00095     OVERALL = 0,
00096     PER_VERTEX
00097   };
00098   Binding findMaterialBinding(SoState * const state) const;
00099 };
00100 
00101 #endif // !COIN_SOMARKERSET_H

Generated at Tue Mar 5 03:31:15 2002 for Coin by doxygen1.2.9 written by Dimitri van Heesch, © 1997-2001