1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-03 17:56:21 +03:00

158 Commits

Author SHA1 Message Date
luzpaz
7e3d063cae
Documentation - Fix various typos found in codebase #350 2025-02-08 09:44:51 +00:00
dpasukhi
ac450989ef Testing - Fix loading order of OCAF and XDE in bug tests #265
GNU compiler have some optimization leads to multiple definitions
  of static global objects.
In case of static linking there are no possible issues, but in case of plug-in
  application can have multiple definitions of single object.
2025-01-17 18:34:14 +00:00
dpasukhi
ea86bfe2fa Testing - Removing direct DCAF loading #147
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
2024-11-05 17:00:06 +00:00
luzpaz
099e0d2524
0033807: Documentation - Fix various typos found in codebase 2024-08-31 14:26:15 +01:00
luzpaz
d51eb087ab
0033766: Documentation - Fix various typos found in codebase 2024-07-15 16:57:52 +01:00
Pasukhin Dmitry
818c68f22e 0033737: Data Exchange, XCAF - Implementing filter tree functionality
Implemented base functionality to filter tree with input label to keep.
2024-07-08 17:28:00 +02:00
anv
d3e00bfaa6 0033616: Application Framework - Using filter while reading XBF may result in unresolved links
- Added tracking of unresolved links for TreeNodes;
- Test case added.
2024-03-28 13:55:46 +00:00
dpasukhi
1103eb60af 0033370: Foundation Classes - Moving into STL and Boost functionality
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
2023-12-04 13:37:09 +00:00
ichesnok
a948803521 0033183: Data Exchange - Lose texture after saving XBF file
Texture reading and writing changed in VisMaterial drivers
2023-09-08 11:28:27 +01:00
dorlov
c772c6caa4 0030828: Data Exchange - The commands getting shapes from XCAF document should be available in C++
Added two new overloaded methods XCAFDoc_ShapeTool::GetOneShape: one returns TopoDS_Shape from TDF_LabelSequence and the other from a sequence of all top-level shapes which are free
2023-02-02 15:04:50 +00:00
smoskvin
057dcfddf7 0033225: Changing the status of tests on Ubuntu 20.04 and Windows 64 VC142 2022-11-28 00:04:06 +03:00
aba
f8d4cfbb80 0027142: Data Exchange - add possibility to set location in XCAFDoc_ShapeTool interface 2022-10-31 19:19:33 +03:00
atereshi
a453f9d128 0028414: Data Exchange, STEP - Face on a closed surface with single inner wire and without natural bound not correctly read
Problem: From the point of view of the STEP format (and others), it is allowed
to describe a face on a surface with natural boundaries (torus, sphere) without
specifying these boundaries. Thus, a face on a closed surface and containing
an inner wire (or several) is correctly defined and describes a face with a
cutout defined by this wire. At the same time, there is a function
(ShapeFix_Face::FixOrientation) in the ShapeHealing procedure that corrects the
orientation of the wires, and it starts before the function of adding natural
boundaries (ShapeFix_Face::FixAddNaturalBound). There are many shapes that have
incorrectly oriented wires and this procedure successfully heals them, but on a
correctly specified face with single inner wire on closed surface, we do not get
the entire surface with a cutout, but a part of the surface defined by the wire.
This fix is intended to resolve this ambiguity.

Change:
1. Added function isNeedAddNaturalBound that returns TRUE if face needs to add
 natural bounds.
2. Corrected condition in FixOrientation to ignoring faces that needs to add
 natural bounds.
3. For tests in which one wire was incorrectly oriented on a closed surface,
flag AddNaturalBound was disabled.
5. Test with cutout from torus was created: bugs step bug28414.

Result: By default, it is correct to add natural boundaries, because this case
 is correct from the point of view of the STEP format and others.
