ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
PCVContext.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 // cloudViewer
11 #include <GenericCloud.h>
12 #include <GenericMesh.h>
13 
14 // system
15 #include <vector>
16 
17 class QGLPixelBuffer;
18 
20 
22 class PCVContext {
23 public:
25  PCVContext();
26 
28  virtual ~PCVContext();
29 
31 
38  bool init(unsigned W,
39  unsigned H,
41  cloudViewer::GenericMesh* mesh = 0,
42  bool closedMesh = true);
43 
45  void setViewDirection(const CCVector3& V);
46 
49 
52  int GLAccumPixel(std::vector<int>& visibilityCount);
53 
54 protected:
55  void glInit();
56  void drawEntity();
58  cloudViewer::GenericMesh* mesh = 0);
59 
62 
65 
66  // zoom courant
68  // translation vers le centre de l'entitee a afficher
70 
71  // associated pixel buffer
72  QGLPixelBuffer* m_pixBuffer;
73 
75  unsigned m_width;
77  unsigned m_height;
78 
80 
82  static const unsigned OPENGL_MATRIX_SIZE = 16;
83 
86 
88  float* m_snapZ;
90  unsigned char* m_snapC;
91 
94 };
PCVContext::m_snapZ
float * m_snapZ
Depth buffer.
Definition: PCVContext.h:88
PCVContext::m_mesh
cloudViewer::GenericMesh * m_mesh
Displayed entity (mesh - optional)
Definition: PCVContext.h:64
cloudViewer::GenericCloud
Definition: GenericCloud.h:20
PCVContext::drawEntity
void drawEntity()
Definition: PCVContext.cpp:187
PCVContext::m_viewMat
float m_viewMat[OPENGL_MATRIX_SIZE]
Current model view matrix.
Definition: PCVContext.h:85
Vector3Tpl< PointCoordinateType >
PCVContext::m_snapC
unsigned char * m_snapC
Color buffer.
Definition: PCVContext.h:90
PCVContext::init
bool init(unsigned W, unsigned H, cloudViewer::GenericCloud *cloud, cloudViewer::GenericMesh *mesh=0, bool closedMesh=true)
Initialization.
Definition: PCVContext.cpp:69
PCVContext::OPENGL_MATRIX_SIZE
static const unsigned OPENGL_MATRIX_SIZE
Model view matrix size (OpenGL)
Definition: PCVContext.h:82
cloudViewer::GenericMesh
Definition: GenericMesh.h:21
PCVContext::setViewDirection
void setViewDirection(const CCVector3 &V)
Set the viewing directions.
Definition: PCVContext.cpp:166
PCVContext::m_pixBuffer
QGLPixelBuffer * m_pixBuffer
Definition: PCVContext.h:72
PCVContext::PCVContext
PCVContext()
Default constructor.
Definition: PCVContext.cpp:49
PCVContext::m_meshIsClosed
bool m_meshIsClosed
Whether displayed mesh is closed or not.
Definition: PCVContext.h:93
PCVContext::m_width
unsigned m_width
Pixel buffer width (pixels)
Definition: PCVContext.h:75
PCVContext::~PCVContext
virtual ~PCVContext()
Destructor.
Definition: PCVContext.cpp:62
GenericMesh.h
PCVContext::m_zoom
PointCoordinateType m_zoom
Definition: PCVContext.h:67
PCVContext::m_vertices
cloudViewer::GenericCloud * m_vertices
Displayed entity (cloud or mesh vertices)
Definition: PCVContext.h:61
GenericCloud.h
PCVContext::m_viewCenter
CCVector3 m_viewCenter
Definition: PCVContext.h:69
PCVContext::m_height
unsigned m_height
Pixel buffer height (pixels)
Definition: PCVContext.h:77
PCVContext::GLAccumPixel
int GLAccumPixel(std::vector< int > &visibilityCount)
Definition: PCVContext.cpp:242
PointCoordinateType
float PointCoordinateType
Type of the coordinates of a (N-D) point.
Definition: CVTypes.h:16
PCVContext::glInit
void glInit()
Definition: PCVContext.cpp:136
PCVContext::associateToEntity
void associateToEntity(cloudViewer::GenericCloud *cloud, cloudViewer::GenericMesh *mesh=0)
Definition: PCVContext.cpp:112
PCVContext
PCV (Portion de Ciel Visible / Ambiant Illumination) OpenGL context.
Definition: PCVContext.h:22