#ifndef _MVector #define _MVector // //- // ========================================================================== // Copyright (C) 1995 - 2006 Autodesk, Inc., and/or its licensors. All // rights reserved. // // The coded instructions, statements, computer programs, and/or related // material (collectively the "Data") in these files contain unpublished // information proprietary to Autodesk, Inc. ("Autodesk") and/or its // licensors, which is protected by U.S. and Canadian federal copyright law // and by international treaties. // // The Data may not be disclosed or distributed to third parties or be // copied or duplicated, in whole or in part, without the prior written // consent of Autodesk. // // The copyright notices in the Software and this entire statement, // including the above license grant, this restriction and the following // disclaimer, must be included in all copies of the Software, in whole // or in part, and all derivative works of the Software, unless such copies // or derivative works are solely in the form of machine-executable object // code generated by a source language processor. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND. // AUTODESK DOES NOT MAKE AND HEREBY DISCLAIMS ANY EXPRESS OR IMPLIED // WARRANTIES INCLUDING, BUT NOT LIMITED TO, THE WARRANTIES OF // NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, // OR ARISING FROM A COURSE OF DEALING, USAGE, OR TRADE PRACTICE. IN NO // EVENT WILL AUTODESK AND/OR ITS LICENSORS BE LIABLE FOR ANY LOST // REVENUES, DATA, OR PROFITS, OR SPECIAL, DIRECT, INDIRECT, OR // CONSEQUENTIAL DAMAGES, EVEN IF AUTODESK AND/OR ITS LICENSORS HAS // BEEN ADVISED OF THE POSSIBILITY OR PROBABILITY OF SUCH DAMAGES. // ========================================================================== //+ // // CLASS: MVector // // ***************************************************************************** // // CLASS DESCRIPTION (MVector) // // This class provides access to Maya's internal vector math library allowing // vectors to be handled easily, and in a manner compatible with internal // Maya data structures. // // ***************************************************************************** #if defined __cplusplus // ***************************************************************************** // INCLUDED HEADER FILES #include #include // ***************************************************************************** // DECLARATIONS class MMatrix; class MFloatVector; class MPoint; class MQuaternion; class MEulerRotation; #define MVector_kTol 1.0e-10 // ***************************************************************************** // CLASS DECLARATION (MVector) /// A vector math class for vectors of doubles. (OpenMaya) (OpenMaya.py) /** This class provides access to Maya's vector math library. */ #ifdef _WIN32 #pragma warning(disable: 4522) #endif // _WIN32 class OPENMAYA_EXPORT MVector { public: /// enum Axis { /// kXaxis, /// kYaxis, /// kZaxis, /// kWaxis }; /// MVector(); /// MVector( const MVector&); /// MVector( const MFloatVector&); /// MVector( const MPoint&); /// MVector( double xx, double yy, double zz = 0.0); /// MVector( const double[3] ); /// ~MVector(); /// MVector& operator= ( const MVector& src ); /// double operator()( unsigned int i ) const; /// double operator[]( unsigned int i )const; /// MVector operator^( const MVector& right) const; /// double operator*( const MVector& right ) const; /// MVector& operator/=( double scalar ); /// MVector operator/( double scalar ) const; /// MVector& operator*=( double scalar ); /// MVector operator*( double scalar ) const; /// MVector operator+( const MVector& other) const; /// MVector& operator+=( const MVector& other ); /// MVector operator-() const; /// MVector operator-( const MVector& other ) const; /// MVector operator*( const MMatrix&) const; /// MVector& operator*=( const MMatrix&); /// bool operator!=( const MVector& other ) const; /// bool operator==( const MVector& other ) const; /// MVector rotateBy( double x, double y, double z, double w) const; /// MVector rotateBy( const double rotXYZ[3], MTransformationMatrix::RotationOrder order ) const; /// MVector rotateBy( MVector::Axis axis, const double angle ) const; /// MVector rotateBy( const MQuaternion & ) const; /// MVector rotateBy( const MEulerRotation & ) const; /// MQuaternion rotateTo( const MVector & ) const; /// MStatus get( double[3] ) const; /// double length() const; /// MVector normal() const; /// MStatus normalize(); /// double angle( const MVector& other ) const; /// bool isEquivalent( const MVector& other, double tolerance = MVector_kTol ) const; /// bool isParallel( const MVector& other, double tolerance = MVector_kTol ) const; /// MVector transformAsNormal( const MMatrix & matrix ) const; BEGIN_NO_SCRIPT_SUPPORT: /// NO SCRIPT SUPPORT double& operator()( unsigned int i ); /// NO SCRIPT SUPPORT double& operator[]( unsigned int i ); /// NO SCRIPT SUPPORT friend OPENMAYA_EXPORT MVector operator*( const MMatrix&, const MVector&); /// NO SCRIPT SUPPORT friend OPENMAYA_EXPORT MVector operator*( int, const MVector&); /// NO SCRIPT SUPPORT friend OPENMAYA_EXPORT MVector operator*( short, const MVector&); /// NO SCRIPT SUPPORT friend OPENMAYA_EXPORT MVector operator*( unsigned int, const MVector&); /// NO SCRIPT SUPPORT friend OPENMAYA_EXPORT MVector operator*( unsigned short, const MVector&); /// NO SCRIPT SUPPORT friend OPENMAYA_EXPORT MVector operator*( float, const MVector&); /// NO SCRIPT SUPPORT friend OPENMAYA_EXPORT MVector operator*( double, const MVector&); /// NO SCRIPT SUPPORT friend OPENMAYA_EXPORT std::ostream& operator<<(std::ostream& os, const MVector& v); END_NO_SCRIPT_SUPPORT: /// The null vector static const MVector zero; /// The vector <1,1,1> static const MVector one; /// Unit vector in the positive x direction static const MVector xAxis; /// Unit vector in the positive y direction static const MVector yAxis; /// Unit vector in the positive z direction static const MVector zAxis; /// Unit vector in the negative z direction static const MVector xNegAxis; /// Unit vector in the negative z direction static const MVector yNegAxis; /// Unit vector in the negative z direction static const MVector zNegAxis; /// The x component of the vector double x; /// The y component of the vector double y; /// The z component of the vector double z; protected: // No protected members private: // No private members }; #ifdef WANT_GCC41_FRIEND MVector operator*( int, const MVector&); MVector operator*( short, const MVector&); MVector operator*( unsigned int, const MVector&); MVector operator*( unsigned short, const MVector&); MVector operator*( float, const MVector&); MVector operator*( double, const MVector&); #endif #ifdef _WIN32 #pragma warning(default: 4522) #endif // _WIN32 // ***************************************************************************** #endif /* __cplusplus */ #endif /* _MVector */