summaryrefslogtreecommitdiff
path: root/lyt/group.cpp
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2010-10-07 15:56:13 +0200
committerTreeki <treeki@gmail.com>2010-10-07 15:56:13 +0200
commit5f6dad55d75cbe146ff7fefc899a02ccd39078ba (patch)
tree0822df14cc6d2c0329810c9ae7b4a4a638fe82b1 /lyt/group.cpp
downloadLayoutStudio-5f6dad55d75cbe146ff7fefc899a02ccd39078ba.tar.gz
LayoutStudio-5f6dad55d75cbe146ff7fefc899a02ccd39078ba.zip
initial commit -- everything compiles except for material.cpp. the material system still needs quite a bit of work; this will come in due time
Diffstat (limited to '')
-rw-r--r--lyt/group.cpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/lyt/group.cpp b/lyt/group.cpp
new file mode 100644
index 0000000..c3a16fb
--- /dev/null
+++ b/lyt/group.cpp
@@ -0,0 +1,38 @@
+#include "group.h"
+
+LYTGroup::LYTGroup() {
+}
+
+
+
+
+void LYTGroup::writeToDataStream(QDataStream &out) {
+ WriteFixedLengthASCII(out, name, 0x10);
+
+ // write the contents
+ out << (quint16)panes.count();
+ out.skipRawData(2); // padding
+
+ foreach (LYTPane *pane, panes) {
+ WriteFixedLengthASCII(out, pane->name, 0x10);
+ }
+}
+
+
+void LYTGroup::readFromDataStream(QDataStream &in, LYTPane &linkedPane) {
+ name = ReadFixedLengthASCII(in, 0x10);
+ qDebug() << "reading group" << name;
+
+ // read the contents
+ quint16 paneCount;
+ in >> (quint16&)paneCount;
+ in.skipRawData(2); // padding
+
+ for (int i = 0; i < paneCount; i++) {
+ QString paneName = ReadFixedLengthASCII(in, 0x10);
+
+ qDebug() << "found" << paneName << "in group" << this->name;
+
+ this->panes.append(linkedPane.findPaneByName(paneName, true));
+ }
+}