Change file on the 3d view when editor file changes
ClosedPublic

Authored by rizzitello on May 27 2018, 1:35 PM.

Diff Detail

Repository
R231 Atelier
Branch
updateModel
Lint
No Linters Available
Unit
No Unit Test Coverage
rizzitello requested review of this revision.May 27 2018, 1:35 PM
rizzitello created this revision.
tcanabrava added inline comments.May 28 2018, 8:19 AM
src/widgets/3dview/viewer3d.cpp
38

don't initialize a string to empty using "", this actually creates a string of size 0 having the '\0' char.
leave it as QString() *or* do nothign, it's correctly default initialized.

40–41

this looks like a debug code that was forgot.

61

hm? why would you do this?

73

use qCDebug

74

stray space.

src/widgets/gcodeeditorwidget.cpp
100–102

the order of the emits matter?
if not one can save the pointers and the url and only call emit once per method.

rizzitello marked 5 inline comments as done.
rizzitello edited the summary of this revision. (Show Details)
  • Rebase, Some of Tomaz adjustments
rizzitello added inline comments.May 28 2018, 12:32 PM
src/mainwindow.cpp
80

This should have been removed durring previous merge

src/widgets/3dview/viewer3d.cpp
38

I will remove this and use its default.

61

This is part of D12719
Its creating a QUrlList from the QVariant that the QML drop target provides.

73

This area needs code still. Here we should be clearing the view. The Debug and space will go when finished.

rizzitello marked an inline comment as done.May 28 2018, 12:37 PM
patrickelectric requested changes to this revision.May 28 2018, 1:08 PM
patrickelectric added inline comments.
src/mainwindow.cpp
80

Rebase.

src/widgets/3dview/viewer3d.cpp
40–41

it is not used.

73

When you do a drawModel the previous one it is not being cleaned ?

This revision now requires changes to proceed.May 28 2018, 1:08 PM
rizzitello planned changes to this revision.May 28 2018, 3:45 PM

An update is coming soon....

src/widgets/3dview/viewer3d.cpp
73

It seams that Its not always cleaned. For example if you load 3 files sometimes you will not see the 3rd one drawn but it will show its url correctly.(this issue is not created from this patch) Ideally we viewer3d would have a clear() method so we can clear the contents of the view before we draw and anytime we do not have a model loaded.

rizzitello updated this revision to Diff 35031.May 28 2018, 3:52 PM
rizzitello marked 2 inline comments as done.
  • Remove unused Code
  • GCodeEditorWidget::newDoc() => GCodeEditorWidgetnewDoc(const QUrl &file)
  • Add currentFileChanged emit, cleanup GCodeEditorWidget::currentIndexChanged
  • Connect GCodeEditorWidget::currentFileChanged to Viewer3d::drawModel
rizzitello updated this revision to Diff 35050.May 28 2018, 6:48 PM
  • Remove more unneeeded code
rizzitello updated this revision to Diff 35053.May 28 2018, 7:20 PM
rizzitello marked 2 inline comments as done.
  • Rebase
patrickelectric accepted this revision.May 28 2018, 7:22 PM
This revision is now accepted and ready to land.May 28 2018, 7:22 PM
laysrodrigues accepted this revision.May 29 2018, 12:15 PM
rizzitello closed this revision.May 29 2018, 12:17 PM