Merge branch 'master' into develop_kimkulling
commit
a3cb1ef55e
|
@ -71,7 +71,7 @@ static const aiImporterDesc desc = {
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
"3ds prj"
|
"3ds prj 3DS PRJ"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -127,7 +127,7 @@ Discreet3DSImporter::~Discreet3DSImporter() {
|
||||||
// Returns whether the class can handle the format of the given file.
|
// Returns whether the class can handle the format of the given file.
|
||||||
bool Discreet3DSImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const {
|
bool Discreet3DSImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const {
|
||||||
std::string extension = GetExtension(pFile);
|
std::string extension = GetExtension(pFile);
|
||||||
if(extension == "3ds" || extension == "prj" ) {
|
if(extension == "3ds" || extension == "3DS" || extension == "prj"|| extension == "PRJ" ) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -560,6 +560,30 @@ void CGLView::Enable_Textures(const bool pEnable)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CGLView::Enable_Axes(const bool pEnable){
|
||||||
|
if(pEnable)
|
||||||
|
{
|
||||||
|
this->mAxesEnabled = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this->mAxesEnabled = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CGLView::Enable_Reload_Textures(const bool pEnable)
|
||||||
|
{
|
||||||
|
if(pEnable)
|
||||||
|
{
|
||||||
|
this->mReloadTexturesEnabled = true;
|
||||||
|
// this->mScene->ImportTextures(this->mScene->pScenePath);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this->mReloadTexturesEnabled = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/********************************************************************/
|
/********************************************************************/
|
||||||
/*********************** Override functions ************************/
|
/*********************** Override functions ************************/
|
||||||
/********************************************************************/
|
/********************************************************************/
|
||||||
|
@ -609,6 +633,7 @@ void CGLView::drawCoordSystem() {
|
||||||
// Z, -Z
|
// Z, -Z
|
||||||
qglColor(QColor(Qt::blue)), glVertex3f(0.0, 0.0, 0.0), glVertex3f(0.0, 0.0, 100000.0);
|
qglColor(QColor(Qt::blue)), glVertex3f(0.0, 0.0, 0.0), glVertex3f(0.0, 0.0, 100000.0);
|
||||||
qglColor(QColor(Qt::yellow)), glVertex3f(0.0, 0.0, 0.0), glVertex3f(0.0, 0.0, -100000.0);
|
qglColor(QColor(Qt::yellow)), glVertex3f(0.0, 0.0, 0.0), glVertex3f(0.0, 0.0, -100000.0);
|
||||||
|
qglColor(QColor(Qt::white));
|
||||||
glEnd();
|
glEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -629,7 +654,10 @@ void CGLView::paintGL()
|
||||||
if ( mLightingEnabled ) {
|
if ( mLightingEnabled ) {
|
||||||
glDisable( GL_LIGHTING );///TODO: display list
|
glDisable( GL_LIGHTING );///TODO: display list
|
||||||
}
|
}
|
||||||
drawCoordSystem();
|
if (this->mAxesEnabled == true)
|
||||||
|
{
|
||||||
|
drawCoordSystem();
|
||||||
|
}
|
||||||
|
|
||||||
glDisable(GL_COLOR_MATERIAL);
|
glDisable(GL_COLOR_MATERIAL);
|
||||||
if(mLightingEnabled) glEnable(GL_LIGHTING);
|
if(mLightingEnabled) glEnable(GL_LIGHTING);
|
||||||
|
|
|
@ -75,7 +75,9 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
bool mAxesEnabled = true;
|
||||||
|
// Textures
|
||||||
|
bool mReloadTexturesEnabled = false; // If true then textures will reload when the window is activated.
|
||||||
/// \enum ELightType
|
/// \enum ELightType
|
||||||
/// Type of light source.
|
/// Type of light source.
|
||||||
enum class ELightType { Directional, Point, Spot };
|
enum class ELightType { Directional, Point, Spot };
|
||||||
|
@ -155,7 +157,6 @@ private:
|
||||||
GLdouble mCamera_Viewport_AspectRatio;///< Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height).
|
GLdouble mCamera_Viewport_AspectRatio;///< Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height).
|
||||||
// Lighting
|
// Lighting
|
||||||
bool mLightingEnabled = false;///< If true then OpenGL lighting is enabled (glEnable(GL_LIGHTING)), if false - disabled.
|
bool mLightingEnabled = false;///< If true then OpenGL lighting is enabled (glEnable(GL_LIGHTING)), if false - disabled.
|
||||||
// Textures
|
|
||||||
///TODO: map is goooood, but not for case when one image can be used in different materials with difference in: texture transformation, targeting of the
|
///TODO: map is goooood, but not for case when one image can be used in different materials with difference in: texture transformation, targeting of the
|
||||||
/// texture (ambient or emission, or even height map), texture properties.
|
/// texture (ambient or emission, or even height map), texture properties.
|
||||||
QMap<QString, GLuint> mTexture_IDMap;///< Map image filenames to textures ID's.
|
QMap<QString, GLuint> mTexture_IDMap;///< Map image filenames to textures ID's.
|
||||||
|
@ -306,6 +307,12 @@ public:
|
||||||
/// \param [in] pEnable - if true then enable textures, false - disable textures.
|
/// \param [in] pEnable - if true then enable textures, false - disable textures.
|
||||||
void Enable_Textures(const bool pEnable);
|
void Enable_Textures(const bool pEnable);
|
||||||
|
|
||||||
|
void Enable_Axes(const bool pEnable);
|
||||||
|
/// \fn void Enable_Textures(const bool pEnable)
|
||||||
|
/// Control textures drawing.
|
||||||
|
/// \param [in] pEnable - if true then enable textures, false - disable textures.
|
||||||
|
void Enable_Reload_Textures(const bool pEnable);
|
||||||
|
|
||||||
/********************************************************************/
|
/********************************************************************/
|
||||||
/******************** Lighting control functions ********************/
|
/******************** Lighting control functions ********************/
|
||||||
/********************************************************************/
|
/********************************************************************/
|
||||||
|
|
|
@ -48,6 +48,7 @@ QTime time_begin = QTime::currentTime();
|
||||||
ui->cbxLighting->setChecked(true); mGLView->Lighting_Enable();
|
ui->cbxLighting->setChecked(true); mGLView->Lighting_Enable();
|
||||||
ui->cbxBBox->setChecked(false); mGLView->Enable_SceneBBox(false);
|
ui->cbxBBox->setChecked(false); mGLView->Enable_SceneBBox(false);
|
||||||
ui->cbxTextures->setChecked(true); mGLView->Enable_Textures(true);
|
ui->cbxTextures->setChecked(true); mGLView->Enable_Textures(true);
|
||||||
|
ui->cbxReloadTextures->setChecked(true); mGLView->Enable_Reload_Textures(false);
|
||||||
//
|
//
|
||||||
// Fill info labels
|
// Fill info labels
|
||||||
//
|
//
|
||||||
|
@ -194,6 +195,13 @@ GLfloat step;
|
||||||
/********************************************************************/
|
/********************************************************************/
|
||||||
/********************** Constructor/Destructor **********************/
|
/********************** Constructor/Destructor **********************/
|
||||||
/********************************************************************/
|
/********************************************************************/
|
||||||
|
bool MainWindow::event(QEvent *e)
|
||||||
|
{
|
||||||
|
if (e->type() == QEvent::WindowActivate && this->mGLView->mReloadTexturesEnabled == true) {
|
||||||
|
qInfo() << "Window Activated";
|
||||||
|
}
|
||||||
|
return QWidget::event(e);
|
||||||
|
}
|
||||||
|
|
||||||
MainWindow::MainWindow(QWidget *parent)
|
MainWindow::MainWindow(QWidget *parent)
|
||||||
: QMainWindow(parent), ui(new Ui::MainWindow),
|
: QMainWindow(parent), ui(new Ui::MainWindow),
|
||||||
|
@ -364,6 +372,18 @@ void MainWindow::on_cbxBBox_clicked(bool checked)
|
||||||
mGLView->updateGL();
|
mGLView->updateGL();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::on_cbxDrawAxes_clicked(bool checked)
|
||||||
|
{
|
||||||
|
mGLView->Enable_Axes(checked);
|
||||||
|
mGLView->updateGL();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::on_cbxReloadTextures_clicked(bool checked)
|
||||||
|
{
|
||||||
|
mGLView->Enable_Reload_Textures(checked);
|
||||||
|
mGLView->updateGL();
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::on_cbxTextures_clicked(bool checked)
|
void MainWindow::on_cbxTextures_clicked(bool checked)
|
||||||
{
|
{
|
||||||
mGLView->Enable_Textures(checked);
|
mGLView->Enable_Textures(checked);
|
||||||
|
|
|
@ -90,7 +90,7 @@ protected:
|
||||||
/// \param [in] pEvent - pointer to event data.
|
/// \param [in] pEvent - pointer to event data.
|
||||||
void keyPressEvent(QKeyEvent* pEvent) override;
|
void keyPressEvent(QKeyEvent* pEvent) override;
|
||||||
|
|
||||||
|
bool event(QEvent*);
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/********************************************************************/
|
/********************************************************************/
|
||||||
|
@ -133,4 +133,6 @@ private slots:
|
||||||
void on_lstCamera_clicked(const QModelIndex &index);
|
void on_lstCamera_clicked(const QModelIndex &index);
|
||||||
void on_cbxBBox_clicked(bool checked);
|
void on_cbxBBox_clicked(bool checked);
|
||||||
void on_cbxTextures_clicked(bool checked);
|
void on_cbxTextures_clicked(bool checked);
|
||||||
|
void on_cbxDrawAxes_clicked(bool checked);
|
||||||
|
void on_cbxReloadTextures_clicked(bool checked);
|
||||||
};
|
};
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>641</width>
|
<width>641</width>
|
||||||
<height>734</height>
|
<height>778</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
|
@ -501,6 +501,23 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="3" column="0">
|
||||||
|
<widget class="QCheckBox" name="cbxDrawAxes">
|
||||||
|
<property name="text">
|
||||||
|
<string>Show Axes</string>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="0">
|
||||||
|
<widget class="QCheckBox" name="cbxReloadTextures">
|
||||||
|
<property name="text">
|
||||||
|
<string>Live Reload Textures</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
|
@ -513,4 +530,7 @@
|
||||||
<layoutdefault spacing="6" margin="11"/>
|
<layoutdefault spacing="6" margin="11"/>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
|
<slots>
|
||||||
|
<signal>installEventFilter()</signal>
|
||||||
|
</slots>
|
||||||
</ui>
|
</ui>
|
||||||
|
|
Loading…
Reference in New Issue