[4] | 1 | #ifndef __DEFAULT_EMPTY_SCENE_CONTENT_H__ |
---|
| 2 | #define __DEFAULT_EMPTY_SCENE_CONTENT_H__ |
---|
| 3 | |
---|
| 4 | |
---|
| 5 | // Includes Projection Designer headers |
---|
| 6 | #include <projdesigner/include/interfaces.h> |
---|
| 7 | |
---|
| 8 | |
---|
| 9 | /** |
---|
| 10 | * This class implements the contents of the empty scene of the default plugin. |
---|
| 11 | * |
---|
| 12 | * The empty scene enables the user to have nothing in the scene. |
---|
| 13 | * |
---|
| 14 | */ |
---|
| 15 | class DefaultEmptySceneContent: public SceneContent |
---|
| 16 | { |
---|
| 17 | |
---|
| 18 | |
---|
| 19 | public: |
---|
| 20 | |
---|
| 21 | |
---|
| 22 | /** |
---|
| 23 | * Default constructor |
---|
| 24 | * |
---|
| 25 | */ |
---|
| 26 | DefaultEmptySceneContent (SceneInterface* plugin); |
---|
| 27 | |
---|
| 28 | |
---|
| 29 | /** |
---|
| 30 | * Copy constructor. |
---|
| 31 | * |
---|
| 32 | * Uses copy_from() to make the copy. |
---|
| 33 | * |
---|
| 34 | */ |
---|
| 35 | DefaultEmptySceneContent (const DefaultEmptySceneContent& data): SceneContent(data) {copy_from(data);} |
---|
| 36 | |
---|
| 37 | |
---|
| 38 | /** |
---|
| 39 | * Destructor. |
---|
| 40 | * |
---|
| 41 | */ |
---|
| 42 | ~DefaultEmptySceneContent (); |
---|
| 43 | |
---|
| 44 | |
---|
| 45 | /** |
---|
| 46 | * Implements the copy from other contents. |
---|
| 47 | * |
---|
| 48 | * This method is used by the copy constructor. |
---|
| 49 | * For the empty scene contents, it does nothing. |
---|
| 50 | * |
---|
| 51 | * @param content The source content to copy from. |
---|
| 52 | * |
---|
| 53 | * @return true if the copy is ok, false otherwise. The copy can fail if |
---|
| 54 | * SceneContent is not a DefaultEmptySceneContent. |
---|
| 55 | * |
---|
| 56 | * @seealso is_equal_to |
---|
| 57 | * |
---|
| 58 | */ |
---|
| 59 | bool copy_from(const SceneContent& data); |
---|
| 60 | |
---|
| 61 | |
---|
| 62 | /** |
---|
| 63 | * Implements the egality-test with other contents. |
---|
| 64 | * |
---|
| 65 | * This could be an operator==. For the empty scene content, the test is not |
---|
| 66 | * difficult. |
---|
| 67 | * |
---|
| 68 | * @param content The content to compare with. |
---|
| 69 | * |
---|
| 70 | * @return true if the content are equal, false otherwise. The test can |
---|
| 71 | * fail if the contents have different parameters, but also it |
---|
| 72 | * SceneContent is not a DefaultEmptySceneContent. |
---|
| 73 | * |
---|
| 74 | * @seealso copy_from |
---|
| 75 | * |
---|
| 76 | */ |
---|
| 77 | bool is_equal_to(const SceneContent& data) const; |
---|
| 78 | |
---|
| 79 | |
---|
| 80 | /** |
---|
| 81 | * Draws the empty scene. |
---|
| 82 | * |
---|
| 83 | * @param glWidget The QGLWidget that own the OpenGL context. |
---|
| 84 | * @param cameraMatrix The camera matrix that must be use. |
---|
| 85 | * |
---|
| 86 | */ |
---|
| 87 | void draw(QGLWidget* glWidget, const float* cameraMatrix); |
---|
| 88 | |
---|
| 89 | |
---|
| 90 | /** |
---|
| 91 | * Resets the teapot. |
---|
| 92 | * |
---|
| 93 | * This is a pure virtual method of SceneContent. |
---|
| 94 | * This one does nothing. |
---|
| 95 | * |
---|
| 96 | */ |
---|
| 97 | void reset (void) {} |
---|
| 98 | |
---|
| 99 | |
---|
| 100 | /** |
---|
| 101 | * Loads the empty scene from a QDomElement. |
---|
| 102 | * |
---|
| 103 | * This is implemented for convenience, but it does nothing. |
---|
| 104 | * |
---|
| 105 | * @param element The QDomElement to read from. |
---|
| 106 | * |
---|
| 107 | */ |
---|
| 108 | void initFromDOMElement(const QDomElement& element); |
---|
| 109 | |
---|
| 110 | |
---|
| 111 | /** |
---|
| 112 | * Writes the empty scene in a QDomDocument. |
---|
| 113 | * |
---|
| 114 | * This is implemented for convenience, but it does nothing. |
---|
| 115 | * |
---|
| 116 | * @param name The name of the element. |
---|
| 117 | * @param doc The document whom belongs the element. |
---|
| 118 | * |
---|
| 119 | * @return The QDomElement to add. |
---|
| 120 | * |
---|
| 121 | */ |
---|
| 122 | QDomElement domElement(const QString& name, QDomDocument& doc) const; |
---|
| 123 | |
---|
| 124 | |
---|
| 125 | /** |
---|
| 126 | * Gets the name of empty scene type, stored in g_scene_name. |
---|
| 127 | * |
---|
| 128 | * @return The name of empty scene type, stored in g_scene_name. |
---|
| 129 | * |
---|
| 130 | */ |
---|
| 131 | const QString& scene_name(void) const {return g_scene_name;} |
---|
| 132 | |
---|
| 133 | |
---|
| 134 | /// Public static const scene name for the empty scene. |
---|
| 135 | static const QString g_scene_name; |
---|
| 136 | |
---|
| 137 | |
---|
| 138 | private: |
---|
| 139 | |
---|
| 140 | // No attribute for the empy scene, of course. |
---|
| 141 | |
---|
| 142 | }; |
---|
| 143 | |
---|
| 144 | |
---|
| 145 | #endif // __DEFAULT_EMPTY_SCENE_CONTENT_H__ |
---|