2022-10-31 18:10:55 +03:00
atereshi
51329afcef 0028024: Data Exchange - create a convenient mechanism for managing shape healing options when reading STEP or IGES file
Problem: There is no possibility to change shape healing options from DRAW without rewriting resource file.
Change: Shape healing parameters from STEP and IGES resource files were duplicated to InterfaceStatic. Resource manager initialize from InterfaceStatic if resource file name is empty.
Result: User can operationally change shape healing parameters from DRAW command using "param" command.
2022-10-31 18:06:02 +03:00
msv
fd5c113a03 0033100: Modeling Algorithms - XCAFDoc_Editor::RescaleGeometry does not rescale triangulations
Make XCAFDoc_Editor::RescaleGeometry to pass the flag theCopyMesh==true
in call to BRepBuilderAPI_Transform::Perform.

Correct the help of the command XRescaleGeometry.
2022-08-13 13:53:14 +03:00
aml
e1d576bf31 0033046: Modeling algorithms - improve performance of per-facet shape construction
Add new class (BRepBuilderAPI_MakeShapeOnMesh) to reconstruct shape from triangulation on per-facet basis.
2022-07-07 19:26:22 +03:00
dpasukhi
4f53e7b37c 0033011: Data Exchange - Backward compatibility XBF format
Fixed problem with moving the attribute position.
Made the same positions as version 7.5 with adding to the end.
2022-07-04 18:58:05 +03:00
ona
e01ce0cd52 0029854: XCAF GD&T: Clear contents of reserved labels only
Clear attributes from reserved child labels only
2022-06-30 19:33:37 +03:00
Dzmitry Razmyslovich
d7dac7fc36 0032784: BinXCAF fails to load documents containing the shapes with scaled/mirrored location
A flag not to raise an exception is used on reading of an XCAF document. If such a shape with scaling transformation is stored in the document, it should be read.
2022-01-19 20:01:14 +03:00
ssafarov
6ba81a695f 0026174: Data Exchange, IGES - Loss of color after the second write of file
A copy of myface is made, where further on the copy the geometry changes. We connect the face, wire, edge of the original shape with the one whose geometry was changed. This is done in order to get the original shape in the TransferWire() and TransferEdge() methods.
2021-12-13 09:36:02 +03:00
kgv
30fa5f6713 0032705: Test - name clashes within temporary files within bugs/caf/bug23766_X
Several test cases writing temporary files have been corrected.
2021-12-02 21:14:57 +03:00
dpasukhi
510d099d15 0028104: Data Exchange - Extract sub-assembly (XDE)
- Added getting and setting Material, VisMaterial and Props to XCAFDoc_Editor::Expand.
- Added XCAFDoc_Editor::Extract to transfer part to a new location
  - XCAFDoc_Editor::Extract allows to extract a part as a component or simply extract to an empty label with attached colors, layers, materials, vismaterials and props
- Added XCAFDoc_Editor::CloneMetaData to clone shape's attributes to new location
- Added XCAFDoc_Editor::CloneShapeLabel to clone shape to new document
- Added XCAFDoc_DocumentTool::Check*Tool methods to check an existing of an any tool
- Protected against creating a new label for non-existent tools via extract or expand process
2021-10-28 22:04:04 +03:00
dpasukhi
da80ff68f1 0031382: Data Exchange - BinXCAF should preserve length unit information
Possibility for adding LengthUnit info to XCAF document using special class XCAFDoc_LenghtUnit and XCAFDoc_LenghtUnitTool is implemented.
Package UnitsMethods is split: geom methods were placed to new file GeomConvert_Units which is in the toolkit TKXSBase, internal step scale factors was placed to StepData.
Updated UnitMethods to convert scale factor to different unit types.
Now, XSAlgo::XSAlgo_AlgoContainer is used to update unit info from static interface values.
New Draw command "XSetLengthUnit" and "XGetLengthUnit" for set or get XDE attribute.
Upgraded tests for STEP, IGES, OBJ, glTF, VRML formats to check area regressing with used unit.
Upgraded tests\de test cases to use any units in the "loop back" algorithms.
2021-08-20 20:30:11 +03:00
bugmaster
50174691dc 0032404: Draw - problems with definition of cpulimit in tests
- The maximum value of cpulimit in test cases was limited to 1000 seconds (~ 17 minutes)
- cpulimit 1000 has been added to hlr/begin
2021-06-16 17:10:53 +03:00
mkrylova
395d00e058 0032144: Draw Harness - add -silent option to command Close
- 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
2021-03-05 17:31:07 +03:00
luz paz
7b5e532f83 0031939: Coding - correction of spelling errors in comments [part 7]
Fix various typos

