Пример #1
0
StereogramDialog::StereogramDialog(ccMainAppInterface* app/*=0*/)
	: QDialog(app ? app->getMainWindow() : 0)
	, Ui::StereogramDialog()
	, m_classifWidget(0)
	, m_colorScaleSelector(0)
	, m_app(app)
	, m_facetGroupUniqueID(0)
{
	setupUi(this);

	//create classification widget (stereogram)
	m_classifWidget = new StereogramWidget(this);
	{
		if (!frame->layout())
			frame->setLayout(new QHBoxLayout());
		frame->layout()->addWidget(m_classifWidget);
		m_classifWidget->setTicksFreq(ticksFreqSpinBox->value());
	}

	//add color ramp selector widget
	if (m_app)
	{
		ccColorScalesManager* csManager = m_app->getColorScalesManager();
		m_colorScaleSelector = new ccColorScaleSelector(csManager,this,QString::fromUtf8(":/CC/plugin/qFacets/gearIcon.png"));
		m_colorScaleSelector->init();
		ccColorScale::Shared scale = csManager->getDefaultScale(ccColorScalesManager::BGYR);
		if (scale)
		{
			m_colorScaleSelector->setSelectedScale(scale->getUuid());
			m_classifWidget->setDensityColorScale(scale);
		}
		connect(m_colorScaleSelector, SIGNAL(colorScaleSelected(int)), this, SLOT(colorScaleChanged(int)));
		connect(m_colorScaleSelector, SIGNAL(colorScaleEditorSummoned()), this, SLOT(spawnColorScaleEditor()));
		//add selector to group's layout
		if (!colorRampGroupBox->layout())
			colorRampGroupBox->setLayout(new QHBoxLayout());
		colorRampGroupBox->layout()->addItem(new QSpacerItem(20, 20, QSizePolicy::Preferred, QSizePolicy::Minimum));
		colorRampGroupBox->layout()->addWidget(m_colorScaleSelector);
		colorScaleStepsSpinBox->setRange(ccColorScale::MIN_STEPS,ccColorScale::MAX_STEPS);
	}
	else
	{
Пример #2
0
void ccColorScaleSelector::init()
{
	//fill combox box
	if (m_comboBox)
	{
		m_comboBox->disconnect(this);

		m_comboBox->clear();
		//add all available color scales
		assert(m_manager);
		for (ccColorScalesManager::ScalesMap::const_iterator it = m_manager->map().begin(); it != m_manager->map().end(); ++it)
			m_comboBox->addItem((*it)->getName(),(*it)->getUuid());

		connect(m_comboBox, SIGNAL(activated(int)), this, SIGNAL(colorScaleSelected(int)));
	}
	//advanced tool button
	if (m_button)
	{
		m_button->disconnect(this);
		connect(m_button, SIGNAL(clicked()), this, SIGNAL(colorScaleEditorSummoned()));
	}
}