//- // ========================================================================== // 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. // ========================================================================== //+ #ifndef __POLYWRITER_H #define __POLYWRITER_H // polyWriter.h // ***************************************************************************** // // CLASS: polyWriter // // ***************************************************************************** // // CLASS DESCRIPTION (polyWriter) // // polyWriter is a class used for creating polygonal mesh exporter plugins. Its // purpose is to output polygonal mesh data in the format required. // // To use this class, derive a new class and begin by adding the following *.h // files: // #include // // The following functions must be implemented: // constructor - which takes in MDagPath and MStatus object addresses // destructor - which destroys any objects created in the constructor // writeToFile() - which performs the actual data export // outputSingleSet() - which performs the export of a particular polygonal set // on the mesh // // The extractGeometry() function may be overridden to extract more data that // it is doing currently, but be sure to call this class' extractGeometry() // method as its first operation so that essential data is extracted. // // It is recommended that smaller helper functions are added to any derived // classes, to export and format specific data about the mesh. // // Once the derived class has been defined, create and return a new object of // this type in the createPolyWriter() function that must be defined in any // class derived from the polyExporter class. // // For examples, see the classes polyRawWriter and polyX3DWriter // // ***************************************************************************** #include #include #include #include class polyWriter { public: polyWriter (MDagPath dagPath, MStatus& status); virtual ~polyWriter (); virtual MStatus extractGeometry (); virtual MStatus writeToFile (ostream & os) = 0; protected: //Methods // MObject findShader (const MObject& setNode); virtual MStatus outputSets (ostream& os); virtual MStatus outputSingleSet (ostream& os, MString setName, MIntArray faces, MString textureName) = 0; static void outputTabs (ostream & os, unsigned int tabCount); //Data Members // //the current UV set's name // MString fCurrentUVSetName; //for storing general mesh information // MPointArray fVertexArray; MColorArray fColorArray; MFloatVectorArray fNormalArray; MFloatVectorArray fTangentArray; MFloatVectorArray fBinormalArray; //for storing DAG objects // MFnMesh* fMesh; MDagPath* fDagPath; MObjectArray fPolygonSets; MObjectArray fPolygonComponents; }; #endif /*__POLYWRITER_H*/