Fixed via codespell v2.1.dev
2021-01-20 21:27:44 +03:00
abv
ae9f4b64ca 0031851: Data Exchange, STEP - enable Unicode symbols in STEP export
Class STEPCAFControl_Writer is corrected to avoid replacing non-Ascii symbols by question marks, and spaces by underscores, on export to STEP.

Related: DRAW commands dealing with strings in OCAF documents are corrected to pass Unicode symbols as UTF-8.

Off-topic: code saving names of external STEP files in XDE and fetching them back is corrected to preserve Unicode symbols as UTF-8.

Added test bugs xde bug31851

Test de step_4 E7 corrected (no more replacement of spaces by underscores in names of layers)
2020-10-14 19:28:58 +03:00
ika
b95caec47d 0031466: Data Exchange - Cannot import layers from STeP file (7.4.0 regression)
Return possibility to find layers fir subshapes.
2020-09-12 20:42:23 +03:00
mpv
ef779ae0da 0031075: Application Framework - reading STEP file into TDocStd_Document leads to memory leaks
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
2020-06-19 19:08:46 +03:00
ika
331bcfc0d0 0031517: Data Exchange - wrong result of ShapeTool::UpdateAssemblies()
Get rid of problem with updating of parents shared one assembly.
2020-04-29 20:45:52 +03:00
ifv
fffc249f21 0027531: Modeling Algorithms - Make the algorithm Approx_SameParameter more clear and robust
Approx/Approx_SameParameter.cxx,hxx:
Class Approx_SameParameter refactoring. Logic is changed in many places to unify usage, simplify maintenance.
Method Curve2d() is changed to return Geom2d_Curve instead of Geom2d_BSplineCurve. Corresponding message is added to the upgrade guide.
.lxx file is merged into .hxx.
Tangent computation is extracted into special method.
Comparing number of sample points after CheckSameParameter(...) is added to define cases with projection fails.
Undesirable behavior when curves are not same parameterized is fixed.

Geom2dAdaptor/Geom2dAdaptor.cxx: treatment of offset curve is added

Adaptor3d/Adaptor3d_TopolTool.cxx: minor improvement of performance for BSpline surfaces with huge number of knots

Tests were modified according to new behavior of sameparameter algorithm
2020-03-06 15:54:46 +03:00
abv
7ed6e985e2 0013175: XCAF document with one vertex is exported to an incorrect STEP file
Added non-regression test case
2019-10-30 23:23:54 +03:00
kgv
ba00aab7a0 0029528: Visualization, TKOpenGl - allow defining sRGB textures
OpenGL rendering is now done into sRGB framebuffer.
OpenGl_ShaderManager::prepareStdProgramFboBlit() has been extended
by programs resolving MSAA texture and applying gamma correction as fallbacks.

Quantity_Color definition has been modified to store RGB components
in linear color space within Quantity_TOC_RGB type.
Standard colors defined by Quantity_NameOfColor enumeration has been updated accordingly.
New Quantity_TOC_sRGB type has been introduced to handle RGB components in non-linear sRGB color space.

OpenGl_TextureFormat class definition has been moved to dedicated files.
New method OpenGl_TextureFormat::FindFormat() replaces OpenGl_Texture::GetDataFormat().
New method OpenGl_TextureFormat::FindSizedFormat() replaces OpenGl_FrameBuffer::getColorDataFormat()
and OpenGl_FrameBuffer::getDepthDataFormat().

