Free Electron
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
fe::ext::ViewCommon Class Reference

general-implementation methods for ViewI More...

#include <ViewCommon.h>

Inheritance diagram for fe::ext::ViewCommon:
Inheritance graph
[legend]

Public Member Functions

virtual void setWindow (sp< WindowI > a_spWindowI)
 Specify window where to draw. More...
 
virtual sp< WindowIwindow (void) const
 
virtual void setViewport (const Box2i &a_rect)
 Define region where to draw. More...
 
virtual Box2i viewport (void) const
 
virtual void setCamera (sp< CameraI > a_spCameraI)
 
virtual sp< CameraIcamera (void) const
 Get current camera. More...
 
virtual ViewI::Projection projection (void) const
 Get current projection. More...
 
virtual void setProjection (Projection a_projection)
 Set whether ortho or perspective. More...
 
virtual void screenAlignment (SpatialTransform &a_rotation)
 Return a screen aligned rotation. More...
 
virtual void screenInfo (Real &a_screenScale, SpatialVector &a_screenLocation, const SpatialTransform &a_rotation, const SpatialVector &a_location)
 Given a screen aligned rotation and world location, return the screen projected location and scale. More...
 
virtual void setScissor (const Box2i *a_pBox)
 Clip all drawing operations to a 2D box. More...
 
virtual const Box2iscissor (void) const
 Get current scissor region. More...
 
virtual void use (ViewI::Projection a_projection)
 
virtual SpatialVector unproject (Real a_winx, Real a_winy, Real a_winz, ViewI::Projection a_projection=ViewI::e_current) const
 Determine 3D location of screen coordinate. More...
 
virtual SpatialVector project (const SpatialVector &a_point, ViewI::Projection a_projection=ViewI::e_current) const
 Project 3D location into screen coordinates. More...
 
virtual Real pixelSize (const SpatialVector &a_center, Real a_radius) const
 Estimate object's screen size. More...
 
virtual Real worldSize (const SpatialVector &a_center, Real a_pixels) const
 Estimate object's world size. More...
 
- Public Member Functions inherited from fe::Component
const Stringname (void) const
 Return the components chosen name. More...
 
const String verboseName (void) const
 Return the annotated chosen name. More...
 
void setName (const String &name)
 Rename the component to anything you want. More...
 
hp< Registryregistry (void) const
 Get the Registry that created this component. More...
 
void adjoin (sp< Component > spComponent)
 Tie this component's lifetime to another. More...
 
sp< Componentcreate (const String &implementation, BWORD quiet=FALSE) const
 Convienience function to registry()->create() More...
 
void disjoin (void)
 Untie component from Hub, if connected. More...
 
String factoryName (void)
 
void setLibrary (sp< Library > spLibrary)
 Store a reference to the library used to instantiate this component. More...
 
sp< Librarylibrary (void)
 Get the library that created the component. More...
 
void setFactoryIndex (I32 a_factoryIndex)
 Set the library's factory index. More...
 
I32 factoryIndex (void)
 Get the library's factory index. More...
 
void setSingleton (BWORD set)
 Specify whether component is a singleton. More...
 
BWORD isSingleton (void)
 Return whether component is a singleton. More...
 
virtual void acquire (void)
 Specialized reference increment. More...
 
virtual void release (void)
 Specialized reference decrement. More...
 
- Public Member Functions inherited from fe::Handled< Component >
const hp< Component > & getHandle (void) const
 Get a safe handle to this object. More...
 
- Public Member Functions inherited from fe::Protectable
virtual I32 protection (void) const
 
virtual void protect (void)
 
virtual void unprotect (void)
 
virtual Protectableclone (Protectable *pInstance=NULL)
 
- Public Member Functions inherited from fe::Counted
virtual void acquire (int &rCount)
 Increment the reference count (and get the count) More...
 
virtual void abandon (void)
 Decrement the reference count. More...
 
int count (void) const
 Return the count of references. More...
 
void setName (const String &)
 
void trackReference (void *pReference, String what)
 
void untrackReference (void *pReference)
 
void registerRegion (void *pT, U32 bytes)
 
- Public Member Functions inherited from fe::Initialized
void initializeAll (void)
 
void setActive (bool a_active)
 

Static Public Member Functions

static Matrix< 4, 4, Real > computeOrtho (Real a_zoom, const Vector< 2, Real > &a_center, const Vector< 2, Real > &a_size)
 
- Static Public Member Functions inherited from fe::Counted
static String reportTracker (void)
 
static U32 trackerCount (void)
 

Private Attributes

