Open Reality Reference Guide
fbmodelpath3d.h
Go to the documentation of this file.
1 #ifndef __FBMODEL_PATH3D_H__
2 #define __FBMODEL_PATH3D_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  #define FBSDK_DLL K_DLLIMPORT
47 #endif
48 
49 #include <fbsdk/fbcore.h>
50 #include <fbsdk/fbcomponent.h>
51 #include <fbsdk/fbmodel.h>
52 
53 #ifdef FBSDKUseNamespace
54  namespace FBSDKNamespace {
55 #endif
56 
58 // FBModelPath3D
61 
64 {
66 
67 public:
92  FBModelPath3D(const char* pName, HIObject pObject=NULL);
93 
96  {
98  eVector
99  };
100  typedef FBPropertyBaseEnum<EKeyPropertyBehavior> PropertyKeyPropertyBehavior;
101 
104  {
105  eArchitectural = 0,
106  eMI,
107  eCM,
108  eM,
109  eKM
110  };
111  typedef FBPropertyBaseEnum<ELengthUnitType> PropertyUnitType;
112 
115  {
116  eNone,
117  eArrow
118  };
119 
120  typedef FBPropertyBaseEnum<EPathEndCapStyle> PropertyPathEndCapStyle;
121 
133 
134  //--- Visual ------------------------------------------------------------------------------------------------------------------------
135 
139  void ShowCurveControls(bool pShow);
140 
144  void ShowCurvePoints(bool pShow);
145 
146 
147  //--- Key Manipulation --------------------------------------------------------------------------------------------------------------
152 
157  FBVector4d PathKeyGet(int pKeyIndex);
158 
164  void PathKeySet(int pKeyIndex, FBVector4d pTLocal, bool pUpdate=true);
165 
173  void PathKeySetLeftRightTangent(int pKeyIndex, FBVector4d pKeyTLocal, FBVector4d pLeftTangentTLocal, FBVector4d pRightTangentTLocal, bool pUpdate=true);
174 
178  void PathKeyRemove(int pKeyIndex);
179 
182  void PathKeyClear();
183 
184  //--- Tangent ----------------------------------------------------------------------------------------------------------------------
185 
191  void PathKeySetLeftTangent(int pKeyIndex, FBVector4d pTLocal, bool pUpdate=true);
192 
198  void PathKeySetRightTangent(int pKeyIndex, FBVector4d pTLocal, bool pUpdate=true);
199 
205 
211 
217  void PathKeySetXDerivative(int pKeyIndex, double pDerivative, bool pUpdate);
218 
224  void PathKeySetYDerivative(int pKeyIndex, double pDerivative, bool pUpdate);
225 
231  void PathKeySetZDerivative(int pKeyIndex, double pDerivative, bool pUpdate);
232 
238  void PathKeySetXYZDerivative(int pKeyIndex, FBVector4d pDerivative, bool pUpdate);
239 
245 
250  double PathKeyGetLeftTangentLength(int pKeyIndex);
251 
256  double PathKeyGetRightTangentLength(int pKeyIndex);
257 
258  //--- Path remove keys (editing) ----------------------------------------------------------------------------------------------------
259 
264 
268 
269  //--- Keys Helpers ------------------------------------------------------------------------------------------------------------------
270 
275 
280 
286 
291  int PathKeyEndAdd(FBVector4d pTLocal);
292 
298  int PathKeyInsertAfter(int pKeyIndex, FBVector4d pTLocal);
299 
300  //--- Animated Keys - Properties and Control Nodes ----------------------------------------------------------------------------------
301 
307 
313 
319  bool PathKeySetControlNode(int pKeyIndex, FBModel* pControlNode);
320 
325  int Total_IsPathKey(double pTotalPercent, FBEvaluateInfo* pEvaluateInfo=NULL);
326 
331  FBVector4d Total_GlobalPathEvaluate(double pTotalPercent, FBEvaluateInfo* pEvaluateInfo=NULL);
332 
337  FBVector4d Total_LocalPathEvaluate(double pTotalPercent, FBEvaluateInfo* pEvaluateInfo=NULL);
338 
343  FBVector4d Total_GlobalPathEvaluateDerivative(double pTotalPercent, FBEvaluateInfo* pEvaluateInfo=NULL);
344 
349  FBVector4d Total_LocalPathEvaluateDerivative(double pTotalPercent, FBEvaluateInfo* pEvaluateInfo=NULL);
350 
355  int Segment_IsPathKey(double pSegmentPercent, FBEvaluateInfo* pEvaluateInfo=NULL);
356 
361  FBVector4d Segment_GlobalPathEvaluate(double pSegmentPercent, FBEvaluateInfo* pEvaluateInfo=NULL);
362 
367  FBVector4d Segment_LocalPathEvaluate(double pSegmentPercent, FBEvaluateInfo* pEvaluateInfo=NULL);
368 
373  FBVector4d Segment_GlobalPathEvaluateDerivative(double pSegmentPercent, FBEvaluateInfo* pEvaluateInfo=NULL);
374 
379  FBVector4d Segment_LocalPathEvaluateDerivative(double pSegmentPercent, FBEvaluateInfo* pEvaluateInfo=NULL);
380 
381  //--- Key Type Converter ------------------------------------------------------------------------------------------------------------
382 
387  double ConvertTotalPercentToSegmentPercent(double pPercent, FBEvaluateInfo* pEvaluateInfo=NULL);
388 
393  double ConvertSegmentPercentToTotalPercent(double pPercent, FBEvaluateInfo* pEvaluateInfo=NULL);
394 
399 
404 
408 };
409 
410 #ifdef FBSDKUseNamespace
411 }
412 #endif
413 
414 #endif
AnimationNodeNotify evaluation information.
Model class.
Definition: fbmodel.h:274
Path 3D model class.
Definition: fbmodelpath3d.h:64
FBVector4d Total_GlobalPathEvaluateDerivative(double pTotalPercent, FBEvaluateInfo *pEvaluateInfo=NULL)
Get the path's derivative at a particular point within the curve, in global coordinates.
FBVector4d Total_LocalPathEvaluate(double pTotalPercent, FBEvaluateInfo *pEvaluateInfo=NULL)
Get the path's vector at a particular point within the curve, in local coordinates.
void PathKeySetXDerivative(int pKeyIndex, double pDerivative, bool pUpdate)
Set derivative in X coordinate for a path tangent.
FBPropertyColorAndAlpha TextBackground
Read Write Property: Path Length label display background color.
void PathKeyClear()
Clear the path keys.
void PathKeyRemoveSelected()
Remove the selected keys from the path.
FBVector4d Segment_LocalPathEvaluate(double pSegmentPercent, FBEvaluateInfo *pEvaluateInfo=NULL)
Get the path's vector at a particular point within the curve, in local coordinates.
int PathKeyInsertAfter(int pKeyIndex, FBVector4d pTLocal)
Adds a new key immediately after the specified key ID (with time gap of 1 sec).
int InsertNewEndKey()
Insert a new key at the end of the path.
void PathKeySetYDerivative(int pKeyIndex, double pDerivative, bool pUpdate)
Set derivative in Y coordinate for a path tangent.
void ShowCurveControls(bool pShow)
Enable or disable displaying Curve Controls for the 3D model path.
FBVector4d PathKeyGetXYZDerivative(int pKeyIndex)
Get vector in XYZ coordinates for a path tangent.
int PathKeyEndAdd(FBVector4d pTLocal)
Adds a new key to the end of the path (with time gap of 1 sec).
void PathKeySet(int pKeyIndex, FBVector4d pTLocal, bool pUpdate=true)
Set the local coordinate vector values for path at a particular key index.
void PathKeySetLeftRightTangent(int pKeyIndex, FBVector4d pKeyTLocal, FBVector4d pLeftTangentTLocal, FBVector4d pRightTangentTLocal, bool pUpdate=true)
Set path's vectors for key, left tangent and right tangent at a particular key index.
FBPropertyDouble PathLength
Read Only Property: Path Length In Centimeter.
void ShowCurvePoints(bool pShow)
Enable or disable displaying Curve Points for the 3D model path.
void UpdateGeometry()
Update path geometry explicitly.
FBVector4d Segment_GlobalPathEvaluate(double pSegmentPercent, FBEvaluateInfo *pEvaluateInfo=NULL)
Get the path's vector at a particular point within the curve, in global coordinates.
void PathKeyRemove(int pKeyIndex)
Remove key at a particular index.
FBVector4d PathKeyGet(int pKeyIndex)
Get path's key vector for at a particular key index.
double ConvertSegmentPercentToTotalPercent(double pPercent, FBEvaluateInfo *pEvaluateInfo=NULL)
Converting one key type Segment (time) to Total (percent).
FBPropertyString PathLengthInString
Read Only Property: Path Length Display String According To The Current Unit.
FBPropertyBool PathLengthShow
Read Write Property: Path length label display or not.
ELengthUnitType
Path Length Unit enum.
void PathKeySetXYZDerivative(int pKeyIndex, FBVector4d pDerivative, bool pUpdate)
Set derivative in XYZ coordinates for a path tangent.
double ConvertToTotalPercentFactor()
Get factor for multiplying the derivative of a key for total mode.
EKeyPropertyBehavior
Key property behavior.
Definition: fbmodelpath3d.h:96
@ eLegacyVector4
2014, 2015, 2016. Key property type is Vector4.
Definition: fbmodelpath3d.h:97
FBVector4d Total_GlobalPathEvaluate(double pTotalPercent, FBEvaluateInfo *pEvaluateInfo=NULL)
Get the path's vector at a particular point within the curve, in global coordinates.
void PathKeySetLeftTangent(int pKeyIndex, FBVector4d pTLocal, bool pUpdate=true)
Set path's key left tangent vector for designated index.
int Total_IsPathKey(double pTotalPercent, FBEvaluateInfo *pEvaluateInfo=NULL)
Query whether a percentage value has a key associated at that point in the path.
double PathKeyGetLeftTangentLength(int pKeyIndex)
Query the length of the left tangent.
FBPropertyDouble PathEndCapScale
Read Write Property: Path end cap display scale.
FBVector4d PathKeyGetRightTangent(int pKeyIndex)
Get the path key right tangent's vector value for designated index.
void PathKeySetRightTangent(int pKeyIndex, FBVector4d pTLocal, bool pUpdate=true)
Set 3D path's key right tangent vector for designated index.
int PathKeyStartAdd(FBVector4d pTLocal)
Adds a new key to the start of the path (with time gap of 1 sec).
FBVector4d Segment_GlobalPathEvaluateDerivative(double pSegmentPercent, FBEvaluateInfo *pEvaluateInfo=NULL)
Get the path's derivative at a particular point within the curve, in global coordinates.
double PathKeyGetRightTangentLength(int pKeyIndex)
Query the value of the right tangent.
FBProperty * PathKeyGetProperty(int pKeyIndex)
Get the path key's corresponding property.
int PathKeyGetCount()
Query the number of keys present in the path.
void PathKeySetZDerivative(int pKeyIndex, double pDerivative, bool pUpdate)
Set derivative in Z coordinate for a path tangent.
FBVector4d PathKeyGetLeftTangent(int pKeyIndex)
Get the path key left tangent's vector value for designated index.
int Segment_IsPathKey(double pSegmentPercent, FBEvaluateInfo *pEvaluateInfo=NULL)
Query whether a percentage value has a key associated at that point in the path.
EPathEndCapStyle
Path end cap style enum.
PropertyUnitType PathLengthUnit
Read Write Property: Path Length Unit.
FBPropertyAnimatableColor Color
Read Write Property: Path display color in viewport.
FBVector4d Segment_LocalPathEvaluateDerivative(double pSegmentPercent, FBEvaluateInfo *pEvaluateInfo=NULL)
Get the path's derivative at a particular point within the curve, in local coordinates.
double ConvertToSegmentPercentFactor()
Get factor for multiplying the derivative of a key for segment mode.
int InsertNewStartKey()
Insert a new key at the start of the path.
FBPropertyBool AutoControlNode
Read Write Property: Automatically create key control nodes.
double ConvertTotalPercentToSegmentPercent(double pPercent, FBEvaluateInfo *pEvaluateInfo=NULL)
Converting one key type Total (percent) to Segment (time).
PropertyKeyPropertyBehavior KeyPropertyBehavior
Read Only Property: Key property behavior.
int GetSelectedPathKeyCount()
Query the number of keys present in the selected path.
FBPropertyDouble TextScale
Read Write Property: Path Length label display scale.
PropertyPathEndCapStyle PathEndCapStyle
Read Write Property: Path end cap display style.
FBModel * PathKeyGetControlNode(int pKeyIndex)
Get the path key's control node.
FBVector4d Total_LocalPathEvaluateDerivative(double pTotalPercent, FBEvaluateInfo *pEvaluateInfo=NULL)
Get the path's derivative at a particular point within the curve, in local coordinates.
FBModelPath3D(const char *pName, HIObject pObject=NULL)
Constructor.
bool PathKeySetControlNode(int pKeyIndex, FBModel *pControlNode)
Set the path key's control node.
Property: Base property class.
Definition: fbproperties.h:195
Property class: const char * (String).
Basic class definitions.
#define __FBClassDeclare(Name, Parent)
For internal use only.
Definition: fbcomponent.h:131
#define FBSDK_DLL
Be sure that FBSDK_DLL is defined only once...
Contains definitions for devices, boxes and models.
Base class for Cameras.
class K_DLLIMPORT FBPropertyBaseAnimatable< FBColor, kFBPT_ColorRGB > FBPropertyAnimatableColor
FBPropertyAnimatableColor type definition.
class K_DLLIMPORT FBPropertyBase< FBColorAndAlpha, kFBPT_ColorRGBA > FBPropertyColorAndAlpha
FBPropertyColorAndAlpha type definition.
class K_DLLIMPORT FBPropertyBase< bool, kFBPT_bool > FBPropertyBool
Property: bool
class K_DLLIMPORT FBPropertyBase< double, kFBPT_double > FBPropertyDouble
Property: double
#define __FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
Definition: fbtypes.h:68
class K_DLLIMPORT FBVector4< double > FBVector4d
4D vector
Definition: fbtypes.h:441