RioEngine  0.1
My first attempt to create a 3D WYSIWYG Game Engine
clnode.h
Go to the documentation of this file.
1 //--------------------------------------------------------------- @License begins
2 // RioEngine: The late night Coke -without whores- debugging sessions
3 // 2012-2015 Leopoldo Lomas Flores. Torreon, Coahuila. MEXICO
4 // leopoldolomas [at] gmail
5 // www.rioengine.com
6 // www.leopoldolomas.info
7 // "You have a problem, you face it like a man."
8 //
9 // This is free and unencumbered software released into the public domain.
10 //
11 // Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
12 // software, either in source code form or as a compiled binary, for any purpose,
13 // commercial or non-commercial, and by any means.
14 //
15 // In jurisdictions that recognize copyright laws, the author or authors of this
16 // software dedicate any and all copyright interest in the software to the public
17 // domain. We make this dedication for the benefit of the public at large and to
18 // the detriment of our heirs and successors. We intend this dedication to be
19 // an overt act of relinquishment in perpetuity of all present and future
20 // rights to this software under copyright law.
21 //
22 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS
24 // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE
25 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
26 // CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
27 // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28 //--------------------------------------------------------------- @License ends
29 
30 #ifndef RIOENGINE_CLENGINE_CLNODE_H_
31 #define RIOENGINE_CLENGINE_CLNODE_H_
32 
33 #include "misc/transform.h"
34 #include "cengine/cobject.h"
36 
37 class CLNode : public CObject {
38  Q_OBJECT
39  Q_PROPERTY(QList<CLInstanceGeometry> InstanceGeometries
42  DESIGNABLE false) // only used for serialization
43 
44 public:
45  CLNode(void);
46  CLNode(const CLNode& node);
47  CLNode& operator=(const CLNode& node);
48  void copyNodeValuesFromNode(CLNode* node);
49 
50  CLNode* getCopy();
51 
53  const Transform& constTransform() const;
54  void setTransform(const Transform& transform);
55 
56  const std::string& id() const;
57  void setId(const std::string &id);
58 
59  bool visible() const;
60  void setVisible(bool visible);
61 
62  const btVector3& size() const;
63  const btVector3& defaultSize() const;
64  virtual const btVector3& calcSize();
65 
66  //serialization
71 
72  ~CLNode(void);
73 
74 protected:
75  virtual void copyValuesFromObject(const CLNode& node);
76 
78  btVector3 m_size;
79  std::string m_id;
80  bool m_visible;
81 
82 private:
83  CArray<CLInstanceGeometry>* m_instanceGeometries;
84  btVector3 m_defaultSize;
85 };
86 
87 #endif // RIOENGINE_CLENGINE_CLNODE_H_
void setId(const std::string &id)
Definition: clnode.cpp:105
void copyNodeValuesFromNode(CLNode *node)
Definition: clnode.cpp:123
virtual const btVector3 & calcSize()
Definition: clnode.cpp:194
const btVector3 & defaultSize() const
Definition: clnode.cpp:188
CArray< CLInstanceGeometry > * getInstanceGeometries() const
Definition: clnode.cpp:155
Transform m_transform
Definition: clnode.h:77
QList< CLInstanceGeometry > InstanceGeometries
Definition: clnode.h:42
Definition: clnode.h:37
const Transform & constTransform() const
Definition: clnode.cpp:75
void setInstanceGeometries(QList< CLInstanceGeometry > vec)
Definition: clnode.cpp:171
bool m_visible
Definition: clnode.h:80
const btVector3 & size() const
Definition: clnode.cpp:182
CLNode * getCopy()
Definition: clnode.cpp:138
Definition: carray.h:43
void setVisible(bool visible)
Definition: clnode.cpp:93
btVector3 m_size
Definition: clnode.h:78
QList< CLInstanceGeometry > instanceGeometries()
Definition: clnode.cpp:161
void setTransform(const Transform &transform)
Definition: clnode.cpp:81
virtual void copyValuesFromObject(const CLNode &node)
Definition: clnode.cpp:55
Transform & transform()
Definition: clnode.cpp:69
bool visible() const
Definition: clnode.cpp:87
std::string m_id
Definition: clnode.h:79