#include <mi32/mgd2.h>#include <mi32/mxtools.h>
Go to the source code of this file.
| #define GRAPH_HISTOGRAM_CREATEMENU 0x0010 |
create standart pull-down menu
| #define GRAPH_HISTOGRAM_CUMULATIVE 0x0004 |
display histogram as cumulative graph
| #define GRAPH_HISTOGRAM_GRIDLINES 0x0002 |
display grid lines
| #define GRAPH_HISTOGRAM_LOGARITHMIC 0x0020 |
logarithmic y - scale
| #define GRAPH_HISTOGRAM_MENUCLOSE 0x0100 |
add "close" item to the menu
| #define GRAPH_HISTOGRAM_MINMAXONLY 0x0008 |
not implemented yet
| #define GRAPH_HISTOGRAM_NOFILL 0x0001 |
don't fill histogram bars or polygon
| #define HISTOGRAM_BAR 1 |
| #define HISTOGRAM_IGNORE 0 |
| #define HISTOGRAM_LASTSTYLE 3 |
| #define HISTOGRAM_OUTLINE 2 |
| #define HISTOGRAM_STRIP 3 |
| #define LABELS_INBOX 3 |
| #define LABELS_NONE 1 |
| #define LABELS_PLAIN 2 |
| #define MxGraph_ClientMessageReason 0x00000400 |
| #define MxGraph_ColorChangeReason 0x00001000 |
| #define MxGraph_CursorEnterReason 0x00002000 |
| #define MxGraph_CursorLeaveReason 0x00004000 |
| #define MxGraph_CursorMotionReason 0x00008000 |
| #define MxGraph_DataChangeReason 0x00000800 |
| #define MxGraph_DestroyReason 0x00000001 |
| #define MxGraph_ExposeReason 0x00000100 |
| #define MxGraph_LeftPressReason 0x00000002 |
| #define MxGraph_LeftReleaseReason 0x00000004 |
| #define MxGraph_MotionLeftNotifyReason 0x00000020 |
| #define MxGraph_MotionRightNotifyReason 0x00000040 |
| #define MxGraph_NDViewClearScreen 0x02000000 |
| #define MxGraph_NDViewRestoreScreen 0x04000000 |
| #define MxGraph_RedrawReason 0x00000080 |
| #define MxGraph_ResizeReason 0x00000200 |
| #define MxGraph_RightPressReason 0x00000008 |
| #define MxGraph_RightReleaseReason 0x00000010 |
| #define MxGraphHistogramClear | ( | wdt | ) | (MxGraphHistogramSetData(wdt,NULL,0)) |
Clear contents of the histogram widget.
| #define XYPLOT_DRAWGRID 0x0004 |
draw grid lines
| #define XYPLOT_DRAWNODES 0x0010 |
draw circles arround graph nodes
| #define XYPLOT_DRAWSTAIRS 0x0001 |
draw plot in the stairs mode
| #define XYPLOT_HASTOOL 0x0008 |
xyplot has a crosshair tool
| #define XYPLOT_SNAPTOVERTEX 0x0020 |
snap tool to the closest vertex
| #define XYPLOT_SOLIDPLOT 0x0002 |
fill area below plot
| #define XYPLOT_XVALUEISINTEGER 0x0040 |
x value is integer value
| typedef fastdelegate::FastDelegate<void(MGD::CONTEXT*, int, int) MXGRAPH_DELEGATE_DRAW) |
| int MxGraphAddCallback | ( | Widget | wgraph, | |
| McbCallbackFunc | , | |||
| void * | data, | |||
| UINT32 | reason | |||
| ) |
Add a callback function to the "MxGraph" widget.
| wgraph | "MxGraph" widget returned by MxGraphCreate function | |
| data | Data passed to the callback function | |
| reason | Callback reason , see MxGraph_...Reason masks |
| Widget MxGraphCreate | ( | Widget | parent, | |
| int | Width, | |||
| int | Height, | |||
| MXGRAPH_DELEGATE_DRAW | DelegateDraw, | |||
| Arg * | arg, | |||
| int | n, | |||
| void * | userdata | |||
| ) |
Create "MxGraph" widget.
| parent | Parent widget | |
| Width | Initial width of the drawing area | |
| Height | Initial height of the drawing area | |
| DelegateDraw | Delegate to call for drawing | |
| arg | Attachments for the "MxGraph" widget | |
| n | Number of elements in arg arrray |
| int MxGraphDraw | ( | Widget | wgraph | ) |
Redraw contents of the "MxGraph" widget.
| wgraph | "MxGraph" widget |
| int MxGraphEnableRedraw | ( | Widget | wgraph, | |
| int | flag | |||
| ) |
Enable redraw of "MxGraph" widget.
| int MxGraphGetDimensions | ( | Widget | wgraph, | |
| int * | Width, | |||
| int * | Height | |||
| ) |
Get actual dimension of the "MxGraph's" DrawArea widget.
| wgraph | "MxGraph" widget | |
| Width | Width in pixels returned | |
| Height | Height in pixels returned |
Get tool handle associated with any MxGraph.
.. widget.
NOTE: You can use this function with any MxGraph... widget.
| wgraph | Any MxGraph... widget (MxGraphXYPlot or MxGraphHistogram) |
| void* MxGraphGetUserData | ( | Widget | wgraph | ) |
Get user data.
| int MxGraphHistogramCheckForNull | ( | Widget | whisto | ) |
This functions checks and removes 0 value from histogram.
| whisto | Histogram widget |
Compute histogram from raw data and assign.
| whisto | "histogram" widget passed | |
| data | Raw data to compute histogram from | |
| numdata | Number of items in the data array | |
| numintervals | Number of histogram intervals to compute |
| Widget MxGraphHistogramCreate | ( | Widget | parent, | |
| int | Width, | |||
| int | Height, | |||
| int | numintervals, | |||
| UINT32 * | data, | |||
| UINT32 | flags, | |||
| Arg * | arg, | |||
| int | n | |||
| ) |
Create a histogram widget.
Flags: GRAPH_HISTOGRAM_NOFILL don't fill histogram bars or polygon GRAPH_HISTOGRAM_GRIDLINES display grid lines GRAPH_HISTOGRAM_LABELS display labels GRAPH_HISTOGRAM_CUMULATIVE display histogram as cumulative graph GRAPH_HISTOGRAM_MINMAXONLY not implemented yet GRAPH_HISTOGRAM_CREATEMENU create standart pull-down menu GRAPH_HISTOGRAM_LOGARITHMIC logarithmic y - scale GRAPH_HISTOGRAM_LABELINBOX draw label boxes
| parent | Parent widget | |
| Width | Initial width of the widget | |
| Height | Initial height of the widget | |
| numintervals | Number of intervals or 0 | |
| data | Histogram data or NULL | |
| flags | Flags | |
| arg | Attachments | |
| n | Number of elements in arg |
| int MxGraphHistogramEnableTooltip | ( | Widget | whisto, | |
| int | flag | |||
| ) |
Enable/disable tooltip in the "Histogram" window.
| whisto | Histogram widget | |
| flag | True or False |
Get number of counts for specified bin number.
| whisto | Histogram widget | |
| bin | Bin number | |
| count | Number of counts returned |
Get data range for a histogram.
NOTE: if histogram data doesn't have start/end value set, then this function returns: start = 0.0 end = numintervals - 1
| whisto | Histogram widget | |
| start | Starting value returned | |
| end | Ending value returned |
Get histogram maximum count and it's position (bin number).
| whisto | Histogram widget | |
| bin | Bin number returned | |
| count | Number of counts returned |
Get number of intervals in the histogram.
| whisto | Histogram widget | |
| numintervals | Number of intervals returned |
| int MxGraphHistogramScreenToData | ( | Widget | whisto, | |
| int | x, | |||
| int | y, | |||
| INT32 * | bin, | |||
| DOUBLE * | value, | |||
| INT32 * | count | |||
| ) |
Convert screen pixel position into (value & count).
| whisto | Histogram widget | |
| x | Screen pixel coordinate | |
| y | Screen pixel coordinate | |
| bin | Bin number returned | |
| value | Value returned (not a bin number) | |
| count | Count returned |
Assign data in histogram form to the histogram widget.
| whisto | Histogram widget | |
| data | Array of counts | |
| items | Number of entries in data array |
Assign data in histogram form to the histogram widget, double form.
Set display flags.
Flags: GRAPH_HISTOGRAM_NOFILL don't fill histogram bars or polygon GRAPH_HISTOGRAM_GRIDLINES display grid lines GRAPH_HISTOGRAM_LABELS display labels GRAPH_HISTOGRAM_CUMULATIVE display histogram as cumulative graph GRAPH_HISTOGRAM_MINMAXONLY not implemented yet GRAPH_HISTOGRAM_CREATEMENU create standart pull-down menu GRAPH_HISTOGRAM_LOGARITHMIC logarithmic y - scale GRAPH_HISTOGRAM_LABELINBOX draw label boxes
| whisto | Histogram widget | |
| flags | Flags |
| int MxGraphHistogramSetFromRaster | ( | Widget | whisto, | |
| RVC::OBJITEM | objitem, | |||
| const REGION2D * | region, | |||
| int | ColorComp | |||
| ) |
Assign data to the histogram widget.
| whisto | Histogram widget | |
| ColorComp | Color component for RGB/BGR rasters |
| int MxGraphHistogramSetStyle | ( | Widget | whisto, | |
| COLOR * | fg, | |||
| COLOR * | bg, | |||
| COLOR * | fill, | |||
| COLOR * | labelcover, | |||
| DOUBLE | levelcount, | |||
| int | DrawStyle | |||
| ) |
Set appearance parameters of the histogram widget.
Draw styles: HISTOGRAM_IGNORE - ignore draw style reassignment HISTOGRAM_BAR - display as a set of 3D-bars HISTOGRAM_OUTLINE - display as histogram outline HISTOGRAM_STRIP - display as "fancy" 3D-strip
| whisto | Histogram widget | |
| fg | NULL or foreground color (Black by default) | |
| bg | NULL or background color (White by default) | |
| fill | NULL or fill color (Green by default) | |
| labelcover | NULL or color for displaying labels (Black by default) | |
| levelcount | Number of counts used as an interval for drawing of the horizontal grid lines and labeling (Pass negative value to ignore). | |
| DrawStyle | Type of the histogram representation |
| int MxGraphHistogramSetTextStyle | ( | Widget | whisto, | |
| const char * | Fontname, | |||
| float | size | |||
| ) |
Set label font and size.
| whisto | Histogram widget | |
| Fontname | Font name to use | |
| size | Label size 8,10,12,14... |
| int MxGraphHistogramSetTicMarks | ( | Widget | whisto, | |
| DOUBLE | datastart, | |||
| DOUBLE | dataend, | |||
| DOUBLE | ticstart, | |||
| DOUBLE | ticspacing | |||
| ) |
Set parameters for ranging histogram values and displaying horizontal tic-marks and labels.
NOTE: This function is important for assignment real world values to the horizontal scale. If programmer doesn't call this function, tic marks will represent just array numbers.
| whisto | Histogram widget | |
| datastart | Value that correspond to the first entry of the histogram data array | |
| dataend | Value that corresponds to the last entry of the histogram array | |
| ticstart | Data value for the first vertical tic-mark or grid-line | |
| ticspacing | Spacing in data values between vertical tic-marks |
| int MxGraphHistogramSmooth | ( | Widget | whisto | ) |
| whisto | Histogram widget |
| int MxGraphNDViewAddPoints | ( | Widget | wview, | |
| INT32 | numdim, | |||
| POINT_ND * | points, | |||
| INT32 | numpts, | |||
| int | Normalize, | |||
| int | ToClass | |||
| ) |
Assign N-dimensional points to visualizer.
Add one N-dimensional point to the NDview.
This function accepts ONLY NORMALIZED DATA in range between 0...1.
| numdim | This is necessary for dimension control |
| int MxGraphNDViewClearPoints | ( | Widget | wview | ) |
Clear NDview.
| Widget MxGraphNDViewCreate | ( | Widget | parent, | |
| int | Width, | |||
| int | Height, | |||
| UINT32 | flags, | |||
| Arg * | argext, | |||
| int | next | |||
| ) |
Create N-dimensional view widget.
| int MxGraphNDViewEditColors | ( | Widget | wview, | |
| int | Redraw | |||
| ) |
Edit color map of the view.
Get color assigned to the class.
| int MxGraphNDViewGetMaxNumClasses | ( | Widget | wview | ) |
Get maximum number of classes.
| int MxGraphNDViewRotate | ( | Widget | wview | ) |
Rotate using "rolling ball" algorithm.
| int MxGraphNDViewRotateRandom | ( | Widget | wview | ) |
Rotate using "rolling ball" algorithm.
| int MxGraphNDViewSetPointMappingCallback | ( | Widget | wview, | |
| int(*)(void *, INT32, COLOR *, int) | MapFunc, | |||
| void * | userdata | |||
| ) |
Set the point mapping callback.
| userdata | User supplied private data structure |
| int MxGraphNDViewSetPoints | ( | Widget | wview, | |
| INT32 | numdim, | |||
| POINT_ND * | points, | |||
| INT32 | numpts, | |||
| int | Norm | |||
| ) |
Assign N-dimensional points to visualizer.
Create N-dimensional view widget.
| int MxGraphNDViewSetViewAxises | ( | Widget | wview, | |
| int | haxis, | |||
| int | vaxis | |||
| ) |
| int MxGraphNDViewSpinGetCancel | ( | Widget | wview | ) |
| int MxGraphNDViewSpinRandom | ( | Widget | wview | ) |
Do the random spinning of the data usign Rolling Ball.
| int MxGraphNDViewSpinSetCancel | ( | Widget | wview | ) |
| int MxGraphNDViewUpdatePointCoord | ( | Widget | wview, | |
| INT32 | pointnum, | |||
| INT32 | numdim, | |||
| INT32 | dim, | |||
| DOUBLE | value | |||
| ) |
Update one coordinate value of the specified point.
This function accepts ONLY NORMALIZED DATA in range between 0...1.
| pointnum | Point number | |
| numdim | Total number of dimensions, this is necessary for dimension control | |
| dim | Dimension to update | |
| value | Value to update |
| void MxGraphRemoveCallback | ( | Widget | w, | |
| McbCallbackFunc | , | |||
| void * | data, | |||
| UINT32 | reason | |||
| ) |
Remove previously assigned callback function.
| Widget MxGraphSelectorCreate | ( | Widget | parent, | |
| int | Width, | |||
| int | Height, | |||
| int | NumSelections, | |||
| UINT8 * | Bitmap, | |||
| UINT32 | flags, | |||
| Arg * | argext, | |||
| int | next | |||
| ) |
Create a graphical selector.
| Widget MxGraphSliderCreate | ( | Widget | parent, | |
| int | Width, | |||
| int | Height, | |||
| int | MinVal, | |||
| int | MaxVal, | |||
| int | InitVal, | |||
| int * | Value, | |||
| UINT32 | flags, | |||
| Arg * | argext, | |||
| int | next | |||
| ) |
Create a graphical scroll bar.
| int MxGraphSliderGetMinMax | ( | Widget | wgraph, | |
| int * | MinVal, | |||
| int * | MaxVal | |||
| ) |
Get the scroll bar's minimum and maximum values.
| int MxGraphSliderGetValue | ( | Widget | wgraph, | |
| int * | Value | |||
| ) |
Get the current value of scroll bar.
Set the background color for the scroll bar.
Set marker color for scroll bar.
| int MxGraphSliderSetMinMax | ( | Widget | wgraph, | |
| int | NewMin, | |||
| int | NewMax, | |||
| int | Redraw | |||
| ) |
Set the minimum and maximum values for the scroll bar.
| int MxGraphSliderSetSensitive | ( | Widget | wgraph, | |
| int | Flag | |||
| ) |
| int MxGraphSliderSetValue | ( | Widget | wgraph, | |
| int | NewValue, | |||
| int | Redraw | |||
| ) |
Set the current value for the scroll bar.
| int MxGraphSliderSetValueChangeCallback | ( | Widget | wgraph, | |
| McbCallbackFunc | func, | |||
| void * | userdata | |||
| ) |
Set the callback for a change of value for the scroll bar.
| int MxGraphSnapshot | ( | Widget | wgraph | ) |
Save contents of the pixmap to the raster.
| int MxGraphXYPlotAddLine | ( | Widget | wplot, | |
| const MIUNICODE * | name, | |||
| DPOLYLINE * | Line, | |||
| const COLOR * | color, | |||
| DOUBLE | linewidth, | |||
| int | Redraw | |||
| ) |
Add line to the plot window.
| wplot | XYPlot widget | |
| name | Line name (will be used for data tip, click right mouse button) | |
| Line | Polyline data | |
| color | Color to use | |
| linewidth | Linewidth to use in pixels | |
| Redraw | Redraw flag |
| int MxGraphXYPlotAddLineScaled | ( | Widget | wplot, | |
| const MIUNICODE * | name, | |||
| DPOLYLINE * | Line, | |||
| const COLOR * | color, | |||
| DOUBLE | linewidth, | |||
| DOUBLE | offset, | |||
| DOUBLE | scale, | |||
| int | Redraw | |||
| ) |
Add line to the plot using specific scaling factors.
| wplot | XYPlot widget | |
| name | Line name (will be used for data tip, click right mouse button) | |
| Line | Polyline data | |
| color | Color to use | |
| linewidth | Linewidth in pixels | |
| offset | Offset value to use | |
| scale | Scale value to use | |
| Redraw | Redraw flag |
| int MxGraphXYPlotClear | ( | Widget | wplot, | |
| int | Redraw | |||
| ) |
Clear content of the plot window.
| wplot | XYPlot Widget | |
| Redraw | TRUE/FALSE redraw flag |
| Widget MxGraphXYPlotCreate | ( | Widget | parent, | |
| int | Width, | |||
| int | Height, | |||
| const MIUNICODE * | title, | |||
| const MIUNICODE * | xtitle, | |||
| const MIUNICODE * | ytitle, | |||
| const MIUNICODE * | y2title, | |||
| UINT32 | flags, | |||
| Arg * | argext, | |||
| int | next | |||
| ) |
Create XYPlot widget.
Flags: XYPLOT_DRAWSTAIRS - draw plot in the stairs mode XYPLOT_SOLIDPLOT - fill area below plot XYPLOT_DRAWGRID - draw grid lines XYPLOT_HASTOOL - xyplot has a crosshair tool XYPLOT_DRAWNODES - draw circles arround graph nodes
| parent | Parent widget | |
| Width | Width of the XYPlot widget | |
| Height | Height of the XYPlot widget | |
| title | Title of the XYPlot widget | |
| xtitle | Title for the horizontal axis | |
| ytitle | Title for the vertical axis | |
| y2title | Title for the secondary vertical axis (not yet impl.) | |
| flags | Flags | |
| argext | Argument list | |
| next | Number of items in argument list |
| int MxGraphXYPlotEditLineColors | ( | Widget | wplot, | |
| int | Redraw | |||
| ) |
Pop-up dialog that allows you to edit.
| wplot | XYPlot widget | |
| Redraw | Redraw flag (redraw if user click "OK") |
| int MxGraphXYPlotEditVertex | ( | Widget | wplot, | |
| const MIUNICODE * | linename, | |||
| INT32 | vertexnum, | |||
| DOUBLE | y, | |||
| int | redraw | |||
| ) |
Edit Y-value of the vertex.
| wplot | XYplot widget | |
| linename | Line name for identification | |
| vertexnum | Vertex number 0....NumPoints-1 | |
| y | New value for y-coordinate | |
| redraw | Redraw flag TRUE or FALSE |
Get current colors.
| wplot | XYplot widget | |
| A | Color used for plot area background color | |
| B | Color used for background color | |
| TextColor | Color used for drawing text |
Get extents of the plot window in data-space.
| wplot | XYPlot widget | |
| rect | Rectangle returned |
Get horizontal data range for display.
| wplot | XYPlot widget | |
| minval | Min. value for display range (returned) | |
| maxval | Max. value for display range (returned) |
Get a copy of the line.
NOTE: Programmer has to free memory for (poly->point) array when done working with the structure. This is just a copy of original line.
| wplot | XYplot widget | |
| linename | Line name for identification | |
| poly | Polyline structure returned |
Get vertical data range for display.
| wplot | XYPlot Widget | |
| minval | Min. value for display range (returned) | |
| maxval | Max. value for display range (returned) |
| int MxGraphXYPlotSetAxisNames | ( | Widget | wplot, | |
| const char * | title, | |||
| const char * | xtitle, | |||
| const char * | ytitle, | |||
| const char * | y2title | |||
| ) |
Set new names for the axises using NON-MIUNICODE strings.
| wplot | XYPlot widget | |
| title | Title of the XYPlot widget | |
| xtitle | Title for the horizontal axis | |
| ytitle | Title for the vertical axis | |
| y2title | Title for the secondary vertical axis |
| int MxGraphXYPlotSetAxisNamesUC | ( | Widget | wplot, | |
| const MIUNICODE * | title, | |||
| const MIUNICODE * | xtitle, | |||
| const MIUNICODE * | ytitle, | |||
| const MIUNICODE * | y2title | |||
| ) |
Set new names for the axises using MIUNICODE strings.
| wplot | XYPlot widget | |
| title | Title of the XYPlot widget | |
| xtitle | Title for the horizontal axis | |
| ytitle | Title for the vertical axis | |
| y2title | Title for the secondary vertical axis |
| int MxGraphXYPlotSetChangePositionCallback | ( | Widget | wplot, | |
| McbCallbackFunc | func, | |||
| void * | userdata | |||
| ) |
Set callback for change to tool position.
NOTE: Tool should be created with XYPLOT_HASTOOL flag in order to be able to use crosshair tool and this callback.
| wplot | XYplot widget | |
| func | Callback function | |
| userdata | Data to pass to callback |
Set colors to use.
| wplot | XYplot widget | |
| A | Color used for plot area background color | |
| B | Color used for background color | |
| TextColor | Color used for drawing text |
| void MxGraphXYPlotSetCursorTrackCallback | ( | Widget | wplot, | |
| McbCallbackFunc | func, | |||
| void * | userdata | |||
| ) |
Set callback for cursor tracking.
| wplot | XYplot widget | |
| func | Callback function | |
| userdata | Data to pass to callback |
Set flags to use.
Flags: XYPLOT_DRAWSTAIRS - draw plot in the stairs mode XYPLOT_SOLIDPLOT - fill area below plot XYPLOT_DRAWGRID - draw grid lines XYPLOT_HASTOOL - xyplot has a crosshair tool (this should be set only when the tool is created!) XYPLOT_DRAWNODES - draw circles arround graph nodes
| wplot | XYplot Widget | |
| flags | Flags |
Set font to use.
| wplot | XYplot widget | |
| fontname | Fontname to use |
| int MxGraphXYPlotSetFontSize | ( | Widget | wplot, | |
| int | Size | |||
| ) |
Set size of the font to use.
| wplot | XYplot widget | |
| Size | Size of the font |
Set horizontal data range for display.
| wplot | XYPlot widget | |
| minval | Min. value for display range | |
| maxval | Max. value for display range | |
| Redraw | Redraw flag |
1.6.1