ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
PCVContext Class Reference

PCV (Portion de Ciel Visible / Ambiant Illumination) OpenGL context. More...

#include <PCVContext.h>

Collaboration diagram for PCVContext:

Public Member Functions

 PCVContext ()
 Default constructor. More...
 
virtual ~PCVContext ()
 Destructor. More...
 
bool init (unsigned W, unsigned H, cloudViewer::GenericCloud *cloud, cloudViewer::GenericMesh *mesh=0, bool closedMesh=true)
 Initialization. More...
 
void setViewDirection (const CCVector3 &V)
 Set the viewing directions. More...
 
int GLAccumPixel (std::vector< int > &visibilityCount)
 

Protected Member Functions

void glInit ()
 
void drawEntity ()
 
void associateToEntity (cloudViewer::GenericCloud *cloud, cloudViewer::GenericMesh *mesh=0)
 

Protected Attributes

cloudViewer::GenericCloudm_vertices
 Displayed entity (cloud or mesh vertices) More...
 
cloudViewer::GenericMeshm_mesh
 Displayed entity (mesh - optional) More...
 
PointCoordinateType m_zoom
 
CCVector3 m_viewCenter
 
QGLPixelBuffer * m_pixBuffer
 
unsigned m_width
 Pixel buffer width (pixels) More...
 
unsigned m_height
 Pixel buffer height (pixels) More...
 
float m_viewMat [OPENGL_MATRIX_SIZE]
 Current model view matrix. More...
 
float * m_snapZ
 Depth buffer. More...
 
unsigned char * m_snapC
 Color buffer. More...
 
bool m_meshIsClosed
 Whether displayed mesh is closed or not. More...
 

Static Protected Attributes

static const unsigned OPENGL_MATRIX_SIZE = 16
 Model view matrix size (OpenGL) More...
 

Detailed Description

PCV (Portion de Ciel Visible / Ambiant Illumination) OpenGL context.

Similar to Cignoni's ShadeVis

Definition at line 22 of file PCVContext.h.

Constructor & Destructor Documentation

◆ PCVContext()

PCVContext::PCVContext ( )

Default constructor.

Definition at line 49 of file PCVContext.cpp.

References m_viewMat, and OPENGL_MATRIX_SIZE.

◆ ~PCVContext()

PCVContext::~PCVContext ( )
virtual

Destructor.

Definition at line 62 of file PCVContext.cpp.

References m_pixBuffer, m_snapC, and m_snapZ.

Member Function Documentation

◆ associateToEntity()

void PCVContext::associateToEntity ( cloudViewer::GenericCloud cloud,
cloudViewer::GenericMesh mesh = 0 
)
protected

◆ drawEntity()

void PCVContext::drawEntity ( )
protected

Definition at line 187 of file PCVContext.cpp.

Referenced by GLAccumPixel().

◆ GLAccumPixel()

int PCVContext::GLAccumPixel ( std::vector< int > &  visibilityCount)

Increments the visibility counter for points viewed in the current pass (see setViewDirection)

Parameters
visibilityCountper-vertex visibility count (same size as the number of vertices)
Returns
number of vertices seen during this pass

Definition at line 242 of file PCVContext.cpp.

References count, drawEntity(), cloudViewer::utility::floor(), cloudViewer::GenericCloud::getNextPoint(), m_height, m_meshIsClosed, m_pixBuffer, m_snapC, m_snapZ, m_vertices, m_width, max(), OPENGL_MATRIX_SIZE, openGLSnapshot(), cloudViewer::GenericCloud::placeIteratorAtBeginning(), cloudViewer::GenericCloud::size(), Tuple3Tpl< Type >::x, Tuple3Tpl< Type >::y, Tuple3Tpl< Type >::z, and ZTWIST.

◆ glInit()

void PCVContext::glInit ( )
protected

Definition at line 136 of file PCVContext.cpp.

References m_pixBuffer.

Referenced by init().

◆ init()

bool PCVContext::init ( unsigned  W,
unsigned  H,
cloudViewer::GenericCloud cloud,
cloudViewer::GenericMesh mesh = 0,
bool  closedMesh = true 
)

Initialization.

Parameters
WOpenGL render context width (pixels)
HOpenGL render context height (pixels)
cloudassociated cloud (or mesh vertices)
meshassociated mesh (if any)
closedMeshwhether mesh is closed (faster) or not (need more memory)
Returns
initialization success

Definition at line 69 of file PCVContext.cpp.

References associateToEntity(), glInit(), m_height, m_meshIsClosed, m_pixBuffer, m_snapC, m_snapZ, m_width, and size.

◆ setViewDirection()

void PCVContext::setViewDirection ( const CCVector3 V)

Set the viewing directions.

Definition at line 166 of file PCVContext.cpp.

References m_pixBuffer.

Member Data Documentation

◆ m_height

unsigned PCVContext::m_height
protected

Pixel buffer height (pixels)

Definition at line 77 of file PCVContext.h.

Referenced by associateToEntity(), GLAccumPixel(), and init().

◆ m_mesh

cloudViewer::GenericMesh* PCVContext::m_mesh
protected

Displayed entity (mesh - optional)

Definition at line 64 of file PCVContext.h.

Referenced by associateToEntity().

◆ m_meshIsClosed

bool PCVContext::m_meshIsClosed
protected

Whether displayed mesh is closed or not.

Definition at line 93 of file PCVContext.h.

Referenced by GLAccumPixel(), and init().

◆ m_pixBuffer

QGLPixelBuffer* PCVContext::m_pixBuffer
protected

Definition at line 72 of file PCVContext.h.

Referenced by GLAccumPixel(), glInit(), init(), setViewDirection(), and ~PCVContext().

◆ m_snapC

unsigned char* PCVContext::m_snapC
protected

Color buffer.

Definition at line 90 of file PCVContext.h.

Referenced by GLAccumPixel(), init(), and ~PCVContext().

◆ m_snapZ

float* PCVContext::m_snapZ
protected

Depth buffer.

Definition at line 88 of file PCVContext.h.

Referenced by GLAccumPixel(), init(), and ~PCVContext().

◆ m_vertices

cloudViewer::GenericCloud* PCVContext::m_vertices
protected

Displayed entity (cloud or mesh vertices)

Definition at line 61 of file PCVContext.h.

Referenced by associateToEntity(), and GLAccumPixel().

◆ m_viewCenter

CCVector3 PCVContext::m_viewCenter
protected

Definition at line 69 of file PCVContext.h.

Referenced by associateToEntity().

◆ m_viewMat

float PCVContext::m_viewMat[OPENGL_MATRIX_SIZE]
protected

Current model view matrix.

Definition at line 85 of file PCVContext.h.

Referenced by PCVContext().

◆ m_width

unsigned PCVContext::m_width
protected

Pixel buffer width (pixels)

Definition at line 75 of file PCVContext.h.

Referenced by associateToEntity(), GLAccumPixel(), and init().

◆ m_zoom

PointCoordinateType PCVContext::m_zoom
protected

Definition at line 67 of file PCVContext.h.

Referenced by associateToEntity().

◆ OPENGL_MATRIX_SIZE

const unsigned PCVContext::OPENGL_MATRIX_SIZE = 16
staticprotected

Model view matrix size (OpenGL)

Warning
Never pass a 'constant initializer' by reference

Definition at line 82 of file PCVContext.h.

Referenced by GLAccumPixel(), and PCVContext().


The documentation for this class was generated from the following files: