57class SMALLCHANGE_DLL_API
LegendKit :
public SoBaseKit {
58 typedef SoBaseKit inherited;
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);
94 static void initClass(
void);
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;
133 typedef SbString SoNumberFormatCB(
const double number,
void * closure);
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);
146 virtual void GLRender(SoGLRenderAction * action);
147 virtual void getBoundingBox(SoGetBoundingBoxAction * action);
148 virtual void handleEvent(SoHandleEventAction * action);
149 virtual void search(SoSearchAction * action);
150 virtual void callback(SoCallbackAction * action);
151 virtual void getMatrix(SoGetMatrixAction * action);
152 virtual void pick(SoPickAction * action);
153 virtual void rayPick(SoRayPickAction * action);
154 virtual void audioRender(SoAudioRenderAction * action);
155 virtual void getPrimitiveCount(SoGetPrimitiveCountAction * action);
157 virtual SbBool affectsState(
void)
const;
160 virtual void notify(SoNotList * list);
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);
172 void render(SoGLRenderAction * action,
const SbBool lines);
173 void renderLines(SoGLRenderAction * action);
174 void renderText(SoGLRenderAction * 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;