Panda3D

mayaApi.h

00001 // Filename: mayaApi.h
00002 // Created by:  drose (15Apr02)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 #ifndef MAYAAPI_H
00016 #define MAYAAPI_H
00017 
00018 #include "pandatoolbase.h"
00019 #include "distanceUnit.h"
00020 #include "coordinateSystem.h"
00021 #include "referenceCount.h"
00022 #include "pointerTo.h"
00023 
00024 class Filename;
00025 
00026 ////////////////////////////////////////////////////////////////////
00027 //       Class : MayaApi
00028 // Description : This class presents a wrapper around the global
00029 //               Maya interface.  While the reference count is held,
00030 //               it keeps the Maya interface open, and closes the
00031 //               interface when the object destructs.
00032 ////////////////////////////////////////////////////////////////////
00033 class MayaApi : public ReferenceCount {
00034 protected:
00035   MayaApi(const string &program_name, bool view_license = false, bool revertdir = true);
00036   MayaApi(const MayaApi &copy);
00037   void operator = (const MayaApi &copy);
00038 
00039 public:
00040   ~MayaApi();
00041 
00042   static PT(MayaApi) open_api(string program_name = "", bool view_license = false, bool revertdir = true);
00043   bool is_valid() const;
00044 
00045   bool read(const Filename &filename);
00046   bool write(const Filename &filename);
00047   bool clear();
00048 
00049   DistanceUnit get_units();
00050   void set_units(DistanceUnit unit);
00051   CoordinateSystem get_coordinate_system();
00052 
00053 private:
00054   bool _is_valid;
00055   bool _plug_in;
00056   Filename _cwd;
00057   static MayaApi *_global_api;
00058 };
00059 
00060 #endif
 All Classes Functions Variables Enumerations