00001 /*======================================================================= 00002 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), *** 00003 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. *** 00004 *** *** 00005 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS *** 00006 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR *** 00007 *** WRITTEN AUTHORIZATION OF FEI S.A.S. *** 00008 *** *** 00009 *** RESTRICTED RIGHTS LEGEND *** 00010 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS *** 00011 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN *** 00012 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT *** 00013 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN *** 00014 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. *** 00015 *** *** 00016 *** COPYRIGHT (C) 1996-2020 BY FEI S.A.S, *** 00017 *** BORDEAUX, FRANCE *** 00018 *** ALL RIGHTS RESERVED *** 00019 **=======================================================================*/ 00020 /*======================================================================= 00021 ** Author : VSG (MMM YYYY) 00022 **=======================================================================*/ 00023 #if !defined SOBUFFERPROPERTIESINTERFACE_H 00024 #define SOBUFFERPROPERTIESINTERFACE_H 00025 00026 #include <Inventor/SbBase.h> 00027 #include <Inventor/devices/SoBufferObject.h> 00028 00029 class SoCpuBufferObject; 00030 00031 00048 class SoBufferPropertiesInterface 00049 { 00050 00051 // ----------------------- Public usage -------------------------------------- 00052 public: 00053 00057 SoBufferPropertiesInterface(); 00058 00062 virtual ~SoBufferPropertiesInterface(); 00063 00072 virtual bool getMinMax(double& min, double& max) = 0; 00073 00080 virtual size_t getRealSize() const = 0; 00081 00082 private: 00083 00084 // Set the cache id allocated by the DataSet 00085 virtual void setCacheSignature(const uint64_t& cacheSignature); 00086 00087 // Retrieve cache id allocated by the DataSet 00088 uint64_t getCacheSignature(); 00089 00090 SoINTERNAL private: 00091 00092 void invalidateCache(); 00093 00094 // Tell if the Min/Max values are available 00095 bool m_bMinMaxIsSet; 00096 00097 // Real size of the buffer (once uncompressed) 00098 size_t m_realSize; 00099 00100 // Min and Max value of the buffer 00101 double m_dMin, m_dMax; 00102 00103 // id of the buffer in the mapping of Inventor base 00104 uint64_t m_mappingId; 00105 00106 // Check the given access mode is supported by buffer 00107 bool checkAccessMode( const SoBufferObject::AccessMode accessMode ); 00108 00109 // Internal unmap method. As long as code is the same 00110 // for all buffer that inherits of this interface 00111 void internalUnmap( SoBufferObject* bufferObject ); 00112 00113 // Unique Id allocated by volumeData; 00114 uint64_t m_cacheSignature; 00115 00116 // Internal buffer Management 00117 SoCpuBufferObject* m_internalPtrRef; 00118 uint64_t m_internalPtrRefCount; 00119 00120 friend class SoCpuBufferCompressedImpl; 00121 friend class SoCpuBufferUniformImpl; 00122 friend class SoCpuBufferBitSetImpl; 00123 friend class SoCpuBufferFromVolumeReaderImpl; 00124 }; 00125 00126 #endif //SOBUFFERPROPERTIESINTERFACE_H 00127 00128