Visualization Library 2.0.0
A lightweight C++ OpenGL middleware for 2D/3D graphics
|
[Download] [Tutorials] [All Classes] [Grouped Classes] |
Implements the viewport and clearing settings associated to a Camera. More...
#include <Viewport.hpp>
Public Member Functions | |
Viewport () | |
Viewport (int x, int y, int w, int h) | |
void | activate () const |
bool | null () |
void | set (int x, int y, int w, int h) |
void | setX (int x) |
int | x () const |
void | setY (int y) |
int | y () const |
void | setWidth (int width) |
int | width () const |
void | setHeight (int height) |
int | height () const |
fvec2 | center () const |
RectI | rect () const |
Returns the rectangular area that defines the viewport computed as RectI(x(), y(), x()+width()-1, y()+height()-1). More... | |
void | setClearColor (float r, float g, float b, float a) |
void | setClearColor (const fvec4 &color) |
const fvec4 & | clearColor () const |
void | setClearColorInt (int r, int g, int b, int a) |
void | setClearColorInt (const ivec4 &color) |
const ivec4 & | clearColorInt () const |
void | setClearColorUInt (unsigned int r, unsigned int g, unsigned int b, unsigned int a) |
void | setClearColorUInt (const uvec4 &color) |
const uvec4 & | clearColorUInt () const |
void | setClearStencil (int stencil) |
int | clearStencil () const |
void | setClearDepth (real depth) |
real | clearDepth () const |
void | setClearFlags (EClearFlags clear_flags) |
Usually you want to use rather RendererAbstract::setClearFlags() More... | |
EClearFlags | clearFlags () const |
void | setClearColorMode (EClearColorMode mode) |
EClearColorMode | clearColorMode () const |
bool | isPointInside (int x, int y, int framebuffer_height) const |
Returns true if the given point is inside the Viewport. More... | |
void | setScissorEnabled (bool enable) |
If scissor setup is enabled (by default it is), then glScissor is called during activate(). More... | |
bool | isScissorEnabled () const |
Public Member Functions inherited from vl::Object | |
Object () | |
Constructor. More... | |
Object (const Object &other) | |
Copy constructor: copies the name, ref count mutex and user data. More... | |
Object & | operator= (const Object &other) |
Copy operator: copies the object's name, ref count mutex and user data. More... | |
const std::string & | objectName () const |
The name of the object, by default set to the object's class name. More... | |
void | setObjectName (const char *name) |
The name of the object, by default set to the object's class name in debug builds. More... | |
void | setObjectName (const std::string &name) |
The name of the object, by default set to the object's class name in debug builds. More... | |
void | setRefCountMutex (IMutex *mutex) |
The mutex used to protect the reference counting of an Object across multiple threads. More... | |
IMutex * | refCountMutex () |
The mutex used to protect the reference counting of an Object across multiple threads. More... | |
const IMutex * | refCountMutex () const |
The mutex used to protect the reference counting of an Object across multiple threads. More... | |
int | referenceCount () const |
Returns the number of references of an object. More... | |
void | incReference () const |
Increments the reference count of an object. More... | |
void | decReference () |
Decrements the reference count of an object and deletes it if both automaticDelete() is true the count reaches 0. More... | |
void | setAutomaticDelete (bool autodel_on) |
If set to true the Object is deleted when its reference count reaches 0. More... | |
bool | automaticDelete () const |
If set to true the Object is deleted when its reference count reaches 0. More... | |
template<class T > | |
T * | as () |
Casts an Object to the specified class. More... | |
template<class T > | |
const T * | as () const |
Casts an Object to the specified class. More... | |
Protected Attributes | |
fvec4 | mClearColor |
ivec4 | mClearColorInt |
uvec4 | mClearColorUInt |
real | mClearDepth |
int | mClearStencil |
EClearFlags | mClearFlags |
EClearColorMode | mClearColorMode |
int | mX |
int | mY |
int | mWidth |
int | mHeight |
bool | mScissorEnabled |
Protected Attributes inherited from vl::Object | |
std::string | mObjectName |
IMutex * | mRefCountMutex |
int | mReferenceCount |
bool | mAutomaticDelete |
Additional Inherited Members | |
Protected Member Functions inherited from vl::Object | |
virtual | ~Object () |
Implements the viewport and clearing settings associated to a Camera.
Supports glClearColor, glClearColorIiEXT and glClearColorIuiEXT (see GL_EXT_texture_integer).
Definition at line 51 of file Viewport.hpp.
Viewport::Viewport | ( | ) |
Definition at line 42 of file Viewport.cpp.
References vl::CCM_Float, vl::CF_CLEAR_COLOR_DEPTH, mClearColor, mClearColorMode, mClearDepth, mClearFlags, mClearStencil, mHeight, mScissorEnabled, mWidth, mX, and mY.
Viewport::Viewport | ( | int | x, |
int | y, | ||
int | w, | ||
int | h | ||
) |
Definition at line 57 of file Viewport.cpp.
References vl::CCM_Float, vl::CF_CLEAR_COLOR_DEPTH, mClearColor, mClearColorMode, mClearDepth, mClearFlags, mClearStencil, mHeight, mScissorEnabled, mWidth, mX, mY, x(), and y().
void Viewport::activate | ( | ) | const |
Definition at line 72 of file Viewport.cpp.
References vl::Vector4< T_Scalar >::a(), vl::Vector4< T_Scalar >::b(), vl::Log::bug(), vl::CCM_Float, vl::CCM_Int, vl::CCM_UInt, clearColorMode(), vl::Vector4< T_Scalar >::g(), mClearColor, mClearColorInt, mClearColorUInt, mClearDepth, mClearFlags, mClearStencil, mHeight, mScissorEnabled, mWidth, mX, mY, vl::Vector4< T_Scalar >::r(), VL_CHECK_OGL, x(), and y().
Referenced by vl::Renderer::render(), and vl::EdgeRenderer::render().
|
inline |
Definition at line 72 of file Viewport.hpp.
Referenced by vl::GhostCameraManipulator::enableEvent(), and vl::GhostCameraManipulator::mouseMoveEvent().
|
inline |
Definition at line 81 of file Viewport.hpp.
Referenced by vlX::VLXClassWrapper_Viewport::exportViewport().
|
inline |
Definition at line 85 of file Viewport.hpp.
Referenced by vlX::VLXClassWrapper_Viewport::exportViewport().
|
inline |
Definition at line 102 of file Viewport.hpp.
Referenced by activate(), and vlX::VLXClassWrapper_Viewport::exportViewport().
|
inline |
Definition at line 89 of file Viewport.hpp.
Referenced by vlX::VLXClassWrapper_Viewport::exportViewport().
|
inline |
Definition at line 95 of file Viewport.hpp.
Referenced by vlX::VLXClassWrapper_Viewport::exportViewport().
|
inline |
Definition at line 99 of file Viewport.hpp.
Referenced by vlX::VLXClassWrapper_Viewport::exportViewport().
|
inline |
Definition at line 92 of file Viewport.hpp.
Referenced by vlX::VLXClassWrapper_Viewport::exportViewport().
|
inline |
Definition at line 71 of file Viewport.hpp.
Referenced by vl::Text::boundingRectTransformed(), vl::TrackballManipulator::computeVector(), vl::GhostCameraManipulator::enableEvent(), vl::PixelLODEvaluator::evaluate(), vlX::VLXClassWrapper_Viewport::exportViewport(), isPointInside(), vl::FlatManipulator::mouseDownEvent(), vl::TrackballManipulator::mouseDownEvent(), vl::GhostCameraManipulator::mouseMoveEvent(), vl::TrackballManipulator::mouseMoveEvent(), vl::SlicedVolume::onActorRenderStarted(), vl::Clear::render_Implementation(), vl::DrawPixels::render_Implementation(), vl::OcclusionCullRenderer::render_pass2(), vl::Text::renderBackground(), vl::Text::renderBorder(), vl::Renderer::renderRaw(), vl::Text::renderText(), and vl::Camera::setProjectionOrtho().
bool Viewport::isPointInside | ( | int | x, |
int | y, | ||
int | framebuffer_height | ||
) | const |
|
inline |
Definition at line 114 of file Viewport.hpp.
|
inline |
Definition at line 61 of file Viewport.hpp.
|
inline |
Returns the rectangular area that defines the viewport computed as RectI(x(), y(), x()+width()-1, y()+height()-1).
Definition at line 77 of file Viewport.hpp.
Referenced by vl::Scissor::enable().
|
inline |
Definition at line 63 of file Viewport.hpp.
Referenced by vl::Applet::resizeEvent(), and vl::CalibratedCamera::updateCalibration().
|
inline |
Definition at line 79 of file Viewport.hpp.
Referenced by vlX::VLXClassWrapper_Viewport::importViewport().
|
inline |
Definition at line 80 of file Viewport.hpp.
|
inline |
Definition at line 83 of file Viewport.hpp.
Referenced by vlX::VLXClassWrapper_Viewport::importViewport().
|
inline |
Definition at line 84 of file Viewport.hpp.
|
inline |
Definition at line 101 of file Viewport.hpp.
Referenced by vlX::VLXClassWrapper_Viewport::importViewport().
|
inline |
Definition at line 87 of file Viewport.hpp.
Referenced by vlX::VLXClassWrapper_Viewport::importViewport().
|
inline |
Definition at line 88 of file Viewport.hpp.
|
inline |
Definition at line 94 of file Viewport.hpp.
Referenced by vlX::VLXClassWrapper_Viewport::importViewport().
|
inline |
Usually you want to use rather RendererAbstract::setClearFlags()
Definition at line 98 of file Viewport.hpp.
Referenced by vlX::VLXClassWrapper_Viewport::importViewport(), vl::Renderer::render(), and vl::EdgeRenderer::render().
|
inline |
Definition at line 91 of file Viewport.hpp.
Referenced by vlX::VLXClassWrapper_Viewport::importViewport().
|
inline |
Definition at line 70 of file Viewport.hpp.
Referenced by vlX::VLXClassWrapper_Viewport::importViewport().
|
inline |
If scissor setup is enabled (by default it is), then glScissor is called during activate().
Definition at line 113 of file Viewport.hpp.
|
inline |
Definition at line 68 of file Viewport.hpp.
Referenced by vlX::VLXClassWrapper_Viewport::importViewport().
|
inline |
Definition at line 64 of file Viewport.hpp.
Referenced by vlX::VLXClassWrapper_Viewport::importViewport().
|
inline |
Definition at line 66 of file Viewport.hpp.
Referenced by vlX::VLXClassWrapper_Viewport::importViewport().
|
inline |
Definition at line 69 of file Viewport.hpp.
Referenced by vl::Text::boundingRectTransformed(), vl::TrackballManipulator::computeVector(), vl::PixelLODEvaluator::evaluate(), vlX::VLXClassWrapper_Viewport::exportViewport(), isPointInside(), vl::FlatManipulator::mouseDownEvent(), vl::TrackballManipulator::mouseDownEvent(), vl::SlicedVolume::onActorRenderStarted(), vl::Clear::render_Implementation(), vl::DrawPixels::render_Implementation(), vl::OcclusionCullRenderer::render_pass2(), vl::Text::renderBackground(), vl::Text::renderBorder(), vl::Renderer::renderRaw(), vl::Text::renderText(), and vl::Camera::setProjectionOrtho().
|
inline |
Definition at line 65 of file Viewport.hpp.
Referenced by activate(), vl::Text::boundingRectTransformed(), vl::PixelLODEvaluator::evaluate(), vlX::VLXClassWrapper_Viewport::exportViewport(), isPointInside(), vl::TrackballManipulator::mouseDownEvent(), vl::FlatManipulator::mouseInViewport(), vl::TrackballManipulator::mouseMoveEvent(), vl::Clear::render_Implementation(), vl::DrawPixels::render_Implementation(), vl::OcclusionCullRenderer::render_pass2(), vl::Text::renderBackground(), vl::Text::renderBorder(), vl::Renderer::renderRaw(), vl::Text::renderText(), and Viewport().
|
inline |
Definition at line 67 of file Viewport.hpp.
Referenced by activate(), vl::Text::boundingRectTransformed(), vl::GhostCameraManipulator::enableEvent(), vl::PixelLODEvaluator::evaluate(), vlX::VLXClassWrapper_Viewport::exportViewport(), isPointInside(), vl::TrackballManipulator::mouseDownEvent(), vl::FlatManipulator::mouseInViewport(), vl::GhostCameraManipulator::mouseMoveEvent(), vl::TrackballManipulator::mouseMoveEvent(), vl::Clear::render_Implementation(), vl::DrawPixels::render_Implementation(), vl::OcclusionCullRenderer::render_pass2(), vl::Text::renderBackground(), vl::Text::renderBorder(), vl::Renderer::renderRaw(), vl::Text::renderText(), and Viewport().
|
protected |
Definition at line 117 of file Viewport.hpp.
Referenced by activate(), and Viewport().
|
protected |
Definition at line 118 of file Viewport.hpp.
Referenced by activate().
|
protected |
Definition at line 124 of file Viewport.hpp.
Referenced by Viewport().
|
protected |
Definition at line 119 of file Viewport.hpp.
Referenced by activate().
|
protected |
Definition at line 121 of file Viewport.hpp.
Referenced by activate(), and Viewport().
|
protected |
Definition at line 123 of file Viewport.hpp.
Referenced by activate(), and Viewport().
|
protected |
Definition at line 122 of file Viewport.hpp.
Referenced by activate(), and Viewport().
|
protected |
Definition at line 128 of file Viewport.hpp.
Referenced by activate(), and Viewport().
|
protected |
Definition at line 130 of file Viewport.hpp.
Referenced by activate(), and Viewport().
|
protected |
Definition at line 127 of file Viewport.hpp.
Referenced by activate(), and Viewport().
|
protected |
Definition at line 125 of file Viewport.hpp.
Referenced by activate(), and Viewport().
|
protected |
Definition at line 126 of file Viewport.hpp.
Referenced by activate(), and Viewport().
Visualization Library 2.0.0 Reference Documentation
Updated on Wed Dec 23 2020 12:44:12.
© Copyright Michele Bosi. All rights reserved.