Revert "License conversion from Flora to Apache 2.0"
[platform/core/uifw/dali-core.git] / dali / internal / update / dynamics / scene-graph-dynamics-cylinder-shape.h
1 #ifndef __SCENE_GRAPH_DYNAMICS_CYLINDER_SHAPE_H__
2 #define __SCENE_GRAPH_DYNAMICS_CYLINDER_SHAPE_H__
3
4 //
5 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
6 //
7 // Licensed under the Flora License, Version 1.0 (the License);
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
10 //
11 //     http://floralicense.org/license/
12 //
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an AS IS BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
18 //
19
20 // BASE CLASS HEADERS
21 #include <dali/internal/update/dynamics/scene-graph-dynamics-shape.h>
22
23 // INTERNAL HEADERS
24 #include <dali/internal/event/dynamics/dynamics-declarations.h>
25 #include <dali/internal/common/message.h>
26 #include <dali/internal/common/event-to-update.h>
27
28 namespace Dali
29 {
30
31 namespace Internal
32 {
33
34 namespace SceneGraph
35 {
36
37 class DynamicsWorld;
38
39 class DynamicsCylinderShape : public DynamicsShape
40 {
41 public:
42   /**
43    * Constructor.
44    * @param[in] world The dynamics world object
45    */
46   DynamicsCylinderShape(DynamicsWorld& world);
47
48   /**
49    * Destructor.
50    */
51   virtual ~DynamicsCylinderShape();
52
53   /**
54    * Initialize the cylinder.
55    * @param[in] radius  The radius of the cylinder.
56    * @param[in] length  The length of the cylinder.
57    */
58   void Initialize( float radius, float length );
59
60 private:
61   // unimplemented copy constructor and assignment operator
62   DynamicsCylinderShape(const DynamicsCylinderShape&);
63   DynamicsCylinderShape& operator=(const DynamicsCylinderShape&);
64
65 }; // class DynamicsCylinderShape
66
67 // Messages for DynamicsCylinderShape
68
69 inline void InitializeDynamicsCylinderShapeMessage( EventToUpdate& eventToUpdate, const DynamicsCylinderShape& shape, const float radius, const float length )
70 {
71   typedef MessageValue2< DynamicsCylinderShape, float, float > LocalType;
72
73   // Reserve some memory inside the message queue
74   unsigned int* slot = eventToUpdate.ReserveMessageSlot( sizeof( LocalType ) );
75
76   // Construct message in the message queue memory; note that delete should not be called on the return value
77   new (slot) LocalType( &shape, &DynamicsCylinderShape::Initialize, radius, length );
78 }
79
80 } // namespace SceneGraph
81
82 } // namespace Internal
83
84 } // namespace Dali
85
86 #endif // __SCENE_GRAPH_DYNAMICS_CYLINDER_SHAPE_H__