Added check for qkList in meshviewer.config

Added QString listOfDirs
Added gettter method to get listOfDirs
Edited MainWindow.ui to prepare for list of file plus dir drop down
This commit is contained in:
Maxim Stewart 2017-05-30 07:11:39 -05:00
parent 7e87b14fe1
commit b2efa83e17
3 changed files with 33 additions and 36 deletions

View File

@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>600</width> <width>800</width>
<height>400</height> <height>600</height>
</rect> </rect>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
@ -68,42 +68,20 @@
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
<widget class="QTreeWidget" name="treeWidget"> <layout class="QVBoxLayout" name="verticalLayout_2">
<property name="showDropIndicator" stdset="0"> <item>
<bool>false</bool> <widget class="QComboBox" name="dirDropDownList"/>
</property> </item>
<property name="dragEnabled"> <item>
<bool>true</bool> <widget class="QTreeView" name="fileListView"/>
</property> </item>
<property name="dragDropMode"> </layout>
<enum>QAbstractItemView::DragOnly</enum>
</property>
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectItems</enum>
</property>
<property name="verticalScrollMode">
<enum>QAbstractItemView::ScrollPerPixel</enum>
</property>
<property name="headerHidden">
<bool>true</bool>
</property>
<property name="expandsOnDoubleClick">
<bool>false</bool>
</property>
<column>
<property name="text">
<string notr="true">1</string>
</property>
</column>
</widget>
</item> </item>
</layout> </layout>
</widget> </widget>
</widget> </widget>
</widget> </widget>
<layoutdefault spacing="6" margin="11"/> <layoutdefault spacing="6" margin="11"/>
<resources> <resources/>
<include location="../Resources/Resources.qrc"/>
</resources>
<connections/> <connections/>
</ui> </ui>

View File

@ -29,6 +29,7 @@ private:
bool m_bfCulling = false; bool m_bfCulling = false;
bool m_light = false; bool m_light = false;
QString listOfDirs;
int m_lightType = 1; // 1 = direct, 2 = point int m_lightType = 1; // 1 = direct, 2 = point
QVector3D m_lightColor = { 255,255,255 }; QVector3D m_lightColor = { 255,255,255 };
float m_attenuation = 0.0f; float m_attenuation = 0.0f;
@ -47,6 +48,7 @@ public:
bool isBfCulling() const; bool isBfCulling() const;
bool isLight() const; bool isLight() const;
QString getListOfDirs();
int getLightType() const; int getLightType() const;
QVector3D getLightColor() const; QVector3D getLightColor() const;
float getAttenuation() const; float getAttenuation() const;
@ -69,4 +71,4 @@ public:
void setHeadlight(bool value); void setHeadlight(bool value);
void setAutoColor(int value); void setAutoColor(int value);
}; };

View File

@ -35,8 +35,19 @@ void SettingsManager::readFromFile()
QList<QByteArray> lines = stream.split('\n'); QList<QByteArray> lines = stream.split('\n');
for (auto& it : lines) for (auto& it : lines)
{ {
if (it.startsWith("<bgOn>")) if (it.startsWith("<qkList>"))
{
QList<QByteArray> values = it.right(it.size() - it.indexOf('>') - 1).split(';');
for (int i = 0; i < values.size(); i++)
{
if (i == values.size() - 1)
listOfDirs.append(values[i]);
else
listOfDirs.append(values[i] + ";");
}
}
else if (it.startsWith("<bgOn>"))
{ {
QList<QByteArray> values = it.right(it.size() - it.indexOf('>') - 1).split(';'); QList<QByteArray> values = it.right(it.size() - it.indexOf('>') - 1).split(';');
@ -107,12 +118,18 @@ void SettingsManager::writeToFile()
file.write(QString("<liTy>%1\n").arg(m_lightType).toUtf8()); file.write(QString("<liTy>%1\n").arg(m_lightType).toUtf8());
file.write(QString("<atFa>%1\n").arg(m_attenuation).toUtf8()); file.write(QString("<atFa>%1\n").arg(m_attenuation).toUtf8());
file.write(QString("<amCo>%1\n").arg(m_ambient).toUtf8()); file.write(QString("<amCo>%1\n").arg(m_ambient).toUtf8());
file.write(QString("<qkList>%1\n").arg(listOfDirs).toUtf8());
file.close(); file.close();
} }
// getter /////////////////////////////////////////////////////////////// // getter ///////////////////////////////////////////////////////////////
QString SettingsManager::getListOfDirs()
{
return listOfDirs;
}
QVector3D SettingsManager::getBgColorOn() const QVector3D SettingsManager::getBgColorOn() const
{ {
return m_bgColorOn; return m_bgColorOn;