Support Forum       G3D Web Page     
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Friends | List of all members
G3D::DebugTextWidget Class Reference

Renders rasterizer statistics and debug text for GApp. More...

Inherits G3D::FullScreenWidget.

Public Member Functions

virtual Rect2D bounds () const override
 Inherited from Surface2D. More...
 
virtual float depth () const override
 Inherited from Surface2D. More...
 
virtual void fireEvent (const GEvent &event)
 Fire an event on the containing window. More...
 
WidgetManagermanager () const
 
virtual void onAfterEvents ()
 Invoked after all onEvent handlers for the current frame and before onUserInput for any other Widget. More...
 
virtual void onAI ()
 
virtual void onBeforeGraphics ()
 Invoked by WidgetManager immediately before GApp::onGraphics runs. More...
 
virtual bool onEvent (const GEvent &event)
 Returning true consumes the event and prevents other GModules from seeing it. More...
 
virtual void onNetwork ()
 
virtual void onPose (Array< shared_ptr< Surface > > &surfaceArray, Array< shared_ptr< Surface2D > > &surface2DArray) override
 
Appends a posed model for this object to the array, if it has a graphic representation. More...
 
virtual void onSimulation (RealTime rdt, SimTime sdt, SimTime idt)
 
virtual void onUserInput (UserInput *ui)
 
virtual float positionalEventZ (const Point2 &pixel) const
 The camera-space z position that this Widget considers this pixel to be at. More...
 
virtual void render (RenderDevice *rd) const override
 Inherited from Surface2D. More...
 
virtual void setDepth (float d)
 Called by the WidgetManager. More...
 
virtual void setManager (WidgetManager *m)
 Called by the WidgetManager when this module is added to it. More...
 
virtual OSWindowwindow () const
 Returns the operating system window that is currently rendering this Widget. More...
 

Static Public Member Functions

static shared_ptr< DebugTextWidgetcreate (GApp *app)
 
static void sort (Array< shared_ptr< Surface2D >> &array)
 Sorts from farthest to nearest. More...
 
static void sortAndRender (RenderDevice *rd, Array< shared_ptr< Surface2D >> &array)
 Calls sort, RenderDevice::push2D, and then render on all elements. More...
 

Protected Member Functions

 DebugTextWidget (GApp *app)
 

Static Protected Member Functions

template<class T , class ... ArgTypes>
static shared_ptr< T > createShared (ArgTypes &&... args)
 Like std::make_shared, but works for protected constructors. More...
 

Protected Attributes

GAppm_app
 
float m_depth
 
WidgetManagerm_manager
 The manager, set by setManager(). More...
 

Friends

class GApp
 

Detailed Description

Renders rasterizer statistics and debug text for GApp.

Constructor & Destructor Documentation

◆ DebugTextWidget()

G3D::DebugTextWidget::DebugTextWidget ( GApp app)
inlineprotected

Referenced by create().

Member Function Documentation

◆ bounds()

virtual Rect2D G3D::FullScreenWidget::bounds ( ) const
inlineoverridevirtualinherited

Inherited from Surface2D.

Reimplemented from G3D::Widget.

◆ create()

static shared_ptr<DebugTextWidget> G3D::DebugTextWidget::create ( GApp app)
inlinestatic

◆ createShared()

template<class T , class ... ArgTypes>
static shared_ptr<T> G3D::ReferenceCountedObject::createShared ( ArgTypes &&...  args)
inlinestaticprotectedinherited

Like std::make_shared, but works for protected constructors.

Call as createShared<myclass>.

◆ depth()

virtual float G3D::FullScreenWidget::depth ( ) const
inlineoverridevirtualinherited

Inherited from Surface2D.

Controls the depth of objects when rendering. Subclasses may override this but it can interfere with the normal handling of rendering and event delivery. depth = 0 is usually the "top" widget and depth = 1 is usually the "bottom" widget.

Reimplemented from G3D::Widget.

◆ fireEvent()

virtual void G3D::Widget::fireEvent ( const GEvent event)
virtualinherited

Fire an event on the containing window.

Reimplemented in G3D::WidgetManager.

◆ manager()

WidgetManager* G3D::Widget::manager ( ) const
inlineinherited

◆ onAfterEvents()

virtual void G3D::Widget::onAfterEvents ( )
inlinevirtualinherited

Invoked after all onEvent handlers for the current frame and before onUserInput for any other Widget.

Reimplemented in G3D::WidgetManager, and G3D::GameController.

◆ onAI()

virtual void G3D::Widget::onAI ( )
inlinevirtualinherited

