FEM: Make SMESH7 compile with occ6

This commit is contained in:
Stefan Tröger 2016-05-14 11:01:57 +02:00 committed by wmayer
parent 666a3e5a68
commit 61f503ad51
8 changed files with 58 additions and 20 deletions

View File

@ -647,6 +647,9 @@ endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
# Salome SMESH sources are under src/3rdParty now
IF(OCC_FOUND)
if(NOT FREECAD_USE_EXTERNAL_SMESH)
find_package(VTK REQUIRED)
find_package(HDF5 REQUIRED)
find_package(MEDFile REQUIRED)
set(SMESH_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/src/3rdParty/salomesmesh/inc)
else()
find_package(SMESH)

View File

@ -16,12 +16,6 @@ if(CMAKE_COMPILER_IS_CLANGXX)
set(CMAKE_CXX_FLAGS " ${CMAKE_CXX_FLAGS} -Wno-self-assign -Wno-reorder -Wno-switch-enum -Wno-unknown-pragmas -Wno-logical-op-parentheses -Wno-unused-variable -Wno-unused-function -Wno-overloaded-virtual")
endif()
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
find_package(VTK REQUIRED)
find_package(HDF5 REQUIRED)
find_package(OPENCASCADE)
find_package(MEDFile REQUIRED)
find_package(Boost COMPONENTS filesystem program_options regex signals system thread REQUIRED)
include(${VTK_USE_FILE})
include_directories(
src/SMDS

View File

@ -30,6 +30,7 @@
#include <TopoDS_Face.hxx>
#include <TopoDS_Edge.hxx>
#include <gp.hxx> //added for occ6
#include <vector>
#include <map>

View File

@ -27,6 +27,12 @@
#ifndef _SMESH_MeshVSLink_HeaderFile
#define _SMESH_MeshVSLink_HeaderFile
#if OCC_VERSION_HEX < 0x070000
#ifndef _Handle_SMESH_MeshVSLink_HeaderFile
#include <Handle_SMESH_MeshVSLink.hxx>
#endif
#endif
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif

View File

@ -24,20 +24,51 @@
// Author : Sioutis Fotios
// Module : SMESH
// #include <SMESH_MeshVSLink.jxx>
#if OCC_VERSION_HEX < 0x070000
// #ifndef _Standard_TypeMismatch_HeaderFile
// #include <Standard_TypeMismatch.hxx>
// #endif
#include <SMESH_MeshVSLink.jxx>
#ifndef _Standard_Version_HeaderFile
#include <Standard_Version.hxx>
#ifndef _Standard_TypeMismatch_HeaderFile
#include <Standard_TypeMismatch.hxx>
#endif
#if OCC_VERSION_HEX < 0x070000
Standard_EXPORT Handle_Standard_Type& SMESH_MeshVSLink_Type_()
{
static Handle_Standard_Type aType1 = STANDARD_TYPE(MeshVS_DataSource3D);
static Handle_Standard_Type aType2 = STANDARD_TYPE(MeshVS_DataSource);
static Handle_Standard_Type aType3 = STANDARD_TYPE(MMgt_TShared);
static Handle_Standard_Type aType4 = STANDARD_TYPE(Standard_Transient);
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,aType4,NULL};
static Handle_Standard_Type _aType = new Standard_Type("SMESH_MeshVSLink",
sizeof(SMESH_MeshVSLink),
1,
(Standard_Address)_Ancestors,
(Standard_Address)NULL);
return _aType;
}
// DownCast method
// allow safe downcasting
//
const Handle(SMESH_MeshVSLink) Handle(SMESH_MeshVSLink)::DownCast(const Handle(Standard_Transient)& AnObject)
{
Handle(SMESH_MeshVSLink) _anOtherObject;
if (!AnObject.IsNull()) {
if (AnObject->IsKind(STANDARD_TYPE(SMESH_MeshVSLink))) {
_anOtherObject = Handle(SMESH_MeshVSLink)((Handle(SMESH_MeshVSLink)&)AnObject);
}
}
return _anOtherObject ;
}
const Handle(Standard_Type)& SMESH_MeshVSLink::DynamicType() const
{
return STANDARD_TYPE(SMESH_MeshVSLink) ;
}
#endif

View File

@ -34,12 +34,12 @@
#include <TopTools_DataMapOfShapeShape.hxx>
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Vertex.hxx>
#include <gp_GTrsf.hxx>
#include <gp_GTrsf2d.hxx>
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
#include <list>
#include <map>
@ -49,7 +49,6 @@ class SMESH_Algo;
class SMESH_Hypothesis;
class SMESH_Mesh;
class SMESH_subMesh;
class TopTools_IndexedMapOfShape;
class TopoDS_Shape;
/*!

View File

@ -1134,9 +1134,11 @@ bool GEOMUtils::FixShapeCurves( TopoDS_Shape& shape )
for (; aExpE.More(); aExpE.Next()) {
const TopoDS_Edge& aE = *(TopoDS_Edge*)&aExpE.Current();
try {
#if OCC_VERSION_HEX >= 0x060800
if (!BOPTools_AlgoTools::ComputeTolerance(aF, aE, aDMax, aT)) {
continue;
}
#endif
}
catch(...) {
continue;

View File

@ -663,10 +663,12 @@ namespace
// make scale to have coordinates precise enough when converted to int
gp_XY uvMin = uvBox.CornerMin(), uvMax = uvBox.CornerMax();
uvMin.ChangeCoord(1) = uvMin.X() * scale[0];
uvMin.ChangeCoord(2) = uvMin.Y() * scale[1];
uvMax.ChangeCoord(1) = uvMax.X() * scale[0];
uvMax.ChangeCoord(2) = uvMax.Y() * scale[1];
uvMin.SetX(uvMin.X() * scale[0]);
uvMin.SetY(uvMin.Y() * scale[1]);
uvMax.SetX(uvMax.X() * scale[0]);
uvMax.SetY(uvMax.Y() * scale[1]);
double vMax[2] = { Max( Abs( uvMin.X() ), Abs( uvMax.X() )),
Max( Abs( uvMin.Y() ), Abs( uvMax.Y() )) };
int iMax = ( vMax[0] > vMax[1] ) ? 0 : 1;