Ocean
PositionInterpolator2D.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) Meta Platforms, Inc. and affiliates.
3  *
4  * This source code is licensed under the MIT license found in the
5  * LICENSE file in the root directory of this source tree.
6  */
7 
8 #ifndef META_OCEAN_SCENEDESCRIPTION_SDX_X3D_POSITION_INTERPOLATOR_2D_H
9 #define META_OCEAN_SCENEDESCRIPTION_SDX_X3D_POSITION_INTERPOLATOR_2D_H
10 
13 
14 namespace Ocean
15 {
16 
17 namespace SceneDescription
18 {
19 
20 namespace SDX
21 {
22 
23 namespace X3D
24 {
25 
26 /**
27  * This class implements a position interpolator 2d node.
28  * @ingroup scenedescriptionsdxx3d
29  */
30 class OCEAN_SCENEDESCRIPTION_SDX_X3D_EXPORT PositionInterpolator2D : virtual public X3DInterpolatorNode
31 {
32  public:
33 
34  /**
35  * Creates a new position interpolator 2d node.
36  * @param environment Node environment
37  */
38  explicit PositionInterpolator2D(const SDXEnvironment* environment);
39 
40  protected:
41 
42  /**
43  * Specifies the node type and the fields of this node.
44  * @return Unique node specification of this node
45  */
47 
48  /**
49  * Event function for single value 'interpolates'.
50  * @see X3DInterpolationNode::onSingleValue().
51  */
52  void onSingleValue(const size_t index, const Timestamp eventTimestamp) override;
53 
54  /**
55  * Event function to interpolate between two values.
56  * @see X3DInterpolationNode::onInterpolate().
57  */
58  void onInterpolate(const size_t leftIndex, const size_t rightIndex, const Scalar interpolationFactor, const Timestamp eventTimestamp) override;
59 
60  /**
61  * Returns the address of the most derived object.
62  * @see Node::objectAddress().
63  */
64  size_t objectAddress() const override;
65 
66  protected:
67 
68  /// KeyValue field.
70 
71  /// Value_changed field.
73 };
74 
75 }
76 
77 }
78 
79 }
80 
81 }
82 
83 #endif // META_OCEAN_SCENEDESCRIPTION_SDX_X3D_POSITION_INTERPOLATOR_2D_H
This class implements a node specification object.
Definition: scenedescription/Node.h:77
This class implements a position interpolator 2d node.
Definition: PositionInterpolator2D.h:31
MultiVector2 keyValue_
KeyValue field.
Definition: PositionInterpolator2D.h:69
size_t objectAddress() const override
Returns the address of the most derived object.
void onSingleValue(const size_t index, const Timestamp eventTimestamp) override
Event function for single value 'interpolates'.
PositionInterpolator2D(const SDXEnvironment *environment)
Creates a new position interpolator 2d node.
void onInterpolate(const size_t leftIndex, const size_t rightIndex, const Scalar interpolationFactor, const Timestamp eventTimestamp) override
Event function to interpolate between two values.
NodeSpecification specifyNode()
Specifies the node type and the fields of this node.
SingleVector2 valueChanged_
Value_changed field.
Definition: PositionInterpolator2D.h:72
This class implements an abstract x3d interpolator node object.
Definition: X3DInterpolatorNode.h:33
This class implements a node environment container.
Definition: SDXNode.h:62
This class implements a timestamp.
Definition: Timestamp.h:36
float Scalar
Definition of a scalar type.
Definition: Math.h:128
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15