sp< CameraIm_spCameraI
 
sp< CameraEditablem_spCameraInternal
 
ViewI::Projection m_projection
 
sp< WindowIm_spWindowI
 
Box2i m_viewport
 

Additional Inherited Members

- Public Types inherited from fe::ext::ViewI
enum  Projection {
  e_none,
  e_perspective,
  e_ortho,
  e_current
}
 
- Protected Types inherited from fe::Initialized
typedef void(* InitializeFunction) (Initialized *)
 
- Protected Member Functions inherited from fe::Handled< Component >
void abandonHandle (void)
 
- Protected Member Functions inherited from fe::Counted
int releaseInternal (void)
 Decrement the reference count. More...
 
void suppressReport (void)
 
- Protected Member Functions inherited from fe::Initialized
void addInitializer (InitializeFunction function)
 

Detailed Description

general-implementation methods for ViewI

Member Function Documentation

◆ camera()

virtual sp<CameraI> fe::ext::ViewCommon::camera ( void  ) const
inlinevirtual

Get current camera.

This is the most recent camera set with setCamera().

Implements fe::ext::ViewI.

◆ pixelSize()

Real fe::ext::ViewCommon::pixelSize ( const SpatialVector a_center,
Real  a_radius 
) const
virtual

Estimate object's screen size.

The input is a sphere center and radius.

Implements fe::ext::ViewI.

Reimplemented in fe::ext::ViewOpenGL.

◆ project()

SpatialVector fe::ext::ViewCommon::project ( const SpatialVector a_point,
ViewI::Projection  a_projection = ViewI::e_current 
) const
virtual

Project 3D location into screen coordinates.

By default, the current Projection determines the projection method.

Window coordinates orginate from bottom left.

Implements fe::ext::ViewI.

Reimplemented in fe::ext::ViewOpenGL.

◆ projection()

virtual ViewI::Projection fe::ext::ViewCommon::projection ( void  ) const
inlinevirtual

Get current projection.

Implements fe::ext::ViewI.

◆ scissor()

virtual const Box2i* fe::ext::ViewCommon::scissor ( void  ) const
inlinevirtual

Get current scissor region.

NULL indicates no scissoring.

Implements fe::ext::ViewI.

Reimplemented in fe::ext::ViewOpenGL.

◆ screenAlignment()

void fe::ext::ViewCommon::screenAlignment ( SpatialTransform a_rotation)
virtual

Return a screen aligned rotation.

Implements fe::ext::ViewI.

◆ screenInfo()

void fe::ext::ViewCommon::screenInfo ( Real &  a_screenScale,
SpatialVector a_screenLocation,
const SpatialTransform a_rotation,
const SpatialVector a_location 
)
virtual

Given a screen aligned rotation and world location, return the screen projected location and scale.

Useful for normalizing object scale to the screen.

Implements fe::ext::ViewI.

References fe::project().

◆ setProjection()

virtual void fe::ext::ViewCommon::setProjection ( Projection  a_projection)
inlinevirtual

Set whether ortho or perspective.

Implements fe::ext::ViewI.

◆ setScissor()

virtual void fe::ext::ViewCommon::setScissor ( const Box2i a_pBox)
inlinevirtual

Clip all drawing operations to a 2D box.

Use NULL pointer to stop scissoring.

Implements fe::ext::ViewI.

Reimplemented in fe::ext::ViewOpenGL.

◆ setViewport()

virtual void fe::ext::ViewCommon::setViewport ( const Box2i a_rect)
inlinevirtual

Define region where to draw.

Implements fe::ext::ViewI.

◆ setWindow()

virtual void fe::ext::ViewCommon::setWindow ( sp< WindowI a_spWindowI)
inlinevirtual

Specify window where to draw.

Implements fe::ext::ViewI.

◆ unproject()

SpatialVector fe::ext::ViewCommon::unproject ( Real  a_winx,
Real  a_winy,
Real  a_winz,
ViewI::Projection  a_projection = ViewI::e_current 
) const
virtual

Determine 3D location of screen coordinate.

By default, the current Projection determines the projection method.

Window coordinates orginate from bottom left.

Implements fe::ext::ViewI.

Reimplemented in fe::ext::ViewOpenGL.

◆ worldSize()

Real fe::ext::ViewCommon::worldSize ( const SpatialVector a_center,
Real  a_pixels 
) const
virtual

Estimate object's world size.

The input is a sphere center and projected pixel radius.

Implements fe::ext::ViewI.

Reimplemented in fe::ext::ViewOpenGL.


The documentation for this class was generated from the following files: