Eliminate m_measurement_inch to clean up logic for priority of MEASUREMENT and INSUNITS.
Save the actual scaling factor rather than the scaling enum so a switch statement is not executed for each call to mm()
Add to CDxfRead the work to handle dxfScaling option, ImpExpDxfRead just has to set it up now.
Get the scaling factor from a lookup table rather than a switch statement
Display a message explaining what the scaling factor is and where it comes from
Remove large amount of Lint.
Colors as assigned to imported drawing entities if they are not merged
with other entities.
The code has been refactored to remove much duplication in reading of
attributes.
The code gives brief messages on the Python console about unsupported
DXF festures and also issues some new errors.
There is no support yet for making colors 1-9 and 250-255 contrast with
the creeen background color. Colors are generated by code rather than a
lookup table; this code can eventually modify the colors it generates to
contrast with a specific background color.
This patch substitutes by isAttachedToDocument() (almost) everywhere where
getNameInDocument() is used for this purpose.
The very few places not touched by this patch demand a (just a little) less trivial change.
When we change the returning type of getNameInDocument() to std::string,
those places will be easily found, because they shall generate a compiler error
(converting std::string to bool).
Rationale:
The fact that getNameInDocument() return nullptr to indicate
that the object is not attached to a document is responsible for lots of bugs
where the developer does not check for "nullptr".
The idea is to eliminate all those uses of getNameInDocument() and, in the near future,
make getNameInDocument() return always a valid std::string.
Rather than generating Python code and interpreting it, which, in C++, is fraught with issues of creating the correct syntax for a str token when the text contains certain special characters like double-quote and backslash, the modified code makes call(s) to PyObject_CallObject which takes the C++ string and makes the appropriate conversion itself. The steps in building the Position passed to make_text are also done using c++ objects until the final Python Placement object is needed.
* Added uppercase extensions for supported formats
In the file App\Application.cpp
* Added file types in upper case
* Adds uppercase file types to the file import filter.
Fixes#10879
* Added filter for *.fcmacro *.fcscript
* Import: Support DXF text rotation - fixes#10882
- Reads and supports text rotation in builtin DXF import
- Makes the builtin DXF import produce Draft texts instead of App::Annotations
- Extends the arguments of Draft make_text()
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Add new method ExportOCAF::exportObjects() to avoid code duplication
* Simplify handling of arguments passed to Python handler
* Fix several lint warnings
* Move ImportOCAFExt to the corresponding source files
* [Base] Add hasExtension for multiple values
* [Gui] Use hasExtension for multiple values
* [Drawing] Use hasExtension for multiple values
* [Fem] Use hasExtension for multiple values
* [Import] Use hasExtension for multiple values
* [Mesh] Use hasExtension for multiple values
* [Part] Use hasExtension for multiple values
* [TechDraw] Use hasExtension for multiple values