VirtualMachine::InternalViewPort Class Reference
[VirtualMachine 3D Render Methods]

#include <VirtualMachine.h>

List of all members.


Detailed Description

Nested class that defines a viewport where to draw (screen, sub-screen,texture rendering screens.) This is a virtual class. Construction must be done by NewViewPortChild(), NewViewPortOnTexture() or InitMachine() for the default viewport accessible with VirtualMachine::GetDefaultViewPort() which stands for the main screen.

Definition at line 286 of file VirtualMachine.h.

Public Types

enum  eLoadId { eLoadId_All = 0, eLoadId_Rotation }
 Matrix_LoadID() special enum. More...

Public Member Functions

virtual void Clear (float _red=0.0f, float _green=0.0f, float _blue=0.0f)=0
 Reset color to black (or given color),and depth buffer, of this ViewPort.
virtual void RenderMesh (InternalObject3DBuffer *_pMeshBuffer, InternalTexture *_pTexture=0L)=0
 Render a 3D Object. The vertexes are transformed with a matrix you set with matrix methods Matrix_LoadID() , Matrix_Translate() , Matrix_Rotate() , Matrix_Scale() , Matrix_Push() , Matrix_Pop() the object shape is defined by _pMeshBuffer, the texture of the object is defined by _pTexture. Note drawings on the main screen needs a SwapBuffer() to be shown at each frames.
virtual void DrawRGBARectangle (unsigned char *_prgbaTable, unsigned int _PixelWidth, unsigned int _PixelHeight)=0
 Render directly a 32bit pixel bitmap image from memory on the whole viewport. note Position Coordinates are not used. the bitamp is just scaled to the viewport. Note drawings on the main screen needs a SwapBuffer() to be shown at each frames.
virtual void SwapBuffer ()=0
 Swap buffers so that what was drawn on the viewport is shown. this is needed to active all Clear(), RenderMesh() ,...
void SetFOVLength (float _fovlength)
 manage 3D projection FOV
void SetNearCutPlane (float _neardistance)
 manage 3D projection near cut plane distance.
void SetFarCutPlane (float _fardistance)
 manage 3D projection far cut plane.
float GetPositionX1 ()
 Get upperleft horizontal the coordinate of this ViewPort, in the father's origin.
float GetPositionY1 ()
 Get the upperleft vertical coordinate of this ViewPort, in the father's origin.
float GetPositionX2 ()
 Get the downright horizontal coordinate of this ViewPort, in the father's origin.
float GetPositionY2 ()
 Get the downright vertical coordinate of this ViewPort, in the father's origin.
float GetClippingX1 ()
 Get upperleft horizontal the coordinate of this ViewPort.
float GetClippingY1 ()
 Get the upperleft vertical coordinate of this ViewPort.
float GetClippingX2 ()
 Get the downright horizontal coordinate of this ViewPort.
float GetClippingY2 ()
 Get the downright vertical coordinate of this ViewPort.
InternalViewPortGetRootViewPort ()
 the root viewport if it is a sub-viewport, or 'this' if root.
InternalViewPortGetFatherViewPort ()
 Get the direct father viewport, or 0L if Root.
virtual void Matrix_LoadID (eLoadId _enum=eLoadId_All)=0
 The matrix becomes an Identity matrix, which means no transformation at all. It cleans all previous transformations. _enum can be used to only affect the rotation terms (3x3 matrix).
virtual void Matrix_Translate (float _x, float _y, float _z)=0
 Add a translation transformation to the matrix.
virtual void Matrix_Rotate (float _angleRad, float _x, float _y, float _z)=0
 Add a Rotation to the matrix, using a quaternion.
virtual void Matrix_Scale (float _sx, float _sy, float _sz)=0
 Add a Scale to the matrix.
virtual void Matrix_Push ()=0
 Push the current state of the matrix in the stack.
virtual void Matrix_Pop ()=0
 Pop the last state of the matrix from the stack.

Protected Attributes

float m_ScaleX1
 2d coordinates of the rectangle scale, in [0,1] values, in the father position scale.
float m_ScaleY1
float m_ScaleX2
float m_ScaleY2
float m_ClippingX1
 2d coordinates of the rectangle bounds, in [0,1] float scale values.
float m_ClippingY1
float m_ClippingX2
float m_ClippingY2
InternalViewPortm_pRootViewPort
 the root viewport if it is a sub-viewport, or 'this' if root.
InternalViewPortm_pPositionFatherViewPort
 the father in the hierarchy of ViewPort
InternalViewPortm_pPositionFirstSonViewPort
 the first son in the hierarchy of ViewPort.
InternalViewPortm_pPositionNextBrotherViewPort
 the next brother in the hierarchy of ViewPort.
InternalViewPortm_pClippingFatherViewPort
 the father in the hierarchy of ViewPort
InternalViewPortm_pClippingFirstSonViewPort
 the first son in the hierarchy of ViewPort.
InternalViewPortm_pClippingNextBrotherViewPort
 the next brother in the hierarchy of ViewPort.
float m_fov
 for 3D rendering, Distance between the projected plane and the center. must be >0.001
float m_NearCutPlane
 for 3D rendering,Near cut plane, must be >0.001 and <= FarCutPlane
float m_FarCutPlane
 for 3D rendering,Far cut plane, must be >= NearCutPlane


Member Enumeration Documentation

enum eLoadId
 

Matrix_LoadID() special enum.

Enumerator:
eLoadId_All  all matrix terms are set to ID
eLoadId_Rotation  only rotation terms (3x3) are set to ID.

Definition at line 420 of file VirtualMachine.h.


Member Function Documentation

virtual void Clear float  _red = 0.0f,
float  _green = 0.0f,
float  _blue = 0.0f
[pure virtual]
 

Reset color to black (or given color),and depth buffer, of this ViewPort.

Parameters:
_red [0.0,1.0]
_green [0.0,1.0]
_blue [0.0,1.0]

virtual void DrawRGBARectangle unsigned char *  _prgbaTable,
unsigned int  _PixelWidth,
unsigned int  _PixelHeight
[pure virtual]
 

Render directly a 32bit pixel bitmap image from memory on the whole viewport. note Position Coordinates are not used. the bitamp is just scaled to the viewport. Note drawings on the main screen needs a SwapBuffer() to be shown at each frames.

Parameters:
_prgbaTable pointer to the beginning of a 32bit RGBA table.
_PixelWidth number of pixel of a line
_PixelHeight number of pixel lines.

float GetClippingX1  )  [inline]
 

Get upperleft horizontal the coordinate of this ViewPort.

Returns:
coord in [0,1] scale.

Definition at line 390 of file VirtualMachine.h.

References m_ClippingX1.

float GetClippingX2  )  [inline]
 

Get the downright horizontal coordinate of this ViewPort.

Returns:
coord in [0,1] scale.

Definition at line 400 of file VirtualMachine.h.

References m_ClippingX2.

float GetClippingY1  )  [inline]
 

Get the upperleft vertical coordinate of this ViewPort.

Returns:
coord in [0,1] scale.

Definition at line 395 of file VirtualMachine.h.

References m_ClippingY1.

float GetClippingY2  )  [inline]
 

Get the downright vertical coordinate of this ViewPort.

Returns:
coord in [0,1] scale.

Definition at line 405 of file VirtualMachine.h.

References m_ClippingY2.

InternalViewPort* GetFatherViewPort  )  [inline]
 

Get the direct father viewport, or 0L if Root.

Returns:
the father InternalViewPort or 0L.

Definition at line 415 of file VirtualMachine.h.

References m_pClippingFatherViewPort.

float GetPositionX1  )  [inline]
 

Get upperleft horizontal the coordinate of this ViewPort, in the father's origin.

Returns:
coord in [0,1] scale.

Definition at line 370 of file VirtualMachine.h.

References m_ScaleX1.

float GetPositionX2  )  [inline]
 

Get the downright horizontal coordinate of this ViewPort, in the father's origin.

Returns:
coord in [0,1] scale.

Definition at line 380 of file VirtualMachine.h.

References m_ScaleX2.

float GetPositionY1  )  [inline]
 

Get the upperleft vertical coordinate of this ViewPort, in the father's origin.

Returns:
coord in [0,1] scale.

Definition at line 375 of file VirtualMachine.h.

References m_ScaleY1.

float GetPositionY2  )  [inline]
 

Get the downright vertical coordinate of this ViewPort, in the father's origin.

Returns:
coord in [0,1] scale.

Definition at line 385 of file VirtualMachine.h.

References m_ScaleY2.

InternalViewPort* GetRootViewPort  )  [inline]
 

the root viewport if it is a sub-viewport, or 'this' if root.

Returns:
the parent root viewport.

Definition at line 410 of file VirtualMachine.h.

References m_pRootViewPort.

virtual void Matrix_LoadID eLoadId  _enum = eLoadId_All  )  [pure virtual]
 

The matrix becomes an Identity matrix, which means no transformation at all. It cleans all previous transformations. _enum can be used to only affect the rotation terms (3x3 matrix).

Parameters:
_enum 

virtual void Matrix_Pop  )  [pure virtual]
 

Pop the last state of the matrix from the stack.

virtual void Matrix_Push  )  [pure virtual]
 

Push the current state of the matrix in the stack.

virtual void Matrix_Rotate float  _angleRad,
float  _x,
float  _y,
float  _z
[pure virtual]
 

Add a Rotation to the matrix, using a quaternion.

Parameters:
_angleRad an angle given in radian.
_x x normalized axis to rotate.
_y y normalized axis to rotate.
_z z normalized axis to rotate.

