37#include <Inventor/errors/SoDebugError.h>
38#include <Inventor/misc/SoState.h>
39#include <Inventor/actions/SoGLRenderAction.h>
40#include <Inventor/nodes/SoPointSet.h>
42#include <Inventor/elements/SoCoordinateElement.h>
43#include <Inventor/elements/SoCacheElement.h>
44#include <Inventor/elements/SoLazyElement.h>
49static void drawMarker(SoAction*,
int);
50static GLubyte* getBitmap(
int,
int,
char []);
74static char plus_5_5[] = {
81static char asterisk_5_5[] = {
88static char cross_5_5[] = {
95static char star_5_5[] = {
102static char circle_line_5_5[] = {
109static char circle_filled_5_5[] = {
116static char triangle_up_line_5_5[] = {
123static char triangle_up_filled_5_5[] = {
130static char triangle_down_line_5_5[] = {
137static char triangle_down_filled_5_5[] = {
144static char david_star_line_5_5[] = {
151static char david_star_filled_5_5[] = {
158static char swiss_cross_line_5_5[] = {
165static char swiss_cross_filled_5_5[] = {
172static char diamond_line_5_5[] = {
179static char diamond_filled_5_5[] = {
186static char square_line_5_5[] = {
193static char square_filled_5_5[] = {
203static char plus_7_7[] = {
212static char asterisk_7_7[] = {
221static char cross_7_7[] = {
230static char star_7_7[] = {
239static char circle_line_7_7[] = {
248static char circle_filled_7_7[] = {
257static char triangle_up_line_7_7[] = {
266static char triangle_up_filled_7_7[] = {
275static char triangle_down_line_7_7[] = {
284static char triangle_down_filled_7_7[] = {
293static char david_star_line_7_7[] = {
302static char david_star_filled_7_7[] = {
311static char swiss_cross_line_7_7[] = {
320static char swiss_cross_filled_7_7[] = {
329static char diamond_line_7_7[] = {
338static char diamond_filled_7_7[] = {
347static char square_line_7_7[] = {
356static char square_filled_7_7[] = {
369static char plus_9_9[] = {
380static char asterisk_9_9[] = {
391static char cross_9_9[] = {
402static char star_9_9[] = {
413static char circle_line_9_9[] = {
424static char circle_filled_9_9[] = {
435static char triangle_up_line_9_9[] = {
446static char triangle_up_filled_9_9[] = {
457static char triangle_down_line_9_9[] = {
468static char triangle_down_filled_9_9[] = {
479static char david_star_line_9_9[] = {
490static char david_star_filled_9_9[] = {
501static char swiss_cross_line_9_9[] = {
512static char swiss_cross_filled_9_9[] = {
523static char diamond_line_9_9[] = {
534static char diamond_filled_9_9[] = {
545static char square_line_9_9[] = {
556static char square_filled_9_9[] = {
568static char* sFigures[54] = {
575 triangle_up_line_5_5,
576 triangle_up_filled_5_5,
577 triangle_down_line_5_5,
578 triangle_down_filled_5_5,
580 david_star_filled_5_5,
581 swiss_cross_line_5_5,
582 swiss_cross_filled_5_5,
593 triangle_up_line_7_7,
594 triangle_up_filled_7_7,
595 triangle_down_line_7_7,
596 triangle_down_filled_7_7,
598 david_star_filled_7_7,
599 swiss_cross_line_7_7,
600 swiss_cross_filled_7_7,
611 triangle_up_line_9_9,
612 triangle_up_filled_9_9,
613 triangle_down_line_9_9,
614 triangle_down_filled_9_9,
616 david_star_filled_9_9,
617 swiss_cross_line_9_9,
618 swiss_cross_filled_9_9,
632 static bool first =
true;
657 SoGLRenderAction* aAction
662 SoState* state = aAction->getState();
664 const SoCoordinateElement* coordinateElement =
665 SoCoordinateElement::getInstance(state);
666 if(coordinateElement==NULL)
return;
668 if(aAction->isOfType(SoGL2PSAction::getClassTypeId())) {
669 SoCacheElement::invalidate(state);
672 const SbColor& color = SoLazyElement::getDiffuse(aAction->getState(),0);
673 float red,green,blue;
674 color.getValue(red,green,blue);
678 int starti = startIndex.getValue();
679 int pointn = numPoints.getValue();
682 glPushAttrib( (GLbitfield)(GL_CURRENT_BIT | GL_ENABLE_BIT));
683 glDisable(GL_LIGHTING);
684 glColor3f(red,green,blue);
688 glDisable(GL_DEPTH_TEST);
691 glPixelStorei(GL_UNPACK_ALIGNMENT,1);
692 for(pointi=starti;pointi<pointn;pointi++){
693 const SbVec3f& vec = coordinateElement->get3(pointi);
694 glRasterPos3f(vec[0],vec[1],vec[2]);
702 drawMarker(aAction,mark);
716 GLfloat xorig = 0,yorig = 0;
717 GLfloat xmove = 0,ymove = 0;
719 if((aStyle>=0)&&(aStyle<18)) {
722 GLubyte* bitmap = getBitmap(w,h,sFigures[aStyle]);
723 glBitmap(w,h,xorig,yorig,0.,0.,bitmap);
725 }
else if((aStyle>=18)&&(aStyle<36)) {
728 GLubyte* bitmap = getBitmap(w,h,sFigures[aStyle]);
729 glBitmap(w,h,xorig,yorig,0.,0.,bitmap);
731 }
else if((aStyle>=36)&&(aStyle<54)) {
734 GLubyte* bitmap = getBitmap(w,h,sFigures[aStyle]);
735 glBitmap(w,h,xorig,yorig,0.,0.,bitmap);
741 if(aAction->isOfType(SoGL2PSAction::getClassTypeId())) {
742 ((
SoGL2PSAction*)aAction)->addBitmap(w,h,xorig,yorig,xmove,ymove);
756 GLubyte* bitmap =
new GLubyte[aW * aH + 1];
759 unsigned char byte = 0;
760 for (
int row = 0; row < aH; row++ ){
761 for (
int col = 0; col < aW; col++){
762 unsigned char c = aFigure[ichar];
767 byte += (1<<(7-ibit));
774 bitmap[index] = byte;
785 bitmap[index] = byte;
virtual ~HEPVis_SoMarkerSet()
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
virtual void GLRender(SoGLRenderAction *)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
HEPVis_SoMarkerSet()
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//