-// Created on: 2011-10-11
+// Created on: 2011-10-11
// Created by: Roman KOZLOV
-// Copyright (c) 2011-2014 OPEN CASCADE SAS
-//
+// Copyright (c) 2011-2014 OPEN CASCADE SAS
+//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
#include <NCollection_TListIterator.hxx>
#include <NCollection_DataMap.hxx>
#include <NCollection_Map.hxx>
-#include <Standard_Integer.hxx>
#include <Standard_Boolean.hxx>
+#include <Standard_Integer.hxx>
+#include <vtkType.h>
-typedef Standard_Size IVtk_IdType;
+#ifdef VTK_USE_64BIT_IDS
+#if defined(_WIN32) && !defined(_WIN64)
+#error "64-bit VTK library can not be linked for 32-bit target platform"
+#endif
+#else
+#ifdef _WIN64
+#error "32-bit VTK library can not be linked for 64-bit target platform"
+#endif
+#endif
+
+typedef vtkIdType IVtk_IdType;
typedef IVtk_IdType IVtk_PointId;
typedef IVtk_IdType IVtk_FaceId;
typedef NCollection_List <gp_XY> IVtk_Pnt2dList;
+
//! @enum IVtk_SelectionMode Selection modes for 3D shapes
//!
//! Enumeration that describes all supported selection modes for 3D shapes.
// ------------------------------------------------------------------
// Abs : Returns the absolute value of an Integer
// ------------------------------------------------------------------
-inline Standard_Integer Abs (const Standard_Integer Value)
-{
+inline Standard_Integer Abs (const Standard_Integer Value)
+{
return Value >= 0 ? Value : -Value;
}
return theOne == theTwo;
}
+// ------------------------------------------------------------------
+// Hascode : Computes a hascoding value for a given long long integer
+// ------------------------------------------------------------------
+inline Standard_Integer HashCode(const long long int theMe,
+ const Standard_Integer theUpper)
+{
+ return ((theMe & 0x7fffffffffffffff) % theUpper) + 1;
+}
+
#if (defined(_LP64) || defined(__LP64__) || defined(_WIN64)) || defined(__APPLE__)
// ------------------------------------------------------------------
// Hascode : Computes a hascoding value for a given unsigned integer
// ------------------------------------------------------------------
// IsEven : Returns Standard_True if an integer is even
// ------------------------------------------------------------------
-inline Standard_Boolean IsEven (const Standard_Integer Value)
+inline Standard_Boolean IsEven (const Standard_Integer Value)
{ return Value % 2 == 0; }
// ------------------------------------------------------------------
// IsOdd : Returns Standard_True if an integer is odd
// ------------------------------------------------------------------
-inline Standard_Boolean IsOdd (const Standard_Integer Value)
+inline Standard_Boolean IsOdd (const Standard_Integer Value)
{ return Value % 2 == 1; }
// ------------------------------------------------------------------
// Max : Returns the maximum integer between two integers
// ------------------------------------------------------------------
inline Standard_Integer Max (const Standard_Integer Val1,
- const Standard_Integer Val2)
+ const Standard_Integer Val2)
{
return Val1 >= Val2 ? Val1 : Val2;
}
// ------------------------------------------------------------------
// Min : Returns the minimum integer between two integers
// ------------------------------------------------------------------
-inline Standard_Integer Min (const Standard_Integer Val1,
- const Standard_Integer Val2)
+inline Standard_Integer Min (const Standard_Integer Val1,
+ const Standard_Integer Val2)
{
return Val1 <= Val2 ? Val1 : Val2;
}
// ------------------------------------------------------------------
// Modulus : Returns the remainder of division between two integers
// ------------------------------------------------------------------
-inline Standard_Integer Modulus (const Standard_Integer Value,
- const Standard_Integer Divisor)
+inline Standard_Integer Modulus (const Standard_Integer Value,
+ const Standard_Integer Divisor)
{ return Value % Divisor; }
// ------------------------------------------------------------------
// Square : Returns the square of an integer
// ------------------------------------------------------------------
-inline Standard_Integer Square(const Standard_Integer Value)
+inline Standard_Integer Square(const Standard_Integer Value)
{ return Value * Value; }
// ------------------------------------------------------------------
// IntegerFirst : Returns the minimum value of an integer
// ------------------------------------------------------------------
-inline Standard_Integer IntegerFirst()
+inline Standard_Integer IntegerFirst()
{ return INT_MIN; }
// ------------------------------------------------------------------
// IntegerLast : Returns the maximum value of an integer
// ------------------------------------------------------------------
-inline Standard_Integer IntegerLast()
+inline Standard_Integer IntegerLast()
{ return INT_MAX; }
// ------------------------------------------------------------------
// IntegerSize : Returns the size in digits of an integer
// ------------------------------------------------------------------
-inline Standard_Integer IntegerSize()
+inline Standard_Integer IntegerSize()
{ return BITS(Standard_Integer); }
-#endif
+#endif