DD::Image::WriteGeo Class Reference

Inherits DD::Image::GeoOp, DD::Image::FileOp, and DD::Image::Executable.

List of all members.

Public Member Functions

 WriteGeo (Node *node)
 ~WriteGeo ()
Executableexecutable ()
virtual bool isWrite () const
virtual void beginExecuting ()
virtual void endExecuting ()
virtual ExecMode execViewMode ()
virtual ExecMode execFrameMode ()
const std::set< int > & views ()
virtual int split_input (int i) const
void execute ()
virtual FileHandler * handler () const
const char * filename () const
const char * getFilename () const
const char * fname () const
void filename (const char *f)
virtual const char * file_type () const
bool set_file_type (const char *)
bool set_file_type_from_filename (Knob *knob=0)
void internalError (const char *fmt,...)
void filetype_knobs (Knob_Callback f)
void knobs (Knob_Callback)
int knob_changed (Knob *)
const char * Class () const
const char * node_help () const

Static Public Member Functions

static const char *const file_types ()

Static Public Attributes

static const Description d

Protected Member Functions

void _validate (bool)
void _close ()

Detailed Description

This is a base class for a file writer.

All the work is done by the various subclasses of GeoWriter. WriteGeo just chooses what subclass to instantiate and returns the output from it, and correctly destroys and instantiates new ones as needed.

Calling Op::execute() initiates writing the file.


Constructor & Destructor Documentation

WriteGeo::~WriteGeo ( )

calls _close()

References _close().


Member Function Documentation

void WriteGeo::_close ( ) [protected, virtual]

Closes file that may be left open. That should not happen, though.

Reimplemented from DD::Image::Op.

References DD::Image::GeoWriter::animation().

Referenced by ~WriteGeo().

void WriteGeo::endExecuting ( ) [virtual]

call finish() on the writer if it is writing an animation file.

Reimplemented from DD::Image::Executable.

References DD::Image::GeoWriter::animation(), and DD::Image::GeoWriter::finish().

Executable::ExecMode WriteGeo::execViewMode ( ) [virtual]

Returns WriteMany if the Writer object asks for more than one in Writer::split_input(), indicating that (most likely) more than one view is wanted. Returns WriteOne otherwise, indicating it is a waste of time to call this with different views. Nuke will detect if the filename changes when the view changes and will call this multiple times with different filenames, otherwise complain if the user asks for more than one view to execute.

Reimplemented from DD::Image::Executable.

References DD::Image::GeoWriter::split_input(), DD::Image::Executable::WriteMany, and DD::Image::Executable::WriteOne.

Executable::ExecMode WriteGeo::execFrameMode ( ) [virtual]

Returns WriteMany if the Writer object returns true for animation(). Returns WriteOne otherwise, indicating it is a waste of time to call this with different frames. Nuke will detect if the filename changes when the frame changes and will call this multiple times with different filenames, otherwise complain if the user asks for more than one frame to execute.

Reimplemented from DD::Image::Executable.

References DD::Image::GeoWriter::animation(), DD::Image::Executable::WriteMany, and DD::Image::Executable::WriteOne.

int WriteGeo::split_input ( int  i) const [virtual]
const char * WriteGeo::file_type ( ) const [virtual]

Return the type of file this will write. This is set by set_file_type() or set_file_type_from_filename() or by validate() if neither of these is done. This is actually the null-sepearted list of names from the DD::Image::Writer::Description object.

Implements DD::Image::FileOp.

Referenced by set_file_type().

bool WriteGeo::set_file_type ( const char *  name)

Set the type of file the Writer will write. The type is a string like "cin" or "jpeg". Returns true if the new type is different than the previous one. Notice that if the type changes all settings on Writer-specific knobs are lost.

If this type is not found or is zero then file_type() is set to zero. If the node is then executed it will attempt to figure out the type from the filename, and if that fails it will cause an error.

file_types() returns a list of available names. You may also be able to set other names like "sgi16" that are not in this list, these typically initialize some knobs to non-default values.

References DD::Image::GeoWriter::Description::constructor, file_type(), and DD::Image::GeoWriter::Description::find().

Referenced by set_file_type_from_filename().

bool WriteGeo::set_file_type_from_filename ( Knob knob = 0)

If the filename has "name:" near the start, try using that to set the file type. If that fails, try using the file extension. This is automatically done by execute() and validate() if this or set_file_type() has not been called.

References DD::Image::Op::error_message(), DD::Image::Knob::get_text(), DD::Image::plugin_error(), and set_file_type().

void WriteGeo::internalError ( const char *  fmt,
  ... 
)