mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-03 17:56:21 +03:00
0024665: A sample for advanced function mechanism
Update for Linux platform
This commit is contained in:
parent
c19f09e973
commit
6396eacb4f
@ -1,40 +1,12 @@
|
||||
######################################################################
|
||||
# Automatically generated by qmake (2.01a) ?? 11. ??? 12:03:38 2016
|
||||
######################################################################
|
||||
|
||||
TEMPLATE = app
|
||||
TARGET =
|
||||
DEPENDPATH += . src
|
||||
INCLUDEPATH += .
|
||||
CONFIG += debug_and_release qt
|
||||
|
||||
# Input
|
||||
HEADERS += src/BaseDriver.h \
|
||||
src/CircleDriver.h \
|
||||
src/ConeDriver.h \
|
||||
src/CylinderDriver.h \
|
||||
src/edge.h \
|
||||
src/FThread.h \
|
||||
src/graphwidget.h \
|
||||
src/mainwindow.h \
|
||||
src/node.h \
|
||||
src/PointDriver.h \
|
||||
src/PrismDriver.h \
|
||||
src/ShapeSaverDriver.h \
|
||||
src/SimpleDriver.h
|
||||
SOURCES += src/BaseDriver.cpp \
|
||||
src/CircleDriver.cpp \
|
||||
src/ConeDriver.cpp \
|
||||
src/CylinderDriver.cpp \
|
||||
src/edge.cpp \
|
||||
src/FThread.cpp \
|
||||
src/graphwidget.cpp \
|
||||
src/main.cpp \
|
||||
src/mainwindow.cpp \
|
||||
src/node.cpp \
|
||||
src/PointDriver.cpp \
|
||||
src/PrismDriver.cpp \
|
||||
src/ShapeSaverDriver.cpp \
|
||||
src/SimpleDriver.cpp
|
||||
TARGET = FuncDemo
|
||||
|
||||
SAMPLESROOT = $$quote($$(CASROOT)/samples/qt)
|
||||
|
||||
HEADERS = src/*.h
|
||||
SOURCES = src/*.cpp
|
||||
|
||||
INCLUDEPATH += $$quote($$(CASROOT)/inc)
|
||||
|
||||
@ -86,6 +58,24 @@ win32 {
|
||||
LIBS += -lTKernel -lTKMath -lTKBRep -lTKGeomBase -lTKGeomAlgo -lTKG3d -lTKG2d \
|
||||
-lTKTopAlgo -lTKMesh -lTKPrim -lTKCDF -lTKLCAF -lTKCAF -lTKBO
|
||||
|
||||
lrelease.name = LRELEASE ${QMAKE_FILE_IN}
|
||||
lrelease.commands = lrelease ${QMAKE_FILE_IN} -qm $${RES_DIR}/${QMAKE_FILE_BASE}.qm
|
||||
lrelease.output = ${QMAKE_FILE_BASE}.qm
|
||||
lrelease.input = TS_FILES
|
||||
lrelease.clean = $${RES_DIR}/${QMAKE_FILE_BASE}.qm
|
||||
lrelease.CONFIG += no_link target_predeps
|
||||
QMAKE_EXTRA_COMPILERS += lrelease
|
||||
|
||||
copy_res.name = Copy resource ${QMAKE_FILE_IN}
|
||||
copy_res.output = ${QMAKE_FILE_BASE}${QMAKE_FILE_EXT}
|
||||
copy_res.clean = $${RES_DIR}/${QMAKE_FILE_BASE}${QMAKE_FILE_EXT}
|
||||
copy_res.input = RES_FILES
|
||||
copy_res.CONFIG += no_link target_predeps
|
||||
win32: copy_res.commands = type ${QMAKE_FILE_IN} > $${RES_DIR}/${QMAKE_FILE_BASE}${QMAKE_FILE_EXT}
|
||||
unix: copy_res.commands = cp -f ${QMAKE_FILE_IN} $${RES_DIR}
|
||||
QMAKE_EXTRA_COMPILERS += copy_res
|
||||
#QMAKE_CXXFLAGS += /wd4996
|
||||
|
||||
greaterThan(QT_MAJOR_VERSION, 4) {
|
||||
QT += widgets
|
||||
}
|
||||
|
@ -1,3 +1,3 @@
|
||||
@echo off
|
||||
rem Define QTDIR variable
|
||||
set QTDIR=D:\Qt\4.8.2
|
||||
set QTDIR=
|
||||
|
3
samples/qt/FuncDemo/custom.sh
Normal file
3
samples/qt/FuncDemo/custom.sh
Normal file
@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
#Define QTDIR variables in order to generate Makefile files by qmake
|
||||
export QTDIR=
|
21
samples/qt/FuncDemo/env.sh
Normal file
21
samples/qt/FuncDemo/env.sh
Normal file
@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
export aSamplePath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
if [ -e "custom.sh" ]; then
|
||||
source "custom.sh";
|
||||
fi
|
||||
|
||||
if [ -e "${aSamplePath}/../../../env.sh" ]; then
|
||||
source "${aSamplePath}/../../../env.sh";
|
||||
fi
|
||||
|
||||
if test "${QTDIR}" == ""; then
|
||||
echo "Environment variable \"QTDIR\" not defined. Define it in \"custom.sh\" script."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
host=`uname -s`
|
||||
export STATION=$host
|
||||
|
||||
export PATH=${QTDIR}/bin:${PATH}
|
32
samples/qt/FuncDemo/run.sh
Normal file
32
samples/qt/FuncDemo/run.sh
Normal file
@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
|
||||
export aSamplePath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
if [ -e "${aSamplePath}/env.sh" ]; then source "${aSamplePath}/env.sh"; fi
|
||||
cd $aSamplePath
|
||||
|
||||
aSystem=`uname -s`
|
||||
if [ "$aSystem" == "Darwin" ] && [ "$MACOSX_USE_GLX" != "true" ]; then
|
||||
if [ "${CASDEB}" == "d" ]; then
|
||||
BIN_DIR="${aSamplePath}/build/Debug/FuncDemo.app/Contents/MacOS"
|
||||
else
|
||||
BIN_DIR="${aSamplePath}/build/Release/FuncDemo.app/Contents/MacOS"
|
||||
fi
|
||||
else
|
||||
BIN_DIR="${aSamplePath}/${STATION}/bin${CASDEB}"
|
||||
fi
|
||||
|
||||
PATH="${BIN_DIR}:${PATH}"
|
||||
export PATH
|
||||
|
||||
if test ! -r "${BIN_DIR}/FuncDemo"; then
|
||||
echo "Executable \"${BIN_DIR}/FuncDemo\" not found."
|
||||
if [ "$aSystem" == "Darwin" ] && [ "$MACOSX_USE_GLX" != "true" ]; then
|
||||
echo "Probably you don't compile the application. Build it with Xcode."
|
||||
else
|
||||
echo "Probably you don't compile the application. Execute \"make\"."
|
||||
fi
|
||||
exit 1
|
||||
fi
|
||||
|
||||
${BIN_DIR}/FuncDemo
|
@ -1,5 +1,5 @@
|
||||
#include "FThread.h"
|
||||
#include "GraphWidget.h"
|
||||
#include "graphwidget.h"
|
||||
|
||||
#include <TFunction_Function.hxx>
|
||||
#include <TFunction_IFunction.hxx>
|
||||
@ -67,7 +67,11 @@ void FThread::run()
|
||||
{
|
||||
L = getFreeFunction();
|
||||
if (L.IsNull())
|
||||
::Sleep(100);
|
||||
#ifdef __GNUC__
|
||||
sleep(0.001);
|
||||
#else
|
||||
::Sleep(100);
|
||||
#endif
|
||||
else
|
||||
break;
|
||||
}
|
||||
@ -123,4 +127,4 @@ void FThread::run()
|
||||
}// while (More())
|
||||
|
||||
graph->setFinished();
|
||||
}
|
||||
}
|
||||
|
@ -54,6 +54,9 @@
|
||||
#include <TDataStd_Name.hxx>
|
||||
#include <TDataStd_Real.hxx>
|
||||
#include <TDataStd_RealArray.hxx>
|
||||
#ifdef __GNUC__
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
MainWindow::MainWindow()
|
||||
{
|
||||
@ -171,7 +174,11 @@ void MainWindow::compute()
|
||||
|
||||
// Process user-events.
|
||||
qApp->processEvents();
|
||||
::Sleep(100);
|
||||
#ifdef __GNUC__
|
||||
sleep(0.001);
|
||||
#else
|
||||
::Sleep(100);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@ -660,4 +667,4 @@ void MainWindow::createDefaultModel2()
|
||||
graph->createModel(doc);
|
||||
|
||||
//app->SaveAs(doc, "W:\\TestFM\\model2.cbf");
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user