.TH "SoMarkerSet" 3 "Sat Oct 12 2013" "Version 4.0.0a" "Coin" \" -*- nroff -*- .ad l .nh .SH NAME SoMarkerSet \- .PP The \fBSoMarkerSet\fP class displays a set of 2D bitmap markers in 3D\&. .PP This node uses the coordinates currently on the state (or in the vertexProperty field) in order\&. The numPoints field specifies the number of points in the set\&. .SH SYNOPSIS .br .PP .PP \fC#include \fP .PP Inherits \fBSoPointSet\fP\&. .SS "Public Types" .in +1c .ti -1c .RI "enum \fBMarkerType\fP { \fBNONE\fP = -1, \fBCROSS_5_5\fP, \fBPLUS_5_5\fP, \fBMINUS_5_5\fP, \fBSLASH_5_5\fP, \fBBACKSLASH_5_5\fP, \fBBAR_5_5\fP, \fBSTAR_5_5\fP, \fBY_5_5\fP, \fBLIGHTNING_5_5\fP, \fBWELL_5_5\fP, \fBCIRCLE_LINE_5_5\fP, \fBSQUARE_LINE_5_5\fP, \fBDIAMOND_LINE_5_5\fP, \fBTRIANGLE_LINE_5_5\fP, \fBRHOMBUS_LINE_5_5\fP, \fBHOURGLASS_LINE_5_5\fP, \fBSATELLITE_LINE_5_5\fP, \fBPINE_TREE_LINE_5_5\fP, \fBCAUTION_LINE_5_5\fP, \fBSHIP_LINE_5_5\fP, \fBCIRCLE_FILLED_5_5\fP, \fBSQUARE_FILLED_5_5\fP, \fBDIAMOND_FILLED_5_5\fP, \fBTRIANGLE_FILLED_5_5\fP, \fBRHOMBUS_FILLED_5_5\fP, \fBHOURGLASS_FILLED_5_5\fP, \fBSATELLITE_FILLED_5_5\fP, \fBPINE_TREE_FILLED_5_5\fP, \fBCAUTION_FILLED_5_5\fP, \fBSHIP_FILLED_5_5\fP, \fBCROSS_7_7\fP, \fBPLUS_7_7\fP, \fBMINUS_7_7\fP, \fBSLASH_7_7\fP, \fBBACKSLASH_7_7\fP, \fBBAR_7_7\fP, \fBSTAR_7_7\fP, \fBY_7_7\fP, \fBLIGHTNING_7_7\fP, \fBWELL_7_7\fP, \fBCIRCLE_LINE_7_7\fP, \fBSQUARE_LINE_7_7\fP, \fBDIAMOND_LINE_7_7\fP, \fBTRIANGLE_LINE_7_7\fP, \fBRHOMBUS_LINE_7_7\fP, \fBHOURGLASS_LINE_7_7\fP, \fBSATELLITE_LINE_7_7\fP, \fBPINE_TREE_LINE_7_7\fP, \fBCAUTION_LINE_7_7\fP, \fBSHIP_LINE_7_7\fP, \fBCIRCLE_FILLED_7_7\fP, \fBSQUARE_FILLED_7_7\fP, \fBDIAMOND_FILLED_7_7\fP, \fBTRIANGLE_FILLED_7_7\fP, \fBRHOMBUS_FILLED_7_7\fP, \fBHOURGLASS_FILLED_7_7\fP, \fBSATELLITE_FILLED_7_7\fP, \fBPINE_TREE_FILLED_7_7\fP, \fBCAUTION_FILLED_7_7\fP, \fBSHIP_FILLED_7_7\fP, \fBCROSS_9_9\fP, \fBPLUS_9_9\fP, \fBMINUS_9_9\fP, \fBSLASH_9_9\fP, \fBBACKSLASH_9_9\fP, \fBBAR_9_9\fP, \fBSTAR_9_9\fP, \fBY_9_9\fP, \fBLIGHTNING_9_9\fP, \fBWELL_9_9\fP, \fBCIRCLE_LINE_9_9\fP, \fBSQUARE_LINE_9_9\fP, \fBDIAMOND_LINE_9_9\fP, \fBTRIANGLE_LINE_9_9\fP, \fBRHOMBUS_LINE_9_9\fP, \fBHOURGLASS_LINE_9_9\fP, \fBSATELLITE_LINE_9_9\fP, \fBPINE_TREE_LINE_9_9\fP, \fBCAUTION_LINE_9_9\fP, \fBSHIP_LINE_9_9\fP, \fBCIRCLE_FILLED_9_9\fP, \fBSQUARE_FILLED_9_9\fP, \fBDIAMOND_FILLED_9_9\fP, \fBTRIANGLE_FILLED_9_9\fP, \fBRHOMBUS_FILLED_9_9\fP, \fBHOURGLASS_FILLED_9_9\fP, \fBSATELLITE_FILLED_9_9\fP, \fBPINE_TREE_FILLED_9_9\fP, \fBCAUTION_FILLED_9_9\fP, \fBSHIP_FILLED_9_9\fP, \fBNUM_MARKERS\fP }" .br .in -1c .SS "Public Member Functions" .in +1c .ti -1c .RI "virtual \fBSoType\fP \fBgetTypeId\fP (void) const " .br .RI "\fIReturns the type identification of an object derived from a class inheriting \fBSoBase\fP\&. This is used for run-time type checking and 'downward' casting\&. \fP" .ti -1c .RI "\fBSoMarkerSet\fP (void)" .br .ti -1c .RI "virtual void \fBGLRender\fP (\fBSoGLRenderAction\fP *action)" .br .ti -1c .RI "virtual void \fBgetPrimitiveCount\fP (\fBSoGetPrimitiveCountAction\fP *action)" .br .in -1c .SS "Static Public Member Functions" .in +1c .ti -1c .RI "static \fBSoType\fP \fBgetClassTypeId\fP (void)" .br .RI "\fIThis static method returns the \fBSoType\fP object associated with objects of this class\&. \fP" .ti -1c .RI "static void \fBinitClass\fP (void)" .br .RI "\fISets up initialization for data common to all instances of this class, like submitting necessary information to the Coin type system\&. \fP" .ti -1c .RI "static int \fBgetNumDefinedMarkers\fP (void)" .br .ti -1c .RI "static void \fBaddMarker\fP (int idx, const \fBSbVec2s\fP &size, const unsigned char *bytes, SbBool isLSBFirst=TRUE, SbBool isUpToDown=TRUE)" .br .ti -1c .RI "static SbBool \fBgetMarker\fP (int idx, \fBSbVec2s\fP &size, const unsigned char *&bytes, SbBool &isLSBFirst)" .br .ti -1c .RI "static SbBool \fBremoveMarker\fP (int idx)" .br .ti -1c .RI "static SbBool \fBisMarkerBitSet\fP (int idx, int bitNumber)" .br .in -1c .SS "Public Attributes" .in +1c .ti -1c .RI "\fBSoMFInt32\fP \fBmarkerIndex\fP" .br .in -1c .SS "Protected Member Functions" .in +1c .ti -1c .RI "virtual const \fBSoFieldData\fP * \fBgetFieldData\fP (void) const " .br .ti -1c .RI "virtual \fB~SoMarkerSet\fP ()" .br .in -1c .SS "Static Protected Member Functions" .in +1c .ti -1c .RI "static const \fBSoFieldData\fP ** \fBgetFieldDataPtr\fP (void)" .br .in -1c .SS "Additional Inherited Members" .SH "Detailed Description" .PP The \fBSoMarkerSet\fP class displays a set of 2D bitmap markers in 3D\&. .PP This node uses the coordinates currently on the state (or in the vertexProperty field) in order\&. The numPoints field specifies the number of points in the set\&. In addition to supplying the user with a set of standard markers to choose from, it is also possible to specify one's own bitmaps for markers\&. .PP This node class is an extension versus the original SGI Inventor v2\&.1 API\&. In addition to being a Coin extension, it is also present in TGS' Inventor implementation\&. (Note that TGS's implementation doesn't support the NONE markerIndex value\&.) .PP \fBFILE FORMAT/DEFAULTS:\fP .PP .nf MarkerSet { vertexProperty NULL startIndex 0 numPoints -1 markerIndex 0 } .fi .PP .PP \fBSince:\fP .RS 4 TGS Inventor 2\&.5 .PP Coin 1\&.0 .RE .PP .SH "Member Enumeration Documentation" .PP .SS "enum \fBSoMarkerSet::MarkerType\fP" Defines the different standard markers\&. .SH "Constructor & Destructor Documentation" .PP .SS "SoMarkerSet::SoMarkerSet (void)" Constructor\&. .SS "SoMarkerSet::~SoMarkerSet ()\fC [protected]\fP, \fC [virtual]\fP" Destructor\&. .SH "Member Function Documentation" .PP .SS "\fBSoType\fP SoMarkerSet::getTypeId (void) const\fC [virtual]\fP" .PP Returns the type identification of an object derived from a class inheriting \fBSoBase\fP\&. This is used for run-time type checking and 'downward' casting\&. Usage example: .PP .PP .nf void foo(SoNode * node) { if (node->getTypeId() == SoFile::getClassTypeId()) { SoFile * filenode = (SoFile *)node; // safe downward cast, knows the type } } .fi .PP .PP For application programmers wanting to extend the library with new nodes, engines, nodekits, draggers or others: this method needs to be overridden in \fIall\fP subclasses\&. This is typically done as part of setting up the full type system for extension classes, which is usually accomplished by using the pre-defined macros available through for instance \fBInventor/nodes/SoSubNode\&.h\fP (SO_NODE_INIT_CLASS and SO_NODE_CONSTRUCTOR for node classes), Inventor/engines/SoSubEngine\&.h (for engine classes) and so on\&. .PP For more information on writing Coin extensions, see the class documentation of the toplevel superclasses for the various class groups\&. .PP Reimplemented from \fBSoPointSet\fP\&. .SS "const \fBSoFieldData\fP ** SoMarkerSet::getFieldDataPtr (void)\fC [static]\fP, \fC [protected]\fP" \fIThis API member is considered internal to the library, as it is not likely to be of interest to the application programmer\&.\fP .PP Reimplemented from \fBSoPointSet\fP\&. .SS "const \fBSoFieldData\fP * SoMarkerSet::getFieldData (void) const\fC [protected]\fP, \fC [virtual]\fP" Returns a pointer to the class-wide field data storage object for this instance\&. If no fields are present, returns \fCNULL\fP\&. .PP Reimplemented from \fBSoPointSet\fP\&. .SS "void SoMarkerSet::GLRender (\fBSoGLRenderAction\fP *action)\fC [virtual]\fP" Action method for the \fBSoGLRenderAction\fP\&. .PP This is called during rendering traversals\&. Nodes influencing the rendering state in any way or who wants to throw geometry primitives at OpenGL overrides this method\&. .PP Reimplemented from \fBSoPointSet\fP\&. .SS "void SoMarkerSet::getPrimitiveCount (\fBSoGetPrimitiveCountAction\fP *action)\fC [virtual]\fP" Action method for the \fBSoGetPrimitiveCountAction\fP\&. .PP Calculates the number of triangle, line segment and point primitives for the node and adds these to the counters of the \fIaction\fP\&. .PP Nodes influencing how geometry nodes calculates their primitive count also overrides this method to change the relevant state variables\&. .PP Reimplemented from \fBSoPointSet\fP\&. .SS "int SoMarkerSet::getNumDefinedMarkers (void)\fC [static]\fP" Returns the number of defined markers\&. .SS "void SoMarkerSet::addMarker (intidx, const \fBSbVec2s\fP &size, const unsigned char *bytes, SbBoolisLSBFirst = \fCTRUE\fP, SbBoolisUpToDown = \fCTRUE\fP)\fC [static]\fP" Replace the bitmap for the marker at \fIidx\fP with the representation given by \fIsize\fP dimensions with the bitmap data at \fIbytes\fP\&. \fIisLSBFirst\fP and \fIisUpToDown\fP indicates how the bitmap data is ordered\&. Does nothing if \fImarkerIndex\fP is NONE\&. .PP Here's a complete usage example which demonstrates how to set up a user-specified marker from a char-map\&. Note that the 'multi-colored' pixmap data is converted to a monochrome bitmap before being passed to \fBaddMarker()\fP because \fBaddMarker()\fP supports only bitmaps\&. .PP .PP .nf const int WIDTH = 18; const int HEIGHT = 19; const int BYTEWIDTH = (WIDTH + 7) / 2; const char coin_marker[WIDTH * HEIGHT + 1] = { '\&.+ ' '+@\&.+ ' ' \&.@#\&.+ ' ' +$@##\&.+ ' ' \&.%@&##\&.+ ' ' +$@&&*##\&.+ ' ' \&.%@&&*=##\&.+ ' ' +$@&&&&=-##\&.+ ' ' \&.%@&&&&&-;#&+ ' ' +$@&&&&&&=#\&. ' ' \&.%@&&&&*#\&. ' ' +$@&&&&#\&. ' ' \&.%@&@%@#\&. ' ' +$%@%\&.$@#\&. ' ' \&.%%\&. \&.$@#\&. ' ' +$\&. \&.$>#\&.' ' + \&.$\&. ' ' \&. ' ' ' }; int byteidx = 0; unsigned char bitmapbytes[BYTEWIDTH * HEIGHT]; for (int h = 0; h < HEIGHT; h++) { unsigned char bits = 0; for (int w = 0; w < WIDTH; w++) { if (coin_marker[(h * WIDTH) + w] != ' ') { bits |= (0x80 >> (w % 8)); } if ((((w + 1) % 8) == 0) || (w == WIDTH - 1)) { bitmapbytes[byteidx++] = bits; bits = 0; } } } int MYAPP_ARROW_IDX = SoMarkerSet::getNumDefinedMarkers(); // add at end SoMarkerSet::addMarker(MYAPP_ARROW_IDX, SbVec2s(WIDTH, HEIGHT), bitmapbytes, FALSE, TRUE); .fi .PP .PP This will provide you with an index given by MYAPP_ARROW_IDX which can be used in \fBSoMarkerSet::markerIndex\fP to display the new marker\&. .SS "SbBool SoMarkerSet::getMarker (intidx, \fBSbVec2s\fP &size, const unsigned char *&bytes, SbBool &isLSBFirst)\fC [static]\fP" Returns data for marker at \fIidx\fP in the \fIsize\fP, \fIbytes\fP and \fIisLSBFirst\fP parameters\&. .PP If no marker is defined for given \fIidx\fP, or \fBSoMarkerSet::markerIndex\fP is NONE (not removable), \fCFALSE\fP is returned\&. If everything is OK, \fCTRUE\fP is returned\&. .SS "SbBool SoMarkerSet::removeMarker (intidx)\fC [static]\fP" Removes marker at \fIidx\fP\&. .PP If no marker is defined for given \fIidx\fP, or \fBSoMarkerSet::markerIndex\fP is NONE (not removable), \fCFALSE\fP is returned\&. If everything is OK, \fCTRUE\fP is returned\&. .SS "SbBool SoMarkerSet::isMarkerBitSet (intidx, intbitNumber)\fC [static]\fP" Not supported in Coin\&. Should probably not have been part of the public Open Inventor API\&. .SH "Member Data Documentation" .PP .SS "\fBSoMFInt32\fP SoMarkerSet::markerIndex" Contains the set of index markers to display, defaults to 0 (CROSS_5_5)\&. The special value NONE renders nothing for that marker\&. .SH "Author" .PP Generated automatically by Doxygen for Coin from the source code\&.