| 1 |
#pragma once |
| 2 |
|
| 3 |
#include "inode.h" |
| 4 |
|
| 5 |
namespace scene |
| 6 |
{ |
| 7 |
|
| 8 |
/** greebo: This is used to identify group entities right before |
| 9 |
* and after map save/load. |
| 10 |
* |
| 11 |
* It provides methods to add/substract the origin to/from |
| 12 |
* their child primitives. |
| 13 |
*/ |
| 14 |
class GroupNode |
| 15 |
{ |
| 16 |
public: |
| 17 |
virtual ~GroupNode() {} |
| 18 |
|
| 19 |
/** greebo: This is called right before saving |
| 20 |
* to move the child brushes of the Doom3Group |
| 21 |
* according to its origin. |
| 22 |
*/ |
| 23 |
virtual void addOriginToChildren() = 0; |
| 24 |
virtual void removeOriginFromChildren() = 0; |
| 25 |
}; |
| 26 |
typedef std::shared_ptr<GroupNode> GroupNodePtr; |
| 27 |
|
| 28 |
} // namespace scene |
| 29 |
|
| 30 |
/** greebo: Cast a node onto a GroupNode pointer |
| 31 |
* |
| 32 |
* @returns: an empty pointer on failure, the pointer to the class otherwise. |
| 33 |
*/ |
| 34 |
inline scene::GroupNodePtr Node_getGroupNode(const scene::INodePtr& node) |
| 35 |
{ |
| 36 |
return std::dynamic_pointer_cast<scene::GroupNode>(node); |
| 37 |
} |