Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

MayaApi Class Reference

This class presents a wrapper around the global Maya interface. More...

#include <mayaApi.h>

Inheritance diagram for MayaApi:

ReferenceCount List of all members.

Public Member Functions

 ~MayaApi ()
bool is_valid () const
 Returns true if the API has been successfully opened and may be used, or false if there is some problem.

bool read (const Filename &filename)
 Reads the indicated maya file into the global model space.

bool write (const Filename &filename)
 Writes the global model space to the indicated file.

bool clear ()
 Resets the global model space to the empty state, for instance in preparation for building a new file.

DistanceUnit get_units ()
 Returns Maya's internal units in effect.

CoordinateSystem get_coordinate_system ()
 Returns Maya's internal coordinate system in effect.

int get_ref_count () const
int ref () const
int unref () const
void test_ref_count_integrity () const

Static Public Member Functions

PointerTo< MayaApi > open_api (string program_name="")
 Opens the Maya API, if it is not already open, and returns a pointer representing this connection.

TypeHandle get_class_type ()
void init_type ()

Protected Member Functions

 MayaApi (const string &program_name)
 Don't attempt to create this object directly; instead, use the open_api() method.

 MayaApi (const MayaApi &copy)
 Don't attempt to copy MayaApi objects.

void operator= (const MayaApi &copy)
 Don't attempt to copy MayaApi objects.


Protected Attributes

int _ref_count

Static Protected Attributes

TypeHandle _type_handle

Private Attributes

bool _is_valid
bool _plug_in

Static Private Attributes

MayaApi * _global_api = (MayaApi *)NULL

Detailed Description

This class presents a wrapper around the global Maya interface.

While the reference count is held, it keeps the Maya interface open, and closes the interface when the object destructs.

Definition at line 46 of file mayaApi.h.


Constructor & Destructor Documentation

MayaApi::MayaApi const string &  program_name  )  [protected]
 

Don't attempt to create this object directly; instead, use the open_api() method.

Definition at line 50 of file mayaApi.cxx.

Referenced by ~MayaApi().

MayaApi::MayaApi const MayaApi &  copy  )  [protected]
 

Don't attempt to copy MayaApi objects.

There should be only one of these in the world at a time.

Definition at line 105 of file mayaApi.cxx.

References nassertv.

MayaApi::~MayaApi  ) 
 

Definition at line 133 of file mayaApi.cxx.

References _global_api, ExecutionEnvironment::get_binary_name(), MayaApi(), and NULL.


Member Function Documentation

bool MayaApi::clear void   ) 
 

Resets the global model space to the empty state, for instance in preparation for building a new file.

Returns true if successful, false otherwise.

Definition at line 297 of file mayaApi.cxx.

References CS_zup_right.

CoordinateSystem MayaApi::get_coordinate_system  ) 
 

Returns Maya's internal coordinate system in effect.

Definition at line 348 of file mayaApi.cxx.

DistanceUnit MayaApi::get_units  ) 
 

Returns Maya's internal units in effect.

Definition at line 315 of file mayaApi.cxx.

bool MayaApi::is_valid  )  const
 

Returns true if the API has been successfully opened and may be used, or false if there is some problem.

Definition at line 201 of file mayaApi.cxx.

PointerTo< MayaApi > MayaApi::open_api string  program_name = ""  )  [static]
 

Opens the Maya API, if it is not already open, and returns a pointer representing this connection.

When you are done using the Maya API, let the pointer destruct.

If program_name is supplied, it is passed to Maya as the name of the currently-executing program. Otherwise, the current program name is extracted from the execution environment, if possible. The special program_name "plug-in" is used for code that is intended to be invoked as a plug-in only; in this case, the maya library is not re-initialized.

Definition at line 174 of file mayaApi.cxx.

void MayaApi::operator= const MayaApi &  copy  )  [protected]
 

Don't attempt to copy MayaApi objects.

There should be only one of these in the world at a time.

Definition at line 120 of file mayaApi.cxx.

bool MayaApi::read const Filename filename  ) 
 

Reads the indicated maya file into the global model space.

Returns true if successful, false otherwise.

Definition at line 231 of file mayaApi.cxx.

bool MayaApi::write const Filename filename  ) 
 

Writes the global model space to the indicated file.

Returns true if successful, false otherwise.

Definition at line 263 of file mayaApi.cxx.

References DU_centimeters, DU_feet, DU_inches, DU_invalid, DU_kilometers, DU_meters, DU_millimeters, DU_statute_miles, and DU_yards.


Member Data Documentation

MayaApi * MayaApi::_global_api = (MayaApi *)NULL [static, private]
 

Definition at line 37 of file mayaApi.cxx.

Referenced by ~MayaApi().

bool MayaApi::_is_valid [private]
 

Definition at line 66 of file mayaApi.h.

bool MayaApi::_plug_in [private]
 

Definition at line 67 of file mayaApi.h.


The documentation for this class was generated from the following files:
Generated on Fri May 2 03:27:37 2003 for Panda-Tool by doxygen1.3