| ## Public API Reference

- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# iBugPlug Struct Reference

Using this interface you can communicate with the BugPlug plugin. More...

`#include <ivaria/bugplug.h>`

Inheritance diagram for iBugPlug:

[legend]
List of all members.

## Public Member Functions
virtual void | AddCounter (const char *countername, int amount=1)=0
| Add an amount to a counter.
virtual void | AddCounterEnum (const char *countername, int enumval, int amount=1)=0
| Add an amount to a enum-counter.
virtual bool | CheckDebugSector () const =0
| Returns true if the debug sector is currently visible.
virtual bool | CheckDebugView () const =0
| Returns true if the debug view is currently visible.
virtual void | DebugSectorBox (const csBox3 &box, float r, float g, float b, const char *name=0, iMeshObject *mesh=0, uint mixmode=CS_FX_COPY)=0
| Add a colored filled box to the debug sector.
virtual void | DebugSectorTriangle (const csVector3 &s1, const csVector3 &s2, const csVector3 &s3, float r, float g, float b, uint mixmode=CS_FX_ADD)=0
| Add a transparent filled triangle to the debug sector.
virtual void | DebugViewBox (int i1, int i2)=0
| Add a box.
virtual int | DebugViewBoxCount () const =0
| Return the current number of boxes.
virtual void | DebugViewClearScreen (bool cs)=0
| Indicate if BugPlug should clear the screen before rendering the debug view.
virtual void | DebugViewGetBox (int i, int &i1, int &i2) const =0
| Return a box.
virtual void | DebugViewGetLine (int i, int &i1, int &i2) const =0
| Return a line.
virtual const csVector2 & | DebugViewGetPoint (int i) const =0
| Return a point.
virtual void | DebugViewLine (int i1, int i2)=0
| Add a line.
virtual int | DebugViewLineCount () const =0
| Return the current number of lines.
virtual int | DebugViewPoint (const csVector2 &point)=0
| Add a dragable point.
virtual int | DebugViewPointCount () const =0
| Return the current number of points.
virtual void | DebugViewRenderObject (iBugPlugRenderObject *obj)=0
| Add some rendering code that will be rendered right before the points and lines are rendered.
virtual bool | ExecCommand (const char *command)=0
| Execute a bugplug command.
virtual void | RemoveCounter (const char *countername)=0
| Remove a counter.
virtual void | ResetCounter (const char *countername, int value=0)=0
| Reset some counter manually.
virtual void | SetupDebugSector ()=0
| Setup the 'debug sector'.
virtual void | SetupDebugView ()=0
| Setup the 'debug 2dview'.
virtual void | SwitchDebugSector (const csReversibleTransform &trans, bool clear=true)=0
| Switch BugPlug view to the debug sector.
virtual void | SwitchDebugView (bool clear=true)=0
| Switch BugPlug view to the debug view.

## Detailed Description

Using this interface you can communicate with the BugPlug plugin.

This can be useful for specialized debugging operations.

Definition at line 54 of file bugplug.h.

## Member Function Documentation

virtual void iBugPlug::AddCounter | ( | const char * | countername,
|  | int | amount = `1` |
| ) |  |  | `[pure virtual]`

Add an amount to a counter.

Bugplug will automatically clear this counter every frame and show the last number, the average, the number of frames, and the total for every known counter. You don't have to specficially register a counter. Just by using this function BugPlug will know about the counter.

virtual void iBugPlug::AddCounterEnum | ( | const char * | countername,
|  | int | enumval,
|  | int | amount = `1` |
| ) |  |  | `[pure virtual]`

Add an amount to a enum-counter.

This is similar to a regular counter except that BugPlug will keep track of how many times every particular value is encountered. Enum-counters are displayed differently. BugPlug will automatically convert a counter to an enum-counter if you use this function on an existing counter and vice versa. BugPlug currently only supports enum values between 0 and 9.

virtual bool iBugPlug::CheckDebugSector | ( |  | ) | const`[pure virtual]`

Returns true if the debug sector is currently visible.

virtual bool iBugPlug::CheckDebugView | ( |  | ) | const`[pure virtual]`

Returns true if the debug view is currently visible.

virtual void iBugPlug::DebugSectorBox | ( | const csBox3 & | box,
|  | float | r,
|  | float | g,
|  | float | b,
|  | const char * | name = `0`,
|  | iMeshObject * | mesh = `0`,
|  | uint | mixmode = `CS_FX_COPY` |
| ) |  |  | `[pure virtual]`

Add a colored filled box to the debug sector.

