Build tools are updated to support building with Visual Studion 2019 toolset ClangCL (LLVM clang-cl):
- In CMake builds, use of unsupported option "-std=c++0x" is avoided
- Tool genconf recognizes availability of ClangCL toolset and proposes it in the list
- Tool genproj recognizes new compiler specification VCVER=vclang and generates VS 2019 projects for it
Note that vclang configuration puts binaries to folder "vc14" as it is compatible with vc14 CRT.
Code is updated to build with Clang for Windows without errors and warnings:
- In BVH classes, pure virtual destructors are replaced by empty ones, to avoid bogus compiler warning
- In .lex files, pragmas are added to disable warnings in parser code
- In OSD, signature of function _osd_wnt_set_error() is corrected to avoid warning on incorrect use of va_args (undefined behavior)
- In OSD_Host, OSD_Parallel_TBB, warnings on usage of deprecated function are disabled
- In Quantity_ColorRGBA and ViewerTest_CmdParser, incorrect use of predefined macro __FUNCTION__ assuming it was a string literal is avoided
- In Standard_Macro.hxx, code is reordered to handle Clang for Windows appropriately
- In AdvApp2Var_SysBase.hxx, inclusion of obsolete (MSVC-specific) header file is replaced by Standard_TypeDef.hxx
- In BRepExtrema_SelfIntersection.hxx, missing Standard_EXPORT is added
- In Standard_ErrorHandler.hxx, empty statements added to avoid warning on unused class fields
- In IVtkDraw and ViewerTest, interface is corrected to use actual type avoiding unnecessary type casts
Off-topic: corrections of some errors (uninitialized class fields) reported by VS Code Analysis in TKernel
if (APPLE)
# CLang can be used with both libstdc++ and libc++, however on OS X libstdc++ is outdated.
set (CMAKE_CXX_FLAGS "-std=c++0x -stdlib=libc++ ${CMAKE_CXX_FLAGS}")
- else()
+ elseif(NOT WIN32)
+ # CLang for Windows (at least CLang 8.0 distributed with VS 2019)
+ # does not support option "-std=c++0x"
set (CMAKE_CXX_FLAGS "-std=c++0x ${CMAKE_CXX_FLAGS}")
endif()
elseif (DEFINED CMAKE_COMPILER_IS_GNUCXX)
lappend ::SYS_VC_LIST "vc142-uwp"
lappend ::SYS_VCVARS_LIST "$res\\VC\\vcvarsall.bat"
}
+if { ! [catch {exec vswhere.exe -version "\[16.0,16.99\]" -latest -requires Microsoft.VisualStudio.Component.VC.ClangCL -property installationPath} res] } {
+ lappend ::SYS_VS_LIST "Visual Studio 2019 (16, toolset ClangCL)"
+ lappend ::SYS_VC_LIST "vclang"
+ lappend ::SYS_VCVARS_LIST "$res\\VC\\vcvarsall.bat"
+}
# detect installed Visual Studio instances from global environment
if { [info exists ::env(VS140COMNTOOLS)] } {
# keep only two first digits in "vc141"
if { ! [regexp {^vc[0-9][0-9]} $theCmpl aCmpl] } {
- set aCmpl $theCmpl
+ if { [regexp {^vclang} $theCmpl] } {
+ set aCmpl vc14
+ } else {
+ set aCmpl $theCmpl
+ }
}
set aShortList {}
# keep only two first digits in "vc141"
if { ! [regexp {^vc[0-9][0-9]} ${::VCVER} aVcLib] } {
- set aVcLib ${::VCVER}
+ if { [regexp {^vclang} ${::VCVER}] } {
+ set aVcLib vc14
+ } else {
+ set aVcLib ${::VCVER}
+ }
}
set isFound "true"
# Wrapper-function to generate VS project files
proc genproj {theFormat args} {
- set aSupportedFormats { "vc7" "vc8" "vc9" "vc10" "vc11" "vc12" "vc14" "vc141" "vc142" "cbp" "xcd" "pro"}
+ set aSupportedFormats { "vc7" "vc8" "vc9" "vc10" "vc11" "vc12" "vc14" "vc141" "vc142" "vclang" "cbp" "xcd" "pro"}
set aSupportedPlatforms { "wnt" "uwp" "lin" "mac" "ios" "qnx" }
set isHelpRequire false
vc14 - Visual Studio 2015
vc141 - Visual Studio 2017
vc142 - Visual Studio 2019
+ vclang - Visual Studio with ClangCL toolset
cbp - CodeBlocks
xcd - XCode
pro - Qt Creator
"vc12" -
"vc14" -
"vc141" -
- "vc142" { OS:MKVC $anOutDir $aModules $theSolution $theFormat $isUWP}
+ "vc142" -
+ "vclang" { OS:MKVC $anOutDir $aModules $theSolution $theFormat $isUWP}
"cbp" { OS:MKCBP $anOutDir $aModules $theSolution $thePlatform $theCmpl }
"xcd" {
set ::THE_GUIDS_LIST($::aTKNullKey) "000000000000000000000000"
append var \
"Microsoft Visual Studio Solution File, Format Version 12.00\n" \
"# Visual Studio 2013\n"
- } elseif { "$vcversion" == "vc14" || "$vcversion" == "vc141" || "$vcversion" == "vc142" } {
+ } elseif { "$vcversion" == "vc14" || "$vcversion" == "vc141" ||
+ "$vcversion" == "vc142" || "$vcversion" == "vclang" } {
append var \
"Microsoft Visual Studio Solution File, Format Version 12.00\n" \
"# Visual Studio 14\n"
} elseif { $theVcVer == "vc142" } {
set aVCRTVer "vc14"
set aToolset "v142"
+ } elseif { $theVcVer == "vclang" } {
+ set aVCRTVer "vc14"
+ set aToolset "ClangCL"
}
set what "$theVcVer"
set VCLIB=%VCLIB%-uwp
set VCPROP=Universal
)
+if "%VCFMT%" == "vclang" (
+ set VCLIB=vc14
+)
rem echo VCVER=%VCVER% VCFMT=%VCFMT% VCLIB=%VCLIB% VCPROP=%VCPROP%
rem ----- Parsing of Visual Studio platform -----
for /f "usebackq delims=" %%i in (`vswhere.exe -version "[16.0,16.99]" -latest -requires Microsoft.VisualStudio.Workload.%VCPROP% -property installationPath`) do (
set "DevEnvDir=%%i\Common7\IDE\"
)
+) else if /I "%VCFMT%" == "vclang" (
+ for /f "usebackq delims=" %%i in (`vswhere.exe -version "[16.0,16.99]" -latest -requires Microsoft.VisualStudio.Workload.%VCPROP% -property installationPath`) do (
+ set "DevEnvDir=%%i\Common7\IDE\"
+ )
) else if /I "%VCFMT%" == "gcc" (
rem MinGW
) else (
echo vc14 = VS 2015
echo vc141 = VS 2017
echo vc142 = VS 2019
+ echo vclang = VS 2019 with ClangCL toolset
exit /B
)
set "VCVARS=%%i\VC\Auxiliary\Build\vcvarsall.bat"
)
set "VCPlatformToolSet=v142"
+) else if /I "%VCFMT%" == "vclang" (
+ for /f "usebackq delims=" %%i in (`vswhere.exe -version "[16.0,16.99]" -latest -requires Microsoft.VisualStudio.Workload.%VCPROP% -property installationPath`) do (
+ set "VCVARS=%%i\VC\Auxiliary\Build\vcvarsall.bat"
+ )
+ set "VCPlatformToolSet=ClangCL"
) else if /I "%VCFMT%" == "gcc" (
rem MinGW
) else (
| OS | Compiler |
| --------- | ----------- |
-| Windows | Microsoft Visual Studio: 2008 SP1, 2010 SP1, 2012 Update 4, 2013 Update 5, 2015 Update 3, 2017 <sup>1</sup>, 2019 <br> GCC 4.3+ (Mingw-w64)|
+| Windows | Microsoft Visual Studio: 2008 SP1, 2010 SP1, 2012 Update 4, 2013 Update 5, 2015 Update 3, 2017 <sup>1</sup>, 2019 <br>, LLVM (ClangCL), GCC 4.3+ (Mingw-w64)|
| Linux | GNU gcc 4.3+ <br> LLVM CLang 3.6+ |
| OS X / macOS | XCode 6 or newer |
| Android | NDK r10, GNU gcc 4.8 or newer |
#define AdvApp2Var_SysBase_HeaderFile
#include <Standard_Macro.hxx>
+#include <Standard_TypeDef.hxx>
#include <AdvApp2Var_Data_f2c.hxx>
-#if _MSC_VER
-#include <stddef.h>
-#else
-#include <stdint.h>
-#endif
class AdvApp2Var_SysBase {
public:
protected:
//! Filter out correct adjacent mesh elements.
- virtual BRepExtrema_ElementFilter::FilterResult PreCheckElements (const Standard_Integer theIndex1,
- const Standard_Integer theIndex2);
+ Standard_EXPORT virtual BRepExtrema_ElementFilter::FilterResult PreCheckElements (const Standard_Integer theIndex1,
+ const Standard_Integer theIndex2);
//! Checks if the given triangles have only single common vertex.
BRepExtrema_ElementFilter::FilterResult isRegularSharedVertex (const BVH_Vec3d& theSharedVert,
BVH_Object() {}
//! Releases resources of geometric object.
- virtual ~BVH_Object() = 0;
+ virtual ~BVH_Object() {}
public:
};
-// =======================================================================
-// function : ~BVH_Object
-// purpose :
-// =======================================================================
-template<class T, int N>
-BVH_Object<T, N>::~BVH_Object()
-{
- //
-}
-
#endif // _BVH_Object_Header
myNumOfThreads (theNumOfThreads) {}
//! Releases resources of BVH queue based builder.
- virtual ~BVH_QueueBuilder() = 0;
+ virtual ~BVH_QueueBuilder() {}
public:
}
}
-// =======================================================================
-// function : ~BVH_QueueBuilder
-// purpose :
-// =======================================================================
-template<class T, int N>
-BVH_QueueBuilder<T, N>::~BVH_QueueBuilder()
-{
- //
-}
-
#endif // _BVH_QueueBuilder_Header
BVH_Set() {}
//! Releases resources of set of objects.
- virtual ~BVH_Set() = 0;
+ virtual ~BVH_Set() {}
//! Returns AABB of the entire set of objects.
virtual BVH_Box<T, N> Box() const
};
-// =======================================================================
-// function : ~BVH_Set
-// purpose :
-// =======================================================================
-template<class T, int N>
-BVH_Set<T, N>::~BVH_Set()
-{
- //
-}
-
#endif // _BVH_Set_Header
// Note that Intel compiler also defines _MSC_VER but has different warning ids
#if defined(__INTEL_COMPILER)
#pragma warning(disable:177 1786 1736)
+#elif defined(__clang__)
+#pragma GCC diagnostic ignored "-Wunused-function"
+#pragma GCC diagnostic ignored "-Winconsistent-dllimport"
+#pragma GCC diagnostic ignored "-Wunneeded-internal-declaration"
#else
#pragma warning(disable:4131 4244 4273 4127 4267)
#endif
// Note that Intel compiler also defines _MSC_VER but has different warning ids
#if defined(__INTEL_COMPILER)
#pragma warning(disable:177 1786 1736)
+#elif defined(__clang__)
+#pragma GCC diagnostic ignored "-Wunused-function"
+#pragma GCC diagnostic ignored "-Winconsistent-dllimport"
+#pragma GCC diagnostic ignored "-Wunneeded-internal-declaration"
#else
#pragma warning(disable:4131 4244 4273 4127 4267)
#endif
// Function : WClass
// Purpose :
//=========================================================
-const Handle(Standard_Transient)& IVtkDraw::WClass()
+const Handle(WNT_WClass)& IVtkDraw::WClass()
{
- static Handle(Standard_Transient) aWindowClass;
+ static Handle(WNT_WClass) aWindowClass;
#ifdef _WIN32
if (aWindowClass.IsNull())
{
- aWindowClass = new WNT_WClass ("GWVTK_Class", DefWindowProc,
+ aWindowClass = new WNT_WClass ("GWVTK_Class", NULL,
CS_VREDRAW | CS_HREDRAW, 0, 0,
::LoadCursorW (NULL, IDC_ARROW));
}
#ifdef _WIN32
if (GetWindow().IsNull())
{
- GetWindow() = new WNT_Window ("IVtkTest",
- Handle(WNT_WClass)::DownCast (WClass()),
+ GetWindow() = new WNT_Window ("IVtkTest", WClass(),
WS_OVERLAPPEDWINDOW,
aPxLeft, aPxTop,
aPxWidth, aPxHeight,
#include <Standard_Macro.hxx>
class Draw_Interpretor;
+class WNT_WClass;
class IVtkDraw
{
Standard_EXPORT static void Commands (Draw_Interpretor& theCommands);
private:
- Standard_EXPORT static const Handle(Standard_Transient)& WClass();
+ Standard_EXPORT static const Handle(WNT_WClass)& WClass();
};
#endif
this->Size[1] = aSize[1];
}
+#ifdef _WIN32
+LRESULT CALLBACK WndProc(HWND theHWnd, UINT theUMsg, WPARAM theWParam, LPARAM theLParam);
+#endif
+
//===========================================================
// Function : Enable
// Purpose :
{
Standard_Size myValue;
public:
- AlignedSize(){}
+ AlignedSize() : myValue(0) {}
AlignedSize(const Standard_Size theValue)
: myValue((theValue + Align - 1) & ~(Align - 1)) {}
operator Standard_Size() const {return myValue;}
{
Standard_Byte* myValue;
public:
- AlignedPtr(){}
+ AlignedPtr() : myValue(0) {}
AlignedPtr(const Standard_Address theValue)
: myValue((Standard_Byte*)((Standard_Size)theValue & ~(Align - 1))) {}
operator Standard_Address () const {return myValue;}
private:
// Copy constructor and assignment operator are private thus not accessible
- NCollection_SparseArrayBase (const NCollection_SparseArrayBase&) {}
- void operator = (const NCollection_SparseArrayBase&) {}
+ NCollection_SparseArrayBase(const NCollection_SparseArrayBase&);
+ void operator = (const NCollection_SparseArrayBase&);
protected:
// Object life
#include <tchar.h>
#endif
- void _osd_wnt_set_error (OSD_Error&, OSD_WhoAmI, ... );
+ void _osd_wnt_set_error (OSD_Error&, Standard_Integer, ... );
#else
#include <errno.h>
#include <stdio.h>
#define _FD ( ( PWIN32_FIND_DATAW )myData )
-void _osd_wnt_set_error ( OSD_Error&, OSD_WhoAmI, ... );
+void _osd_wnt_set_error ( OSD_Error&, Standard_Integer, ... );
OSD_DirectoryIterator :: OSD_DirectoryIterator (
const OSD_Path& where,
} // end OSD_DirectoryIterator :: Error
// For compatibility with UNIX version
-OSD_DirectoryIterator::OSD_DirectoryIterator() {}
+OSD_DirectoryIterator::OSD_DirectoryIterator()
+: myFlag(false),
+ myHandle(0),
+ myData(0),
+ myFirstCall(Standard_False)
+{}
void OSD_DirectoryIterator::Initialize(
const OSD_Path&,
#ifdef _WIN32
#include <windows.h>
- void _osd_wnt_set_error (OSD_Error&, OSD_WhoAmI, ... );
+ void _osd_wnt_set_error (OSD_Error&, Standard_Integer, ... );
static TCollection_AsciiString _osd_wnt_set_disk_name (const OSD_Path& thePath)
{
#define OPEN_OLD 1
#define OPEN_APPEND 2
- void _osd_wnt_set_error ( OSD_Error&, OSD_WhoAmI, ... );
+ void _osd_wnt_set_error (OSD_Error&, Standard_Integer, ...);
#ifndef OCCT_UWP
PSECURITY_DESCRIPTOR __fastcall _osd_wnt_protection_to_sd ( const OSD_Protection&, BOOL, const wchar_t* );
#define _FD ( ( PWIN32_FIND_DATAW )myData )
-void _osd_wnt_set_error ( OSD_Error&, OSD_WhoAmI, ... );
+void _osd_wnt_set_error ( OSD_Error&, Standard_Integer, ... );
OSD_FileIterator :: OSD_FileIterator (
const OSD_Path& where,
} // end OSD_FileIterator :: Error
// For compatibility with UNIX version
-OSD_FileIterator::OSD_FileIterator() {}
+OSD_FileIterator::OSD_FileIterator()
+: myFlag(Standard_False),
+ myHandle(0),
+ myData(0),
+ myFirstCall(Standard_False)
+{}
void OSD_FileIterator::Initialize(
const OSD_Path&,
#endif
Standard_Integer __fastcall _get_file_type ( Standard_CString, HANDLE );
-void _osd_wnt_set_error ( OSD_Error&, OSD_WhoAmI, ... );
+void _osd_wnt_set_error ( OSD_Error&, Standard_Integer, ... );
static BOOL __fastcall _get_file_time (const wchar_t*, LPSYSTEMTIME, BOOL );
static void __fastcall _test_raise ( TCollection_AsciiString, Standard_CString );
} // end OSD_FileNode :: Error
-void _osd_wnt_set_error ( OSD_Error& err, OSD_WhoAmI who, ... ) {
+void _osd_wnt_set_error ( OSD_Error& err, Standard_Integer who, ... ) {
DWORD errCode;
#pragma comment( lib, "WSOCK32.LIB" )
#endif
-void _osd_wnt_set_error ( OSD_Error&, OSD_WhoAmI, ... );
+void _osd_wnt_set_error ( OSD_Error&, Standard_Integer, ... );
static BOOL fInit = FALSE;
static TCollection_AsciiString hostName;
ZeroMemory (szHostName, sizeof(char) * (MAX_COMPUTERNAME_LENGTH + 1));
// suppress GetVersionEx() deprecation warning
-#if defined(__INTEL_COMPILER)
- #pragma warning(disable : 1478)
-#elif defined(_MSC_VER)
- #pragma warning(disable : 4996)
-#endif
+ Standard_DISABLE_DEPRECATION_WARNINGS
if (!GetVersionExW (&osVerInfo))
{
_osd_wnt_set_error (myError, OSD_WHost);
ms.dwLength = sizeof(MEMORYSTATUS);
GlobalMemoryStatus (&ms);
} // end else
-#ifdef _MSC_VER
- #pragma warning(default : 4996)
-#endif
+ Standard_ENABLE_DEPRECATION_WARNINGS
if ( !Failed () ) {
#include <OSD_ThreadPool.hxx>
#include <Standard_ProgramError.hxx>
+Standard_DISABLE_DEPRECATION_WARNINGS
#include <tbb/parallel_for.h>
#include <tbb/parallel_for_each.h>
#include <tbb/blocked_range.h>
#include <tbb/task_scheduler_init.h>
+Standard_ENABLE_DEPRECATION_WARNINGS
//=======================================================================
//function : forEachExternal
static void __fastcall _test_raise ( OSD_SysType, Standard_CString );
static void __fastcall _remove_dup ( TCollection_AsciiString& );
-OSD_Path :: OSD_Path () {
-
+OSD_Path :: OSD_Path ()
+: myUNCFlag(Standard_False), mySysDep(OSD_WindowsNT)
+{
} // end constructor ( 1 )
OSD_Path :: OSD_Path (
//------------------- WNT Sources of OSD_Path ---------------------------
//------------------------------------------------------------------------
-void _osd_wnt_set_error ( OSD_Error&, OSD_WhoAmI, ... );
+void _osd_wnt_set_error ( OSD_Error&, Standard_Integer, ... );
// =======================================================================
// function : OSD_Process
LARGE_INTEGER time;
return isOk && QueryPerformanceCounter (&time) ?
(Standard_Real)time.QuadPart / (Standard_Real)freq.QuadPart :
-#ifndef OCCT_UWP
- 0.001 * GetTickCount();
-#else
0.001 * GetTickCount64();
-#endif
}
#endif /* _WIN32 */
#endif
// this code does not work with optimize mode on Windows
-#if defined(_MSC_VER)
+#if defined(_MSC_VER) && !defined(__clang__)
#pragma optimize( "", off )
#endif
static Standard_Integer OCC6143 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
return 0;
}
-#if defined(_MSC_VER)
+#if defined(_MSC_VER) && !defined(__clang__)
#pragma optimize( "", on )
#endif
#include <Standard_Atomic.hxx>
#ifdef HAVE_TBB
+ Standard_DISABLE_DEPRECATION_WARNINGS
#include <tbb/parallel_for.h>
#include <tbb/parallel_for_each.h>
#include <tbb/blocked_range.h>
+ Standard_ENABLE_DEPRECATION_WARNINGS
#endif
#include <cstdio>
const ColorInteger theColorComponentBase)
{
Standard_ASSERT_RETURN (theColorComponentBase >= 2,
- __FUNCTION__ ": 'theColorComponentBase' must be greater than 1.",
+ "'theColorComponentBase' must be greater than 1.",
0.0f);
const ColorInteger aColorComponentMaxValue = theColorComponentBase - 1;
const ColorInteger aColorComponentAsInteger = theColorInteger % theColorComponentBase;
Quantity_ColorRGBA& theColor)
{
Standard_ASSERT_RETURN (theColorComponentBase >= 2,
- __FUNCTION__ ": 'theColorComponentBase' must be greater than 1.",
+ "'theColorComponentBase' must be greater than 1.",
0.0f);
Graphic3d_Vec4 aColor (1.0f);
if (hasAlphaComponent)
}
inline Standard_ErrorHandler::Callback::~Callback ()
{
+ (void)myHandler;
+ (void)myPrev;
}
inline void Standard_ErrorHandler::Callback::RegisterCallback ()
{
#if defined(__ICL) || defined (__INTEL_COMPILER)
#define Standard_DISABLE_DEPRECATION_WARNINGS __pragma(warning(push)) __pragma(warning(disable:1478))
#define Standard_ENABLE_DEPRECATION_WARNINGS __pragma(warning(pop))
-#elif defined(_MSC_VER)
- #define Standard_DISABLE_DEPRECATION_WARNINGS __pragma(warning(push)) __pragma(warning(disable:4996))
- #define Standard_ENABLE_DEPRECATION_WARNINGS __pragma(warning(pop))
#elif (defined(__GNUC__) && __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) || defined(__clang__)
// available since at least gcc 4.2 (maybe earlier), however only gcc 4.6+ supports this pragma inside the function body
// CLang also supports this gcc syntax (in addition to "clang diagnostic ignored")
#define Standard_DISABLE_DEPRECATION_WARNINGS _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
#define Standard_ENABLE_DEPRECATION_WARNINGS _Pragma("GCC diagnostic warning \"-Wdeprecated-declarations\"")
+#elif defined(_MSC_VER)
+ #define Standard_DISABLE_DEPRECATION_WARNINGS __pragma(warning(push)) __pragma(warning(disable:4996))
+ #define Standard_ENABLE_DEPRECATION_WARNINGS __pragma(warning(pop))
#else
#define Standard_DISABLE_DEPRECATION_WARNINGS
#define Standard_ENABLE_DEPRECATION_WARNINGS
// Note that Intel compiler also defines _MSC_VER but has different warning ids
#if defined(__INTEL_COMPILER)
#pragma warning(disable:177 1786 1736)
+#elif defined(__clang__)
+#pragma GCC diagnostic ignored "-Wunused-function"
+#pragma GCC diagnostic ignored "-Winconsistent-dllimport"
+#pragma GCC diagnostic ignored "-Wunneeded-internal-declaration"
#else
#pragma warning(disable:4131 4244 4273 4267 4127)
#endif
// Note that Intel compiler also defines _MSC_VER but has different warning ids
#if defined(__INTEL_COMPILER)
#pragma warning(disable:177 1786 1736)
+#elif defined(__clang__)
+#pragma GCC diagnostic ignored "-Wunused-function"
+#pragma GCC diagnostic ignored "-Winconsistent-dllimport"
+#pragma GCC diagnostic ignored "-Wunneeded-internal-declaration"
+#else
#else
#pragma warning(disable:4131 4244 4273 4267 4127)
#endif
Storage_BucketIterator::Storage_BucketIterator
(Storage_BucketOfPersistent* aBucketManager)
+: myBucket(0), myCurrentBucket(0),
+ myCurrentBucketIndex(0), myCurrentIndex(0),
+ myBucketNumber(0), myMoreObject(Standard_False)
{
if (aBucketManager) {
myBucket = aBucketManager;
myCurrentIndex = 0;
myMoreObject = Standard_True;
}
- else myMoreObject = Standard_False;
}
//=======================================================================
class V3d_Viewer;
class ViewerTest_EventManager;
class TopoDS_Shape;
+class WNT_WClass;
class ViewerTest
{
//! Ctrl+MB2 for pan, etc) and keyboard shortcuts.
//! This method is relevant for MS Windows only and respectively
//! returns WNT_WClass handle.
- static const Handle(Standard_Transient)& WClass();
+ static const Handle(WNT_WClass)& WClass();
};
#endif // _ViewerTest_HeaderFile
std::string& theOptionArgument) const
{
Standard_ASSERT_RETURN (theArgumentIndex >= 0,
- __FUNCTION__ ": 'theArgumentIndex' must be greater than or equal to zero.",
+ "'theArgumentIndex' must be greater than or equal to zero.",
false);
ViewerTest_CommandOptionKey anOptionKey = THE_UNNAMED_COMMAND_OPTION_KEY;
if (!theOptionName.empty() && !findOptionKey (theOptionName, anOptionKey))
std::string& theOptionArgument) const
{
Standard_ASSERT_RETURN (theArgumentIndex >= 0,
- __FUNCTION__ ": 'theArgumentIndex' must be greater than or equal to zero.",
+ "'theArgumentIndex' must be greater than or equal to zero.",
false);
std::size_t aUsedOptionIndex = 0;
if (!findUsedOptionIndex (theOptionKey, aUsedOptionIndex))
std::string ViewerTest_CmdParser::Arg (const std::string& theOptionName, const Standard_Integer theArgumentIndex) const
{
Standard_ASSERT_RETURN (theArgumentIndex >= 0,
- __FUNCTION__ ": 'theArgumentIndex' must be greater than or equal to zero.",
+ "'theArgumentIndex' must be greater than or equal to zero.",
std::string());
std::string anOptionArgument;
if (!Arg (theOptionName, theArgumentIndex, anOptionArgument))
const RawStringArguments aRawStringArguments = getRawStringArguments (aUsedOptionIndex);
const Standard_Integer aNumberOfArguments = static_cast<Standard_Integer> (aRawStringArguments.size());
Standard_ASSERT_RETURN (theArgumentIndex < aNumberOfArguments,
- __FUNCTION__ ": 'theArgumentIndex' must be less than the number of command-line arguments "
- "passed with the option which access key is 'theOptionKey'.",
+ "'theArgumentIndex' must be less than the number of command-line arguments "
+ "passed with the option which access key is 'theOptionKey'.",
false);
const Standard_Integer aNumberOfAvailableArguments = aNumberOfArguments - theArgumentIndex;
TheColor aColor;
{
Standard_ASSERT_RETURN (
theUsedOptionIndex < myOptionArgumentStorage.size(),
- __FUNCTION__ ": 'theUsedOptionIndex' must be less than the size of 'myOptionArgumentStorage'.",
+ "'theUsedOptionIndex' must be less than the size of 'myOptionArgumentStorage'.",
RawStringArguments());
const OptionArguments& anOptionArguments = myOptionArgumentStorage[theUsedOptionIndex];
return convertToRawStringList (anOptionArguments);
//purpose :
//==============================================================================
-const Handle(Standard_Transient)& ViewerTest::WClass()
+const Handle(WNT_WClass)& ViewerTest::WClass()
{
- static Handle(Standard_Transient) theWClass;
+ static Handle(WNT_WClass) theWClass;
#if defined(_WIN32)
if (theWClass.IsNull())
{
- theWClass = new WNT_WClass ("GW3D_Class", (Standard_Address )AdvViewerWindowProc,
+ theWClass = new WNT_WClass ("GW3D_Class", AdvViewerWindowProc,
CS_VREDRAW | CS_HREDRAW, 0, 0,
::LoadCursor (NULL, IDC_ARROW));
}
// Create window
#if defined(_WIN32)
- VT_GetWindow() = new WNT_Window (aTitle.ToCString(),
- Handle(WNT_WClass)::DownCast (WClass()),
+ VT_GetWindow() = new WNT_Window (aTitle.ToCString(), WClass(),
Draw_VirtualWindows ? WS_POPUP : WS_OVERLAPPEDWINDOW,
aPxLeft, aPxTop,
aPxWidth, aPxHeight,