1 #ifndef SMALLCHANGE_LEGENDKIT_H 2 #define SMALLCHANGE_LEGENDKIT_H 36 #include <Inventor/nodekits/SoSubKit.h> 37 #include <Inventor/nodekits/SoBaseKit.h> 38 #include <Inventor/fields/SoSFEnum.h> 39 #include <Inventor/fields/SoSFBool.h> 40 #include <Inventor/fields/SoSFVec2f.h> 41 #include <Inventor/fields/SoSFFloat.h> 42 #include <Inventor/fields/SoSFString.h> 43 #include <Inventor/fields/SoMFString.h> 45 #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__) 46 #include <SoWinLeaveScope.h> 49 #include <SmallChange/basic.h> 62 SO_KIT_CATALOG_ENTRY_HEADER(topSeparator);
63 SO_KIT_CATALOG_ENTRY_HEADER(viewport);
64 SO_KIT_CATALOG_ENTRY_HEADER(resetTransform);
65 SO_KIT_CATALOG_ENTRY_HEADER(position);
66 SO_KIT_CATALOG_ENTRY_HEADER(depthBuffer);
67 SO_KIT_CATALOG_ENTRY_HEADER(lightModel);
68 SO_KIT_CATALOG_ENTRY_HEADER(camera);
69 SO_KIT_CATALOG_ENTRY_HEADER(texture);
70 SO_KIT_CATALOG_ENTRY_HEADER(shapeHints);
71 SO_KIT_CATALOG_ENTRY_HEADER(pickStyle);
72 SO_KIT_CATALOG_ENTRY_HEADER(backgroundMaterial);
73 SO_KIT_CATALOG_ENTRY_HEADER(backgroundShape);
74 SO_KIT_CATALOG_ENTRY_HEADER(imageSeparator);
75 SO_KIT_CATALOG_ENTRY_HEADER(imageTransform);
76 SO_KIT_CATALOG_ENTRY_HEADER(imageMaterial);
77 SO_KIT_CATALOG_ENTRY_HEADER(imageSwitch);
78 SO_KIT_CATALOG_ENTRY_HEADER(imageGroup);
79 SO_KIT_CATALOG_ENTRY_HEADER(imageTranslation);
80 SO_KIT_CATALOG_ENTRY_HEADER(image);
81 SO_KIT_CATALOG_ENTRY_HEADER(textureGroup);
82 SO_KIT_CATALOG_ENTRY_HEADER(textureQuality);
83 SO_KIT_CATALOG_ENTRY_HEADER(textureImage);
84 SO_KIT_CATALOG_ENTRY_HEADER(textureShape);
85 SO_KIT_CATALOG_ENTRY_HEADER(tickMaterial);
86 SO_KIT_CATALOG_ENTRY_HEADER(renderCallbackLines);
87 SO_KIT_CATALOG_ENTRY_HEADER(textMaterial);
88 SO_KIT_CATALOG_ENTRY_HEADER(renderCallbackText);
89 SO_KIT_CATALOG_ENTRY_HEADER(extraNodes);
114 void setImageTransparency(
const float transparency = 0.0f);
115 void useTextureNotImage(
const SbBool onoff);
116 void setColorCB(uint32_t (*colorCB)(
double,
void*),
void * userdata = NULL);
117 void setColorCB(uint32_t (*colorCB)(
double));
119 void clearTicks(
void);
120 void addSmallTick(
double nval);
121 void addBigTick(
double nval,
double tickvalue,
const SbString * discretestring = NULL);
122 void addBigTick(
double nval,
const SbString &
string,
const SbString * discretestring = NULL);
124 void setDiscreteMode(
const SbBool onoff);
125 void addDiscreteColor(
double uppernval, uint32_t color);
126 void addDiscreteColor(
double uppernval);
128 void clearData(
void);
129 void enableImage(
const SbBool onoff);
131 float getLegendWidth(
void)
const;
134 void setNumberFormatCallback(SoNumberFormatCB * cb,
void * closure);
138 void setTickAndLinesColor(
const SbColor & color,
const float transparency = 0.0f);
139 void setTextColor(
const SbColor & color,
const float transparency = 0.0f);
140 void setPosition(
const SbVec2s & pos);
141 void setBackgroundColor(
const SbColor & color,
const float transparency = 0.0f);
142 void enableBackground(
const SbBool onoff);
164 void recalcSize(
SoState * state);
165 void initBackground(
const SbBool force = FALSE);
166 void initTextureImage(
void);
167 void initImage(
void);
168 void reallyInitImage(
unsigned char * data,
unsigned char * rowdata = NULL);
169 void fillImageAlpha(
void);
170 static void renderCBlines(
void * userdata,
SoAction * action);
171 static void renderCBtext(
void * userdata,
SoAction * action);
175 void renderString(
const char * str,
int xpos,
int ypos);
177 void setSwitchValue(
const char * part,
const int value);
179 class LegendKitP * pimpl;
180 friend class LegendKitP;
183 #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__) 184 #include <SoWinEnterScope.h> 187 #endif // !SMALLCHANGE_LEGENDKIT_H virtual void search(SoSearchAction *action)
SoSFFloat bigTickSize
Definition: LegendKit.h:101
SoMFString description
Definition: LegendKit.h:105
virtual void notify(SoNotList *l)
SoSFBool discreteUseLower
Definition: LegendKit.h:109
virtual SbBool affectsState(void) const
SoSFFloat topSpace
Definition: LegendKit.h:108
The LegendKit class is used to draw a simple colormap legend.
Definition: LegendKit.h:57
SoSFFloat space
Definition: LegendKit.h:100
virtual void handleEvent(SoHandleEventAction *action)
virtual void getPrimitiveCount(SoGetPrimitiveCountAction *action)
virtual void audioRender(SoAudioRenderAction *action)
virtual void getMatrix(SoGetMatrixAction *action)
virtual void GLRender(SoGLRenderAction *action)
SoSFBool on
Definition: LegendKit.h:98
virtual void pick(SoPickAction *action)
static void initClass(void)
SoSFFloat tickValueOffset
Definition: LegendKit.h:104
SoSFFloat smallTickSize
Definition: LegendKit.h:102
SoSFBool threadSafe
Definition: LegendKit.h:110
SoSFFloat imageWidth
Definition: LegendKit.h:99
virtual void callback(SoCallbackAction *action)
SoSFString tickValueFormat
Definition: LegendKit.h:103
SbString SoNumberFormatCB(const double number, void *closure)
Definition: LegendKit.h:133
virtual void getBoundingBox(SoGetBoundingBoxAction *action)
virtual void rayPick(SoRayPickAction *action)
SoSFBool delayedRender
Definition: LegendKit.h:107
SoSFBool descriptionOnTop
Definition: LegendKit.h:106