Nuke binary plugins 15.1.5
 
Loading...
Searching...
No Matches
DD::Image::GeoWriter Class Reference

#include <GeoWriter.h>

Inherits DD::Image::FileHandler.

Classes

class  Description
 Specialised GeoWriter Description. More...
 

Public Member Functions

 GeoWriter (WriteGeo *)
 
 ~GeoWriter () override
 
virtual void frame (int)
 
virtual void execute (Scene &scene)
 
virtual bool animation () const
 
virtual int split_input (int i) const
 
virtual void finish ()
 
void knobs (Knob_Callback cb) override
 
int knob_changed (Knob *knob) override
 

Protected Member Functions

int frame () const
 
GeoOpinput0 ()
 
const char * filename () const
 
void status (float amount) const
 
bool open ()
 
bool close ()
 
bool write (const void *, FILE_OFFSET)
 
bool write (FILE_OFFSET, const void *, FILE_OFFSET)
 
bool seek (FILE_OFFSET)
 
FILE_OFFSET tell () const
 

Protected Attributes

WriteGeogeo
 Points at the WriteGeo that created this.
 
void * file
 Actually a FILE* but I don't want the <stdio.h> header!
 
FILE_OFFSET offset
 Current offset into file.
 

Friends

class WriteGeo
 

Detailed Description

Writes data to a geometry file.

The WriteGeo creates one of these for every different filename it writes. Each different file type is a different subclass. Each subclass defines a Writer_Description object, all of these are searched to figure out what subclass to use.

The implementation of the base class is in WriteGeo.C

Constructor & Destructor Documentation

◆ GeoWriter()

GeoWriter::GeoWriter ( WriteGeo i)

This does not open the file. Instead a subclass should call open() as the first statement in execute() and then return if open fails.

References file.

◆ ~GeoWriter()

GeoWriter::~GeoWriter ( )
override

Destruction closes the temporary file if execute() did not call close().

References file.

Member Function Documentation

◆ frame() [1/2]

int DD::Image::GeoWriter::frame ( ) const
inlineprotected

Frame number to write.

◆ input0()

GeoOp * DD::Image::GeoWriter::input0 ( )
inlineprotected

The GeoOp whose output should be written.

◆ filename()

const char * DD::Image::GeoWriter::filename ( ) const
inlineprotected

The filename to write.

Referenced by close(), and open().

◆ status()

void DD::Image::GeoWriter::status ( float  amount) const
inlineprotected

Call status to display percentage of the current frame done.

References DD::Image::Op::progressFraction().

◆ open()

bool GeoWriter::open ( )
protected

Open the output file. This file is created with a temporary name so that the original file is not replaced until the write is successful. This returns false and calls geo->error() if it can't open the file.

References file, filename(), geo, DD::Image::WriteGeo::internalError(), offset, and strlcpy().

◆ close()

bool GeoWriter::close ( )
protected

Close the output file. If there have not been any errors this will mv the temporary file to the correct place.

References DD::Image::Op::aborted(), file, filename(), geo, DD::Image::WriteGeo::internalError(), and strlcpy().

◆ write() [1/2]

bool GeoWriter::write ( const void *  buf,
FILE_OFFSET  length 
)
protected

Write length bytes to the file. Call geo->error() on any errors and returns false. Returns true on success.

References file, geo, DD::Image::WriteGeo::internalError(), and offset.

Referenced by write().

◆ write() [2/2]

bool GeoWriter::write ( FILE_OFFSET  off,
const void *  buf,
FILE_OFFSET  length 
)
protected

Same as "seek(off) && write(buf, length)", this writes length bytes to the file at offset and leaves the pointer after that.

References seek(), and write().

◆ seek()

bool GeoWriter::seek ( FILE_OFFSET  off)
protected

Move the write pointer to offset. This is done efficiently if the pointer is already at that point. Calls geo->error() on any errors and returns false. Returns true on success.

References file, geo, DD::Image::WriteGeo::internalError(), and offset.

Referenced by write().

◆ tell()

FILE_OFFSET DD::Image::GeoWriter::tell ( ) const
inlineprotected

Returns where the pointer currently is.

◆ frame() [2/2]

void GeoWriter::frame ( int  n)
virtual

Set the frame number to n.

◆ execute()

void GeoWriter::execute ( Scene scene)
virtual

Write the data in geo->input0(). The frame number may be retrieved with frame() and the filename from filename(). This may call geo->error() with any error messages.

References DD::Image::Op::debug(), and geo.

◆ animation()

bool GeoWriter::animation ( ) const
virtual

Return true if the destination can have an animation. If this is true then the writer is capable of writing objects with animation, and frame() and execute() may be called multiple times to write different objects. The default version returns false.

Referenced by DD::Image::WriteGeo::_close(), DD::Image::WriteGeo::endExecuting(), and DD::Image::WriteGeo::execFrameMode().

◆ split_input()

int GeoWriter::split_input ( int  i) const
virtual

Lets a writer override the Op::split_input() method of the including WriteGeo op. This is used by Writers that can write more than one view.

Referenced by DD::Image::WriteGeo::execViewMode(), and DD::Image::WriteGeo::split_input().

◆ finish()

void GeoWriter::finish ( )
virtual

Override if the writer needs to do something to finish a sequence. This is mostly of use by animation writers that don't close out the destination on a frame-by-frame basis.

Referenced by DD::Image::WriteGeo::endExecuting().

◆ knobs()

void GeoWriter::knobs ( Knob_Callback  cb)
override

Like the Op::knobs() method, this allows the Writers to create format-specific knobs for format-specific parameters. At present, the Writers are tasked with adding the knobs themselves after the 'file_type' knob of the parent Write.

◆ knob_changed()

int GeoWriter::knob_changed ( Knob knob)
override

Like the Op::knob_changed() method, this allows the Writers to handle changes in their own parameters.



©2024 The Foundry Visionmongers, Ltd. All Rights Reserved.
www.foundry.com