◆ onBeforeGraphics()

virtual void G3D::Widget::onBeforeGraphics ( )
inlinevirtualinherited

Invoked by WidgetManager immediately before GApp::onGraphics runs.

Reimplemented in G3D::WidgetManager, G3D::CallbackWidget, and G3D::XRWidget.

◆ onEvent()

virtual bool G3D::Widget::onEvent ( const GEvent event)
inlinevirtualinherited

Returning true consumes the event and prevents other GModules from seeing it.

Motion events (GEventType::MOUSEMOTION, GEventType::JOYHATMOTION, JGEventType::OYBALLMOTION, and GEventType::JOYAXISMOTION) cannot be cancelled.

Reimplemented in G3D::GuiWindow, G3D::WidgetManager, G3D::ThirdPersonManipulator, G3D::GConsole, G3D::Discovery::Client, G3D::SceneEditorWindow, G3D::FirstPersonManipulator, G3D::VideoRecordDialog, G3D::UprightSplineManipulator, G3D::CameraControlWindow, G3D::GuiMenu, G3D::ControlPointEditor, G3D::DeveloperWindow, and G3D::ArticulatedModelSpecificationEditorDialog.

◆ onNetwork()

virtual void G3D::Widget::onNetwork ( )
inlinevirtualinherited

◆ onPose()

virtual void G3D::FullScreenWidget::onPose ( Array< shared_ptr< Surface > > &  surfaceArray,
Array< shared_ptr< Surface2D > > &  surface2DArray 
)
inlineoverridevirtualinherited


Appends a posed model for this object to the array, if it has a graphic representation.

The posed model appended is allowed to reference the agent and is allowed to mutate if the agent is mutated.

Reimplemented from G3D::Widget.

◆ onSimulation()

virtual void G3D::Widget::onSimulation ( RealTime  rdt,
SimTime  sdt,
SimTime  idt 
)
inlinevirtualinherited

◆ onUserInput()

virtual void G3D::Widget::onUserInput ( UserInput ui)
inlinevirtualinherited

◆ positionalEventZ()

virtual float G3D::Widget::positionalEventZ ( const Point2 pixel) const
inlinevirtualinherited

The camera-space z position that this Widget considers this pixel to be at.

Used for positional event (e.g., mouse click) delivery. Higher means closer.

Large negative values are far away. 0 is the closest 3D object. Values greater than zero are used for 2D objects. Returning fnan() [the default] requests the WidgetManager to set hte positionalEventZ to the object's normal event zorder.

See the implementation of ControlPointEditor::positionalEventZ for an example of how to use this with a 3D object.

Reimplemented in G3D::ControlPointEditor.

◆ render()

virtual void G3D::DebugTextWidget::render ( RenderDevice rd) const
overridevirtual

Inherited from Surface2D.

Reimplemented from G3D::Widget.

◆ setDepth()

virtual void G3D::Widget::setDepth ( float  d)
inlinevirtualinherited

Called by the WidgetManager.

This is the depth that the Widget is expected to use when posed as a Surface2D. Subclasses may override or ignore this but it can interfere with the normal handling of rendering.

◆ setManager()

virtual void G3D::Widget::setManager ( WidgetManager m)
inlinevirtualinherited

◆ sort()

static void G3D::Surface2D::sort ( Array< shared_ptr< Surface2D >> &  array)
staticinherited

Sorts from farthest to nearest.

◆ sortAndRender()

static void G3D::Surface2D::sortAndRender ( RenderDevice rd,
Array< shared_ptr< Surface2D >> &  array 
)
staticinherited

Calls sort, RenderDevice::push2D, and then render on all elements.

◆ window()

virtual OSWindow* G3D::Widget::window ( ) const
virtualinherited

Returns the operating system window that is currently rendering this Widget.

Reimplemented in G3D::WidgetManager.

Referenced by G3D::FullScreenWidget::bounds().

Friends And Related Function Documentation

◆ GApp

friend class GApp
friend

Member Data Documentation

◆ m_app

GApp* G3D::DebugTextWidget::m_app
protected

◆ m_depth

float G3D::Widget::m_depth
protectedinherited

◆ m_manager

WidgetManager* G3D::Widget::m_manager
protectedinherited

The manager, set by setManager().

This cannot be a reference counted pointer because that would create a cycle between the Widget and its manager.

Referenced by G3D::Widget::manager(), G3D::GuiWindow::manager(), G3D::Widget::setManager(), and G3D::GuiWindow::setVisible().


documentation generated on Wed Nov 24 2021 08:01:54 using doxygen 1.8.15