git-svn-id: svn://db.shs.com.ru/libs@84 a8b55f48-bf90-11e4-a774-851b48703e85
@@ -15,9 +15,9 @@ file(GLOB MOCS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.h")
|
||||
file(GLOB CPPS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.cpp")
|
||||
file(GLOB UIS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.ui")
|
||||
file(GLOB RES "*.qrc")
|
||||
list(REMOVE_ITEM CPPS "main.cpp" "mainwindow.cpp")
|
||||
list(REMOVE_ITEM MOCS "mainwindow.h")
|
||||
list(REMOVE_ITEM UIS "mainwindow.ui")
|
||||
list(REMOVE_ITEM CPPS "main.cpp" "qglview_window.cpp")
|
||||
list(REMOVE_ITEM MOCS "qglview_window.h")
|
||||
list(REMOVE_ITEM UIS "qglview_window.ui")
|
||||
qt4_wrap_cpp(CMOCS ${MOCS} OPTIONS -nw)
|
||||
qt4_wrap_ui(CUIS ${UIS})
|
||||
qt4_add_resources(CRES ${RES})
|
||||
@@ -39,7 +39,7 @@ else ()
|
||||
install(TARGETS qglview DESTINATION bin)
|
||||
endif ()
|
||||
|
||||
qt4_wrap_cpp(CMOCS_TEST "mainwindow.h" OPTIONS -nw)
|
||||
qt4_wrap_ui(CUIS_TEST "mainwindow.ui")
|
||||
add_executable(qglview_test "main.cpp" "mainwindow.cpp" ${CMOCS_TEST} ${CUIS_TEST} ${CRES})
|
||||
qt4_wrap_cpp(CMOCS_TEST "qglview_window.h" OPTIONS -nw)
|
||||
qt4_wrap_ui(CUIS_TEST "qglview_window.ui")
|
||||
add_executable(qglview_test "main.cpp" "qglview_window.cpp" ${CMOCS_TEST} ${CUIS_TEST} ${CRES})
|
||||
target_link_libraries(qglview_test ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTOPENGL_LIBRARY} ${QT_QTXML_LIBRARY} qglview qad_widgets qad_utils)
|
||||
|
||||
|
Before Width: | Height: | Size: 73 KiB |
|
Before Width: | Height: | Size: 103 KiB |
|
Before Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 128 KiB |
|
Before Width: | Height: | Size: 210 KiB |
|
Before Width: | Height: | Size: 442 KiB |
|
Before Width: | Height: | Size: 50 KiB |
|
Before Width: | Height: | Size: 50 KiB |
|
Before Width: | Height: | Size: 50 KiB |
|
Before Width: | Height: | Size: 52 KiB |
|
Before Width: | Height: | Size: 48 KiB |
|
Before Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 51 KiB |
19878
qglview/data/l_.ASE
|
Before Width: | Height: | Size: 1.1 KiB |
@@ -1,305 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1">
|
||||
<asset>
|
||||
<contributor>
|
||||
<author><3E><><EFBFBD><EFBFBD></author>
|
||||
<authoring_tool>OpenCOLLADA for 3ds Max; ; </authoring_tool>
|
||||
</contributor>
|
||||
<created>2015-11-16T13:29:28</created>
|
||||
<modified>2015-11-16T13:29:28</modified>
|
||||
<unit name="millimeter" meter="0.001"/>
|
||||
<up_axis>Z_UP</up_axis>
|
||||
</asset>
|
||||
<library_effects>
|
||||
<effect id="_1_-_Default">
|
||||
<profile_COMMON>
|
||||
<newparam sid="__proj_plane_d_png-surface">
|
||||
<surface type="2D">
|
||||
<init_from>__proj_plane_d_png</init_from>
|
||||
</surface>
|
||||
</newparam>
|
||||
<newparam sid="__proj_plane_d_png-sampler">
|
||||
<sampler2D>
|
||||
<source>__proj_plane_d_png-surface</source>
|
||||
</sampler2D>
|
||||
</newparam>
|
||||
<newparam sid="__proj_plane_n_png-surface">
|
||||
<surface type="2D">
|
||||
<init_from>__proj_plane_n_png</init_from>
|
||||
</surface>
|
||||
</newparam>
|
||||
<newparam sid="__proj_plane_n_png-sampler">
|
||||
<sampler2D>
|
||||
<source>__proj_plane_n_png-surface</source>
|
||||
</sampler2D>
|
||||
</newparam>
|
||||
<technique sid="common">
|
||||
<blinn>
|
||||
<emission>
|
||||
<color>0 0 0 1</color>
|
||||
</emission>
|
||||
<ambient>
|
||||
<color>0.5882353 0.5882353 0.5882353 1</color>
|
||||
</ambient>
|
||||
<diffuse>
|
||||
<texture texture="__proj_plane_d_png-sampler" texcoord="CHANNEL1"/>
|
||||
</diffuse>
|
||||
<specular>
|
||||
<color>0.9 0.9 0.9 1</color>
|
||||
</specular>
|
||||
<shininess>
|
||||
<float>1</float>
|
||||
</shininess>
|
||||
<reflective>
|
||||
<color>0 0 0 1</color>
|
||||
</reflective>
|
||||
<transparent opaque="A_ONE">
|
||||
<color>1 1 1 1</color>
|
||||
</transparent>
|
||||
<transparency>
|
||||
<float>1</float>
|
||||
</transparency>
|
||||
</blinn>
|
||||
<extra>
|
||||
<technique profile="OpenCOLLADA3dsMax">
|
||||
<bump bumptype="HEIGHTFIELD">
|
||||
<texture texture="__proj_plane_n_png-sampler" texcoord="CHANNEL1"/>
|
||||
</bump>
|
||||
</technique>
|
||||
</extra>
|
||||
</technique>
|
||||
</profile_COMMON>
|
||||
<extra>
|
||||
<technique profile="OpenCOLLADA3dsMax">
|
||||
<extended_shader>
|
||||
<apply_reflection_dimming>0</apply_reflection_dimming>
|
||||
<dim_level>0</dim_level>
|
||||
<falloff_type>0</falloff_type>
|
||||
<index_of_refraction>1.5</index_of_refraction>
|
||||
<opacity_type>0</opacity_type>
|
||||
<reflection_level>3</reflection_level>
|
||||
<wire_size>1</wire_size>
|
||||
<wire_units>0</wire_units>
|
||||
</extended_shader>
|
||||
<shader>
|
||||
<ambient_diffuse_lock>1</ambient_diffuse_lock>
|
||||
<ambient_diffuse_texture_lock>1</ambient_diffuse_texture_lock>
|
||||
<diffuse_specular_lock>0</diffuse_specular_lock>
|
||||
<soften>0.1</soften>
|
||||
<use_self_illum_color>0</use_self_illum_color>
|
||||
</shader>
|
||||
</technique>
|
||||
</extra>
|
||||
</effect>
|
||||
</library_effects>
|
||||
<library_materials>
|
||||
<material id="_1_-_Default-material" name="_1_-_Default">
|
||||
<instance_effect url="#_1_-_Default"/>
|
||||
</material>
|
||||
</library_materials>
|
||||
<library_geometries>
|
||||
<geometry id="geom-Box001" name="Box001">
|
||||
<mesh>
|
||||
<source id="geom-Box001-positions">
|
||||
<float_array id="geom-Box001-positions-array" count="24">-52.46753 -52.46753 0 52.46753 -52.46753 0 -52.46753 52.46753 0 52.46753 52.46753 0 -52.46753 -52.46753 81.55844 52.46753 -52.46753 81.55844 -52.46753 52.46753 81.55844 52.46753 52.46753 81.55844</float_array>
|
||||
<technique_common>
|
||||
<accessor source="#geom-Box001-positions-array" count="8" stride="3">
|
||||
<param name="X" type="float"/>
|
||||
<param name="Y" type="float"/>
|
||||
<param name="Z" type="float"/>
|
||||
</accessor>
|
||||
</technique_common>
|
||||
</source>
|
||||
<source id="geom-Box001-normals">
|
||||
<float_array id="geom-Box001-normals-array" count="72">0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 1 0 0 1 0 0 1 0 0 1 0 -1 0 0 -1 0 0 -1 0 0 -1 0 1 0 0 1 0 0 1 0 0 1 0 0 0 1 0 0 1 0 0 1 0 0 1 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0</float_array>
|
||||
<technique_common>
|
||||
<accessor source="#geom-Box001-normals-array" count="24" stride="3">
|
||||
<param name="X" type="float"/>
|
||||
<param name="Y" type="float"/>
|
||||
<param name="Z" type="float"/>
|
||||
</accessor>
|
||||
</technique_common>
|
||||
</source>
|
||||
<source id="geom-Box001-map1">
|
||||
<float_array id="geom-Box001-map1-array" count="36">0 0 0 1 0 0 0 1 0 1 1 0 0 0 0 1 0 0 0 1 0 1 1 0 0 0 0 1 0 0 0 1 0 1 1 0</float_array>
|
||||
<technique_common>
|
||||
<accessor source="#geom-Box001-map1-array" count="12" stride="3">
|
||||
<param name="S" type="float"/>
|
||||
<param name="T" type="float"/>
|
||||
<param name="P" type="float"/>
|
||||
</accessor>
|
||||
</technique_common>
|
||||
</source>
|
||||
<vertices id="geom-Box001-vertices">
|
||||
<input semantic="POSITION" source="#geom-Box001-positions"/>
|
||||
</vertices>
|
||||
<triangles material="_1_-_Default_1" count="12">
|
||||
<input semantic="VERTEX" source="#geom-Box001-vertices" offset="0"/>
|
||||
<input semantic="NORMAL" source="#geom-Box001-normals" offset="1"/>
|
||||
<input semantic="TEXCOORD" source="#geom-Box001-map1" offset="2" set="0"/>
|
||||
<p>0 0 9 2 1 11 3 2 10 3 2 10 1 3 8 0 0 9 4 4 8 5 5 9 7 6 11 7 6 11 6 7 10 4 4 8 0 8 4 1 9 5 5 10 7 5 10 7 4 11 6 0 8 4 1 12 0 3 13 1 7 14 3 7 14 3 5 15 2 1 12 0 3 16 4 2 17 5 6 18 7 6 18 7 7 19 6 3 16 4 2 20 0 0 21 1 4 22 3 4 22 3 6 23 2 2 20 0</p>
|
||||
</triangles>
|
||||
</mesh>
|
||||
<extra>
|
||||
<technique profile="OpenCOLLADA3dsMax">
|
||||
<max_box>
|
||||
<generateuvs>1</generateuvs>
|
||||
<height>81.55844</height>
|
||||
<heightsegments>1</heightsegments>
|
||||
<length>104.9351</length>
|
||||
<lengthsegments>1</lengthsegments>
|
||||
<width>104.9351</width>
|
||||
<widthsegments>1</widthsegments>
|
||||
</max_box>
|
||||
</technique>
|
||||
</extra>
|
||||
</geometry>
|
||||
</library_geometries>
|
||||
<library_lights>
|
||||
<light id="EnvironmentAmbientLight" name="EnvironmentAmbientLight">
|
||||
<technique_common>
|
||||
<ambient>
|
||||
<color>0 0 0</color>
|
||||
</ambient>
|
||||
</technique_common>
|
||||
</light>
|
||||
<light id="Omni001-light" name="Omni001">
|
||||
<technique_common>
|
||||
<point>
|
||||
<color>1 1 1</color>
|
||||
<constant_attenuation>1</constant_attenuation>
|
||||
<linear_attenuation>0</linear_attenuation>
|
||||
<quadratic_attenuation>0</quadratic_attenuation>
|
||||
</point>
|
||||
</technique_common>
|
||||
<extra>
|
||||
<technique profile="OpenCOLLADA3dsMax">
|
||||
<max_light>
|
||||
<affect_diffuse>1</affect_diffuse>
|
||||
<affect_specular>1</affect_specular>
|
||||
<attenuation_far_end>200</attenuation_far_end>
|
||||
<attenuation_far_start>80</attenuation_far_start>
|
||||
<attenuation_near_end>40</attenuation_near_end>
|
||||
<attenuation_near_start>0</attenuation_near_start>
|
||||
<decay_radius>40</decay_radius>
|
||||
<decay_type>0</decay_type>
|
||||
<multiplier>1</multiplier>
|
||||
<use_far_attenuation>0</use_far_attenuation>
|
||||
<use_near_attenuation>0</use_near_attenuation>
|
||||
</max_light>
|
||||
</technique>
|
||||
</extra>
|
||||
</light>
|
||||
</library_lights>
|
||||
<library_images>
|
||||
<image id="__proj_plane_d_png">
|
||||
<init_from>file:///D:/orders/libs/qglview/data/images/0_0_proj_plane_d.png</init_from>
|
||||
</image>
|
||||
<image id="__proj_plane_n_png">
|
||||
<init_from>file:///D:/orders/libs/qglview/data/images/1_1_proj_plane_n.png</init_from>
|
||||
</image>
|
||||
</library_images>
|
||||
<library_visual_scenes>
|
||||
<visual_scene id="MaxScene">
|
||||
<node name="EnvironmentAmbientLight">
|
||||
<instance_light url="#EnvironmentAmbientLight"/>
|
||||
</node>
|
||||
<node id="node-Box001" name="Box001">
|
||||
<translate>-0.2597403 1.67982e-6 -38.42989</translate>
|
||||
<instance_geometry url="#geom-Box001">
|
||||
<bind_material>
|
||||
<technique_common>
|
||||
<instance_material symbol="_1_-_Default_1" target="#_1_-_Default-material">
|
||||
<bind_vertex_input semantic="CHANNEL1" input_semantic="TEXCOORD" input_set="0"/>
|
||||
<bind_vertex_input semantic="CHANNEL1" input_semantic="TEXCOORD" input_set="0"/>
|
||||
</instance_material>
|
||||
</technique_common>
|
||||
</bind_material>
|
||||
</instance_geometry>
|
||||
<extra>
|
||||
<technique profile="OpenCOLLADA">
|
||||
<cast_shadows>1</cast_shadows>
|
||||
<primary_visibility>1</primary_visibility>
|
||||
<receive_shadows>1</receive_shadows>
|
||||
<secondary_visibility>1</secondary_visibility>
|
||||
</technique>
|
||||
</extra>
|
||||
</node>
|
||||
<node id="node-Omni001" name="Omni001">
|
||||
<translate>-70.79592 -1.038961 0</translate>
|
||||
<instance_light url="#Omni001-light"/>
|
||||
<extra>
|
||||
<technique profile="OpenCOLLADA">
|
||||
<cast_shadows>1</cast_shadows>
|
||||
<primary_visibility>1</primary_visibility>
|
||||
<receive_shadows>1</receive_shadows>
|
||||
<secondary_visibility>1</secondary_visibility>
|
||||
</technique>
|
||||
</extra>
|
||||
</node>
|
||||
<node id="node-Omni002" name="Omni002">
|
||||
<translate>71.64668 -1.038961 0</translate>
|
||||
<instance_light url="#Omni001-light"/>
|
||||
<extra>
|
||||
<technique profile="OpenCOLLADA">
|
||||
<cast_shadows>1</cast_shadows>
|
||||
<primary_visibility>1</primary_visibility>
|
||||
<receive_shadows>1</receive_shadows>
|
||||
<secondary_visibility>1</secondary_visibility>
|
||||
</technique>
|
||||
</extra>
|
||||
</node>
|
||||
<node id="node-Omni003" name="Omni003">
|
||||
<translate>-0.6411896 69.10653 0</translate>
|
||||
<instance_light url="#Omni001-light"/>
|
||||
<extra>
|
||||
<technique profile="OpenCOLLADA">
|
||||
<cast_shadows>1</cast_shadows>
|
||||
<primary_visibility>1</primary_visibility>
|
||||
<receive_shadows>1</receive_shadows>
|
||||
<secondary_visibility>1</secondary_visibility>
|
||||
</technique>
|
||||
</extra>
|
||||
</node>
|
||||
<node id="node-Omni004" name="Omni004">
|
||||
<translate>-0.6411896 -70.79569 0</translate>
|
||||
<instance_light url="#Omni001-light"/>
|
||||
<extra>
|
||||
<technique profile="OpenCOLLADA">
|
||||
<cast_shadows>1</cast_shadows>
|
||||
<primary_visibility>1</primary_visibility>
|
||||
<receive_shadows>1</receive_shadows>
|
||||
<secondary_visibility>1</secondary_visibility>
|
||||
</technique>
|
||||
</extra>
|
||||
</node>
|
||||
<node id="node-Omni005" name="Omni005">
|
||||
<translate>-0.6411896 -0.9917782 61.31038</translate>
|
||||
<instance_light url="#Omni001-light"/>
|
||||
<extra>
|
||||
<technique profile="OpenCOLLADA">
|
||||
<cast_shadows>1</cast_shadows>
|
||||
<primary_visibility>1</primary_visibility>
|
||||
<receive_shadows>1</receive_shadows>
|
||||
<secondary_visibility>1</secondary_visibility>
|
||||
</technique>
|
||||
</extra>
|
||||
</node>
|
||||
<node id="node-Omni006" name="Omni006">
|
||||
<translate>-0.6411896 -0.9917731 -55.19681</translate>
|
||||
<instance_light url="#Omni001-light"/>
|
||||
<extra>
|
||||
<technique profile="OpenCOLLADA">
|
||||
<cast_shadows>1</cast_shadows>
|
||||
<primary_visibility>1</primary_visibility>
|
||||
<receive_shadows>1</receive_shadows>
|
||||
<secondary_visibility>1</secondary_visibility>
|
||||
</technique>
|
||||
</extra>
|
||||
</node>
|
||||
</visual_scene>
|
||||
</library_visual_scenes>
|
||||
<scene>
|
||||
<instance_visual_scene url="#MaxScene"/>
|
||||
</scene>
|
||||
</COLLADA>
|
||||
|
Before Width: | Height: | Size: 123 KiB |
@@ -20,7 +20,7 @@
|
||||
#include <QCleanlooksStyle>
|
||||
#include <QDebug>
|
||||
#include <QDir>
|
||||
#include "mainwindow.h"
|
||||
#include "qglview_window.h"
|
||||
//#include <GL/glew.h>
|
||||
//#include <GL/freeglut.h>
|
||||
//#include "unistd.h"
|
||||
@@ -103,7 +103,7 @@ int main(int argc, char ** argv) {
|
||||
//QApplication::setStyle(new QCleanlooksStyle());
|
||||
//QDir::setCurrent(a.applicationDirPath());
|
||||
//a.setWindowIcon(QIcon(":/icons/peri4_paint.png"));
|
||||
MainWindow w;
|
||||
QGLViewWindow w;
|
||||
w.show();
|
||||
QStringList al(a.arguments());
|
||||
al.pop_front();
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "mainwindow.h"
|
||||
#include "qglview_window.h"
|
||||
#include "loader_qgl.h"
|
||||
#include "loader_ase.h"
|
||||
#include "loader_3ds.h"
|
||||
@@ -27,7 +27,7 @@
|
||||
#include <QMessageBox>
|
||||
|
||||
|
||||
MainWindow::MainWindow(QWidget * parent): QMainWindow(parent), Ui::MainWindow() {
|
||||
QGLViewWindow::QGLViewWindow(QWidget * parent): QMainWindow(parent), Ui::QGLViewWindow() {
|
||||
setupUi(this);
|
||||
icon_geo = QIcon(":/icons/type-geo.png");
|
||||
icon_camera = QIcon(":/icons/type-camera.png");
|
||||
@@ -116,12 +116,12 @@ MainWindow::MainWindow(QWidget * parent): QMainWindow(parent), Ui::MainWindow()
|
||||
}
|
||||
|
||||
|
||||
MainWindow::~MainWindow() {
|
||||
QGLViewWindow::~QGLViewWindow() {
|
||||
//delete ps;
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::changeEvent(QEvent * e) {
|
||||
void QGLViewWindow::changeEvent(QEvent * e) {
|
||||
QMainWindow::changeEvent(e);
|
||||
if (e->type() == QEvent::LanguageChange) {
|
||||
retranslateUi(this);
|
||||
@@ -130,7 +130,7 @@ void MainWindow::changeEvent(QEvent * e) {
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::timerEvent(QTimerEvent * ) {
|
||||
void QGLViewWindow::timerEvent(QTimerEvent * ) {
|
||||
//static double t = 0.;
|
||||
cam_light->intensity = checkCameraLight->isChecked() ? 0.5 : 0.;
|
||||
//((RendererSimple*)(view->renderer()))->mpos = view->mapFromGlobal(QCursor::pos());
|
||||
@@ -138,7 +138,7 @@ void MainWindow::timerEvent(QTimerEvent * ) {
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_view_glKeyPressEvent(QKeyEvent * e) {
|
||||
void QGLViewWindow::on_view_glKeyPressEvent(QKeyEvent * e) {
|
||||
if (e->key() != Qt::Key_F11) return;
|
||||
if (view->windowState().testFlag(Qt::WindowFullScreen)) {
|
||||
centralwidget->layout()->addWidget(view);
|
||||
@@ -149,18 +149,18 @@ void MainWindow::on_view_glKeyPressEvent(QKeyEvent * e) {
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_view_glInitializeDone() {
|
||||
void QGLViewWindow::on_view_glInitializeDone() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::loadFile(const QString & path) {
|
||||
void QGLViewWindow::loadFile(const QString & path) {
|
||||
prev_path = path;
|
||||
importFile(path);
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::importFile(const QString & path) {
|
||||
void QGLViewWindow::importFile(const QString & path) {
|
||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
QFileInfo fi(path);
|
||||
GLObjectBase * o = 0;
|
||||
@@ -180,7 +180,7 @@ void MainWindow::importFile(const QString & path) {
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::makeObjetTree(const GLObjectBase * o, QTreeWidgetItem * ti) {
|
||||
void QGLViewWindow::makeObjetTree(const GLObjectBase * o, QTreeWidgetItem * ti) {
|
||||
if (o == axis) return;
|
||||
for (int i = 0; i < o->childCount(); ++i) {
|
||||
const GLObjectBase * co = o->child(i);
|
||||
@@ -198,7 +198,7 @@ void MainWindow::makeObjetTree(const GLObjectBase * o, QTreeWidgetItem * ti) {
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::selectionChanged(GLObjectBase * cur, GLObjectBase * prev) {
|
||||
void QGLViewWindow::selectionChanged(GLObjectBase * cur, GLObjectBase * prev) {
|
||||
sel_obj = cur;
|
||||
//qDebug() << "selected" << (cur != 0 ? cur->name() : "0");
|
||||
labelName->setText(cur != 0 ? cur->name() : "");
|
||||
@@ -219,13 +219,13 @@ void MainWindow::selectionChanged(GLObjectBase * cur, GLObjectBase * prev) {
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::materialChanged() {
|
||||
void QGLViewWindow::materialChanged() {
|
||||
if (sel_obj == 0) return;
|
||||
sel_obj->setMaterial(matEditor->material());
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_comboRenderer_currentIndexChanged(int val) {
|
||||
void QGLViewWindow::on_comboRenderer_currentIndexChanged(int val) {
|
||||
GLRendererBase * pr = 0;
|
||||
switch (val) {
|
||||
case 0: view->setRenderer(new RendererSimple(view), &pr); break;
|
||||
@@ -236,7 +236,7 @@ void MainWindow::on_comboRenderer_currentIndexChanged(int val) {
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_actionReset_triggered() {
|
||||
void QGLViewWindow::on_actionReset_triggered() {
|
||||
view->removeObject(axis, false);
|
||||
view->clearObjects(true);
|
||||
view->addObject(axis);
|
||||
@@ -244,7 +244,7 @@ void MainWindow::on_actionReset_triggered() {
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_actionImport_triggered() {
|
||||
void QGLViewWindow::on_actionImport_triggered() {
|
||||
QStringList fl = QFileDialog::getOpenFileNames(this, "Select files", prev_path, "Supported types(*.qgl *.ase *.3ds *.obj *.dae);;"
|
||||
"QGLView(*.qgl);;"
|
||||
"Ascii Scene Export(*.ase);;"
|
||||
@@ -258,7 +258,7 @@ void MainWindow::on_actionImport_triggered() {
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_actionSave_triggered() {
|
||||
void QGLViewWindow::on_actionSave_triggered() {
|
||||
QString f = QFileDialog::getSaveFileName(this, "Select file", prev_path, "QGLView(*.qgl)");
|
||||
if (f.isEmpty()) return;
|
||||
if (f.right(4).toLower() != ".qgl")
|
||||
@@ -272,7 +272,7 @@ void MainWindow::on_actionSave_triggered() {
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_actionSaveSelected_triggered() {
|
||||
void QGLViewWindow::on_actionSaveSelected_triggered() {
|
||||
if (!sel_obj) return;
|
||||
QString f = QFileDialog::getSaveFileName(this, "Select file", prev_path, "QGLView(*.qgl)");
|
||||
if (f.isEmpty()) return;
|
||||
@@ -285,7 +285,7 @@ void MainWindow::on_actionSaveSelected_triggered() {
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_actionOpen_triggered() {
|
||||
void QGLViewWindow::on_actionOpen_triggered() {
|
||||
QString f = QFileDialog::getOpenFileName(this, "Select file", prev_path, "Supported types(*.qgl *.ase *.3ds *.obj *.dae);;"
|
||||
"QGLView(*.qgl);;"
|
||||
"Ascii Scene Export(*.ase);;"
|
||||
@@ -298,7 +298,7 @@ void MainWindow::on_actionOpen_triggered() {
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_view_keyEvent(Qt::Key k, Qt::KeyboardModifiers m) {
|
||||
void QGLViewWindow::on_view_keyEvent(Qt::Key k, Qt::KeyboardModifiers m) {
|
||||
//qDebug() << k;
|
||||
double spd = 0.2;
|
||||
if (m.testFlag(Qt::ShiftModifier))
|
||||
@@ -313,21 +313,21 @@ void MainWindow::on_view_keyEvent(Qt::Key k, Qt::KeyboardModifiers m) {
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_treeObjects_itemClicked(QTreeWidgetItem * ti, int col) {
|
||||
void QGLViewWindow::on_treeObjects_itemClicked(QTreeWidgetItem * ti, int col) {
|
||||
((GLObjectBase*)(ti->data(0, Qt::UserRole).toULongLong()))->select();
|
||||
if (sel_obj->type() == GLObjectBase::glCamera)
|
||||
view->setCamera(*(Camera*)sel_obj);
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::objectsTreeChanged() {
|
||||
void QGLViewWindow::objectsTreeChanged() {
|
||||
treeObjects->clear();
|
||||
makeObjetTree(&(view->rootObject()), treeObjects->invisibleRootItem());
|
||||
treeObjects->expandAll();
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_pushButton_clicked() {
|
||||
void QGLViewWindow::on_pushButton_clicked() {
|
||||
//view->removeLight(view->lightsCount() - 1);
|
||||
//setWindowTitle(QString::number(view->lightsCount()));
|
||||
QVector3D wp = view->light(0)->worldPos();
|
||||
@@ -336,7 +336,7 @@ void MainWindow::on_pushButton_clicked() {
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_pushButton_3_clicked() {
|
||||
void QGLViewWindow::on_pushButton_3_clicked() {
|
||||
QList<GLObjectBase * > ol = view->objects(true);
|
||||
qDebug() << ol.size();
|
||||
foreach (GLObjectBase * i, ol) {
|
||||
@@ -16,8 +16,8 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef MAINWINDOW_H
|
||||
#define MAINWINDOW_H
|
||||
#ifndef QGLVIEWWINDOW_H
|
||||
#define QGLVIEWWINDOW_H
|
||||
|
||||
#include <QTranslator>
|
||||
#include <QInputDialog>
|
||||
@@ -30,7 +30,7 @@
|
||||
#include <QThread>
|
||||
#include <QTime>
|
||||
#include <QSplitter>
|
||||
#include "ui_mainwindow.h"
|
||||
#include "ui_qglview_window.h"
|
||||
#include "loader_3ds.h"
|
||||
#include "loader_ase.h"
|
||||
#include "renderer_simple.h"
|
||||
@@ -41,12 +41,12 @@
|
||||
#include "rope_system.h"
|
||||
|
||||
|
||||
class MainWindow: public QMainWindow, public Ui::MainWindow
|
||||
class QGLViewWindow: public QMainWindow, public Ui::QGLViewWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
MainWindow(QWidget * parent = 0);
|
||||
~MainWindow();
|
||||
QGLViewWindow(QWidget * parent = 0);
|
||||
~QGLViewWindow();
|
||||
|
||||
void loadFile(const QString & path);
|
||||
|
||||
@@ -140,4 +140,4 @@ private:
|
||||
|
||||
};
|
||||
|
||||
#endif // MAINWINDOW_H
|
||||
#endif // QGLVIEWWINDOW_H
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>MainWindow</class>
|
||||
<widget class="QMainWindow" name="MainWindow">
|
||||
<class>QGLViewWindow</class>
|
||||
<widget class="QMainWindow" name="QGLViewWindow">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||