RenderManAPI  24.0
RixRIB.h
Go to the documentation of this file.
1 /*
2 # ------------------------------------------------------------------------------
3 #
4 # Copyright (c) 2020 Pixar. All rights reserved.
5 #
6 # The information in this file (the "Software") is provided for the exclusive
7 # use of the software licensees of Pixar ("Licensees"). Licensees have the
8 # right to incorporate the Software into other products for use by other
9 # authorized software licensees of Pixar, without fee. Except as expressly
10 # permitted herein, the Software may not be disclosed to third parties, copied
11 # or duplicated in any form, in whole or in part, without the prior written
12 # permission of Pixar.
13 #
14 # The copyright notices in the Software and this entire statement, including the
15 # above license grant, this restriction and the following disclaimer, must be
16 # included in all copies of the Software, in whole or in part, and all permitted
17 # derivative works of the Software, unless such copies or derivative works are
18 # solely in the form of machine-executable object code generated by a source
19 # language processor.
20 #
21 # PIXAR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
22 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL PIXAR BE
23 # LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
24 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
25 # OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
26 # CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. IN NO CASE WILL
27 # PIXAR'S TOTAL LIABILITY FOR ALL DAMAGES ARISING OUT OF OR IN CONNECTION WITH
28 # THE USE OR PERFORMANCE OF THIS SOFTWARE EXCEED $50.
29 #
30 # Pixar
31 # 1200 Park Ave
32 # Emeryville CA 94608
33 #
34 # ------------------------------------------------------------------------------
35 */
36 
37 #ifndef RixRIB_h
38 #define RixRIB_h
39 
40 #include "RixInterfaces.h" // for RixInterface
41 #include "ri.h" // for RtBound
42 
43 class Ri;
44 
66 class RixZipSubfile;
67 
68 class RixZipWriter {
69 public:
70 
74  virtual bool
75  BeginSubfile(const char *subfilename, bool compress, bool bufferall,
76  RixZipSubfile **result) = 0;
77 
79  virtual int
80  EndSubfile() = 0;
81 
84  virtual const char*
85  GetError(void) = 0;
86 
87  virtual
89 };
90 
96 public:
97 
99  virtual size_t
100  GetSize(void) = 0;
101 
103  virtual void
104  BeginReading(void) = 0;
105 
107  virtual void
108  Read(void *blk, size_t blocksize) = 0;
109 
111  virtual void
112  EndReading(void) = 0;
113 
115  virtual void
116  Write(const void *blk, size_t blocksize) = 0;
117 
118 
119  virtual
121 };
122 
123 
124 
125 class RixRIB : public RixInterface
126 {
127 public:
129  {
130  enum Format
131  {
135  };
137  {
141  };
143  {
145  k_asWide = 0x2,
146  };
153  };
154 
158  virtual Ri* CreateRIBGenerator(Ri* parent = 0L, Configuration* config = nullptr) = 0;
159 
161  virtual void DestroyRIBGenerator(Ri*) = 0;
162 
165  virtual RixZipWriter*
166  GetZipWriter(void) = 0;
167 
171  virtual RixZipSubfile*
172  OpenSubfileForRead(const char* path, const char* subfileName) = 0;
173 
176  virtual bool GetBound(const char* archiveName, RtBound bound) = 0;
177 
178 protected:
181 };
182 
183 #endif
Definition: RixRIB.h:132
virtual ~RixZipSubfile()
Definition: RixRIB.h:120
RIBs can be written into single zip files and this helper object allows access to the sub-files...
Definition: RixRIB.h:95
virtual void Write(const void *blk, size_t blocksize)=0
Write data to a file.
virtual Ri * CreateRIBGenerator(Ri *parent=0L, Configuration *config=nullptr)=0
Return a pointer to RIB generator, or NULL of there is an error.
virtual bool BeginSubfile(const char *subfilename, bool compress, bool bufferall, RixZipSubfile **result)=0
On succes opens a new subfile.
virtual RixZipWriter * GetZipWriter(void)=0
Return the current zip file writer object.
Definition: RixRIB.h:125
Definition: RixRIB.h:138
AsciiStyle
Definition: RixRIB.h:142
Compression compression
Definition: RixRIB.h:149
Base class for all Rix interfaces.
Definition: RixInterfaces.h:133
float RtBound[6]
Definition: ri.h:64
Definition: RixRIB.h:128
RixRIB()
Constructor is for internal use only.
Definition: RixRIB.h:180
Definition: RixRIB.h:134
virtual bool GetBound(const char *archiveName, RtBound bound)=0
Get the bounding box of the given RIB archive file.
Format
Definition: RixRIB.h:130
Definition: RixRIB.h:145
int asciiStyle
Definition: RixRIB.h:150
Format format
Definition: RixRIB.h:148
virtual int EndSubfile()=0
returns non zero on error
Compression
Definition: RixRIB.h:136
Definition: RixRIB.h:133
virtual ~RixZipWriter()
Definition: RixRIB.h:88
virtual const char * GetError(void)=0
If BeginSubfile fails (returns true) call this to get any diagnostic message.
Definition: RixRIB.h:140
virtual size_t GetSize(void)=0
size of the data in the file.
virtual void DestroyRIBGenerator(Ri *)=0
Destructs a RIB generator created by CreateRIBGenerator()
RtBound bbox
Definition: RixRIB.h:152
Definition: RixRIB.h:144
Definition: RixRIB.h:139
virtual RixZipSubfile * OpenSubfileForRead(const char *path, const char *subfileName)=0
Return a new zip subfile for read-only purposes.
int precision
Definition: RixRIB.h:151
virtual void BeginReading(void)=0
This must be called before calling Read();.
virtual void Read(void *blk, size_t blocksize)=0
Read at most blocksize bytes from the file.
Definition: RixRIB.h:68
virtual void EndReading(void)=0
Call when you are done calling Read();.
Configuration()
Definition: RixRIB.h:147