Open Reality Reference Guide
 
Loading...
Searching...
No Matches
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
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
78 kAll=7,
80 kData=16,
81 kMerge=32
82};
83
85// New classes
88template <class tType> class FBSDK_DLL FBVector2
89{
90 private:
91 public:
92 tType mValue[2];
93
94 public:
95
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
154template <class tType> class FBSDK_DLL FBVector3
155{
156 private:
157 public:
158 tType mValue[3];
159
160 public:
161
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
221template <class tType> class FBSDK_DLL FBVector4
222{
223 private:
224 public:
225
226 tType mValue[4];
227
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:
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
414
419
423 bool Validate();
424
429 const FBMatrix InverseProduct( const FBMatrix& pMatrix );
430
431};
432
433
435typedef class FBSDK_DLL FBVector2<double> FBVector2d;
436
438typedef class FBSDK_DLL FBVector3<double> FBVector3d;
439
441typedef class FBSDK_DLL FBVector4<double> FBVector4d;
442
444typedef class FBSDK_DLL FBVector4<float> FBColorF;
445
447class FBSDK_DLL FBColor : public FBVector3< double >
448{
449 public:
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
489class FBSDK_DLL FBColorAndAlpha : public FBVector4< double >
490{
491 public:
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
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
559typedef class FBSDK_DLL FBVector3< double > FBVector3Double;
560
562typedef class FBSDK_DLL FBVector4< double > FBVector4Double;
563
565class FBSDK_DLL FBSVector : public FBVector3< double >
566{
567 private:
568 public:
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;
593typedef class FBSDK_DLL FBVector4<double> FBQuaternion;
595typedef class FBSDK_DLL FBVector2<float> FBUV;
597typedef class FBSDK_DLL FBVector4<float> FBVertex;
599typedef class FBSDK_DLL FBVector4<float> FBNormal;
600
602// Global
604#ifdef FBSDKUseNamespace
605 }
606#endif
607
608#endif
609
Color and alpha vector.
Definition fbtypes.h:490
FBColorAndAlpha(double *pValue)
Constructor from array.
FBColorAndAlpha(double pRed, double pGreen, double pBlue, double pAlpha=1.0)
Constructor.
FBColorAndAlpha(const FBColor &pValue)
Constructor from FBColor.
FBColorAndAlpha(const FBColorAndAlpha &pVector)
Copy Constructor.
FBColorAndAlpha()
Constructor.
double & operator[](int pIndex)
Overloaded [] operator.
FBColorAndAlpha(const FBColorF &pValue)
Constructor from FBColorF.
Color vector.
Definition fbtypes.h:448
FBColor()
Constructor.
FBColor(double pRed, double pGreen, double pBlue)
Constructor.
double & operator[](int pIndex)
Overloaded [] operator.
FBColor(const FBColor &pVector)
Copy Constructor.
FBColor(double *pValue)
Constructor from array.
Four x Four (double) Matrix.
Definition fbtypes.h:290
FBMatrix & Inverse()
Get Inversed matrix.
const FBMatrix InverseProduct(const FBMatrix &pMatrix)
InverseProduct Matrix.
void Set(const double *pValue)
Set matrix from an array.
FBMatrix(const FBMatrix &pMatrix)
Copy Constructor.
void Identity()
Load identity matrix.
FBMatrix(const double *pValue)
Constructor.
FBMatrix()
Constructor Initializes matrix to identity.
bool Validate()
Validated matrix.
FBMatrix & Transpose()
Get Transposed matrix.
double ** GetData() const
return internal Data
Three dimensional scaling vector.
Definition fbtypes.h:566
void Init()
Init Initialization function.
FBSVector()
Constructor.
FBSVector(double p1, double p2, double p3=1.0)
Constructor.
FBSVector(double *pValue)
Constructor from array.
Two dimensional vector (template).
Definition fbtypes.h:89
void Init()
Initialization function.
tType & operator[](int pIndex)
Overloaded [] operator.
FBVector2()
Constructor.
void Set(tType *pValue)
Set vector from an array.
FBVector2(tType *pValue)
Constructor from array.
FBVector2(tType p1, tType p2)
Constructor.
FBVector2(const FBVector2 &pVector)
Copy Constructor.
Three dimensional vector (template).
Definition fbtypes.h:155
void Init()
Initialization function.
tType & operator[](int pIndex)
Overloaded [] operator.
FBVector3(tType p1, tType p2, tType p3=0)
Constructor.
FBVector3(tType *pValue)
Constructor from array.
FBVector3()
Constructor.
FBVector3(const FBVector3 &pVector)
Copy Constructor.
void Set(tType *pValue)
Set vector from an array.
Four dimensional vector (template).
Definition fbtypes.h:222
void Init()
Initialization function.
tType & operator[](int pIndex)
Overloaded [] operator.
FBVector4(const FBVector4 &pVector)
Copy Constructor.
FBVector4(tType *pValue)
Constructor from array.
FBVector4(tType p1, tType p2, tType p3, tType p4=1)
Constructor.
void Set(tType *pValue)
Set vector from an array.
FBVector4()
Constructor.
#define FBSDK_DLL
Be sure that FBSDK_DLL is defined only once...
class K_DLLIMPORT FBVector3< double > FBVector3Double
Vector 3 double.
Definition fbtypes.h:559
class K_DLLIMPORT FBVector4< float > FBVertex
Vertex.
Definition fbtypes.h:597
kFbxObjectStore
Description of the different store/retrieve passes of the FBX format.
Definition fbtypes.h:74
@ kCleanup
Last pass for cleanup (retrieve only).
Definition fbtypes.h:79
@ kData
Special data pass.
Definition fbtypes.h:80
@ kInit
Initialization before store.
Definition fbtypes.h:75
@ kMerge
Merge pass.
Definition fbtypes.h:81
@ kRelations
Relations.
Definition fbtypes.h:77
@ kAll
Mask for Attributes and Relations (for compatibility with SDK earlier that 6.0).
Definition fbtypes.h:78
@ kAttributes
Attributes.
Definition fbtypes.h:76
class K_DLLIMPORT FBVector4< double > FBVector4Double
Vector 4 double.
Definition fbtypes.h:562
class K_DLLIMPORT FBVector4< double > FBQuaternion
Quaternion.
Definition fbtypes.h:593
class K_DLLIMPORT FBVector2< double > FBVector2d
2D vector.
Definition fbtypes.h:435
class K_DLLIMPORT FBVector4< float > FBColorF
Color float.
Definition fbtypes.h:444
class K_DLLIMPORT FBVector3< double > FBVector3d
3D vector.
Definition fbtypes.h:438
class K_DLLIMPORT 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
class K_DLLIMPORT FBVector4< double > FBVector4d
4D vector
Definition fbtypes.h:441
FBVector3< double > FBRVector
Rotation vector.
Definition fbtypes.h:553
class K_DLLIMPORT FBVector4< float > FBNormal
Normal.
Definition fbtypes.h:599
FBVector4< double > FBTVector
Translation vector.
Definition fbtypes.h:556