1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-04 18:06:22 +03:00

175 Commits

Author SHA1 Message Date
abv
b1811c1d2b 0029151: GCC 7.1 warnings "this statement may fall through" [-Wimplicit-fallthrough=]
New macro Standard_FALLTHROUGH is defined for use in a switch statement immediately before a case label, if code associated with the previous case label may fall through to that
next label (i.e. does not end with "break" or "return" etc.).
This macro indicates that the fall through is intentional and should not be diagnosed by a compiler that warns on fallthrough.

The macro is inserted in places that currently generate such warning message and where fallthrough is intentional.

Doxygen comments are provided for this and other macros in Standard_Macro.hxx.
2017-10-04 15:28:02 +03:00
oan
71c810df61 0028824: Possibility to build OCCT 7.1.0 and above using Visual Studio 2008
Possibility to build OCCT using Visual Studio 2008 (VC9) is restored.
For that:

- template functions and classes from namespace std or tr1 (for VC9) are imported to namespace opencascade which is then used instead of std in relevant places
- templates not provided by compiler (VC9) but required for OCCT are defined in this namespace (in Standard_Handle.hxx)
- methods implementing move semantics are excluded for VC9 compiler (which does not support && syntax)
- support of vc9 compiler is restored in build procedures and environment scripts
- check of type of the current class in macros DEFINE_STANDARD_RTTI* is refactored

VS 2008 is restored in the list of supported platforms on Overview / System Requirements.
2017-09-22 11:52:00 +03:00
bugmaster
30017a480e Incitement OCCT version to 7.2.1 dev 2017-09-22 11:51:18 +03:00
bugmaster
230b2bff00 Incrementing OCCT version up to 7.2.0 2017-08-30 13:52:53 +03:00
Benjamin Bihler
1aa738ddd6 0028854: The documentation should state where handle reference counting happens
The comment to class opencascade::handle<> in Standard_Handle.hxx now explains better the features differing it from std::shared_ptr<>.
2017-08-24 19:12:06 +03:00
Thomas Krijnen
d37ac0c26e 0028983: Configuration - HAVE_NO_DLL causes compilation to fail on MSVC 2017-08-10 13:56:10 +03:00
kgv
e2c4ce4869 0028971: Configuration - fix compatibility with glibc 2.26+ due to xlocale.h removal 2017-08-08 17:45:40 +03:00
bugmaster
82af2baefa Update of OCCT version up to 7.2.0 beta 2017-08-01 23:48:23 +03:00
kgv
a5460e9d98 0028887: TKJT - add option to cache file content
Added new auxiliary class Standard_ArrayStreamBuffer implementing
std::streambuf interface for defining std::istream from allocated memory.
2017-07-13 17:29:50 +03:00
abv
896faa7296 0028417: Using PRECOMPILED HEADER to speed up compilation time
Use of Cotire tool is introduced for acceleration of CMake builds, by usage of precompiled headers.
CMake option BUILD_USE_PCH is added to enable / disable use of precompiled headers

When precompiled headers are used, additional compiler macros are defined globally in the build system to avoid problems due to different order of included files:
- NOMINMAX is defined on Windows to prevent defining "min" and "max" as macros by windows.h
- STRSAFE_NO_DEPRECATE and _SCL_SECURE_NO_WARNINGS are defined on Windows to prevent declaring functions of standard C library as deprecated by #pragma, and other warnings in system headers
- GL_GLEXT_LEGACY and GLX_GLEXT_LEGACY are defined to ensure that only OCCT's own glext.h is used
- __STDC_FORMAT_MACROS is defined to have standard C print format macros always defined

Code is corrected to avoid conflicts with system headers and in case of compiling together as unity builds (partially):
- Some locally defined variables in TKV3d, TKHLR are renamed to be unique
- Duplicated definitions of macros and global functions are eliminated in TKSTEP
- Useless header WNT_UInt.hxx is removed
- Usage of local variables conflicting with X11 macro is avoided in Draw_Viewer.cxx
- Local variables in AIS_ConcentricRelation.cxx are renamed to avoid conflict with macros defined in windows.h
- HXX files containing code are renamed to PXX or merged with corresponding CXX files.

