Adding a new mouse navigation option to FreeCAD

From FreeCAD Documentation
Revision as of 13:37, 14 April 2023 by Roy 043 (talk | contribs) (Removed Tutorials_navi)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This documentation is not finished. Please help and contribute documentation.

GuiCommand model explains how commands should be documented. Browse Category:UnfinishedDocu to see more incomplete pages like this one. See Category:Command Reference for all commands.

See WikiPages to learn about editing the wiki pages, and go to Help FreeCAD to learn about other ways in which you can contribute.

Tutorial
Topic
Adding new navigation option to FreeCAD
Level
Advanced
Time to complete
Authors
Kunda1
FreeCAD version
0.19.x and above
Example files
See also
None

Introduction

This tutorial attempts to help developers understand how to add their own custom 'mouse' models to FreeCAD. There are currently several options within FreeCAD to customize navigation, they are listed in the Mouse navigation page. Some of the options include: Revit, OpenCascade, Inventor, Touchpad etc...

Prerequisite

  • Familiarity with C++ syntax
  • Ability to compile FreeCAD from source

Relevant source files

At the time of writing this documentation the relevant source code files are located at:

  • src/Gui/NavigationStyle.(h,cpp)
  • src/Gui/(Foo)NavigationStyle.cpp Foo is a placeholder for the different mouse/navigation modes, for example: Revit, Inventor, OpenCascade, Touchpad, CAD etc...
  • src/Gui/CMakeLists.txt - Add your new mouse/navigation mode here so it's picked up by the compiler
  • src/Gui/SoFCDB.cpp

Historical code commits

We can refer to previous code commits that added different mouse modes for orientation. Here are a few:

Source code