Removed cm units option.

This commit is contained in:
leo 2014-05-02 21:54:07 +00:00
parent d2d02a1f08
commit 7b60905dcb
4 changed files with 15 additions and 41 deletions

View file

@ -6852,14 +6852,12 @@ bool Project::GetSelectionCenter(lcVector3& Center) const
void Project::ConvertToUserUnits(lcVector3& Value) const void Project::ConvertToUserUnits(lcVector3& Value) const
{ {
if ((m_nSnap & LC_DRAW_CM_UNITS) == 0) Value /= 0.04f;
Value /= 0.04f;
} }
void Project::ConvertFromUserUnits(lcVector3& Value) const void Project::ConvertFromUserUnits(lcVector3& Value) const
{ {
if ((m_nSnap & LC_DRAW_CM_UNITS) == 0) Value *= 0.04f;
Value *= 0.04f;
} }
bool Project::GetFocusPosition(lcVector3& Position) const bool Project::GetFocusPosition(lcVector3& Position) const
@ -7327,31 +7325,19 @@ void Project::GetSnapDistance(float* SnapXY, float* SnapZ) const
void Project::GetSnapText(char* SnapXY, char* SnapZ, char* SnapAngle) const void Project::GetSnapText(char* SnapXY, char* SnapZ, char* SnapAngle) const
{ {
if (m_nSnap & LC_DRAW_CM_UNITS) const char* SnapXYText[] = { "0", "1/20S", "1/4S", "1F", "1/2S", "1S", "2S", "3S", "4S", "8S" };
{ const char* SnapZText[] = { "0", "1/20S", "1/4S", "1F", "1/2S", "1S", "1B", "2B", "4B", "8B" };
float xy, z; const char* SnapAngleText[] = { "0", "1", "5", "10", "15", "30", "45", "60", "90", "180" };
GetSnapDistance(&xy, &z); int SXY, SZ, SA;
GetSnapIndex(&SXY, &SZ, &SA);
sprintf(SnapXY, "%.2f", xy); SXY = lcMin(SXY, 9);
sprintf(SnapZ, "%.2f", z); SZ = lcMin(SZ, 9);
}
else
{
const char* SnapXYText[] = { "0", "1/20S", "1/4S", "1F", "1/2S", "1S", "2S", "3S", "4S", "8S" };
const char* SnapZText[] = { "0", "1/20S", "1/4S", "1F", "1/2S", "1S", "1B", "2B", "4B", "8B" };
const char* SnapAngleText[] = { "0", "1", "5", "10", "15", "30", "45", "60", "90", "180" };
int SXY, SZ, SA; strcpy(SnapXY, SnapXYText[SXY]);
GetSnapIndex(&SXY, &SZ, &SA); strcpy(SnapZ, SnapZText[SZ]);
strcpy(SnapAngle, SnapAngleText[SA]);
SXY = lcMin(SXY, 9);
SZ = lcMin(SZ, 9);
strcpy(SnapXY, SnapXYText[SXY]);
strcpy(SnapZ, SnapZText[SZ]);
strcpy(SnapAngle, SnapAngleText[SA]);
}
} }
void Project::SnapVector(lcVector3& Delta, lcVector3& Leftover) const void Project::SnapVector(lcVector3& Delta, lcVector3& Leftover) const

View file

@ -20,7 +20,7 @@
#define LC_DRAW_LOCK_XYZ (LC_DRAW_LOCK_X | LC_DRAW_LOCK_Y | LC_DRAW_LOCK_Z) #define LC_DRAW_LOCK_XYZ (LC_DRAW_LOCK_X | LC_DRAW_LOCK_Y | LC_DRAW_LOCK_Z)
#define LC_DRAW_MOVEAXIS 0x0800 // Move on fixed axis #define LC_DRAW_MOVEAXIS 0x0800 // Move on fixed axis
//#define LC_DRAW_PREVIEW 0x1000 // Show piece position //#define LC_DRAW_PREVIEW 0x1000 // Show piece position
#define LC_DRAW_CM_UNITS 0x2000 // Use centimeters //#define LC_DRAW_CM_UNITS 0x2000 // Use centimeters
//#define LC_DRAW_3DMOUSE 0x4000 // Mouse moves in all directions //#define LC_DRAW_3DMOUSE 0x4000 // Mouse moves in all directions
#define LC_SCENE_FOG 0x004 // Enable fog #define LC_SCENE_FOG 0x004 // Enable fog

View file

@ -30,7 +30,6 @@ lcQPreferencesDialog::lcQPreferencesDialog(QWidget *parent, void *data) :
ui->lgeoPath->setText(options->LGEOPath); ui->lgeoPath->setText(options->LGEOPath);
ui->mouseSensitivity->setValue(options->Preferences.mMouseSensitivity); ui->mouseSensitivity->setValue(options->Preferences.mMouseSensitivity);
ui->checkForUpdates->setCurrentIndex(options->CheckForUpdates); ui->checkForUpdates->setCurrentIndex(options->CheckForUpdates);
ui->centimeterUnits->setChecked((options->Snap & LC_DRAW_CM_UNITS) != 0);
ui->noRelativeSnap->setChecked((options->Snap & LC_DRAW_GLOBAL_SNAP) != 0); ui->noRelativeSnap->setChecked((options->Snap & LC_DRAW_GLOBAL_SNAP) != 0);
ui->fixedDirectionKeys->setChecked((options->Snap & LC_DRAW_MOVEAXIS) != 0); ui->fixedDirectionKeys->setChecked((options->Snap & LC_DRAW_MOVEAXIS) != 0);
@ -85,7 +84,7 @@ void lcQPreferencesDialog::accept()
return; return;
} }
options->Snap &= ~(LC_DRAW_CM_UNITS | LC_DRAW_GLOBAL_SNAP | LC_DRAW_MOVEAXIS); options->Snap &= ~(LC_DRAW_GLOBAL_SNAP | LC_DRAW_MOVEAXIS);
strcpy(options->DefaultAuthor, ui->authorName->text().toLocal8Bit().data()); strcpy(options->DefaultAuthor, ui->authorName->text().toLocal8Bit().data());
strcpy(options->ProjectsPath, ui->projectsFolder->text().toLocal8Bit().data()); strcpy(options->ProjectsPath, ui->projectsFolder->text().toLocal8Bit().data());
@ -95,9 +94,6 @@ void lcQPreferencesDialog::accept()
options->Preferences.mMouseSensitivity = ui->mouseSensitivity->value(); options->Preferences.mMouseSensitivity = ui->mouseSensitivity->value();
options->CheckForUpdates = ui->checkForUpdates->currentIndex(); options->CheckForUpdates = ui->checkForUpdates->currentIndex();
if (ui->centimeterUnits->isChecked())
options->Snap |= LC_DRAW_CM_UNITS;
if (ui->noRelativeSnap->isChecked()) if (ui->noRelativeSnap->isChecked())
options->Snap |= LC_DRAW_GLOBAL_SNAP; options->Snap |= LC_DRAW_GLOBAL_SNAP;

View file

@ -192,20 +192,13 @@
</widget> </widget>
</item> </item>
<item row="9" column="0" colspan="2"> <item row="9" column="0" colspan="2">
<widget class="QCheckBox" name="centimeterUnits">
<property name="text">
<string>Centimeter units</string>
</property>
</widget>
</item>
<item row="10" column="0" colspan="2">
<widget class="QCheckBox" name="noRelativeSnap"> <widget class="QCheckBox" name="noRelativeSnap">
<property name="text"> <property name="text">
<string>Don't allow relative snap</string> <string>Don't allow relative snap</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="11" column="0" colspan="2"> <item row="10" column="0" colspan="2">
<widget class="QCheckBox" name="fixedDirectionKeys"> <widget class="QCheckBox" name="fixedDirectionKeys">
<property name="text"> <property name="text">
<string>Fixed direction keys</string> <string>Fixed direction keys</string>
@ -724,7 +717,6 @@
<tabstop>lgeoPathBrowse</tabstop> <tabstop>lgeoPathBrowse</tabstop>
<tabstop>mouseSensitivity</tabstop> <tabstop>mouseSensitivity</tabstop>
<tabstop>checkForUpdates</tabstop> <tabstop>checkForUpdates</tabstop>
<tabstop>centimeterUnits</tabstop>
<tabstop>noRelativeSnap</tabstop> <tabstop>noRelativeSnap</tabstop>
<tabstop>fixedDirectionKeys</tabstop> <tabstop>fixedDirectionKeys</tabstop>
<tabstop>antiAliasing</tabstop> <tabstop>antiAliasing</tabstop>