Commit 27e8f7b0 authored by Stéphane Albert's avatar Stéphane Albert

ENH: Added mvdMyWidget (similar to mvdMyClass) template files.

parent 2f5d2704
......@@ -266,6 +266,8 @@ MainWindow
// Setup color-setup controller.
colorSetupWidget->blockSignals( true );
{
// qDebug() << vectorImageModel->GetBandNames();
colorSetupWidget->SetComponents( vectorImageModel->GetBandNames() );
for( int i=0; i<ColorSetupWidget::CHANNEL_COUNT; ++i )
......
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>mvd::ColorDynamicsWidget</class>
<widget class="QWidget" name="mvd::ColorDynamicsWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>308</width>
<height>105</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<property name="locale">
<locale language="C" country="AnyCountry"/>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="1">
<widget class="QLabel" name="m_LowLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Low</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QLabel" name="m_HighLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>High</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="m_QuantileLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Quantile:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QDoubleSpinBox" name="m_LowQuantileSpinBox">
<property name="frame">
<bool>true</bool>
</property>
<property name="suffix">
<string>%</string>
</property>
<property name="value">
<double>2.000000000000000</double>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QDoubleSpinBox" name="m_HighQuantileSpinBox">
<property name="frame">
<bool>true</bool>
</property>
<property name="suffix">
<string>%</string>
</property>
<property name="value">
<double>2.000000000000000</double>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QPushButton" name="m_DefaultsButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Defaults</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="m_ValueLabel">
<property name="text">
<string>Value:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QDoubleSpinBox" name="m_LowValueSpinBox">
<property name="frame">
<bool>true</bool>
</property>
<property name="suffix">
<string/>
</property>
<property name="maximum">
<double>255.000000000000000</double>
</property>
<property name="value">
<double>0.000000000000000</double>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QDoubleSpinBox" name="m_HighValueSpinBox">
<property name="frame">
<bool>true</bool>
</property>
<property name="suffix">
<string/>
</property>
<property name="maximum">
<double>255.000000000000000</double>
</property>
<property name="value">
<double>255.000000000000000</double>
</property>
</widget>
</item>
<item row="2" column="3">
<widget class="QPushButton" name="m_MinMaxButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Min/Max</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="1">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>45</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>1</height>
</size>
</property>
</spacer>
</item>
</layout>
<zorder>layoutWidget</zorder>
<zorder>layoutWidget</zorder>
<zorder>layoutWidget</zorder>
<zorder>layoutWidget</zorder>
<zorder>label_28</zorder>
<zorder>horizontalSpacer</zorder>
<zorder>verticalSpacer</zorder>
</widget>
<resources/>
<connections/>
</ui>
/*=========================================================================
Program: Monteverdi2
Language: C++
Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
See Copyright.txt for details.
Monteverdi2 is distributed under the CeCILL licence version 2. See
Licence_CeCILL_V2-en.txt or
http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt for more details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#include "mvdMyWidget.h"
#include "ui_mvdMyWidget.h"
//
// Qt includes (sorted by alphabetic order)
//// Must be included before system/custom includes.
//
// System includes (sorted by alphabetic order)
//
// ITK includes (sorted by alphabetic order)
//
// OTB includes (sorted by alphabetic order)
//
// Monteverdi includes (sorted by alphabetic order)
namespace mvd
{
/*
TRANSLATOR mvd::MyWidget
Necessary for lupdate to be aware of C++ namespaces.
Context comment for translator.
*/
/*******************************************************************************/
MyWidget
::MyWidget( QWidget* parent, Qt::WindowFlags flags ):
QWidget( parent, flags ),
m_UI( new mvd::Ui::MyWidget() )
{
m_UI->setupUi( this );
}
/*******************************************************************************/
MyWidget
::~MyWidget()
{
}
/*******************************************************************************/
/* SLOTS */
/*******************************************************************************/
/*******************************************************************************/
} // end namespace 'mvd'
/*=========================================================================
Program: Monteverdi2
Language: C++
Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
See Copyright.txt for details.
Monteverdi2 is distributed under the CeCILL licence version 2. See
Licence_CeCILL_V2-en.txt or
http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt for more details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef __mvdMyWidget_h
#define __mvdMyWidget_h
//
// Configuration include.
//// Included at first position before any other ones.
#include "ConfigureMonteverdi2.h"
//
// Qt includes (sorted by alphabetic order)
//// Must be included before system/custom includes.
#include <QtGui>
//
// System includes (sorted by alphabetic order)
//
// ITK includes (sorted by alphabetic order)
//
// OTB includes (sorted by alphabetic order)
//
// Monteverdi includes (sorted by alphabetic order)
//
// External classes pre-declaration.
namespace
{
}
namespace mvd
{
//
// Internal classes pre-declaration.
namespace Ui
{
class MyWidget;
};
/**
* \class MyWidget
*/
class Monteverdi2_EXPORT MyWidget :
public QWidget
{
Q_OBJECT;
//
// Public methods.
public:
/** Constructor */
MyWidget( QWidget* parent =NULL, Qt::WindowFlags flags =0 );
/** Destructor */
virtual ~MyWidget();
//
// SIGNALS.
signals:
//
// Protected methods.
protected:
//
// Protected attributes.
protected:
//
// Private methods.
private:
//
// Private attributes.
private:
/**
* uic generated.
*/
Ui::MyWidget* m_UI;
//
// SLOTS.
private slots:
};
} // end namespace 'mvd'
#endif // __mvdMyWidget_h
......@@ -89,10 +89,18 @@ VectorImageModel
StringVector stdBandNames( GetMetadataInterface()->GetBandName() );
/*
qDebug() << "stdBandNames.size(): " << stdBandNames.size();
for( unsigned int i=0; i<stdBandNames.size(); ++i )
{
qDebug() << i << ": " << QString::fromStdString( stdBandNames[ i ] );
}
*/
assert( stdBandNames.empty() ||
stdBandNames.size()==output->GetNumberOfComponentsPerPixel() );
if( stdBandNames.empty() )
if( stdBandNames.size()!=output->GetNumberOfComponentsPerPixel() )
{
stdBandNames.resize( output->GetNumberOfComponentsPerPixel() );
}
......@@ -128,11 +136,10 @@ VectorImageModel
// Ensure default display returns valid band indices (see OTB bug).
assert( metaData->GetDefaultDisplay().size()==3 );
/*
assert( metaData->GetDefaultDisplay()[ 0 ]
< output->GetNumberOfComponentsPerPixel() );
assert( metaData->GetDefaultDisplay()[ 1 ] <
assert( metaData->GetDefaultDisplay()[ 1 ]
< output->GetNumberOfComponentsPerPixel() );
assert( metaData->GetDefaultDisplay()[ 2 ]
< output->GetNumberOfComponentsPerPixel() );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment