fbsdk/fbtypes.h Source File

fbtypes.h
Go to the documentation of this file.
1 #ifndef __FBTYPES_H__
2 #define __FBTYPES_H__
3 /**************************************************************************
4  Copyright (c) 1994 - 2009 Autodesk, Inc. and/or its licensors.
5  All Rights Reserved.
6 
7  The coded instructions, statements, computer programs, and/or related
8  material (collectively the "Data") in these files contain unpublished
9  information proprietary to Autodesk, Inc. and/or its licensors, which is
10  protected by Canada and United States of America federal copyright law
11  and by international treaties.
12 
13  The Data may not be disclosed or distributed to third parties, in whole
14  or in part, without the prior written consent of Autodesk, Inc.
15  ("Autodesk").
16 
17  THE DATA IS PROVIDED "AS IS" AND WITHOUT WARRANTY.
18  ALL WARRANTIES ARE EXPRESSLY EXCLUDED AND DISCLAIMED. AUTODESK MAKES NO
19  WARRANTY OF ANY KIND WITH RESPECT TO THE DATA, EXPRESS, IMPLIED OR
20  ARISING BY CUSTOM OR TRADE USAGE, AND DISCLAIMS ANY IMPLIED WARRANTIES
21  OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR
22  PURPOSE OR USE. WITHOUT LIMITING THE FOREGOING, AUTODESK DOES NOT
23  WARRANT THAT THE OPERATION OF THE DATA WILL BE UNINTERRUPTED OR ERROR
24  FREE.
25 
26  IN NO EVENT SHALL AUTODESK, ITS AFFILIATES, PARENT COMPANIES, LICENSORS
27  OR SUPPLIERS ("AUTODESK GROUP") BE LIABLE FOR ANY LOSSES, DAMAGES OR
28  EXPENSES OF ANY KIND (INCLUDING WITHOUT LIMITATION PUNITIVE OR MULTIPLE
29  DAMAGES OR OTHER SPECIAL, DIRECT, INDIRECT, EXEMPLARY, INCIDENTAL, LOSS
30  OF PROFITS, REVENUE OR DATA, COST OF COVER OR CONSEQUENTIAL LOSSES OR
31  DAMAGES OF ANY KIND), HOWEVER CAUSED, AND REGARDLESS OF THE THEORY OF
32  LIABILITY, WHETHER DERIVED FROM CONTRACT, TORT (INCLUDING, BUT NOT
33  LIMITED TO, NEGLIGENCE), OR OTHERWISE, ARISING OUT OF OR RELATING TO THE
34  DATA OR ITS USE OR ANY OTHER PERFORMANCE, WHETHER OR NOT AUTODESK HAS
35  BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS OR DAMAGE.
36 
37 **************************************************************************/
38 
43 #include <kaydaradef.h>
44 
45 #ifndef FBSDK_DLL
46 
49  #define FBSDK_DLL K_DLLIMPORT
50 #endif
51 
52 #include <fbsdk/fbversion.h>
53 
54 #ifdef FBSDKUseNamespace
55  namespace FBSDKNamespace {
56 #endif
57 
58 
62 #define FB_FORWARD( ClassName ) class ClassName
63 
64 
68 #define __FB_FORWARD( ClassName ) \
69  FB_FORWARD( ClassName ); \
70  class Data##ClassName
71 
72 
75  kInit=1,
78  kAll=7,
80  kData=16,
81  kMerge=32
82 };
83 
85 // New classes
88 template <class tType> class FBSDK_DLL FBVector2
89 {
90  private:
91  public:
92  tType mValue[2];
93 
94  public:
95 
97  FBVector2();
98 
100  FBVector2( const FBVector2& pVector );
101 
105  FBVector2( tType *pValue );
106 
111  FBVector2( tType p1,tType p2 );
112 
116  void Init();
117 
122  tType &operator[](int pIndex);
123 
127  void Set( tType *pValue );
128 
132  operator tType *() const;
133 
138  const FBVector2& operator = ( const FBVector2& pVector );
139 
144  bool operator != ( const FBVector2& pVector );
145 
150  bool operator == ( const FBVector2& pVector );
151 };
152 
154 template <class tType> class FBSDK_DLL FBVector3
155 {
156  private:
157  public:
158  tType mValue[3];
159 
160  public:
161 
163  FBVector3();
164 
166  FBVector3( const FBVector3& pVector );
167 
171  FBVector3( tType *pValue );
172 
178  FBVector3( tType p1,tType p2, tType p3 = 0);
179 
183  void Init();
184 
189  tType &operator[](int pIndex);
190 
194  void Set( tType *pValue );
195 
199  operator tType *() const;
200 
205  const FBVector3& operator = ( const FBVector3& pVector );
206 
211  bool operator != ( const FBVector3& pVector );
212 
217  bool operator == ( const FBVector3& pVector );
218 };
219 
221 template <class tType> class FBSDK_DLL FBVector4
222 {
223  private:
224  public:
225 
226  tType mValue[4];
227 
229  FBVector4();
230 
232  FBVector4( const FBVector4& pVector );
233 
237  FBVector4( tType *pValue );
238 
245  FBVector4( tType p1,tType p2, tType p3, tType p4 = 1);
246 
250  void Init();
251 
256  tType &operator[](int pIndex);
257 
261  void Set( tType *pValue );
262 
266  operator tType *() const;
267 
272  const FBVector4& operator = ( const FBVector4& pVector );
273 
278  bool operator != ( const FBVector4& pVector );
279 
284  bool operator == ( const FBVector4& pVector );
285 
286 };
287 
290 {
291  private:
292  double mValue[4][4];
293 
294  public:
298  FBMatrix();
299 
303  FBMatrix( const double *pValue );
304 
308  FBMatrix( const FBMatrix& pMatrix );
309 
311  void Identity();
312 
316  void Set( const double *pValue );
317 
321  operator double *() const;
322 
326  double ** GetData() const;
327 
331  double& operator () ( int i, int j );
332 
337  const FBMatrix& operator = ( const FBMatrix& pMatrix );
338 
343  const FBMatrix& operator = ( const double *pValue );
344 
349  bool operator != ( const FBMatrix& pMatrix );
350 
355  bool operator == ( const FBMatrix& pMatrix );
356 
361  const FBMatrix operator + ( const FBMatrix& pMatrix ) const;
362 
367  FBMatrix &operator += ( const FBMatrix& pMatrix );
368 
372  const FBMatrix operator - ();
373 
378  const FBMatrix operator - ( const FBMatrix& pMatrix ) const;
379 
384  FBMatrix &operator -= ( const FBMatrix& pMatrix );
385 
390  const FBMatrix operator * ( const FBMatrix& pMatrix ) const;
391 
396  FBMatrix &operator *= ( const FBMatrix& pMatrix );
397 
402  const FBMatrix operator * ( const double pN ) const;
403 
408  FBMatrix &operator *= ( const double pN );
409 
413  FBMatrix &Inverse();
414 
418  FBMatrix &Transpose();
419 
423  bool Validate();
424 
429  const FBMatrix InverseProduct( const FBMatrix& pMatrix );
430 
431 };
432 
433 
435 typedef class FBSDK_DLL FBVector2<double> FBVector2d;
436 
438 typedef class FBSDK_DLL FBVector3<double> FBVector3d;
439 
441 typedef class FBSDK_DLL FBVector4<double> FBVector4d;
442 
444 typedef class FBSDK_DLL FBVector4<float> FBColorF;
445 
447 class FBSDK_DLL FBColor : public FBVector3< double >
448 {
449  public:
451  FBColor();
452 
456  FBColor( double *pValue );
457 
463  FBColor( double pRed, double pGreen, double pBlue);
464 
466  FBColor( const FBColor& pVector );
467 
472  double &operator[](int pIndex);
473 
477  operator double *() const;
478 
483  const FBColor& operator = ( const FBColor& pVector );
484  void operator=(double *pValue);
485  const FBVector3< double >& operator = ( const FBVector3< double >& pVector );
486 };
487 
489 class FBSDK_DLL FBColorAndAlpha : public FBVector4< double >
490 {
491  public:
493  FBColorAndAlpha();
494 
498  FBColorAndAlpha( double *pValue );
499 
506  FBColorAndAlpha( double pRed, double pGreen, double pBlue, double pAlpha=1.0);
507 
511  FBColorAndAlpha( const FBColor &pValue );
512 
516  FBColorAndAlpha( const FBColorF& pValue );
517 
519  FBColorAndAlpha( const FBColorAndAlpha& pVector );
520 
525  double &operator[](int pIndex);
526 
530  operator double *() const;
531 
536  const FBColorAndAlpha& operator = ( const FBColorAndAlpha& pVector );
537  const FBColorAndAlpha& operator = ( const FBColor& pVector );
538  const FBColorAndAlpha& operator = ( const FBColorF& pVector );
539  void operator=(double *pValue);
540  const FBVector4< double >& operator = ( const FBVector4< double >& pVector );
541 };
542 
545 
548 
551 
554 
557 
559 typedef class FBSDK_DLL FBVector3< double > FBVector3Double;
560 
562 typedef class FBSDK_DLL FBVector4< double > FBVector4Double;
563 
565 class FBSDK_DLL FBSVector : public FBVector3< double >
566 {
567  private:
568  public:
570  FBSVector();
571 
575  FBSVector( double *pValue );
576 
582  FBSVector( double p1,double p2, double p3=1.0 );
583 
588  void Init();
589 };
590 
591 //typedef FBVector3<double> FBSVector;
593 typedef class FBSDK_DLL FBVector4<double> FBQuaternion;
595 typedef class FBSDK_DLL FBVector2<float> FBUV;
597 typedef class FBSDK_DLL FBVector4<float> FBVertex;
599 typedef class FBSDK_DLL FBVector4<float> FBNormal;
600 
602 // Global
604 #ifdef FBSDKUseNamespace
605  }
606 #endif
607 
608 #endif
609 
#define Set(a0, a1, a2, a3)
Definition: Python-ast.h:467
Four dimensional vector (template).
Definition: fbtypes.h:221
Three dimensional scaling vector.
Definition: fbtypes.h:565
FBString operator+(const FBString &p1Str, const char *p2Str)
Py_ssize_t i
Definition: abstract.h:1086
class FBVector4< float > FBVertex
Vertex.
Definition: fbtypes.h:597
Merge pass.
Definition: fbtypes.h:81
Four x Four (double) Matrix.
Definition: fbtypes.h:289
class FBVector3< double > FBVector3d
3D vector.
Definition: fbtypes.h:438
Initialization before store.
Definition: fbtypes.h:75
Two dimensional vector (template).
Definition: fbtypes.h:88
Last pass for cleanup (retrieve only).
Definition: fbtypes.h:79
Three dimensional vector (template).
Definition: fbtypes.h:154
Mask for Attributes and Relations (for compatibility with SDK earlier that 6.0).
Definition: fbtypes.h:78
Color vector.
Definition: fbtypes.h:447
class FBVector3< double > FBVector3Double
Vector 3 double.
Definition: fbtypes.h:559
FBVector4< double > FBTVector
Translation vector.
Definition: fbtypes.h:556
kFbxObjectStore
Description of the different store/retrieve passes of the FBX format.
Definition: fbtypes.h:74
define declarations to determine cross-platform namespace conventions.
class FBVector4< double > FBVector4Double
Vector 4 double.
Definition: fbtypes.h:562
Relations.
Definition: fbtypes.h:77
class FBVector4< double > FBVector4d
4D vector
Definition: fbtypes.h:441
#define FBSDKNamespace
FBSDKNamespace define.
Definition: fbversion.h:64
bool operator==(const FBPickInfos &pLhs, const FBPickInfos &pRhs)
Special data pass.
Definition: fbtypes.h:80
class FBVector4< float > FBNormal
Normal.
Definition: fbtypes.h:599
class FBVector2< double > FBVector2d
2D vector.
Definition: fbtypes.h:435
Color and alpha vector.
Definition: fbtypes.h:489
FBVector3< double > FBRVector
Rotation vector.
Definition: fbtypes.h:553
class FBVector2< float > FBUV
Represents a UV coordinate as a FBVector2 of floats in the range of 0.0f to 1.0f; value 0 is the U va...
Definition: fbtypes.h:595
const char void * pValue
Definition: fbcontrols.h:2116
class FBVector4< double > FBQuaternion
Quaternion.
Definition: fbtypes.h:593
class FBVector4< float > FBColorF
Color float.
Definition: fbtypes.h:444
#define FBSDK_DLL
Be sure that FBSDK_DLL is defined only once...
Definition: fbtypes.h:49
Attributes.
Definition: fbtypes.h:76