Graphic3d_TextureRoot::IsColorMap() - introduced new property defining
if RGB(A)8 image formats should be loaded as sRGB(A) textures or as data RGB(A) textures.
OpenGl_Texture initialization methods have been extended with new theIsColorMap argument.

vreadpixel - added argument -sRGB printing color in sRGB color space.

Test cases have been updated to new sRGB rendered results.
2019-10-22 15:15:52 +03:00
kgv
aaf8d6a98d 0030969: Coding Rules - refactor Quantity_Color.cxx color table definition
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.
2019-10-22 15:15:51 +03:00
ika
d6b200e03a 0030779: Data Exchange - Problems with located subshapes in expand compounds
Protect Expand compounds against problems with located subshapes.
Add method XCAFDoc_ShapeTool::AddSubShape() with Boolean output parameter.
Speed up XCAFDoc_ShapeTool::Expand().
Speed up XCAFDoc_ShapeTool::FindSubShape().
2019-06-14 12:27:34 +03:00
ika
7783ba1120 0030727: Data Exchange - Problems in Shape Tool
Add protection from return of not top-level shape by FindShape method.
Add protection against located roots into FindMainShape method.
Add new Draw command for FindMainShape.
Add flag findInstance to Draw command FindShape
2019-05-24 10:33:24 +03:00
kgv
c1197a1575 0030464: Visualization - unable to set sub-shape transparency using vaspects command
Added AIS_ColoredShape::SetCustomTransparency() for simple way for assigning sub-shape transparency.
2019-02-01 13:26:24 +03:00
kgv
3d999c6090 0030411: Data Exchange - attached model is exported as empty JT and VRML file
VrmlData_ShapeConvert::ConvertDocument() now handles reference labels within free shapes in the document.
2018-12-14 12:08:42 +03:00
kgv
7803c28d96 0030409: Data Exchange - exception during VRML file export
VrmlData_ShapeConvert::addShape() - handle case when parent node is NULL.
2018-12-14 12:07:56 +03:00
skl
1d441d1ac7 0030402: Data Exchange - exported VRML file has broken location information 2018-12-13 13:34:41 +03:00
oan
7bd071edb1 0026106: BRepMesh - revision of data model
Removed tight connections between data structures, auxiliary tools and algorithms in order to create extensible solution, easy for maintenance and improvements;
Code is separated on several functional units responsible for specific operation for the sake of simplification of debugging and readability;
Introduced new data structures enabling possibility to manipulate discrete model of particular entity (edge, wire, face) in order to perform computations locally instead of processing an entire model.

The workflow of updated component can be divided on six parts:
* Creation of model data structure: source TopoDS_Shape passed to algorithm is analyzed and exploded on faces and edges. For each topological entity corresponding reflection is created in data model. Note that underlying algorithms use data model as input and access it via common interface which allows user to create custom data model with necessary dependencies between particular entities;
* Discretize edges 3D & 2D curves: 3D curve as well as associated set of 2D curves of each model edge is discretized in order to create coherent skeleton used as a base in faces meshing process. In case if some edge of source shape already contains polygonal data which suites specified parameters, it is extracted from shape and stored to the model as is. Each edge is processed separately, adjacency is not taken into account;
* Heal discrete model: source TopoDS_Shape can contain problems, such as open-wire or self-intersections, introduced during design, exchange or modification of model. In addition, some problems like self-intersections can be introduced by roughly discretized edges. This stage is responsible for analysis of discrete model in order to detect and repair faced problems or refuse model’s part for further processing in case if problem cannot be solved;
* Preprocess discrete model: defines actions specific for implemented approach to be performed before meshing of faces. By default, iterates over model faces and checks consistency of existing triangulations. Cleans topological faces and its adjacent edges from polygonal data in case of inconsistency or marks face of discrete model as not required for computation;
* Discretize faces: represents core part performing mesh generation for particular face based on 2D discrete data related to processing face. Caches polygonal data associated with face’s edges in data model for further processing and stores generated mesh to TopoDS_Face;
* Postprocess discrete model: defines actions specific for implemented approach to be performed after meshing of faces. By default, stores polygonal data obtained on previous stage to TopoDS_Edge objects of source model.

