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
{
if ((m_nSnap & LC_DRAW_CM_UNITS) == 0)
Value /= 0.04f;
Value /= 0.04f;
}
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
@ -7327,31 +7325,19 @@ void Project::GetSnapDistance(float* SnapXY, float* SnapZ) const
void Project::GetSnapText(char* SnapXY, char* SnapZ, char* SnapAngle) const
{
if (m_nSnap & LC_DRAW_CM_UNITS)
{
float xy, z;
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" };
GetSnapDistance(&xy, &z);
int SXY, SZ, SA;
GetSnapIndex(&SXY, &SZ, &SA);
sprintf(SnapXY, "%.2f", xy);
sprintf(SnapZ, "%.2f", z);
}
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" };
SXY = lcMin(SXY, 9);
SZ = lcMin(SZ, 9);
int SXY, SZ, SA;
GetSnapIndex(&SXY, &SZ, &SA);
SXY = lcMin(SXY, 9);
SZ = lcMin(SZ, 9);
strcpy(SnapXY, SnapXYText[SXY]);
strcpy(SnapZ, SnapZText[SZ]);
strcpy(SnapAngle, SnapAngleText[SA]);
}
strcpy(SnapXY, SnapXYText[SXY]);
strcpy(SnapZ, SnapZText[SZ]);
strcpy(SnapAngle, SnapAngleText[SA]);
}
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_MOVEAXIS 0x0800 // Move on fixed axis
//#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_SCENE_FOG 0x004 // Enable fog

View file

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

View file

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