Envelopes.h
Go to the documentation of this file.
1 /*--------------------------------------------------------------------------------------+
2 |
3 | Supplied under applicable software license agreement.
4 |
5 | Copyright (c) 2018 Bentley Systems, Incorporated. All rights reserved.
6 |
7 +---------------------------------------------------------------------------------------*/
8 #pragma once
9 
13 #ifndef DOCUMENTATION_GENERATOR
14 
15 #if defined (__ANIMATOR_BUILD__)
16 # define __ANIMATOR_DECLSPEC__ __declspec(dllexport)
17 #else
18 # define __ANIMATOR_DECLSPEC__ __declspec(dllimport)
19 #endif
20 
21 #define ANIMATOR_EXPORTED __ANIMATOR_DECLSPEC__
22 
23 #else
24 
25 #define ANIMATOR_EXPORTED
26 
27 #endif
28 
29 
30 #include "TimeInterval.h"
31 #include "float.h"
32 #include "limits.h"
33 
34 
36 
37 static const double ENVELOPE_NoDouble = DBL_MIN;
38 static const Int32 ENVELOPE_NoInt = INT_MIN;
39 static const TimeVal ENVELOPE_NoTime = (TIME_Min + 1);
40 static const DPoint4d ENVELOPE_NoQuat = {1.0, 1.0, 1.0, 1.0};
41 static const WString ENVELOPE_NoStr = L"Invalid String";
42 
43 /*=================================================================================**/
49  {
64  };
65 
66 /*=================================================================================**/
71 {
72 public:
74 
76  ANIMATOR_EXPORTED void InitDefaults ();
77 
81  ANIMATOR_EXPORTED BentleyStatus Copy (KeyDoubleValueCR rhs);
82 
86  ANIMATOR_EXPORTED bool Equals (KeyDoubleValueCR rhs) const;
87 
91  ANIMATOR_EXPORTED void SetX (TimeVal x);
92 
96  ANIMATOR_EXPORTED void SetY (double y);
97 
101  ANIMATOR_EXPORTED TimeVal GetX () const;
102 
106  ANIMATOR_EXPORTED double GetY () const;
107 
108 };
109 
110 /*=================================================================================**/
115 {
116 public:
118 
120  ANIMATOR_EXPORTED void InitDefaults ();
121 
125  ANIMATOR_EXPORTED BentleyStatus Copy (KeyIntValueCR rhs);
126 
130  ANIMATOR_EXPORTED bool Equals (KeyIntValueCR rhs) const;
131 
135  ANIMATOR_EXPORTED void SetX (TimeVal x);
136 
140  ANIMATOR_EXPORTED void SetY (Int32 y);
141 
145  ANIMATOR_EXPORTED TimeVal GetX () const;
146 
150  ANIMATOR_EXPORTED Int32 GetY () const;
151 };
152 
153 /*=================================================================================**/
158 {
159 public:
161 
163  ANIMATOR_EXPORTED void InitDefaults ();
164 
168  ANIMATOR_EXPORTED BentleyStatus Copy (KeyTimeValueCR rhs);
169 
173  ANIMATOR_EXPORTED bool Equals (KeyTimeValueCR rhs) const;
174 
178  ANIMATOR_EXPORTED void SetX (TimeVal x);
179 
183  ANIMATOR_EXPORTED void SetY (TimeVal y);
184 
188  ANIMATOR_EXPORTED TimeVal GetX () const;
189 
193  ANIMATOR_EXPORTED TimeVal GetY () const;
194 };
195 
196 
197 /*=================================================================================**/
202 {
203 public:
205 
207  ANIMATOR_EXPORTED void InitDefaults ();
208 
212  ANIMATOR_EXPORTED BentleyStatus Copy (KeyQuaternionValueCR rhs);
213 
217  ANIMATOR_EXPORTED bool Equals (KeyQuaternionValueCR rhs) const;
218 
222  ANIMATOR_EXPORTED void SetX (TimeVal x);
223 
227  ANIMATOR_EXPORTED void SetY (DPoint4dCR y);
228 
232  ANIMATOR_EXPORTED TimeVal GetX () const;
233 
237  ANIMATOR_EXPORTED DPoint4dCR GetY () const;
238 };
239 
240 /*=================================================================================**/
245 {
246 public:
248 
250  ANIMATOR_EXPORTED void InitDefaults ();
251 
255  ANIMATOR_EXPORTED BentleyStatus Copy (KeyWStringValueCR rhs);
256 
260  ANIMATOR_EXPORTED bool Equals (KeyWStringValueCR rhs) const;
261 
265  ANIMATOR_EXPORTED void SetX (TimeVal x);
266 
270  ANIMATOR_EXPORTED void SetY (WStringCR y);
271 
275  ANIMATOR_EXPORTED TimeVal GetX () const;
276 
280  ANIMATOR_EXPORTED WStringCR GetY () const;
281 };
282 
283 /*=================================================================================**/
288  {
291  };
292 
294 
295 /*=================================================================================**/
300 {
301 public:
302 
306  ANIMATOR_EXPORTED BentleyStatus Copy (VelocityDataCR rhs);
307 
311  ANIMATOR_EXPORTED bool Equals (VelocityDataCR rhs) const;
312 
316  ANIMATOR_EXPORTED VelocityDataType GetType () const;
317 
320  ANIMATOR_EXPORTED void SetType (VelocityDataType type);
321 
322 };
323 
324 
325 /*=================================================================================**/
330 {
332 public:
333 
335  ANIMATOR_EXPORTED void InitDefaults ();
336 
338  ANIMATOR_EXPORTED void InitConstant ();
339 
341  ANIMATOR_EXPORTED void InitAccelerate ();
342 
344  ANIMATOR_EXPORTED void InitDecelerate ();
345 
347  ANIMATOR_EXPORTED void InitAccelerateDecelerate ();
348 
352  ANIMATOR_EXPORTED BentleyStatus Copy (VelocityDataCR rhs);
353 
357  ANIMATOR_EXPORTED bool Equals (VelocityDataCR rhs) const;
358 
362  ANIMATOR_EXPORTED void AddArray (bvector<DPoint3d> const& pts);
363 
367  ANIMATOR_EXPORTED bvector<DPoint3d> const& GetArray () const;
368 
372  ANIMATOR_EXPORTED void Add (DPoint3dCR pt);
373 
376  ANIMATOR_EXPORTED bool IsValid () const;
377 
379  ANIMATOR_EXPORTED void Validate ();
380 
385  ANIMATOR_EXPORTED double ComputeBezierY (double tVal) const;
386 
389  ANIMATOR_EXPORTED static VelocityDataPtr Create ();
390 };
391 
392 /*=================================================================================**/
397 {
398 public:
400  ANIMATOR_EXPORTED explicit KeyComponent (AnimatorVelocity velocity);
401 
403  ANIMATOR_EXPORTED void InitDefaults ();
404 
407  ANIMATOR_EXPORTED VelocityDataCP GetData () const;
408 
411  ANIMATOR_EXPORTED VelocityDataP GetDataP ();
412 
416  ANIMATOR_EXPORTED BentleyStatus Copy (KeyComponentCR rhs);
417 
421  ANIMATOR_EXPORTED bool Equals (KeyComponentCR rhs) const;
422 
424  ANIMATOR_EXPORTED void DeleteData ();
425 
429  ANIMATOR_EXPORTED VelocityDataP AddData (VelocityDataType type);
430 
434  ANIMATOR_EXPORTED AnimatorVelocity GetVelocityType () const;
435 
439  ANIMATOR_EXPORTED void SetVelocityType (AnimatorVelocity velType);
440 
445 
449  ANIMATOR_EXPORTED void SetElementId (Bentley::DgnPlatform::ElementId elId);
450 };
451 
452 /*=================================================================================**/
457 {
459 public:
461 
463  ANIMATOR_EXPORTED void InitDefaults ();
464 
467  ANIMATOR_EXPORTED KeyDoubleValueCR GetKeyValue () const;
468 
471  ANIMATOR_EXPORTED KeyDoubleValueR GetKeyValueR ();
472 };
473 
474 /*=================================================================================**/
479 {
480 public:
481 
486  ANIMATOR_EXPORTED bool operator() (KeyDoubleComponentCR l, KeyDoubleComponentCR r) const;
487 };
488 
489 typedef bset<KeyDoubleComponent, KeyDoubleComponentComparator> KeyDoubleComponentSet;
494 
495 /*=================================================================================**/
500 {
502 public:
504 
506  ANIMATOR_EXPORTED void InitDefaults ();
507 
510  ANIMATOR_EXPORTED KeyIntValueCR GetKeyValue () const;
511 
514  ANIMATOR_EXPORTED KeyIntValueR GetKeyValueR ();
515 };
516 
517 /*=================================================================================**/
522 {
523 public:
524 
529 ANIMATOR_EXPORTED bool operator() (KeyIntComponentCR l, KeyIntComponentCR r) const;
530 };
531 
532 typedef bset<KeyIntComponent, KeyIntComponentComparator> KeyIntComponentSet;
537 
538 /*=================================================================================**/
543 {
545 public:
547 
549  ANIMATOR_EXPORTED void InitDefaults ();
550 
551  ANIMATOR_EXPORTED KeyQuaternionValueCR GetKeyValue () const;
552 
555  ANIMATOR_EXPORTED KeyQuaternionValueR GetKeyValueR ();
556 };
557 
558 /*=================================================================================**/
563 {
564 public:
565 
570 ANIMATOR_EXPORTED bool operator() (KeyQuaternionComponentCR l, KeyQuaternionComponentCR r) const;
571 };
572 
573 typedef bset<KeyQuaternionComponent, KeyQuaternionComponentComparator> KeyQuaternionComponentSet;
578 
579 
580 /*=================================================================================**/
585 {
587 public:
589 
591  ANIMATOR_EXPORTED void InitDefaults ();
592 
595  ANIMATOR_EXPORTED KeyWStringValueCR GetKeyValue () const;
596 
599  ANIMATOR_EXPORTED KeyWStringValueR GetKeyValueR ();
600 };
601 
602 /*=================================================================================**/
607 {
608 public:
609 
614 ANIMATOR_EXPORTED bool operator() (KeyWStringComponentCR l, KeyWStringComponentCR r) const;
615 };
616 
617 typedef bset<KeyWStringComponent, KeyWStringComponentComparator> KeyWStringComponentSet;
622 
623 
624 /*=================================================================================**/
629 {
631 public:
633 
635  ANIMATOR_EXPORTED void InitDefaults ();
636 
639  ANIMATOR_EXPORTED KeyTimeValueCR GetKeyValue () const;
640 
643  ANIMATOR_EXPORTED KeyTimeValueR GetKeyValueR ();
644 };
645 
646 /*=================================================================================**/
651 {
652 public:
653 
658 ANIMATOR_EXPORTED bool operator() (KeyTimeComponentCR l, KeyTimeComponentCR r) const;
659 };
660 
661 typedef bset<KeyTimeComponent, KeyTimeComponentComparator> KeyTimeComponentSet;
666 
667 
668 /*=================================================================================**/
673 {
674 public:
675  //=======================================================================================
676  // Defines an enumerator for the end behavior of the envelope
677  // @bsiclass Bentley Systems
678  //=======================================================================================
680  {
681  ENDBEHAVIOR_Reset = 0,
682  ENDBEHAVIOR_Constant = 1,
683  ENDBEHAVIOR_Repeat = 2,
684  ENDBEHAVIOR_Oscillate = 3,
685  ENDBEHAVIOR_OffsetRepeat = 4,
686  ENDBEHAVIOR_Linear = 5,
687  ENDBEHAVIOR_None = 6,
688  };
689 
693  ANIMATOR_EXPORTED EndBehavior GetPreBehavior () const;
694 
698  ANIMATOR_EXPORTED EndBehavior GetPostBehavior () const;
699 
702  ANIMATOR_EXPORTED UInt32 GetTaskId () const;
703 
707  ANIMATOR_EXPORTED bool HasComponentAtTime (TimeVal t) const;
708 
712  ANIMATOR_EXPORTED TimeVal GetResetPreTime () const;
713 
717  ANIMATOR_EXPORTED TimeVal GetResetPostTime () const;
718 
719 
723  ANIMATOR_EXPORTED bool Equals (KeyComponentEnvelopeCR rhs) const;
724 
731  ANIMATOR_EXPORTED BentleyStatus InterpolationData (KeyComponentCP* lhs, KeyComponentCP* rhs, double& interp, TimeVal t) const;
732 
736  ANIMATOR_EXPORTED TimeInterval GetDuration (bool ignoreEndBehavior) const;
737 
741  ANIMATOR_EXPORTED BentleyStatus Serialize (DataExternalizer& out) const;
742 };
743 
745 
746 /*=================================================================================**/
751 {
753 
754 
755  ANIMATOR_EXPORTED KeyDoubleComponentSetCR GetComponents () const;
757 
760  ANIMATOR_EXPORTED bool HasLimits () const;
761 
764  ANIMATOR_EXPORTED double GetLowerLimit () const;
765 
768  ANIMATOR_EXPORTED double GetUpperLimit () const;
769 
772  ANIMATOR_EXPORTED double GetInitialValue () const;
773 
776  ANIMATOR_EXPORTED double GetResetValue () const;
777 
778 
782  ANIMATOR_EXPORTED double Interpolate (TimeVal t) const;
783 
787  ANIMATOR_EXPORTED double CubicInterpolate (TimeVal t) const;
788 };
789 
791 
792 /*=================================================================================**/
797 {
799 
800 
801  ANIMATOR_EXPORTED KeyIntComponentSetCR GetComponents () const;
803 
806  ANIMATOR_EXPORTED bool HasLimits () const;
807 
810  ANIMATOR_EXPORTED Int32 GetLowerLimit () const;
811 
814  ANIMATOR_EXPORTED Int32 GetUpperLimit () const;
815 
818  ANIMATOR_EXPORTED Int32 GetInitialValue () const ;
819 
823  ANIMATOR_EXPORTED Int32 GetResetValue () const;
824 
828  ANIMATOR_EXPORTED void SetResetValue (Int32 value);
829 
833  ANIMATOR_EXPORTED Int32 Interpolate (TimeVal t) const;
834 
838  ANIMATOR_EXPORTED Int32 InterpolateAsBoolean (TimeVal t) const;
839 
843 
844 };
845 
847 
848 /*=================================================================================**/
853 {
855 
856 
857  ANIMATOR_EXPORTED Int32 GetInitialValue () const ;
859 
865  ANIMATOR_EXPORTED WStringR Increment (WStringR file, TimeVal t, Int32 frameNumber) const;
866 
870 };
871 
873 
874 /*=================================================================================**/
879 {
881 
882 
883  ANIMATOR_EXPORTED KeyTimeComponentSetCR GetComponents () const;
885 
888  ANIMATOR_EXPORTED bool HasLimits () const;
889 
892  ANIMATOR_EXPORTED TimeVal GetLowerLimit () const;
893 
896  ANIMATOR_EXPORTED TimeVal GetUpperLimit () const;
897 
901  ANIMATOR_EXPORTED bool HasChangedForTime (TimeVal t) const;
902 
905  ANIMATOR_EXPORTED TimeVal GetInitialValue () const ;
906 
910  ANIMATOR_EXPORTED TimeVal GetResetValue () const;
911 
915  ANIMATOR_EXPORTED void SetResetValue (TimeVal value);
916 
920  ANIMATOR_EXPORTED TimeVal Interpolate (TimeVal t) const;
921 };
922 
924 
925 
926 /*=================================================================================**/
931 {
933 
934 
935  ANIMATOR_EXPORTED DPoint4dR GetInitialValue (DPoint4dR pt) const;
938 
943  ANIMATOR_EXPORTED DPoint4dR GetResetValue (DPoint4dR pt) const;
944 
948  ANIMATOR_EXPORTED void SetResetValue (DPoint4dCR pt);
949 
952  ANIMATOR_EXPORTED KeyQuaternionComponentSetCR GetComponents () const;
953 
958  ANIMATOR_EXPORTED DPoint4dR Interpolate (DPoint4dR pt, TimeVal t) const;
959 
964  ANIMATOR_EXPORTED DPoint4dR CubicInterpolate (DPoint4dR pt, TimeVal t) const;
965 };
966 
967 
969 
970 /*=================================================================================**/
975 {
977 
978 
979 
980  ANIMATOR_EXPORTED WStringR GetInitialValue (WStringR str) const;
983 
988  ANIMATOR_EXPORTED WStringR GetResetValue (WStringR str) const;
989 
993  ANIMATOR_EXPORTED void SetResetValue (WStringCR str);
994 
997  ANIMATOR_EXPORTED KeyWStringComponentSetCR GetComponents () const;
998 
1003  ANIMATOR_EXPORTED WStringR Interpolate (WStringR str, TimeVal t) const;
1004 };
1005 
1006 
1010 
RefCountedPtr< struct KeyIntComponentEnvelope > KeyIntComponentEnvelopePtr
Definition: Envelopes.h:790
KeyIntComponentSet * KeyIntComponentSetP
Definition: Envelopes.h:533
An element was added to the file.
#define ANIMATOR_EXPORTED
Definition: Envelopes.h:25
KeyTimeComponentSet const * KeyTimeComponentSetCP
Definition: Envelopes.h:663
#define END_BENTLEY_MSTNPLATFORM_NAMESPACE
Definition: DgnPlatform.h:30
Defines a comparing operator for KeyIntComponent.
Definition: Envelopes.h:521
Int64 TimeVal
Definition: TimeInterval.h:11
Defines a comparing operator for KeyDoubleComponent.
Definition: Envelopes.h:478
KeyQuaternionComponentSet & KeyQuaternionComponentSetR
Definition: Envelopes.h:576
A TiemVal type key component with relative operations.
Definition: Envelopes.h:628
Defines a pair value with DPoint4d and TimeVal.
Definition: Envelopes.h:201
Defines a class of velocity data with relative operations.
Definition: Envelopes.h:299
struct Bentley::WString const & WStringCR
Definition: Bentley.h:239
Animate script entry using a deceleration.
Definition: Envelopes.h:57
Defines a pair value with WString and TimeVal.
Definition: Envelopes.h:244
KeyTimeComponentSet & KeyTimeComponentSetR
Definition: Envelopes.h:664
#define TIME_Min
Definition: TimeInterval.h:28
KeyWStringComponentSet const & KeyWStringComponentSetCR
Definition: Envelopes.h:621
bset< KeyWStringComponent, KeyWStringComponentComparator > KeyWStringComponentSet
Definition: Envelopes.h:617
Defines a pair value with double and TimeVal.
Definition: Envelopes.h:70
KeyTimeComponentSet const & KeyTimeComponentSetCR
Definition: Envelopes.h:665
#define BEGIN_BENTLEY_MSTNPLATFORM_NAMESPACE
Definition: DgnPlatform.h:29
Defines an envelope class of KeyTimeComponent with relative operations.
Definition: Envelopes.h:878
KeyDoubleComponentSet const * KeyDoubleComponentSetCP
Definition: Envelopes.h:491
Defines a comparing operator for KeyTimeComponent.
Definition: Envelopes.h:650
bset< KeyDoubleComponent, KeyDoubleComponentComparator > KeyDoubleComponentSet
Definition: Envelopes.h:489
Defines an envelope class of KeyComponent with relative operations.
Definition: Envelopes.h:672
Velocity value has no meaning in the instance of its use.
Definition: Envelopes.h:51
A quaternion type key component with relative operations.
Definition: Envelopes.h:542
Animate script entry using Custom velocity defined by the user.
Definition: Envelopes.h:63
KeyIntComponentSet const * KeyIntComponentSetCP
Definition: Envelopes.h:534
bset< KeyQuaternionComponent, KeyQuaternionComponentComparator > KeyQuaternionComponentSet
Definition: Envelopes.h:573
KeyWStringComponentSet & KeyWStringComponentSetR
Definition: Envelopes.h:620
Defines an component envelope class of key file increment component with relative operations...
Definition: Envelopes.h:852
uint32_t UInt32
Definition: Bentley.r.h:128
4d point coordinates.
Definition: dpoint4d.h:17
An int type key component with relative operations.
Definition: Envelopes.h:499
Animate script entry using an acceleration.
Definition: Envelopes.h:55
EndBehavior
Definition: Envelopes.h:679
RefCountedPtr< struct KeyTimeComponentEnvelope > KeyTimeComponentEnvelopePtr
Definition: Envelopes.h:872
RefCountedPtr< struct VelocityData > VelocityDataPtr
Definition: Envelopes.h:293
Defines a comparing operator for KeyQuaternionComponent.
Definition: Envelopes.h:562
KeyDoubleComponentSet & KeyDoubleComponentSetR
Definition: Envelopes.h:492
Defines a pair value with TimeVal.
Definition: Envelopes.h:157
Defines a class of key component with relative operations.
Definition: Envelopes.h:396
KeyIntComponentSet const & KeyIntComponentSetCR
Definition: Envelopes.h:536
Defines an envelope class of KeyIntComponent with relative operations.
Definition: Envelopes.h:796
BentleyStatus
Definition: Bentley.h:208
int32_t Int32
Definition: Bentley.r.h:119
bset< KeyIntComponent, KeyIntComponentComparator > KeyIntComponentSet
Definition: Envelopes.h:532
AnimatorVelocity
Anything which is animatable can have a velocity.
Definition: Envelopes.h:48
KeyTimeComponentSet * KeyTimeComponentSetP
Definition: Envelopes.h:662
A shared pointer template for reference-counted objects.
Definition: RefCounted.h:119
A WString type key component with relative operations.
Definition: Envelopes.h:584
RefCountedPtr< struct KeyWStringComponentEnvelope > KeyWStringComponentEnvelopePtr
Definition: Envelopes.h:968
Base class to make a class non-copyable.
Definition: NonCopyableClass.h:23
KeyQuaternionComponentSet const * KeyQuaternionComponentSetCP
Definition: Envelopes.h:575
RefCountedPtr< struct KeyQuaternionComponentEnvelope > KeyQuaternionComponentEnvelopePtr
Definition: Envelopes.h:923
Defines an envelope class of KeyWStringComponent with relative operations.
Definition: Envelopes.h:974
Animate script entry using Infinite velocity.
Definition: Envelopes.h:61
#define DEFINE_T_SUPER(B)
Definition: Bentley.h:167
Defines the struct of time interval which will be used for Animation module.
Definition: TimeInterval.h:45
Defines an envelope class of KeyDoubleComponent with relative operations.
Definition: Envelopes.h:750
Animate script entry using Constant velocity.
Definition: Envelopes.h:53
KeyIntComponentSet & KeyIntComponentSetR
Definition: Envelopes.h:535
Concrete class that can be used to implement the reference-counting pattern.
Definition: RefCounted.h:109
bset< KeyTimeComponent, KeyTimeComponentComparator > KeyTimeComponentSet
Definition: Envelopes.h:661
UInt64 ElementId
Definition: DgnPlatformBaseType.r.h:83
RefCountedPtr< struct KeyDoubleComponentEnvelope > KeyDoubleComponentEnvelopePtr
Definition: Envelopes.h:744
Defines an envelope class of KeyQuaternionComponent with relative operations.
Definition: Envelopes.h:930
A double type key component with relative operations.
Definition: Envelopes.h:456
KeyWStringComponentSet const * KeyWStringComponentSetCP
Definition: Envelopes.h:619
struct DPoint3d const & DPoint3dCR
Definition: msgeomstructs_typedefs.h:79
RefCountedPtr< struct KeyFileIncrementComponentEnvelope > KeyFileIncrementComponentEnvelopePtr
Definition: Envelopes.h:846
KeyDoubleComponentSet const & KeyDoubleComponentSetCR
Definition: Envelopes.h:493
KeyWStringComponentSet * KeyWStringComponentSetP
Definition: Envelopes.h:618
KeyDoubleComponentSet * KeyDoubleComponentSetP
Definition: Envelopes.h:490
VelocityDataType
Defines the types of velocity data.
Definition: Envelopes.h:287
struct DPoint4d const & DPoint4dCR
Definition: msgeomstructs_typedefs.h:96
Animate script entry using acceleration then deceleration.
Definition: Envelopes.h:59
KeyQuaternionComponentSet * KeyQuaternionComponentSetP
Definition: Envelopes.h:574
Defines a pair value with int and TimeVal.
Definition: Envelopes.h:114
KeyQuaternionComponentSet const & KeyQuaternionComponentSetCR
Definition: Envelopes.h:577
A string class that has many of the same capabilities as std::string, plus additional functions such ...
Definition: WString.h:51
Defines a comparing operator for KeyWStringComponent.
Definition: Envelopes.h:606
Defines a class of bezier velocity with relative operations.
Definition: Envelopes.h:329

Copyright © 2017 Bentley Systems, Incorporated. All rights reserved.