Component is now spread over IMeshData, IMeshTools, BRepMeshData and BRepMesh units.

<!break>

1. Extend "tricheck" DRAW-command in order to find degenerated triangles.

2. Class BRepMesh_FastDiscret::Parameters has been declared as deprecated.

3. NURBS range splitter: do not split intervals without necessity. Intervals are split only in case if it is impossible to compute normals directly on intervals.

4. Default value of IMeshTools_Parameters::MinSize has been changed. New value is equal to 0.1*Deflection.

5. Correction of test scripts:

1) perf mesh bug27119: requested deflection is increased from 1e-6 to 1e-5 to keep reasonable performance (but still reproducing original issue)
2) bugs mesh bug26692_1, 2: make snapshot of triangulation instead of wireframe (irrelevant)

Correction in upgrade guide.
2018-11-02 17:06:40 +03:00
skl
5ada54fb79 0030280: Data Exchange - broken VRML output due to unescaped symbols starting comment block 2018-10-23 20:10:58 +03:00
skl
9b9f2fe972 0030221: Data Exchange - VRML is exported with inversed normals
Added test case bugs/xde/bug30221
2018-10-11 19:12:12 +03:00
kgv
1f26f80bb7 0029967: Draw Harness - command bounding has annoying syntax
Bnd_OBB constructor from Bnd_Box is fixed for VOID input.

DRAW command bounding command is adjusted:
- Support of old syntax 'bounding shape'is restored.
- Exception on VOID bounding box is avoided.
- Arguments are handled in case-insensitive way.
- Options -s, -perfmeter, and ability to set result as first argument are removed as redundant.
- Help is moved to command definition.

Separate command OCC29311 is added (in QADraw) to do the same as option -perfmeter did; tests are updated.
2018-07-27 16:19:26 +03:00
kgv
4c4420dfe9 0029868: Draw Harness - help message for readstl command is unclear
readstl syntax has been modified, so that it creates a single-face triangulation by default.
The argument "trinagulation" is no more supported.
The new argument "-brep" has been introduced to generate
a compound of per-triangle faces instead (old default behavior of the command).
2018-07-06 15:53:48 +03:00
ika
fcdb829c25 0029890: Data Exchange - Problem in Expand Compounds
XCAFDoc_ShapeTool::Expand method now avoids creation of subshapes under assemblies.
XCAFDoc_ShapeTool::AddSubShape now avoids creation subshapes under all labels except for simple parts.
2018-06-29 12:10:37 +03:00
ika
8cbf1f8d41 0029888: [Regression] Data Exchange - XCAFDoc_Editor::Expand() removes names
XCAFDoc_Editor::Expand function avoids expanding references to assemblies.
2018-06-29 12:09:25 +03:00
ika
f277ba3771 0029821: Data Exchange - Wrong processing of subshapes in ShapeTool
Improve FindSubShape method in ShapeTool.
Update Expand compounds, according to changes in ShapeTool.
Add FindSubShape and AddSubShape commands for Draw.
2018-06-14 14:03:07 +03:00
ika
bc728d2621 0029599: Data Exchange - Incorrect expand compound method in XDE
Improve processing of subshapes in ShapeTool
Fix sharing and calculating location for subshapes
Switch off autonaming for expand
2018-03-29 17:13:24 +03:00
snn
eacdb38f2e 0029525: PMI dimension names
Implemented semantic PMI names translation from STEP to XCAF in OCCT:
- [Get/Set]SemanticName functions added to XCAFDimTolObjects_*Object classes
- X[Get/Set]GDTSemanticName draw commands added
- test case added
2018-03-29 17:13:21 +03:00