Compare commits

..

62 Commits

Author SHA1 Message Date
016753fb4d Merge pull request 'master' (#65) from master into release
All checks were successful
SHS Gitea/libs/pipeline/head This commit looks good
Reviewed-on: https://git.shs.tools/SHS/libs/pulls/65
2020-08-18 17:09:38 +03:00
4b7c513f7f flags() 2020-08-18 17:03:13 +03:00
0f6bc121aa ImageView fix 2020-08-18 17:02:14 +03:00
0ec173d9bb improve ImageView quality 2020-08-18 16:59:58 +03:00
cabacdd908 BlockView trace fix 2020-08-17 12:10:13 +03:00
f66138593c BlockView tracing fix 2020-08-17 00:57:44 +03:00
c49454bb03 another version of tracing across buses 2020-08-17 00:32:59 +03:00
efb5cbe484 blockview migrate to "deploy*" 2020-08-16 16:36:46 +03:00
b71db0530f Merge pull request 'pip' (#64) from master into release
All checks were successful
SHS Gitea/libs/pipeline/head This commit looks good
Reviewed-on: https://git.shs.tools/SHS/libs/pulls/64
2020-08-14 19:55:38 +03:00
ddc4da54be pip
BlockBusItem paint fix
2020-08-14 18:00:58 +03:00
bb645bd71b Merge pull request 'master' (#63) from master into release
All checks were successful
SHS Gitea/libs/pipeline/head This commit looks good
Reviewed-on: https://git.shs.tools/SHS/libs/pulls/63
2020-08-14 15:25:41 +03:00
d6cc5f0033 QAD 1.7.0
backport PIChunkStream optimizations to ChunkStream
2020-08-14 14:18:20 +03:00
055b8a9480 bus joint paint now configured with BlockView::setBusSquareNodes(), square or round. By default round 2020-08-14 14:08:31 +03:00
12664842c7 Merge pull request 'master' (#62) from master into release
All checks were successful
SHS Gitea/libs/pipeline/head This commit looks good
Reviewed-on: https://git.shs.tools/SHS/libs/pulls/62
2020-08-13 18:09:20 +03:00
8fbed9f427 revert busitem paint 2020-08-13 18:09:04 +03:00
e43ae02e48 Merge branch 'master' of https://git.signalmodelling.ru/SHS/libs 2020-08-13 18:04:02 +03:00
a9b9061475 binlog and PathEdit fixes 2020-08-13 18:03:52 +03:00
c41e92a9f5 Merge pull request 'master' (#61) from master into release
All checks were successful
SHS Gitea/libs/pipeline/head This commit looks good
Reviewed-on: https://git.shs.tools/SHS/libs/pulls/61
2020-08-13 14:44:37 +03:00
b37318a5a5 BlockView draw bus joint changed 2020-08-13 14:13:23 +03:00
6f97d849e9 Merge branch 'master' of https://git.shs.tools/SHS/libs 2020-08-13 13:00:59 +03:00
58432fa62e version 1.6.0
QAD::File add "is_save" flag
2020-08-13 13:00:52 +03:00
6e4cdccc94 Merge pull request 'binlog user header' (#60) from master into release
All checks were successful
SHS Gitea/libs/pipeline/head This commit looks good
Reviewed-on: https://git.shs.tools/SHS/libs/pulls/60
2020-08-12 20:02:12 +03:00
aa2ea1eda6 binlog user header 2020-08-12 20:01:46 +03:00
e59bf65294 Merge pull request 'pip' (#59) from master into release
All checks were successful
SHS Gitea/libs/pipeline/head This commit looks good
Reviewed-on: https://git.shs.tools/SHS/libs/pulls/59
2020-08-11 21:19:15 +03:00
11e665c419 pip 2020-08-11 21:19:02 +03:00
2e5d64f258 Merge pull request 'pip' (#58) from master into release
Some checks failed
SHS Gitea/libs/pipeline/head There was a failure building this commit
Reviewed-on: https://git.shs.tools/SHS/libs/pulls/58
2020-08-11 20:59:41 +03:00
1312f950c7 pip 2020-08-11 20:59:25 +03:00
5382c54d6a Merge pull request 'PIP 2.0.0' (#57) from master into release
Some checks failed
SHS Gitea/libs/pipeline/head There was a failure building this commit
Reviewed-on: https://git.shs.tools/SHS/libs/pulls/57
2020-08-11 20:21:17 +03:00
56b3dcad7c Merge remote-tracking branch 'remotes/origin/release' 2020-08-11 20:20:24 +03:00
75464792ba Merge remote-tracking branch 'remotes/origin/master' into release
Some checks failed
SHS Gitea/libs/pipeline/head There was a failure building this commit
2020-08-11 20:16:10 +03:00
8b86f93e38 pip 2.0.0 2020-08-11 20:11:10 +03:00
3e0ec72e7d Blockview changes:
1) Теперь для создания сегмента не надо держать Shift, а перемешение шины теперь с нажатой клавишей Shift
2) Режим трассировки шин теперь пытается проложить маршрут с возможностью пересечения шины под прямым углом
3) Теперь рисуются точки соединения сегментов если их больше 2х
4) Обновлена подсказка в tooltip

p.s. update pip)
2020-08-11 17:35:18 +03:00
b45bfca826 getSaveFileName for QAD::File editor 2020-08-11 10:15:09 +03:00
6a9b1751ac android docker
All checks were successful
SHS Gitea/libs/pipeline/head This commit looks good
2020-08-10 22:13:31 +03:00
ede780249a android docker 2020-08-10 22:12:52 +03:00
067839f02b Dockerfile ENV patch
All checks were successful
SHS Gitea/libs/pipeline/head This commit looks good
2020-08-10 17:55:07 +03:00
da9237e74b Dockerfile ENV patch 2020-08-10 17:48:35 +03:00
905eb77091 windows PIP -> QtBin install fix 2020-08-05 12:06:56 +03:00
2974967790 TouchButtFrame fix 2020-08-04 17:57:11 +03:00
4a567dbba4 pip 2020-08-03 09:05:06 +03:00
0c7619d00b new pip 2020-08-03 01:43:47 +03:00
fa4634b0c7 last pip 2020-08-02 12:16:14 +03:00
0f1825bf33 merged to PIP 1.99.3 2020-08-01 21:30:25 +03:00
562cb280f7 Merge branch 'master' of https://git.shs.tools/SHS/libs 2020-07-30 00:25:33 +03:00
5ec9c22d46 pip 2020-07-30 00:25:24 +03:00
d78a1f532b Merge branch 'master' of https://git.signalmodelling.ru/SHS/libs 2020-07-29 14:36:30 +03:00
0d9ecc9ceb Dockerfile, clone only one branch 2020-07-29 14:36:21 +03:00
7baa7916f7 pip v2 2020-07-29 01:32:19 +03:00
7ecf33a908 Merge branch 'master' of https://git.shs.tools/SHS/libs 2020-07-24 21:54:44 +03:00
c3f921ea6a FindQAD.cmake patch for piqt and piqt_utils 2020-07-24 21:54:38 +03:00
2251caf12c clean qglengine/qglview.h 2020-07-23 17:14:22 +03:00
c76608abf0 QGLEngine license 2020-07-22 11:24:42 +03:00
06c99dd105 Merge pull request 'pip' (#55) from master into release
Some checks failed
SHS Gitea/libs/pipeline/head There was a failure building this commit
2020-07-16 13:59:20 +03:00
caf149ed28 pip 2020-07-16 13:59:07 +03:00
13a543bfd5 Merge pull request 'pip 24' (#54) from master into release
Some checks failed
SHS Gitea/libs/pipeline/head There was a failure building this commit
2020-07-16 13:51:49 +03:00
16e52701be pip 2020-07-16 13:44:26 +03:00
09ed9a9907 compile fixes 2020-07-16 13:41:50 +03:00
a5d75fec09 includes 2020-07-16 13:05:49 +03:00
afd15e20f6 fix warning 2020-07-16 12:58:31 +03:00
77c2296320 pip 24 2020-07-16 12:52:59 +03:00
1c8d2d5c5f Merge branch 'master' of https://git.signalmodelling.ru/SHS/libs 2020-07-16 12:50:49 +03:00
f6a9e44805 piSwap 2020-07-16 12:50:24 +03:00
118 changed files with 1270 additions and 1129 deletions

View File

@@ -77,7 +77,6 @@ endif()
set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD 11)
set(PIP_LIBRARY pip) set(PIP_LIBRARY pip)
set(PIP_FOLDERS "." "core" "containers" "thread" "system" "io_devices" "io_utils" "console" "math" "code" "geo" "resources" "opencl" "crypt" "introspection" "concurrent" "cloud")
set(PIP_INCLUDES) set(PIP_INCLUDES)
if(LIB) if(LIB)
@@ -101,9 +100,6 @@ else()
message(STATUS "Install ${PROJECT_NAME} to local \"bin\", \"lib\" and \"include\"") message(STATUS "Install ${PROJECT_NAME} to local \"bin\", \"lib\" and \"include\"")
endif() endif()
foreach(F ${PIP_FOLDERS})
list(APPEND PIP_INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}/pip/lib/main/${F}")
endforeach(F)
#message(${PIP_INCLUDES}) #message(${PIP_INCLUDES})
if(CMAKE_CROSSCOMPILING OR (DEFINED ANDROID_PLATFORM)) if(CMAKE_CROSSCOMPILING OR (DEFINED ANDROID_PLATFORM))
set(PIP_CMG "pip_cmg") set(PIP_CMG "pip_cmg")
@@ -150,6 +146,9 @@ else()
endif() endif()
add_subdirectory(pip) add_subdirectory(pip)
foreach(F ${PIP_MAIN_FOLDERS})
list(APPEND PIP_INCLUDES "${F}")
endforeach(F)
set(_DIRS) set(_DIRS)
if (SomeQtFound) if (SomeQtFound)
message(STATUS "Building Qt-derived targets for ${QtVersions}") message(STATUS "Building Qt-derived targets for ${QtVersions}")
@@ -180,7 +179,7 @@ else()
endif() endif()
if(WIN32) if(WIN32)
foreach(PIP_LT ${PIP_LIBS_TARGETS}) foreach(PIP_LT ${PIP_MODULES})
if (SomeQtFound) if (SomeQtFound)
qt_install(FILES "${CMAKE_CURRENT_BINARY_DIR}/pip/lib${PIP_LT}.dll" DESTINATION QtBin) qt_install(FILES "${CMAKE_CURRENT_BINARY_DIR}/pip/lib${PIP_LT}.dll" DESTINATION QtBin)
endif() endif()

View File

@@ -356,9 +356,9 @@ int CDSection::sectionsCount() const {
PIStringList CDSection::index_names() const { PIStringList CDSection::index_names() const {
PIStringList ret; PIStringList ret;
PIMap<int, CDType>::const_iterator i; auto i = cd.makeIterator();
for (i = cd.begin(); i != cd.end(); ++i) while (i.next())
ret << i->second.name(); ret << i.value().name();
return ret; return ret;
} }
@@ -387,15 +387,14 @@ CDType & CDSection::getByName(const PIString & name_) {
int dv = 0; int dv = 0;
if (isd) dv = np[i].toInt(); if (isd) dv = np[i].toInt();
ns = 0; ns = 0;
PIMap<int, CDSection>::iterator it; auto it = cs->s.makeIterator();
//piCout << np[i] << isd << dv; while (it.next()) {
for (it = cs->s.begin(); it != cs->s.end(); ++it) {
bool f = false; bool f = false;
if (isd) f = (dv == it.key()); if (isd) f = (dv == it.key());
else f = (np[i] == it.value().alias); else f = (np[i] == it.value().alias);
//piCout << "s..." << it.key() << it.value().alias << f; //piCout << "s..." << it.key() << it.value().alias << f;
if (f) { if (f) {
ns = &(it.value()); ns = &(it.valueRef());
break; break;
} }
} }
@@ -403,13 +402,13 @@ CDType & CDSection::getByName(const PIString & name_) {
if (!ns) return null; if (!ns) return null;
cs = ns; cs = ns;
} }
PIMap<int, CDType>::iterator it;
if (np.back().isEmpty()) return null; if (np.back().isEmpty()) return null;
bool isd = np.back()[0].isDigit() || (np.back()[0] == '-'); bool isd = np.back()[0].isDigit() || (np.back()[0] == '-');
int dv = 0; int dv = 0;
if (isd) dv = np.back().toInt(); if (isd) dv = np.back().toInt();
//piCout << np.back() << isd << dv; //piCout << np.back() << isd << dv;
for (it = cs->cd.begin(); it != cs->cd.end(); ++it) { auto it = cs->cd.makeIterator();
while (it.next()) {
bool f = false; bool f = false;
if (isd) f = (dv == it.key()); if (isd) f = (dv == it.key());
else f = (np.back() == it.value().name()); else f = (np.back() == it.value().name());
@@ -446,9 +445,9 @@ void CDSection::write(PIIODevice * d, const PIString & prefix) {
d->write(l.toUTF8()); d->write(l.toUTF8());
l = "alias = " + alias + " \n"; l = "alias = " + alias + " \n";
d->write(l.toUTF8()); d->write(l.toUTF8());
PIMap<int, CDType>::iterator i; auto i = cd.makeIterator();
for (i = cd.begin(); i != cd.end(); ++i) { while (i.next()) {
CDType & ck(i.value()); const CDType & ck(i.value());
if (ck.cd_type() != cd_type_) continue; if (ck.cd_type() != cd_type_) continue;
switch (cd_type_) { switch (cd_type_) {
case CDType::cdNull: break; case CDType::cdNull: break;
@@ -487,9 +486,9 @@ void CDSection::write(PIIODevice * d, const PIString & prefix) {
if (!s.isEmpty()) { if (!s.isEmpty()) {
if (prefix.isEmpty()) l = "s"; if (prefix.isEmpty()) l = "s";
else l = prefix + ".s"; else l = prefix + ".s";
PIMap<int, CDSection>::iterator j; auto j = s.makeIterator();
for (j = s.begin(); j != s.end(); ++j) { while (j.next()) {
j.value().write(d, l + "." + PIString::fromNumber(j.key())); j.valueRef().write(d, l + "." + PIString::fromNumber(j.key()));
} }
} }
if (prefix.isEmpty()) { if (prefix.isEmpty()) {

View File

@@ -3,9 +3,14 @@ FROM ${DOCKER_PREFIX}android
ARG LIBS_BUILD_NUMBER=9999 ARG LIBS_BUILD_NUMBER=9999
ARG JOBS_COUNT=4 ARG JOBS_COUNT=4
ENV PATH=/opt/cmake/bin:$PATH
ENV ANDROID_HOME=/usr/lib/android-sdk
ENV ANDROID_NDK_HOME=${ANDROID_HOME}/ndk-bundle
ENV ANDROID_TOOLCHAIN=${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake
ENV NDK_PLATFORM="android-21"
WORKDIR /soft WORKDIR /soft
RUN git clone -b release --depth 1 --recursive https://git.shs.tools/SHS/libs.git RUN git clone -b release --single-branch --depth 1 --recursive https://git.shs.tools/SHS/libs.git
WORKDIR /soft/libs_build_host WORKDIR /soft/libs_build_host
RUN cmake -DICU=0 -DCROSSTOOLS=1 -DBUILD_NUMBER=${LIBS_BUILD_NUMBER} ../libs \ RUN cmake -DICU=0 -DCROSSTOOLS=1 -DBUILD_NUMBER=${LIBS_BUILD_NUMBER} ../libs \

View File

@@ -3,9 +3,10 @@ FROM ${DOCKER_PREFIX}debian
ARG LIBS_BUILD_NUMBER=9999 ARG LIBS_BUILD_NUMBER=9999
ARG JOBS_COUNT=4 ARG JOBS_COUNT=4
ENV PATH=/opt/cmake/bin:$PATH
WORKDIR /soft WORKDIR /soft
RUN git clone -b release --depth 1 --recursive https://git.shs.tools/SHS/libs.git RUN git clone -b release --single-branch --depth 1 --recursive https://git.shs.tools/SHS/libs.git
WORKDIR /soft/libs_build_debian WORKDIR /soft/libs_build_debian
RUN cmake -DICU=0 -DLIB=1 -DQGLENGINE=1 -DQGLVIEW=1 -DBUILD_NUMBER=${LIBS_BUILD_NUMBER} ../libs \ RUN cmake -DICU=0 -DLIB=1 -DQGLENGINE=1 -DQGLVIEW=1 -DBUILD_NUMBER=${LIBS_BUILD_NUMBER} ../libs \

View File

@@ -3,9 +3,10 @@ FROM ${DOCKER_PREFIX}osx
ARG LIBS_BUILD_NUMBER=9999 ARG LIBS_BUILD_NUMBER=9999
ARG JOBS_COUNT=4 ARG JOBS_COUNT=4
ENV PATH=/soft/osxcross/target/bin:/opt/cmake/bin:$PATH
WORKDIR /soft WORKDIR /soft
RUN git clone -b release --depth 1 --recursive https://git.shs.tools/SHS/libs.git RUN git clone -b release --single-branch --depth 1 --recursive https://git.shs.tools/SHS/libs.git
WORKDIR /soft/libs_build_host WORKDIR /soft/libs_build_host
RUN cmake -DICU=0 -DCROSSTOOLS=1 -DBUILD_NUMBER=${LIBS_BUILD_NUMBER} ../libs \ RUN cmake -DICU=0 -DCROSSTOOLS=1 -DBUILD_NUMBER=${LIBS_BUILD_NUMBER} ../libs \

View File

@@ -3,9 +3,10 @@ FROM ${DOCKER_PREFIX}pi
ARG LIBS_BUILD_NUMBER=9999 ARG LIBS_BUILD_NUMBER=9999
ARG JOBS_COUNT=4 ARG JOBS_COUNT=4
ENV PATH=/opt/cmake/bin:$PATH
WORKDIR /soft WORKDIR /soft
RUN git clone -b release --depth 1 --recursive https://git.shs.tools/SHS/libs.git RUN git clone -b release --single-branch --depth 1 --recursive https://git.shs.tools/SHS/libs.git
WORKDIR /soft/libs_build_host WORKDIR /soft/libs_build_host
RUN cmake -DICU=0 -DCROSSTOOLS=1 -DBUILD_NUMBER=${LIBS_BUILD_NUMBER} ../libs \ RUN cmake -DICU=0 -DCROSSTOOLS=1 -DBUILD_NUMBER=${LIBS_BUILD_NUMBER} ../libs \

View File

@@ -3,9 +3,10 @@ FROM ${DOCKER_PREFIX}windows
ARG LIBS_BUILD_NUMBER=9999 ARG LIBS_BUILD_NUMBER=9999
ARG JOBS_COUNT=4 ARG JOBS_COUNT=4
ENV PATH=/opt/cmake/bin:$PATH
WORKDIR /soft WORKDIR /soft
RUN git clone -b release --depth 1 --recursive https://git.shs.tools/SHS/libs.git RUN git clone -b release --single-branch --depth 1 --recursive https://git.shs.tools/SHS/libs.git
WORKDIR /soft/libs_build_host WORKDIR /soft/libs_build_host
RUN cmake -DICU=0 -DCROSSTOOLS=1 -DBUILD_NUMBER=${LIBS_BUILD_NUMBER} ../libs \ RUN cmake -DICU=0 -DCROSSTOOLS=1 -DBUILD_NUMBER=${LIBS_BUILD_NUMBER} ../libs \

2
pip

Submodule pip updated: 5df43a45f2...9834ac177b

View File

@@ -106,7 +106,7 @@ const QAD::IODevice PI2QADIODevice(const PIVariantTypes::IODevice & v) {
const QAD::File PI2QADFile(const PIVariantTypes::File & v) { const QAD::File PI2QADFile(const PIVariantTypes::File & v) {
return QAD::File(PI2QString(v.file), PI2QString(v.filter), v.is_abs); return QAD::File(PI2QString(v.file), PI2QString(v.filter), v.is_abs, v.is_save);
} }
@@ -116,7 +116,7 @@ const QAD::Dir PI2QADDir(const PIVariantTypes::Dir & v) {
const PIVariantTypes::File QAD2PIFile(const QAD::File & v) { const PIVariantTypes::File QAD2PIFile(const QAD::File & v) {
return PIVariantTypes::File(Q2PIString(v.file), Q2PIString(v.filter), v.is_abs); return PIVariantTypes::File(Q2PIString(v.file), Q2PIString(v.filter), v.is_abs, v.is_save);
} }

View File

@@ -74,7 +74,7 @@ void FilterItem::rename() {
piForeachC (PICodeInfo::EnumeratorInfo & i, ei->members) piForeachC (PICodeInfo::EnumeratorInfo & i, ei->members)
if (i.value == mode()) { if (i.value == mode()) {
ms = PI2QString(i.name); ms = PI2QString(i.name);
piBreak; break;
} }
} }
text_mode->setText(ms); text_mode->setText(ms);

View File

@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.0)
cmake_policy(SET CMP0017 NEW) # need include() with .cmake cmake_policy(SET CMP0017 NEW) # need include() with .cmake
project(qad) project(qad)
set(_QAD_MAJOR 1) set(_QAD_MAJOR 1)
set(_QAD_MINOR 5) set(_QAD_MINOR 7)
set(_QAD_REVISION 0) set(_QAD_REVISION 0)
set(_QAD_SUFFIX ) set(_QAD_SUFFIX )
set(_QAD_COMPANY SHS) set(_QAD_COMPANY SHS)

View File

@@ -28,6 +28,9 @@
</color> </color>
</brush> </brush>
</property> </property>
<property name="renderHints">
<set>QPainter::SmoothPixmapTransform|QPainter::TextAntialiasing</set>
</property>
</widget> </widget>
</item> </item>
<item> <item>

View File

@@ -16,6 +16,7 @@ BlockBusItem::BlockBusItem(const BlockBusItem & other): QGraphicsObject(), Prope
setPen(other.pen()); setPen(other.pen());
setBrush(other.brush()); setBrush(other.brush());
setBusType(other.busType()); setBusType(other.busType());
square_node = other.square_node;
max_ep = other.max_ep; max_ep = other.max_ep;
pol = other.pol; pol = other.pol;
segments = other.segments; segments = other.segments;
@@ -46,6 +47,7 @@ void BlockBusItem::_init() {
bu.setColor(Qt::darkGray); bu.setColor(Qt::darkGray);
} }
setPen(pu); setBrush(bu); setPen(pu); setBrush(bu);
square_node = false;
max_ep = 0; max_ep = 0;
selPoint = selSegment = state_ = -1; selPoint = selSegment = state_ = -1;
pen_width = 2.; pen_width = 2.;
@@ -219,6 +221,12 @@ void BlockBusItem::setColor(const QColor & c) {
} }
void BlockBusItem::setSquareNodes(bool yes) {
square_node = yes;
update();
}
void BlockBusItem::markAsInput() { void BlockBusItem::markAsInput() {
mark_in = true; mark_in = true;
mark_out = false; mark_out = false;
@@ -299,7 +307,7 @@ QList<BlockItem * > BlockBusItem::connectedBlocks() const {
QSet<BlockItem * > ret; QSet<BlockItem * > ret;
foreach (BlockItemPin * p, pins) foreach (BlockItemPin * p, pins)
ret << p->parent(); ret << p->parent();
return ret.toList(); return ret.values();
} }
@@ -475,16 +483,16 @@ int BlockBusItem::neighborSegmentPoint(int point, int * seg) const {
} }
void BlockBusItem::testPoint(QPointF pos, int * sel_point, int * sel_segment) { void BlockBusItem::testPoint(QPointF pos, int * sel_point, int * sel_segment, bool for_trace) {
for (int i = 0; i < pol.size(); ++i) { for (int i = 0; i < pol.size(); ++i) {
if ((pol[i] - pos).manhattanLength() <= 10.) { // Point if ((pol[i] - pos).manhattanLength() <= (for_trace ? 5. : 10.)) { // Point
*sel_point = i; *sel_point = i;
*sel_segment = -1; *sel_segment = -1;
return; return;
} }
} }
for (int i = 0; i < segments.size(); ++i) { for (int i = 0; i < segments.size(); ++i) {
if (distPointToLine(pol[segments[i].first], pol[segments[i].second], pos) <= 7.) { // Segment if (distPointToLine(pol[segments[i].first], pol[segments[i].second], pos) <= (for_trace ? 5. : 7.)) { // Segment
*sel_point = -1; *sel_point = -1;
*sel_segment = i; *sel_segment = i;
return; return;
@@ -496,7 +504,12 @@ void BlockBusItem::testPoint(QPointF pos, int * sel_point, int * sel_segment) {
void BlockBusItem::hoverEnterEvent(QGraphicsSceneHoverEvent * e) { void BlockBusItem::hoverEnterEvent(QGraphicsSceneHoverEvent * e) {
tt = bus_name + (bus_name.isEmpty() ? "" : "\n\n") + tr("Add point: Ctrl + LeftClick\nRemove point\\segment: Ctrl + RightClick\nNew branch: Shift + LeftClick\nRemove connection: Shift + RightClick"); tt = bus_name + (bus_name.isEmpty() ? "" : "\n\n")
+ tr("Add point: Ctrl + LeftClick\n"
"Remove point\\segment: Ctrl + RightClick\n"
"Remove connection: Shift + RightClick\n"
"Move point\\segment: Shift + LeftPress\n"
"Change trace mode: press Shift, when mouse move");
} }
@@ -563,12 +576,12 @@ void BlockBusItem::mousePressEvent(QGraphicsSceneMouseEvent * e) {
QMetaObject::invokeMethod(scene()->views().back(), "newBranchCancel"); QMetaObject::invokeMethod(scene()->views().back(), "newBranchCancel");
} }
new_segment = false; new_segment = false;
if ((selPoint < 0 || selPoint > pol.size() - 1) && (selSegment < 0)) { if ((selPoint < 0 || selPoint > pol.size() - 1) && (selSegment < 0) && e->modifiers().testFlag(Qt::ShiftModifier)) {
QGraphicsObject::mousePressEvent(e); QGraphicsObject::mousePressEvent(e);
return; return;
} }
int btncnt = 0; int btncnt = 0;
if (endpoints().contains(selPoint) && e->button() == Qt::LeftButton) if (endpoints().contains(selPoint) && (e->button() == Qt::LeftButton) && e->modifiers().testFlag(Qt::ShiftModifier))
QMetaObject::invokeMethod(scene()->views().back(), "startBusPointMove", Q_ARG(int, busType())); QMetaObject::invokeMethod(scene()->views().back(), "startBusPointMove", Q_ARG(int, busType()));
if (e->buttons().testFlag(Qt::LeftButton)) btncnt++; if (e->buttons().testFlag(Qt::LeftButton)) btncnt++;
if (e->buttons().testFlag(Qt::RightButton)) btncnt++; if (e->buttons().testFlag(Qt::RightButton)) btncnt++;
@@ -591,28 +604,26 @@ void BlockBusItem::mousePressEvent(QGraphicsSceneMouseEvent * e) {
prepareGeometryChange(); prepareGeometryChange();
return; return;
} }
if (e->modifiers().testFlag(Qt::ShiftModifier)) { if (e->buttons().testFlag(Qt::LeftButton) && e->modifiers().testFlag(Qt::NoModifier)) {
if (e->buttons().testFlag(Qt::LeftButton)) { if (selSegment >= 0)
if (selSegment >= 0) press_pos = quantize(nearestPointOnLine(pol[segments[selSegment].first], pol[segments[selSegment].second], e->scenePos()), grid_step);
press_pos = quantize(nearestPointOnLine(pol[segments[selSegment].first], pol[segments[selSegment].second], e->scenePos()), grid_step); else {
else { if (selPoint >= 0)
if (selPoint >= 0) press_pos = pol[selPoint];
press_pos = pol[selPoint]; else
else return;
}
if (max_ep >= 2) {
if (endpointCount() >= max_ep)
if (pointSegmentsCount(selPoint) >= 2 || selSegment >= 0)
return; return;
}
if (max_ep >= 2) {
if (endpointCount() >= max_ep)
if (pointSegmentsCount(selPoint) >= 2 || selSegment >= 0)
return;
}
QMetaObject::invokeMethod(scene()->views().back(), "newBranch", Q_ARG(BlockBusItem * , this));
new_segment = true;
return;
}
if (e->buttons().testFlag(Qt::RightButton)) {
deleteLater();
} }
QMetaObject::invokeMethod(scene()->views().back(), "newBranch", Q_ARG(BlockBusItem * , this));
new_segment = true;
return;
}
if (e->buttons().testFlag(Qt::RightButton) && e->modifiers().testFlag(Qt::ShiftModifier)) {
deleteLater();
} }
if (e->modifiers().testFlag(Qt::ControlModifier)) { if (e->modifiers().testFlag(Qt::ControlModifier)) {
if (e->buttons().testFlag(Qt::RightButton)) { if (e->buttons().testFlag(Qt::RightButton)) {
@@ -635,24 +646,22 @@ void BlockBusItem::mousePressEvent(QGraphicsSceneMouseEvent * e) {
return; return;
} }
} }
if (e->modifiers().testFlag(Qt::ShiftModifier)) { if (e->buttons().testFlag(Qt::RightButton)) {
if (e->buttons().testFlag(Qt::RightButton)) { if (deleted) return;
if (deleted) return; deleted = true;
deleted = true;
}
} }
} }
void BlockBusItem::mouseMoveEvent(QGraphicsSceneMouseEvent * e) { void BlockBusItem::mouseMoveEvent(QGraphicsSceneMouseEvent * e) {
if (temp_ || mm_cancel) return; if (temp_ || mm_cancel) return;
if (((selPoint < 0 || selPoint > pol.size() - 1) && (selSegment < 0)) && !new_segment) { if (((selPoint < 0 || selPoint > pol.size() - 1) && (selSegment < 0)) && !new_segment && mm_mods.testFlag(Qt::ShiftModifier)) {
QGraphicsObject::mouseMoveEvent(e); QGraphicsObject::mouseMoveEvent(e);
return; return;
} }
qp = quantize(e->scenePos(), grid_step); qp = quantize(e->scenePos(), grid_step);
lp = qp - lp; lp = qp - lp;
if (e->buttons().testFlag(Qt::LeftButton) && mm_mods.testFlag(Qt::ShiftModifier) && new_segment) { if (e->buttons().testFlag(Qt::LeftButton) && mm_mods.testFlag(Qt::NoModifier) && new_segment) {
QMetaObject::invokeMethod(scene()->views().back(), "newBranchTrace", Q_ARG(BlockBusItem * , this), Q_ARG(QPointF, e->scenePos())); QMetaObject::invokeMethod(scene()->views().back(), "newBranchTrace", Q_ARG(BlockBusItem * , this), Q_ARG(QPointF, e->scenePos()));
return; return;
} }
@@ -677,7 +686,7 @@ void BlockBusItem::mouseMoveEvent(QGraphicsSceneMouseEvent * e) {
void BlockBusItem::mouseReleaseEvent(QGraphicsSceneMouseEvent * e) { void BlockBusItem::mouseReleaseEvent(QGraphicsSceneMouseEvent * e) {
mm_mods = 0; mm_mods = Qt::KeyboardModifiers();
int btncnt = 0; int btncnt = 0;
if (e->buttons().testFlag(Qt::LeftButton)) btncnt++; if (e->buttons().testFlag(Qt::LeftButton)) btncnt++;
if (e->buttons().testFlag(Qt::RightButton)) btncnt++; if (e->buttons().testFlag(Qt::RightButton)) btncnt++;
@@ -720,9 +729,20 @@ void BlockBusItem::paint(QPainter * p, const QStyleOptionGraphicsItem * o, QWidg
//if (mark_in) {p->setPen(pa); p->setBrush(ba);} //if (mark_in) {p->setPen(pa); p->setBrush(ba);}
//if (mark_out) {p->setPen(pr); p->setBrush(br);} //if (mark_out) {p->setPen(pr); p->setBrush(br);}
if (im_bus.isNull()) { if (im_bus.isNull()) {
QPen _pen(p->pen());
for (int i = 0; i < segments.size(); ++i) { for (int i = 0; i < segments.size(); ++i) {
_pen.setWidthF(pen_width);
_pen.setCapStyle(Qt::SquareCap);
p->setPen(_pen);
p->drawLine(pol[segments[i].first], pol[segments[i].second]); p->drawLine(pol[segments[i].first], pol[segments[i].second]);
if (pointSegmentsCount(segments[i].first) > 2) {
_pen.setWidthF(pen_width * 1.8 + 2.);
_pen.setCapStyle(square_node ? Qt::SquareCap : Qt::RoundCap);
p->setPen(_pen);
p->drawPoint(pol[segments[i].first]);
}
} }
p->setPen(_pen);
} else { } else {
QBrush br; QBrush br;
br.setTextureImage(im_bus); br.setTextureImage(im_bus);

View File

@@ -46,7 +46,7 @@ public:
double endpointImageScale() const {return im_end_scale;} double endpointImageScale() const {return im_end_scale;}
void appendPoint(const QPointF & p); void appendPoint(const QPointF & p);
void appendPoint(qreal x, qreal y); void appendPoint(qreal x, qreal y);
void testPoint(QPointF pos, int * sel_point, int * sel_segment); void testPoint(QPointF pos, int * sel_point, int * sel_segment, bool for_trace = false);
void clear(); void clear();
/*void setStart(const QPointF & p) {pol[0] = p; scene()->update();} /*void setStart(const QPointF & p) {pol[0] = p; scene()->update();}
void setStart(qreal x, qreal y) {setStart(QPointF(x, y));} void setStart(qreal x, qreal y) {setStart(QPointF(x, y));}
@@ -64,6 +64,7 @@ public:
double width() const {return pen_width;} double width() const {return pen_width;}
void setWidth(const double & w); void setWidth(const double & w);
void setColor(const QColor & c); void setColor(const QColor & c);
void setSquareNodes(bool yes);
int addPoint(const QPointF & point, bool update = true); int addPoint(const QPointF & point, bool update = true);
int segmentPointPair(int point, int * seg = 0) const; int segmentPointPair(int point, int * seg = 0) const;
void removePoint(int index); void removePoint(int index);
@@ -122,7 +123,7 @@ protected:
QImage im_bus, im_end; QImage im_bus, im_end;
QPolygonF pol, bpol, pol_s; QPolygonF pol, bpol, pol_s;
Qt::KeyboardModifiers mm_mods; Qt::KeyboardModifiers mm_mods;
bool temp_; bool temp_, square_node;
double pen_width, grid_step, im_bus_scale, im_end_scale; double pen_width, grid_step, im_bus_scale, im_end_scale;
int selPoint, selSegment, max_ep, bus_type, state_; int selPoint, selSegment, max_ep, bus_type, state_;
bool moved, deleted, mark_in, mark_out, new_segment, mm_cancel, lm_point; bool moved, deleted, mark_in, mark_out, new_segment, mm_cancel, lm_point;

View File

@@ -1,8 +1,26 @@
project(blockeditor) project(blockeditor)
import_version(${PROJECT_NAME} QAD)
find_qt(${QtVersions} Core Gui Widgets) find_qt(${QtVersions} Core Gui Widgets)
if (Qt5_FOUND)
import_version(${PROJECT_NAME}5 ${PROJECT_NAME})
import_deploy_properties(${PROJECT_NAME}5 ${PROJECT_NAME})
endif()
set_deploy_property(${PROJECT_NAME}
LABEL ${PROJECT_NAME}
FULLNAME "${_QAD_DOMAIN}.${PROJECT_NAME}"
COMPANY ${_QAD_COMPANY}
INFO "Editor for BlockView Blocks")
if(APPLE)
#set_deploy_property(${PROJECT_NAME} ICON "icons/blockview.icns")
elseif(WIN32)
set_deploy_property(${PROJECT_NAME} ICON "icons/blockview.ico")
else()
set_deploy_property(${PROJECT_NAME} ICON "icons/blockview.png")
endif()
make_rc(${PROJECT_NAME} out_RC)
qt_sources(SRC) qt_sources(SRC)
qt_wrap(${SRC} CPPS out_CPP QMS out_QM) qt_wrap(${SRC} HDRS out_HDR CPPS out_CPP QMS out_QM)
qt_add_executable(${PROJECT_NAME} WIN32 out_CPP) qt_add_executable(${PROJECT_NAME} WIN32 out_CPP ${out_RC})
qt_target_link_libraries(${PROJECT_NAME} qad_utils qad_widgets qad_blockview) qt_target_link_libraries(${PROJECT_NAME} qad_utils qad_widgets qad_blockview)
message(STATUS "Building ${PROJECT_NAME}") message(STATUS "Building ${PROJECT_NAME}")
if(LIB) if(LIB)
@@ -18,5 +36,7 @@ if(LIB)
#message(STATUS "Install ${PROJECT_NAME} to system \"${CMAKE_INSTALL_PREFIX}\"") #message(STATUS "Install ${PROJECT_NAME} to system \"${CMAKE_INSTALL_PREFIX}\"")
else() else()
qt_install(TARGETS ${PROJECT_NAME} DESTINATION bin) qt_install(TARGETS ${PROJECT_NAME} DESTINATION bin)
#message(STATUS "Install ${PROJECT_NAME} to local \"bin\"") endif()
if (Qt5_FOUND)
deploy_target(${PROJECT_NAME}5 VERBOSE DEPLOY_DIR ${CMAKE_CURRENT_BINARY_DIR} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/../release)
endif() endif()

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@@ -1,43 +0,0 @@
# if defined(UNDER_CE)
# include <winbase.h>
# else
# include <winver.h>
# endif
1 ICON icons/blockview.ico
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,0
PRODUCTVERSION 1,0,0,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x9L
#else
FILEFLAGS 0x8L
#endif
FILEOS 0x40004L
FILETYPE 0x2L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "Comments", "\0"
VALUE "CompanyName", "BMSTU SM5\0"
VALUE "FileDescription", "Block Editor\0"
VALUE "FileVersion", "1,0,0,0\0"
VALUE "InternalName", "Block Editor\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "blockeditor.exe\0"
VALUE "PrivateBuild", "1\0"
VALUE "ProductName", "Block Editor\0"
VALUE "ProductVersion", "1, 0, 0, 0\0"
VALUE "SpecialBuild", "\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END

View File

@@ -8,6 +8,7 @@
#include <QVector2D> #include <QVector2D>
#include <QClipboard> #include <QClipboard>
#include <QMimeData> #include <QMimeData>
#include <QElapsedTimer>
const QString _BlockView_Mime_ = "_BlockView_copypaste_"; const QString _BlockView_Mime_ = "_BlockView_copypaste_";
@@ -45,9 +46,9 @@ void BlockView::_init() {
smode = BlockView::MultiSelection; smode = BlockView::MultiSelection;
cur_scl = thumb_scl = prev_app_scale = 1.; cur_scl = thumb_scl = prev_app_scale = 1.;
_talpha = 0.; _talpha = 0.;
ae_enabled = is_block_anim = true; ae_enabled = is_block_anim = is_nav_anim = true;
is_nav_anim = true;
nav_prev_aa = nav_prev_imaa = nav_prev_grid = true; nav_prev_aa = nav_prev_imaa = nav_prev_grid = true;
square_node = false;
thumb_size = QSizeF(200, 200); thumb_size = QSizeF(200, 200);
if (scene() == 0) { if (scene() == 0) {
scene_ = new QGraphicsScene; scene_ = new QGraphicsScene;
@@ -938,6 +939,7 @@ void BlockView::addItem(QGraphicsItem * item, bool emit_action) {
applyGridStep(); applyGridStep();
if (item->data(1005) == "connection") { if (item->data(1005) == "connection") {
loadBus(qgraphicsitem_cast<BlockBusItem*>(item)); loadBus(qgraphicsitem_cast<BlockBusItem*>(item));
((BlockBusItem*)item)->setSquareNodes(square_node);
connect((BlockBusItem*)item, SIGNAL(destroyed(QObject*)), this, SLOT(removedBus(QObject*)), Qt::UniqueConnection); connect((BlockBusItem*)item, SIGNAL(destroyed(QObject*)), this, SLOT(removedBus(QObject*)), Qt::UniqueConnection);
if (emit_action) emitActionEvent(BlockItemBase::BusAdd, QList<QGraphicsItem*>() << item); if (emit_action) emitActionEvent(BlockItemBase::BusAdd, QList<QGraphicsItem*>() << item);
emit connectionsChanged(); emit connectionsChanged();
@@ -1236,7 +1238,7 @@ void BlockView::trace(QPointF scene_pos_from, QPointF scene_pos_to, BlockBusItem
int dx = sr.left() / grid_step, dy = sr.top() / grid_step; int dx = sr.left() / grid_step, dy = sr.top() / grid_step;
//qDebug() << dp; //qDebug() << dp;
QPoint dp(-dx, -dy), qpt = quantize(scene_pos_to, grid_step).toPoint() / grid_step + dp; QPoint dp(-dx, -dy), qpt = quantize(scene_pos_to, grid_step).toPoint() / grid_step + dp;
QTime tm; QElapsedTimer tm;
tm.restart(); tm.restart();
wavetrace.resize(sr.size() / grid_step); wavetrace.resize(sr.size() / grid_step);
wavetrace.fill(BlockViewWavetrace::Empty); wavetrace.fill(BlockViewWavetrace::Empty);
@@ -1262,23 +1264,26 @@ void BlockView::trace(QPointF scene_pos_from, QPointF scene_pos_to, BlockBusItem
double signx = (p1.x() >= p0.x() ? 1. : -1.), signy = (p1.y() >= p0.y() ? 1. : -1.); double signx = (p1.x() >= p0.x() ? 1. : -1.), signy = (p1.y() >= p0.y() ? 1. : -1.);
int steps(0); int steps(0);
if ((dx + dy) < grid_step) continue; if ((dx + dy) < grid_step) continue;
BlockViewWavetrace::CellState cs = BlockViewWavetrace::Blocked;
if (dx >= dy) { // by x if (dx >= dy) { // by x
sx = grid_step; sx = grid_step;
sy = sx * dy / dx; sy = sx * dy / dx;
steps = qRound(dx / grid_step); steps = qRound(dx / grid_step);
cs = BlockViewWavetrace::HorizontalBus;
} else { } else {
sy = grid_step; sy = grid_step;
sx = sy * dx / dy; sx = sy * dx / dy;
steps = qRound(dy / grid_step); steps = qRound(dy / grid_step);
cs = BlockViewWavetrace::VerticalBus;
} }
sx *= signx; sx *= signx;
sy *= signy; sy *= signy;
//qDebug() << "fill" << p0 << "->" << p1 << "in" << steps << sx << sy; //qDebug() << "fill" << p0 << "->" << p1 << "in" << steps << sx << sy;
for (int j = 0; j < steps; ++j) { for (int j = 0; j <= steps; ++j) {
QPoint tp = quantize(cp, grid_step).toPoint() / grid_step + dp; QPoint tp = quantize(cp, grid_step).toPoint() / grid_step + dp;
if (tp != qpt) if (tp != qpt)
wavetrace.fill(tp, BlockViewWavetrace::Blocked); wavetrace.fill(tp, (j > 0 && j < steps) ? cs : BlockViewWavetrace::Blocked);
//qDebug() << " set" << cp; //qDebug() << " set" << cp << ((j > 0 && j < steps) ? cs : BlockViewWavetrace::Blocked);
cp += QPointF(sx, sy); cp += QPointF(sx, sy);
} }
} }
@@ -1344,7 +1349,7 @@ void BlockView::matchBus() {
//qDebug() << "1" << buses.size() << tmp_bus.pol; //qDebug() << "1" << buses.size() << tmp_bus.pol;
for (int i = 0; i < buses.size(); ++i) { for (int i = 0; i < buses.size(); ++i) {
b = buses[i]; b = buses[i];
b->testPoint(point, &sp, &ss); b->testPoint(point, &sp, &ss, true);
//qDebug() << i << sp << ss; //qDebug() << i << sp << ss;
if (sp >= 0 || ss >= 0) break; if (sp >= 0 || ss >= 0) break;
} }
@@ -1719,6 +1724,15 @@ void BlockView::checkPaste(bool queued) {
} }
void BlockView::setBusSquareNodes(bool yes) {
square_node = yes;
QList<BlockBusItem * > sbl = buses();
foreach (BlockBusItem * b, sbl) {
b->setSquareNodes(square_node);
}
}
void BlockView::newBranchTrace(BlockBusItem * item, QPointF to) { void BlockView::newBranchTrace(BlockBusItem * item, QPointF to) {
trace(item->press_pos, to, &tmp_bus); trace(item->press_pos, to, &tmp_bus);

View File

@@ -57,6 +57,7 @@ class QAD_EXPORT BlockView: public QGraphicsView
Q_PROPERTY(bool pinMulticonnect READ isPinMulticonnectEnabled WRITE setPinMulticonnectEnabled) Q_PROPERTY(bool pinMulticonnect READ isPinMulticonnectEnabled WRITE setPinMulticonnectEnabled)
Q_PROPERTY(bool miniMap READ isMiniMapEnabled WRITE setMiniMapEnabled) Q_PROPERTY(bool miniMap READ isMiniMapEnabled WRITE setMiniMapEnabled)
Q_PROPERTY(bool zoomWheelOnly READ isZoomWheelOnly WRITE setZoomWheelOnly) Q_PROPERTY(bool zoomWheelOnly READ isZoomWheelOnly WRITE setZoomWheelOnly)
Q_PROPERTY(bool busSquareNodes READ isBusSquareNodes WRITE setBusSquareNodes)
Q_PROPERTY(double _thumb READ _thumb WRITE _setThumb DESIGNABLE false SCRIPTABLE false) Q_PROPERTY(double _thumb READ _thumb WRITE _setThumb DESIGNABLE false SCRIPTABLE false)
Q_PROPERTY(QRectF _nav READ _nav WRITE _setNav DESIGNABLE false SCRIPTABLE false) Q_PROPERTY(QRectF _nav READ _nav WRITE _setNav DESIGNABLE false SCRIPTABLE false)
@@ -84,6 +85,7 @@ public:
bool isPinMulticonnectEnabled() const {return m_pin_mc;} bool isPinMulticonnectEnabled() const {return m_pin_mc;}
bool isMiniMapEnabled() const {return minimap;} bool isMiniMapEnabled() const {return minimap;}
bool isZoomWheelOnly() const {return wheel_zoom;} bool isZoomWheelOnly() const {return wheel_zoom;}
bool isBusSquareNodes() const {return square_node;}
double gridStep() const {return grid_step;} double gridStep() const {return grid_step;}
double gridPointsWidth() const {return grid_points;} double gridPointsWidth() const {return grid_points;}
SelectionMode selectionMode() const {return smode;} SelectionMode selectionMode() const {return smode;}
@@ -195,7 +197,7 @@ protected:
int timer_thumb, thumb_hide_delay, thick; int timer_thumb, thumb_hide_delay, thick;
bool mm_drag, new_bus, new_branch, moved, mm_cancel, iconnect, mm_copy, mm_thumb, ae_enabled, is_nav_anim, is_block_anim, move_bus_point; bool mm_drag, new_bus, new_branch, moved, mm_cancel, iconnect, mm_copy, mm_thumb, ae_enabled, is_nav_anim, is_block_anim, move_bus_point;
bool grid_visible, grid_snap, pm_connect, navigation, m_connect, m_trace_with_buses, m_pin_mc, minimap, prev_tcb, wheel_zoom; bool grid_visible, grid_snap, pm_connect, navigation, m_connect, m_trace_with_buses, m_pin_mc, minimap, prev_tcb, wheel_zoom;
bool nav_prev_aa, nav_prev_imaa, nav_prev_grid; bool nav_prev_aa, nav_prev_imaa, nav_prev_grid, square_node;
double grid_step, grid_points, cur_scl, _talpha, thumb_scl; double grid_step, grid_points, cur_scl, _talpha, thumb_scl;
double prev_app_scale; double prev_app_scale;
@@ -235,6 +237,7 @@ public slots:
void setPinMulticonnectEnabled(bool on) {m_pin_mc = on;} void setPinMulticonnectEnabled(bool on) {m_pin_mc = on;}
void setMiniMapEnabled(bool on) {minimap = on;} void setMiniMapEnabled(bool on) {minimap = on;}
void setZoomWheelOnly(bool on) {wheel_zoom = on;} void setZoomWheelOnly(bool on) {wheel_zoom = on;}
void setBusSquareNodes(bool yes);
void zoom(double factor); void zoom(double factor);
void zoomIn() {zoom(1.2);} void zoomIn() {zoom(1.2);}

View File

@@ -1,11 +1,10 @@
#include "blockviewwavetrace.h" #include "blockviewwavetrace.h"
#include <QTime>
BlockViewWavetrace::BlockViewWavetrace(int width, int height) { BlockViewWavetrace::BlockViewWavetrace(int width, int height) {
max_steps = 512; max_steps = 512;
resize(width, height); resize(width, height);
setPreferredDirection(BlockViewWavetrace::Horizontal); setPreferredDirection(Horizontal);
} }
@@ -17,14 +16,13 @@ void BlockViewWavetrace::resize(int width, int height) {
for (int i = 0; i < wid; ++i) { for (int i = 0; i < wid; ++i) {
if (field[i].size() != hei) { if (field[i].size() != hei) {
field[i].resize(hei); field[i].resize(hei);
field[i].fill(-1); field[i].fill(Cell());
} }
} }
} }
void BlockViewWavetrace::fill(short val) { void BlockViewWavetrace::fill(short val) {
QTime tm; tm.restart();
for (int i = 0; i < wid; ++i) { for (int i = 0; i < wid; ++i) {
if (i == 0) if (i == 0)
field[i].fill(val); field[i].fill(val);
@@ -37,7 +35,18 @@ void BlockViewWavetrace::fill(short val) {
void BlockViewWavetrace::fill(const QRect & rect, short val) { void BlockViewWavetrace::fill(const QRect & rect, short val) {
for (int i = rect.left(); i <= rect.right(); ++i) for (int i = rect.left(); i <= rect.right(); ++i)
for (int j = rect.top(); j <= rect.bottom(); ++j) for (int j = rect.top(); j <= rect.bottom(); ++j)
field[i][j] = val; field[i][j].value = field[i][j].direction = val;
}
void BlockViewWavetrace::fill(int px, int py, short val) {
short p = field[px][py].value;
if ((val == HorizontalBus && p == VerticalBus ) ||
(val == VerticalBus && p == HorizontalBus))
field[px][py].value = Blocked;
else
field[px][py].value = val;
field[px][py].direction = field[px][py].value;
} }
@@ -47,52 +56,33 @@ bool BlockViewWavetrace::trace(const QPoint & start, const QPoint & finish) {
if (dir_ == NoTrace) return true; if (dir_ == NoTrace) return true;
//qDebug() << "trace" << start << finish; //qDebug() << "trace" << start << finish;
//return true; //return true;
int cx, cy; short cl = 0;
short cl = 0, empty = (short)BlockViewWavetrace::Empty;
QRect frect(0, 0, wid - 1, hei - 1); QRect frect(0, 0, wid - 1, hei - 1);
QVector<QPoint> cpnts, npnts; QVector<QPoint> cpnts, npnts;
fill(st, cl); fill(st, cl);
cpnts.push_back(st); cpnts.push_back(st);
if (field[fn.x()][fn.y()] == (short)BlockViewWavetrace::Blocked) if (field[fn.x()][fn.y()].value == (short)Blocked)
return false; return false;
auto checkAndFill = [this, &npnts, &frect](int x, int y, short acc_dir, short c) {
if (!frect.contains(x, y)) return;
short p = field[x][y].value;
if (p == (short)Empty || p == acc_dir) {
npnts.push_back(QPoint(x, y));
field[x][y].value = c;
}
};
while (cpnts.size() > 0) { while (cpnts.size() > 0) {
npnts.clear(); npnts.clear();
cl++; cl++;
if (cl >= max_steps) return false; if (cl >= max_steps)
return false;
for (int i = 0; i < cpnts.size(); ++i) { for (int i = 0; i < cpnts.size(); ++i) {
if (cpnts[i] == fn) { if (cpnts[i] == fn)
return true; return true;
} checkAndFill(cpnts[i].x() - 1, cpnts[i].y() , (short)VerticalBus , cl);
cx = cpnts[i].x() - 1; checkAndFill(cpnts[i].x() + 1, cpnts[i].y() , (short)VerticalBus , cl);
cy = cpnts[i].y(); checkAndFill(cpnts[i].x() , cpnts[i].y() - 1, (short)HorizontalBus, cl);
if (frect.contains(cx, cy)) { checkAndFill(cpnts[i].x() , cpnts[i].y() + 1, (short)HorizontalBus, cl);
if (field[cx][cy] == empty) {
npnts.push_back(QPoint(cx, cy));
fill(cx, cy, cl);
}
}
cx = cpnts[i].x() + 1;
if (frect.contains(cx, cy)) {
if (field[cx][cy] == empty) {
npnts.push_back(QPoint(cx, cy));
fill(cx, cy, cl);
}
}
cx = cpnts[i].x();
cy = cpnts[i].y() - 1;
if (frect.contains(cx, cy)) {
if (field[cx][cy] == empty) {
npnts.push_back(QPoint(cx, cy));
fill(cx, cy, cl);
}
}
cy = cpnts[i].y() + 1;
if (frect.contains(cx, cy)) {
if (field[cx][cy] == empty) {
npnts.push_back(QPoint(cx, cy));
fill(cx, cy, cl);
}
}
} }
cpnts = npnts; cpnts = npnts;
//qDebug() << cl << ": " << cpnts.size(); //qDebug() << cl << ": " << cpnts.size();
@@ -108,68 +98,43 @@ void BlockViewWavetrace::gatherPath() {
path_.push_front(st); path_.push_front(st);
return; return;
} }
int cx, cy;
int pa = -1, ca = -1; int pa = -1, ca = -1;
bool first = true; bool first = true;
short cl = field[fn.x()][fn.y()]; short cl = field[fn.x()][fn.y()].value;
QRect frect(0, 0, wid, hei); QRect frect(0, 0, wid, hei);
QPoint cpnt = fn; QPoint cpnt = fn;
//cout << "start from " << cl << endl; //cout << "start from " << cl << endl;
auto checkAndStep = [this, &cpnt, &first, &frect] (int dir, short c, int & ca_, int pa_)->bool {
int cx = cpnt.x() + dps[dir].x();
int cy = cpnt.y() + dps[dir].y();
if (frect.contains(cx, cy)) {
const Cell & cell(field[cx][cy]);
if (cell.value == c) {
if (cell.direction == HorizontalBus || cell.direction == VerticalBus) {
if (dps[dir].x() == 0 && cell.direction == VerticalBus)
return false;
if (dps[dir].y() == 0 && cell.direction == HorizontalBus)
return false;
}
ca_ = QLineF(QPointF(cx, cy), cpnt).angle();
if (ca_ != pa_ && !first)
path_.push_front(cpnt);
cpnt = QPoint(cx, cy);
first = false;
return true;
}
}
return false;
};
while (cl > 0) { while (cl > 0) {
cl--; cl--;
pa = ca; pa = ca;
int dir = 0;
cx = cpnt.x() + dps[dir].x(); if (checkAndStep(0, cl, ca, pa)) continue;
cy = cpnt.y() + dps[dir].y(); if (checkAndStep(1, cl, ca, pa)) continue;
dir++; if (checkAndStep(2, cl, ca, pa)) continue;
if (frect.contains(cx, cy)) { if (checkAndStep(3, cl, ca, pa)) continue;
if (field[cx][cy] == cl) {
ca = QLineF(QPointF(cx, cy), cpnt).angle();
if (ca != pa && !first)
path_.push_front(cpnt);
cpnt = QPoint(cx, cy);
first = false;
continue;
}
}
cx = cpnt.x() + dps[dir].x();
cy = cpnt.y() + dps[dir].y();
dir++;
if (frect.contains(cx, cy)) {
if (field[cx][cy] == cl) {
ca = QLineF(QPointF(cx, cy), cpnt).angle();
if (ca != pa && !first)
path_.push_front(cpnt);
cpnt = QPoint(cx, cy);
first = false;
continue;
}
}
cx = cpnt.x() + dps[dir].x();
cy = cpnt.y() + dps[dir].y();
dir++;
if (frect.contains(cx, cy)) {
if (field[cx][cy] == cl) {
ca = QLineF(QPointF(cx, cy), cpnt).angle();
if (ca != pa && !first)
path_.push_front(cpnt);
cpnt = QPoint(cx, cy);
first = false;
continue;
}
}
cx = cpnt.x() + dps[dir].x();
cy = cpnt.y() + dps[dir].y();
if (frect.contains(cx, cy)) {
if (field[cx][cy] == cl) {
ca = QLineF(QPointF(cx, cy), cpnt).angle();
if (ca != pa && !first)
path_.push_front(cpnt);
cpnt = QPoint(cx, cy);
first = false;
continue;
}
}
} }
path_.push_front(st); path_.push_front(st);
//cout << path_.size() << endl; //cout << path_.size() << endl;

View File

@@ -27,7 +27,7 @@ class QAD_EXPORT BlockViewWavetrace {
public: public:
BlockViewWavetrace(int width = 1, int height = 1); BlockViewWavetrace(int width = 1, int height = 1);
enum CellState {Empty = -1, Blocked = -2}; enum CellState {Empty = -1, Blocked = -2, HorizontalBus = -3, VerticalBus = -4};
enum Direction {NoTrace, Horizontal, Vertical}; enum Direction {NoTrace, Horizontal, Vertical};
int width() const {return wid;} int width() const {return wid;}
@@ -36,8 +36,8 @@ public:
void resize(const QSize & sz) {resize(sz.width(), sz.height());} void resize(const QSize & sz) {resize(sz.width(), sz.height());}
void fill(short val = -1); void fill(short val = -1);
void fill(const QRect & rect, short val = -1); void fill(const QRect & rect, short val = -1);
void fill(const QPoint & point, short val = -1) {field[point.x()][point.y()] = val;} void fill(const QPoint & point, short val = -1) {fill(point.x(), point.y(), val);}
void fill(int px, int py, short val = -1) {field[px][py] = val;} void fill(int px, int py, short val);
void fill(BlockViewWavetrace::CellState val = Empty) {fill((short)val);} void fill(BlockViewWavetrace::CellState val = Empty) {fill((short)val);}
void fill(const QRect & rect, BlockViewWavetrace::CellState val = Empty) {fill(rect, (short)val);} void fill(const QRect & rect, BlockViewWavetrace::CellState val = Empty) {fill(rect, (short)val);}
void fill(const QPoint & point, BlockViewWavetrace::CellState val = Empty) {fill(point, (short)val);} void fill(const QPoint & point, BlockViewWavetrace::CellState val = Empty) {fill(point, (short)val);}
@@ -52,10 +52,17 @@ public:
const QVector<QPoint> & path() const; const QVector<QPoint> & path() const;
private: private:
struct Cell {
Cell(short v = Empty): value(v), direction(0) {}
short value;
short direction;
};
int wid, hei, max_steps; int wid, hei, max_steps;
Direction dir_; Direction dir_;
QVector<QVector<short> > field; QVector<QVector<Cell> > field;
QVector<QPoint> path_; QVector<QPoint> path_;
QVector<QPoint> jumps;
QPoint dps[4], st, fn; QPoint dps[4], st, fn;
}; };

View File

@@ -4,11 +4,12 @@
<context> <context>
<name>BlockBusItem</name> <name>BlockBusItem</name>
<message> <message>
<location filename="../blockbusitem.cpp" line="499"/> <location filename="../blockbusitem.cpp" line="500"/>
<source>Add point: Ctrl + LeftClick <source>Add point: Ctrl + LeftClick
Remove point\segment: Ctrl + RightClick Remove point\segment: Ctrl + RightClick
New branch: Shift + LeftClick Remove connection: Shift + RightClick
Remove connection: Shift + RightClick</source> Move point\segment: Shift + LeftPress
Change trace mode: press Shift, when mouse move</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
</context> </context>
@@ -347,7 +348,7 @@ Image</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../drawtools.cpp" line="824"/> <location filename="../drawtools.cpp" line="837"/>
<source>Select image</source> <source>Select image</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>

View File

@@ -4,16 +4,39 @@
<context> <context>
<name>BlockBusItem</name> <name>BlockBusItem</name>
<message> <message>
<location filename="../blockbusitem.cpp" line="499"/>
<source>Add point: Ctrl + LeftClick <source>Add point: Ctrl + LeftClick
Remove point\segment: Ctrl + RightClick Remove point\segment: Ctrl + RightClick
New branch: Shift + LeftClick New branch: Shift + LeftClick
Remove connection: Shift + RightClick</source> Remove connection: Shift + RightClick</source>
<translation>Добавить точку: Ctrl + LeftClick <translation type="vanished">Добавить точку: Ctrl + LeftClick
Удалить точку\сегмент: Ctrl + RightClick Удалить точку\сегмент: Ctrl + RightClick
Новая ветка: Shift + LeftClick Новая ветка: Shift + LeftClick
Удалить шину: Shift + RightClick</translation> Удалить шину: Shift + RightClick</translation>
</message> </message>
<message>
<source>Add point: Ctrl + LeftClick
Remove point\segment: Ctrl + RightClick
Remove connection: Shift + RightClick
Move point\segment: Shift + mouse move
Change trace mode: press Shift, when mouse move</source>
<translation type="obsolete">Добавить точку: Ctrl + LeftClick
Удалить точку\сегмент: Ctrl + RightClick
Удалить шину: Shift + RightClick
Переместить точку\сегмент: Shift + двига</translation>
</message>
<message>
<location filename="../blockbusitem.cpp" line="500"/>
<source>Add point: Ctrl + LeftClick
Remove point\segment: Ctrl + RightClick
Remove connection: Shift + RightClick
Move point\segment: Shift + LeftPress
Change trace mode: press Shift, when mouse move</source>
<translation>Добавить точку: Ctrl + LeftClick
Удалить точку\сегмент: Ctrl + RightClick
Удалить шину: Shift + RightClick
Переместить точку\сегмент: Shift + LeftPress
Поменять режим трассировки: нажать Shift, во время перемещения мыши</translation>
</message>
</context> </context>
<context> <context>
<name>BlockEditor</name> <name>BlockEditor</name>
@@ -363,7 +386,7 @@ Image</source>
картинку</translation> картинку</translation>
</message> </message>
<message> <message>
<location filename="../drawtools.cpp" line="824"/> <location filename="../drawtools.cpp" line="837"/>
<source>Select image</source> <source>Select image</source>
<translation>Выбрать картинку</translation> <translation>Выбрать картинку</translation>
</message> </message>

View File

@@ -96,6 +96,20 @@ foreach(_Q ${_QAD_LIBS})
#message(STATUS "Library qad_${_Q}5 (${_QU}) -> ${QAD5_${_QU}_LIBRARY} found in ${_SEARCH_DIR}") #message(STATUS "Library qad_${_Q}5 (${_QU}) -> ${QAD5_${_QU}_LIBRARY} found in ${_SEARCH_DIR}")
list(APPEND QT_MULTILIB_LIST qad_${_Q}) list(APPEND QT_MULTILIB_LIST qad_${_Q})
endforeach() endforeach()
set(_PIQT_LIBS piqt piqt_utils)
foreach(_Q ${_PIQT_LIBS})
foreach(_v ${_QT_VERSIONS_})
set(MULTILIB_${_Q}_SUFFIX_Qt${_v} ${_v})
if(hasParent)
set(MULTILIB_${_Q}_SUFFIX_Qt${_v} ${_v} PARENT_SCOPE)
endif()
#message(STATUS "MULTILIB_${_Q}_SUFFIX_Qt${_v} = ${_v}")
endforeach()
#message(STATUS "Library ${_Q}5 (${_QU}) -> ${QAD5_${_QU}_LIBRARY} found in ${_SEARCH_DIR}")
list(APPEND QT_MULTILIB_LIST ${_Q})
endforeach()
foreach(_Q ${_QAD_LIBS}) foreach(_Q ${_QAD_LIBS})
string(TOUPPER ${_Q} _QU) string(TOUPPER ${_Q} _QU)
set(_target QAD::${_ITN_${_Q}}) set(_target QAD::${_ITN_${_Q}})

View File

@@ -51,6 +51,7 @@ void TouchButtFrame::setButtons(const QStringList & captions) {
addButton(QString(captions.at(i)).replace("\\n", "\n")); addButton(QString(captions.at(i)).replace("\\n", "\n"));
if (button(cur) != 0) button(cur)->setChecked(true); if (button(cur) != 0) button(cur)->setChecked(true);
else if (!captions.isEmpty()) button(0)->setChecked(true); else if (!captions.isEmpty()) button(0)->setChecked(true);
resetColors();
} }

View File

@@ -46,9 +46,15 @@ public:
int id; int id;
T data; T data;
}; };
template <typename T> static Chunk<T> chunk(int id, const T & data) {return Chunk<T>(id, data);} template <typename T>
struct ChunkConst {
ChunkConst(int i, const T & d): id(i), data(d) {}
int id;
const T & data;
};
template <typename T> static ChunkConst<T> chunk(int id, const T & data) {return ChunkConst<T>(id, data);}
template <typename T> ChunkStream & add(int id, const T & data) {*this << Chunk<T>(id, data); return *this;} template <typename T> ChunkStream & add(int id, const T & data) {*this << ChunkConst<T>(id, data); return *this;}
void setSource(const QByteArray & data); void setSource(const QByteArray & data);
void setSource(QDataStream & str); void setSource(QDataStream & str);
@@ -88,6 +94,7 @@ private:
QMap<int, QByteArray> data_map; QMap<int, QByteArray> data_map;
template <typename T> friend ChunkStream & operator <<(ChunkStream & s, const ChunkStream::Chunk<T> & c); template <typename T> friend ChunkStream & operator <<(ChunkStream & s, const ChunkStream::Chunk<T> & c);
template <typename T> friend ChunkStream & operator <<(ChunkStream & s, const ChunkStream::ChunkConst<T> & c);
}; };
template <typename T> template <typename T>
@@ -111,5 +118,26 @@ ChunkStream & operator <<(ChunkStream & s, const ChunkStream::Chunk<T> & c) {
} }
return s; return s;
} }
template <typename T>
ChunkStream & operator <<(ChunkStream & s, const ChunkStream::ChunkConst<T> & c) {
QByteArray ba;
QDataStream bas(&ba, QIODevice::WriteOnly);
bas.setVersion(QDataStream::Qt_4_8);
bas << c.data;
switch (s.version_) {
case ChunkStream::Version_1:
s.stream_ << c.id << ba;
break;
case ChunkStream::Version_2:
if (s.data_->isEmpty())
s.stream_ << uchar(uchar(s.version_) | 0x80);
ChunkStream::writeVInt(s.stream_, c.id);
ChunkStream::writeVInt(s.stream_, ba.size());
s.stream_.writeRawData(ba.data(), ba.size());
break;
default: break;
}
return s;
}
#endif // CHUNKSTREAM_H #endif // CHUNKSTREAM_H

View File

@@ -3,6 +3,7 @@
#include <QDirIterator> #include <QDirIterator>
#include <QTranslator> #include <QTranslator>
#include <QApplication> #include <QApplication>
#include <QDebug>
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) #if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
# include <QStandardPaths> # include <QStandardPaths>
#else #else

View File

@@ -21,12 +21,12 @@
#define QAD_LOCATIONS_H #define QAD_LOCATIONS_H
#include "qad_export.h" #include "qad_export.h"
#include <QDebug> #include <QString>
namespace QAD { namespace QAD {
enum QAD_EXPORT LocationType { enum LocationType {
ltConfig, ltConfig,
ltCache, ltCache,
}; };

View File

@@ -45,7 +45,6 @@ namespace QAD {
struct QAD_EXPORT Enum { struct QAD_EXPORT Enum {
Enum(const QString & n = QString()): enum_name(n) {} Enum(const QString & n = QString()): enum_name(n) {}
Enum(const QMetaEnum & meta, int selected = 0); Enum(const QMetaEnum & meta, int selected = 0);
QString toString() const {return selected;} // obsolete, use selectedName()
int selectedValue() const; int selectedValue() const;
QString selectedName() const {return selected;} QString selectedName() const {return selected;}
bool selectValue(int v); bool selectValue(int v);
@@ -64,15 +63,18 @@ namespace QAD {
}; };
struct QAD_EXPORT File { struct QAD_EXPORT File {
File(const QString & p = QString(), const QString & f = QString(), bool abs = false): file(p), filter(f), is_abs(abs) {} File(const QString & p = QString(), const QString & f = QString(), bool abs = false, bool save_mode = false):
file(p), filter(f), is_abs(abs), is_save(save_mode) {}
QString toString() const {return file;} QString toString() const {return file;}
QString file; QString file;
QString filter; QString filter;
bool is_abs; bool is_abs;
bool is_save;
}; };
struct QAD_EXPORT Dir { struct QAD_EXPORT Dir {
Dir(const QString & d = QString(), bool abs = false): dir(d), is_abs(abs) {} Dir(const QString & d = QString(), bool abs = false):
dir(d), is_abs(abs) {}
QString toString() const {return dir;} QString toString() const {return dir;}
QString dir; QString dir;
bool is_abs; bool is_abs;
@@ -113,8 +115,8 @@ inline QDataStream & operator >>(QDataStream & s, QAD::Enum & v) {s >> v.enum_na
inline QDebug operator <<(QDebug s, const QAD::Enum & v) {s.nospace() << v.selected; return s.space();} inline QDebug operator <<(QDebug s, const QAD::Enum & v) {s.nospace() << v.selected; return s.space();}
Q_DECLARE_METATYPE(QAD::File) Q_DECLARE_METATYPE(QAD::File)
inline QDataStream & operator <<(QDataStream & s, const QAD::File & v) {s << v.file << v.filter << v.is_abs; return s;} inline QDataStream & operator <<(QDataStream & s, const QAD::File & v) {s << v.file << v.filter << uchar((v.is_abs ? 1 : 0) + (v.is_save ? 2 : 0)); return s;}
inline QDataStream & operator >>(QDataStream & s, QAD::File & v) {s >> v.file >> v.filter >> v.is_abs; return s;} inline QDataStream & operator >>(QDataStream & s, QAD::File & v) {uchar f(0); s >> v.file >> v.filter >> f; v.is_abs = ((f & 1) == 1); v.is_save = ((f & 2) == 2); return s;}
inline QDebug operator <<(QDebug s, const QAD::File & v) {s.nospace() << v.file; return s.space();} inline QDebug operator <<(QDebug s, const QAD::File & v) {s.nospace() << v.file; return s.space();}
Q_DECLARE_METATYPE(QAD::Dir) Q_DECLARE_METATYPE(QAD::Dir)

View File

@@ -14,8 +14,10 @@ ImageView::ImageView(QWidget * parent): QGraphicsView(parent) {
setDragMode(QGraphicsView::NoDrag); setDragMode(QGraphicsView::NoDrag);
setTransformationAnchor(QGraphicsView::AnchorUnderMouse); setTransformationAnchor(QGraphicsView::AnchorUnderMouse);
setScene(new QGraphicsScene()); setScene(new QGraphicsScene());
setRenderHint(QPainter::Antialiasing, true);
setRenderHint(QPainter::SmoothPixmapTransform, true);
item.setTransformationMode(Qt::SmoothTransformation); item.setTransformationMode(Qt::SmoothTransformation);
item.setFlags(0); item.setFlags(QGraphicsItem::GraphicsItemFlags());
scene()->addItem(&item); scene()->addItem(&item);
viewport()->setAutoFillBackground(false); viewport()->setAutoFillBackground(false);
viewport()->installEventFilter(this); viewport()->installEventFilter(this);
@@ -28,12 +30,12 @@ ImageView::~ImageView() {
QPixmap ImageView::pixmap() const { QPixmap ImageView::pixmap() const {
return item.pixmap(); return map;
} }
void ImageView::setPixmap(QPixmap pixmap) { void ImageView::setPixmap(QPixmap pixmap) {
item.setPixmap(pixmap); map = pixmap;
adjustView(); adjustView();
} }
@@ -42,12 +44,13 @@ void ImageView::setImage(const QImage & i) {
im_data.clear(); im_data.clear();
if (i.isNull()) { if (i.isNull()) {
item.setPixmap(QPixmap()); item.setPixmap(QPixmap());
map = QPixmap();
return; return;
} }
QBuffer b(&im_data); b.open(QIODevice::ReadWrite); QBuffer b(&im_data); b.open(QIODevice::ReadWrite);
i.save(&b, "png"); i.save(&b, "png");
b.close(); b.close();
item.setPixmap(QPixmap::fromImage(i)); map = QPixmap::fromImage(i);
adjustView(); adjustView();
} }
@@ -56,17 +59,18 @@ void ImageView::setImage(const QByteArray & i) {
im_data = i; im_data = i;
if (i.isEmpty()) { if (i.isEmpty()) {
item.setPixmap(QPixmap()); item.setPixmap(QPixmap());
map = QPixmap();
return; return;
} }
item.setPixmap(QPixmap::fromImage(QImage::fromData(i))); map = QPixmap::fromImage(QImage::fromData(i));
adjustView(); adjustView();
} }
void ImageView::clear() { void ImageView::clear() {
im_data.clear(); im_data.clear();
item.setPixmap(QPixmap()); item.setPixmap(QPixmap());
map = QPixmap();
} }
@@ -121,10 +125,17 @@ bool ImageView::eventFilter(QObject * o, QEvent * e) {
void ImageView::adjustView() { void ImageView::adjustView() {
qreal mp = map.width() / map.size().boundedTo(size()).width();
if (mp > 1) {
item.setPixmap(map.scaled(map.size()/mp, Qt::KeepAspectRatio, Qt::SmoothTransformation));
} else {
item.setPixmap(map);
}
if (!autofit_) return; if (!autofit_) return;
setSceneRect(item.boundingRect()); setSceneRect(item.boundingRect());
fitInView(&item, Qt::KeepAspectRatio); fitInView(&item, Qt::KeepAspectRatio);
centerOn(&item); centerOn(&item);
} }

View File

@@ -52,6 +52,7 @@ private:
QByteArray im_data; QByteArray im_data;
QPoint prev_pos; QPoint prev_pos;
bool autofit_; bool autofit_;
QPixmap map;
public slots: public slots:

View File

@@ -101,7 +101,7 @@ void StringListEdit::editItem() {
PathEdit::PathEdit(QWidget * parent): QWidget(parent), lay(QBoxLayout::LeftToRight, this) { PathEdit::PathEdit(QWidget * parent): QWidget(parent), lay(QBoxLayout::LeftToRight, this) {
is_dir = is_abs = false; is_dir = is_abs = is_save = false;
filter = tr("All files(*)"); filter = tr("All files(*)");
line = new CLineEdit(this); line = new CLineEdit(this);
//line->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); //line->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
@@ -134,10 +134,24 @@ void PathEdit::resizeEvent(QResizeEvent *) {
} }
void PathEdit::setValue(const QString & v) {
line->setText(v);
if (!is_dir && is_save)
butt_select->setIcon(QIcon(":/icons/document-save.png"));
else
butt_select->setIcon(QIcon(":/icons/document-open.png"));
}
void PathEdit::select() { void PathEdit::select() {
QString ret; QString ret;
if (is_dir) ret = QFileDialog::getExistingDirectory(this, tr("Select directory"), value()); if (is_dir) ret = QFileDialog::getExistingDirectory(this, tr("Select directory"), value());
else ret = QFileDialog::getOpenFileName(this, tr("Select file"), value(), filter); else {
if (is_save)
ret = QFileDialog::getSaveFileName(this, tr("Select file"), value(), filter);
else
ret = QFileDialog::getOpenFileName(this, tr("Select file"), value(), filter);
}
if (ret.isEmpty()) return; if (ret.isEmpty()) return;
if (!is_abs) if (!is_abs)
ret = QDir::current().relativeFilePath(ret); ret = QDir::current().relativeFilePath(ret);
@@ -369,6 +383,7 @@ QVariant QVariantEdit::value() const {
ret.file = _path->value(); ret.file = _path->value();
ret.filter = _path->filter; ret.filter = _path->filter;
ret.is_abs = _path->is_abs; ret.is_abs = _path->is_abs;
ret.is_save = _path->is_save;
return QVariant::fromValue<QAD::File>(ret); return QVariant::fromValue<QAD::File>(ret);
} }
} }
@@ -465,16 +480,18 @@ void QVariantEdit::_setEnum(const QAD::Enum & v) {
void QVariantEdit::_setFile(const QAD::File & v) { void QVariantEdit::_setFile(const QAD::File & v) {
_path->is_dir = false; _path->is_dir = false;
_path->filter = v.filter;
_path->is_abs = v.is_abs;
_path->is_save = v.is_save;
_path->setValue(v.file); _path->setValue(v.file);
_path->filter = v.filter;
_path->is_abs = v.is_abs;
} }
void QVariantEdit::_setDir(const QAD::Dir & v) { void QVariantEdit::_setDir(const QAD::Dir & v) {
_path->is_dir = true; _path->is_dir = true;
_path->setValue(v.dir);
_path->is_abs = v.is_abs; _path->is_abs = v.is_abs;
_path->setValue(v.dir);
} }

View File

@@ -75,9 +75,9 @@ public:
QString value() const {return line->text();} QString value() const {return line->text();}
bool is_dir, is_abs; bool is_dir, is_abs, is_save;
QString filter; QString filter;
private: private:
virtual void changeEvent(QEvent * e); virtual void changeEvent(QEvent * e);
virtual void resizeEvent(QResizeEvent * ); virtual void resizeEvent(QResizeEvent * );
@@ -87,7 +87,7 @@ private:
QPushButton * butt_select; QPushButton * butt_select;
public slots: public slots:
void setValue(const QString & v) {line->setText(v);} void setValue(const QString & v);
private slots: private slots:
void select(); void select();

View File

@@ -199,7 +199,7 @@ public:
PIHash<Key, T> & clear() {pih_content.clear(); return *this;} PIHash<Key, T> & clear() {pih_content.clear(); return *this;}
void swap(PIHash<Key, T> & other) { void swap(PIHash<Key, T> & other) {
piSwapBinary<PIVector<PIVector<HashEntry> > >(pih_content, other.pih_content); pih_content.swap(other.pih_content);
} }
PIHash<Key, T> & insert(const Key & key, const T & value) { PIHash<Key, T> & insert(const Key & key, const T & value) {

View File

@@ -394,15 +394,15 @@ void CDItemModel::rebuildModel() {
void CDItemModel::buildItem(CDItem * it, CDSection & r) { void CDItemModel::buildItem(CDItem * it, CDSection & r) {
//piCout << "build item" << r.name << r.alias; //piCout << "build item" << r.name << r.alias;
PIMap<int, CDType>::iterator i; auto i = r.cd.makeIterator();
for (i = r.cd.begin(); i != r.cd.end(); ++i) { while (i.next()) {
it->childs << new CDItem(interface, i.key(), CDItem::ItemCDType, it); it->childs << new CDItem(interface, i.key(), CDItem::ItemCDType, it);
} }
it->item_count = it->childs.size(); it->item_count = it->childs.size();
PIMap<int, CDSection>::iterator j; auto j = r.s.makeIterator();
for (j = r.s.begin(); j != r.s.end(); ++j) { while (j.next()) {
it->childs << new CDItem(interface, j.key(), CDItem::ItemCDSection, it); it->childs << new CDItem(interface, j.key(), CDItem::ItemCDSection, it);
buildItem(it->childs.back(), j.value()); buildItem(it->childs.back(), j.valueRef());
} }
} }

View File

@@ -1,19 +1,19 @@
/* /*
QGLView QGL Buffer
Ivan Pelipenko peri4ko@yandex.ru Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#define GL_GLEXT_PROTOTYPES #define GL_GLEXT_PROTOTYPES

View File

@@ -1,5 +1,5 @@
/* /*
QGLView QGL Buffer
Ivan Pelipenko peri4ko@yandex.ru Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify

View File

@@ -1,19 +1,19 @@
/* /*
QGLView QGL CubeTexture
Ivan Pelipenko peri4ko@yandex.ru Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "gltypes.h" #include "gltypes.h"

View File

@@ -1,19 +1,19 @@
/* /*
QGLView QGL CubeTexture
Ivan Pelipenko peri4ko@yandex.ru Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef GLCUBEMAP_H #ifndef GLCUBEMAP_H

View File

@@ -1,19 +1,19 @@
/* /*
QGLView QGL Framebuffer
Ivan Pelipenko peri4ko@yandex.ru Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <QOpenGLExtraFunctions> #include <QOpenGLExtraFunctions>

View File

@@ -1,19 +1,19 @@
/* /*
QGLView QGL Framebuffer
Ivan Pelipenko peri4ko@yandex.ru Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef GLFRAMEBUFFER_H #ifndef GLFRAMEBUFFER_H

View File

@@ -1,19 +1,19 @@
/* /*
QGLView QGL FramebufferMipmap
Ivan Pelipenko peri4ko@yandex.ru Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <QOpenGLExtraFunctions> #include <QOpenGLExtraFunctions>

View File

@@ -1,19 +1,19 @@
/* /*
QGLView QGL FramebufferMipmap
Ivan Pelipenko peri4ko@yandex.ru Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef GLFRAMEBUFFER_MIPMAP_H #ifndef GLFRAMEBUFFER_MIPMAP_H

View File

@@ -1,19 +1,19 @@
/* /*
QGLView QGL Material
Ivan Pelipenko peri4ko@yandex.ru Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "gltypes.h" #include "gltypes.h"
@@ -22,66 +22,6 @@
using namespace QGLEngineShaders; using namespace QGLEngineShaders;
/*
bool CubeTexture::create() {
//qDebug("create");
destroy();
glGenTextures(1, &id_);
glBindTexture(GL_TEXTURE_CUBE_MAP, id_);
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
//glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_GENERATE_MIPMAP_SGIS, GL_TRUE);
//glClearError();
glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X, 0, format_, size, size, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr);
glTexImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_X, 0, format_, size, size, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr);
glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_Y, 0, format_, size, size, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr);
glTexImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, format_, size, size, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr);
glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_Z, 0, format_, size, size, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr);
glTexImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, format_, size, size, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr);
//qDebug() << glGetError();
changed_ = false;
return id_ > 0;
}
void CubeTexture::load() {
if (isEmpty()) return;
create();
if (!path(0).isEmpty()) loadFront(path(0));
if (!path(1).isEmpty()) loadBack(path(1));
if (!path(2).isEmpty()) loadLeft(path(2));
if (!path(3).isEmpty()) loadRight(path(3));
if (!path(4).isEmpty()) loadTop(path(4));
if (!path(5).isEmpty()) loadBottom(path(5));
}
void CubeTexture::loadFromDirectory(const QString & dir) {
QDir d(dir); QFileInfoList sl;
sl = d.entryInfoList(QStringList("front.*"), QDir::Files | QDir::NoDotAndDotDot); if (!sl.isEmpty()) loadFront(sl[0].absoluteFilePath());
sl = d.entryInfoList(QStringList("back.*"), QDir::Files | QDir::NoDotAndDotDot); if (!sl.isEmpty()) loadBack(sl[0].absoluteFilePath());
sl = d.entryInfoList(QStringList("left.*"), QDir::Files | QDir::NoDotAndDotDot); if (!sl.isEmpty()) loadLeft(sl[0].absoluteFilePath());
sl = d.entryInfoList(QStringList("right.*"), QDir::Files | QDir::NoDotAndDotDot); if (!sl.isEmpty()) loadRight(sl[0].absoluteFilePath());
sl = d.entryInfoList(QStringList("top.*"), QDir::Files | QDir::NoDotAndDotDot); if (!sl.isEmpty()) loadTop(sl[0].absoluteFilePath());
sl = d.entryInfoList(QStringList("bottom.*"), QDir::Files | QDir::NoDotAndDotDot); if (!sl.isEmpty()) loadBottom(sl[0].absoluteFilePath());
}
void CubeTexture::loadPathesFromDirectory(const QString & dir) {
QDir d(dir); QFileInfoList sl;
sl = d.entryInfoList(QStringList("front.*"), QDir::Files | QDir::NoDotAndDotDot); if (!sl.isEmpty()) pathes[0] = sl[0].absoluteFilePath();
sl = d.entryInfoList(QStringList("back.*"), QDir::Files | QDir::NoDotAndDotDot); if (!sl.isEmpty()) pathes[1] = sl[0].absoluteFilePath();
sl = d.entryInfoList(QStringList("left.*"), QDir::Files | QDir::NoDotAndDotDot); if (!sl.isEmpty()) pathes[2] = sl[0].absoluteFilePath();
sl = d.entryInfoList(QStringList("right.*"), QDir::Files | QDir::NoDotAndDotDot); if (!sl.isEmpty()) pathes[3] = sl[0].absoluteFilePath();
sl = d.entryInfoList(QStringList("top.*"), QDir::Files | QDir::NoDotAndDotDot); if (!sl.isEmpty()) pathes[4] = sl[0].absoluteFilePath();
sl = d.entryInfoList(QStringList("bottom.*"), QDir::Files | QDir::NoDotAndDotDot); if (!sl.isEmpty()) pathes[5] = sl[0].absoluteFilePath();
}
*/
Map::Map() { Map::Map() {
bitmap_id = 0; bitmap_id = 0;

View File

@@ -1,19 +1,19 @@
/* /*
QGLView QGL Material
Ivan Pelipenko peri4ko@yandex.ru Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef GLMATERIAL_H #ifndef GLMATERIAL_H
@@ -22,57 +22,6 @@
#include "glshaders_types.h" #include "glshaders_types.h"
#include "chunkstream.h" #include "chunkstream.h"
/*
class Texture {
public:
Texture(int _width, int _height, const GLenum & _format = GL_RGBA8, const GLenum & _target = GL_TEXTURE_2D) {wid = _width; hei = _height; format_ = _format; target_ = _target; id_ = 0;}
bool create() {destroy(); createGLTexture(id_, wid, hei, format_, target_); return id_ > 0;}
void destroy() {if (id_ > 0) glDeleteTextures(1, &id_); id_ = 0;}
void bind() {if (id_ > 0) glBindTexture(target_, id_);}
void release() {glBindTexture(target_, 0);}
int width() const {return wid;}
int height() const {return hei;}
GLenum format() const {return format_;}
GLenum target() const {return target_;}
GLuint id() const {return id_;}
private:
int wid, hei;
GLenum format_, target_;
GLuint id_;
};
class CubeTexture {
public:
CubeTexture(int _size, const GLenum & _format = GL_RGBA8) {size = _size; format_ = _format; id_ = 0; changed_ = false; pathes.resize(6);}
bool create();
void destroy() {if (id_ > 0) glDeleteTextures(1, &id_); id_ = 0;}
void bind() {if (changed_) {changed_ = false; create();} if (id_ > 0) glBindTexture(GL_TEXTURE_CUBE_MAP, id_);}
void release() {glBindTexture(GL_TEXTURE_CUBE_MAP, 0);}
void resize(int _size) {size = _size; changed_ = true;}
void loadFromDirectory(const QString & dir);
void loadFront(const QString & path) {bind(); pathes[0] = path; createGLTexture(id_, rotateQImageLeft(QImage(path)).scaled(size, size, Qt::IgnoreAspectRatio, Qt::SmoothTransformation), format_, GL_TEXTURE_CUBE_MAP_POSITIVE_X);}
void loadBack(const QString & path) {bind(); pathes[1] = path; createGLTexture(id_, rotateQImageRight(QImage(path)).scaled(size, size, Qt::IgnoreAspectRatio, Qt::SmoothTransformation), format_, GL_TEXTURE_CUBE_MAP_NEGATIVE_X);}
void loadLeft(const QString & path) {bind(); pathes[2] = path; createGLTexture(id_, QImage(path).scaled(size, size, Qt::IgnoreAspectRatio, Qt::SmoothTransformation), format_, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y);}
void loadRight(const QString & path) {bind(); pathes[3] = path; createGLTexture(id_, rotateQImage180(QImage(path)).scaled(size, size, Qt::IgnoreAspectRatio, Qt::SmoothTransformation), format_, GL_TEXTURE_CUBE_MAP_POSITIVE_Y);}
void loadTop(const QString & path) {bind(); pathes[4] = path; createGLTexture(id_, rotateQImageLeft(QImage(path)).scaled(size, size, Qt::IgnoreAspectRatio, Qt::SmoothTransformation), format_, GL_TEXTURE_CUBE_MAP_NEGATIVE_Z);}
void loadBottom(const QString & path) {bind(); pathes[5] = path; createGLTexture(id_, rotateQImageLeft(QImage(path)).scaled(size, size, Qt::IgnoreAspectRatio, Qt::SmoothTransformation), format_, GL_TEXTURE_CUBE_MAP_POSITIVE_Z);}
void load();
bool isEmpty() const {foreach (const QString & i, pathes) if (!i.isEmpty()) return false; return true;}
GLenum format() const {return format_;}
void setFormat(GLenum f) {format_ = f; changed_ = true;}
GLuint id() const {return id_;}
const QString & path(int side) const {return pathes[side];}
void setPath(int side, const QString & p) {pathes[side] = p;}
void loadPathesFromDirectory(const QString & dir);
private:
bool changed_;
int size;
GLenum format_;
GLuint id_;
QVector<QString> pathes;
};
*/
class Map { class Map {
public: public:

View File

@@ -1,19 +1,19 @@
/* /*
QGLView QGL Mesh
Ivan Pelipenko peri4ko@yandex.ru Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#define GL_GLEXT_PROTOTYPES #define GL_GLEXT_PROTOTYPES
@@ -24,7 +24,7 @@
using namespace QGLEngineShaders; using namespace QGLEngineShaders;
static int _count = 0; //static int _count = 0;
Mesh::Mesh(GLenum geom_type_): geom_type(geom_type_), Mesh::Mesh(GLenum geom_type_): geom_type(geom_type_),
buffer_geom(GL_ARRAY_BUFFER, GL_STATIC_DRAW), buffer_geom(GL_ARRAY_BUFFER, GL_STATIC_DRAW),

View File

@@ -1,5 +1,5 @@
/* /*
QGLView QGL Mesh
Ivan Pelipenko peri4ko@yandex.ru Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify

View File

@@ -1,27 +1,25 @@
/* /*
QGLView QGL Primitives
Ivan Pelipenko peri4ko@yandex.ru Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "glprimitives.h" #include "glprimitives.h"
#include "glmesh.h" #include "glmesh.h"
Mesh * Primitive::plane(float width, float length) { Mesh * Primitive::plane(float width, float length) {
Mesh * ret = new Mesh(); Mesh * ret = new Mesh();
QVector<QVector3D> & v(ret->vertices ()); QVector<QVector3D> & v(ret->vertices ());

View File

@@ -1,19 +1,19 @@
/* /*
QGLView QGL Primitives
Ivan Pelipenko peri4ko@yandex.ru Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef GLPRIMITIVE_CUBE_H #ifndef GLPRIMITIVE_CUBE_H

View File

@@ -1,19 +1,19 @@
/* /*
QGLView QGLEngineShaders
Ivan Pelipenko peri4ko@yandex.ru Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "gltypes.h" #include "gltypes.h"

View File

@@ -1,19 +1,19 @@
/* /*
QGLView QGLEngineShaders
Ivan Pelipenko peri4ko@yandex.ru Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef GLSHADERS_H #ifndef GLSHADERS_H

View File

@@ -1,19 +1,19 @@
/* /*
QGLView QGLEngineShaders
Ivan Pelipenko peri4ko@yandex.ru Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef GLSHADERS_HEADERS_H #ifndef GLSHADERS_HEADERS_H

View File

@@ -1,22 +1,21 @@
/* /*
QGLView QGLEngineShaders
Ivan Pelipenko peri4ko@yandex.ru Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "glshaders_types.h" #include "glshaders_types.h"

View File

@@ -1,19 +1,19 @@
/* /*
QGLView QGLEngineShaders
Ivan Pelipenko peri4ko@yandex.ru Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef GLSHADERS_TYPES_H #ifndef GLSHADERS_TYPES_H

View File

@@ -1,19 +1,19 @@
/* /*
QGLView QGL Texture2DArray
Ivan Pelipenko peri4ko@yandex.ru Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#define GL_GLEXT_PROTOTYPES #define GL_GLEXT_PROTOTYPES

View File

@@ -1,5 +1,5 @@
/* /*
QGLView QGL Texture2DArray
Ivan Pelipenko peri4ko@yandex.ru Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify

View File

@@ -1,5 +1,5 @@
/* /*
QGLView QGL Transform
Ivan Pelipenko peri4ko@yandex.ru Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
@@ -16,9 +16,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "gltransform.h"
//#include <Qt3DCore/private/sqt_p.h>
#include "gltransform.h"
#include "gltypes.h" #include "gltypes.h"
#include <cmath> #include <cmath>

View File

@@ -1,5 +1,5 @@
/* /*
QGLView QGL Transform
Ivan Pelipenko peri4ko@yandex.ru Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify

View File

@@ -1,19 +1,19 @@
/* /*
QGLView QGLView Types
Ivan Pelipenko peri4ko@yandex.ru Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "glcamera.h" #include "glcamera.h"

View File

@@ -1,5 +1,5 @@
/* /*
QGLView QGLView Types
Ivan Pelipenko peri4ko@yandex.ru Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
@@ -128,7 +128,7 @@ inline float randomu() {return float(random()) / RAND_MAX;}
inline const QSizeF operator *(const QSizeF & f, const QSizeF & s) {return QSizeF(f.width() * s.width(), f.height() * s.height());} inline const QSizeF operator *(const QSizeF & f, const QSizeF & s) {return QSizeF(f.width() * s.width(), f.height() * s.height());}
#ifndef PIP_VERSION #ifndef PIP_VERSION
template<typename Type> inline void piSwap(Type & f, Type & s) {Type t = f; f = s; s = t;} template<typename T> inline void piSwap(T & f, T & s) {T t(f); f = s; s = t;}
template<typename Type> inline Type piMin(const Type & f, const Type & s) {return (f > s) ? s : f;} template<typename Type> inline Type piMin(const Type & f, const Type & s) {return (f > s) ? s : f;}
template<typename Type> inline Type piMin(const Type & f, const Type & s, const Type & t) {return (f < s && f < t) ? f : ((s < t) ? s : t);} template<typename Type> inline Type piMin(const Type & f, const Type & s, const Type & t) {return (f < s && f < t) ? f : ((s < t) ? s : t);}
template<typename Type> inline Type piMax(const Type & f, const Type & s) {return (f < s) ? s : f;} template<typename Type> inline Type piMax(const Type & f, const Type & s) {return (f < s) ? s : f;}

View File

@@ -1,19 +1,19 @@
/* /*
QGLView QGL VertexObject
Ivan Pelipenko peri4ko@yandex.ru Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#define GL_GLEXT_PROTOTYPES #define GL_GLEXT_PROTOTYPES

View File

@@ -1,5 +1,5 @@
/* /*
QGLView QGL VertexObject
Ivan Pelipenko peri4ko@yandex.ru Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify

View File

@@ -1,19 +1,19 @@
/* /*
QGLView QGL HDR
Ivan Pelipenko peri4ko@yandex.ru Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "hdr_p.h" #include "hdr_p.h"

View File

@@ -1,19 +1,19 @@
/* /*
QGLView QGL HDR
Ivan Pelipenko peri4ko@yandex.ru Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef HDR_P_H #ifndef HDR_P_H

View File

@@ -1,19 +1,19 @@
/* /*
QGLView QGL Loader Assimp
Ivan Pelipenko peri4ko@yandex.ru Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "loader_assimp.h" #include "loader_assimp.h"

View File

@@ -1,19 +1,19 @@
/* /*
QGLView QGL Loader Assimp
Ivan Pelipenko peri4ko@yandex.ru Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef LOADER_ASSIMP_H #ifndef LOADER_ASSIMP_H

View File

@@ -1,19 +1,19 @@
/* /*
QGLView QGL Loader QGL
Ivan Pelipenko peri4ko@yandex.ru Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "loader_qgl.h" #include "loader_qgl.h"

View File

@@ -1,19 +1,19 @@
/* /*
QGLView QGL Loader QGL
Ivan Pelipenko peri4ko@yandex.ru Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef LOADER_QGL_H #ifndef LOADER_QGL_H

View File

@@ -1,19 +1,19 @@
/* /*
QGLView QGL Camera
Ivan Pelipenko peri4ko@yandex.ru Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "gltypes.h" #include "gltypes.h"

View File

@@ -1,19 +1,19 @@
/* /*
QGLView QGL Camera
Ivan Pelipenko peri4ko@yandex.ru Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef GLCAMERA_H #ifndef GLCAMERA_H

View File

@@ -1,19 +1,19 @@
/* /*
GLObjectBase & Light QGL ObjectBase & Light
Ivan Pelipenko peri4ko@yandex.ru Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "globject.h" #include "globject.h"
@@ -21,7 +21,7 @@
#include "glscene.h" #include "glscene.h"
#include "glmesh.h" #include "glmesh.h"
#include <chunkstream.h> #include <chunkstream.h>
static int _count = 0; //static int _count = 0;
ObjectBase::ObjectBase(Mesh * geom, Material * mat) { ObjectBase::ObjectBase(Mesh * geom, Material * mat) {
type_ = glMesh; type_ = glMesh;

View File

@@ -1,19 +1,19 @@
/* /*
GLObjectBase & Light QGL ObjectBase & Light
Ivan Pelipenko peri4ko@yandex.ru Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef GLOBJECT_H #ifndef GLOBJECT_H

View File

@@ -1,19 +1,19 @@
/* /*
QGLView QGL GLRendererBase
Ivan Pelipenko peri4ko@yandex.ru Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "glrendererbase.h" #include "glrendererbase.h"

View File

@@ -1,5 +1,5 @@
/* /*
QGLView QGL GLRendererBase
Ivan Pelipenko peri4ko@yandex.ru Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify

View File

@@ -1,19 +1,19 @@
/* /*
GLObjectBase & Light QGL Scene
Ivan Pelipenko peri4ko@yandex.ru Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "glscene.h" #include "glscene.h"

View File

@@ -1,19 +1,19 @@
/* /*
GLObjectBase & Light QGL Scene
Ivan Pelipenko peri4ko@yandex.ru Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef GLSCENE_H #ifndef GLSCENE_H

View File

@@ -1,19 +1,19 @@
/* /*
QGLView QGL TextureManager
Ivan Pelipenko peri4ko@yandex.ru Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "gltexture_manager.h" #include "gltexture_manager.h"

View File

@@ -1,19 +1,19 @@
/* /*
QGLView QGL TextureManager
Ivan Pelipenko peri4ko@yandex.ru Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef GLTEXTUREMANAGER_H #ifndef GLTEXTUREMANAGER_H

View File

@@ -1,3 +1,21 @@
/*
QGL GLWidget
Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "glwidget.h" #include "glwidget.h"
#include "qglview.h" #include "qglview.h"
#include <QVBoxLayout> #include <QVBoxLayout>

View File

@@ -1,3 +1,21 @@
/*
QGL GLWidget
Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GLWIDGET_H #ifndef GLWIDGET_H
#define GLWIDGET_H #define GLWIDGET_H

View File

@@ -1,5 +1,5 @@
/* /*
MouseController QGL MouseController
Ivan Pelipenko peri4ko@yandex.ru Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify

View File

@@ -1,5 +1,5 @@
/* /*
QGLView QGL MouseController
Ivan Pelipenko peri4ko@yandex.ru Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify

View File

@@ -1,3 +1,21 @@
/*
QGL OpenGLWindow
Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "openglwindow.h" #include "openglwindow.h"
#include <QCoreApplication> #include <QCoreApplication>
#include <QOpenGLContext> #include <QOpenGLContext>

View File

@@ -1,3 +1,21 @@
/*
QGL OpenGLWindow
Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <QWindow> #include <QWindow>
#include <QOpenGLExtraFunctions> #include <QOpenGLExtraFunctions>

View File

@@ -150,7 +150,6 @@ public:
bool isServiceMode() const {return renderer_.edit_mode;} bool isServiceMode() const {return renderer_.edit_mode;}
void setServiceMode(bool yes) {renderer_.edit_mode = yes;} void setServiceMode(bool yes) {renderer_.edit_mode = yes;}
// void addObject(GLObjectBase & o) {addObject(&o);}
Scene::SelectionMode selectionMode() const {return scene_->selectionMode();} Scene::SelectionMode selectionMode() const {return scene_->selectionMode();}
Qt::MouseButton selectionButton() const {return mouse.selectionButton();} Qt::MouseButton selectionButton() const {return mouse.selectionButton();}
@@ -219,7 +218,6 @@ private:
Camera * camera_, * default_camera; Camera * camera_, * default_camera;
MouseController mouse; MouseController mouse;
QMenu context_menu; QMenu context_menu;
// uint cid;
QSet<int> keys_; QSet<int> keys_;
QColor backColor_, fogColor_, ambientColor_, hoverHaloColor_, selectionHaloColor_; QColor backColor_, fogColor_, ambientColor_, hoverHaloColor_, selectionHaloColor_;
QTime time, ktm_; QTime time, ktm_;

View File

@@ -1,19 +1,19 @@
/* /*
Stanley Designer QGLViewWindow
Ivan Pelipenko peri4ko@yandex.ru Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <QApplication> #include <QApplication>

View File

@@ -1,19 +1,19 @@
/* /*
Stanley Designer QGLViewWindow
Ivan Pelipenko peri4ko@yandex.ru Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "qglview_window.h" #include "qglview_window.h"

View File

@@ -1,19 +1,19 @@
/* /*
Stanley Designer QGLViewWindow
Ivan Pelipenko peri4ko@yandex.ru Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef QGLVIEWWINDOW_H #ifndef QGLVIEWWINDOW_H

View File

@@ -1,19 +1,19 @@
/* /*
QGLView QGL Renderer
Ivan Pelipenko peri4ko@yandex.ru Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#define GL_GLEXT_PROTOTYPES #define GL_GLEXT_PROTOTYPES

View File

@@ -1,19 +1,19 @@
/* /*
QGLView QGL Renderer
Ivan Pelipenko peri4ko@yandex.ru Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef RENDERER_H #ifndef RENDERER_H

View File

@@ -1,19 +1,19 @@
/* /*
QGLView QGL RendererBase
Ivan Pelipenko peri4ko@yandex.ru Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#define GL_GLEXT_PROTOTYPES #define GL_GLEXT_PROTOTYPES

View File

@@ -1,19 +1,19 @@
/* /*
QGLView QGL RendererBase
Ivan Pelipenko peri4ko@yandex.ru Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef RENDERER_BASE_H #ifndef RENDERER_BASE_H

View File

@@ -1,19 +1,19 @@
/* /*
QGLView QGL RendererMaterial
Ivan Pelipenko peri4ko@yandex.ru Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#define GL_GLEXT_PROTOTYPES #define GL_GLEXT_PROTOTYPES

View File

@@ -1,19 +1,19 @@
/* /*
QGLView QGL RendererMaterial
Ivan Pelipenko peri4ko@yandex.ru Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef RENDERER_MATERIAL_H #ifndef RENDERER_MATERIAL_H

View File

@@ -1,19 +1,19 @@
/* /*
QGLView QGL RendererSelection
Ivan Pelipenko peri4ko@yandex.ru Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#define GL_GLEXT_PROTOTYPES #define GL_GLEXT_PROTOTYPES

View File

@@ -1,19 +1,19 @@
/* /*
QGLView QGL RendererSelection
Ivan Pelipenko peri4ko@yandex.ru Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef RENDERER_SELECTION_H #ifndef RENDERER_SELECTION_H

View File

@@ -1,19 +1,19 @@
/* /*
QGLView QGL RendererService
Ivan Pelipenko peri4ko@yandex.ru Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#define GL_GLEXT_PROTOTYPES #define GL_GLEXT_PROTOTYPES

View File

@@ -1,19 +1,19 @@
/* /*
QGLView QGL RendererService
Ivan Pelipenko peri4ko@yandex.ru Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef RENDERER_SERVICE_H #ifndef RENDERER_SERVICE_H

View File

@@ -1,19 +1,19 @@
/* /*
QGLView QGL TonemappingProc
Ivan Pelipenko peri4ko@yandex.ru Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#define GL_GLEXT_PROTOTYPES #define GL_GLEXT_PROTOTYPES

View File

@@ -1,19 +1,19 @@
/* /*
QGLView QGL TonemappingProc
Ivan Pelipenko peri4ko@yandex.ru Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef TONEMAPPING_PROC_H #ifndef TONEMAPPING_PROC_H
@@ -52,7 +52,7 @@ private:
float frame_max, cur_max; float frame_max, cur_max;
bool need_render_sum, enabled; bool need_render_sum, enabled;
volatile bool exit_; std::atomic_bool exit_;
int timer_tone, timer_delim; int timer_tone, timer_delim;
Framebuffer fbo_1x1; Framebuffer fbo_1x1;
FramebufferMipmap fbomm; FramebufferMipmap fbomm;

Some files were not shown because too many files have changed in this diff Show More