If name is not 0 it will be shown in BugPlug when the mouse is over the object. If iMeshObject* is not 0 it will be shown inside the box when the mouse is over the object.

virtual void iBugPlug::DebugSectorTriangle | ( | const csVector3 & | s1,
|  | const csVector3 & | s2,
|  | const csVector3 & | s3,
|  | float | r,
|  | float | g,
|  | float | b,
|  | uint | mixmode = `CS_FX_ADD` |
| ) |  |  | `[pure virtual]`

Add a transparent filled triangle to the debug sector.

The color will be max at s1 and completely black at s2 and s3.

virtual void iBugPlug::DebugViewBox | ( | int | i1,
|  | int | i2 |
| ) |  |  | `[pure virtual]`

Add a box.

The two indices are as returned from DebugViewPoint().

virtual int iBugPlug::DebugViewBoxCount | ( |  | ) | const`[pure virtual]`

Return the current number of boxes.

virtual void iBugPlug::DebugViewClearScreen | ( | bool | cs | ) | `[pure virtual]`

Indicate if BugPlug should clear the screen before rendering the debug view.

True by default.

virtual void iBugPlug::DebugViewGetBox | ( | int | i,
|  | int & | i1,
|  | int & | i2 |
| ) |  |  | const`[pure virtual]`

Return a box.

virtual void iBugPlug::DebugViewGetLine | ( | int | i,
|  | int & | i1,
|  | int & | i2 |
| ) |  |  | const`[pure virtual]`

Return a line.

virtual const csVector2& iBugPlug::DebugViewGetPoint | ( | int | i | ) | const`[pure virtual]`

Return a point.

virtual void iBugPlug::DebugViewLine | ( | int | i1,
|  | int | i2 |
| ) |  |  | `[pure virtual]`

Add a line.

The two indices are as returned from DebugViewPoint().

virtual int iBugPlug::DebugViewLineCount | ( |  | ) | const`[pure virtual]`

Return the current number of lines.

virtual int iBugPlug::DebugViewPoint | ( | const csVector2 & | point | ) | `[pure virtual]`

Add a dragable point.

Returns an index that can be used in a line.

virtual int iBugPlug::DebugViewPointCount | ( |  | ) | const`[pure virtual]`

Return the current number of points.

virtual void iBugPlug::DebugViewRenderObject | ( | iBugPlugRenderObject * | obj | ) | `[pure virtual]`

Add some rendering code that will be rendered right before the points and lines are rendered.

If 0 the current object will be removed.

virtual bool iBugPlug::ExecCommand | ( | const char * | command | ) | `[pure virtual]`

Execute a bugplug command.

The commands are the same ones you can specify in the `bugplug.key` file.

Parameters:

  | command | Command to execute.

Returns:
  Whether the command was executed successfully.

virtual void iBugPlug::RemoveCounter | ( | const char * | countername | ) | `[pure virtual]`

Remove a counter.

From this point on BugPlug will no longer show this counter (BugPlug will remove the counter internally).

virtual void iBugPlug::ResetCounter | ( | const char * | countername,
|  | int | value = `0` |
| ) |  |  | `[pure virtual]`

Reset some counter manually.

Normally BugPlug will reset counters every frame but you can also reset it manually. If you reset an enum-counter all enum types are reset at once.

virtual void iBugPlug::SetupDebugSector | ( |  | ) | `[pure virtual]`

Setup the 'debug sector'.

The debug sector is a sector which you can fill with boxes and other objects. BugPlug can then switch the view to that sector so that the objects are rendered. This can be useful for debugging complicated systems in a graphical manner. This function will clear any previously created debug sector.

virtual void iBugPlug::SetupDebugView | ( |  | ) | `[pure virtual]`

Setup the 'debug 2dview'.

To this view a plugin or application can add various 2D objects (lines and points for example). This function will clear any previously created debug view.

virtual void iBugPlug::SwitchDebugSector | ( | const csReversibleTransform & | trans,
|  | bool | clear = `true` |
| ) |  |  | `[pure virtual]`

Switch BugPlug view to the debug sector.

The given transform is given to the camera. If clear is false then the 3D view will not be overwritten. In that case the transformation will not be used but the debug sector will follow the 3D view.

virtual void iBugPlug::SwitchDebugView | ( | bool | clear = `true` | ) | `[pure virtual]`

Switch BugPlug view to the debug view.

If clear is false then the 3D view will not be overwritten.

The documentation for this struct was generated from the following file:

- ivaria/bugplug.h