DCAF require VISUALIZATION for correct work.
In some scenario DRAWEXE can generate a dublicates of the
internal static singletons. This means each dynamic library
will have their own instance of the static singleton.
Update all direct library loading to use the DCAF plugin
mechanism. This will ensure that the DCAF plugin is loaded
only once and that the correct instance is used.
Originally issue is reproduced only Linux with dlopen with "RTLD_LAZY".
Can be resolved additionally adding "RTLD_LAZY | RTLD_GLOBAL" for dlopen
NCollection containers update:
- NCollection_Array1 - updated functionality
- NCollection_Array2 - NCollection_Array1 as a wrapper for 2array
- NCollection_Vector -> NCollection_DynamicArray was renamed and reworked.
TCollection:
- Use static empty string to avoid allocations on empty string
NCollection allocators update:
- NCollection_Allocator - allocator that used Standard::Allocate
- NCollection_OccAllocator - allocator-wrapper that used OCC BaseAllocator objects
- NCollection_IncAllocator - rework to increase performance
Standard:
- Rework functionality to use different allocation libs
- Implement basic of new way to wrap allocations tools
- Define 4 ways to allocation (defines in configure stage)
Additional changes:
- Hash function uses std::hash functionality
- size_t as a hash value
- New HashUtils with Murmur and FVN hash algo for x32 and x64
- Deprecated _0.cxx and .gxx DE classes reorganized
- Create own utility for std memory
- Update Standard_Transient to be more platform-independent
Math TK changes:
- math_Vector -> match_BaseVector<>
- Buffer decreased to cash 32 elements instead of 512
Improved the test stability: created 10 iterations of measurements and take the minimum to
minimize the affect of other processes and threads; increased the compare range of
the quarter and the whole of the document load.
The following classes have been removed as obsolete:
- BRepAlgo_BooleanOperation
- BRepAlgo_Fuse
- BRepAlgo_Cut
- BRepAlgo_Common
- BRepAlgo_Section
The corresponding classes from BRepAlgoAPI package have to be used instead.
Draw commands:
- fuse
- cut
- common
- section/psection
have also been removed as obsolete.
The corresponding commands for modern Boolean operations algorithm (bfuse/bcut/bcommon/bsection) have to be used instead.
Adjustment of the test cases to use the commands for modern algorithm.
Implementation of new format for quick reading and writing parts of the documents (sub-set of labels and sub-set of attributes). It consists in writing shapes and all their contents right in the TNaming_NamedShape attribute placement and skipping the shape section. New format 12 for Binary file types is assigned to this version.
Added PCDM_ReaderFilter class that could be used in Open methods of TDocStd_Application. If it is defined, it allows to read:
- into already opened document in append mode AppendMode_Protect (do not overwrite existing attributes) or AppendMode_Overwrite
- only specified sub-trees of the document using AddPath (const TCollection_AsciiString& theEntryToRead)
- only specified attributes using AddRead (const TCollection_AsciiString& theRead) where theRead could be "TDataStd_Name", for example
- to skip specified attributes read using AddSkipped (const TCollection_AsciiString& theSkipped) where theSkipped could be "TDF_Reference", for example
The current limitations:
- only in Bin format
- if shapes have in the document shared topology, loaded in "append" mode in different "load" operations, they will have no shared topology anymore
Modifications:
BinLDrivers and BinDrivers packages - modifications related to the quick part tree format flag usage, skipping shape section writing and adding labels sizes into the document to be able to pass labels during the reading quickly.
BinObjMgt_Persistent and BinObjMgt_Position - to add possibility to write directly into the stream some data just after the attribute. Before this record a data-size is recorded.
BinMXCAFDoc package modifications to write BinMXCAFDoc_LocationDriver location in the same way as shapes write location data right after the attribute (empty) data in this new format.
BinTools package: creation of ShapeReader and ShapeWriter classes with same root class ShapeSetBase with ShapeSet class. These classes allows to write/read shapes directly to the stream. If some object is already in the stream, write a reference - relative position of the duplicated object. The old format of documents is still supported by Bin_ToolsShapeSet class.
PCDM_ReaderFilter - Allows the user to create a reading filter. It contains algorithm to browse labels tree quickly, without usage of referencing by entry-strings.
TDocStd, CDF and some other packages are changed for supporting reading filters API and options.
Tests, documentation and upgrade information are also added for both issues: 31839 and 31918 related to this commit.
A table for fast access to the labels by entry is implemented in OCAF document. A method TDF_Data::SetAccessByEntries(true) fills-in a table for fast access to the labels. New labels, created later will be added to the table automatically. The method TDF_Tool::Label() will search the entry in the table and then, if not found, will call the old code. Disabling of usage of the table (by calling of TDF_Data::SetAccessByEntries(false)) cleans the internal table of entries - labels. By default, the table is not used.
This improvement is useful for large documents with a lot of labels, and if the application uses entries to get labels. The application should call TDF_Data::SetAccessByEntries(true) for a document and then, the method TDF_Tool::Label() called inside OCAF and XCAF will use the fast access to the labels and speed-up the application.
Also, the method TDF_Tool::Entry() is improved (by MPV).
Modified files:
- TDF_Data.hxx and cxx: the new methods SetAccessByEntries(bool), IsAccessByEntries() and GetLabel(entry) are implemented. No need to use the method GetLabel() directly. It is called in TDF_Tool::Label().
- TDF_Label.cxx: adding of a newly created label to the table of entries - labels.
- TDF_Tool.cxx: the method Entry() is accelerated (by MPV) and Label() is improved to call TDF_Data::GetLabel().
- DDF_DataCommands.cxx: a new draw-command is added SetAccessByEntry, which sets or unsets usage of the table for fast access to the labels. Usage of the draw-command is illustrated in a new test "bugs caf bug31920".
Tests:
- bugs caf bug31920: a new simple test to check TDF_Tool::Label() when fast access to the labels is on.
Doc:
- dox\upgrade\upgrade.md is extended for new information
- Extended command Close with an option -silent
- Extended command Close to handle */-ALL for closing ALL document
- Replaced catch {Close D} by Close D -silent in tests
In test it should be taken into account that
lappend listmem [meminfo h]
checktrend $listmem 0 0 "Memory leak"
also gets memory (also about 100 bytes per iteration).
Storage and retrieval of a document by means of a stream is distributed to TObj model.
Modified files:
-TObj_Model.hxx, cxx - the virtual methods Load() and SaveAs() obtained a stream as an argument instead of a file name.
-TObj_Application.hxx, cxx - same extension: the virtual methods LoadDocument() and SaveDocument() use a stream to open and save a document.
-TObjDRAW.cxx - draw-commands TObjSave and TObjLoad are extended for -stream parameter, which allows usage of a file input or output stream instead of a file name.
A new test:
- bugs caf bug29901 - it creates a simple TObj-model, saves it on disk using a file stream, loads it by means of a file stream and checks the content.
Modified test:
- bugs caf bug28425 - just improved to proper manipulate a test-file on disk.
1. Unification of usage of a storage version of an OCAF document by XML and binary file formats.
2. A new format version enumeration in TDocStd package: TDocStd_FormatVersion.
3. Removal of unnecessary methods for storage version like XmlLDrivers::StorageVersion() and BinLDrivers::StorageVersion().
4. Support of old documents (storage version <= 9) in binary file format (came from ESA).
New files:
- TDocStd_FormatVersion.hxx: a new storage format version enumeration for an OCAF document.
Modified files:
- CDM_Document.hxx and cxx: removal of storage format version property (moved to TDocStd_Document).
- TDocStd_Document.hxx and cxx: a storage format version property (moved from CDM_Document).
- BinLDrivers_DocumentSection.hxx and cxx: support of old document storage version in binary file format.
- BinDrivers_DocumentStorageDriver.hxx and cxx,
- BinLDrivers_DocumentStorageDriver.hxx and cxx,
- BinLDrivers_DocumentRetrievalDriver.cxx,
- XmlLDrivers_DocumentRetrievalDriver.cxx,
- XmlLDrivers_DocumentStorageDriver.cxx: usage of document storage version from TDocStd_Document in storage and retrieval drivers.
- DDocStd_ApplicationCommands.cxx: draw-command name StorageVersion is replaced by StorageFormatVersion (to be the same everywhere). A corresponding script is corrected too.
New test:
- bugs caf bug29217: a test case for old document storage version in binary file format. It checks several attributes saved by the version TDocStd_FormatVersion_VERSION_7 (old) and the latest version.
Modified test:
- caf presentation M1: the test used a file in the current folder, not in {imagedir} like all other tests.
- bugs caf bug28691
Documentation:
- dox/upgrade/upgrade.md
// All remarks are fixed.
Class CDF_Session is removed.
Integrated previously but not described:
0029195: OCAF - ensure thread safety for different documents.
Static local variables are eliminated in PCDM package.
Global documents metadata look-up table and directory of opened documents are removed.
Look-up table is maintained now as field in instances of the CDM_Application class.
Methods providing iteration by components are removed from class CDF_Store; signature of methods returned Standard_ExtString is changed to return Handle(TCollection_HExtendedString).
Support of different "Presentations" of documents is eliminated.
Added theAllSubChildren flag to the TObj_OcafObjectIterator to iterate all sub-children.
By default it still iterates only the first level of children.
Draw_Interpretor, CommandCmd() - catched exceptions and messages put into Tcl string result
before throwing a Tcl exception (return 1) are now print in intense red (using Message::SendFail()).
Duplication of exception message in std::cout and Tcl output has been removed.
Draw Harness plugins have been updated to use either Message::SendFail() or theDI instead of std::cout/std::cerr
for printing colored error message before throwing a Tcl exception.
In the TDocStd_Owner keep simple pointer to TDocStd_Document instead of Handle. This causes automatic destruction of the document without explicit call of Close.
In Standard_Type added a static variable theType that initializes theRegistry map earlier. Otherwise exit from Draw interpreter crashes in many test-cases because not-closed transactions are aborted on document handle release from Draw theVariables map.
Corrected method for test OCC159bug due to the fact that Owner does not add a ref count now
Close the document in the end of bugs xde bug22776 otherwise double remove of visualization objects (on library exit and on visualization attributes remove from the document) causes crash on exit from draw
Added a new test bugs caf bug31075
Class Standard_BaseDriver is inherited from Standard_Transient, its descendants are updated accordingly.
Handle is used to manipulate objects of this class and its descendants (instead of references or raw pointers) to ensure automatic destruction.
Added test bugs caf bug31546
Related:
- Standard_OVERRIDE is added in declarations of virtual methods in descendants of Storage_BaseDriver
- Methods operator << and operator >> are removed in descendants of Storage_BaseDriver (they repeat the same methods inherited from the base class)
- Typedef PCDM_BaseDriverPointer is marked as deprecated
- Unused class DDI_Ostream is removed
- Private field Standard_Transient::count is renamed to myRefCount_ to avoid compiler warnings if the same name is used within the scope of a descendant class
- Output of meaningful error messages is restored in DRAW commands fsdread and fsdwrite
A case of reading of a very small value was skipped, for example: 2.1219957909652723e-314.
Fixed in XmlMDataStd_RealArrayDriver.cxx and XmlMDataStd_RealListDriver.cxx
// A test file bug29452.xml is extended to check this skipped case.
The table of named colors has been compressed and moved out
from Quantity_Color.cxx into Quantity_ColorTable.pxx.
Quantity_NameOfColor - grayscale enumeration values have been re-ordered to fix discontinuity.
Duplicating colors has been merged within enumeration:
CHARTREUSE=CHARTREUSE1, GOLD=GOLD1, GREEN=GREEN1, ORANGE=ORANGE1,
ORANGERED=ORANGERED1, RED=RED1, TOMATO=TOMATO1, YELLOW=YELLOW1.
Added aliases to several other common colors:
BLUE=BLUE1, CYAN=CYAN1, LIGHTCYAN=LIGHTCYAN1, MAGENTA=MAGENTA1.
Quantity_Color class definition has been cleaned to follow OCCT coding style.
Quantity_Color now stores NCollection_Vec3<float> as class field instead of separate components.
Removed unused class Quantity_ColorDefinitionError.
New methods Quantity_Color::Convert_LinearRGB_To_sRGB() and Quantity_Color::Convert_sRGB_To_LinearRGB()
converting RGB components from linear to non-linear sRGB colorspace and vice versa.
Image_PixMap::PixelColor() and Image_PixMap::SetPixelColor() methods have been extended
with an optional argument for performing linearization/delinearization of 8-bit sRGB pixel formats.
Draw Harness command AISColor has been corrected to take color name instead of enumeration index.
Added protection against clash of attributes with the same GUID when more than one attribute of the same type but with different GUIDs are stored in the file.
If attribute with default GUID has already been read, then adding next empty attribute of the same type (done at start of its reading) will fail; in such case another attempt is made with Null GUID.
Method XmlObjMgt::GetReal() is improved to (a) recognize NAN and infinity written by old MSVC runtime (like 1.#QNAN and 1.#INF) and (b) detect situation when there are some trailing non-space symbols after the real value, returning False in such case.
Reading of real-valued attributes (single real, array, list) from OCAF XML format is improved to create valid attribute even if parsing of (some) members fails; warning is generated instead of error in such case.
Added test bugs caf bug29452
1. Implementation of the *Generated* method for the algorithms in Boolean Component.
In terms of these algorithms the shape from the arguments can have Generated shapes only if these new shapes have been obtained as a result of pure intersection (not overlapping) of this shape with any other shapes from arguments.
Thus, the Generated shapes are always:
* VERTICES created from the intersection points and may be Generated from edges and faces only;
* EDGES created from the intersection edges and may be Generated from faces only.
So, only EDGES and FACES could have information about Generated shapes. For all other types of shapes the list of Generated shapes will be empty.
2. Optimization and simplification of the Modified and IsDeleted methods based on the correct filling of the BOPAlgo_BuilderShape::myImagesResult map.
3. Provide history of unification of the solids in the CellsBuilder algorithm.
4. Update of the documentation of Boolean Operations User guide with new chapter "History Information" describing rules for filling history for operations in Boolean Component.
5. Test cases for the issue. New grid "history" has been added into "boolean" category.
Reproduced on TDF_Reference attribute that refers to label with zero-tags entry. Make checking of saved/retrieved tags in XML format pass zero-tags as correct.