4#include <vtkPointData.h>
7#ifndef TTK_INSTALL_ASSETS_DIR
8#define TTK_INSTALL_ASSETS_DIR "."
18 vtkRenderWindowInteractor *interactor = this->Interactor;
19 string key = interactor->GetKeySym();
21 if(interactor->GetControlKey()) {
36 }
else if(key ==
"Escape") {
40 if((key ==
"0") || (key ==
"1") || (key ==
"2") || (key ==
"3")
41 || (key ==
"4") || (key ==
"5") || (key ==
"6") || (key ==
"7")
42 || (key ==
"8") || (key ==
"9")) {
83 "/textures/png/scalarFieldTexturePaleInterleavedRules.png");
86 && (
pngReader_->GetOutput()->GetNumberOfCells() == 1));
93 vtkVRMLExporter *exporter = vtkVRMLExporter::New();
96 exporter->SetFileName(fileName.data());
108 "fullscreen", &
fullscreen_,
"Maximize the window at launch");
116 int const outputPortNumber =
vtkWrapper_->GetNumberOfOutputPorts();
129 if((
int)
surfaces_.size() != outputPortNumber) {
130 surfaces_.resize(outputPortNumber,
nullptr);
136 for(
int i = 0; i < outputPortNumber; i++) {
144 for(
int i = 0; i < outputPortNumber; i++) {
149 vtkWrapper_->GetOutput(i)->GetPointData()->SetActiveScalars(
nullptr);
152 if((
repeat_) && (i < vtkWrapper_->GetNumberOfInputPorts())) {
192 msg <<
"[UserInterface] Initializing user interface..." << endl;
211 renderer_->SetBackground(44 / 255.0, 44 / 255.0, 44 / 255.0);
217 msg <<
"[ttkUserInterfaceBase] Running user interface!" << endl;
233 if((outputId < 0) || (outputId >=
vtkWrapper_->GetNumberOfOutputPorts()))
237 msg <<
"[ttkUserInterfaceBase] Turning output #" << outputId <<
" ";
255 msg <<
"[ttkUserInterfaceBase] Switching transparency ";
281 surfaces_[i] = vtkPolyData::SafeDownCast(
void OnKeyPress() override
ttkUserInterfaceBase * userInterface_
virtual int OnKeyPress(vtkRenderWindowInteractor *interactor, std::string &key)=0
int execute() override
Set the arguments of your ttk module and execute it here.
vtkDataSetAlgorithm * vtkWrapper_
int save() const override
Save the output(s) of the TTK module.
std::vector< vtkDataSet * > inputs_
std::vector< vtkPolyData * > surfaces_
vtkSmartPointer< vtkRenderWindowInteractor > interactor_
ttkKeyHandler * keyHandler_
vtkSmartPointer< ttkCustomInteractor > customInteractor_
int switchOutput(const int &outputId)
vtkSmartPointer< vtkRenderer > renderer_
vtkSmartPointer< vtkPNGReader > pngReader_
std::vector< vtkSmartPointer< vtkActor > > mainActors_
vtkSmartPointer< vtkRenderWindow > renderWindow_
std::vector< vtkSmartPointer< vtkDataSetSurfaceFilter > > boundaryFilters_
int init(int &argc, char **argv) override
~ttkUserInterfaceBase() override
std::vector< int > hiddenOutputs_
std::vector< bool > visibleOutputs_
std::vector< vtkSmartPointer< ttkTextureMapFromField > > textureMapFromFields_
int exportScene(const std::string &fileName="output.wrl") const
ttkKeyHandler * getKeyHandler()
int updateScalarFieldTexture()
std::vector< vtkSmartPointer< vtkPolyDataMapper > > boundaryMappers_
vtkSmartPointer< vtkTexture > texture_
int setOption(const std::string &key, bool *value, const std::string &description="")
CommandLineParser parser_
virtual int init(int &argc, char **argv)
vtkStandardNewMacro(ttkCustomInteractor)
#define TTK_INSTALL_ASSETS_DIR
printMsg(debug::output::BOLD+" | | | | | . \\ | | (__| | / __/| |_| / __/|__ _|"+debug::output::ENDCOLOR, debug::Priority::PERFORMANCE, debug::LineMode::NEW, stream)