fbsdk/fbmodelpath3d.h Source File
 
 
 
fbsdk/fbmodelpath3d.h
Go to the documentation of this file.
00001 #ifndef __FBMODEL_PATH3D_H__
00002 #define __FBMODEL_PATH3D_H__
00003 /**************************************************************************
00004  Copyright (c) 1994 - 2009 Autodesk, Inc. and/or its licensors.
00005  All Rights Reserved.
00006  
00007  The coded instructions, statements, computer programs, and/or related 
00008  material (collectively the "Data") in these files contain unpublished 
00009  information proprietary to Autodesk, Inc. and/or its licensors, which is 
00010  protected by Canada and United States of America federal copyright law 
00011  and by international treaties.
00012  
00013  The Data may not be disclosed or distributed to third parties, in whole 
00014  or in part, without the prior written consent of Autodesk, Inc. 
00015  ("Autodesk").
00016  
00017  THE DATA IS PROVIDED "AS IS" AND WITHOUT WARRANTY.
00018  ALL WARRANTIES ARE EXPRESSLY EXCLUDED AND DISCLAIMED. AUTODESK MAKES NO 
00019  WARRANTY OF ANY KIND WITH RESPECT TO THE DATA, EXPRESS, IMPLIED OR 
00020  ARISING BY CUSTOM OR TRADE USAGE, AND DISCLAIMS ANY IMPLIED WARRANTIES 
00021  OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR 
00022  PURPOSE OR USE. WITHOUT LIMITING THE FOREGOING, AUTODESK DOES NOT 
00023  WARRANT THAT THE OPERATION OF THE DATA WILL BE UNINTERRUPTED OR ERROR 
00024  FREE.
00025  
00026  IN NO EVENT SHALL AUTODESK, ITS AFFILIATES, PARENT COMPANIES, LICENSORS 
00027  OR SUPPLIERS ("AUTODESK GROUP") BE LIABLE FOR ANY LOSSES, DAMAGES OR 
00028  EXPENSES OF ANY KIND (INCLUDING WITHOUT LIMITATION PUNITIVE OR MULTIPLE 
00029  DAMAGES OR OTHER SPECIAL, DIRECT, INDIRECT, EXEMPLARY, INCIDENTAL, LOSS 
00030  OF PROFITS, REVENUE OR DATA, COST OF COVER OR CONSEQUENTIAL LOSSES OR 
00031  DAMAGES OF ANY KIND), HOWEVER CAUSED, AND REGARDLESS OF THE THEORY OF 
00032  LIABILITY, WHETHER DERIVED FROM CONTRACT, TORT (INCLUDING, BUT NOT 
00033  LIMITED TO, NEGLIGENCE), OR OTHERWISE, ARISING OUT OF OR RELATING TO THE 
00034  DATA OR ITS USE OR ANY OTHER PERFORMANCE, WHETHER OR NOT AUTODESK HAS 
00035  BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS OR DAMAGE.
00036  
00037 **************************************************************************/
00038 
00043 #include <kaydaradef.h>
00044 
00045 #ifndef FBSDK_DLL 
00046     #define FBSDK_DLL K_DLLIMPORT
00047 #endif
00048 
00049 #include <fbsdk/fbcore.h>
00050 #include <fbsdk/fbcomponent.h>
00051 #include <fbsdk/fbmodel.h>
00052 
00053 #ifdef FBSDKUseNamespace
00054     namespace FBSDKNamespace {
00055 #endif
00056 
00058 // FBModelPath3D
00060 __FB_FORWARD( FBModelPath3D );
00061 
00063 class FBSDK_DLL FBModelPath3D : public FBModel
00064 {
00065     __FBClassDeclare(FBModelPath3D, FBModel);
00066 
00067 public:
00090     FBModelPath3D(const char* pName, HIObject pObject=NULL);
00091 
00093     enum ELengthUnitType 
00094     {
00095         eArchitectural = 0,
00096         eMI,
00097         eCM,
00098         eM,
00099         eKM
00100     };
00101     typedef FBPropertyBaseEnum<ELengthUnitType> PropertyUnitType;
00102 
00104     enum EPathEndCapStyle
00105     {
00106         eNone, 
00107         eArrow
00108     };
00109 
00110     typedef FBPropertyBaseEnum<EPathEndCapStyle> PropertyPathEndCapStyle;  
00111 
00112     FBPropertyDouble PathLength;                
00113     FBPropertyString PathLengthInString;        
00114     PropertyUnitType PathLengthUnit;            
00115     FBPropertyBool   PathLengthShow;            
00116     FBPropertyDouble TextScale;                 
00117     FBPropertyColorAndAlpha TextBackground;     
00118     PropertyPathEndCapStyle PathEndCapStyle;    
00119     FBPropertyDouble PathEndCapScale;           
00120     FBPropertyAnimatableColor Color;            
00121 
00122     //--- Visual ------------------------------------------------------------------------------------------------------------------------
00123 
00127     void        ShowCurveControls(bool pShow);
00128 
00132     void        ShowCurvePoints(bool pShow);
00133 
00134 
00135     //--- Key Manipulation --------------------------------------------------------------------------------------------------------------
00139     int         PathKeyGetCount();
00140 
00145     FBVector4d  PathKeyGet(int pKeyIndex);
00146 
00152     void        PathKeySet(int pKeyIndex, FBVector4d pTLocal, bool pUpdate=true);
00153 
00161     void        PathKeySetLeftRightTangent(int pKeyIndex, FBVector4d pKeyTLocal, FBVector4d pLeftTangentTLocal, FBVector4d pRightTangentTLocal, bool pUpdate=true); 
00162 
00166     void        PathKeyRemove(int pKeyIndex);
00167 
00170     void        PathKeyClear();
00171 
00172     //--- Tangent ----------------------------------------------------------------------------------------------------------------------
00173 
00179     void        PathKeySetLeftTangent(int pKeyIndex, FBVector4d pTLocal, bool pUpdate=true);
00180 
00186     void        PathKeySetRightTangent(int pKeyIndex, FBVector4d pTLocal, bool pUpdate=true);
00187 
00192     FBVector4d  PathKeyGetLeftTangent(int pKeyIndex);
00193 
00198     FBVector4d  PathKeyGetRightTangent(int pKeyIndex);
00199 
00205     void        PathKeySetXDerivative(int pKeyIndex, double pDerivative, bool pUpdate);
00206 
00212     void        PathKeySetYDerivative(int pKeyIndex, double pDerivative, bool pUpdate);
00213 
00219     void        PathKeySetZDerivative(int pKeyIndex, double pDerivative, bool pUpdate);
00220 
00226     void        PathKeySetXYZDerivative(int pKeyIndex, FBVector4d pDerivative, bool pUpdate);
00227 
00232     FBVector4d  PathKeyGetXYZDerivative(int pKeyIndex);
00233 
00238     double      PathKeyGetLeftTangentLength(int pKeyIndex);
00239 
00244     double      PathKeyGetRightTangentLength(int pKeyIndex);
00245 
00246     //--- Path remove keys (editing) ----------------------------------------------------------------------------------------------------
00247 
00251     int         GetSelectedPathKeyCount();
00252 
00255     void        PathKeyRemoveSelected();
00256 
00257     //--- Keys Helpers ------------------------------------------------------------------------------------------------------------------
00258 
00262     int        InsertNewStartKey();
00263 
00267     int        InsertNewEndKey();
00268 
00273     int        PathKeyStartAdd(FBVector4d pTLocal);
00274 
00279     int        PathKeyEndAdd(FBVector4d pTLocal);
00280 
00281     //--- Curve -------------------------------------------------------------------------------------------------------------------------
00288     int        Total_PathKeyAdd(double pTotalPercent, FBVector4d pTLocal);
00289 
00294     int        Total_IsPathKey(double pTotalPercent);
00295 
00300     FBVector4d Total_GlobalPathEvaluate(double pTotalPercent);
00301 
00306     FBVector4d Total_LocalPathEvaluate(double pTotalPercent);
00307 
00312     FBVector4d Total_GlobalPathEvaluateDerivative(double pTotalPercent);
00313 
00318     FBVector4d Total_LocalPathEvaluateDerivative(double pTotalPercent);
00319 
00326     int        Segment_PathKeyAdd(double pSegmentPercent, FBVector4d pTLocal);
00327 
00332     int        Segment_IsPathKey(double pSegmentPercent);
00333 
00338     FBVector4d Segment_GlobalPathEvaluate(double pSegmentPercent);
00339 
00344     FBVector4d Segment_LocalPathEvaluate(double pSegmentPercent);
00345 
00350     FBVector4d Segment_GlobalPathEvaluateDerivative(double pSegmentPercent);
00351 
00356     FBVector4d Segment_LocalPathEvaluateDerivative(double pSegmentPercent);
00357 
00358     //--- Key Type Converter ------------------------------------------------------------------------------------------------------------
00359 
00364     double     ConvertTotalPercentToSegmentPercent(double pPercent);
00365 
00370     double     ConvertSegmentPercentToTotalPercent(double pPercent);
00371 
00375     double     ConvertToSegmentPercentFactor();
00376 
00380     double     ConvertToTotalPercentFactor();
00381     
00384     void      UpdateGeometry();
00385 };
00386 
00387 #ifdef FBSDKUseNamespace
00388 }
00389 #endif
00390 
00391 #endif