Commit 500a98a2 authored by NICLAUSSE Nicolas's avatar NICLAUSSE Nicolas

Merge branch 'develop' into feature/fix-clut-editor

parents 905d216d 206e774f
......@@ -19,7 +19,7 @@
## ###################################################################
build
build*
build-*
## ###################################################################
## Install tree
......
# Version: $Id$
#
#
#
#
# Commentary:
#
#
# Commentary:
#
#
# Change Log:
#
#
#
#
# Code:
......@@ -20,8 +20,7 @@ dependencies:
- vtk=8.2.0
- dtk-fonts
- dtk-log
- dtk-core
- dtk-widgets
- dtk-widgets >=2.7.0
#
#
# dtk-visualization.yaml ends here
@echo off
mkdir build
cd build
set BUILD_CONFIG=Release
cmake .. -G "Visual Studio 14 2015 Win64" ^
-Wno-dev ^
-DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^
-DCMAKE_PREFIX_PATH=%LIBRARY_PREFIX% ^
-DCMAKE_INSTALL_RPATH:STRING=%LIBRARY_LIB% ^
-DCMAKE_INSTALL_NAME_DIR=%LIBRARY_LIB%
if errorlevel 1 exit 1
cmake --build . --config %BUILD_CONFIG% --target install
if errorlevel 1 exit 1
#!/bin/bash
mkdir build
cd build
cmake .. \
-DCMAKE_INSTALL_PREFIX="${PREFIX}" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_LIBDIR=lib
make -j${CPU_COUNT}
make install
package:
name: dtk-visualization
version: {{ GIT_DESCRIBE_TAG }}
source:
git_url: ../..
build:
number: 0
requirements:
build:
- cmake >=3.2.0
- binutils_impl_linux-64<2.31.0 # [linux]
- {{ compiler('cxx') }}
- {{ cdt('xorg-x11-proto-devel') }} # [linux]
- {{ cdt('mesa-libgl-devel') }} # [linux]
- {{ cdt('mesa-libegl-devel') }} # [linux]
- {{ cdt('mesa-dri-drivers') }} # [linux]
- {{ cdt('libx11-devel') }} # [linux]
- {{ cdt('libXt-devel') }} # [linux]
- {{ cdt('libICE-devel') }} # [linux]
- {{ cdt('libuuid-devel') }} # [linux]
- {{ cdt('libSM-devel') }} # [linux]
- {{ cdt('libxext-devel') }} # [linux]
- {{ cdt('libxcb') }} # [linux]
- {{ cdt('libxrender-devel') }} # [linux]
- {{ cdt('libxau-devel') }} # [linux]
- {{ cdt('libdrm-devel') }} # [linux]
- {{ cdt('libxcomposite-devel') }} # [linux]
- {{ cdt('libxcursor-devel') }} # [linux]
- {{ cdt('libxi-devel') }} # [linux]
- {{ cdt('libxrandr-devel') }} # [linux]
- {{ cdt('pciutils-devel') }} # [linux]
- {{ cdt('libxscrnsaver-devel') }} # [linux]
- {{ cdt('libxtst-devel') }} # [linux]
- {{ cdt('libselinux-devel') }} # [linux]
- {{ cdt('libxdamage') }} # [linux]
- {{ cdt('libxdamage-devel') }} # [linux]
- {{ cdt('libxfixes') }} # [linux]
- {{ cdt('libxfixes-devel') }} # [linux]
- {{ cdt('libxxf86vm') }} # [linux]
host:
- qt >=5.9.0
- dtk-fonts
- dtk-widgets >=2.7.0,<2.8
- vtk >=8.1.0
run:
- vtk >=8.1.0
- qt >=5.9.0
- dtk-fonts
- dtk-widgets >=2.7.0,<2.8
- dtk-widgets >=2.7.0,<2.8
- gst-plugins-good # [linux]
- gst-libav # [linux]
about:
home: http://dtk.inria.fr/
license: BSD
summary: dtk-visualization is a bridge between Qt and VTK and requires no additional dependency.
......@@ -156,15 +156,13 @@ void dtkVisualizationDecoratorScalarColorMap::setData(const QVariant& data)
d->dataset->GetPointData()->SetActiveScalars(qPrintable(field_name));
double *range = static_cast<vtkDataArray *>(d->dataset->GetPointData()->GetScalars())->GetRange();
d->ranges[field_name] = qMakePair(range[0], range[1]);
vtkSmartPointer<vtkColorTransferFunction> color_function = vtkSmartPointer<vtkColorTransferFunction>::New();
QColor black = QColor(0., 0., 0., 255);
double node = 0. * range[1] + (1. - 0.) * range[0];
color_function->AddRGBPoint(node, black.red(), black.green(), black.blue());
color_function->AddRGBPoint(range[0], black.red(), black.green(), black.blue());
QColor white = QColor(1., 1., 1., 255);
node = 1. * range[1] + (1. - 1.) * range[0];
color_function->AddRGBPoint(node, white.red(), white.green(), white.blue());
color_function->AddRGBPoint(range[1], white.red(), white.green(), white.blue());
color_function->Build();
d->color_transfer_functions[field_name] = color_function;
vtkSmartPointer<vtkPiecewiseFunction> opacity_function = vtkSmartPointer<vtkPiecewiseFunction>::New();
......@@ -390,13 +388,15 @@ bool dtkVisualizationDecoratorScalarColorMap::setCurrentFieldName(const QString&
return true;
}
void dtkVisualizationDecoratorScalarColorMap::setCurrentColorTransferFunction(vtkSmartPointer<vtkColorTransferFunction> color_function)
void dtkVisualizationDecoratorScalarColorMap::setCurrentColorTransferFunction(vtkSmartPointer<vtkColorTransferFunction> p_color_function)
{
if (d->current_field_name.isEmpty()) {
return;
}
d->color_transfer_functions[d->current_field_name] = color_function;
d->color_transfer_functions[d->current_field_name]->DeepCopy(p_color_function);
vtkSmartPointer<vtkColorTransferFunction> color_function = d->color_transfer_functions[d->current_field_name];
d->mapper->SetLookupTable(color_function);
d->mapper->Modified();
......@@ -408,17 +408,18 @@ void dtkVisualizationDecoratorScalarColorMap::setCurrentColorTransferFunction(vt
if (this->canvas() && this->canvas()->interactor()) {
this->canvas()->interactor()->Render();
}
emit this->currentColorTransferFunctionChanged(color_function);
}
void dtkVisualizationDecoratorScalarColorMap::setCurrentOpacityTransferFunction(vtkSmartPointer<vtkPiecewiseFunction> opacity_function)
void dtkVisualizationDecoratorScalarColorMap::setCurrentOpacityTransferFunction(vtkSmartPointer<vtkPiecewiseFunction> p_opacity_function)
{
if (d->current_field_name.isEmpty()) {
return;
}
d->opacity_functions[d->current_field_name] = opacity_function;
d->opacity_functions[d->current_field_name]->DeepCopy(p_opacity_function);
vtkSmartPointer<vtkPiecewiseFunction> opacity_function = d->opacity_functions[d->current_field_name];
int size = opacity_function->GetSize();
......
......@@ -931,6 +931,8 @@ void dtkVisualizationWidgetsClutEditor::setColorTransferFunction(vtkColorTransfe
d->colorTransferFunction->DeepCopy(color_transfer_function);
this->updateTable();
this->onApply();
}
void *dtkVisualizationWidgetsClutEditor::opacityTransferFunction(void)
......@@ -940,7 +942,9 @@ void *dtkVisualizationWidgetsClutEditor::opacityTransferFunction(void)
void dtkVisualizationWidgetsClutEditor::setOpacityTransferFunction(vtkPiecewiseFunction *opacity_transfer_function)
{
d->opacityTransferFunction = opacity_transfer_function;
if(!d->opacityTransferFunction) d->opacityTransferFunction = vtkPiecewiseFunction::New();
d->opacityTransferFunction->DeepCopy(opacity_transfer_function);
if (d->colorTransferFunction) {
qWarning() << "Color transfer function must be set prior to opacity transfer function.";
......@@ -948,6 +952,8 @@ void dtkVisualizationWidgetsClutEditor::setOpacityTransferFunction(vtkPiecewiseF
}
this->updateTable();
this->onApply();
}
void dtkVisualizationWidgetsClutEditor::updateTable(void)
......
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