Fixed overwriting of axo view when ortho views changed.

This commit is contained in:
j-dowsett
2013-11-27 17:28:13 +00:00
parent 7ee2d974a9
commit 5ada742f7e
3 changed files with 289 additions and 300 deletions

View File

@@ -839,6 +839,8 @@ void TaskOrthoViews::cb_toggled(bool toggle)
if (abs(dx * dy) == 1)
{
axo = i;
ui->tabWidget->setTabEnabled(1,true);
set_axo();
}
else
@@ -871,6 +873,13 @@ void TaskOrthoViews::cb_toggled(bool toggle)
if (view_status[i][2] == dx && view_status[i][3] == dy)
break;
}
if (i == axo)
{
axo = 0;
ui->tabWidget->setTabEnabled(1,false);
}
views[i]->activate(false);
view_status[i][0] = 0;
view_status[i][2] = 0;
@@ -934,9 +943,10 @@ void TaskOrthoViews::updateSecondaries()
{
int direction, rotation;
int dx, dy;
int n;
for (int i = 1; i < 4; i++)
if (view_status[i][0] == 1)
if ((view_status[i][0] == 1) && (i != axo))
{
dx = view_status[i][2];
dy = view_status[i][3];
@@ -996,6 +1006,7 @@ void TaskOrthoViews::smooth(int i)
Command::commitCommand();
}
void TaskOrthoViews::axo_flip()
{
axo_flipped = !axo_flipped;
@@ -1031,6 +1042,11 @@ void TaskOrthoViews::axoTopChanged(int i)
void TaskOrthoViews::axoChanged(int i)
{
if (i == 2)
ui->flip->setEnabled(true);
else
ui->flip->setEnabled(false);
set_axo();
}
@@ -1081,7 +1097,7 @@ void TaskOrthoViews::set_axo()
angle = (angle > 0) ? 98.8 : -81.2;
}
}
views[3]->setDir(v[0],v[1],v[2], angle, primary);
views[axo]->setDir(v[0],v[1],v[2], angle, primary);
compute();
}

View File

@@ -137,6 +137,7 @@ private:
float horiz, vert; //centre-centre distances
bool axo_flipped;
int axo;
float pagewidth, pageheight; //these are actually the available width and height, calculated in constructor.
float pageh1, pageh2; //h1 - total usable page height, h2 - total height allowing for info box.

View File

@@ -26,131 +26,6 @@
<string>Orthographic Projection</string>
</property>
<layout class="QGridLayout" name="gridLayout_5">
<item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLabel" name="label_7">
<property name="text">
<string>Projection</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="projection">
<property name="editable">
<bool>false</bool>
</property>
<item>
<property name="text">
<string>Third Angle</string>
</property>
</item>
<item>
<property name="text">
<string>First Angle</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item row="1" column="0">
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QLabel" name="textLabel1">
<property name="text">
<string>Primary View</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="primary">
<property name="sizeAdjustPolicy">
<enum>QComboBox::AdjustToContentsOnFirstShow</enum>
</property>
<property name="frame">
<bool>true</bool>
</property>
<item>
<property name="text">
<string/>
</property>
</item>
<item>
<property name="text">
<string>Front</string>
</property>
</item>
<item>
<property name="text">
<string>Right</string>
</property>
</item>
<item>
<property name="text">
<string>Back</string>
</property>
</item>
<item>
<property name="text">
<string>Left</string>
</property>
</item>
<item>
<property name="text">
<string>Top</string>
</property>
</item>
<item>
<property name="text">
<string>Bottom</string>
</property>
</item>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>- Rotate</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="rotate">
<item>
<property name="text">
<string notr="true">0</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">90</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">180</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">270</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item row="2" column="0">
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="3" column="0">
<layout class="QGridLayout" name="gridLayout">
<item row="3" column="1">
@@ -624,188 +499,285 @@
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_2">
<widget class="QWidget" name="axoTab">
<property name="enabled">
<bool>false</bool>
</property>
<attribute name="title">
<string>Axonometric</string>
</attribute>
<widget class="QWidget" name="gridLayoutWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>231</width>
<height>196</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_6">
<item row="5" column="1">
<widget class="QPushButton" name="flip">
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string>Switch direction</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="axoProj">
<property name="enabled">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>Isometric</string>
<layout class="QGridLayout" name="gridLayout_7">
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout_6">
<item row="0" column="1">
<widget class="QComboBox" name="axoProj">
<property name="enabled">
<bool>false</bool>
</property>
</item>
<item>
<property name="text">
<string>Dimetric</string>
</property>
</item>
<item>
<property name="text">
<string>Trimetric</string>
</property>
</item>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_10">
<property name="text">
<string> Scale</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string> View projection</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string> Top face</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_9">
<property name="text">
<string> Left face</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="axoTop">
<property name="enabled">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>Front</string>
</property>
</item>
<item>
<property name="text">
<string>Right</string>
</property>
</item>
<item>
<property name="text">
<string>Back</string>
</property>
</item>
<item>
<property name="text">
<string>Left</string>
</property>
</item>
<item>
<property name="text">
<string>Top</string>
</property>
</item>
<item>
<property name="text">
<string>Bottom</string>
</property>
</item>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="axoLeft">
<property name="enabled">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>Right</string>
</property>
</item>
<item>
<property name="text">
<string>Left</string>
</property>
</item>
<item>
<property name="text">
<string>Top</string>
</property>
</item>
<item>
<property name="text">
<string>Bottom</string>
</property>
</item>
</widget>
</item>
<item row="3" column="1">
<widget class="QLineEdit" name="axoScale">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_12">
<property name="text">
<string> Trimetric -</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_11">
<property name="text">
<string> x / y</string>
</property>
</widget>
</item>
<item row="4" column="1">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLineEdit" name="axoX">
<property name="enabled">
<bool>false</bool>
<item>
<property name="text">
<string>Isometric</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="axoY">
<property name="enabled">
<bool>false</bool>
</item>
<item>
<property name="text">
<string>Dimetric</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<property name="text">
<string>Trimetric</string>
</property>
</item>
</widget>
</item>
<item row="4" column="1">
<widget class="QPushButton" name="flip">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Switch direction</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_10">
<property name="text">
<string> Scale</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string> View projection </string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string> Top face</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_9">
<property name="text">
<string> Left face</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="axoTop">
<property name="enabled">
<bool>false</bool>
</property>
<item>
<property name="text">
<string>Front</string>
</property>
</item>
<item>
<property name="text">
<string>Right</string>
</property>
</item>
<item>
<property name="text">
<string>Back</string>
</property>
</item>
<item>
<property name="text">
<string>Left</string>
</property>
</item>
<item>
<property name="text">
<string>Top</string>
</property>
</item>
<item>
<property name="text">
<string>Bottom</string>
</property>
</item>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="axoLeft">
<property name="enabled">
<bool>false</bool>
</property>
<item>
<property name="text">
<string>Right</string>
</property>
</item>
<item>
<property name="text">
<string>Left</string>
</property>
</item>
<item>
<property name="text">
<string>Top</string>
</property>
</item>
<item>
<property name="text">
<string>Bottom</string>
</property>
</item>
</widget>
</item>
<item row="3" column="1">
<widget class="QLineEdit" name="axoScale">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_12">
<property name="text">
<string> Trimetric</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</widget>
</item>
<item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLabel" name="label_7">
<property name="text">
<string>Projection</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="projection">
<property name="editable">
<bool>false</bool>
</property>
<item>
<property name="text">
<string>Third Angle</string>
</property>
</item>
<item>
<property name="text">
<string>First Angle</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item row="2" column="0">
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="1" column="0">
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QLabel" name="textLabel1">
<property name="text">
<string>Primary View</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="primary">
<property name="sizeAdjustPolicy">
<enum>QComboBox::AdjustToContentsOnFirstShow</enum>
</property>
<property name="frame">
<bool>true</bool>
</property>
<item>
<property name="text">
<string/>
</property>
</item>
<item>
<property name="text">
<string>Front</string>
</property>
</item>
<item>
<property name="text">
<string>Right</string>
</property>
</item>
<item>
<property name="text">
<string>Back</string>
</property>
</item>
<item>
<property name="text">
<string>Left</string>
</property>
</item>
<item>
<property name="text">
<string>Top</string>
</property>
</item>
<item>
<property name="text">
<string>Bottom</string>
</property>
</item>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>- Rotate</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="rotate">
<item>
<property name="text">
<string notr="true">0</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">90</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">180</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">270</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>