eryar / occSketcher

OpenCASCADE Sketcher is a C++ library for creating of 2D Sketcher based on Open CASCADE (www.opencascade.org) library. This sketcher allows to create 2D sketches by using snaps, geometric primitives. It can be used for creating CAD applications.
GNU Lesser General Public License v2.1
36 stars 21 forks source link

Qt 5.x and OpenCasCade 7.x #2

Open xiaozhaolook opened 6 years ago

xiaozhaolook commented 6 years ago

Hi, could you rewrite this project using Qt 5.x and OpenCasCade 7.x , and I think it's more convenient to construct this Sketcher Project using CMake, I have wrote a CMakeLists.txt as following : `cmake_minimum_required( VERSION 2.8.11 )

project( sketcher_example)

set(CMAKE_INCLUDE_CURRENT_DIR ON)

find_package(Qt5 REQUIRED Core QUIET COMPONENTS Xml Script OpenGL Svg)

include_directories (BEFORE ../../include) include_directories (BEFORE ./include)

find_package(Qt5Widgets)
include_directories(${PROJECT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
$ENV{OCCT_INCLUDES}) FILE(GLOB OCCT_LIBRARIES "D:/Program Files (x86)/OCCT/win32/vc12/lib/*.lib") LINK_LIBRARIES(${OCCT_LIBRARIES})

FILE(GLOB PROJECT_SRCS ".h" ".hxx" "*.cpp" )

FILE(GLOB PROJECT_UIS
"*.ui" )

SET( RESOURCE ${CMAKE_SOURCE_DIR}/icons/iconfiles.qrc )

FILE(GLOB PROJECT_MOC_HDRS
".h" ".hxx" )

QT5_WRAP_UI( PROJECT_UIS_H
${PROJECT_UIS}
)
QT5_WRAP_CPP( PROJECT_MOC_SRCS
${PROJECT_MOC_HDRS}
)

QT5_ADD_RESOURCES(RESOURCE_ADDED ${RESOURCE})

ADD_EXECUTABLE( sketcher_example ${PROJECT_SRCS}
${PROJECT_UIS_H}
${PROJECT_MOC_SRCS} ${RESOURCE_ADDED} )

TARGET_LINK_LIBRARIES ( sketcher_example Qt5::Widgets
Qt5::Core Qt5::Gui ) ` but when I try to compile the project, many error appeared,such as: 1.error LNK2005: "public: virtual struct QMetaObject const * __thiscall ApplicationWindow::metaObject(void)const " (?metaObject@ApplicationWindow@@UBEPBUQMetaObject@@XZ) already defined in moc_Application.cxx.obj E:\sketcher_example\Build\moc_Application.cpp.obj sketcher_example

2. DEFINE_STANDARD_HANDLE(Geom2d_Edge, Geom2d_Line) Error: class "Handle_Geom2d_Edge" has no member "Access"

3.Many headers no found in OpenCasCade 7.0 , such as :

include

include

include

include

even though after two days' work , I have fixed many bugs, but also have remained problem, Can you help me to solve this problem?

eryar commented 6 years ago

Hello @xiaozhaolook I want to rewrite occSketcher for Qt4.x and OpenCASCADE6.x in VS2008 first.

When finished this, it is only need small modification for Qt5.x and opencascade7.x.

xiaozhaolook commented 6 years ago

Great, I am devoting myself to this work too, but why not work with Qt 5.x and OCCT 7.x directly? Could we work on this project together?

eryar commented 6 years ago

Ok.

I will use Qt5.8 and OCCT7.3 directly. Then we can work on the project together, and you can pull your code to this project.

xiaozhaolook commented 6 years ago

In fact, I am trying to use Qt 5.6.3 and OCCT 7.0.0, I have compiled those libraries, the lastest two days, I have tried to convert the original project (may write by Qt 2.x and old version OCCT released before 2005), but many debug appeared, and How can I put my code here?

eryar commented 6 years ago

I will rewrite the example by using the lastest version occt7.3 Qt sample. Then you can Fork the code and pull your modifications. You can use the Git tool to work together with me.

xiaozhaolook commented 6 years ago

Ok, thank you

xiaozhaolook commented 6 years ago

Could I add you as a wechat friend? So we can talk about some technology problem directly

eryar commented 6 years ago

ok.

My Wechat id: eryarfly

grotius-cnc commented 2 years ago

I never use cmake for my own work. But usually cmake .. works fine.

I have a opencascade lib compiled as qt project just with qmake. In this way you can easely create opencascade opengl intrusions. This is fun.

I think eryar would like to play with this.

could you rewrite this project using Qt 5.x and OpenCasCade 7.x , and I think it's more convenient to construct this Sketcher Project using CMake,

In the issue threat of this repo called "tiny present" i have a link to a archive that includes several things. It shows how the Sketcher is implemented. An sich it worked out of the box.

YongcanZhou commented 1 year ago

Hello, is the upgrade successful? If possible, can you please push it, thank you very much!