#include #include "vtkObjectFactory.h" #include #include #include #include #include #include #include #include // #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include //---------------------------------------------------------------------------- vtkStandardNewMacro( vtkKWDataBrowser ); vtkCxxRevisionMacro( vtkKWDataBrowser, "$Revision: 1.0 $"); //---------------------------------------------------------------------------- vtkKWDataBrowser::vtkKWDataBrowser() { this->ButtonLoadData = vtkKWPushButton::New(); this->ButtonColorByData = vtkKWPushButton::New(); this->ButtonColorByVectors = vtkKWPushButton::New(); this->ButtonColorByTensors = vtkKWPushButton::New(); this->ButtonProperty = vtkKWPushButton::New(); // this->DataListBox = vtkKWListBox::New(); this->DataListBox = vtkKWComboBox::New(); this->ButtonSetLookupTable = vtkKWColorPresetSelector::New(); this->VectorManager = vtkVectorVisuManager::New(); this->FiberManager = vtkFibersManager::New(); this->TensorManager = vtkTensorVisuManager::New(); this->LookUpTableId = 2; this->ScaleSet = vtkKWScaleSet::New(); this->ComboBoxSet = vtkKWComboBoxSet::New(); this->HSVColorSelector = vtkKWHSVColorSelector::New(); this->S_MaterialPropertyWidget = vtkKWSurfaceMaterialPropertyWidget::New(); //this->View = 0; } //---------------------------------------------------------------------------- vtkKWDataBrowser::~vtkKWDataBrowser() { this->ButtonLoadData->Delete(); this->ButtonColorByData->Delete(); this->DataListBox->Delete(); this->VectorManager->Delete(); this->FiberManager->Delete(); this->TensorManager->Delete(); this->ButtonSetLookupTable->Delete(); this->ButtonProperty->Delete(); this->HSVColorSelector->Delete(); this->ScaleSet->Delete(); this->ComboBoxSet->Delete(); this->S_MaterialPropertyWidget->Delete(); } //---------------------------------------------------------------------------- void vtkKWDataBrowser::CreateWidget() { // Check if already created if (this->IsCreated()) { vtkErrorMacro("class already created"); return; } // Call the superclass to create the whole widget this->Superclass::CreateWidget(); //this->SetLabelText ("Data Browser"); this->CreateDataList(); this->CreateButtons(); // Update according to the current metadataset this->Update(); // Pack this->Pack(); } //---------------------------------------------------------------------------- void vtkKWDataBrowser::CreateButtons() { this->ButtonLoadData->SetParent(this); this->ButtonLoadData->Create(); this->ButtonLoadData->SetImageToPixels(image_loadattributes, image_loadattributes_width, image_loadattributes_height, image_loadattributes_pixel_size, image_loadattributes_length); this->ButtonLoadData->SetCommand(this, "ButtonLoadDataCallBack"); this->ButtonLoadData->SetBalloonHelpString("Load some data..."); this->ButtonColorByData->SetParent(this); this->ButtonColorByData->Create(); this->ButtonColorByData->SetImageToPixels(image_applyattributes, image_applyattributes_width, image_applyattributes_height, image_applyattributes_pixel_size, image_applyattributes_length); this->ButtonColorByData->SetCommand(this, "ButtonColorByDataCallBack"); this->ButtonColorByData->SetBalloonHelpString("color by the selected data..."); this->ButtonColorByVectors->SetParent(this); this->ButtonColorByVectors->Create(); this->ButtonColorByVectors->SetImageToPixels(image_processvectors, image_processvectors_width, image_processvectors_height, image_processvectors_pixel_size, image_processvectors_length); this->ButtonColorByVectors->SetCommand(this, "ButtonColorByVectorsCallBack"); this->ButtonColorByVectors->SetBalloonHelpString("color by the vectors..."); this->ButtonColorByTensors->SetParent(this); this->ButtonColorByTensors->Create(); this->ButtonColorByTensors->SetImageToPixels(image_processvectors, image_processvectors_width, image_processvectors_height, image_processvectors_pixel_size, image_processvectors_length); this->ButtonColorByTensors->SetCommand(this, "ButtonColorByTensorsCallBack"); this->ButtonColorByTensors->SetBalloonHelpString("color by the tensors..."); this->ButtonProperty->SetParent(this); this->ButtonProperty->Create(); this->ButtonProperty->SetImageToPixels(image_properties, image_properties_width, image_properties_height, image_properties_pixel_size, image_properties_length); this->ButtonProperty->SetCommand(this, "ButtonPropertyCallBack"); this->ButtonProperty->SetBalloonHelpString("More Properties..."); this->ButtonSetLookupTable->SetParent(this); this->ButtonSetLookupTable->Create(); this->ButtonSetLookupTable->SetLabelText(""); this->ButtonSetLookupTable->GetWidget()->SetImageToPixels(image_lookuptable, image_lookuptable_width, image_lookuptable_height, image_lookuptable_pixel_size, image_lookuptable_length); this->ButtonSetLookupTable->SetPresetSelectedCommand(this, "ButtonSetLookupTableCallBack"); this->ButtonSetLookupTable->SetBalloonHelpString("Select a color map..."); this->HSVColorSelector->SetParent(this); this->HSVColorSelector->Create(); // this->HSVColorSelector->SetWidth (30); this->HSVColorSelector->SetHueSatWheelRadius (30); this->HSVColorSelector->SetBalloonHelpString("Color"); this->HSVColorSelector->SetSelectionChangingCommand (this, "ColorChangingCallback"); this->HSVColorSelector->SetSelectionChangedCommand (this, "ColorChangedCallback"); this->HSVColorSelector->InvokeCommandsWithRGBOn(); this->ScaleSet->SetParent(this); this->ScaleSet->PackHorizontallyOn(); this->ScaleSet->Create(); this->ScaleSet->SetBorderWidth(2); this->ScaleSet->SetReliefToGroove(); this->ScaleSet->SetWidgetsPadX(1); this->ScaleSet->SetWidgetsPadY(1); this->ScaleSet->SetPadX(1); this->ScaleSet->SetPadY(1); this->ScaleSet->SetMaximumNumberOfWidgetsInPackingDirection(2); this->OpacityScale = this->ScaleSet->AddWidget(0); this->OpacityScale->SetOrientationToHorizontal(); this->OpacityScale->SetLabelText("Opacity"); this->OpacityScale->SetRange (0,100); this->OpacityScale->SetResolution (1); this->OpacityScale->SetLength (95); this->OpacityScale->SetSliderLength (10); this->OpacityScale->SetActiveBackgroundColor (0.9,0.2,0.4); this->OpacityScale->SetBalloonHelpString("Opacity"); this->OpacityScale->SetValue (100); this->OpacityScale->SetCommand (this, "OpacityChangingCallback"); this->LineWidthScale = this->ScaleSet->AddWidget(1); this->LineWidthScale->SetOrientationToHorizontal(); this->LineWidthScale->SetLabelText("Line Width"); this->LineWidthScale->SetRange (1,10); this->LineWidthScale->SetResolution (1); this->LineWidthScale->SetLength (95); this->LineWidthScale->SetSliderLength (8); this->LineWidthScale->SetActiveBackgroundColor (0.9,0.2,0.4); this->LineWidthScale->SetBalloonHelpString("width"); this->LineWidthScale->SetValue (1); this->LineWidthScale->SetCommand (this, "LineWidthChangingCallback"); this->ComboBoxSet->SetParent(this); this->ComboBoxSet->PackHorizontallyOn(); this->ComboBoxSet->Create(); this->ComboBoxSet->SetBorderWidth(2); this->ComboBoxSet->SetReliefToGroove(); this->ComboBoxSet->SetWidgetsPadX(1); this->ComboBoxSet->SetWidgetsPadY(1); this->ComboBoxSet->SetPadX(1); this->ComboBoxSet->SetPadY(1); this->ComboBoxSet->SetMaximumNumberOfWidgetsInPackingDirection(2); this->SurfaceRepresentationComboBox = this->ComboBoxSet->AddWidget (0); this->SurfaceRepresentationComboBox->SetWidth (12); this->SurfaceRepresentationComboBox->ReadOnlyOn(); this->SurfaceRepresentationComboBox->SetValue("Representation..."); this->SurfaceRepresentationComboBox->AddValue("Solid"); this->SurfaceRepresentationComboBox->AddValue("Wireframe"); this->SurfaceRepresentationComboBox->AddValue("Points"); this->SurfaceRepresentationComboBox->SetCommand(this, "SurfaceRepresentationChangedCallBack"); this->InterpolationModeComboBox = this->ComboBoxSet->AddWidget (1); this->InterpolationModeComboBox->SetWidth (12); this->InterpolationModeComboBox->ReadOnlyOn(); this->InterpolationModeComboBox->SetValue("Interpolation..."); this->InterpolationModeComboBox->AddValue("Flat"); this->InterpolationModeComboBox->AddValue("Gouraud"); this->InterpolationModeComboBox->SetCommand(this, "InterpolationModeChangedCallBack"); this->S_MaterialPropertyWidget->SetParent(this); this->S_MaterialPropertyWidget->PopupModeOn(); this->S_MaterialPropertyWidget->Create(); this->S_MaterialPropertyWidget->GetPopupButton()->SetLabelPositionToTop(); this->S_MaterialPropertyWidget->SetPresetSize (25); this->S_MaterialPropertyWidget->SetPreviewSize(25); //this->S_MaterialPropertyWidget->AllowFrameToCollapseOff(); this->S_MaterialPropertyWidget->SetPropertyChangedCommand (this, "InvokeMetaDataSetModifiedCommand"); this->S_MaterialPropertyWidget->SetPropertyChangingCommand (this, "InvokeMetaDataSetModifiedCommand"); //this->S_MaterialPropertyWidget->SetWidth (120); } //---------------------------------------------------------------------------- void vtkKWDataBrowser::CreateDataList() { this->DataListBox->SetParent(this); this->DataListBox->Create(); this->DataListBox->SetWidth (17); this->DataListBox->ReadOnlyOn(); this->DataListBox->SetValue("Select Attributes"); this->DataListBox->AddValue("Default"); this->DataListBox->SetCommand(this, "SelectionChangedCallback"); // this->DataListBox->Create(); // this->DataListBox->SetReliefToGroove (); // this->DataListBox->SetBorderWidth (3); // this->DataListBox->SetBackgroundColor (1.0,1.0,1.0); // this->DataListBox->SetWidth(17); // this->DataListBox->SetHeight(8); // this->DataListBox->SetSelectionModeToSingle(); } //---------------------------------------------------------------------------- void vtkKWDataBrowser::Pack() { if (this->HSVColorSelector->IsCreated()) { this->Script( "grid %s -sticky nw -column 0 -row 0 -columnspan 3 -padx 5 -pady 5", this->HSVColorSelector->GetWidgetName()); } if (this->S_MaterialPropertyWidget->IsCreated()) { this->Script( "grid %s -sticky nw -column 2 -row 0 -padx 5 -pady 5", this->S_MaterialPropertyWidget->GetWidgetName()); } if (this->ScaleSet->IsCreated()) { this->Script( "grid %s -sticky nw -column 0 -row 1 -columnspan 3 -padx 5 -pady 5", this->ScaleSet->GetWidgetName()); } if (this->ComboBoxSet->IsCreated()) { this->Script( "grid %s -sticky nw -column 0 -row 2 -columnspan 3 -padx 5 -pady 5", this->ComboBoxSet->GetWidgetName()); } if (this->ButtonLoadData->IsCreated()) { this->Script( "grid %s -sticky nw -column 0 -row 3 -padx 5 -pady 5", this->ButtonLoadData->GetWidgetName()); } if (this->ButtonSetLookupTable->IsCreated()) { this->Script( "grid %s -sticky nw -column 1 -row 3 -padx 5 -pady 5", this->ButtonSetLookupTable->GetWidgetName()); } if (this->ButtonProperty->IsCreated()) { this->Script( "grid %s -sticky nw -column 2 -row 3 -padx 5 -pady 5", this->ButtonProperty->GetWidgetName()); } if (this->DataListBox->IsCreated()) { this->Script( "grid %s -sticky nw -column 0 -row 4 -columnspan 2 -padx 5 -pady 5", this->DataListBox->GetWidgetName()); } if (this->ButtonColorByData->IsCreated()) { this->Script( "grid %s -sticky nw -column 2 -row 4 -padx 5 -pady 5", this->ButtonColorByData->GetWidgetName()); } // if (this->ButtonColorByVectors->IsCreated()) // { // this->Script("pack %s -side top -anchor nw -padx 2 -pady 2", // this->ButtonColorByVectors->GetWidgetName()); // } // if (this->ButtonColorByTensors->IsCreated()) // { // this->Script("pack %s -side top -anchor nw -padx 2 -pady 2", // this->ButtonColorByTensors->GetWidgetName()); // } this->Script("grid columnconfigure %s 0 -weight 1", this->GetWidgetName()); this->Script("grid columnconfigure %s 1 -weight 1", this->GetWidgetName()); this->Script("grid columnconfigure %s 2 -weight 1", this->GetWidgetName()); } //---------------------------------------------------------------------------- void vtkKWDataBrowser::Update() { this->Superclass::Update(); this->PopulateDataList(); if (!this->MetaDataSet) return; if (!vtkProperty::SafeDownCast(this->MetaDataSet->GetProperty())) return; this->HSVColorSelector->SetSelectedColor (vtkMath::RGBToHSV (vtkProperty::SafeDownCast(this->MetaDataSet->GetProperty())->GetColor())); this->S_MaterialPropertyWidget->SetProperty (vtkProperty::SafeDownCast(this->MetaDataSet->GetProperty())); this->OpacityScale->SetValue ((double)(vtkProperty::SafeDownCast(this->MetaDataSet->GetProperty())->GetOpacity()*100)); this->LineWidthScale->SetValue ((double)(vtkProperty::SafeDownCast(this->MetaDataSet->GetProperty())->GetLineWidth())); } void vtkKWDataBrowser::PopulateDataList () { this->DataListBox->DeleteAllValues (); if (!this->MetaDataSet) return; vtkPointSet* pointset = vtkPointSet::SafeDownCast (this->MetaDataSet->GetDataSet()); if (pointset && pointset->GetNumberOfPoints()) this->DataListBox->AddValue ("Default"); vtkDataArrayCollection* arrays = vtkDataArrayCollection::New(); this->MetaDataSet->GetArrayCollection (arrays); for (int i=0; iGetNumberOfItems(); i++) { std::ostringstream os; os << "#" << i+1 <<" : "; if (arrays->GetItem(i)->GetName()) os<GetItem(i)->GetName(); this->DataListBox->AddValue (os.str().c_str()); } // if (!arrays->GetNumberOfItems()) // this->DataListBox->AddValue ("No Data."); arrays->Delete(); } void vtkKWDataBrowser::SelectionChangedCallback (const char* value) { // this->ButtonColorByDataCallBack(); } //---------------------------------------------------------------------------- void vtkKWDataBrowser::ButtonLoadDataCallBack() { if (!this->MetaDataSet) return; vtkKWLoadSaveDialog *dialog = vtkKWLoadSaveDialog::New() ; dialog->SetParent(this); dialog->Create(); dialog->MultipleSelectionOn(); dialog->RetrieveLastPathFromRegistry("DataPath"); dialog->SetTitle ("Open associated data file(s)..."); dialog->SetFileTypes ("{{all} {.*}}"); if ( dialog->Invoke () == 0 ) { dialog->Delete(); return ; } vtkMetaDataSetSequence* sequence = vtkMetaDataSetSequence::SafeDownCast (this->MetaDataSet); std::string seq_scalarname = "Some_Scalars"; if (sequence && (dialog->GetNumberOfFileNames() > 1)) { vtkKWSimpleEntryDialog* dialog2 = vtkKWSimpleEntryDialog::New(); dialog2->SetApplication (this->GetApplication()); dialog2->Create(); dialog2->SetTitle ("Scalar Name"); //dialog->GetEntry()->GetWidget()->SetRestrictValueToInteger(); dialog2->GetEntry()->SetLabelPositionToTop(); dialog2->GetEntry()->SetLabelText ("Your are adding scalars to a sequence.\nPlease set the name to use "); if ( dialog2->Invoke () == 0 ) { dialog2->Delete(); return; } seq_scalarname = dialog2->GetEntry()->GetWidget()->GetValue(); dialog2->Delete(); } for (int i=0; iGetNumberOfFileNames(); i++) { const char* filename = dialog->GetFileNames ()->GetValue (i); std::string name = vtksys::SystemTools::GetFilenameName (filename); try { if (sequence && (dialog->GetNumberOfFileNames() > 1)) { sequence->ReadPointData (i, filename, seq_scalarname.c_str()); if (i == 0) this->MetaDataSet->ReadPointData (filename, seq_scalarname.c_str()); } else { this->MetaDataSet->ReadPointData (filename, name.c_str()); } } catch (vtkErrorCode::ErrorIds) { vtkKWMessageDialog::PopupMessage(this->GetApplication(), this->GetParentTopLevel(), "Error", "Cannot open file !\nPlease check the log window for details.", vtkKWMessageDialog::ErrorIcon); } } dialog->SaveLastPathToRegistry("DataPath"); dialog->Delete(); this->Update(); } //---------------------------------------------------------------------------- void vtkKWDataBrowser::ButtonColorByDataCallBack() { if (!this->MetaDataSet) return; std::string name = this->DataListBox->GetValue(); if (strcmp(name.c_str(), "Default") == 0) { this->MetaDataSet->ScalarVisibilityOff(); this->InvokeMetaDataSetModifiedCommand(); return; } std::string arrayname = name.substr(5); vtkDataArray* array = this->MetaDataSet->GetArray(arrayname.c_str()); if (!array) { vtkWarningMacro(<<"Couldn't find attribute : "<GetApplication(), this->GetParentTopLevel(), "Warning", "Couldn't find attribute !\nPlease check the log window for details.", vtkKWMessageDialog::WarningIcon); return; } if (array->GetNumberOfComponents() == 3) { vtkKWMessageDialog* dialog = vtkKWMessageDialog::New(); dialog->SetApplication (this->GetApplication()); dialog->SetStyleToYesNo (); dialog->Create(); dialog->SetTitle("Warning !"); dialog->SetText("This attributes has 3 components, \nRepresent it as vector field ?"); if ( dialog->Invoke () == 1 ) { int ret = this->MetaDataSet->GetDataSet()->GetPointData()->SetActiveAttribute (array->GetName(), vtkDataSetAttributes::VECTORS); if (ret == -1) { ret = this->MetaDataSet->GetDataSet()->GetCellData()->SetActiveAttribute (array->GetName(), vtkDataSetAttributes::VECTORS); } if (ret > -1) { this->ButtonColorByVectorsCallBack(); return; } } } vtkLookupTable* lut = vtkLookupTableManager::GetLookupTable(this->LookUpTableId); array->SetLookupTable(lut); this->MetaDataSet->ColorByArray(array); // vtkKWPageView* page = this->ParentObject->GetPage(this->MetaDataSet->GetTag()); // if (page) // { // page->GetView1()->GetScalarBar()->SetLookupTable(lut); // page->GetView2()->GetScalarBar()->SetLookupTable(lut); // page->GetView3()->GetScalarBar()->SetLookupTable(lut); // page->GetView4()->GetScalarBar()->SetLookupTable(lut); // } lut->Delete(); this->MetaDataSet->ScalarVisibilityOn(); this->InvokeMetaDataSetModifiedCommand(); } void vtkKWDataBrowser::ButtonColorByVectorsCallBack() { if (!this->MetaDataSet || !this->MetaDataSet->GetDataSet() || ( !this->MetaDataSet->GetDataSet()->GetPointData()->GetVectors() && !this->MetaDataSet->GetDataSet()->GetCellData()->GetVectors()) || !this->ParentObject) return; vtkKWPageView* page = this->ParentObject->GetPage(this->MetaDataSet->GetTag()); if (!page) return; vtkProperty* property = vtkProperty::SafeDownCast (this->MetaDataSet->GetProperty()); if (property) property->SetOpacity(0.15); this->VectorManager->SetRenderWindowInteractor (page->GetView4()->GetRenderWindowInteractor()); this->VectorManager->SetInput(this->MetaDataSet->GetDataSet()); this->VectorManager->SetBoxWidget (true); std::vector list = page->AddPolyData (this->VectorManager->GetOutput2(), NULL, 1.5); for (unsigned int i=0; iSetProperty(this->VectorManager->GetActor()->GetProperty()); } page->GetView4()->AddActor (this->VectorManager->GetActor()); page->Render(); } void vtkKWDataBrowser::ButtonColorByTensorsCallBack() { if (!this->MetaDataSet || !this->MetaDataSet->GetDataSet() || !this->ParentObject) return; vtkKWPageView* page = this->ParentObject->GetPage(this->MetaDataSet->GetTag()); if (!page) return; this->VectorManager->SetRenderWindowInteractor (page->GetView4()->GetRenderWindowInteractor()); this->VectorManager->SetInput(this->MetaDataSet->GetDataSet()); this->VectorManager->SetBoxWidget (true); page->GetView4()->RemoveDataSet(this->MetaDataSet->GetDataSet()); //this->MetaDataSet->SetDataSet(this->VectorManager->GetOutput()); //page->AddDataSet(this->MetaDataSet->GetDataSet(), vtkProperty::SafeDownCast(this->MetaDataSet->GetProperty())); std::vector list = page->AddDataSet (this->VectorManager->GetOutput(), vtkProperty::SafeDownCast (this->MetaDataSet->GetProperty())); for (unsigned int j=0; jMetaDataSet->AddActor (list[j]); page->Render(); } void vtkKWDataBrowser::ButtonPropertyCallBack() { if (!this->MetaDataSet || !this->MetaDataSet->GetDataSet() || !this->ParentObject) return; vtkKWPageView* page = this->ParentObject->GetPage(this->MetaDataSet->GetTag()); if (!page) return; vtkKWDialog* dialog = vtkKWDialog::New(); dialog->SetApplication(this->GetApplication()); dialog->Create(); dialog->SetDisplayPositionToDefault(); dialog->SetPosition (100,100); dialog->SetTitle("Properties"); vtkKWSurfacePropertyWidget* infowidget = vtkKWSurfacePropertyWidget::New(); infowidget->SetParent(dialog->GetFrame()); infowidget->Create(); infowidget->SetProperty(vtkProperty::SafeDownCast(this->MetaDataSet->GetProperty())); infowidget->SetPropertyChangingCommand(page, "Render"); infowidget->SetPropertyChangedCommand(page, "Render"); this->GetApplication()->Script("pack %s -side top -anchor nw -expand y -padx 10 -pady 10", infowidget->GetWidgetName()); dialog->Invoke(); infowidget->Delete(); dialog->Delete(); } void vtkKWDataBrowser::ButtonSetLookupTableCallBack(const char* value) { std::cout<<"coloring : "<LookUpTableId = 6; if (strcmp (value, "Gray") == 0) this->LookUpTableId = 0; if (strcmp (value, "HSV") == 0) this->LookUpTableId = 2; if (strcmp (value, "Hot") == 0) this->LookUpTableId = 3; if (strcmp (value, "Cool") == 0) this->LookUpTableId = 9; this->ButtonColorByDataCallBack(); } void vtkKWDataBrowser::OpacityChangingCallback (double op) { if (!this->MetaDataSet) return; if (vtkProperty::SafeDownCast(this->MetaDataSet->GetProperty())) vtkProperty::SafeDownCast(this->MetaDataSet->GetProperty())->SetOpacity (op/100.0); this->InvokeMetaDataSetModifiedCommand(); } void vtkKWDataBrowser::ColorChangingCallback (double r, double g, double b) { if (!this->MetaDataSet) return; if (vtkProperty::SafeDownCast(this->MetaDataSet->GetProperty())) vtkProperty::SafeDownCast(this->MetaDataSet->GetProperty())->SetColor (r,g,b); this->InvokeMetaDataSetModifiedCommand(); } void vtkKWDataBrowser::ColorChangedCallback (double r, double g, double b) { if (!this->MetaDataSet) return; if (vtkProperty::SafeDownCast(this->MetaDataSet->GetProperty())) this->S_MaterialPropertyWidget->SetMaterialColor (r,g,b); this->InvokeMetaDataSetModifiedCommand(); } void vtkKWDataBrowser::SurfaceRepresentationChangedCallBack( const char* value) { if (!this->MetaDataSet) return; if (!vtkProperty::SafeDownCast(this->MetaDataSet->GetProperty())) return; if (strcmp (value, "Solid")==0) vtkProperty::SafeDownCast(this->MetaDataSet->GetProperty())->SetRepresentationToSurface(); else if (strcmp (value, "Wireframe")==0) vtkProperty::SafeDownCast(this->MetaDataSet->GetProperty())->SetRepresentationToWireframe(); else if (strcmp (value, "Points")==0) vtkProperty::SafeDownCast(this->MetaDataSet->GetProperty())->SetRepresentationToPoints(); this->InvokeMetaDataSetModifiedCommand(); } void vtkKWDataBrowser::InterpolationModeChangedCallBack( const char* value) { if (!this->MetaDataSet) return; if (!vtkProperty::SafeDownCast(this->MetaDataSet->GetProperty())) return; if (strcmp (value, "Flat")==0) vtkProperty::SafeDownCast(this->MetaDataSet->GetProperty())->SetInterpolationToFlat(); else if (strcmp (value, "Gouraud")==0) vtkProperty::SafeDownCast(this->MetaDataSet->GetProperty())->SetInterpolationToGouraud(); this->InvokeMetaDataSetModifiedCommand(); } void vtkKWDataBrowser::LineWidthChangingCallback (double width) { if (!this->MetaDataSet) return; if (vtkProperty::SafeDownCast(this->MetaDataSet->GetProperty())) { vtkProperty::SafeDownCast(this->MetaDataSet->GetProperty())->SetLineWidth (width); vtkProperty::SafeDownCast(this->MetaDataSet->GetProperty())->SetPointSize (width); } this->InvokeMetaDataSetModifiedCommand(); }