occSketcher icon indicating copy to clipboard operation
occSketcher copied to clipboard

Qt 5.x and OpenCasCade 7.x

Open xiaozhaolook opened this issue 6 years ago • 10 comments

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

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 <AIS_Drawer.hxx> #include <PTopoDS_HShape.hxx> #include <PTColStd_PersistentTransientMap.hxx> #include <PTColStd_TransientPersistentMap.hxx>

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

xiaozhaolook avatar Jul 03 '18 07:07 xiaozhaolook

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.

eryar avatar Jul 03 '18 09:07 eryar

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?

xiaozhaolook avatar Jul 04 '18 01:07 xiaozhaolook

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.

eryar avatar Jul 04 '18 01:07 eryar

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?

xiaozhaolook avatar Jul 04 '18 01:07 xiaozhaolook

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.

eryar avatar Jul 04 '18 01:07 eryar

Ok, thank you

xiaozhaolook avatar Jul 04 '18 02:07 xiaozhaolook

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

xiaozhaolook avatar Jul 09 '18 02:07 xiaozhaolook

ok.

My Wechat id: eryarfly

eryar avatar Jul 09 '18 02:07 eryar

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.

grotius-cnc avatar Feb 11 '22 15:02 grotius-cnc

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

YongcanZhou avatar Jan 07 '23 16:01 YongcanZhou