Merge pull request #557 from aws-lumberyard-dev/cgalvan/RemoveUnusedCSelectionGroupUsages
[LYN-3347] Removed some unused references to CSelectionGroup.
This commit is contained in:
@@ -451,7 +451,6 @@ void CCryEditApp::RegisterActionHandlers()
|
||||
#endif
|
||||
ON_COMMAND(ID_DISPLAY_GOTOPOSITION, OnDisplayGotoPosition)
|
||||
ON_COMMAND(ID_SNAPANGLE, OnSnapangle)
|
||||
ON_COMMAND(ID_EDIT_RENAMEOBJECT, OnEditRenameobject)
|
||||
ON_COMMAND(ID_CHANGEMOVESPEED_INCREASE, OnChangemovespeedIncrease)
|
||||
ON_COMMAND(ID_CHANGEMOVESPEED_DECREASE, OnChangemovespeedDecrease)
|
||||
ON_COMMAND(ID_CHANGEMOVESPEED_CHANGESTEP, OnChangemovespeedChangestep)
|
||||
@@ -3824,59 +3823,6 @@ void CCryEditApp::OnUpdateSnapangle(QAction* action)
|
||||
action->setChecked(gSettings.pGrid->IsAngleSnapEnabled());
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CCryEditApp::OnEditRenameobject()
|
||||
{
|
||||
CSelectionGroup* pSelection = GetIEditor()->GetSelection();
|
||||
if (pSelection->IsEmpty())
|
||||
{
|
||||
QMessageBox::critical(AzToolsFramework::GetActiveWindow(), QString(), QObject::tr("No Selected Objects!"));
|
||||
return;
|
||||
}
|
||||
|
||||
IObjectManager* pObjMan = GetIEditor()->GetObjectManager();
|
||||
|
||||
if (!pObjMan)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
StringDlg dlg(QObject::tr("Rename Object(s)"));
|
||||
if (dlg.exec() == QDialog::Accepted)
|
||||
{
|
||||
CUndo undo("Rename Objects");
|
||||
QString newName;
|
||||
QString str = dlg.GetString();
|
||||
int num = 0;
|
||||
|
||||
for (int i = 0; i < pSelection->GetCount(); ++i)
|
||||
{
|
||||
CBaseObject* pObject = pSelection->GetObject(i);
|
||||
|
||||
if (pObject)
|
||||
{
|
||||
if (pObjMan->IsDuplicateObjectName(str))
|
||||
{
|
||||
pObjMan->ShowDuplicationMsgWarning(pObject, str, true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < pSelection->GetCount(); ++i)
|
||||
{
|
||||
newName = QStringLiteral("%1%2").arg(str).arg(num);
|
||||
++num;
|
||||
CBaseObject* pObject = pSelection->GetObject(i);
|
||||
|
||||
if (pObject)
|
||||
{
|
||||
pObjMan->ChangeObjectName(pObject, newName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CCryEditApp::OnChangemovespeedIncrease()
|
||||
{
|
||||
|
||||
@@ -413,7 +413,6 @@ private:
|
||||
void OnDisplayGotoPosition();
|
||||
void OnSnapangle();
|
||||
void OnUpdateSnapangle(QAction* action);
|
||||
void OnEditRenameobject();
|
||||
void OnChangemovespeedIncrease();
|
||||
void OnChangemovespeedDecrease();
|
||||
void OnChangemovespeedChangestep();
|
||||
|
||||
@@ -1091,35 +1091,6 @@ bool CExportManager::AddSelectedEntityObjects()
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool CExportManager::AddSelectedObjects()
|
||||
{
|
||||
CSelectionGroup* pSelection = GetIEditor()->GetSelection();
|
||||
|
||||
int numObjects = pSelection->GetCount();
|
||||
if (numObjects > m_data.m_objects.size())
|
||||
{
|
||||
m_data.m_objects.reserve(numObjects + 1); // +1 for terrain
|
||||
}
|
||||
// First run pipeline to precache geometry
|
||||
m_isPrecaching = true;
|
||||
for (int i = 0; i < numObjects; i++)
|
||||
{
|
||||
AddObject(pSelection->GetObject(i));
|
||||
}
|
||||
|
||||
GetIEditor()->Get3DEngine()->ProposeContentPrecache();
|
||||
|
||||
// Repeat pipeline to collect geometry
|
||||
m_isPrecaching = false;
|
||||
for (int i = 0; i < numObjects; i++)
|
||||
{
|
||||
AddObject(pSelection->GetObject(i));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CExportManager::AddSelectedRegionObjects()
|
||||
{
|
||||
AABB box;
|
||||
@@ -1185,7 +1156,7 @@ bool CExportManager::ExportToFile(const char* filename, bool bClearDataAfterExpo
|
||||
}
|
||||
|
||||
|
||||
bool CExportManager::Export(const char* defaultName, const char* defaultExt, const char* defaultPath, bool isSelectedObjects, bool isSelectedRegionObjects, bool isOccluder, bool bAnimationExport)
|
||||
bool CExportManager::Export(const char* defaultName, const char* defaultExt, const char* defaultPath, [[maybe_unused]] bool isSelectedObjects, bool isSelectedRegionObjects, bool isOccluder, bool bAnimationExport)
|
||||
{
|
||||
m_bAnimationExport = bAnimationExport;
|
||||
|
||||
@@ -1229,10 +1200,6 @@ bool CExportManager::Export(const char* defaultName, const char* defaultExt, con
|
||||
if (m_bAnimationExport || CFileUtil::SelectSaveFile(filters, defaultExt, defaultPath, newFilename))
|
||||
{
|
||||
WaitCursor wait;
|
||||
if (isSelectedObjects)
|
||||
{
|
||||
AddSelectedObjects();
|
||||
}
|
||||
if (isSelectedRegionObjects)
|
||||
{
|
||||
AddSelectedRegionObjects();
|
||||
|
||||
@@ -128,10 +128,6 @@ public:
|
||||
bool Export(const char* defaultName, const char* defaultExt = "", const char* defaultPath = "", bool isSelectedObjects = true,
|
||||
bool isSelectedRegionObjects = false, bool isOccluder = false, bool bAnimationExport = false);
|
||||
|
||||
//! Add to Export Data geometry from selected objects
|
||||
//! return true if succeed, otherwise false
|
||||
bool AddSelectedObjects();
|
||||
|
||||
bool AddSelectedEntityObjects();
|
||||
|
||||
//! Add to Export Data geometry from objects inside selected region volume
|
||||
|
||||
@@ -136,31 +136,10 @@ Matrix34 CGrid::GetMatrix() const
|
||||
Ang3 angles = Ang3(rotationAngles.x * gf_PI / 180.0, rotationAngles.y * gf_PI / 180.0, rotationAngles.z * gf_PI / 180.0);
|
||||
|
||||
tm = Matrix33::CreateRotationXYZ(angles);
|
||||
|
||||
if (gSettings.snap.bGridGetFromSelected)
|
||||
{
|
||||
CSelectionGroup* sel = GetIEditor()->GetSelection();
|
||||
if (sel->GetCount() > 0)
|
||||
{
|
||||
CBaseObject* obj = sel->GetObject(0);
|
||||
tm = obj->GetWorldTM();
|
||||
tm.OrthonormalizeFast();
|
||||
tm.SetTranslation(Vec3(0, 0, 0));
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (GetIEditor()->GetReferenceCoordSys() == COORDS_LOCAL)
|
||||
{
|
||||
tm.SetIdentity();
|
||||
|
||||
CSelectionGroup* sel = GetIEditor()->GetSelection();
|
||||
if (sel->GetCount() > 0)
|
||||
{
|
||||
CBaseObject* obj = sel->GetObject(0);
|
||||
tm = obj->GetWorldTM();
|
||||
tm.OrthonormalizeFast();
|
||||
tm.SetTranslation(Vec3(0, 0, 0));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -39,8 +39,6 @@ CGridSettingsDialog::CGridSettingsDialog(QWidget* pParent /*=NULL*/)
|
||||
|
||||
connect(ui->m_userDefined, &QCheckBox::clicked, this, &CGridSettingsDialog::OnBnUserDefined);
|
||||
connect(ui->m_getFromObject, &QCheckBox::clicked, this, &CGridSettingsDialog::OnBnGetFromObject);
|
||||
connect(ui->m_getAnglesFromObject, &QPushButton::clicked, this, &CGridSettingsDialog::OnBnGetAngles);
|
||||
connect(ui->m_getTranslationFromObject, &QPushButton::clicked, this, &CGridSettingsDialog::OnBnGetTranslation);
|
||||
|
||||
auto doubleSpinBoxValueChanged = static_cast<void(QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged);
|
||||
|
||||
@@ -115,39 +113,6 @@ void CGridSettingsDialog::OnBnGetFromObject()
|
||||
EnableGridPropertyControls(ui->m_userDefined->isChecked(), ui->m_getFromObject->isChecked());
|
||||
}
|
||||
|
||||
void CGridSettingsDialog::OnBnGetAngles()
|
||||
{
|
||||
CSelectionGroup* sel = GetIEditor()->GetSelection();
|
||||
if (sel->GetCount() > 0)
|
||||
{
|
||||
CBaseObject* obj = sel->GetObject(0);
|
||||
Matrix34 tm = obj->GetWorldTM();
|
||||
AffineParts ap;
|
||||
ap.SpectralDecompose(tm);
|
||||
|
||||
Vec3 rotation = Vec3(RAD2DEG(Ang3::GetAnglesXYZ(Matrix33(ap.rot))));
|
||||
|
||||
ui->m_angleX->setValue(rotation.x);
|
||||
ui->m_angleY->setValue(rotation.y);
|
||||
ui->m_angleZ->setValue(rotation.z);
|
||||
}
|
||||
}
|
||||
|
||||
void CGridSettingsDialog::OnBnGetTranslation()
|
||||
{
|
||||
CSelectionGroup* sel = GetIEditor()->GetSelection();
|
||||
if (sel->GetCount() > 0)
|
||||
{
|
||||
CBaseObject* obj = sel->GetObject(0);
|
||||
Matrix34 tm = obj->GetWorldTM();
|
||||
Vec3 translation = tm.GetTranslation();
|
||||
|
||||
ui->m_translationX->setValue(translation.x);
|
||||
ui->m_translationY->setValue(translation.y);
|
||||
ui->m_translationZ->setValue(translation.z);
|
||||
}
|
||||
}
|
||||
|
||||
void CGridSettingsDialog::EnableGridPropertyControls(const bool isUserDefined, const bool isGetFromObject)
|
||||
{
|
||||
ui->m_getFromObject->setEnabled(isUserDefined == true);
|
||||
|
||||
@@ -51,8 +51,6 @@ private slots:
|
||||
void accept() override;
|
||||
void OnBnUserDefined();
|
||||
void OnBnGetFromObject();
|
||||
void OnBnGetAngles();
|
||||
void OnBnGetTranslation();
|
||||
void OnValueUpdate();
|
||||
|
||||
private:
|
||||
|
||||
@@ -116,29 +116,6 @@ static CCryEditDoc * theDocument;
|
||||
|
||||
#undef GetCommandLine
|
||||
|
||||
namespace
|
||||
{
|
||||
bool SelectionContainsComponentEntities()
|
||||
{
|
||||
bool result = false;
|
||||
CSelectionGroup* pSelection = GetIEditor()->GetObjectManager()->GetSelection();
|
||||
if (pSelection)
|
||||
{
|
||||
CBaseObject* selectedObj = nullptr;
|
||||
for (int selectionCounter = 0; selectionCounter < pSelection->GetCount(); ++selectionCounter)
|
||||
{
|
||||
selectedObj = pSelection->GetObject(selectionCounter);
|
||||
if (selectedObj->GetType() == OBJTYPE_AZENTITY)
|
||||
{
|
||||
result = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
const char* CEditorImpl::m_crashLogFileName = "SessionStatus/editor_statuses.json";
|
||||
|
||||
CEditorImpl::CEditorImpl()
|
||||
|
||||
@@ -884,9 +884,6 @@ void MainWindow::InitActions()
|
||||
.SetStatusTip(tr("Restore saved state (Fetch)"));
|
||||
|
||||
// Modify actions
|
||||
am->AddAction(ID_EDIT_RENAMEOBJECT, tr("Rename Object(s)..."))
|
||||
.SetStatusTip(tr("Rename Object"));
|
||||
|
||||
am->AddAction(ID_EDITMODE_MOVE, tr("Move"))
|
||||
.SetIcon(Style::icon("Move"))
|
||||
.SetApplyHoverEffect()
|
||||
|
||||
@@ -3960,18 +3960,6 @@ void CRenderViewport::RenderConstructionPlane()
|
||||
Ang3 angles = Ang3(pGrid->rotationAngles.x * gf_PI / 180.0, pGrid->rotationAngles.y * gf_PI / 180.0, pGrid->rotationAngles.z * gf_PI / 180.0);
|
||||
Matrix34 tm = Matrix33::CreateRotationXYZ(angles);
|
||||
|
||||
if (gSettings.snap.bGridGetFromSelected)
|
||||
{
|
||||
CSelectionGroup* sel = GetIEditor()->GetSelection();
|
||||
if (sel->GetCount() > 0)
|
||||
{
|
||||
CBaseObject* obj = sel->GetObject(0);
|
||||
tm = obj->GetWorldTM();
|
||||
tm.OrthonormalizeFast();
|
||||
tm.SetTranslation(Vec3(0, 0, 0));
|
||||
}
|
||||
}
|
||||
|
||||
u = tm * u;
|
||||
v = tm * v;
|
||||
}
|
||||
@@ -4026,11 +4014,6 @@ void CRenderViewport::RenderConstructionPlane()
|
||||
void CRenderViewport::RenderSnappingGrid()
|
||||
{
|
||||
// First, Check whether we should draw the grid or not.
|
||||
CSelectionGroup* pSelGroup = GetIEditor()->GetSelection();
|
||||
if (pSelGroup == nullptr || pSelGroup->GetCount() != 1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
CGrid* pGrid = GetViewManager()->GetGrid();
|
||||
if (pGrid->IsEnabled() == false && pGrid->IsAngleSnapEnabled() == false)
|
||||
{
|
||||
|
||||
@@ -91,7 +91,6 @@
|
||||
#define ID_EXPORT_INDOORS 32915
|
||||
#define ID_VIEW_CYCLE2DVIEWPORT 32916
|
||||
#define ID_SNAPANGLE 32917
|
||||
#define ID_EDIT_RENAMEOBJECT 32925
|
||||
#define ID_CHANGEMOVESPEED_INCREASE 32928
|
||||
#define ID_CHANGEMOVESPEED_DECREASE 32929
|
||||
#define ID_CHANGEMOVESPEED_CHANGESTEP 32930
|
||||
|
||||
Reference in New Issue
Block a user