IVtkTools classes are corrected to avoid compiler warnings disabled in non-PCH builds by inclusion of VTK headers.

Useless pragmas disabling warnings on MSVC are removed
2017-07-06 12:41:41 +03:00
szy
5a1271c8b4 0027970: Improvement of standard attributes usability - containers. 2017-05-26 14:48:53 +03:00
kgv
56689b2700 0028487: Visualization, TKOpenGl - add option for rendering with lower resolution
Graphic3d_RenderingParams::RenderResolutionScale - added new option
defining scale factor for allocating off-screen rendering buffers
relative to native resolution of window buffer.

Scale factor can be below 1.0 (lower resolution) or higher (as analog of super sampling),
but can not be combined with MSAA settings.

Draw Harness command vrenderparams has been extended with option -rendScale
managing introduced option Graphic3d_RenderingParams::RenderResolutionScale.

vcaps has been extended with option -useWindowBuffer for managing
OpenGl_Caps::useSystemBuffer option.

vrepaint has been extended with option -immediate
for testing immediate layer redraw

OpenGl_View::blitBuffers() - eliminate compiler warning on Android
2017-03-03 16:11:22 +03:00
ifv
e525fd6ad2 0028458: Some faces are missing when loading a specific CAD. This is a regression from OCCT 7.0 and Express Mesh 7.0.
Function ACos and ASin are modified to avoid exception when argument is +-(1. + Epsilon(1.)) because of "numerical noise"
2017-03-02 12:31:56 +03:00
kgv
dace4784d1 0028439: Configuration - compilation error when using thread_local within XCode 7 or earlier
__has_feature(cxx_thread_local) check has been added
for using thread_local keyword within CLang.
2017-02-09 16:16:23 +03:00
ski
9775fa6110 0026937: Eliminate NO_CXX_EXCEPTION macro support
Macro NO_CXX_EXCEPTION was removed from code.
Method Raise() was replaced by explicit throw statement.
Method Standard_Failure::Caught() was replaced by normal C++mechanism of exception transfer.
Method Standard_Failure::Caught() is deprecated now.
Eliminated empty constructors.
Updated samples.
Eliminate empty method ChangeValue from NCollection_Map class.
Removed not operable methods from NCollection classes.
2017-02-02 16:35:54 +03:00
Benjamin Bihler
0e9fe060f3 0028355: Stating wrong parent class in DEFINE_STANDARD_RTTIEXT is not recognized during compilation
Added compile-time checks (static_assert) in DEFINE_STANDARD_RTTI*(A,B) macros to check that A is actually the class being defined, and B is its base class.
For GCC compiler version 4.7 and later on, check ensures that B is direct base class of A.

Fixed dubious RTTI definitions.
2017-01-19 17:25:56 +03:00
apn
9bcfd6f649 Fix compilation error on vc12 (MSVC++ 12.0) 2016-12-29 20:24:44 +03:00
abv
b3d20c7f46 0028217: Error handling is not thread safe and causing memory corruption and sporadic crashes
Static variable holding handle to the last raised exception is made thread-local on compilers that support C++11 keyword thread_local (MCVC++ 14+, GCC 4.8+, ICC 14+, CLang).
Test bugs fclasses bug28217 is added (BAD on vc < 14 and gcc < 4.8).

Test case tuning bugs/fclasses/bug28217
2016-12-29 14:38:02 +03:00
apn
e3cb774f2e Change OCCT version to 7.1.1 and define OCC_VERSION_DEVELOPMENT to "dev" 2016-12-08 16:19:55 +03:00
apn
8f16a18454 Incrementation of OCCT version up to 7.1.0 2016-11-24 07:07:01 +03:00
apn
aa7b761d4c Incrementing OCCT version up to 7.1.0 beta 2016-11-09 12:12:43 +03:00
szy
fa53efefc3 0027932: Improvement of standard attributes usability.
OCAF attributes TDataStd_AsciiString, TDataStd_Integer, TDataStd_Name, TDataStd_Real are extended by possibility to use custom GUID.