virtual void Matrix_Scale float  _sx,
float  _sy,
float  _sz
[pure virtual]
 

Add a Scale to the matrix.

Parameters:
_x Rate to scale the X axis.
_y Rate to scale the Y axis.
_z Rate to scale the Z axis.

virtual void Matrix_Translate float  _x,
float  _y,
float  _z
[pure virtual]
 

Add a translation transformation to the matrix.

Parameters:
_x x axis distance to move.
_y y axis distance to move.
_z z axis distance to move.

virtual void RenderMesh InternalObject3DBuffer _pMeshBuffer,
InternalTexture _pTexture = 0L
[pure virtual]
 

Render a 3D Object. The vertexes are transformed with a matrix you set with matrix methods Matrix_LoadID() , Matrix_Translate() , Matrix_Rotate() , Matrix_Scale() , Matrix_Push() , Matrix_Pop() the object shape is defined by _pMeshBuffer, the texture of the object is defined by _pTexture. Note drawings on the main screen needs a SwapBuffer() to be shown at each frames.

Parameters:
_pMeshBuffer InternalObject3DBuffer
_pTexture InternalTexture or null, it will shade vertex color.

void SetFarCutPlane float  _fardistance  )  [inline]
 

manage 3D projection far cut plane.

Definition at line 339 of file VirtualMachine.h.

References m_FarCutPlane.

void SetFOVLength float  _fovlength  )  [inline]
 

manage 3D projection FOV

Definition at line 331 of file VirtualMachine.h.

References m_fov.

void SetNearCutPlane float  _neardistance  )  [inline]
 

manage 3D projection near cut plane distance.

Definition at line 335 of file VirtualMachine.h.

References m_NearCutPlane.

virtual void SwapBuffer  )  [pure virtual]
 

Swap buffers so that what was drawn on the viewport is shown. this is needed to active all Clear(), RenderMesh() ,...


Member Data Documentation

float m_ClippingX1 [protected]
 

2d coordinates of the rectangle bounds, in [0,1] float scale values.

Definition at line 470 of file VirtualMachine.h.

Referenced by GetClippingX1().

float m_FarCutPlane [protected]
 

for 3D rendering,Far cut plane, must be >= NearCutPlane

Definition at line 493 of file VirtualMachine.h.

Referenced by SetFarCutPlane().

float m_fov [protected]
 

for 3D rendering, Distance between the projected plane and the center. must be >0.001

Definition at line 489 of file VirtualMachine.h.

Referenced by SetFOVLength().

float m_NearCutPlane [protected]
 

for 3D rendering,Near cut plane, must be >0.001 and <= FarCutPlane

Definition at line 491 of file VirtualMachine.h.

Referenced by SetNearCutPlane().

InternalViewPort* m_pClippingFatherViewPort [protected]
 

the father in the hierarchy of ViewPort

Definition at line 483 of file VirtualMachine.h.

Referenced by GetFatherViewPort().

InternalViewPort* m_pClippingFirstSonViewPort [protected]
 

the first son in the hierarchy of ViewPort.

Definition at line 485 of file VirtualMachine.h.

InternalViewPort* m_pClippingNextBrotherViewPort [protected]
 

the next brother in the hierarchy of ViewPort.

Definition at line 487 of file VirtualMachine.h.

InternalViewPort* m_pPositionFatherViewPort [protected]
 

the father in the hierarchy of ViewPort

Definition at line 477 of file VirtualMachine.h.

InternalViewPort* m_pPositionFirstSonViewPort [protected]
 

the first son in the hierarchy of ViewPort.

Definition at line 479 of file VirtualMachine.h.

InternalViewPort* m_pPositionNextBrotherViewPort [protected]
 

the next brother in the hierarchy of ViewPort.

Definition at line 481 of file VirtualMachine.h.

InternalViewPort* m_pRootViewPort [protected]
 

the root viewport if it is a sub-viewport, or 'this' if root.

Definition at line 475 of file VirtualMachine.h.

Referenced by GetRootViewPort().

float m_ScaleX1 [protected]
 

2d coordinates of the rectangle scale, in [0,1] values, in the father position scale.

Definition at line 465 of file VirtualMachine.h.

Referenced by GetPositionX1().


The documentation for this class was generated from the following file:
      /\/\        4         N         k         !         N         D
                      _______  _ __ ___  _____            ___ _ _  ____
     ___________  __//___   /________  |/    / ___________\_______/    \
    /   _   _   \/   _     /    _   /      _/_/____/    _       __     /
   /    /   /       /     /    /    \      \/     /    /    \   \     /
  \\___/___/___/    ¯    _____/_____/       ______\___/_____/\________\\
               \________/_ ___ __ l____\      /elD!  
                 http://www.m4nkind.com \____/