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_MARKER_SET_
00026 #define _SO_MARKER_SET_
00027
00028 #include <Inventor/nodes/SoPointSet.h>
00029 #include <Inventor/fields/SoMFInt32.h>
00030 #include <Inventor/fields/SoSFFloat.h>
00031 #include <Inventor/fields/SoMFFloat.h>
00032
00034 class SbThreadMutex;
00035 class SoMarker;
00036
00037 namespace markerset {
00038 class SoMarkerSetImpl;
00039 }
00040 class SoMarkerSizeCache;
00043
00044
00145 class SoMarkerSet : public SoPointSet {
00146 SO_NODE_HEADER(SoMarkerSet) ;
00147
00148 public:
00175 SoMFInt32 markerIndex;
00176
00189 SoMFFloat markerScale;
00190
00200 SoSFFloat markerGlobalScale;
00201
00205 SoMarkerSet() ;
00206
00208 enum MarkerType {
00210 CROSS_5_5,
00212 PLUS_5_5,
00214 MINUS_5_5,
00216 SLASH_5_5,
00218 BACKSLASH_5_5,
00220 BAR_5_5,
00222 STAR_5_5,
00224 Y_5_5,
00226 LIGHTNING_5_5,
00228 WELL_5_5,
00229
00231 CIRCLE_LINE_5_5,
00233 SQUARE_LINE_5_5,
00235 DIAMOND_LINE_5_5,
00237 TRIANGLE_LINE_5_5,
00239 RHOMBUS_LINE_5_5,
00241 HOURGLASS_LINE_5_5,
00243 SATELLITE_LINE_5_5,
00245 PINE_TREE_LINE_5_5,
00247 CAUTION_LINE_5_5,
00249 SHIP_LINE_5_5,
00250
00252 CIRCLE_FILLED_5_5,
00254 SQUARE_FILLED_5_5,
00256 DIAMOND_FILLED_5_5,
00258 TRIANGLE_FILLED_5_5,
00260 RHOMBUS_FILLED_5_5,
00262 HOURGLASS_FILLED_5_5,
00264 SATELLITE_FILLED_5_5,
00266 PINE_TREE_FILLED_5_5,
00268 CAUTION_FILLED_5_5,
00270 SHIP_FILLED_5_5,
00271
00273 CROSS_7_7,
00275 PLUS_7_7,
00277 MINUS_7_7,
00279 SLASH_7_7,
00281 BACKSLASH_7_7,
00283 BAR_7_7,
00285 STAR_7_7,
00287 Y_7_7,
00289 LIGHTNING_7_7,
00291 WELL_7_7,
00292
00294 CIRCLE_LINE_7_7,
00296 SQUARE_LINE_7_7,
00298 DIAMOND_LINE_7_7,
00300 TRIANGLE_LINE_7_7,
00302 RHOMBUS_LINE_7_7,
00304 HOURGLASS_LINE_7_7,
00306 SATELLITE_LINE_7_7,
00308 PINE_TREE_LINE_7_7,
00310 CAUTION_LINE_7_7,
00312 SHIP_LINE_7_7,
00313
00315 CIRCLE_FILLED_7_7,
00317 SQUARE_FILLED_7_7,
00319 DIAMOND_FILLED_7_7,
00321 TRIANGLE_FILLED_7_7,
00323 RHOMBUS_FILLED_7_7,
00325 HOURGLASS_FILLED_7_7,
00327 SATELLITE_FILLED_7_7,
00329 PINE_TREE_FILLED_7_7,
00331 CAUTION_FILLED_7_7,
00333 SHIP_FILLED_7_7,
00334
00336 CROSS_9_9,
00338 PLUS_9_9,
00340 MINUS_9_9,
00342 SLASH_9_9,
00344 BACKSLASH_9_9,
00346 BAR_9_9,
00348 STAR_9_9,
00350 Y_9_9,
00352 LIGHTNING_9_9,
00354 WELL_9_9,
00355
00357 CIRCLE_LINE_9_9,
00359 SQUARE_LINE_9_9,
00361 DIAMOND_LINE_9_9,
00363 TRIANGLE_LINE_9_9,
00365 RHOMBUS_LINE_9_9,
00367 HOURGLASS_LINE_9_9,
00369 SATELLITE_LINE_9_9,
00371 PINE_TREE_LINE_9_9,
00373 CAUTION_LINE_9_9,
00375 SHIP_LINE_9_9,
00376
00378 CIRCLE_FILLED_9_9,
00380 SQUARE_FILLED_9_9,
00382 DIAMOND_FILLED_9_9,
00384 TRIANGLE_FILLED_9_9,
00386 RHOMBUS_FILLED_9_9,
00388 HOURGLASS_FILLED_9_9,
00390 SATELLITE_FILLED_9_9,
00392 PINE_TREE_FILLED_9_9,
00394 CAUTION_FILLED_9_9,
00396 SHIP_FILLED_9_9
00397 };
00398
00402 static int getNumDefinedMarkers();
00403
00419 static void addMarker(int markerIndex, const SbVec2s &size, const unsigned char *bytes,
00420 SbBool isLSBFirst = TRUE, SbBool isUpToDown = TRUE);
00421
00439 static void addMarker(int markerIndex, const SbVec2s &size,
00440 const unsigned char *bytes,
00441 const uint32_t *orderedRGBA,
00442 SbBool isLSBFirst = TRUE, SbBool isUpToDown = TRUE);
00443
00448 static void addMarker(int markerIndex, SoMarker* marker );
00449
00457 static SbBool getMarker(int markerIndex,
00458 SbVec2s &size,
00459 const unsigned char *&bytes,
00460 SbBool &isLSBFirst);
00461
00470 static SbBool getMarker(int markerIndex,
00471 SbVec2s &size,
00472 const unsigned char *&bytes,
00473 const uint32_t *&orderedRGBA,
00474 SbBool &isLSBFirst);
00475
00480 static SoMarker* getMarker( int markerIndex );
00481
00486 static SbBool removeMarker(int markerIndex);
00487
00488 private:
00489 virtual void GLRender(SoGLRenderAction *action);
00490 virtual void getPrimitiveCount(SoGetPrimitiveCountAction *action);
00491
00492
00493 virtual void computeBBox( SoAction *action, SbBox3f &box, SbVec3f ¢er );
00494
00495 static SbBool isMarkerBitSet(int markerIndex, int bitNumber);
00496
00497 private:
00498 static void initClass();
00499 static void exitClass();
00500 SbBool callShouldGLRender(SoGLRenderAction *action, SbBool isPointOrLines);
00501
00502 SoINTERNAL private:
00503 virtual ~SoMarkerSet();
00504
00505
00506 virtual void generatePrimitives(SoAction *action);
00507 virtual void invokePointCallbacks_(SoAction *action, const SoPrimitiveVertex *v, const uint32_t index);
00508
00509 virtual void notify(SoNotList *list);
00510
00511 private:
00512
00514 markerset::SoMarkerSetImpl* m_MarkerSetShaderImpl;
00515 markerset::SoMarkerSetImpl* m_MarkerSetRasterImpl;
00517 void updateImpl(markerset::SoMarkerSetImpl* impl, SoNotList* list);
00519 markerset::SoMarkerSetImpl* chooseImplementation(SoState* state);
00520
00521
00522 SoRayPickAction* m_currentPickAction;
00523 SoMarkerSizeCache* m_markerSizeCache;
00524 };
00525
00526 #endif // !_SO_MARKER_SET_
00527
00528
00529