Inherits opentl::core::util::ParameterContainer.
Public Types | |
Public Member Functions | |
opentl::cvprocess::GlFbo * | getGlFbo (const std::string &str, int camIdx) |
Returns a pointer to a frame buffer object class instance. Uses singleton pattern per Camera and modality. | |
opentl::cvprocess::GlShaderMgr * | getGlShaderMgr (void) |
Returns pointer to a class for OpenGL shader management. | |
void | getOpenGlModelViewMatrix (const opentl::core::cvdata::Pose &objPose, double *modelViewMatrix, int cameraIdx, int linkIdx) const |
Get target specific OpenGL model view matrix. | |
GLScene (std::vector< opentl::models::ObjModel * > &objModels, opentl::cvprocess::GpuStdShaders *gpuShaders=NULL) | |
Constructor. | |
void | init () |
Initialize class. | |
void | prepareDisplayLists (const std::vector< opentl::models::ObjModel * > &objModels) |
void | renderScene (const TargetPtrVector &targets, std::size_t partitionIdx, RENDER_MODE renderMode, int camIdx, std::vector< int > &linkIds, GLuint *drawnPixQueryArray=NULL) |
Render scene consisting of all targets in given render mode for a certain camera/sensor. Hint: - Requires call of setOpenGlProjection() first!
| |
void | renderScene (const std::vector< boost::shared_ptr< opentl::core::State > > &states, const std::vector< opentl::models::ObjModel * > &objModels, RENDER_MODE renderMode, int camIdx, std::vector< int > &linkIds, GLuint *drawnPixQueryArray=NULL) |
Render scene consisting of all states in given render mode for a certain camera/sensor. Hint: - Requires call of setOpenGlProjection() first!
| |
void | renderSingleObject (const opentl::core::State *state, const opentl::models::ObjModel *objModel, RENDER_MODE renderMode, int targetIdx=0, int camIdx=0, int partIdx=0) |
Render a single object (state hypothesis) in given render mode for a certain camera/sensor. Hint: - Requires call of setOpenGlProjection() first! NOTE: The target ID is encoded in glFogCoord. | |
void | setOpenGlProjection (const TargetPtrVector &targets, std::size_t partitionIdx, input::ImageSensor &sensor, int cameraIdx, std::vector< int > &linkIds) const |
Set OpenGL projection paramenters and culling planes based on last warpUpdate(). | |
void | setOpenGlProjection (const std::vector< boost::shared_ptr< opentl::core::State > > &states, const std::vector< opentl::models::ObjModel * > &objModels, input::ImageSensor &sensor, int cameraIdx, std::vector< int > &linkIds) const |
Set OpenGL projection paramenters and culling planes based on last warpUpdate(). | |
virtual | ~GLScene () |
Destructor. | |
Public Attributes | |
std::vector< models::ObjModel * > & | mObjModels |
Vector of object model pointers. |
HINT: A GLScene instance is created per GL hardware accelerated graphics card (SLI connected cards are perceived as a single card). Each graphic card should handle at least one sensor view and all corresponding modalities/features processing Explanation: Independet graphic cards should have their own GL contexts (=non shared FBOs) to avoid unwanted driver internal texture copy/syncronization tasks.
opentl::modelprojection::GLScene::GLScene | ( | std::vector< opentl::models::ObjModel * > & | objModels, | |
opentl::cvprocess::GpuStdShaders * | gpuShaders = NULL | |||
) |
Constructor.
objModels | Vector of object model pointers. | |
param | Optional parameters for this class. | |
gpuShaders | pointer to gpu-shader (optional) |
virtual opentl::modelprojection::GLScene::~GLScene | ( | ) | [virtual] |
Destructor.
opentl::cvprocess::GlFbo* opentl::modelprojection::GLScene::getGlFbo | ( | const std::string & | str, | |
int | camIdx | |||
) | [inline] |
Returns a pointer to a frame buffer object class instance. Uses singleton pattern per Camera and modality.
str | Arbitrary string to uniquely identify this fbo instance. If str = "_ENFORCE_NEW_", the creation of a new fbo instance is enforced! | |
camIdx | Camera index. |
opentl::cvprocess::GlShaderMgr* opentl::modelprojection::GLScene::getGlShaderMgr | ( | void | ) | [inline] |
Returns pointer to a class for OpenGL shader management.
void opentl::modelprojection::GLScene::getOpenGlModelViewMatrix | ( | const opentl::core::cvdata::Pose & | objPose, | |
double * | modelViewMatrix, | |||
int | cameraIdx, | |||
int | linkIdx | |||
) | const [inline] |
Get target specific OpenGL model view matrix.
objPose | Object pose. | |
modelViewMatrix | Resulting OpenGL model view matrix. | |
cameraIdx | Camera index. | |
linkIdx | Link index of articulated object. |
void opentl::modelprojection::GLScene::init | ( | ) | [virtual] |
void opentl::modelprojection::GLScene::prepareDisplayLists | ( | const std::vector< opentl::models::ObjModel * > & | objModels | ) |
void opentl::modelprojection::GLScene::renderScene | ( | const TargetPtrVector & | targets, | |
std::size_t | partitionIdx, | |||
RENDER_MODE | renderMode, | |||
int | camIdx, | |||
std::vector< int > & | linkIds, | |||
GLuint * | drawnPixQueryArray = NULL | |||
) |
Render scene consisting of all targets in given render mode for a certain camera/sensor. Hint: - Requires call of setOpenGlProjection() first!
targets | Vector of wanted targets. | |
partitionIdx | Index to the current active state in the targets. | |
renderMode | Mode in which to render into OpenGL buffer. | |
camIdx | Camera index. | |
linkIds | Link indices: for each object, a single link, or the full shape (id = -1) can be rendered. | |
drawnPixQueryArray | Optional: creates query for drawn pixel per target (including all articulated object parts). Query array elements must already exist. |
void opentl::modelprojection::GLScene::renderScene | ( | const std::vector< boost::shared_ptr< opentl::core::State > > & | states, | |
const std::vector< opentl::models::ObjModel * > & | objModels, | |||
RENDER_MODE | renderMode, | |||
int | camIdx, | |||
std::vector< int > & | linkIds, | |||
GLuint * | drawnPixQueryArray = NULL | |||
) |
Render scene consisting of all states in given render mode for a certain camera/sensor. Hint: - Requires call of setOpenGlProjection() first!
states | Vector of states. | |
objModels | reference to the object models used | |
renderMode | Mode in which to render into OpenGL buffer. | |
camIdx | Camera index. | |
linkIds | Link indices: for each object, a single link, or the full shape (id = -1) can be rendered. | |
drawnPixQueryArray | Optional: creates query for drawn pixel per target (including all articulated object parts). Query array elements must already exist. |
void opentl::modelprojection::GLScene::renderSingleObject | ( | const opentl::core::State * | state, | |
const opentl::models::ObjModel * | objModel, | |||
RENDER_MODE | renderMode, | |||
int | targetIdx = 0 , |
|||
int | camIdx = 0 , |
|||
int | partIdx = 0 | |||
) |
Render a single object (state hypothesis) in given render mode for a certain camera/sensor. Hint: - Requires call of setOpenGlProjection() first! NOTE: The target ID is encoded in glFogCoord.
state | State to be drawn. | |
objModel | pointer to Object model | |
renderMode | Mode in which to render into OpenGL buffer. | |
targetIdx | This is the vector position within the target vector to be rendered. ATTENTION: This is not the targetId !!! | |
camIdx | Camera index. | |
partIdx | Optional: part index of articulated object. |
void opentl::modelprojection::GLScene::setOpenGlProjection | ( | const TargetPtrVector & | targets, | |
std::size_t | partitionIdx, | |||
input::ImageSensor & | sensor, | |||
int | cameraIdx, | |||
std::vector< int > & | linkIds | |||
) | const |
Set OpenGL projection paramenters and culling planes based on last warpUpdate().
targets | Vector of targets. | |
partitionIdx | Index to the current active state in the targets. | |
sensor | pointer to the used sensor models | |
cameraIdx | Camera index. | |
linkIdx | Link index of articulated object. |
void opentl::modelprojection::GLScene::setOpenGlProjection | ( | const std::vector< boost::shared_ptr< opentl::core::State > > & | states, | |
const std::vector< opentl::models::ObjModel * > & | objModels, | |||
input::ImageSensor & | sensor, | |||
int | cameraIdx, | |||
std::vector< int > & | linkIds | |||
) | const |
std::vector<models::ObjModel*>& opentl::modelprojection::GLScene::mObjModels |
Vector of object model pointers.