#include <arappbase.h>
Public Types | |
| enum | IncrementModes { INCREMENT_MODE_ZOOM = 0, INCREMENT_MODE_PARAM = 1, INCREMENT_MODE_DISPLAY = 2 } |
| Values denoting the current operation of the +/- keys e.g zoom, paramater update or element display. More... | |
Public Member Functions | |
| virtual void | OnInit (int *argc, char *argv[]) |
| Called when application is first started. | |
| virtual void | OnKeyPress (unsigned int state, unsigned int key, int x, int y, bool &actioned) |
| Called when a key is pressed. | |
| virtual void | OnEraseBackground () |
| Called when the background needs clearing. | |
| virtual void | OnUpdate () |
| Called when the OpenGL window needs repainting. | |
| virtual void | OnPostUpdate () |
| Called after update but before OpenGL buffer is displayed on the screen. | |
| virtual void | OnResize (int width, int height) |
| Called when the window has been resized. | |
| virtual void | OnDisplayMessage (const char *message) |
| Called when the passed message text should be displayed on the screen. | |
| virtual void | OnDisplayUpdateModeValue (unsigned int id, const Utility::ARString &name) |
| Called when the Update Mode parameter values needs displaying. | |
| virtual void | OnDisplayDisplayModeValue (bool *value, const Utility::ARString &name) |
| Called when the Display mode value needs to be displayed. | |
| virtual void | OnIncrementUpdateModeValue (unsigned int id, int increment) |
| Called when a particular update mode value needs updating. | |
| virtual void | OnDisplayFPS (unsigned int fps) |
| Called when the frames per second needs to be displayed. | |
| virtual void | OnDisplayFrameNo (unsigned int frameNo) |
| Called then the current frame number needs to be displayed. | |
| virtual void | OnDisplayFocalLength (int FocalLengthU, int FocalLengthV) |
| Called when the focal length values need to be displayed. | |
| virtual void | OnDisplayMarkerEdge (Detection::ARBoundingBox *marker, Graphics::ARImage *image) |
| Called when the edge around the detected marker needs to be drawn. | |
| virtual void | OnDisplayMarkerBox (Detection::ARBoundingBox *marker, Graphics::ARImage *image) |
| Called when the bounding box needs to be drawn around the detected marker. | |
| virtual void | OnDisplayMarkerCorners (Detection::ARBoundingBox *marker, Graphics::ARImage *image) |
| Called when the current marker corners need to be drawn. | |
| virtual void | OnDisplayMarkerId (Detection::ARBoundingBox *marker, Graphics::ARImage *image) |
| Called when the current marker Id needs to be drawn. | |
| virtual void | OnDisplayAR (Detection::ARBoundingBox *marker) |
| Called when the OpenGL object needs to be displayed for the current detected marker. | |
| virtual void | OnInitDisplayAR () |
| Called prior to displaying augmented objects. | |
| virtual void | OnSetMarkerPose (Detection::ARBoundingBox *marker) |
| Called when the OpenGL projection and modelview matrices need to be set. | |
| virtual void | OnSegmentImage (Graphics::ARImage *image) |
| Called when the current frame image needs to be segmented. | |
| virtual void | OnGetApplicationTitle (Utility::ARString &title) |
| Called to retrive the title for the application. | |
| virtual void | OnGetDetailHelp (Utility::ARString &help) |
| Called when detailed help text is needed for the current application. | |
| virtual void | OnInitHelp () |
| Called when help keys and command line switches should be defined. | |
| void | AddHelpSwitch (const Utility::ARString &Switch, const Utility::ARString &Description) |
| Method for adding help for a particular command line switch. | |
| void | AddHelpKey (const Utility::ARString &Key, const Utility::ARString &Description) |
| Method for adding help for a particular user key switch. | |
| void | Update () |
| Call this method to repaint screen. | |
| int | GetWinWidth () |
| Returns the width of the current window. | |
| Utility::ARRecti | GetWinRect () |
| Returns the window rectangle. | |
| int | GetWinHeight () |
| Returns the height of the current window. | |
| int | GetZoom () |
| Returns the zoom factor for the current viewport. | |
| Graphics::ARImage * | GetImage () |
| Returns a pointer to the current image. | |
| int | GetMode () |
| Returns the current mode of operation (e.g. video streaming or static images). | |
| int | GetChannel () |
| Returns the current image channel/s that are being displayed. | |
| Detection::ARMarkers * | GetMarkers () |
| Returns the current marker definitions. | |
| Utility::ARConfiguration * | GetConfig () |
| Returns a pointer to the current configuration data. | |
| bool | GetConfigValue (const char *section, const char *item, Utility::ARString &value, const char *defvalue=0) |
| Retrieves the value associated with the section/item combination from the configuration file. | |
| bool | GetConfigValues (const char *section, const char *item, std::vector< Utility::ARString > &values, const char *defvalue=0) |
| Retrieves multiple values associated with the section/item combination from the configuration file. | |
| int | GetActualFPS () |
| Returns the actual frames per second being processed. | |
| int | GetFrameNo () |
| Returns the current frame number. | |
| void | AddUpdateMode (unsigned int id, const Utility::ARString &name) |
| Adds an updateable parameter to the current list. | |
| bool | NextUpdateMode (bool forwards=true) |
| Cycles through the available parameter update modes. | |
| void | AddDisplayMode (bool *value, const Utility::ARString &name) |
| Adds an element that can be turned on or off. | |
| bool | NextDisplayMode (bool forwards=true) |
| Cycles through the available element display modes. | |
| void | DrawBuffer (int x, int y, const char *buffer, const Graphics::ARColour &colour, void *font=GLUT_BITMAP_HELVETICA_18) |
| Draws text to the current window. | |
| void | DrawBuffer (Utility::ARRecti rect, const char *buffer, int flags, Graphics::ARColour colour, void *font=GLUT_BITMAP_HELVETICA_18) |
| Draws text to the current window. | |
| void | SetTimedMessage (const char *message) |
| This method will display a message on the screen for a fixed duration. | |
| int | GetMarkerCount () |
| Returns the number of detected markers in the current frame. | |
Protected Member Functions | |
| bool | GetSnapshotFilename (Utility::ARString &filename) |
| Returns the next available snapshot filename. | |
Protected Attributes | |
| int | markerCount |
| The number of currently detected markers. | |
| std::vector< ARUpdateMode > | updateModes |
| The _updateModes vector stores the various update modes that the user can cycle through. | |
| int | updateModeIdx |
| Holds the index position of the current Update Parameters mode item. | |
| std::vector< ARDisplayMode > | displayModes |
| The _displayModes vector stores the various element visibility modes that the user can cycle through. | |
| int | displayModeIdx |
| Holds the index position of the current Element visibility mode item. | |
| unsigned int | incrementMode |
| Denotes the current operation for the arrow keys. The value can be one of the IncrementModes enumeration. | |
| int | zoom |
| Denotes the zoom level of the current view. | |
| bool | showUI |
| Overide for the displaying of UI elements. | |
| bool | showFPS |
| Denotes whether the frames per second should be displayed. | |
| bool | showFrameNo |
| Denotes whether the current frame number should be displayed. | |
| bool | showFocalLength |
| Denotes whether the current frame focal length should be displayed. | |
| bool | showBoundingBoxes |
| Denotes whether bounding boxes should be drawn around potential marker regions. | |
| bool | showCorners |
| Denotes whether corners of potential markers should be displayed. | |
| bool | showMarkerEdge |
| Denotes whether a line should be draw around the detected marker. | |
| bool | showMarkerId |
| Denotes whether the marker id should be displayed against the detected marker. | |
| bool | showAR |
| Denotes whether the augmented elemented should be displayed. | |
| int | channel |
| Denotes the current colour channel being display. The value can be one of the Channel enumeration. | |
| int | otsuOffset |
| Denotes the amount the dynamic Otsu threshold value should be adjusted by. | |
| bool | useLuminance |
| unsigned int | minArea |
| Denotes the number of pixels that a bounding box must be to be deemed valid. | |
| int | fixedFocalLengthU |
| Denotes the fixed focal length in the U direction. | |
| int | fixedFocalLengthV |
| Denotes the fixed focal length in the V direction. | |
| int | currentFocalLengthU |
| Denotes the current focal length in the U direction. | |
| int | currentFocalLengthV |
| Denotes the current focal length in the V direction. | |
| bool | useFixedFocalLength |
| Denotes whether to use fixed focal lengths or dyanamically calculate them based on marker position. | |
| Detection::ARDetection | detection |
| The main marker detection object. | |
| Utility::ARString | defaultModelsConfigPath |
| The default path to the models.conf file. | |
| Utility::ARConfiguration | modelsConfig |
| The models configuration data. | |
| Utility::ARString | timedMessage |
| Message to display for a short time. | |
| Utility::ARPoint3Di | rotation |
| Specifies the default rotation of each object prior to being displayed. | |
| bool | takeSnapshot |
| Denotes whether a snaphot tiff file should be saved after the next frame is rendered. | |
| Utility::ARString | snapshotLocation |
| Defines the folder to write snapshots to. | |
| Utility::ARString | snapshotPrefix |
| Defines the prefix to use when writing out snapshots. The final file name will be <snapshotprefix>.n.tif. | |
To create custom application functionality, a new class should be created which is derived from the ARAppBase class.
|
|
Values denoting the current operation of the +/- keys e.g zoom, paramater update or element display.
|
|
||||||||||||
|
Adds an element that can be turned on or off. Update modes can be cycled using the relevant key. The +/- keys can then be used to turn the element on or off e.g. turn on/off the showing of fps.
|
|
||||||||||||
|
Method for adding help for a particular user key switch.
|
|
||||||||||||
|
Method for adding help for a particular command line switch.
|
|
||||||||||||
|
Adds an updateable parameter to the current list. Updateable parameters can be cycled using the relevant key. The +/- keys can then be used to increment or decrement the associated value.
|
|
||||||||||||||||||||||||
|
Draws text to the current window.
|
|
||||||||||||||||||||||||
|
Draws text to the current window.
|
|
|
Returns the actual frames per second being processed.
|
|
|
Returns the current image channel/s that are being displayed.
|
|
||||||||||||||||||||
|
Retrieves the value associated with the section/item combination from the configuration file.
|
|
||||||||||||||||||||
|
Retrieves multiple values associated with the section/item combination from the configuration file.
|
|
|
Returns the current frame number.
|
|
|
Returns a pointer to the current image.
|
|
|
Returns the current marker definitions.
|
|
|
Returns the current mode of operation (e.g. video streaming or static images).
|
|
|
Returns the next available snapshot filename.
|
|
|
Returns the height of the current window.
|
|
|
Returns the window rectangle.
|
|
|
Returns the width of the current window.
|
|
|
Returns the zoom factor for the current viewport.
|
|
|
Cycles through the available element display modes. Display modes allow visual aspects to be turned on or off using the +/- keys.
|
|
|
Cycles through the available parameter update modes. Update modes allow specific configuration options to be updated using the +/- keys.
|
|
||||||||||||
|
Called when the Display mode value needs to be displayed. The function should display the name and the value so that when using the +/- keys, the user can see the new value.
|
|
||||||||||||
|
Called when the focal length values need to be displayed.
|
|
|
Called when the frames per second needs to be displayed.
|
|
|
Called then the current frame number needs to be displayed.
|
|
||||||||||||
|
Called when the bounding box needs to be drawn around the detected marker.
|
|
||||||||||||
|
Called when the current marker corners need to be drawn. The default behaviour draws a small cross at each corner of the marker.
|
|
||||||||||||
|
Called when the edge around the detected marker needs to be drawn. The default behaviour of this method is to draw a line between each of the corners.
|
|
||||||||||||
|
Called when the current marker Id needs to be drawn.
|
|
|
Called when the passed message text should be displayed on the screen. It is upto the custom implementation to determine how or where the message is displayed. The function is called when a timed message is to be displayed.
|
|
||||||||||||
|
Called when the Update Mode parameter values needs displaying. The display should show the name and value so that when using the +/- keys, the user can see the new value.
|
|
|
Called to retrive the title for the application.
|
|
|
Called when detailed help text is needed for the current application.
|
|
||||||||||||
|
Called when a particular update mode value needs updating. /param id The unique identifier for the current update mode. /param increment The amount (positive or negative) by which the value should be incremented. |
|
||||||||||||
|
Called when application is first started. Enables the custom functionality to initialise itself and to process any custom command line switches.
|
|
|
Called prior to displaying augmented objects. This function enables OpenGL parameters (e.g. lights, setup buffers, etc) to be set prior to displaying each AR element. The default behavior of this function sets up the OpenGL depth buffer and creates the viewport for the AR. |
|
|
Called when help keys and command line switches should be defined. The methods AddHelpSwitch and AddHelpKey should be called to load the availables command line switches and user keys. |
|
||||||||||||||||||||||||
|
Called when a key is pressed.
if (state & KEY_EXTENDED) std::cout << "Extended "; if (state & KEY_SHIFT) std::cout << "Shift "; if (state & KEY_ALT) std::cout << "Alt "; if (state & KEY_CTRL) std::cout << "Ctrl "; If the extended bit is set then the key value is one of the special glut key values e.g. GLUT_KEY_F1,GLUT_KEY_F2, GLUT_KEY_LEFT etc. Refer to Glut documentation for a complete list of special constants (glutSpecialFunc). |
|
||||||||||||
|
Called when the window has been resized.
|
|
|
Called when the current frame image needs to be segmented. This function should update the alpha channel of the image so that there are only black (0) and white (255) values. The default implementation of this function performs Otsu dynamic thresholding.
|
|
|
Called when the OpenGL projection and modelview matrices need to be set.
|
|
|
This method will display a message on the screen for a fixed duration.
|
|
|
Overide for the displaying of UI elements. If this value is false then no elements will be shown (regardless of their own show flag) |
|
|
Denotes whether the black and white segmentation should use a luminance formula or a simple average of the red, green and blue component values. |
1.3.9.1