WandererFan / FreeCAD-TechDraw

This repo is obsolete. Please use FreeCAD/FreeCAD.
Other
3 stars 1 forks source link

Ability to Produce Drawings Without /Gui #23

Closed WandererFan closed 8 years ago

WandererFan commented 8 years ago

TechDraw/App will not produce a drawing on its own. TechDraw/Gui is required to provide the QGraphicsScene which contains the actual drawing. This seems in conflict with FreeCAD's principle of being able to work in a non-Gui mode.

ianrrees commented 8 years ago

Very true - I'll look at separating the GUI bits from the QGraphicsScene.

ianrrees commented 8 years ago

Acceptance tests for this:

  1. Able to build TechDraw with BUILD_GUI=0 which doesn't include any files in the Gui directory. This currently works for TechDraw, but not for a few other modules in FreeCAD...
  2. Able to output an SVG (pdf?) from TechDraw of a Part Design object via a Python script run in FreeCADCmd built with BUILD_GUI=0.
  3. 1 and 2 imply that non-GUI code that's currently in src/Mod/TechDraw/Gui are moved to App directory.
ianrrees commented 8 years ago

I moved one class following the pattern in my email as a test case. The diff is pretty confusing...

https://github.com/ianrrees/FreeCAD_tinkering/commit/e1791c05f3599e6c2e9b0894fc5099b6b21622c7?diff=split

WandererFan commented 8 years ago

At some point in a change this big, we're going to have to just delete all the old stuff and replace everything. Like we did with luke's stuff and the Drawing->TechDraw conversion.

On Sun, Feb 14, 2016 at 3:40 AM, Ian notifications@github.com wrote:

I moved one class following the pattern in my email as a test case. The diff is pretty confusing...

ianrrees/FreeCAD_tinkering@e1791c0?diff=split https://github.com/ianrrees/FreeCAD_tinkering/commit/e1791c05f3599e6c2e9b0894fc5099b6b21622c7?diff=split

— Reply to this email directly or view it on GitHub https://github.com/WandererFan/FreeCAD-TechDraw/issues/23#issuecomment-183850927 .

ianrrees commented 8 years ago

Got to the point where we can make drawings via Python with BUILD_GUI=0 and export them to SVG. It turned out to be a bit of a pain to spin up a QGraphicsScene without the GUI going - there's an AFACT undocumented dependency on Qt's event loop, which isn't running if FreeCAD was built without GUI. See dd03d4a70f43a695fe892e1287e33126755ea564 for the workaround.

Currently, can only include templates in the drawings, but I think it shouldn't be too hard to move the other QGraphicsItems code over.

WandererFan commented 8 years ago

Fuzzy area for me, but isn't the event loop part of QtCore/QApplication?

On Tue, Apr 19, 2016 at 4:36 AM, Ian notifications@github.com wrote:

Got to the point where we can make drawings via Python with BUILD_GUI=0 and export them to SVG. It turned out to be a bit of a pain to spin up a QGraphicsScene without the GUI going - there's an AFACT undocumented dependency on Qt's event loop, which isn't running if FreeCAD was built without GUI. See dd03d4a https://github.com/WandererFan/FreeCAD-TechDraw/commit/dd03d4a70f43a695fe892e1287e33126755ea564 for the workaround.

Currently, can only include templates in the drawings, but I think it shouldn't be too hard to move the other QGraphicsItems code over.

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/WandererFan/FreeCAD-TechDraw/issues/23#issuecomment-211797499

ianrrees commented 8 years ago

Yes, and I think it might be worth discussing with the main developers whether we want the FreeCAD command line application to have a Qt event loop running. Certainly would make some things easier, and I can't think of any major problems with doing that.

WandererFan commented 8 years ago

I'll leave that to you. I'm no expert in Qt arch.

On Tue, Apr 19, 2016 at 4:55 PM, Ian notifications@github.com wrote:

Yes, and I think it might be worth discussing with the main developers whether we want the FreeCAD command line application to have a Qt event loop running. Certainly would make some things easier, and I can't think of any major problems with doing that.

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/WandererFan/FreeCAD-TechDraw/issues/23#issuecomment-212124097

WandererFan commented 8 years ago

Note that Clip is currently broken due to this issue. Y coordinates not updated. See GIBase::getYInClip().

WandererFan commented 8 years ago

This issue appears to be insurmountable at this point due to TechDraw's tight coupling with QGraphics and QtSvg modules.

On indefinite hold.