#ifndef __POLYEXPORTER_H #define __POLYEXPORTER_H //- // ========================================================================== // Copyright (C) 1995 - 2005 Alias Systems Corp. and/or its licensors. All // rights reserved. // // The coded instructions, statements, computer programs, and/or related // material (collectively the "Data") in these files are provided by Alias // Systems Corp. ("Alias") and/or its licensors for the exclusive use of the // Customer (as defined in the Alias Software License Agreement that // accompanies this Alias software). Such Customer has the right to use, // modify, and incorporate the Data into other products and to distribute such // products for use by end-users. // // THE DATA IS PROVIDED "AS IS". ALIAS HEREBY DISCLAIMS ALL WARRANTIES // RELATING TO THE DATA, INCLUDING, WITHOUT LIMITATION, ANY AND ALL EXPRESS OR // IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND/OR FITNESS FOR A // PARTICULAR PURPOSE. IN NO EVENT SHALL ALIAS BE LIABLE FOR ANY DAMAGES // WHATSOEVER, WHETHER DIRECT, INDIRECT, SPECIAL, OR PUNITIVE, WHETHER IN AN // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, OR IN EQUITY, // ARISING OUT OF ACCESS TO, USE OF, OR RELIANCE UPON THE DATA. // ========================================================================== //+ // polyExporter.h // // ***************************************************************************** // // CLASS: polyExporter // // ***************************************************************************** // // CLASS DESCRIPTION (polyExporter) // // polyExporter is a class used for creating polygonal mesh exporter plugins. // It is derived from the MPxFileTranslator class and thus implements the // functions writer(), haveWriteMethod(), haveReadMethod(), and canBeOpened(), // which are called by Maya when a scene export is executed. This class allows // the choice of exporting all or only selected poly meshes in the scene. // // To use this class, derive a new class and begin by adding the following *.h // files: // #include - used for defining plugins // #include - used for input/output operations // #include - used for file input/output operations // // The following functions must be implemented: // creator() - required by Maya to allocate an instance of the derived class // initializePlugin() - required to register the plugin with Maya // uninitializePlugin() - required to unregister the plugin with Maya // defaultExtension() - returns an the export file type extension // createPolyWriter() - returns a new polyWriter which performs the exporting // // For examples, see the classes polyRawExporter and polyX3DExporter // // ***************************************************************************** #include class polyWriter; class MDagPath; class MFnDagNode; class polyExporter:public MPxFileTranslator { public: polyExporter(); virtual ~polyExporter(); virtual MStatus writer (const MFileObject& file, const MString& optionsString, MPxFileTranslator::FileAccessMode mode); virtual bool haveWriteMethod () const; virtual bool haveReadMethod () const; virtual bool canBeOpened () const; virtual MString defaultExtension () const = 0; protected: virtual bool isVisible(MFnDagNode& fnDag, MStatus& status); virtual MStatus exportAll(ostream& os); virtual MStatus exportSelection(ostream& os); virtual void writeHeader(ostream& os); virtual void writeFooter(ostream& os); virtual MStatus processPolyMesh(const MDagPath dagPath, ostream& os); virtual polyWriter* createPolyWriter(const MDagPath dagPath, MStatus& status) = 0; }; #endif /*__POLYEXPORTER_H*/