fbsdk/fbtexture.h Source File

fbtexture.h
Go to the documentation of this file.
1 #ifndef __FBTEXTURE_H__
2 #define __FBTEXTURE_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 #ifndef FBSDK_DLL
45 
48  #define FBSDK_DLL K_DLLIMPORT
49 #endif
50 
51 #include <fbsdk/fbcomponent.h>
52 #include <fbsdk/fbcore.h>
53 #include <fbsdk/fbproperties.h>
54 #include <fbsdk/fbvideo.h>
55 
56 #ifdef FBSDKUseNamespace
57 namespace FBSDKNamespace {
58 #endif
59 
60 
62 // FBTexture
64 __FB_FORWARD( FBTexture );
65 
78 };
79 
93 };
94 
103 };
104 
105 FB_DEFINE_ENUM( FBSDK_DLL, TextureUseType );
106 FB_DEFINE_ENUM( FBSDK_DLL, TextureMapping );
107 FB_DEFINE_ENUM( FBSDK_DLL, TextureBlendMode );
108 
110 // This class is used to encapsulate an underlying media that is used to texture a model.
111 //
113 
115 
116 class FBSDK_DLL FBTexture : public FBBox {
118 public:
123  FBTexture(const char* pName, HIObject pObject=NULL);
124  virtual void FBDelete();
125 
130  FBTexture* Clone();
131 
142  FBPropertyInt CroppingX[2];
143  FBPropertyInt CroppingY[2];
147 
148  void OGLInit(FBRenderOptions* pRenderOptions = NULL);
149  unsigned int GetTextureObject();
150  double* GetMatrix();
151 };
152 
154 // FBPropertyListTexture
157 
159 {
160 public:
168  virtual int Add( FBTexture* pItem );
173  FBTexture* operator[](int pIndex);
174 
175 private:
176  inline virtual int Add ( FBComponent* pItem ) { return Add((FBTexture*)pItem); }
177 };
178 
180 // FBLayeredTexture
183 
191 public:
196  FBLayeredTexture(const char* pName, HIObject pObject=NULL);
197  virtual void FBDelete();
198 
203  FBLayeredTexture* Clone();
204 
214  virtual void TextureLayerComposition(FBTime pTime,FBTime pTimeInCurrentTimeRef, int pWidth, int pHeight);
215 
217  void SetLayerConfigDirty();
218 
221 };
222 
225 #define FBStorableCustomTextureImplementation(ClassName, Type)\
226  const char* ClassName::FbxGetObjectSubType(){ return #ClassName; }\
227  HIObject RegisterStorable##ClassName##Create(HIObject /*pOwner*/, const char* pName, void* /*pData*/){\
228  ClassName* Class = new ClassName(pName);\
229  Class->mAllocated = true;\
230  if( Class->FBCreate() ){\
231  return Class->GetHIObject();\
232  } else {\
233  delete Class;\
234  return NULL;}}\
235  FBLibraryModule(ClassName##Storable){\
236  FBString lGroup = "FbxStorable/";\
237  lGroup += #Type;\
238  FBRegisterObject(ClassName##R2, lGroup, #ClassName, "", RegisterStorable##ClassName##Create, true, NULL);\
239  FBSetStoreableCustomTextureRegistered();}\
240 
241 
242 #ifdef FBSDKUseNamespace
243 }
244 #endif
245 
246 #endif /* this must be the last line of this file */
FBPropertyAnimatableVector3d Rotation
Read Write Property: Rotation coordinates.
Definition: fbtexture.h:138
Shadow Map, work with model.
Definition: fbtexture.h:73
#define __FBClassDeclare(Name, Parent)
For internal use only.
Definition: fbcomponent.h:132
FBPropertyInt Height
Read Only Property: Height of texture.
Definition: fbtexture.h:133
FBPropertyAnimatableDouble Alpha
Read Write Property: Texture alpha value.
Definition: fbtexture.h:140
#define FB_DEFINE_COMPONENT(DllTag, Type)
Define a component and give it the ability to be a property.
Definition: fbproperties.h:139
FBPropertyAnimatableColorAndAlpha BackgroundColor
Read/Write Property: Animatable Background color which is used to clear color buffer before compositi...
Definition: fbtexture.h:219
Bump Normal Map, work with model.
Definition: fbtexture.h:77
Light Map, work with model.
Definition: fbtexture.h:74
FBPropertyAnimatableVector3d Translation
Read Write Property: Translation coordinates.
Definition: fbtexture.h:137
FBPropertyAnimatableVector3d Scaling
Read Write Property: Scaling coordinates.
Definition: fbtexture.h:139
class FBPropertyBaseAnimatable< double, kFBPT_double > FBPropertyAnimatableDouble
FBPropertyBaseAnimatableDouble type definition.
LayeredTexture class.
Definition: fbtexture.h:189
Sphere Reflexion Map, work with model.
Definition: fbtexture.h:76
PropertyList: Texture
Definition: fbtexture.h:158
class FBPropertyBaseAnimatable< FBColorAndAlpha, kFBPT_ColorRGBA > FBPropertyAnimatableColorAndAlpha
FBPropertyAnimatableColorAndAlpha type definition.
#define NULL
Definition: kaydara.h:169
FBVideo and derivative classes.
Spherical Reflexion Map, work with model.
Definition: fbtexture.h:75
Property classes.
class FBPropertyBaseEnum< enum FBTextureUseType > FBPropertyTextureUseType
Definition: fbtexture.h:105
Contains definitions for devices, boxes and models.
FBPropertyListTexture Layers
Read/Write Property: Textures Layers.
Definition: fbtexture.h:220
#define FB_DEFINE_ENUM(DllTag, Type)
Define an enum and give it the ability to be a property.
Definition: fbproperties.h:148
MotionBuilder SDK base class.
Definition: fbcomponent.h:668
class FBPropertyBaseEnum< enum FBTextureMapping > FBPropertyTextureMapping
Definition: fbtexture.h:106
FBPropertyInt TextureOGLId
Read Only: OpenGL texture buffer object Id.
Definition: fbtexture.h:146
#define FBSDK_DLL
Be sure that FBSDK_DLL is defined only once...
Definition: fbtexture.h:48
class FBPropertyBase< bool, kFBPT_bool > FBPropertyBool
Property: bool
class FBPropertyBaseComponent< FBVideo * > FBPropertyVideo
Definition: fbstory.h:76
FBPropertyVideo Video
Read Write Property: Media used for texturing.
Definition: fbtexture.h:144
FBTextureUseType
Texture Use Type.
Definition: fbtexture.h:70
Definition: Python-ast.h:18
PropertyList: Concrete class for PropertyList of component
Definition: fbcomponent.h:553
#define __FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
Definition: fbtypes.h:68
FBPropertyBool SwapUV
Read Write Property: Swap UV coordinates?
Definition: fbtexture.h:141
FBPropertyTextureBlendMode BlendMode
Read Write Property: Texture blend mode.
Definition: fbtexture.h:136
FBTextureBlendMode
Texture blend modes.
Definition: fbtexture.h:98
class FBPropertyBaseEnum< enum FBTextureBlendMode > FBPropertyTextureBlendMode
Definition: fbtexture.h:107
#define FBSDKNamespace
FBSDKNamespace define.
Definition: fbversion.h:64
Basic class definitions.
Time data structure.
Definition: fbtime.h:86
FBPropertyTextureUseType UseType
Read Write Property: Texture Use Type.
Definition: fbtexture.h:134
A box is a fundamental building block in the application architecture.
Definition: fbcore.h:218
Layer multiplication + brightness.
Definition: fbtexture.h:102
#define FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
Definition: fbtypes.h:62
Layer multiplication.
Definition: fbtexture.h:101
FBPropertyInt Width
Read Only Property: Width of texture.
Definition: fbtexture.h:132
class FBPropertyBase< int, kFBPT_int > FBPropertyInt
Property: int
standard color type, work with material.
Definition: fbtexture.h:72
FBTextureMapping
Texture mapping modes.
Definition: fbtexture.h:83
FBPropertyTextureMapping Mapping
Read Write Property: Texture mapping.
Definition: fbtexture.h:135
FBPropertyBool TakeBased
Read Write Property: A video is linked to a take, changing the take will change the connected video...
Definition: fbtexture.h:145
class FBPropertyBaseAnimatable< FBVector3d, kFBPT_Vector3D > FBPropertyAnimatableVector3d
FBPropertyAnimatableVector3D type definition.