Now multiple attributes of any of these types can be placed at the same label using different user-defined GUIDs.
For this new "Set" methods were added into each attribute, which takes this custom GUID as an argument.
Other aspects of management of attributes on labels remain the same.

Version number of persistent OCAF documents is incremented.
However, the attributes are stored in the same way unless non-standard GUID is used for particular attribute.
Previously saved documents are fully supported, but the new documents with this extension used will be non-readable by the previous version of OCAF libraries.
2016-11-08 19:30:59 +03:00
nbv
b070046674 0028054: Regression: Class BRepProj_Projection gives invalid result after projection edge based on the line on the conical surface
Problem of projection of line on the cone in the special case when starting point of the line coincides with the cone apex is fixed (by shifting this point along the source line).
2016-11-08 19:29:55 +03:00
abv
c381fda2d6 0027713: Test bugs fclasses bug6143 is not OK for Linux after restoring FPS (26329)
Use standard (POSIX-compliant) macro "__linux__" for identification of Linux system, instead of obsolete "linux"
2016-09-30 11:17:19 +03:00
ifv
f4dee9bb20 0026329: Restore floating point signals handling in DRAW
Added DRAW command dsetsignal, resetting OSD signal handler with either armed or disabled FPE handler, according to an option.
If called without arguments, it sets FPE handler only if environment variable OSD_FPE is defined (with value different from 0).
On start, DRAW calls dsetsignal to set FPE signal if CSF_FPE is defined.
Test bugs fclasses bug6143 uses dsetsignal to set FPE handler unconditionally before the test command, and resets it to default at the end.

A number of changes in the code have been done in order to fix floating point exceptions that became generated after enabling signals:

- Global functions Sinh() and Cosh() defined in Standard_Real.hxx are improved to raise Standard_NumericError exception if argument is too big (greater than 710.47586), instead of relying on system treatment of floating point overflow. These functions are used instead of sinh and cosh in ElCLib.cxx.

- Maximal value of parameter on hyperbola is restricted by 23 (corresponding to ~1e10 in 3d) in order to avoid FP overflow in Extrema_GenExtCS.cxx, ShapeFix_EdgeProjAux.cxx.

- Interface of the root curve adaptor class Adaptor3d_Curve has been updated to add new virtual methods BasisCurve and OffsetValue. They complement the adaptor for the case of offset curves. These methods are used in Extrema_GenExtCS.cxx to restrict domain search in the case of offset of hyperbola, in order to get rid of floating point overflow. All classes inheriting Adaptor3d_Curve have been changed to implement the new virtual methods.

- Protection against division by zero has been implemented in ApproxInt_KnotTools.cxx, BRepClass3d_SClassifier.cxx, BRepGProp_Face.cxx, BRepMesh_FastDiscretFace.cxx, Geom2dGcc_Circ2d2TanOnIter.cxx, Geom2dInt_Geom2dCurveTool.cxx, IntPolyh_MaillageAffinage.cxx.

- Protection against calling of math functions of infinite arguments has been added in BRepCheck_Edge.cxx, BRepLib.cxx, CSLib_NormalPolyDef.cxx, Extrema_FuncExtPC.gxx, Extrema_GExtPC.gxx, Extrema_GLocateExtPC.gxx, Intf_InterferencePolygonPolyhedron.gxx, ShapeAnalysis_Surface.cxx, ShapeAnalysis_TransferParametersProj.cxx, ShapeAnalysis_Wire.cxx, math_FunctionSetRoot.cxx.

- Proper initialization of local variables is done in BOPAlgo_PaveFiller_6.cxx, XSDRAWSTLVRML.cxx.

