00001 /*************************************************************************** 00002 *cr 00003 *cr (C) Copyright 1995-2019 The Board of Trustees of the 00004 *cr University of Illinois 00005 *cr All Rights Reserved 00006 *cr 00007 ***************************************************************************/ 00008 /*************************************************************************** 00009 * RCS INFORMATION: 00010 * 00011 * $RCSfile: MayaDisplayDevice.h,v $ 00012 * $Author: johns $ $Locker: $ $State: Exp $ 00013 * $Revision: 1.5 $ $Date: 2019年01月17日 21:21:00 $ 00014 * 00015 *************************************************************************** 00016 * DESCRIPTION: 00017 * Use to make Maya ASCII scene files for direct import into Autodesk Maya. 00018 * 00019 ***************************************************************************/ 00020 00021 #ifndef MayaDISPLAYDEVICE 00022 #define MayaDISPLAYDEVICE 00023 00024 #include <stdio.h> 00025 #include "FileRenderer.h" 00026 00028 class MayaDisplayDevice : public FileRenderer { 00029 private: 00030 int objnameindex; 00031 int oldColorIndex; 00032 int oldMaterialIndex; 00033 int oldMaterialState; 00034 void write_material_block(void); 00035 void write_cindexmaterial(const char *, int, int); 00036 void write_colormaterial(float *, int); 00037 00038 protected: 00039 void beginrepgeomgroup(const char *); 00040 void comment(const char *); 00041 void line(float *xyz1, float *xyz2); 00042 void point(float *xyz); 00043 void sphere(float *xyzr); 00044 void triangle(const float *, const float *, const float *, 00045 const float *, const float *, const float *); 00046 #if 0 00047 void tricolor(const float * xyz1, const float * xyz2, const float * xyz3, 00048 const float * n1, const float * n2, const float * n3, 00049 const float * c1, const float * c2, const float * c3); 00050 #endif 00051 00052 public: 00053 MayaDisplayDevice(void); // constructor 00054 virtual ~MayaDisplayDevice(void); // destructor 00055 virtual int open_file(const char *filename); 00056 virtual void close_file(void); 00057 void write_header (void); 00058 void write_trailer(void); 00059 }; 00060 00061 #endif 00062