00001 // Filename: ribGraphicsWindow.I 00002 // Created by: drose (17Feb99) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved 00008 // 00009 // All use of this software is subject to the terms of the Panda 3d 00010 // Software license. You should have received a copy of this license 00011 // along with this source code; you will also find a current copy of 00012 // the license at http://www.panda3d.org/license.txt . 00013 // 00014 // To contact the maintainers of this program write to 00015 // panda3d@yahoogroups.com . 00016 // 00017 //////////////////////////////////////////////////////////////////// 00018 00019 #include <ribGraphicsStateGuardian.h> 00020 00021 //////////////////////////////////////////////////////////////////// 00022 // Function: RIBGraphicsWindow::set_rib_filename_template 00023 // Access: Public 00024 // Description: Specifies the string that defines the filename that 00025 // will be generated for each RIB file output by the 00026 // GraphicsWindow. The template may contain any of the 00027 // % format characters described in ribGraphicsWindow.h. 00028 // In particular, if it contains %f (or some variant), 00029 // there will be a separate RIB file generated for each 00030 // frame; otherwise, all the frames will be written to 00031 // the same RIB file. 00032 //////////////////////////////////////////////////////////////////// 00033 INLINE void RIBGraphicsWindow:: 00034 set_rib_filename_template(const string &str) { 00035 _rib_filename_template = str; 00036 _rib_per_frame = check_per_frame(str); 00037 } 00038 00039 //////////////////////////////////////////////////////////////////// 00040 // Function: RIBGraphicsWindow::get_rib_filename_template 00041 // Access: Public 00042 // Description: Returns the string that defines the RIB filename. 00043 // See set_rib_filename_template(). 00044 //////////////////////////////////////////////////////////////////// 00045 INLINE string RIBGraphicsWindow:: 00046 get_rib_filename_template() const { 00047 return _rib_filename_template; 00048 } 00049 00050 //////////////////////////////////////////////////////////////////// 00051 // Function: RIBGraphicsWindow::get_rib_filename 00052 // Access: Public 00053 // Description: Returns the name of the RIB file that will be created 00054 // at the next (or possibly only the first) call to 00055 // begin_frame(). 00056 //////////////////////////////////////////////////////////////////// 00057 INLINE string RIBGraphicsWindow:: 00058 get_rib_filename() const { 00059 return format_name(_rib_filename_template); 00060 } 00061 00062 //////////////////////////////////////////////////////////////////// 00063 // Function: RIBGraphicsWindow::rib_per_frame 00064 // Access: Public 00065 // Description: Returns true if the RIB filename template contains 00066 // the format specification %f, which means there will 00067 // be a separate RIB file generated for each frame. 00068 //////////////////////////////////////////////////////////////////// 00069 INLINE bool RIBGraphicsWindow:: 00070 rib_per_frame() const { 00071 return _rib_per_frame; 00072 } 00073 00074 //////////////////////////////////////////////////////////////////// 00075 // Function: RIBGraphicsWindow::set_image_filename_template 00076 // Access: Public 00077 // Description: Specifies the string that defines the filename that 00078 // will be written to the RIB file as an output filename 00079 // request. The template may contain any of the 00080 // % format characters descimageed in RIBGraphicsWindow.h. 00081 // In particular, if it contains %f (or some variant), 00082 // there will be a separate image file generated for each 00083 // frame; otherwise, all the frames will be written to 00084 // the same image file, whatever that might mean. 00085 // 00086 // This string may also be empty. If it is, no 00087 // "Display" command will be written to the RIB file, 00088 // and the renderer will choose whatever output filename 00089 // is appropriate. 00090 //////////////////////////////////////////////////////////////////// 00091 INLINE void RIBGraphicsWindow:: 00092 set_image_filename_template(const string &str) { 00093 _image_filename_template = str; 00094 _image_per_frame = check_per_frame(str); 00095 } 00096 00097 //////////////////////////////////////////////////////////////////// 00098 // Function: RIBGraphicsWindow::get_image_filename_template 00099 // Access: Public 00100 // Description: Returns the string that defines the image filename. 00101 // See set_image_filename_template(). 00102 //////////////////////////////////////////////////////////////////// 00103 INLINE string RIBGraphicsWindow:: 00104 get_image_filename_template() const { 00105 return _image_filename_template; 00106 } 00107 00108 //////////////////////////////////////////////////////////////////// 00109 // Function: RIBGraphicsWindow::get_image_filename 00110 // Access: Public 00111 // Description: Returns the name of the image file that will be 00112 // created at the next call to begin_frame(). 00113 //////////////////////////////////////////////////////////////////// 00114 INLINE string RIBGraphicsWindow:: 00115 get_image_filename() const { 00116 return format_name(_image_filename_template); 00117 } 00118 00119 //////////////////////////////////////////////////////////////////// 00120 // Function: RIBGraphicsWindow::image_per_frame 00121 // Access: Public 00122 // Description: Returns true if the image filename template contains 00123 // the format specification %f, which means there will 00124 // be a separate image file generated for each frame. 00125 //////////////////////////////////////////////////////////////////// 00126 INLINE bool RIBGraphicsWindow:: 00127 image_per_frame() const { 00128 return _image_per_frame; 00129 } 00130 00131 //////////////////////////////////////////////////////////////////// 00132 // Function: RIBGraphicsStateWindow::set_texture_directory 00133 // Access: Public 00134 // Description: Sets the name of the directory into which texture 00135 // maps are copied to be available to the RIB file. 00136 //////////////////////////////////////////////////////////////////// 00137 INLINE void RIBGraphicsWindow:: 00138 set_texture_directory(const string &directory) { 00139 DCAST(RIBGraphicsStateGuardian, _gsg)->set_texture_directory(directory); 00140 } 00141 00142 //////////////////////////////////////////////////////////////////// 00143 // Function: RIBGraphicsWindow::get_texture_directory 00144 // Access: Public 00145 // Description: Returns the name of the directory into which texture 00146 // maps are copied to be available to the RIB file. 00147 //////////////////////////////////////////////////////////////////// 00148 INLINE string RIBGraphicsWindow:: 00149 get_texture_directory() const { 00150 return DCAST(RIBGraphicsStateGuardian, _gsg)->get_texture_directory(); 00151 } 00152 00153 //////////////////////////////////////////////////////////////////// 00154 // Function: RIBGraphicsWindow::set_texture_extension 00155 // Access: Public 00156 // Description: Specifies the filename extension that texture map 00157 // files are given when they are copied into the 00158 // directory for RIB files. This might also imply an 00159 // image type. The default is "tiff", which implies 00160 // TIFF files. 00161 //////////////////////////////////////////////////////////////////// 00162 INLINE void RIBGraphicsWindow:: 00163 set_texture_extension(const string &extension) { 00164 DCAST(RIBGraphicsStateGuardian, _gsg)->set_texture_extension(extension); 00165 } 00166 00167 //////////////////////////////////////////////////////////////////// 00168 // Function: RIBGraphicsWindow::get_texture_extension 00169 // Access: Public 00170 // Description: Returns the filename extension that texture map 00171 // files are given when they are copied into the 00172 // directory for RIB files. 00173 //////////////////////////////////////////////////////////////////// 00174 INLINE string RIBGraphicsWindow:: 00175 get_texture_extension() const { 00176 return DCAST(RIBGraphicsStateGuardian, _gsg)->get_texture_extension(); 00177 }