Changeset 3211 for branches/Rappture 1.2
- Timestamp:
- Dec 18, 2012, 10:49:56 AM (12 years ago)
- Location:
- branches/Rappture 1.2/packages/vizservers/vtkvis
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Rappture 1.2/packages/vizservers/vtkvis/RpCutplane.cpp
r3205 r3211 158 158 // Map scalars through lookup table regardless of type 159 159 _mapper[i]->SetColorModeToMapScalars(); 160 //_mapper ->InterpolateScalarsBeforeMappingOn();160 //_mapper[i]->InterpolateScalarsBeforeMappingOn(); 161 161 } 162 162 _cutPlane[i] = vtkSmartPointer<vtkPlane>::New(); … … 375 375 } 376 376 377 void Cutplane::setInterpolateBeforeMapping(bool state) 378 { 379 for (int i = 0; i < 3; i++) { 380 if (_mapper[i] != NULL) { 381 _mapper[i]->SetInterpolateScalarsBeforeMapping((state ? 1 : 0)); 382 } 383 } 384 } 385 377 386 /** 378 387 * \brief Select a 2D slice plane from a 3D DataSet -
branches/Rappture 1.2/packages/vizservers/vtkvis/RpCutplane.h
r3177 r3211 66 66 void setSliceVisibility(Axis axis, bool state); 67 67 68 void setInterpolateBeforeMapping(bool state); 69 68 70 void setColorMode(ColorMode mode, DataSet::DataAttributeType type, 69 71 const char *name, double range[2] = NULL); -
branches/Rappture 1.2/packages/vizservers/vtkvis/RpHeightMap.cpp
r3205 r3211 470 470 } 471 471 472 void HeightMap::setInterpolateBeforeMapping(bool state) 473 { 474 if (_dsMapper != NULL) { 475 _dsMapper->SetInterpolateScalarsBeforeMapping((state ? 1 : 0)); 476 } 477 } 478 472 479 void HeightMap::setAspect(double aspect) 473 480 { -
branches/Rappture 1.2/packages/vizservers/vtkvis/RpHeightMap.h
r3189 r3211 72 72 } 73 73 74 void setInterpolateBeforeMapping(bool state); 75 74 76 void setNumContours(int numContours); 75 77 -
branches/Rappture 1.2/packages/vizservers/vtkvis/RpPseudoColor.cpp
r3205 r3211 220 220 } 221 221 222 void PseudoColor::setInterpolateBeforeMapping(bool state) 223 { 224 if (_dsMapper != NULL) { 225 _dsMapper->SetInterpolateScalarsBeforeMapping((state ? 1 : 0)); 226 } 227 } 228 222 229 void PseudoColor::updateRanges(Renderer *renderer) 223 230 { -
branches/Rappture 1.2/packages/vizservers/vtkvis/RpPseudoColor.h
r3177 r3211 48 48 virtual void setClippingPlanes(vtkPlaneCollection *planes); 49 49 50 void setInterpolateBeforeMapping(bool state); 51 50 52 void setColorMode(ColorMode mode, DataSet::DataAttributeType type, 51 53 const char *name, double range[2] = NULL); -
branches/Rappture 1.2/packages/vizservers/vtkvis/RpVtkRenderer.cpp
r3208 r3211 533 533 _cubeAxesActor->SetViewAngleLODThreshold(0); 534 534 _cubeAxesActor->SetEnableViewAngleLOD(0); 535 _cubeAxesActor->SetScreenSize(10.0); 535 // Attempt to set font sizes for 2D (this currently doesn't work) 536 for (int i = 0; i < 3; i++) { 537 _cubeAxesActor->GetTitleTextProperty(i)->SetFontSize(14); 538 _cubeAxesActor->GetLabelTextProperty(i)->SetFontSize(12); 539 } 540 // Set font pixel size for 3D 541 _cubeAxesActor->SetScreenSize(8.0); 536 542 #endif 537 543 _cubeAxesActor->SetBounds(0, 1, 0, 1, 0, 1); -
branches/Rappture 1.2/packages/vizservers/vtkvis/RpVtkRenderer.h
r3205 r3211 453 453 const char *name, double range[2] = NULL); 454 454 455 void setCutplaneInterpolateBeforeMapping(const DataSetId& id, bool state); 456 455 457 // Cylinders 456 458 … … 499 501 void setHeightMapContourList(const DataSetId& id, const std::vector<double>& contours); 500 502 503 void setHeightMapInterpolateBeforeMapping(const DataSetId& id, bool state); 504 501 505 void setHeightMapContourSurfaceVisibility(const DataSetId& id, bool state); 502 506 … … 554 558 DataSet::DataAttributeType type, 555 559 const char *name, double range[2] = NULL); 560 561 void setPseudoColorInterpolateBeforeMapping(const DataSetId& id, bool state); 556 562 557 563 // Spheres -
branches/Rappture 1.2/packages/vizservers/vtkvis/RpVtkRendererCmd.cpp
r3196 r3211 2684 2684 2685 2685 static int 2686 CutplanePreInterpOp(ClientData clientData, Tcl_Interp *interp, int objc, 2687 Tcl_Obj *const *objv) 2688 { 2689 bool state; 2690 if (GetBooleanFromObj(interp, objv[2], &state) != TCL_OK) { 2691 return TCL_ERROR; 2692 } 2693 if (objc == 4) { 2694 const char *name = Tcl_GetString(objv[3]); 2695 g_renderer->setCutplaneInterpolateBeforeMapping(name, state); 2696 } else { 2697 g_renderer->setCutplaneInterpolateBeforeMapping("all", state); 2698 } 2699 return TCL_OK; 2700 } 2701 2702 static int 2686 2703 CutplaneScaleOp(ClientData clientData, Tcl_Interp *interp, int objc, 2687 2704 Tcl_Obj *const *objv) … … 2812 2829 {"orient", 2, CutplaneOrientOp, 6, 7, "qw qx qy qz ?dataSetName?"}, 2813 2830 {"outline", 2, CutplaneOutlineOp, 3, 4, "bool ?dataSetName?"}, 2814 {"pos", 1, CutplanePositionOp, 5, 6, "x y z ?dataSetName?"}, 2831 {"pos", 2, CutplanePositionOp, 5, 6, "x y z ?dataSetName?"}, 2832 {"preinterp", 2, CutplanePreInterpOp, 3, 4, "bool ?dataSetName?"}, 2815 2833 {"scale", 2, CutplaneScaleOp, 5, 6, "sx sy sz ?dataSetName?"}, 2816 2834 {"slice", 2, CutplaneVolumeSliceOp, 4, 5, "axis ratio ?dataSetName?"}, … … 4713 4731 4714 4732 static int 4733 HeightMapPreInterpOp(ClientData clientData, Tcl_Interp *interp, int objc, 4734 Tcl_Obj *const *objv) 4735 { 4736 bool state; 4737 if (GetBooleanFromObj(interp, objv[2], &state) != TCL_OK) { 4738 return TCL_ERROR; 4739 } 4740 if (objc == 4) { 4741 const char *name = Tcl_GetString(objv[3]); 4742 g_renderer->setHeightMapInterpolateBeforeMapping(name, state); 4743 } else { 4744 g_renderer->setHeightMapInterpolateBeforeMapping("all", state); 4745 } 4746 return TCL_OK; 4747 } 4748 4749 static int 4715 4750 HeightMapScaleOp(ClientData clientData, Tcl_Interp *interp, int objc, 4716 4751 Tcl_Obj *const *objv) … … 4812 4847 {"opacity", 2, HeightMapOpacityOp, 3, 4, "value ?dataSetName?"}, 4813 4848 {"orient", 2, HeightMapOrientOp, 6, 7, "qw qx qy qz ?dataSetName?"}, 4814 {"pos", 1, HeightMapPositionOp, 5, 6, "x y z ?dataSetName?"}, 4849 {"pos", 2, HeightMapPositionOp, 5, 6, "x y z ?dataSetName?"}, 4850 {"preinterp", 2, HeightMapPreInterpOp, 3, 4, "bool ?dataSetName?"}, 4815 4851 {"scale", 2, HeightMapScaleOp, 5, 6, "sx sy sz ?dataSetName?"}, 4816 4852 {"slice", 2, HeightMapVolumeSliceOp, 4, 5, "axis ratio ?dataSetName?"}, … … 6728 6764 6729 6765 static int 6766 PseudoColorPreInterpOp(ClientData clientData, Tcl_Interp *interp, int objc, 6767 Tcl_Obj *const *objv) 6768 { 6769 bool state; 6770 if (GetBooleanFromObj(interp, objv[2], &state) != TCL_OK) { 6771 return TCL_ERROR; 6772 } 6773 if (objc == 4) { 6774 const char *name = Tcl_GetString(objv[3]); 6775 g_renderer->setPseudoColorInterpolateBeforeMapping(name, state); 6776 } else { 6777 g_renderer->setPseudoColorInterpolateBeforeMapping("all", state); 6778 } 6779 return TCL_OK; 6780 } 6781 6782 static int 6730 6783 PseudoColorScaleOp(ClientData clientData, Tcl_Interp *interp, int objc, 6731 6784 Tcl_Obj *const *objv) … … 6792 6845 {"opacity", 2, PseudoColorOpacityOp, 3, 4, "value ?dataSetName?"}, 6793 6846 {"orient", 2, PseudoColorOrientOp, 6, 7, "qw qx qy qz ?dataSetName?"}, 6794 {"pos", 1, PseudoColorPositionOp, 5, 6, "x y z ?dataSetName?"}, 6847 {"pos", 2, PseudoColorPositionOp, 5, 6, "x y z ?dataSetName?"}, 6848 {"preinterp", 2, PseudoColorPreInterpOp, 3, 4, "bool ?dataSetName?"}, 6795 6849 {"scale", 1, PseudoColorScaleOp, 5, 6, "sx sy sz ?dataSetName?"}, 6796 6850 {"visible", 1, PseudoColorVisibleOp, 3, 4, "bool ?dataSetName?"}, -
branches/Rappture 1.2/packages/vizservers/vtkvis/RpVtkRendererGraphicsObjs.cpp
r3203 r3211 929 929 } 930 930 931 void Renderer::setCutplaneInterpolateBeforeMapping(const DataSetId& id, bool state) 932 { 933 CutplaneHashmap::iterator itr; 934 935 bool doAll = false; 936 937 if (id.compare("all") == 0) { 938 itr = _cutplanes.begin(); 939 doAll = true; 940 } else { 941 itr = _cutplanes.find(id); 942 } 943 944 if (itr == _cutplanes.end()) { 945 ERROR("Cutplane not found: %s", id.c_str()); 946 return; 947 } 948 949 do { 950 itr->second->setInterpolateBeforeMapping(state); 951 } while (doAll && ++itr != _cutplanes.end()); 952 953 _needsRedraw = true; 954 } 955 931 956 /** 932 957 * \brief Create a new Cylinder and associate it with an ID … … 1479 1504 } 1480 1505 1506 void Renderer::setHeightMapInterpolateBeforeMapping(const DataSetId& id, bool state) 1507 { 1508 HeightMapHashmap::iterator itr; 1509 1510 bool doAll = false; 1511 1512 if (id.compare("all") == 0) { 1513 itr = _heightMaps.begin(); 1514 doAll = true; 1515 } else { 1516 itr = _heightMaps.find(id); 1517 } 1518 if (itr == _heightMaps.end()) { 1519 ERROR("HeightMap not found: %s", id.c_str()); 1520 return; 1521 } 1522 1523 do { 1524 itr->second->setInterpolateBeforeMapping(state); 1525 } while (doAll && ++itr != _heightMaps.end()); 1526 1527 _needsRedraw = true; 1528 } 1529 1481 1530 /** 1482 1531 * \brief Turn on/off rendering height map contour lines for the given DataSet … … 2014 2063 do { 2015 2064 itr->second->setColorMode(mode, name, range); 2065 } while (doAll && ++itr != _pseudoColors.end()); 2066 2067 _needsRedraw = true; 2068 } 2069 2070 void Renderer::setPseudoColorInterpolateBeforeMapping(const DataSetId& id, bool state) 2071 { 2072 PseudoColorHashmap::iterator itr; 2073 2074 bool doAll = false; 2075 2076 if (id.compare("all") == 0) { 2077 itr = _pseudoColors.begin(); 2078 doAll = true; 2079 } else { 2080 itr = _pseudoColors.find(id); 2081 } 2082 if (itr == _pseudoColors.end()) { 2083 ERROR("PseudoColor not found: %s", id.c_str()); 2084 return; 2085 } 2086 2087 do { 2088 itr->second->setInterpolateBeforeMapping(state); 2016 2089 } while (doAll && ++itr != _pseudoColors.end()); 2017 2090
Note: See TracChangeset
for help on using the changeset viewer.