Fixes#11873 this was the primary goal of these changes
Fixes (partially) #11874 the parts of a polyline are combined as a
compound object (shape) but it would be preferable for them to be made
into a wire (if possible)
Fixes#11872 Objects in a block definition are now kept separately
until the block is inserted, in which case the inserted objects are
subject to all the other options regarding combining.
Fixes (partially, review required) #11871 Text and dimensions are now
kept as part of the block definition and are placed in the drawing when
the block is inserted but this code has not been extensively tested.
Affects #11875, custom types are not made, but the labels now reflect
the object types rather than all being "Shapennn"
This leaves the importer options handling in a bit of a mess that needs
cleanup eventually, but this can be a new issue.
This includes some importer flags that have no corresponding options
(e.g. import frozen layers), some flags not yet implemented, some
flags not yet even declared in the code because their implementation
is further off (import hatch outlines), and some suggested future
options (import SOLIDs as faces)
Centralize the calculation of the OCS for entities as they're read
from the DXF. Most of the entities don't use this yet, but some of
them roll their own crude Normal Vector handling. Because the new
code takes priority over the old for reading the normal vector, such
code will always see (0, 0, 1) as the extrusion direction.
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