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 : C. OGNIER (Jun 2003) 00022 **=======================================================================*/ 00023 00024 00025 #ifndef _SORASTERIMAGEFILE_ 00026 #define _SORASTERIMAGEFILE_ 00027 00028 00029 #include <Inventor/image/SoRasterImageIO.h> 00030 #include <Inventor/image/SoRasterImageRW.h> 00031 00048 class SoRasterImageFile : public SoRasterImageIO 00049 { 00050 SO_IMAGE_RASTER_RW_HEADER() 00051 00052 public: 00056 SoRasterImageFile(); 00057 00063 SoNONUNICODE SoRasterImageFile(const char* fileName); 00064 00068 SoRasterImageFile( const SbString& fileName ); 00069 00073 SoRasterImageFile(const FILE* fp); 00074 00075 00079 virtual ~SoRasterImageFile(); 00080 00081 00090 SoNONUNICODE virtual const char* getFileName() const; 00091 00098 virtual SbString getStringFileName() const; 00099 00110 SoNONUNICODE virtual const char* getFullPathFileName() const; 00111 00119 virtual SbString getStringFullPathFileName() const; 00120 00126 SoNONUNICODE virtual void setFileName(const char* fileName); 00127 00131 virtual void setFileName( const SbString& fileName ); 00132 00137 virtual void setFilePointer(const FILE* fp); 00138 00142 virtual FILE* getFilePointer() const; 00143 00157 virtual SbBool openRead( const SbStringList * directoryList ); 00158 00169 virtual SbBool checkRead( const SbStringList * directoryList ); 00170 00175 virtual SbBool openWrite( void ); 00176 00180 virtual void closeFile(); 00181 00186 virtual void nullFilePtr(); 00187 00191 virtual void setBinary(SbBool isBinary); 00192 00193 00197 virtual SbBool isBinary() const; 00198 00199 00203 virtual SbString getFileSuffix() const; 00204 00205 #if 1 SoDEPRECATED 00211 virtual SbBool openFile(SoRasterImageRW::OpenMode openMode); 00212 00213 #endif 00215 private: 00216 00221 virtual void setFileSuffix( const SbString& suffix); 00222 00223 private: 00224 void constructorCommon(); 00225 00226 SbString m_fileName; 00227 SbString m_fullPath; // full path, after a successful openRead 00228 SbString m_fileSuffix; 00229 FILE* m_fp; 00230 SbBool m_isBinary; 00231 SoRasterImageRW::OpenMode m_openMode; 00232 }; 00233 00234 #endif 00235 00236 00237