igor::iView Class Reference

#include <iView.h>

Public Member Functions

 iView ()=default
 
virtual ~iView ()
 
void setScene (iScenePtr scene)
 
iScenePtr getScene ()
 
void setName (const iaString &name)
 
const iaStringgetName () const
 
float64 getAspectRatio () const
 
void registerRenderDelegate (iDrawDelegate renderDelegate)
 
void unregisterRenderDelegate (iDrawDelegate renderDelegate)
 
void setViewportRelative (iaRectanglef rect)
 
iaRectanglei getViewport () 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
 
void setCamera (iNodeID cameraID)
 
iNodeID getCamera () const
 
iaVector3d unProject (const iaVector3d &screenpos, const iaMatrixd &modelMatrix)
 
iaVector3d project (const iaVector3d &worldSpacePos, const iaMatrixd &cameraMatrix)
 
uint64 pickColorID (uint32 posx, uint32 posy)
 
uint64 pickColorID (const iaVector2i &pos)
 
void pickColorID (const iaRectanglei &rectangle, std::vector< uint64 > &colorIDs)
 
int32 getZIndex () const
 
bool isPerspective () const
 

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 ( )
default

does nothing

◆ ~iView()

igor::iView::~iView ( )
virtual

checks consistency

Member Function Documentation

◆ getAspectRatio()

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

◆ getCamera()

iNodeID igor::iView::getCamera ( ) const
Returns
current camera id

◆ 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

◆ getScene()

iScenePtr igor::iView::getScene ( )
Returns
scene to be rendered with this view

◆ getViewport()

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

◆ 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

◆ pickColorID() [1/3]

void igor::iView::pickColorID ( const iaRectanglei rectangle,
std::vector< uint64 > &  colorIDs 
)

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

◆ pickColorID() [2/3]

uint64 igor::iView::pickColorID ( const iaVector2i pos)

same as pickColorID but with different parameters

Parameters
posthe position to pick a color from

◆ pickColorID() [3/3]

uint64 igor::iView::pickColorID ( 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()

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

◆ registerRenderDelegate()

void igor::iView::registerRenderDelegate ( iDrawDelegate  renderDelegate)

registers delegate to render event

Parameters
renderDelegatedelegate to register

◆ setBoundingBoxVisible()

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

defines if bounding boxes are shown or not

Parameters
boundingBoxif true bounding boxes are shown

◆ setCamera()

void igor::iView::setCamera ( iNodeID  cameraID)

sets current camera by id

Parameters
cameraIDthe camery id

◆ 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

◆ setPerspective()

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

activates perspective mode and sets the view_angle

Parameters
viewAngelvalues in degrees 0 < viewAngel < 180

◆ setScene()

void igor::iView::setScene ( iScenePtr  scene)

sets the scene to be rendered with this view

Parameters
scenescene to be rendered

◆ 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()

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

unprojects screen position to object space

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

◆ unregisterRenderDelegate()

void igor::iView::unregisterRenderDelegate ( iDrawDelegate  renderDelegate)

unregister delegate from render event

Parameters
renderDelegatedelegate to unregister

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: