mirror of
https://github.com/leozide/leocad
synced 2025-02-06 08:46:06 +01:00
Moved addkeys to main window.
This commit is contained in:
parent
d162acdf52
commit
eb4bc27c25
8 changed files with 65 additions and 80 deletions
|
@ -11,6 +11,8 @@ lcMainWindow::lcMainWindow()
|
||||||
mActiveView = NULL;
|
mActiveView = NULL;
|
||||||
mPreviewWidget = NULL;
|
mPreviewWidget = NULL;
|
||||||
|
|
||||||
|
mAddKeys = false;
|
||||||
|
|
||||||
for (int FileIdx = 0; FileIdx < LC_MAX_RECENT_FILES; FileIdx++)
|
for (int FileIdx = 0; FileIdx < LC_MAX_RECENT_FILES; FileIdx++)
|
||||||
strcpy(mRecentFiles[FileIdx], lcGetProfileString((LC_PROFILE_KEY)(LC_PROFILE_RECENT_FILE1 + FileIdx)));
|
strcpy(mRecentFiles[FileIdx], lcGetProfileString((LC_PROFILE_KEY)(LC_PROFILE_RECENT_FILE1 + FileIdx)));
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,11 @@ class lcMainWindow : public lcBaseWindow
|
||||||
lcMainWindow();
|
lcMainWindow();
|
||||||
~lcMainWindow();
|
~lcMainWindow();
|
||||||
|
|
||||||
|
bool GetAddKeys() const
|
||||||
|
{
|
||||||
|
return mAddKeys;
|
||||||
|
}
|
||||||
|
|
||||||
View* GetActiveView() const
|
View* GetActiveView() const
|
||||||
{
|
{
|
||||||
return mActiveView;
|
return mActiveView;
|
||||||
|
@ -49,7 +54,7 @@ class lcMainWindow : public lcBaseWindow
|
||||||
void UpdateAction(int NewAction);
|
void UpdateAction(int NewAction);
|
||||||
void UpdatePaste(bool Enabled);
|
void UpdatePaste(bool Enabled);
|
||||||
void UpdateTime(int CurrentTime, int TotalTime);
|
void UpdateTime(int CurrentTime, int TotalTime);
|
||||||
void UpdateAnimation(bool AddKeys);
|
void SetAddKeys(bool AddKeys);
|
||||||
void UpdateLockSnap(lcuint32 Snap);
|
void UpdateLockSnap(lcuint32 Snap);
|
||||||
void UpdateSnap();
|
void UpdateSnap();
|
||||||
void UpdateUndoRedo(const char* UndoText, const char* RedoText);
|
void UpdateUndoRedo(const char* UndoText, const char* RedoText);
|
||||||
|
@ -72,6 +77,8 @@ class lcMainWindow : public lcBaseWindow
|
||||||
protected:
|
protected:
|
||||||
View* mActiveView;
|
View* mActiveView;
|
||||||
lcArray<View*> mViews;
|
lcArray<View*> mViews;
|
||||||
|
|
||||||
|
bool mAddKeys;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern class lcMainWindow* gMainWindow;
|
extern class lcMainWindow* gMainWindow;
|
||||||
|
|
|
@ -107,7 +107,6 @@ void Project::UpdateInterface()
|
||||||
gMainWindow->UpdateFocusObject(GetFocusObject());
|
gMainWindow->UpdateFocusObject(GetFocusObject());
|
||||||
SetAction(m_nCurAction);
|
SetAction(m_nCurAction);
|
||||||
gMainWindow->UpdateTransformType(mTransformType);
|
gMainWindow->UpdateTransformType(mTransformType);
|
||||||
gMainWindow->UpdateAnimation(m_bAddKeys);
|
|
||||||
gMainWindow->UpdateLockSnap(m_nSnap);
|
gMainWindow->UpdateLockSnap(m_nSnap);
|
||||||
gMainWindow->UpdateSnap();
|
gMainWindow->UpdateSnap();
|
||||||
gMainWindow->UpdateCameraMenu();
|
gMainWindow->UpdateCameraMenu();
|
||||||
|
@ -199,8 +198,7 @@ void Project::LoadDefaults(bool cameras)
|
||||||
// Default values
|
// Default values
|
||||||
gMainWindow->SetColorIndex(lcGetColorIndex(4));
|
gMainWindow->SetColorIndex(lcGetColorIndex(4));
|
||||||
SetAction(LC_TOOL_SELECT);
|
SetAction(LC_TOOL_SELECT);
|
||||||
m_bAddKeys = false;
|
gMainWindow->SetAddKeys(false);
|
||||||
gMainWindow->UpdateAnimation(m_bAddKeys);
|
|
||||||
m_bUndoOriginal = true;
|
m_bUndoOriginal = true;
|
||||||
gMainWindow->UpdateUndoRedo(NULL, NULL);
|
gMainWindow->UpdateUndoRedo(NULL, NULL);
|
||||||
m_nAngleSnap = (unsigned short)lcGetProfileInt(LC_PROFILE_ANGLE_SNAP);
|
m_nAngleSnap = (unsigned short)lcGetProfileInt(LC_PROFILE_ANGLE_SNAP);
|
||||||
|
@ -632,18 +630,18 @@ bool Project::FileLoad(lcFile* file, bool bUndo, bool bMerge)
|
||||||
|
|
||||||
if (fv < 1.3f)
|
if (fv < 1.3f)
|
||||||
{
|
{
|
||||||
file->ReadS32(&i, 1); //m_bAnimation = (i != 0);
|
file->ReadS32(&i, 1); // m_bAnimation = (i != 0);
|
||||||
file->ReadS32(&i, 1); m_bAddKeys = (i != 0);
|
file->ReadS32(&i, 1); // mAddKeys = (i != 0);
|
||||||
file->ReadU8(&ch, 1); // m_nFPS
|
file->ReadU8(&ch, 1); // m_nFPS
|
||||||
file->ReadS32(&i, 1); // m_nCurFrame = i;
|
file->ReadS32(&i, 1); // m_nCurFrame = i;
|
||||||
file->ReadU16(&sh, 1); // m_nTotalFrames
|
file->ReadU16(&sh, 1); // m_nTotalFrames
|
||||||
file->ReadS32(&i, 1); //m_nGridSize = i;
|
file->ReadS32(&i, 1); // m_nGridSize = i;
|
||||||
file->ReadS32(&i, 1); //m_nMoveSnap = i;
|
file->ReadS32(&i, 1); // m_nMoveSnap = i;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
file->ReadU8(&ch, 1); //m_bAnimation = (ch != 0);
|
file->ReadU8(&ch, 1); // m_bAnimation = (ch != 0);
|
||||||
file->ReadU8(&ch, 1); m_bAddKeys = (ch != 0);
|
file->ReadU8(&ch, 1); // mAddKeys = (ch != 0);
|
||||||
file->ReadU8(&ch, 1); // m_nFPS
|
file->ReadU8(&ch, 1); // m_nFPS
|
||||||
file->ReadU16(&sh, 1); // m_nCurFrame
|
file->ReadU16(&sh, 1); // m_nCurFrame
|
||||||
file->ReadU16(&sh, 1); // m_nTotalFrames
|
file->ReadU16(&sh, 1); // m_nTotalFrames
|
||||||
|
@ -706,7 +704,6 @@ bool Project::FileLoad(lcFile* file, bool bUndo, bool bMerge)
|
||||||
}
|
}
|
||||||
|
|
||||||
SetAction(action);
|
SetAction(action);
|
||||||
gMainWindow->UpdateAnimation(m_bAddKeys);
|
|
||||||
gMainWindow->UpdateLockSnap(m_nSnap);
|
gMainWindow->UpdateLockSnap(m_nSnap);
|
||||||
gMainWindow->UpdateSnap();
|
gMainWindow->UpdateSnap();
|
||||||
gMainWindow->UpdateCameraMenu();
|
gMainWindow->UpdateCameraMenu();
|
||||||
|
@ -808,9 +805,9 @@ void Project::FileSave(lcFile* file, bool bUndo)
|
||||||
// 0.60 (1.0)
|
// 0.60 (1.0)
|
||||||
rgb = LC_FLOATRGB(mProperties.mAmbientColor);
|
rgb = LC_FLOATRGB(mProperties.mAmbientColor);
|
||||||
file->WriteU32(&rgb, 1);
|
file->WriteU32(&rgb, 1);
|
||||||
ch = 0;//m_bAnimation;
|
ch = 0;// m_bAnimation;
|
||||||
file->WriteBuffer(&ch, 1);
|
file->WriteBuffer(&ch, 1);
|
||||||
ch = m_bAddKeys;
|
ch = 0;// mAddKeys;
|
||||||
file->WriteU8(&ch, 1);
|
file->WriteU8(&ch, 1);
|
||||||
file->WriteU8 (24); // m_nFPS
|
file->WriteU8 (24); // m_nFPS
|
||||||
file->WriteU16(1); // m_nCurFrame
|
file->WriteU16(1); // m_nCurFrame
|
||||||
|
@ -1555,28 +1552,6 @@ void Project::RenderBackground(View* View)
|
||||||
glDepthMask(GL_TRUE);
|
glDepthMask(GL_TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct lcTranslucentRenderSection
|
|
||||||
{
|
|
||||||
float Distance;
|
|
||||||
Piece* piece;
|
|
||||||
};
|
|
||||||
|
|
||||||
int lcTranslucentRenderCompare(const lcTranslucentRenderSection& a, const lcTranslucentRenderSection& b)
|
|
||||||
{
|
|
||||||
if (a.Distance > b.Distance)
|
|
||||||
return 1;
|
|
||||||
else
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
int lcOpaqueRenderCompare(Piece* const& a, Piece* const& b)
|
|
||||||
{
|
|
||||||
if (a->mPieceInfo > b->mPieceInfo)
|
|
||||||
return 1;
|
|
||||||
else
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Project::RenderScenePieces(View* view, bool DrawInterface)
|
void Project::RenderScenePieces(View* view, bool DrawInterface)
|
||||||
{
|
{
|
||||||
const lcPreferences& Preferences = lcGetPreferences();
|
const lcPreferences& Preferences = lcGetPreferences();
|
||||||
|
@ -2463,7 +2438,7 @@ void Project::ZoomExtents(int FirstView, int LastView)
|
||||||
{
|
{
|
||||||
View* view = Views[vp];
|
View* view = Views[vp];
|
||||||
|
|
||||||
view->mCamera->ZoomExtents(view, Center, Points, 8, m_nCurStep, m_bAddKeys);
|
view->mCamera->ZoomExtents(view, Center, Points, 8, m_nCurStep, gMainWindow->GetAddKeys());
|
||||||
}
|
}
|
||||||
|
|
||||||
gMainWindow->UpdateFocusObject(GetFocusObject());
|
gMainWindow->UpdateFocusObject(GetFocusObject());
|
||||||
|
@ -4561,7 +4536,7 @@ void Project::HandleCommand(LC_COMMANDS id)
|
||||||
{
|
{
|
||||||
lcVector3 FocusVector;
|
lcVector3 FocusVector;
|
||||||
GetSelectionCenter(FocusVector);
|
GetSelectionCenter(FocusVector);
|
||||||
gMainWindow->GetActiveView()->mCamera->SetFocalPoint(FocusVector, m_nCurStep, m_bAddKeys);
|
gMainWindow->GetActiveView()->mCamera->SetFocalPoint(FocusVector, m_nCurStep, gMainWindow->GetAddKeys());
|
||||||
gMainWindow->UpdateAllViews();
|
gMainWindow->UpdateAllViews();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -5273,7 +5248,7 @@ void Project::HandleCommand(LC_COMMANDS id)
|
||||||
Center = lcVector3((bs[0] + bs[3]) * 0.5f, (bs[1] + bs[4]) * 0.5f, (bs[2] + bs[5]) * 0.5f);
|
Center = lcVector3((bs[0] + bs[3]) * 0.5f, (bs[1] + bs[4]) * 0.5f, (bs[2] + bs[5]) * 0.5f);
|
||||||
}
|
}
|
||||||
|
|
||||||
gMainWindow->GetActiveView()->mCamera->Center(Center, m_nCurStep, m_bAddKeys);
|
gMainWindow->GetActiveView()->mCamera->Center(Center, m_nCurStep, gMainWindow->GetAddKeys());
|
||||||
gMainWindow->UpdateAllViews();
|
gMainWindow->UpdateAllViews();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -5376,49 +5351,49 @@ void Project::HandleCommand(LC_COMMANDS id)
|
||||||
|
|
||||||
case LC_VIEW_VIEWPOINT_FRONT:
|
case LC_VIEW_VIEWPOINT_FRONT:
|
||||||
{
|
{
|
||||||
gMainWindow->GetActiveView()->mCamera->SetViewpoint(LC_VIEWPOINT_FRONT, m_nCurStep, m_bAddKeys);
|
gMainWindow->GetActiveView()->mCamera->SetViewpoint(LC_VIEWPOINT_FRONT, m_nCurStep, gMainWindow->GetAddKeys());
|
||||||
HandleCommand(LC_VIEW_ZOOM_EXTENTS);
|
HandleCommand(LC_VIEW_ZOOM_EXTENTS);
|
||||||
gMainWindow->UpdateAllViews();
|
gMainWindow->UpdateAllViews();
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case LC_VIEW_VIEWPOINT_BACK:
|
case LC_VIEW_VIEWPOINT_BACK:
|
||||||
{
|
{
|
||||||
gMainWindow->GetActiveView()->mCamera->SetViewpoint(LC_VIEWPOINT_BACK, m_nCurStep, m_bAddKeys);
|
gMainWindow->GetActiveView()->mCamera->SetViewpoint(LC_VIEWPOINT_BACK, m_nCurStep, gMainWindow->GetAddKeys());
|
||||||
HandleCommand(LC_VIEW_ZOOM_EXTENTS);
|
HandleCommand(LC_VIEW_ZOOM_EXTENTS);
|
||||||
gMainWindow->UpdateAllViews();
|
gMainWindow->UpdateAllViews();
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case LC_VIEW_VIEWPOINT_TOP:
|
case LC_VIEW_VIEWPOINT_TOP:
|
||||||
{
|
{
|
||||||
gMainWindow->GetActiveView()->mCamera->SetViewpoint(LC_VIEWPOINT_TOP, m_nCurStep, m_bAddKeys);
|
gMainWindow->GetActiveView()->mCamera->SetViewpoint(LC_VIEWPOINT_TOP, m_nCurStep, gMainWindow->GetAddKeys());
|
||||||
HandleCommand(LC_VIEW_ZOOM_EXTENTS);
|
HandleCommand(LC_VIEW_ZOOM_EXTENTS);
|
||||||
gMainWindow->UpdateAllViews();
|
gMainWindow->UpdateAllViews();
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case LC_VIEW_VIEWPOINT_BOTTOM:
|
case LC_VIEW_VIEWPOINT_BOTTOM:
|
||||||
{
|
{
|
||||||
gMainWindow->GetActiveView()->mCamera->SetViewpoint(LC_VIEWPOINT_BOTTOM, m_nCurStep, m_bAddKeys);
|
gMainWindow->GetActiveView()->mCamera->SetViewpoint(LC_VIEWPOINT_BOTTOM, m_nCurStep, gMainWindow->GetAddKeys());
|
||||||
HandleCommand(LC_VIEW_ZOOM_EXTENTS);
|
HandleCommand(LC_VIEW_ZOOM_EXTENTS);
|
||||||
gMainWindow->UpdateAllViews();
|
gMainWindow->UpdateAllViews();
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case LC_VIEW_VIEWPOINT_LEFT:
|
case LC_VIEW_VIEWPOINT_LEFT:
|
||||||
{
|
{
|
||||||
gMainWindow->GetActiveView()->mCamera->SetViewpoint(LC_VIEWPOINT_LEFT, m_nCurStep, m_bAddKeys);
|
gMainWindow->GetActiveView()->mCamera->SetViewpoint(LC_VIEWPOINT_LEFT, m_nCurStep, gMainWindow->GetAddKeys());
|
||||||
HandleCommand(LC_VIEW_ZOOM_EXTENTS);
|
HandleCommand(LC_VIEW_ZOOM_EXTENTS);
|
||||||
gMainWindow->UpdateAllViews();
|
gMainWindow->UpdateAllViews();
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case LC_VIEW_VIEWPOINT_RIGHT:
|
case LC_VIEW_VIEWPOINT_RIGHT:
|
||||||
{
|
{
|
||||||
gMainWindow->GetActiveView()->mCamera->SetViewpoint(LC_VIEWPOINT_RIGHT, m_nCurStep, m_bAddKeys);
|
gMainWindow->GetActiveView()->mCamera->SetViewpoint(LC_VIEWPOINT_RIGHT, m_nCurStep, gMainWindow->GetAddKeys());
|
||||||
HandleCommand(LC_VIEW_ZOOM_EXTENTS);
|
HandleCommand(LC_VIEW_ZOOM_EXTENTS);
|
||||||
gMainWindow->UpdateAllViews();
|
gMainWindow->UpdateAllViews();
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case LC_VIEW_VIEWPOINT_HOME:
|
case LC_VIEW_VIEWPOINT_HOME:
|
||||||
{
|
{
|
||||||
gMainWindow->GetActiveView()->mCamera->SetViewpoint(LC_VIEWPOINT_HOME, m_nCurStep, m_bAddKeys);
|
gMainWindow->GetActiveView()->mCamera->SetViewpoint(LC_VIEWPOINT_HOME, m_nCurStep, gMainWindow->GetAddKeys());
|
||||||
HandleCommand(LC_VIEW_ZOOM_EXTENTS);
|
HandleCommand(LC_VIEW_ZOOM_EXTENTS);
|
||||||
gMainWindow->UpdateAllViews();
|
gMainWindow->UpdateAllViews();
|
||||||
} break;
|
} break;
|
||||||
|
@ -5548,10 +5523,8 @@ void Project::HandleCommand(LC_COMMANDS id)
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case LC_VIEW_TIME_ADD_KEYS:
|
case LC_VIEW_TIME_ADD_KEYS:
|
||||||
{
|
gMainWindow->SetAddKeys(!gMainWindow->GetAddKeys());
|
||||||
m_bAddKeys = !m_bAddKeys;
|
break;
|
||||||
gMainWindow->UpdateAnimation(m_bAddKeys);
|
|
||||||
} break;
|
|
||||||
|
|
||||||
case LC_EDIT_SNAP_X:
|
case LC_EDIT_SNAP_X:
|
||||||
if (m_nSnap & LC_DRAW_SNAP_X)
|
if (m_nSnap & LC_DRAW_SNAP_X)
|
||||||
|
@ -6477,7 +6450,7 @@ bool Project::MoveSelectedObjects(lcVector3& Move, lcVector3& Remainder, bool Sn
|
||||||
|
|
||||||
if (pCamera->IsSelected())
|
if (pCamera->IsSelected())
|
||||||
{
|
{
|
||||||
pCamera->Move(m_nCurStep, m_bAddKeys, x, y, z);
|
pCamera->Move(m_nCurStep, gMainWindow->GetAddKeys(), x, y, z);
|
||||||
pCamera->UpdatePosition(m_nCurStep);
|
pCamera->UpdatePosition(m_nCurStep);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6488,7 +6461,7 @@ bool Project::MoveSelectedObjects(lcVector3& Move, lcVector3& Remainder, bool Sn
|
||||||
|
|
||||||
if (pLight->IsSelected())
|
if (pLight->IsSelected())
|
||||||
{
|
{
|
||||||
pLight->Move (m_nCurStep, m_bAddKeys, x, y, z);
|
pLight->Move (m_nCurStep, gMainWindow->GetAddKeys(), x, y, z);
|
||||||
pLight->UpdatePosition (m_nCurStep);
|
pLight->UpdatePosition (m_nCurStep);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6499,7 +6472,7 @@ bool Project::MoveSelectedObjects(lcVector3& Move, lcVector3& Remainder, bool Sn
|
||||||
|
|
||||||
if (Piece->IsSelected())
|
if (Piece->IsSelected())
|
||||||
{
|
{
|
||||||
Piece->Move(m_nCurStep, m_bAddKeys, x, y, z);
|
Piece->Move(m_nCurStep, gMainWindow->GetAddKeys(), x, y, z);
|
||||||
Piece->UpdatePosition(m_nCurStep);
|
Piece->UpdatePosition(m_nCurStep);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6660,7 +6633,7 @@ bool Project::RotateSelectedObjects(lcVector3& Delta, lcVector3& Remainder, bool
|
||||||
pos[1] = Center[1] + Distance[1];
|
pos[1] = Center[1] + Distance[1];
|
||||||
pos[2] = Center[2] + Distance[2];
|
pos[2] = Center[2] + Distance[2];
|
||||||
|
|
||||||
Piece->ChangeKey(m_nCurStep, m_bAddKeys, pos, LC_PK_POSITION);
|
Piece->ChangeKey(m_nCurStep, gMainWindow->GetAddKeys(), pos, LC_PK_POSITION);
|
||||||
}
|
}
|
||||||
|
|
||||||
rot[0] = NewRotation[0];
|
rot[0] = NewRotation[0];
|
||||||
|
@ -6668,7 +6641,7 @@ bool Project::RotateSelectedObjects(lcVector3& Delta, lcVector3& Remainder, bool
|
||||||
rot[2] = NewRotation[2];
|
rot[2] = NewRotation[2];
|
||||||
rot[3] = NewRotation[3] * LC_RTOD;
|
rot[3] = NewRotation[3] * LC_RTOD;
|
||||||
|
|
||||||
Piece->ChangeKey(m_nCurStep, m_bAddKeys, rot, LC_PK_ROTATION);
|
Piece->ChangeKey(m_nCurStep, gMainWindow->GetAddKeys(), rot, LC_PK_ROTATION);
|
||||||
Piece->UpdatePosition(m_nCurStep);
|
Piece->UpdatePosition(m_nCurStep);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6713,7 +6686,7 @@ void Project::TransformSelectedObjects(LC_TRANSFORM_TYPE Type, const lcVector3&
|
||||||
|
|
||||||
if (pCamera->IsSelected())
|
if (pCamera->IsSelected())
|
||||||
{
|
{
|
||||||
pCamera->Move(m_nCurStep, m_bAddKeys, Offset.x, Offset.y, Offset.z);
|
pCamera->Move(m_nCurStep, gMainWindow->GetAddKeys(), Offset.x, Offset.y, Offset.z);
|
||||||
pCamera->UpdatePosition(m_nCurStep);
|
pCamera->UpdatePosition(m_nCurStep);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6724,7 +6697,7 @@ void Project::TransformSelectedObjects(LC_TRANSFORM_TYPE Type, const lcVector3&
|
||||||
|
|
||||||
if (pLight->IsSelected())
|
if (pLight->IsSelected())
|
||||||
{
|
{
|
||||||
pLight->Move(m_nCurStep, m_bAddKeys, Offset.x, Offset.y, Offset.z);
|
pLight->Move(m_nCurStep, gMainWindow->GetAddKeys(), Offset.x, Offset.y, Offset.z);
|
||||||
pLight->UpdatePosition (m_nCurStep);
|
pLight->UpdatePosition (m_nCurStep);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6735,7 +6708,7 @@ void Project::TransformSelectedObjects(LC_TRANSFORM_TYPE Type, const lcVector3&
|
||||||
|
|
||||||
if (Piece->IsSelected())
|
if (Piece->IsSelected())
|
||||||
{
|
{
|
||||||
Piece->Move(m_nCurStep, m_bAddKeys, Offset.x, Offset.y, Offset.z);
|
Piece->Move(m_nCurStep, gMainWindow->GetAddKeys(), Offset.x, Offset.y, Offset.z);
|
||||||
Piece->UpdatePosition(m_nCurStep);
|
Piece->UpdatePosition(m_nCurStep);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6796,7 +6769,7 @@ void Project::TransformSelectedObjects(LC_TRANSFORM_TYPE Type, const lcVector3&
|
||||||
|
|
||||||
if (Piece->IsSelected())
|
if (Piece->IsSelected())
|
||||||
{
|
{
|
||||||
Piece->ChangeKey(m_nCurStep, m_bAddKeys, NewRotation, LC_PK_ROTATION);
|
Piece->ChangeKey(m_nCurStep, gMainWindow->GetAddKeys(), NewRotation, LC_PK_ROTATION);
|
||||||
Piece->UpdatePosition(m_nCurStep);
|
Piece->UpdatePosition(m_nCurStep);
|
||||||
nSel++;
|
nSel++;
|
||||||
}
|
}
|
||||||
|
@ -6839,7 +6812,7 @@ void Project::ModifyObject(Object* Object, lcObjectProperty Property, void* Valu
|
||||||
|
|
||||||
if (Part->mPosition != Position)
|
if (Part->mPosition != Position)
|
||||||
{
|
{
|
||||||
Part->ChangeKey(m_nCurStep, m_bAddKeys, Position, LC_PK_POSITION);
|
Part->ChangeKey(m_nCurStep, gMainWindow->GetAddKeys(), Position, LC_PK_POSITION);
|
||||||
Part->UpdatePosition(m_nCurStep);
|
Part->UpdatePosition(m_nCurStep);
|
||||||
|
|
||||||
CheckPointString = "Moving";
|
CheckPointString = "Moving";
|
||||||
|
@ -6853,7 +6826,7 @@ void Project::ModifyObject(Object* Object, lcObjectProperty Property, void* Valu
|
||||||
|
|
||||||
if (Rotation != Part->mRotation)
|
if (Rotation != Part->mRotation)
|
||||||
{
|
{
|
||||||
Part->ChangeKey(m_nCurStep, m_bAddKeys, Rotation, LC_PK_ROTATION);
|
Part->ChangeKey(m_nCurStep, gMainWindow->GetAddKeys(), Rotation, LC_PK_ROTATION);
|
||||||
Part->UpdatePosition(m_nCurStep);
|
Part->UpdatePosition(m_nCurStep);
|
||||||
|
|
||||||
CheckPointString = "Rotating";
|
CheckPointString = "Rotating";
|
||||||
|
@ -6923,7 +6896,7 @@ void Project::ModifyObject(Object* Object, lcObjectProperty Property, void* Valu
|
||||||
|
|
||||||
if (camera->mPosition != Position)
|
if (camera->mPosition != Position)
|
||||||
{
|
{
|
||||||
camera->ChangeKey(m_nCurStep, m_bAddKeys, Position, LC_CK_EYE);
|
camera->ChangeKey(m_nCurStep, gMainWindow->GetAddKeys(), Position, LC_CK_EYE);
|
||||||
camera->UpdatePosition(m_nCurStep);
|
camera->UpdatePosition(m_nCurStep);
|
||||||
|
|
||||||
CheckPointString = "Camera";
|
CheckPointString = "Camera";
|
||||||
|
@ -6937,7 +6910,7 @@ void Project::ModifyObject(Object* Object, lcObjectProperty Property, void* Valu
|
||||||
|
|
||||||
if (camera->mTargetPosition != TargetPosition)
|
if (camera->mTargetPosition != TargetPosition)
|
||||||
{
|
{
|
||||||
camera->ChangeKey(m_nCurStep, m_bAddKeys, TargetPosition, LC_CK_TARGET);
|
camera->ChangeKey(m_nCurStep, gMainWindow->GetAddKeys(), TargetPosition, LC_CK_TARGET);
|
||||||
camera->UpdatePosition(m_nCurStep);
|
camera->UpdatePosition(m_nCurStep);
|
||||||
|
|
||||||
CheckPointString = "Camera";
|
CheckPointString = "Camera";
|
||||||
|
@ -6951,7 +6924,7 @@ void Project::ModifyObject(Object* Object, lcObjectProperty Property, void* Valu
|
||||||
|
|
||||||
if (camera->mUpVector != Up)
|
if (camera->mUpVector != Up)
|
||||||
{
|
{
|
||||||
camera->ChangeKey(m_nCurStep, m_bAddKeys, Up, LC_CK_UP);
|
camera->ChangeKey(m_nCurStep, gMainWindow->GetAddKeys(), Up, LC_CK_UP);
|
||||||
camera->UpdatePosition(m_nCurStep);
|
camera->UpdatePosition(m_nCurStep);
|
||||||
|
|
||||||
CheckPointString = "Camera";
|
CheckPointString = "Camera";
|
||||||
|
@ -7044,7 +7017,7 @@ void Project::ZoomActiveView(int Amount)
|
||||||
{
|
{
|
||||||
float ScaledAmount = 2.0f * Amount / (21 - lcGetProfileInt(LC_PROFILE_MOUSE_SENSITIVITY));
|
float ScaledAmount = 2.0f * Amount / (21 - lcGetProfileInt(LC_PROFILE_MOUSE_SENSITIVITY));
|
||||||
|
|
||||||
gMainWindow->GetActiveView()->mCamera->Zoom(ScaledAmount, m_nCurStep, m_bAddKeys);
|
gMainWindow->GetActiveView()->mCamera->Zoom(ScaledAmount, m_nCurStep, gMainWindow->GetAddKeys());
|
||||||
gMainWindow->UpdateFocusObject(GetFocusObject());
|
gMainWindow->UpdateFocusObject(GetFocusObject());
|
||||||
gMainWindow->UpdateAllViews();
|
gMainWindow->UpdateAllViews();
|
||||||
}
|
}
|
||||||
|
@ -7152,6 +7125,9 @@ void Project::EndMouseTool(lcTool Tool, bool Accept)
|
||||||
if (!gMainWindow->GetActiveView()->mCamera->IsSimple())
|
if (!gMainWindow->GetActiveView()->mCamera->IsSimple())
|
||||||
CheckPoint("Roll");
|
CheckPoint("Roll");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case LC_TOOL_ZOOM_REGION:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7307,14 +7283,14 @@ void Project::PaintToolClicked(lcObject* Object)
|
||||||
|
|
||||||
void Project::UpdateZoomTool(lcCamera* Camera, float Mouse)
|
void Project::UpdateZoomTool(lcCamera* Camera, float Mouse)
|
||||||
{
|
{
|
||||||
Camera->Zoom(Mouse - mMouseToolDistance.x, m_nCurStep, m_bAddKeys);
|
Camera->Zoom(Mouse - mMouseToolDistance.x, m_nCurStep, gMainWindow->GetAddKeys());
|
||||||
mMouseToolDistance.x = Mouse;
|
mMouseToolDistance.x = Mouse;
|
||||||
gMainWindow->UpdateAllViews();
|
gMainWindow->UpdateAllViews();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Project::UpdatePanTool(lcCamera* Camera, float MouseX, float MouseY)
|
void Project::UpdatePanTool(lcCamera* Camera, float MouseX, float MouseY)
|
||||||
{
|
{
|
||||||
Camera->Pan(MouseX - mMouseToolDistance.x, MouseY - mMouseToolDistance.y, m_nCurStep, m_bAddKeys);
|
Camera->Pan(MouseX - mMouseToolDistance.x, MouseY - mMouseToolDistance.y, m_nCurStep, gMainWindow->GetAddKeys());
|
||||||
mMouseToolDistance.x = MouseX;
|
mMouseToolDistance.x = MouseX;
|
||||||
mMouseToolDistance.y = MouseY;
|
mMouseToolDistance.y = MouseY;
|
||||||
gMainWindow->UpdateAllViews();
|
gMainWindow->UpdateAllViews();
|
||||||
|
@ -7324,7 +7300,7 @@ void Project::UpdateOrbitTool(lcCamera* Camera, float MouseX, float MouseY)
|
||||||
{
|
{
|
||||||
lcVector3 Center;
|
lcVector3 Center;
|
||||||
GetSelectionCenter(Center);
|
GetSelectionCenter(Center);
|
||||||
Camera->Orbit(MouseX - mMouseToolDistance.x, MouseY - mMouseToolDistance.y, Center, m_nCurStep, m_bAddKeys);
|
Camera->Orbit(MouseX - mMouseToolDistance.x, MouseY - mMouseToolDistance.y, Center, m_nCurStep, gMainWindow->GetAddKeys());
|
||||||
mMouseToolDistance.x = MouseX;
|
mMouseToolDistance.x = MouseX;
|
||||||
mMouseToolDistance.y = MouseY;
|
mMouseToolDistance.y = MouseY;
|
||||||
gMainWindow->UpdateAllViews();
|
gMainWindow->UpdateAllViews();
|
||||||
|
@ -7332,14 +7308,14 @@ void Project::UpdateOrbitTool(lcCamera* Camera, float MouseX, float MouseY)
|
||||||
|
|
||||||
void Project::UpdateRollTool(lcCamera* Camera, float Mouse)
|
void Project::UpdateRollTool(lcCamera* Camera, float Mouse)
|
||||||
{
|
{
|
||||||
Camera->Roll(Mouse - mMouseToolDistance.x, m_nCurStep, m_bAddKeys);
|
Camera->Roll(Mouse - mMouseToolDistance.x, m_nCurStep, gMainWindow->GetAddKeys());
|
||||||
mMouseToolDistance.x = Mouse;
|
mMouseToolDistance.x = Mouse;
|
||||||
gMainWindow->UpdateAllViews();
|
gMainWindow->UpdateAllViews();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Project::ZoomRegionToolClicked(lcCamera* Camera, const lcVector3* Points, float RatioX, float RatioY)
|
void Project::ZoomRegionToolClicked(lcCamera* Camera, const lcVector3* Points, float RatioX, float RatioY)
|
||||||
{
|
{
|
||||||
Camera->ZoomRegion(Points, m_nCurStep, m_bAddKeys, RatioX, RatioY);
|
Camera->ZoomRegion(Points, m_nCurStep, gMainWindow->GetAddKeys(), RatioX, RatioY);
|
||||||
|
|
||||||
gMainWindow->UpdateFocusObject(GetFocusObject());
|
gMainWindow->UpdateFocusObject(GetFocusObject());
|
||||||
gMainWindow->UpdateAllViews();
|
gMainWindow->UpdateAllViews();
|
||||||
|
|
|
@ -374,7 +374,6 @@ protected:
|
||||||
int m_nCurAction;
|
int m_nCurAction;
|
||||||
PieceInfo* m_pCurPiece;
|
PieceInfo* m_pCurPiece;
|
||||||
PieceInfo* mDropPiece;
|
PieceInfo* mDropPiece;
|
||||||
bool m_bAddKeys;
|
|
||||||
unsigned char m_nCurStep;
|
unsigned char m_nCurStep;
|
||||||
|
|
||||||
lcuint16 m_nMoveSnap;
|
lcuint16 m_nMoveSnap;
|
||||||
|
|
|
@ -1495,6 +1495,7 @@ void View::OnLeftButtonDown()
|
||||||
case LC_TRACKTOOL_ROTATE_X:
|
case LC_TRACKTOOL_ROTATE_X:
|
||||||
case LC_TRACKTOOL_ROTATE_Y:
|
case LC_TRACKTOOL_ROTATE_Y:
|
||||||
case LC_TRACKTOOL_ROTATE_Z:
|
case LC_TRACKTOOL_ROTATE_Z:
|
||||||
|
case LC_TRACKTOOL_ROTATE_XY:
|
||||||
case LC_TRACKTOOL_ROTATE_XYZ:
|
case LC_TRACKTOOL_ROTATE_XYZ:
|
||||||
if (mProject->AnyObjectsSelected(true))
|
if (mProject->AnyObjectsSelected(true))
|
||||||
StartTracking(LC_TRACKBUTTON_LEFT);
|
StartTracking(LC_TRACKBUTTON_LEFT);
|
||||||
|
@ -1604,6 +1605,7 @@ void View::OnRightButtonDown()
|
||||||
case LC_TRACKTOOL_ROTATE_X:
|
case LC_TRACKTOOL_ROTATE_X:
|
||||||
case LC_TRACKTOOL_ROTATE_Y:
|
case LC_TRACKTOOL_ROTATE_Y:
|
||||||
case LC_TRACKTOOL_ROTATE_Z:
|
case LC_TRACKTOOL_ROTATE_Z:
|
||||||
|
case LC_TRACKTOOL_ROTATE_XY:
|
||||||
case LC_TRACKTOOL_ROTATE_XYZ:
|
case LC_TRACKTOOL_ROTATE_XYZ:
|
||||||
if (mProject->AnyObjectsSelected(true))
|
if (mProject->AnyObjectsSelected(true))
|
||||||
StartTracking(LC_TRACKBUTTON_RIGHT);
|
StartTracking(LC_TRACKBUTTON_RIGHT);
|
||||||
|
|
|
@ -1141,12 +1141,9 @@ void lcQMainWindow::updateTime(int currentTime, int totalTime)
|
||||||
statusTimeLabel->setText(QString(tr(" Step %1 ")).arg(QString::number(currentTime)));
|
statusTimeLabel->setText(QString(tr(" Step %1 ")).arg(QString::number(currentTime)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void lcQMainWindow::updateAnimation(bool addKeys)
|
void lcQMainWindow::setAddKeys(bool addKeys)
|
||||||
{
|
{
|
||||||
// TODO: update animation
|
actions[LC_VIEW_TIME_ADD_KEYS]->setChecked(addKeys);
|
||||||
/*
|
|
||||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(anim_toolbar.keys), bAddKeys);
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void lcQMainWindow::updateLockSnap(lcuint32 snap)
|
void lcQMainWindow::updateLockSnap(lcuint32 snap)
|
||||||
|
|
|
@ -35,7 +35,7 @@ public:
|
||||||
void updateAction(int newAction);
|
void updateAction(int newAction);
|
||||||
void updatePaste(bool enabled);
|
void updatePaste(bool enabled);
|
||||||
void updateTime(int currentTime, int totalTime);
|
void updateTime(int currentTime, int totalTime);
|
||||||
void updateAnimation(bool addKeys);
|
void setAddKeys(bool addKeys);
|
||||||
void updateLockSnap(lcuint32 snap);
|
void updateLockSnap(lcuint32 snap);
|
||||||
void updateSnap();
|
void updateSnap();
|
||||||
void updateUndoRedo(const char* undoText, const char* redoText);
|
void updateUndoRedo(const char* undoText, const char* redoText);
|
||||||
|
|
|
@ -508,12 +508,14 @@ void lcMainWindow::UpdateTime(int CurrentTime, int TotalTime)
|
||||||
window->updateTime(CurrentTime, TotalTime);
|
window->updateTime(CurrentTime, TotalTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
void lcMainWindow::UpdateAnimation(bool AddKeys)
|
void lcMainWindow::SetAddKeys(bool AddKeys)
|
||||||
{
|
{
|
||||||
lcQMainWindow* window = (lcQMainWindow*)mHandle;
|
lcQMainWindow* window = (lcQMainWindow*)mHandle;
|
||||||
|
|
||||||
if (window)
|
if (window)
|
||||||
window->updateAnimation(AddKeys);
|
window->setAddKeys(AddKeys);
|
||||||
|
|
||||||
|
mAddKeys = AddKeys;
|
||||||
}
|
}
|
||||||
|
|
||||||
void lcMainWindow::UpdateLockSnap(lcuint32 Snap)
|
void lcMainWindow::UpdateLockSnap(lcuint32 Snap)
|
||||||
|
|
Loading…
Add table
Reference in a new issue