Open Inventor Release 2024.1.1
 
Loading...
Searching...
No Matches
SoMarker.h
1/*=======================================================================
2 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
3 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
4 *** ***
5 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
6 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
7 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
8 *** ***
9 *** RESTRICTED RIGHTS LEGEND ***
10 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
11 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
12 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
13 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
14 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
15 *** ***
16 *** COPYRIGHT (C) 1996-2022 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : Nicolas DAGUISE (Feb 2008)
22**=======================================================================*/
23
24
25#ifndef _SO_MARKER_H_
26#define _SO_MARKER_H_
27
28#include <Inventor/nodes/SoNode.h>
29#include <Inventor/fields/SoMFUInt32.h>
30#include <Inventor/fields/SoSFBool.h>
31#include <Inventor/fields/SoMFUByte.h>
32#include <Inventor/fields/SoSFVec2s.h>
33#include <Inventor/fields/SoSFInt32.h>
34
35class SoState;
36class SoGLObjectCache;
37
38#define MARKER_HASH_TAB_SIZE 151
39
129class SoMarker : public SoNode
130{
131 SO_NODE_HEADER(SoMarker);
132
133public:
134
157
178
199
220
241
262
283
304
325 };
326
331
340
345
352
358
363
368
369private:
370
371 static void initClass();
372 static void exitClass();
373
374 virtual void notify( SoNotList* list );
375
379 int getMarkerIndex()
380 { return m_markerIndex; }
381
385 void setMarkerIndex( const int tindex )
386 { m_markerIndex = tindex; }
387
391 static int getNumDefinedMarkers();
392
396 static int getMaxIndexDefinedMarker();
397
401 static void addMarker(int markerIndex,
402 const SbVec2s &size,
403 const unsigned char *bytes,
404 const uint32_t *orderedRGBA,
405 SbBool isLSBFirst = TRUE,
406 SbBool isUpToDown = TRUE);
410 static void addMarker(int markerIndex, SoMarker* marker );
411
415 static SbBool removeMarker(int markerIndex);
416
417 static SoMarker* getMarkerDesc( int markerInd );
418
419 static SbBool isMarkerBitSet(int markerIndex, int bitNumber) ;
420
421 // Update the list of all instancied SoMarkerSet
422 static void updateListInstanciedMarkerSet();
423 static void addMarkerSetDependency(SoNode* );
424 static void removeMarkerSetDependency(SoNode* );
425
426private:
430 virtual ~SoMarker();
431
432 SbBool useDL;
433
434 virtual SbBool readInstance(SoInput *in, unsigned short flags);
435
436private:
437
438 // Index of the marker
439 int m_markerIndex;
440
441 // Marker associated displayList
442 SoGLObjectCache* m_objCache;
443
444 // Marker hash table
445 static SbPList m_markerHashTab[MARKER_HASH_TAB_SIZE];
446
447 // Create/Destroy the list of predefined markers
448 static void createListOfPreDefinedMarkers();
449 static void destroyListOfPreDefinedMarkers();
450 static bool m_isBuildingPredefinedMarkers;
451
452 // Return the marker hash table index from a marker index
453 static inline int getMarkerHashTabIndex(int markerIndex);
454
455 // List of instancied SoMarkerSet
456 static SbPList m_listInstanciedMarkerSet;
457
458 void setPredefined(bool b);
459
460 bool m_predefined;
461 bool m_prevUpToDown;
462
463 // Cache last marker used by isMarkerBitSet() method
464 static int s_cachedCurrentMarkerIndex;
465};
466
467#endif // !_SO_MARKER_H_
468
469
List of generic (void *) pointers.
Definition SbPList.h:77
2D vector class.
Definition SbVec.h:700
Used to read Open Inventor data files.
Definition SoInput.h:363
Multiple-value field containing any number of uint8_t integers.
Definition SoMFUByte.h:66
Multiple-value field containing any number of uint32_t integers.
Definition SoMFUInt32.h:90
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Defines a custom...
Definition SoMarker.h:130
MarkerType
Marker type.
Definition SoMarker.h:136
@ BACKSLASH_7_7
Backslash 7x7.
Definition SoMarker.h:209
@ SATELLITE_FILLED_7_7
Satellite filled 7x7.
Definition SoMarker.h:255
@ Y_5_5
Y 5x5.
Definition SoMarker.h:152
@ LIGHTNING_5_5
Lightning 5x5.
Definition SoMarker.h:154
@ CIRCLE_FILLED_9_9
Circle filled 9x9.
Definition SoMarker.h:306
@ Y_9_9
Y 9x9.
Definition SoMarker.h:278
@ RHOMBUS_LINE_9_9
Rhombus line 9x9.
Definition SoMarker.h:293
@ SHIP_FILLED_9_9
Ship filled 9x9.
Definition SoMarker.h:324
@ SQUARE_LINE_7_7
Square line 7x7.
Definition SoMarker.h:224
@ SATELLITE_LINE_9_9
Satellite line 9x9.
Definition SoMarker.h:297
@ PINE_TREE_LINE_5_5
Pine line 5x5.
Definition SoMarker.h:173
@ DIAMOND_FILLED_7_7
Diamond filled 7x7.
Definition SoMarker.h:247
@ CIRCLE_LINE_9_9
Circle line 9x9.
Definition SoMarker.h:285
@ SATELLITE_LINE_5_5
Satellite line 5x5.
Definition SoMarker.h:171
@ RHOMBUS_FILLED_7_7
Rhombus filled 7x7.
Definition SoMarker.h:251
@ SHIP_LINE_7_7
Ship line 7x7.
Definition SoMarker.h:240
@ SLASH_5_5
Slash 5x5.
Definition SoMarker.h:144
@ CAUTION_FILLED_5_5
Caution filled 5x5.
Definition SoMarker.h:196
@ PLUS_7_7
Plus 7x7.
Definition SoMarker.h:203
@ BAR_7_7
Bar 7x7.
Definition SoMarker.h:211
@ SLASH_9_9
Slash 9x9.
Definition SoMarker.h:270
@ DIAMOND_FILLED_9_9
Diamond filled 9x9.
Definition SoMarker.h:310
@ SATELLITE_FILLED_9_9
Satellite filled 9x9.
Definition SoMarker.h:318
@ MINUS_5_5
Minus 5x5.
Definition SoMarker.h:142
@ CROSS_7_7
Cross 7x7.
Definition SoMarker.h:201
@ BAR_9_9
Bar 9x9.
Definition SoMarker.h:274
@ PLUS_9_9
Plus 9x9.
Definition SoMarker.h:266
@ WELL_9_9
Well 9x9.
Definition SoMarker.h:282
@ DIAMOND_FILLED_5_5
Diamond filled 5x5.
Definition SoMarker.h:184
@ BACKSLASH_5_5
Backslash 5x5.
Definition SoMarker.h:146
@ LIGHTNING_7_7
Lightning 7x7.
Definition SoMarker.h:217
@ RHOMBUS_FILLED_5_5
Rhombus filled 5x5.
Definition SoMarker.h:188
@ DIAMOND_LINE_7_7
Diamond line 7x7.
Definition SoMarker.h:226
@ HOURGLASS_FILLED_5_5
Hourglass filled 5x5.
Definition SoMarker.h:190
@ PINE_TREE_FILLED_9_9
Pine filled 9x9.
Definition SoMarker.h:320
@ CIRCLE_FILLED_7_7
Circle filled 7x7.
Definition SoMarker.h:243
@ MINUS_9_9
Minus 9x9.
Definition SoMarker.h:268
@ SATELLITE_FILLED_5_5
Satellite filled 5x5.
Definition SoMarker.h:192
@ SQUARE_LINE_9_9
Square line 9x9.
Definition SoMarker.h:287
@ STAR_7_7
Star 7x7.
Definition SoMarker.h:213
@ RHOMBUS_FILLED_9_9
Rhombus filled 9x9.
Definition SoMarker.h:314
@ CIRCLE_FILLED_5_5
Circle filled 5x5.
Definition SoMarker.h:180
@ CAUTION_LINE_5_5
Caution line 5x5.
Definition SoMarker.h:175
@ SQUARE_FILLED_7_7
Square filled 7x7.
Definition SoMarker.h:245
@ SHIP_FILLED_7_7
Ship filled 7x7.
Definition SoMarker.h:261
@ PINE_TREE_FILLED_5_5
Pine filled 5x5.
Definition SoMarker.h:194
@ CIRCLE_LINE_7_7
Circle line 7x7.
Definition SoMarker.h:222
@ DIAMOND_LINE_9_9
Diamond line 9x9.
Definition SoMarker.h:289
@ HOURGLASS_LINE_7_7
Hourglass line 7x7.
Definition SoMarker.h:232
@ TRIANGLE_LINE_9_9
Triangle line 9x9.
Definition SoMarker.h:291
@ CROSS_9_9
Cross 9x9.
Definition SoMarker.h:264
@ TRIANGLE_LINE_5_5
Triangle line 5x5.
Definition SoMarker.h:165
@ CAUTION_FILLED_7_7
Caution filled 7x7.
Definition SoMarker.h:259
@ BACKSLASH_9_9
Backslash 9x9.
Definition SoMarker.h:272
@ CAUTION_LINE_9_9
Caution line 9x9.
Definition SoMarker.h:301
@ SHIP_FILLED_5_5
Ship filled 5x5.
Definition SoMarker.h:198
@ DIAMOND_LINE_5_5
Diamond line 5x5.
Definition SoMarker.h:163
@ HOURGLASS_FILLED_7_7
Hourglass filled 7x7.
Definition SoMarker.h:253
@ MINUS_7_7
Minus 7x7.
Definition SoMarker.h:205
@ WELL_5_5
Well 5x5.
Definition SoMarker.h:156
@ TRIANGLE_FILLED_7_7
Triangle filled 7x7.
Definition SoMarker.h:249
@ RHOMBUS_LINE_7_7
Rhombus line 7x7.
Definition SoMarker.h:230
@ TRIANGLE_LINE_7_7
Triangle line 7x7.
Definition SoMarker.h:228
@ CROSS_5_5
Cross 5x5.
Definition SoMarker.h:138
@ SLASH_7_7
Slash 7x7.
Definition SoMarker.h:207
@ HOURGLASS_LINE_5_5
Hourglass line 5x5.
Definition SoMarker.h:169
@ TRIANGLE_FILLED_5_5
Triangle filled 5x5.
Definition SoMarker.h:186
@ PINE_TREE_LINE_7_7
Pine line 7x7.
Definition SoMarker.h:236
@ CAUTION_LINE_7_7
Caution line 7x7.
Definition SoMarker.h:238
@ CAUTION_FILLED_9_9
Caution filled 9x9.
Definition SoMarker.h:322
@ STAR_5_5
Star 5x5.
Definition SoMarker.h:150
@ TRIANGLE_FILLED_9_9
Triangle filled 9x9.
Definition SoMarker.h:312
@ HOURGLASS_FILLED_9_9
Hourglass filled 9x9.
Definition SoMarker.h:316
@ PLUS_5_5
Plus 5x5.
Definition SoMarker.h:140
@ WELL_7_7
Well 7x7.
Definition SoMarker.h:219
@ SATELLITE_LINE_7_7
Satellite line 7x7.
Definition SoMarker.h:234
@ SHIP_LINE_9_9
Ship line 9x9.
Definition SoMarker.h:303
@ SQUARE_LINE_5_5
Square line 5x5.
Definition SoMarker.h:161
@ LIGHTNING_9_9
Lightning 9x9.
Definition SoMarker.h:280
@ HOURGLASS_LINE_9_9
Hourglass line 9x9.
Definition SoMarker.h:295
@ STAR_9_9
Star 9x9.
Definition SoMarker.h:276
@ SHIP_LINE_5_5
Ship line 5x5.
Definition SoMarker.h:177
@ PINE_TREE_LINE_9_9
Pine line 9x9.
Definition SoMarker.h:299
@ CIRCLE_LINE_5_5
Circle line 5x5.
Definition SoMarker.h:159
@ PINE_TREE_FILLED_7_7
Pine filled 7x7.
Definition SoMarker.h:257
@ Y_7_7
Y 7x7.
Definition SoMarker.h:215
@ SQUARE_FILLED_9_9
Square filled 9x9.
Definition SoMarker.h:308
@ RHOMBUS_LINE_5_5
Rhombus line 5x5.
Definition SoMarker.h:167
@ SQUARE_FILLED_5_5
Square filled 5x5.
Definition SoMarker.h:182
@ BAR_5_5
Bar 5x5.
Definition SoMarker.h:148
SoMFUByte bitmap
Defines the current marker data buffer.
Definition SoMarker.h:339
SoSFBool upToDown
if TRUE, marker bitmap is described from down to up (that is bytes[0] is the left bottom corner of th...
Definition SoMarker.h:351
SoSFInt32 index
Defines the marker index.
Definition SoMarker.h:367
SoMarker()
Marker constructor.
SoSFVec2s size
Defines the size (in pixels) of the marker.
Definition SoMarker.h:362
SoMFUInt32 orderedRGBA
Defines the marker coloration mask.
Definition SoMarker.h:344
SoSFBool isLSBFirst
if TRUE, bits are ordered within a byte from Least Significant to most significant; otherwise the fir...
Definition SoMarker.h:357
Abstract base class for all database nodes.
Definition SoNode.h:145
Field containing a single Boolean value.
Definition SoSFBool.h:79
Field containing a int32_t integer.
Definition SoSFInt32.h:80
Field containing a two-dimensional vector.
Definition SoSFVec2s.h:52
Traversal state.
Definition SoState.h:74
int SbBool
Boolean type.
Definition SbBase.h:87