#include "DefaultEmptySceneContent.h" const QString DefaultEmptySceneContent::g_scene_name=QObject::tr("Empty"); /** * Default constructor * */ DefaultEmptySceneContent::DefaultEmptySceneContent(SceneInterface* plugin): SceneContent(plugin) { } /** * Destructor. * */ DefaultEmptySceneContent::~DefaultEmptySceneContent() { } /** * Implements the copy from other contents. * * This method is used by the copy constructor. * For the empty scene contents, it does nothing. * * @param content The source content to copy from. * * @return true if the copy is ok, false otherwise. The copy can fail if * SceneContent is not a DefaultEmptySceneContent. * * @seealso is_equal_to * */ bool DefaultEmptySceneContent::copy_from(const SceneContent& data) { if (!SceneContent::copy_from(data)) return false; Q_ASSERT(NULL!=plugin()); Q_ASSERT(NULL!=data.plugin()); return true; } /** * Implements the egality-test with other contents. * * This could be an operator==. For the empty scene content, the test is not * difficult. * * @param content The content to compare with. * * @return true if the content are equal, false otherwise. The test can * fail if the contents have different parameters, but also it * SceneContent is not a DefaultEmptySceneContent. * * @seealso copy_from * */ bool DefaultEmptySceneContent::is_equal_to(const SceneContent& data) const { if (!SceneContent::is_equal_to(data)) return false; return true; } /** * Draws the empty scene. * * @param glWidget The QGLWidget that own the OpenGL context. * @param cameraMatrix The camera matrix that must be use. * */ void DefaultEmptySceneContent::draw(QGLWidget *glWidget, const float* cameraMatrix) { Q_UNUSED (glWidget); Q_UNUSED(cameraMatrix); } /** * Loads the empty scene from a QDomElement. * * This is implemented for convenience, but it does nothing. * * @param element The QDomElement to read from. * */ void DefaultEmptySceneContent::initFromDOMElement(const QDomElement& element) { if (!element.isNull()) { SceneContent::initFromDOMElement(element); } } /** * Writes the empty scene in a QDomDocument. * * This is implemented for convenience, but it does nothing. * * @param name The name of the element. * @param doc The document whom belongs the element. * * @return The QDomElement to add. * */ QDomElement DefaultEmptySceneContent::domElement(const QString& name, QDomDocument& doc) const { QDomElement de = SceneContent::domElement(name, doc); return de; }