igor::iView Class Reference

#include <iView.h>

Public Member Functions

 iView ()
 
virtual ~iView ()
 
void setScene (const iEntitySceneID &entitySceneID)
 
void setScene (iEntityScenePtr entityScene)
 
const iEntitySceneIDgetSceneID () const
 
void setOverrideCamera (iEntityPtr camera)
 
const iEntityPtr getCamera () const
 
void setName (const iaString &name)
 
const iaStringgetName () const
 
float64 getAspectRatio () const
 
iRenderEvent & getRenderEvent ()
 
iPreRenderEvent & getPreRenderEvent ()
 
void setViewportRelative (iaRectanglef rect)
 
const iaRectangleigetViewport () const
 
void setPerspective (float32 viewAngel)
 
void setOrthogonal (float32 left, float32 right, float32 bottom, float32 top)
 
void setClipPlanes (float32 nearPlain, float32 farPlain)
 
void setClearColorActive (bool active)
 
bool isClearColorActive () const
 
void setUpdateViewport (bool enabled)
 
bool isUpdatingViewport () const
 
void setClearColor (const iaColor4f &color)
 
void setClearColor (float32 r, float32 g, float32 b, float32 a)
 
const iaColor4fgetClearColor () const
 
void setClearDepthActive (bool active)
 
bool isClearDepthActive () const
 
void setClearDepth (float32 depth)
 
float32 getClearDepth () const
 
void setVisible (bool visible=true)
 
bool isVisible () const
 
void setWireframeVisible (bool wireframe=true)
 
bool isWireframeVisible () const
 
void setBoundingBoxVisible (bool boundingBox=true)
 
bool isBoundingBoxVisible () const
 
void setOctreeVisible (bool octree=true)
 
bool isOctreeVisible () const
 
iaVector3d unProject (const iaVector3d &screenpos)
 
iaVector3d project (const iaVector3d &worldSpacePos)
 
iaVector3d unProject (const iaVector3d &screenpos, const iaMatrixd &cameraMatrix)
 
iaVector3d unProject (const iaVector3d &screenpos, iEntityPtr camera)
 
iaVector3d project (const iaVector3d &worldSpacePos, const iaMatrixd &cameraMatrix)
 
iEntityID pickEntityID (uint32 posx, uint32 posy)
 
iEntityID pickEntityID (const iaVector2i &pos)
 
void pickEntityID (const iaRectanglei &rectangle, std::vector< iEntityID > &entityIDs)
 
int32 getZIndex () const
 
bool isPerspective () const
 
bool isEmbedded ()
 

Friends

class iWindow
 
class iWidgetViewport
 

Detailed Description

represents a view rectangle within a window and projection of the scene

similar to what the combination of glViewport and glFrustum do

Constructor & Destructor Documentation

◆ iView()

igor::iView::iView ( )

init

◆ ~iView()

igor::iView::~iView ( )
virtual

does nothing

Member Function Documentation

◆ getAspectRatio()

float64 igor::iView::getAspectRatio ( ) const
Returns
aspect ratio

◆ getCamera()

const iEntityPtr igor::iView::getCamera ( ) const
Returns
effective camera

either the scene's active camera or the override camera if set

◆ getClearColor()

const iaColor4f & igor::iView::getClearColor ( ) const
Returns
current clear color

◆ getClearDepth()

float32 igor::iView::getClearDepth ( ) const
Returns
clear depth Value

◆ getName()

const iaString & igor::iView::getName ( ) const
Returns
name of the view

◆ getPreRenderEvent()

iPreRenderEvent & igor::iView::getPreRenderEvent ( )
Returns
pre render event

◆ getRenderEvent()

iRenderEvent & igor::iView::getRenderEvent ( )
Returns
render event

◆ getSceneID()

const iEntitySceneID & igor::iView::getSceneID ( ) const
Returns
scene ID

◆ getViewport()

const iaRectanglei & igor::iView::getViewport ( ) const
Returns
viewport in pixels

◆ getZIndex()

int32 igor::iView::getZIndex ( ) const
Returns
the z index of this view

◆ isBoundingBoxVisible()

bool igor::iView::isBoundingBoxVisible ( ) const
Returns
true if bounding boxes are shown

◆ isClearColorActive()

bool igor::iView::isClearColorActive ( ) const
Returns
true if color buffer will be cleared before render

◆ isClearDepthActive()

bool igor::iView::isClearDepthActive ( ) const
Returns
true if clear depth is active

◆ isEmbedded()

bool igor::iView::isEmbedded ( )
Returns
true if this view is embedded inside a widget

◆ isOctreeVisible()

bool igor::iView::isOctreeVisible ( ) const
Returns
true if octree is shown

◆ isPerspective()

bool igor::iView::isPerspective ( ) const
Returns
true if configure with perspective projection

else it must be a orthogonal projection

◆ isUpdatingViewport()

bool igor::iView::isUpdatingViewport ( ) const
Returns
true if viewport will be updated before drawing

◆ isVisible()

bool igor::iView::isVisible ( ) const
Returns
true if view is visible

◆ isWireframeVisible()

bool igor::iView::isWireframeVisible ( ) const
Returns
true if wireframe mode is active

◆ pickEntityID() [1/3]

void igor::iView::pickEntityID ( const iaRectanglei rectangle,
std::vector< iEntityID > &  entityIDs 
)

renders view in offscreen buffer using the colorID material and returns the color IDs from given rectangle

◆ pickEntityID() [2/3]

iEntityID igor::iView::pickEntityID ( const iaVector2i pos)

