Open Inventor Release 2024.2.1
 
Loading...
Searching...
No Matches
SoCpuBufferUniform.h
1/*=======================================================================
2 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
3 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
4 *** ***
5 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
6 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
7 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
8 *** ***
9 *** RESTRICTED RIGHTS LEGEND ***
10 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
11 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
12 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
13 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
14 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
15 *** ***
16 *** COPYRIGHT (C) 1996-2020 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : VSG (MMM YYYY)
22**=======================================================================*/
23#pragma once
24
25#include <Inventor/SbDataType.h>
26#include <Inventor/devices/SoCpuBufferObject.h>
27#include <LDM/tiles/SoBufferPropertiesInterface.h>
28#include <LDM/tiles/SoLDMBufferObjectInterface.h>
29
30
32class SoCpuBufferUniformImpl;
33
50{
51 SO_TYPED_CLASS_HEADER();
52
53 // ----------------------- Public usage --------------------------------------
54public:
55
60
67 SoCpuBufferUniform(const double value, SbDataType valueType );
68
80 virtual void map( SoBufferObject* targetBufferObject, SoBufferObject::AccessMode accessMode, size_t startPosition = 0, size_t mappingSize = SO_BUFFER_SIZE_ALL );
81
87 virtual void map( SoCpuBufferObject* targetBufferObject, SoBufferObject::AccessMode accessMode, size_t startPosition = 0, size_t mappingSize = SO_BUFFER_SIZE_ALL );
88
94 virtual void map( SoGLBufferObject* targetBufferObject, SoBufferObject::AccessMode accessMode, size_t startPosition = 0, size_t mappingSize = SO_BUFFER_SIZE_ALL );
95
104 virtual void unmap( SoCpuBufferObject* bufferObject );
105
114 virtual void unmap( SoGLBufferObject* bufferObject );
115
124 virtual void unmap( SoBufferObject* bufferObject );
125
132 virtual void* map( SoBufferObject::AccessMode accessMode, size_t offset = 0, size_t count = SO_BUFFER_SIZE_ALL );
133
139 virtual void unmap();
140
151 virtual void memset( void* data, size_t dataSize = 1, size_t offset = 0, size_t count = SO_BUFFER_SIZE_ALL );
152
156 virtual void memcpy( SoBufferObject* sourceBufferObject, size_t destOffset, size_t sourceOffset, size_t copySize );
157
166 virtual bool getMinMax( double& min, double& max);
167
171 virtual double getValue() const;
172
176 virtual SbDataType getType() const;
177
181 void setValue(const double &value, const SbDataType &dataType);
182
186 virtual size_t getRealSize() const;
187
191 virtual void setRealSize(const size_t &realSize);
192
193private:
197 virtual ~SoCpuBufferUniform();
198
199private:
200
202 virtual SoBufferObject* clone() const;
203
204SoINTERNAL private:
205 // Create internal uncompress version of the buffer
206 virtual SoCpuBufferObject* createCachedBuffer();
207 virtual void prefetchBuffer();
208
210
212};
213
Class encoding a data type.
Definition SbDataType.h:58
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Abstract base cl...
AccessMode
This enum provides the possible access modes for a mapped buffer object.
#define SO_BUFFER_SIZE_ALL
Used to indicate that we want to use the whole buffer.
<a href="IconLegend.html"><img src="extLDM.gif" alt="Large Data Management" border="0"></a> LDM inte...
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> CPU buffer objec...
<a href="IconLegend.html"><img src="extLDM.gif" alt="Large Data Management" border="0"></a> LDM buff...
virtual void * map(SoBufferObject::AccessMode accessMode, size_t offset=0, size_t count=SO_BUFFER_SIZE_ALL)
Returns a pointer to the memory array used for the storage of the buffer.
virtual void unmap(SoBufferObject *bufferObject)
Remove the specified bufferObject from the list of buffers which map the current buffer.
virtual void unmap(SoCpuBufferObject *bufferObject)
Unmap the specified CPU buffer object It is defined just to speed up the call when the type of the ...
void setValue(const double &value, const SbDataType &dataType)
Set the value and data type for this uniform buffer.
virtual void setRealSize(const size_t &realSize)
Set the real size of the buffer object in bytes.
SoCpuBufferUniform()
Default constructor.
virtual size_t getRealSize() const
Returns the real size of the buffer in bytes.
SoCpuBufferUniform(const double value, SbDataType valueType)
Constructor.
virtual void memset(void *data, size_t dataSize=1, size_t offset=0, size_t count=SO_BUFFER_SIZE_ALL)
This function sets the contents of (or a portion of) the buffer object to the specified value.
virtual void map(SoBufferObject *targetBufferObject, SoBufferObject::AccessMode accessMode, size_t startPosition=0, size_t mappingSize=SO_BUFFER_SIZE_ALL)
Map the current buffer object into the specified buffer object.
virtual void unmap()
Unmap a mapped buffer.
virtual double getValue() const
Get the value of the uniform tile.
virtual void memcpy(SoBufferObject *sourceBufferObject, size_t destOffset, size_t sourceOffset, size_t copySize)
Memcpy the contents of sourceBufferObject into this buffer object.
friend class SoCpuBufferUniformImpl
virtual bool getMinMax(double &min, double &max)
Get the min and max values in the buffer, if they are known.
virtual void map(SoCpuBufferObject *targetBufferObject, SoBufferObject::AccessMode accessMode, size_t startPosition=0, size_t mappingSize=SO_BUFFER_SIZE_ALL)
Map the current buffer object into the specified CPU buffer object.
virtual void unmap(SoGLBufferObject *bufferObject)
Unmap the specified GL buffer object It is defined just to speed up the call when the type of the o...
virtual SbDataType getType() const
Get the type of the value of the uniform tile.
virtual void map(SoGLBufferObject *targetBufferObject, SoBufferObject::AccessMode accessMode, size_t startPosition=0, size_t mappingSize=SO_BUFFER_SIZE_ALL)
Map the current buffer object into the specified GL buffer object.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> OpenGL buffer ob...
<a href="IconLegend.html"><img src="extLDM.gif" alt="Large Data Management" border="0"></a> LDM inte...