- Inconsistent usage of Standard_Boolean* to access integer data in HLR (caused by #27772) is corrected

Some test cases have been updated to actual state.
2016-09-30 11:17:17 +03:00
kgv
fb0b05319f 0027838: Foundation Classes - support wchar_t* input within TCollection_AsciiString and TCollection_ExtendedString
TCollection_ExtendedString/TCollection_AsciiString description
has been updated to reflect usage of this classes for Unicode strings.

TCollection_ExtendedString now defines constructor taking wchar_t* (all platforms)
and method ::ToWideString() returning wchar_t* (Windows only).
TCollection_AsciiString now defines constructor taking wchar_t*.

TCollection_ExtendedString/TCollection_AsciiString now defines
auxiliary methods ::StartsWith() and ::EndsWith().

TCollection_ExtendedString internals has been updated to eliminate
duplicated code for converting between UTF-16 and UTF-8.

Code has been cleaned up from redundant explicit conversions to wchar_t*.
Global method OSD_OpenStream()/OSD_OpenFileBuf() have been replaced
by C++ template to eliminate copy-paste for different STL collections.

OSD_SharedLibrary now uses wide-char system API call LoadLibraryExW()
on Windows for consistency.

New macro Standard_UNUSED has been added for marking possibly unused functions and variables
(to suppress gcc/clang compiler warnings).
2016-09-15 12:33:55 +03:00
kgv
1ce0716bb1 0027811: Configuration - allow building TKOpenGl with OpenGL ES on Windows
OpenGl_ShaderManager::prepareStdProgramFboBlit() now tries using extension
GL_EXT_frag_depth within OpenGL ES 2.0 when OpenGL ES 3.0 is not available.
OpenGl_View::blitBuffers() now disables Depth test
when copying depth values is not supported by OpenGL ES 2.0 hardware.

Fixed building for UWP with SDK 10.0.10240.0
Fixed building TKService, TKV3d and TKOpenGl for UWP.

OSD_Environment now defines global environment map
for emulating desktop behavior on UWP.
2016-09-08 10:46:58 +03:00
kgv
dde6883382 0027772: Foundation Classes - define Standard_Boolean using C++ type "bool" instead of "unsigned int"
Code has been updated to remove no-op casts and implicit casts to Standard_Boolean.

Places of inproper use of Standard_Boolean instead of Standard_Integer
have been corrected:
- Bnd_Box, Bnd_Box2d
  Bit flags are now defined as private enum
- HLRAlgo_BiPoint, HLRAlgo_EdgesBlock, HLRBRep_EdgeData, HLRBRep_FaceData
  Bit flags are now defined as enum
- HLRAlgo_EdgeStatus, HLRBRep_BiPnt2D, HLRBRep_BiPoint
  Bit flags are now defined as bool fields
- HLRAlgo_PolyData
  Bit flags are now defined as Standard_Integer
- OSD_DirectoryIterator, OSD_FileIterator
  Boolean flag is now defined as Standard_Boolean
- ShapeAnalysis_Surface::SurfaceNewton()
  now returns Standard_Integer (values 0, 1 or 3)
- ChFi2d_FilletAlgo
  now uses TColStd_SequenceOfBoolean instead of TColStd_SequenceOfInteger
  for storing boolean flags

Method IFSelect_Dispatch::PacketsCount() has been dropped from interface.

ShapeFix_Solid::Status() has been fixed to decode requested status
instead of returning integer value.

TopOpeBRepBuild_Builder1 now defines map storing Standard_Boolean values
instead of Standard_Integer.

Persistence for Standard_Boolean type has been corrected
to keep backward compatibility:
- BinMDataStd, BinTools, FSD_BinaryFile

Broken Draw Harness commands vdisplaymode and verasemode have been removed.

BRepMesh_FastDiscretFace::initDataStructure() - workaround old gcc limitations

BRepMesh_IncrementalMesh::clear() - avoid ambiguity
2016-08-26 10:16:17 +03:00
ski
742cc8b01d 0027350: Support for Universal Windows Platform
- Toolchain file to configure a Visual Studio generator for a Windows 10 Universal Application was added (CMake).
- There is no support for environment variables in UWP.
- SID is not supported (were excluded).
- Windows registry is not supported (were excluded).
- Mess with usage of Unicode/ANSI was corrected.
- Added sample to check UWP functionality.
- Excluded usage of methods with Unicode characters where it is possible.
- Minor corrections to allow building OCAF (except TKVCAF) and DE (except VRML and XDE)
- Building of unsupported modules for UWP platform is off by default .
- Checking of DataExchange functionality was added to XAML (UWP) sample.
- Added information about UWP to the documentation.
- Update of results of merge with issue 27801
2016-08-26 09:43:29 +03:00
kgv
94afca11a0 0027801: Configuration - fix compilation of Standard.cxx when using MinGW-W64 2016-08-25 15:10:49 +03:00
kgv
60273f7774 0027763: Visualization - remove V3d_View::Print() method
Dependency from FreeImagePlus.dll (but not FreeImage.dll) has been removed.

Method V3d_View::Export() has been marked as deprecated.

Added Standard_DISABLE_DEPRECATION_WARNINGS and Standard_ENABLE_DEPRECATION_WARNINGS
to eliminate compiler warnings for using deprecated APIs within Draw Harness for testing.

compatibility with gcc 4.5-
2016-08-18 15:02:37 +03:00
kgv
c885cfda24 0027676: Foundation Classes - define Standard_ExtCharacter, Standard_Utf16Char using C++11 types char16_t 2016-08-11 12:17:03 +03:00
kgv
c58b1b6257 0027754: Configuration - fix compilation of Standard.cxx on non-x86 desktop systems 2016-08-11 11:58:30 +03:00
kgv
9016c8bd2e 0027563: Foundation Classes, opencascade::handle - make operator*() consistent with operator->() 2016-08-11 11:54:22 +03:00
ski
536a3cb80c 0027525: Coding - eliminate warnings on Windows for OCCT with static type of libraries
Useless *.cxx files were removed to eliminate linker warning LNK4221.

Package TopOpeBRepDS was cleaned up from old debugging routines.

Merged OSD_signal_WNT.cxx into OSD_signal.cxx

Class Standard_ErrorHandlerCallback was moved into the Standard_ErrorHandler class as nested class Callback

Eliminated warning about unused variable.
2016-07-14 13:21:33 +03:00
kgv
a13f2dc486 0027566: Configuration - define Handle_ as non-template class for compatibility with C++/CLI
For MSVC compiler (version 12 and above), Handle_Class types are defined as true classes (inheriting corresponding opencascade::handle<Class>) to allow using them in "public" statement of C++/CLI language, to make these classes recognizable by other C++/CLI libraries.

Code to test operations with Handle_ class is added to QAHandleOps test command
2016-06-23 18:14:10 +03:00
kgv
be5c360207 0027562: Coding - avoid exporting of inline methods 2016-06-09 12:21:58 +03:00
bugmaster
6d4bf6d9b1 Incrementation of OCCT version up to 7.0.1 2016-04-08 11:50:48 +03:00
bugmaster
65ebcbd01a Incrementation of OCCT version up to 7.0.0 2016-04-04 16:47:35 +03:00
Roman Lygin
60a6678eee 0027254: [Regression] 7.0 types initialization mechanism is not thread-safe on VS2013
The code in Standard_Type::type_instance<T>::get() distinguishes between compilers supporting and not supporting N2660. VS2013 was incorrectly considered as supporting, although the comment stated the opposite.

The fix makes VS2013 treated as not supporting N2660.
2016-03-12 09:17:55 +03:00
bugmaster
71b471d7b8 Incrementation OCCT version up to 7.0.0 rc 2016-03-04 15:02:14 +03:00
kgv
7c65581dd3 0027197: Configuration - fix compilation issues when using mingw
AIS_ColorScale, AIS_Dimension - the protected method DrawText()
has been renamed to drawText() to avoid name collisions with macros.

_MSC_VER/_WIN32 misuse has been fixed in several places.
Header <malloc.h> is now included where alloca() is used.
Draw_Window - dllimport flag has been dropped from inline methods.

TKernel - mandatory dependencies Winspool.lib and Psapi.lib
are now linked explicitly (instead of msvc-specific pragma syntax).

CMake scripts - the option -std=c++0x has been replaced by -std=gnu++0x
for mingw to allow extensions (like _wfopen() and others).
The minimum Windows version has been set to _WIN32_WINNT=0x0501.
Invalid options "-z defs" and "-lm" have been dropped for mingw.
Flag --export-all-symbols has been added to CMAKE_SHARED_LINKER_FLAGS
to workaround missing vtable symbols when using mingw.
FreeType is now linked explicitly on Windows.

Draw::Load() - "lib" suffix is now prepended on mingw as well.

Drop redundant declaration of _TINT from OSD_WNT_1.hxx.
NCollection_UtfString::FromLocale() - platform-specific code has been moved to .cxx file.
Draw_BasicCommands - fixed incorrect mingw64 version macros.

genproj, cbp - added workaround for process argument list limits on Windows.
TKSTEP linkage is failing on this platform due to too long list of files.
The list of object files to link is now stored in dedicated file which is passed to gcc.

Option "-z defs" removed from CMake linker options to avoid problems when building with different configurations of VTK on Linux

Some MinGW-specific compiler warnings (potentially uninitialized vars, use of NULL, parentheses in conditional expressions) are fixed (speculatively)
2016-03-04 07:31:05 +03:00
abv
a9dde4a31b 0027104: DownCast() cannot return null for mismatched handle
Method DownCast() is made template, to be available only when argument is actually a pointer or handle to a base class.

For compatibility with existing code, method DownCast() that can be used for the same type, derived, or unrelated class (i.e. where there is no actual down casting) is still available, its use shall cause "deprecated" compiler warning.

OCCT code is updated to remove meaningless DownCast()s; a few places where DownCast() was used with argument of unrelated type are corrected.

DRAW command QAHandleCast is removed (it was useful only during redesign of handles).
2016-02-20 10:10:15 +03:00
abv
5d351a0822 0026549: Provide move constructors and operators for basic classes
Move constructor and operator added for opencascade::handle<>
2016-02-20 10:10:13 +03:00
abv
4796758e8d 0027111: Add generalized copy constructor in handle class for old compilers
Copy constructor and assignment operator from handle of derived type is added in handle class.
They are enabled only if macro OCC_HANDLE_NOCASTS is defined, and operators of cast of handle to reference to handle to base type are disabled in that case.

Useless type casts to handle to base type are removed in GC and GCE2d classes.
Code returning reference to handle from function is corrected to return it either by value or as reference to handle of actual type.
2016-02-20 10:10:12 +03:00
abv
aa00364da7 0026377: Passing Handle objects as arguments to functions as non-const reference to base type is dangerous
Operator of cast to non-const reference is declared deprecated to produce compiler warning if used (usually implicitly).

OCCT code is updated to avoid that cast, occurring when function accepting non-const reference to handle is called with handle to derived type.
For that, local variable of argument type is passed instead, and down-cast is used to get it to desired type after the call.
A few occurrences of use of uninitialized variable are corrected.
2016-02-20 10:10:11 +03:00
kgv
8ddd25b887 0027113: Coding - add macros Standard_DEPRECATED for marking deprecated functionality
Macro Standard_DEPRECATED("message") can be used in declarations to mark a method deprecated and generate compiler warning when it is used.
If OCCT_NO_DEPRECATED is defined, Standard_DEPRECATED is disabled (defined empty).
2016-02-20 10:10:09 +03:00
abv
4db4247a0b 0024836: Stack overflow when raising exception in low memory condition
Standard_OutOfMemory exception is refactored so as to avoid memory allocations (which will likely fail) when it is raised:

- method NewInstance() returns static instance (singleton)
- method Raise() raises copy of that singleton, resetting its message string
- message string is stored as field, not allocated dynamically (thus maximum message length is limited by buffer size)

Class Standard_Failure slightly revised: method Destroy() is merged to destructor, methods Get/SetMessageString() are made virtual.

Add test case for the bug
2016-01-21 15:49:51 +03:00
abv
8bb8064e8f Fix of compiler warnings on OCCT 7.0.0.beta (CLang and VC++ 14) 2016-01-03 15:17:05 +03:00
bugmaster
a1613f0a65 Incrementing OCCT version up to 7.0.0 beta 2015-12-23 13:40:41 +03:00