GLC_Viewport : OpenGL Viewport. More...
#include <glc_viewport.h>
Public Member Functions | |
Constructor / Destructor | |
GLC_Viewport (QGLWidget *GLWidget) | |
Default constructor. | |
virtual | ~GLC_Viewport () |
Delete Camera, Image Plane and orbit circle. | |
Get Functions | |
GLC_Camera * | cameraHandle () const |
Return the camera associate to this viewport. | |
int | viewHSize () const |
Get this viewport Horizontal size. | |
int | viewVSize () const |
Get this viewport Vertical size. | |
double | aspectRatio () const |
Get this viewport ratio. | |
GLC_Point2d | normalyseMousePosition (int x, int y) |
Return the normalyse mouse position from screen coordinate. | |
GLC_Point2d | mapToOpenGLScreen (int x, int y) |
Map screen position to OpenGL screen position. | |
GLC_Point2d | mapNormalyzeToOpenGLScreen (double x, double y) |
Map normalyze screen position to OpenGL screen position. | |
GLC_Vector3d | mapPosMouse (GLdouble Posx, GLdouble Posy) const |
Map Screen position to OpenGL position (On image Plane) according to this viewport. | |
GLC_Vector3d | mapNormalyzePosMouse (double Posx, double Posy) const |
Map normalyse Screen position to OpenGL position (On image Plane) according to this viewport. | |
double | viewAngle () const |
Get this viewport's camera's angle of view. | |
double | viewTangent () const |
Get this viewport's camera's tangent value of view. | |
double | nearClippingPlaneDist (void) const |
Get this viewport near clipping plane distance. | |
double | farClippingPlaneDist (void) const |
Get this viewport far clipping plane distance. | |
QColor | backgroundColor (void) const |
Get this viewportbackground Color. | |
GLsizei | selectionSquareSize () const |
Return the selection square size of this viewport. | |
GLC_Matrix4x4 | projectionMatrix () const |
Return this viewport's the projection matrix. | |
GLC_Matrix4x4 | compositionMatrix () const |
Return the composition matrix between projection matrix and view matrix. | |
GLC_3DViewCollection * | widget3dCollectionHandle () |
Return an handle to the widget 3D collection. | |
bool | useOrtho () const |
Return true if this viewport use orthographic projection. | |
int | minimumPixelCullingSize () const |
Return the minimum pixel culling size. | |
double | minimumStaticPixelCullingRatio () const |
Return the minimum pixel culling ratio. | |
double | minimumDynamicPixelCullingRatio () const |
Return the minimum dynamic pixel culling ratio. | |
Set Functions | |
void | setWinGLSize (int HSize, int VSize) |
Inform the viewport that the OpenGL window size has been modified. | |
GLC_uint | renderAndSelect (int x, int y) |
Call the attached QGLWidgetSelect updateGL function and return the picking id. | |
GLC_uint | selectOnPreviousRender (int x, int y) |
Return the picking id from the already render window. | |
GLC_uint | selectBody (GLC_3DViewInstance *, int x, int y) |
Select a body inside a 3DViewInstance and return its UID. | |
QPair< int, GLC_uint > | selectPrimitive (GLC_3DViewInstance *, int x, int y) |
Select a primitive inside a 3DViewInstance and return its UID and its body index. | |
QSet< GLC_uint > | selectInsideSquare (int x1, int y1, int x2, int y2) |
Select objects inside specified square and return its UID in a set. | |
void | loadBackGroundImage (const QString &imageFile) |
load background image from file in this viewport | |
void | loadBackGroundImage (const QImage &image) |
load background image in this viewport | |
void | deleteBackGroundImage () |
delete background image of this viewport | |
void | setViewAngle (double TargetFov) |
Set Camera's angle of view of this viewport. | |
bool | setDistMin (double DistMin) |
Set near clipping distance of this viewport. | |
bool | setDistMax (double DistMax) |
Set far clipping distance of this viewport. | |
void | setDistMinAndMax (const GLC_BoundingBox &bBox) |
Set Near and Far clipping distance of this viewport. | |
void | setBackgroundColor (QColor setColor) |
Set the Background color of this viewport. | |
void | setSelectionSquareSize (GLsizei size) |
Set the selection square size of this viewport. | |
bool | updateFrustum (GLC_Matrix4x4 *pMat=NULL) |
Update this viewport frustum (frustum cullin purpose). | |
void | addClipPlane (GLenum planeGlEnum, GLC_Plane *pPlane) |
Add a clipping plane to this viewport. | |
void | removeClipPlane (GLenum planeGlEnum) |
Remove the clip plane coresponding to the given id. | |
void | removeAllClipPlane () |
Remove all clip plane. | |
void | useClipPlane (bool flag) |
Set the clipping plane usage. | |
void | add3DWidget (GLC_3DViewInstance &widget) |
Add 3DWidget to this viewport. | |
void | clearBackground (const QColor &c) const |
Clear the background color with the specified color. | |
void | setToOrtho (bool useOrtho) |
Set othographic usage to the given flag. | |
void | setMinimumPixelCullingSize (int size) |
Set minimum pixel culling size. | |
zoom Functions | |
void | reframe (const GLC_BoundingBox &box) |
Set the viewport's camera in order to reframe on the current scene. | |
Private Member Functions | |
GLC_uint | meaningfulIdInsideSquare (GLint x, GLint y, GLsizei width, GLsizei height) |
Return the meaningful color ID inside a square in screen coordinates. | |
QSet< GLC_uint > | listOfIdInsideSquare (GLint x, GLint y, GLsizei width, GLsizei height) |
Return the Set of ID inside a square in screen coordinate. | |
void | updateMinimumRatioSize () |
Update minimum ratio size for pixel culling. | |
Private Attributes | |
GLC_Camera * | m_pViewCam |
Viewport's camera. | |
double | m_DistanceMax |
Camera Maximum distance (far clipping plane). | |
double | m_dDistanceMini |
Camera Minimum distance (near clipping plane). | |
double | m_ViewAngle |
Camera angle of view. | |
double | m_ViewTangent |
Camera angle tangent. | |
GLC_ImagePlane * | m_pImagePlane |
Image plane (Background image). | |
int | m_WindowHSize |
Horizontal OpenGL viewport size. | |
int | m_WindowVSize |
Vertical OpenGL viewport size. | |
double | m_AspectRatio |
View AspectRatio. | |
QGLWidget * | m_pQGLWidget |
The QGLWidget attached to the viewport (rendering context). | |
QColor | m_BackgroundColor |
Viewport Background color. | |
GLsizei | m_SelectionSquareSize |
The selection square size. | |
GLC_Matrix4x4 | m_ProjectionMatrix |
The projection matrix. | |
GLC_Frustum | m_Frustum |
The frustum associated to the viewport. | |
QHash< GLenum, GLC_Plane * > | m_ClipPlanesHash |
The list of additionnal clipping plane. | |
bool | m_UseClipPlane |
Flag to know if clipping plane must be used. | |
GLC_3DViewCollection | m_3DWidgetCollection |
The collection wich contains 3D widget. | |
bool | m_UseParallelProjection |
Flag to know if the viewport use orthographic projection. | |
int | m_MinimumStaticPixelSize |
The minimum static pixel culling size. | |
double | m_MinimumStaticRatioSize |
The minimum static size ratio. | |
double | m_MinimumDynamicRatioSize |
The minimum dynamic size ratio. | |
OpenGL Functions | |
| |
void | initGl () |
Initialize OpenGL with default values. | |
void | glExecuteCam (void) |
Load camera's transformation Matrix and display image if necessary. | |
void | updateProjectionMat (void) |
Update this viewport OpenGL projection matrix. | |
void | forceAspectRatio (double) |
Force the aspect ratio of this viewport. | |
void | updateAspectRatio () |
Update the aspect ratio of this viewport. | |
const GLC_Frustum & | frustum () const |
Return the frustum associated to this viewport. | |
GLC_Frustum | selectionFrustum (int, int) const |
Return the frustum associated to a selection coordinate. | |
GLC_Point3d | unProject (int, int) const |
Return the world 3d point from the given screen coordinate. | |
QList< GLC_Point3d > | unproject (const QList< int > &) const |
Return the list af world 3d point form the givne list af screen coordinates. | |
QGLWidget * | qGLWidgetHandle () |
Return an handle of the QGLWidget of this viewport. | |
void | render3DWidget () |
Render viewport 3D widget. | |
void | renderImagePlane () |
Render this viewport's image plane. |
GLC_Viewport : OpenGL Viewport.
An GLC_Viewport define Viewport with these specification
Definition at line 53 of file glc_viewport.h.
GLC_Viewport::GLC_Viewport | ( | QGLWidget * | GLWidget | ) |
Default constructor.
Construct Viewport with these specifications :
Definition at line 42 of file glc_viewport.cpp.
References updateMinimumRatioSize().
GLC_Viewport::~GLC_Viewport | ( | ) | [virtual] |
Delete Camera, Image Plane and orbit circle.
Definition at line 71 of file glc_viewport.cpp.
References deleteBackGroundImage(), m_ClipPlanesHash, and m_pViewCam.
void GLC_Viewport::add3DWidget | ( | GLC_3DViewInstance & | widget | ) | [inline] |
Add 3DWidget to this viewport.
Definition at line 301 of file glc_viewport.h.
void GLC_Viewport::addClipPlane | ( | GLenum | planeGlEnum, | |
GLC_Plane * | pPlane | |||
) |
Add a clipping plane to this viewport.
Definition at line 686 of file glc_viewport.cpp.
References m_ClipPlanesHash.
double GLC_Viewport::aspectRatio | ( | ) | const [inline] |
Get this viewport ratio.
Definition at line 94 of file glc_viewport.h.
QColor GLC_Viewport::backgroundColor | ( | void | ) | const [inline] |
Get this viewportbackground Color.
Definition at line 130 of file glc_viewport.h.
GLC_Camera* GLC_Viewport::cameraHandle | ( | ) | const [inline] |
Return the camera associate to this viewport.
Definition at line 82 of file glc_viewport.h.
Referenced by GLC_3DViewInstance::choseLod(), GLC_RepCrossMover::createCrossInstance(), GLC_AbstractManipulator::enterManipulateState(), GLC_FlyMover::fly(), GLC_TurnTableMover::init(), GLC_SetTargetMover::init(), GLC_FlyMover::init(), GLC_AbstractManipulator::manipulate(), GLC_ZoomMover::move(), GLC_TurnTableMover::move(), GLC_TsrMover::move(), GLC_TrackBallMover::move(), GLC_PanMover::move(), GLC_FlyMover::move(), and GLC_FlyMover::timerEvent().
void GLC_Viewport::clearBackground | ( | const QColor & | c | ) | const [inline] |
Clear the background color with the specified color.
Definition at line 305 of file glc_viewport.h.
GLC_Matrix4x4 GLC_Viewport::compositionMatrix | ( | ) | const [inline] |
Return the composition matrix between projection matrix and view matrix.
Definition at line 405 of file glc_viewport.h.
References m_ProjectionMatrix, m_pViewCam, GLC_Camera::modelViewMatrix(), and projectionMatrix().
Referenced by GLC_TsrMover::move(), and updateFrustum().
void GLC_Viewport::deleteBackGroundImage | ( | ) |
delete background image of this viewport
Definition at line 559 of file glc_viewport.cpp.
References m_pImagePlane.
Referenced by ~GLC_Viewport().
double GLC_Viewport::farClippingPlaneDist | ( | void | ) | const [inline] |
Get this viewport far clipping plane distance.
Definition at line 126 of file glc_viewport.h.
void GLC_Viewport::forceAspectRatio | ( | double | ratio | ) |
Force the aspect ratio of this viewport.
Definition at line 204 of file glc_viewport.cpp.
References m_AspectRatio, and updateProjectionMat().
const GLC_Frustum& GLC_Viewport::frustum | ( | ) | const [inline] |
Return the frustum associated to this viewport.
Definition at line 188 of file glc_viewport.h.
Referenced by GLC_3DViewCollection::updateInstanceViewableState().
void GLC_Viewport::glExecuteCam | ( | void | ) |
Load camera's transformation Matrix and display image if necessary.
Definition at line 167 of file glc_viewport.cpp.
References GLC_Camera::glExecute(), m_pViewCam, and renderImagePlane().
Referenced by selectBody(), and selectPrimitive().
void GLC_Viewport::initGl | ( | ) |
Initialize OpenGL with default values.
Glew initialisation is made here
Definition at line 154 of file glc_viewport.cpp.
References m_BackgroundColor, and m_pQGLWidget.
QSet< GLC_uint > GLC_Viewport::listOfIdInsideSquare | ( | GLint | x, | |
GLint | y, | |||
GLsizei | width, | |||
GLsizei | height | |||
) | [private] |
Return the Set of ID inside a square in screen coordinate.
Definition at line 515 of file glc_viewport.cpp.
References glc::decodeRgbId(), m_BackgroundColor, and m_pQGLWidget.
Referenced by selectInsideSquare().
void GLC_Viewport::loadBackGroundImage | ( | const QImage & | image | ) |
load background image in this viewport
Definition at line 553 of file glc_viewport.cpp.
References m_pImagePlane.
void GLC_Viewport::loadBackGroundImage | ( | const QString & | imageFile | ) |
load background image from file in this viewport
Definition at line 547 of file glc_viewport.cpp.
References m_pImagePlane.
GLC_Vector3d GLC_Viewport::mapNormalyzePosMouse | ( | double | Posx, | |
double | Posy | |||
) | const |
Map normalyse Screen position to OpenGL position (On image Plane) according to this viewport.
Definition at line 143 of file glc_viewport.cpp.
References m_WindowHSize, m_WindowVSize, and mapPosMouse().
GLC_Point2d GLC_Viewport::mapNormalyzeToOpenGLScreen | ( | double | x, | |
double | y | |||
) |
Map normalyze screen position to OpenGL screen position.
Definition at line 114 of file glc_viewport.cpp.
References GLC_Vector2d::getY(), and GLC_Vector2d::setY().
Referenced by mapToOpenGLScreen(), and GLC_TsrMover::move().
GLC_Vector3d GLC_Viewport::mapPosMouse | ( | GLdouble | Posx, | |
GLdouble | Posy | |||
) | const |
Map Screen position to OpenGL position (On image Plane) according to this viewport.
Definition at line 123 of file glc_viewport.cpp.
References GLC_Camera::distEyeTarget(), m_pViewCam, m_ViewTangent, m_WindowHSize, and m_WindowVSize.
Referenced by GLC_SetTargetMover::init(), GLC_PanMover::init(), mapNormalyzePosMouse(), and GLC_PanMover::move().
GLC_Point2d GLC_Viewport::mapToOpenGLScreen | ( | int | x, | |
int | y | |||
) |
Map screen position to OpenGL screen position.
Definition at line 107 of file glc_viewport.cpp.
References GLC_Vector2d::getX(), GLC_Vector2d::getY(), mapNormalyzeToOpenGLScreen(), and normalyseMousePosition().
GLC_uint GLC_Viewport::meaningfulIdInsideSquare | ( | GLint | x, | |
GLint | y, | |||
GLsizei | width, | |||
GLsizei | height | |||
) | [private] |
Return the meaningful color ID inside a square in screen coordinates.
Definition at line 468 of file glc_viewport.cpp.
References glc::decodeRgbId(), m_BackgroundColor, and m_pQGLWidget.
Referenced by selectBody(), selectOnPreviousRender(), and selectPrimitive().
double GLC_Viewport::minimumDynamicPixelCullingRatio | ( | ) | const [inline] |
Return the minimum dynamic pixel culling ratio.
Definition at line 161 of file glc_viewport.h.
Referenced by GLC_3DViewInstance::choseLod().
int GLC_Viewport::minimumPixelCullingSize | ( | ) | const [inline] |
Return the minimum pixel culling size.
Definition at line 153 of file glc_viewport.h.
double GLC_Viewport::minimumStaticPixelCullingRatio | ( | ) | const [inline] |
Return the minimum pixel culling ratio.
Definition at line 157 of file glc_viewport.h.
Referenced by GLC_3DViewInstance::choseLod().
double GLC_Viewport::nearClippingPlaneDist | ( | void | ) | const [inline] |
Get this viewport near clipping plane distance.
Definition at line 122 of file glc_viewport.h.
GLC_Point2d GLC_Viewport::normalyseMousePosition | ( | int | x, | |
int | y | |||
) |
Return the normalyse mouse position from screen coordinate.
Definition at line 90 of file glc_viewport.cpp.
References m_WindowHSize, and m_WindowVSize.
Referenced by mapToOpenGLScreen().
GLC_Matrix4x4 GLC_Viewport::projectionMatrix | ( | ) | const [inline] |
Return this viewport's the projection matrix.
Definition at line 138 of file glc_viewport.h.
Referenced by compositionMatrix().
QGLWidget* GLC_Viewport::qGLWidgetHandle | ( | ) | [inline] |
Return an handle of the QGLWidget of this viewport.
Definition at line 202 of file glc_viewport.h.
Referenced by GLC_RepFlyMover::glDraw().
void GLC_Viewport::reframe | ( | const GLC_BoundingBox & | box | ) |
Set the viewport's camera in order to reframe on the current scene.
box shouldn't be empty
Definition at line 575 of file glc_viewport.cpp.
References GLC_BoundingBox::boundingSphereRadius(), GLC_BoundingBox::center(), GLC_BoundingBox::isEmpty(), m_pViewCam, m_ViewTangent, GLC_Camera::setDistEyeTarget(), GLC_Camera::target(), and GLC_Camera::translate().
void GLC_Viewport::removeAllClipPlane | ( | ) |
Remove all clip plane.
Definition at line 709 of file glc_viewport.cpp.
References m_ClipPlanesHash.
void GLC_Viewport::removeClipPlane | ( | GLenum | planeGlEnum | ) |
Remove the clip plane coresponding to the given id.
Definition at line 696 of file glc_viewport.cpp.
References m_ClipPlanesHash.
void GLC_Viewport::render3DWidget | ( | ) |
Render viewport 3D widget.
Definition at line 316 of file glc_viewport.cpp.
References m_3DWidgetCollection, GLC_3DViewCollection::render(), glc::TransparentRenderFlag, and glc::WireRenderFlag.
GLC_uint GLC_Viewport::renderAndSelect | ( | int | x, | |
int | y | |||
) |
Call the attached QGLWidgetSelect updateGL function and return the picking id.
Return UID of the nearest picked object
Definition at line 345 of file glc_viewport.cpp.
References m_pQGLWidget, selectOnPreviousRender(), and GLC_State::setSelectionMode().
void GLC_Viewport::renderImagePlane | ( | ) | [private] |
Render this viewport's image plane.
Definition at line 304 of file glc_viewport.cpp.
References GLC_State::isInSelectionMode(), m_pImagePlane, and GLC_ImagePlane::render().
Referenced by glExecuteCam().
GLC_uint GLC_Viewport::selectBody | ( | GLC_3DViewInstance * | pInstance, | |
int | x, | |||
int | y | |||
) |
Select a body inside a 3DViewInstance and return its UID.
Return UID of the nearest picked body
Definition at line 368 of file glc_viewport.cpp.
References GLC_Context::current(), GLC_Context::glcEnableLighting(), GLC_Context::glcLoadIdentity(), glExecuteCam(), m_pQGLWidget, meaningfulIdInsideSquare(), GLC_3DViewInstance::renderForBodySelection(), and GLC_State::setSelectionMode().
QSet< GLC_uint > GLC_Viewport::selectInsideSquare | ( | int | x1, | |
int | y1, | |||
int | x2, | |||
int | y2 | |||
) |
Select objects inside specified square and return its UID in a set.
Definition at line 438 of file glc_viewport.cpp.
References listOfIdInsideSquare(), m_pQGLWidget, and GLC_State::setSelectionMode().
GLC_Frustum GLC_Viewport::selectionFrustum | ( | int | x, | |
int | y | |||
) | const |
Return the frustum associated to a selection coordinate.
Definition at line 215 of file glc_viewport.cpp.
References GLC_Camera::eye(), m_Frustum, m_pViewCam, m_SelectionSquareSize, and unproject().
GLsizei GLC_Viewport::selectionSquareSize | ( | ) | const [inline] |
Return the selection square size of this viewport.
Definition at line 134 of file glc_viewport.h.
GLC_uint GLC_Viewport::selectOnPreviousRender | ( | int | x, | |
int | y | |||
) |
Return the picking id from the already render window.
Definition at line 357 of file glc_viewport.cpp.
References m_pQGLWidget, m_SelectionSquareSize, and meaningfulIdInsideSquare().
Referenced by renderAndSelect(), and GLC_3DWidgetManagerHandle::select().
QPair< int, GLC_uint > GLC_Viewport::selectPrimitive | ( | GLC_3DViewInstance * | pInstance, | |
int | x, | |||
int | y | |||
) |
Select a primitive inside a 3DViewInstance and return its UID and its body index.
Return UID of the nearest picked primitive
Definition at line 395 of file glc_viewport.cpp.
References GLC_Context::current(), GLC_Context::glcEnableLighting(), GLC_Context::glcLoadIdentity(), glExecuteCam(), m_pQGLWidget, meaningfulIdInsideSquare(), GLC_3DViewInstance::renderForBodySelection(), GLC_3DViewInstance::renderForPrimitiveSelection(), and GLC_State::setSelectionMode().
void GLC_Viewport::setBackgroundColor | ( | QColor | setColor | ) |
Set the Background color of this viewport.
Definition at line 680 of file glc_viewport.cpp.
References m_BackgroundColor, and m_pQGLWidget.
bool GLC_Viewport::setDistMax | ( | double | DistMax | ) |
Set far clipping distance of this viewport.
Definition at line 611 of file glc_viewport.cpp.
References m_dDistanceMini, m_DistanceMax, and updateProjectionMat().
bool GLC_Viewport::setDistMin | ( | double | DistMin | ) |
Set near clipping distance of this viewport.
Definition at line 592 of file glc_viewport.cpp.
References m_dDistanceMini, m_DistanceMax, and updateProjectionMat().
void GLC_Viewport::setDistMinAndMax | ( | const GLC_BoundingBox & | bBox | ) |
Set Near and Far clipping distance of this viewport.
box shouldn't be empty
Definition at line 630 of file glc_viewport.cpp.
References GLC_Camera::distEyeTarget(), GLC_Camera::eye(), GLC_BoundingBox::isEmpty(), m_dDistanceMini, m_DistanceMax, m_pViewCam, GLC_Camera::modelViewMatrix(), and updateProjectionMat().
Referenced by GLC_TsrMover::move().
void GLC_Viewport::setMinimumPixelCullingSize | ( | int | size | ) | [inline] |
Set minimum pixel culling size.
Definition at line 312 of file glc_viewport.h.
void GLC_Viewport::setSelectionSquareSize | ( | GLsizei | size | ) | [inline] |
Set the selection square size of this viewport.
Definition at line 281 of file glc_viewport.h.
void GLC_Viewport::setToOrtho | ( | bool | useOrtho | ) |
Set othographic usage to the given flag.
Definition at line 565 of file glc_viewport.cpp.
References m_UseParallelProjection, and updateProjectionMat().
void GLC_Viewport::setViewAngle | ( | double | TargetFov | ) | [inline] |
Set Camera's angle of view of this viewport.
Definition at line 260 of file glc_viewport.h.
References glc::toRadian().
void GLC_Viewport::setWinGLSize | ( | int | HSize, | |
int | VSize | |||
) |
Inform the viewport that the OpenGL window size has been modified.
Definition at line 325 of file glc_viewport.cpp.
References m_WindowHSize, m_WindowVSize, updateAspectRatio(), updateMinimumRatioSize(), and updateProjectionMat().
QList< GLC_Point3d > GLC_Viewport::unproject | ( | const QList< int > & | list | ) | const |
Return the list af world 3d point form the givne list af screen coordinates.
The size of the given list must be a multiple of 2
Definition at line 271 of file glc_viewport.cpp.
References GLC_Matrix4x4::getData(), m_ProjectionMatrix, m_pViewCam, m_WindowVSize, and GLC_Camera::modelViewMatrix().
Referenced by selectionFrustum().
GLC_Point3d GLC_Viewport::unProject | ( | int | x, | |
int | y | |||
) | const |
Return the world 3d point from the given screen coordinate.
Definition at line 252 of file glc_viewport.cpp.
References GLC_Matrix4x4::getData(), m_ProjectionMatrix, m_pViewCam, m_WindowVSize, and GLC_Camera::modelViewMatrix().
Referenced by GLC_SetTargetMover::init(), GLC_FlyMover::init(), GLC_FlyMover::move(), and GLC_3DWidgetManagerHandle::select().
void GLC_Viewport::updateAspectRatio | ( | ) |
Update the aspect ratio of this viewport.
Definition at line 210 of file glc_viewport.cpp.
References m_AspectRatio, m_WindowHSize, and m_WindowVSize.
Referenced by setWinGLSize().
bool GLC_Viewport::updateFrustum | ( | GLC_Matrix4x4 * | pMat = NULL |
) | [inline] |
Update this viewport frustum (frustum cullin purpose).
Return true if the frustum has changed
Definition at line 417 of file glc_viewport.h.
References compositionMatrix(), m_Frustum, and GLC_Frustum::update().
Referenced by GLC_3DViewCollection::updateInstanceViewableState().
void GLC_Viewport::updateMinimumRatioSize | ( | ) | [private] |
Update minimum ratio size for pixel culling.
Definition at line 539 of file glc_viewport.cpp.
References m_MinimumDynamicRatioSize, m_MinimumStaticPixelSize, m_MinimumStaticRatioSize, m_WindowHSize, and m_WindowVSize.
Referenced by GLC_Viewport(), and setWinGLSize().
void GLC_Viewport::updateProjectionMat | ( | void | ) |
Update this viewport OpenGL projection matrix.
Definition at line 173 of file glc_viewport.cpp.
References GLC_Context::current(), GLC_Camera::distEyeTarget(), GLC_Context::glcFrustum(), GLC_Context::glcLoadIdentity(), GLC_Context::glcMatrixMode(), GLC_Context::glcOrtho(), m_AspectRatio, m_dDistanceMini, m_DistanceMax, m_ProjectionMatrix, m_pViewCam, m_UseParallelProjection, m_ViewAngle, m_ViewTangent, glc::PI, and GLC_Context::projectionMatrix().
Referenced by forceAspectRatio(), setDistMax(), setDistMin(), setDistMinAndMax(), setToOrtho(), and setWinGLSize().
void GLC_Viewport::useClipPlane | ( | bool | flag | ) |
Set the clipping plane usage.
Definition at line 720 of file glc_viewport.cpp.
References GLC_Plane::data(), m_ClipPlanesHash, and m_UseClipPlane.
bool GLC_Viewport::useOrtho | ( | ) | const [inline] |
Return true if this viewport use orthographic projection.
Definition at line 149 of file glc_viewport.h.
Referenced by GLC_AbstractManipulator::manipulate().
double GLC_Viewport::viewAngle | ( | ) | const [inline] |
Get this viewport's camera's angle of view.
Definition at line 113 of file glc_viewport.h.
Referenced by GLC_RepCrossMover::createCrossInstance().
int GLC_Viewport::viewHSize | ( | ) | const [inline] |
Get this viewport Horizontal size.
Definition at line 86 of file glc_viewport.h.
Referenced by GLC_RepTrackBallMover::computeRadius(), GLC_RepCrossMover::createCrossInstance(), GLC_RepTrackBallMover::glDraw(), GLC_RepFlyMover::glDraw(), GLC_SetTargetMover::init(), GLC_FlyMover::mapForFlying(), GLC_TrackBallMover::mapForTracking(), GLC_TurnTableMover::move(), and GLC_TsrMover::move().
double GLC_Viewport::viewTangent | ( | ) | const [inline] |
Get this viewport's camera's tangent value of view.
Definition at line 117 of file glc_viewport.h.
Referenced by GLC_3DViewInstance::choseLod(), and GLC_TsrMover::move().
int GLC_Viewport::viewVSize | ( | ) | const [inline] |
Get this viewport Vertical size.
Definition at line 90 of file glc_viewport.h.
Referenced by GLC_RepTrackBallMover::computeRadius(), GLC_RepCrossMover::createCrossInstance(), GLC_RepTrackBallMover::glDraw(), GLC_RepFlyMover::glDraw(), GLC_ZoomMover::init(), GLC_SetTargetMover::init(), GLC_FlyMover::mapForFlying(), GLC_TrackBallMover::mapForTracking(), GLC_ZoomMover::move(), GLC_TurnTableMover::move(), and GLC_TsrMover::move().
GLC_3DViewCollection* GLC_Viewport::widget3dCollectionHandle | ( | ) | [inline] |
Return an handle to the widget 3D collection.
Definition at line 145 of file glc_viewport.h.
The collection wich contains 3D widget.
Definition at line 390 of file glc_viewport.h.
Referenced by render3DWidget().
double GLC_Viewport::m_AspectRatio [private] |
View AspectRatio.
Definition at line 366 of file glc_viewport.h.
Referenced by forceAspectRatio(), updateAspectRatio(), and updateProjectionMat().
QColor GLC_Viewport::m_BackgroundColor [private] |
Viewport Background color.
Definition at line 372 of file glc_viewport.h.
Referenced by initGl(), listOfIdInsideSquare(), meaningfulIdInsideSquare(), and setBackgroundColor().
QHash<GLenum, GLC_Plane*> GLC_Viewport::m_ClipPlanesHash [private] |
The list of additionnal clipping plane.
Definition at line 384 of file glc_viewport.h.
Referenced by addClipPlane(), removeAllClipPlane(), removeClipPlane(), useClipPlane(), and ~GLC_Viewport().
double GLC_Viewport::m_dDistanceMini [private] |
Camera Minimum distance (near clipping plane).
Definition at line 353 of file glc_viewport.h.
Referenced by setDistMax(), setDistMin(), setDistMinAndMax(), and updateProjectionMat().
double GLC_Viewport::m_DistanceMax [private] |
Camera Maximum distance (far clipping plane).
Definition at line 352 of file glc_viewport.h.
Referenced by setDistMax(), setDistMin(), setDistMinAndMax(), and updateProjectionMat().
GLC_Frustum GLC_Viewport::m_Frustum [private] |
The frustum associated to the viewport.
Definition at line 381 of file glc_viewport.h.
Referenced by selectionFrustum(), and updateFrustum().
double GLC_Viewport::m_MinimumDynamicRatioSize [private] |
The minimum dynamic size ratio.
Definition at line 402 of file glc_viewport.h.
Referenced by updateMinimumRatioSize().
int GLC_Viewport::m_MinimumStaticPixelSize [private] |
The minimum static pixel culling size.
Definition at line 396 of file glc_viewport.h.
Referenced by updateMinimumRatioSize().
double GLC_Viewport::m_MinimumStaticRatioSize [private] |
The minimum static size ratio.
Definition at line 399 of file glc_viewport.h.
Referenced by updateMinimumRatioSize().
GLC_ImagePlane* GLC_Viewport::m_pImagePlane [private] |
Image plane (Background image).
Definition at line 359 of file glc_viewport.h.
Referenced by deleteBackGroundImage(), loadBackGroundImage(), and renderImagePlane().
QGLWidget* GLC_Viewport::m_pQGLWidget [private] |
The QGLWidget attached to the viewport (rendering context).
Definition at line 369 of file glc_viewport.h.
Referenced by initGl(), listOfIdInsideSquare(), meaningfulIdInsideSquare(), renderAndSelect(), selectBody(), selectInsideSquare(), selectOnPreviousRender(), selectPrimitive(), and setBackgroundColor().
The projection matrix.
Definition at line 378 of file glc_viewport.h.
Referenced by compositionMatrix(), unproject(), unProject(), and updateProjectionMat().
GLC_Camera* GLC_Viewport::m_pViewCam [private] |
Viewport's camera.
Definition at line 350 of file glc_viewport.h.
Referenced by compositionMatrix(), glExecuteCam(), mapPosMouse(), reframe(), selectionFrustum(), setDistMinAndMax(), unproject(), unProject(), updateProjectionMat(), and ~GLC_Viewport().
GLsizei GLC_Viewport::m_SelectionSquareSize [private] |
The selection square size.
Definition at line 375 of file glc_viewport.h.
Referenced by selectionFrustum(), and selectOnPreviousRender().
bool GLC_Viewport::m_UseClipPlane [private] |
Flag to know if clipping plane must be used.
Definition at line 387 of file glc_viewport.h.
Referenced by useClipPlane().
bool GLC_Viewport::m_UseParallelProjection [private] |
Flag to know if the viewport use orthographic projection.
Definition at line 393 of file glc_viewport.h.
Referenced by setToOrtho(), and updateProjectionMat().
double GLC_Viewport::m_ViewAngle [private] |
Camera angle of view.
Definition at line 354 of file glc_viewport.h.
Referenced by updateProjectionMat().
double GLC_Viewport::m_ViewTangent [private] |
Camera angle tangent.
Definition at line 355 of file glc_viewport.h.
Referenced by mapPosMouse(), reframe(), and updateProjectionMat().
int GLC_Viewport::m_WindowHSize [private] |
Horizontal OpenGL viewport size.
Definition at line 362 of file glc_viewport.h.
Referenced by mapNormalyzePosMouse(), mapPosMouse(), normalyseMousePosition(), setWinGLSize(), updateAspectRatio(), and updateMinimumRatioSize().
int GLC_Viewport::m_WindowVSize [private] |
Vertical OpenGL viewport size.
Definition at line 363 of file glc_viewport.h.
Referenced by mapNormalyzePosMouse(), mapPosMouse(), normalyseMousePosition(), setWinGLSize(), unproject(), unProject(), updateAspectRatio(), and updateMinimumRatioSize().