NCBI C++ ToolKit
ivbogeom.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 #ifndef GUI_OPENGL___IVBOGEOM___HPP
2 #define GUI_OPENGL___IVBOGEOM___HPP
3 
4 
5 /* $Id: ivbogeom.hpp 43891 2019-09-16 13:50:00Z evgeniev $
6  * ===========================================================================
7  *
8  * PUBLIC DOMAIN NOTICE
9  * National Center for Biotechnology Information
10  *
11  * This software/database is a "United States Government Work" under the
12  * terms of the United States Copyright Act. It was written as part of
13  * the author's official duties as a United States Government employee and
14  * thus cannot be copyrighted. This software/database is freely available
15  * to the public for use. The National Library of Medicine and the U.S.
16  * Government have not placed any restriction on its use or reproduction.
17  *
18  * Although all reasonable efforts have been taken to ensure the accuracy
19  * and reliability of the software and data, the NLM and the U.S.
20  * Government do not and cannot warrant the performance or results that
21  * may be obtained by using this software or data. The NLM and the U.S.
22  * Government disclaim all warranties, express or implied, including
23  * warranties of performance, merchantability or fitness for any particular
24  * purpose.
25  *
26  * Please cite the author in any work or product based on this material.
27  *
28  * ===========================================================================
29  *
30  * Authors: Roman Katargin
31  *
32  * File Description:
33  *
34  */
35 
36 
37 #include <gui/opengl.h>
38 #include <gui/gui.hpp>
39 
40 #include <gui/utils/vect2.hpp>
41 #include <gui/utils/vect3.hpp>
42 #include <gui/utils/vect4.hpp>
43 
44 #include <gui/utils/rgba_color.hpp>
45 
46 /** @addtogroup GUI_OPENGL
47  *
48  * @{
49  */
50 
52 
53 class IVboGeom
54 {
55 public:
56  virtual ~IVboGeom() {}
57 
59  {
63  };
64 
66  {
72  };
73 
74  virtual string GetName() const = 0;
75 
76  /// Render data in buffers
77  virtual void Render(const float* modelView) = 0;
78 
79  virtual GLenum GetDrawMode() const = 0;
80  virtual EVertexFormat GetVertexFormat() const = 0;
81  virtual ESecondaryFormat GetSecondaryFormat() const = 0;
82 
83  virtual size_t GetVertexCount() const = 0;
84 
85  virtual void SetVertexBuffer2D(const vector<CVect2<float> >& data) = 0;
86  virtual void GetVertexBuffer2D(vector<CVect2<float> >& data) const = 0;
87 
88  virtual void SetVertexBuffer3D(const vector<CVect3<float> >& data) = 0;
89  virtual void GetVertexBuffer3D(vector<CVect3<float> >& data) const = 0;
90 
91  virtual void SetColorBuffer(const vector<CRgbaColor>& data) = 0;
92  virtual void GetColorBuffer(vector<CRgbaColor>& data) const = 0;
93 
94  virtual void SetColorBufferUC(const vector<CVect4<unsigned char> >& data) = 0;
95  virtual void GetColorBufferUC(vector<CVect4<unsigned char> >& data) const = 0;
96 
97  virtual void SetTexCoordBuffer1D(const vector<float>& data) = 0;
98  virtual void GetTexCoordBuffer1D(vector<float>& data) const = 0;
99 
100  virtual void SetTexCoordBuffer(const vector<CVect2<float> >& data) = 0;
101  virtual void GetTexCoordBuffer(vector<CVect2<float> >& data) const = 0;
102 
103 private:
104  friend class CRenderCommon;
105  virtual void x_SetDrawMode(GLenum drawMode) = 0;
106 };
107 
109 
110 /* @} */
111 
112 #endif // GUI_OPENGL___IVBOGEOM___HPP
virtual size_t GetVertexCount() const =0
virtual void Render(const float *modelView)=0
Render data in buffers.
virtual void GetVertexBuffer3D(vector< CVect3< float > > &data) const =0
virtual void SetVertexBuffer3D(const vector< CVect3< float > > &data)=0
virtual void x_SetDrawMode(GLenum drawMode)=0
virtual void GetColorBufferUC(vector< CVect4< unsigned char > > &data) const =0
virtual void SetTexCoordBuffer1D(const vector< float > &data)=0
virtual EVertexFormat GetVertexFormat() const =0
virtual void SetColorBufferUC(const vector< CVect4< unsigned char > > &data)=0
ESecondaryFormat
Definition: ivbogeom.hpp:66
virtual void GetVertexBuffer2D(vector< CVect2< float > > &data) const =0
virtual ~IVboGeom()
Definition: ivbogeom.hpp:56
virtual void SetTexCoordBuffer(const vector< CVect2< float > > &data)=0
virtual void GetTexCoordBuffer1D(vector< float > &data) const =0
virtual string GetName() const =0
virtual ESecondaryFormat GetSecondaryFormat() const =0
virtual void SetColorBuffer(const vector< CRgbaColor > &data)=0
virtual GLenum GetDrawMode() const =0
virtual void SetVertexBuffer2D(const vector< CVect2< float > > &data)=0
virtual void GetColorBuffer(vector< CRgbaColor > &data) const =0
virtual void GetTexCoordBuffer(vector< CVect2< float > > &data) const =0
@ kVertexFormatVertex3D
Definition: ivbogeom.hpp:62
@ kVertexFormatNone
Definition: ivbogeom.hpp:60
@ kVertexFormatVertex2D
Definition: ivbogeom.hpp:61
@ kSecondaryFormatNone
Definition: ivbogeom.hpp:67
@ kSecondaryFormatColorUChar
Definition: ivbogeom.hpp:69
@ kSecondaryFormatColorFloat
Definition: ivbogeom.hpp:68
@ kSecondaryFormatTexture2D
Definition: ivbogeom.hpp:70
@ kSecondaryFormatTexture1D
Definition: ivbogeom.hpp:71
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
Standard mechanism to include OpenGL headers for all platforms.
Modified on Sat Feb 24 07:47:27 2024 by modify_doxy.py rev. 669887