|
Revision 13041, 1.4 kB
(checked in by robert, 14 months ago)
|
|
Ran script to remove trailing spaces and tabs
|
-
Property svn:eol-style set to
native
-
Property svn:keywords set to
Author Date Id Revision
|
| Line | |
|---|
| 1 | |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | #ifndef LWOSG_LAYER_ |
|---|
| 9 | #define LWOSG_LAYER_ |
|---|
| 10 | |
|---|
| 11 | #include "lwo2chunks.h" |
|---|
| 12 | |
|---|
| 13 | #include "Unit.h" |
|---|
| 14 | |
|---|
| 15 | namespace lwosg |
|---|
| 16 | { |
|---|
| 17 | |
|---|
| 18 | class Layer { |
|---|
| 19 | public: |
|---|
| 20 | typedef std::vector<Unit> Unit_list; |
|---|
| 21 | |
|---|
| 22 | inline Layer(); |
|---|
| 23 | |
|---|
| 24 | inline const lwo2::FORM::LAYR *get_layer_chunk() const; |
|---|
| 25 | inline void set_layer_chunk(const lwo2::FORM::LAYR *layr); |
|---|
| 26 | |
|---|
| 27 | inline int number() const; |
|---|
| 28 | |
|---|
| 29 | inline Unit_list &units(); |
|---|
| 30 | inline const Unit_list &units() const; |
|---|
| 31 | inline osg::Vec3 pivot() const; |
|---|
| 32 | |
|---|
| 33 | private: |
|---|
| 34 | const lwo2::FORM::LAYR *layr_; |
|---|
| 35 | Unit_list units_; |
|---|
| 36 | }; |
|---|
| 37 | |
|---|
| 38 | |
|---|
| 39 | |
|---|
| 40 | inline Layer::Layer() |
|---|
| 41 | : layr_(0) |
|---|
| 42 | { |
|---|
| 43 | } |
|---|
| 44 | |
|---|
| 45 | inline Layer::Unit_list &Layer::units() |
|---|
| 46 | { |
|---|
| 47 | return units_; |
|---|
| 48 | } |
|---|
| 49 | |
|---|
| 50 | inline const Layer::Unit_list &Layer::units() const |
|---|
| 51 | { |
|---|
| 52 | return units_; |
|---|
| 53 | } |
|---|
| 54 | |
|---|
| 55 | inline osg::Vec3 Layer::pivot() const |
|---|
| 56 | { |
|---|
| 57 | if (layr_) { |
|---|
| 58 | return osg::Vec3(layr_->pivot.X, layr_->pivot.Y, layr_->pivot.Z); |
|---|
| 59 | } |
|---|
| 60 | return osg::Vec3(0, 0, 0); |
|---|
| 61 | } |
|---|
| 62 | |
|---|
| 63 | inline const lwo2::FORM::LAYR *Layer::get_layer_chunk() const |
|---|
| 64 | { |
|---|
| 65 | return layr_; |
|---|
| 66 | } |
|---|
| 67 | |
|---|
| 68 | inline void Layer::set_layer_chunk(const lwo2::FORM::LAYR *layr) |
|---|
| 69 | { |
|---|
| 70 | layr_ = layr; |
|---|
| 71 | } |
|---|
| 72 | |
|---|
| 73 | inline int Layer::number() const |
|---|
| 74 | { |
|---|
| 75 | if (layr_) { |
|---|
| 76 | return layr_->number; |
|---|
| 77 | } |
|---|
| 78 | return -1; |
|---|
| 79 | } |
|---|
| 80 | |
|---|
| 81 | |
|---|
| 82 | } |
|---|
| 83 | |
|---|
| 84 | #endif |
|---|