same as pickEntityID but with different parameters

Parameters
posthe position to pick a color from

◆ pickEntityID() [3/3]

iEntityID igor::iView::pickEntityID ( uint32  posx,
uint32  posy 
)

renders view in an offscreen buffer using the colorID material and returns the color id at given point.

Top left is origin.

Parameters
posxhorizontal position of point in pixel
posyvertical position of point in pixel
Returns
color id at given point (results are only valid for IDs <= 0xFFFFFF in use)

◆ project() [1/2]

iaVector3d igor::iView::project ( const iaVector3d worldSpacePos)

project world position to screen coordinates

Parameters
worldSpacePosthe position in world space to project
Returns
projected screen position

◆ project() [2/2]

iaVector3d igor::iView::project ( const iaVector3d worldSpacePos,
const iaMatrixd cameraMatrix 
)

project world position to screen coordinates

Parameters
worldSpacePosthe position in world space to project
cameraMatrixthe camera matrix
Returns
projected screen position

◆ setBoundingBoxVisible()

void igor::iView::setBoundingBoxVisible ( bool  boundingBox = true)

defines if bounding boxes are shown or not

Parameters
boundingBoxif true bounding boxes are shown

◆ setClearColor() [1/2]

void igor::iView::setClearColor ( const iaColor4f color)

specifies the the color the color buffer will be cleared with

Parameters
colorthe clear color

◆ setClearColor() [2/2]

void igor::iView::setClearColor ( float32  r,
float32  g,
float32  b,
float32  a 
)

specifies the the color the color buffer will be cleared with

Parameters
rred channel of clear color
ggreen channel of clear color
bblue channel of clear color
aalpha channel of clear color

◆ setClearColorActive()

void igor::iView::setClearColorActive ( bool  active)

sets the clear color bit.

Parameters
activetrue: color buffer will be cleared every frame; false: it will not

◆ setClearDepth()

void igor::iView::setClearDepth ( float32  depth)

sets the clear depth value

Parameters
depththe clear depth value

◆ setClearDepthActive()

void igor::iView::setClearDepthActive ( bool  active)

sets the clear buffer bit.

Parameters
activetrue: depth buffer will be cleared every frame; false: it will not

◆ setClipPlanes()

void igor::iView::setClipPlanes ( float32  nearPlain,
float32  farPlain 
)

defines the near and far clipping planes

Parameters
nearPlainnear clipping plane
farPlainfar clipping plane

◆ setName()

void igor::iView::setName ( const iaString name)

sets name of view

Parameters
namename of the view

◆ setOctreeVisible()

void igor::iView::setOctreeVisible ( bool  octree = true)

defines if octree is shown or not

Parameters
octreeif true octree is shown

◆ setOrthogonal()

void igor::iView::setOrthogonal ( float32  left,
float32  right,
float32  bottom,
float32  top 
)

activates othogonal projection mode

Parameters
leftleft value of orthogonal projection
rightright value of orthogonal projection
bottombottom value of orthogonal projection
toptop value of orthogonal projection

◆ setOverrideCamera()

void igor::iView::setOverrideCamera ( iEntityPtr  camera)

specifies a camera to override the active cam of the scene

camera is allowed to not be from the same scene as the view scene

Parameters
cameracamera entity to use

◆ setPerspective()

void igor::iView::setPerspective ( float32  viewAngel)

activates perspective mode and sets the view_angle

Parameters
viewAngelvalues in degrees 0 < viewAngel < 180

◆ setScene() [1/2]

void igor::iView::setScene ( const iEntitySceneID entitySceneID)

sets the entity scene to render with this view

Parameters
entitySceneIDentity scene ID to render

◆ setScene() [2/2]

void igor::iView::setScene ( iEntityScenePtr  entityScene)

sets the entity scene to render with this view

Parameters
entitySceneentity scene to render

◆ setUpdateViewport()

void igor::iView::setUpdateViewport ( bool  enabled)

sets if the viewport will be updated during draw call

Parameters
enabledif true viewport will be updated before drawing (enabled is default)

◆ setViewportRelative()

void igor::iView::setViewportRelative ( iaRectanglef  rect)

sets the view port within a window.

values have to be from 0.0 to 1.0 and represent a resolution independent unit.

TODO need a pixel version of this

Parameters
rectrectangle with view port boundings using relative values 0.0 - 1.0

◆ setVisible()

void igor::iView::setVisible ( bool  visible = true)

sets view visible

Parameters
visiblethe visible flag

◆ setWireframeVisible()

void igor::iView::setWireframeVisible ( bool  wireframe = true)

shows all rendering in wireframe mode or normal mode

Parameters
wireframeif true all rendering is using wireframe

◆ unProject() [1/3]

iaVector3d igor::iView::unProject ( const iaVector3d screenpos)

unprojects screen position to object space

Parameters
screenposscreen position in pixels (vertical origin is at top of window)
Returns
unprojected position in object space

◆ unProject() [2/3]

iaVector3d igor::iView::unProject ( const iaVector3d screenpos,
const iaMatrixd cameraMatrix 
)

unprojects screen position to object space

Parameters
screenposscreen position in pixels (vertical origin is at top of window)
cameraMatrixthe camera matrix to create the model view matrix from
Returns
unprojected position in object space

◆ unProject() [3/3]

iaVector3d igor::iView::unProject ( const iaVector3d screenpos,
iEntityPtr  camera 
)

Friends And Related Function Documentation

◆ iWidgetViewport

friend class iWidgetViewport
friend

◆ iWindow

friend class iWindow
friend

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