00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef _SO_INDEXED_MARKER_SET_
00026 #define _SO_INDEXED_MARKER_SET_
00027
00028 #include <Inventor/nodes/SoIndexedPointSet.h>
00029 #include <Inventor/nodes/SoMarkerSet.h>
00030 #include <Inventor/fields/SoMFInt32.h>
00031 #include <Inventor/nodes/SoPointSet.h>
00032 #include <Inventor/fields/SoSFFloat.h>
00033 #include <Inventor/fields/SoMFFloat.h>
00034 #include <Inventor/caches/SoCache.h>
00035
00036 class SbThreadMutex;
00037 class SoMarker;
00038 class SoMarkerSizeCache;
00039
00040
00041
00145 class SoIndexedMarkerSet : public SoIndexedPointSet {
00146 SO_NODE_HEADER(SoIndexedMarkerSet) ;
00147
00148 public:
00157 SoMFInt32 markerIndex ;
00158
00170 SoMFFloat markerScale;
00171
00180 SoSFFloat markerGlobalScale;
00181
00185 SoIndexedMarkerSet() ;
00186
00188 enum MarkerType {
00190 CROSS_5_5,
00192 PLUS_5_5,
00194 MINUS_5_5,
00196 SLASH_5_5,
00198 BACKSLASH_5_5,
00200 BAR_5_5,
00202 STAR_5_5,
00204 Y_5_5,
00206 LIGHTNING_5_5,
00208 WELL_5_5,
00209
00211 CIRCLE_LINE_5_5,
00213 SQUARE_LINE_5_5,
00215 DIAMOND_LINE_5_5,
00217 TRIANGLE_LINE_5_5,
00219 RHOMBUS_LINE_5_5,
00221 HOURGLASS_LINE_5_5,
00223 SATELLITE_LINE_5_5,
00225 PINE_TREE_LINE_5_5,
00227 CAUTION_LINE_5_5,
00229 SHIP_LINE_5_5,
00230
00232 CIRCLE_FILLED_5_5,
00234 SQUARE_FILLED_5_5,
00236 DIAMOND_FILLED_5_5,
00238 TRIANGLE_FILLED_5_5,
00240 RHOMBUS_FILLED_5_5,
00242 HOURGLASS_FILLED_5_5,
00244 SATELLITE_FILLED_5_5,
00246 PINE_TREE_FILLED_5_5,
00248 CAUTION_FILLED_5_5,
00250 SHIP_FILLED_5_5,
00251
00253 CROSS_7_7,
00255 PLUS_7_7,
00257 MINUS_7_7,
00259 SLASH_7_7,
00261 BACKSLASH_7_7,
00263 BAR_7_7,
00265 STAR_7_7,
00267 Y_7_7,
00269 LIGHTNING_7_7,
00271 WELL_7_7,
00272
00274 CIRCLE_LINE_7_7,
00276 SQUARE_LINE_7_7,
00278 DIAMOND_LINE_7_7,
00280 TRIANGLE_LINE_7_7,
00282 RHOMBUS_LINE_7_7,
00284 HOURGLASS_LINE_7_7,
00286 SATELLITE_LINE_7_7,
00288 PINE_TREE_LINE_7_7,
00290 CAUTION_LINE_7_7,
00292 SHIP_LINE_7_7,
00293
00295 CIRCLE_FILLED_7_7,
00297 SQUARE_FILLED_7_7,
00299 DIAMOND_FILLED_7_7,
00301 TRIANGLE_FILLED_7_7,
00303 RHOMBUS_FILLED_7_7,
00305 HOURGLASS_FILLED_7_7,
00307 SATELLITE_FILLED_7_7,
00309 PINE_TREE_FILLED_7_7,
00311 CAUTION_FILLED_7_7,
00313 SHIP_FILLED_7_7,
00314
00316 CROSS_9_9,
00318 PLUS_9_9,
00320 MINUS_9_9,
00322 SLASH_9_9,
00324 BACKSLASH_9_9,
00326 BAR_9_9,
00328 STAR_9_9,
00330 Y_9_9,
00332 LIGHTNING_9_9,
00334 WELL_9_9,
00335
00337 CIRCLE_LINE_9_9,
00339 SQUARE_LINE_9_9,
00341 DIAMOND_LINE_9_9,
00343 TRIANGLE_LINE_9_9,
00345 RHOMBUS_LINE_9_9,
00347 HOURGLASS_LINE_9_9,
00349 SATELLITE_LINE_9_9,
00351 PINE_TREE_LINE_9_9,
00353 CAUTION_LINE_9_9,
00355 SHIP_LINE_9_9,
00356
00358 CIRCLE_FILLED_9_9,
00360 SQUARE_FILLED_9_9,
00362 DIAMOND_FILLED_9_9,
00364 TRIANGLE_FILLED_9_9,
00366 RHOMBUS_FILLED_9_9,
00368 HOURGLASS_FILLED_9_9,
00370 SATELLITE_FILLED_9_9,
00372 PINE_TREE_FILLED_9_9,
00374 CAUTION_FILLED_9_9,
00376 SHIP_FILLED_9_9
00377 };
00378
00382 static int getNumDefinedMarkers();
00383
00399 static void addMarker( int markerIndex, const SbVec2s& size, const unsigned char* bytes,
00400 SbBool isLSBFirst = TRUE, SbBool isUpToDown = TRUE );
00401
00419 static void addMarker( int markerIndex,
00420 const SbVec2s& size,
00421 const unsigned char* bytes,
00422 const uint32_t* orderedRGBA,
00423 SbBool isLSBFirst = TRUE,
00424 SbBool isUpToDown = TRUE );
00425
00430 static void addMarker( int markerIndex, SoMarker* marker );
00431
00439 static SbBool getMarker( int markerIndex,
00440 SbVec2s& size,
00441 const unsigned char*& bytes,
00442 SbBool& isLSBFirst );
00443
00452 static SbBool getMarker( int markerIndex,
00453 SbVec2s& size,
00454 const unsigned char* &bytes,
00455 const uint32_t*& orderedRGBA,
00456 SbBool& isLSBFirst );
00457
00462 static SoMarker* getMarker( int markerIndex );
00463
00468 static SbBool removeMarker( int markerIndex );
00469
00470 private:
00471
00472 virtual void generatePrimitives( SoAction* action );
00473
00474
00475 virtual SbBool isRenderingPointsOrLines( SoGLRenderAction* action );
00476
00477
00478 virtual ~SoIndexedMarkerSet();
00479
00480 private:
00481 virtual void GLRender( SoGLRenderAction* action );
00482 virtual void getPrimitiveCount( SoGetPrimitiveCountAction* action );
00483
00484
00485 virtual void computeBBox( SoAction* action, SbBox3f& box, SbVec3f& center );
00486
00487 private:
00488 static void initClass();
00489 static void exitClass();
00490
00491 static SbBool isMarkerBitSet( int markerIndex, int bitNumber );
00492
00493
00494 virtual void notify( SoNotList* list );
00495 };
00496
00497
00498 inline SbBool
00499 SoIndexedMarkerSet::isRenderingPointsOrLines(SoGLRenderAction *)
00500 {
00501 return TRUE;
00502 }
00503
00504 #endif
00505
00506
00507