Changeset 2332 for trunk/packages/vizservers
- Timestamp:
- Aug 5, 2011, 9:20:18 AM (13 years ago)
- Location:
- trunk/packages/vizservers/vtkvis
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/vizservers/vtkvis/ColorMap.cpp
r2320 r2332 248 248 * \brief Perform linear interpolation of two color control points 249 249 */ 250 void ColorMap::lerp(double *result, const ControlPoint& cp1, const ControlPoint& cp2, double value) 250 void ColorMap::lerp(double *result, 251 const ControlPoint& cp1, 252 const ControlPoint& cp2, 253 double value) 251 254 { 252 255 double factor = (value - cp1.value) / (cp2.value - cp1.value); … … 259 262 * \brief Perform linear interpolation of two opacity control points 260 263 */ 261 void ColorMap::lerp(double *result, const OpacityControlPoint& cp1, const OpacityControlPoint& cp2, double value) 264 void ColorMap::lerp(double *result, 265 const OpacityControlPoint& cp1, 266 const OpacityControlPoint& cp2, 267 double value) 262 268 { 263 269 double factor = (value - cp1.value) / (cp2.value - cp1.value); -
trunk/packages/vizservers/vtkvis/Makefile.in
r2328 r2332 23 23 MKDIR_P = @MKDIR_P@ 24 24 25 GL_LIB_SPEC = -lGL 25 GL_LIB_SPEC = -lGL -lm 26 26 27 27 TCL_LIB_SPEC = @TCL_LIB_SPEC@ … … 51 51 USE_OFFSCREEN_RENDERING = yes 52 52 53 EXTRA_CFLAGS = -Wall -Wno-deprecated #vtk uses deprecated strstream header (instead of sstream) 53 #vtk uses deprecated strstream header (instead of sstream) 54 EXTRA_CFLAGS = -Wall -Wno-deprecated 54 55 DEFINES = 55 56 ifdef DEBUG -
trunk/packages/vizservers/vtkvis/RpGlyphs.cpp
r2330 r2332 31 31 _scaleFactor(1.0) 32 32 { 33 _backfaceCulling = true; 33 34 } 34 35 … … 175 176 initProp(); 176 177 177 getActor()->GetProperty()->BackfaceCullingOn();178 179 178 getActor()->SetMapper(_pdMapper); 180 179 _pdMapper->Update(); -
trunk/packages/vizservers/vtkvis/RpMolecule.cpp
r2330 r2332 29 29 _atomScaling(NO_ATOM_SCALING) 30 30 { 31 _backfaceCulling = true; 31 32 } 32 33 … … 48 49 if (_atomProp == NULL) { 49 50 _atomProp = vtkSmartPointer<vtkActor>::New(); 50 _atomProp->GetProperty()->BackfaceCullingOn(); 51 if (_backfaceCulling && _opacity == 1.0) 52 _atomProp->GetProperty()->BackfaceCullingOn(); 51 53 _atomProp->GetProperty()->EdgeVisibilityOff(); 52 54 _atomProp->GetProperty()->SetEdgeColor(_edgeColor[0], _edgeColor[1], _edgeColor[2]); … … 59 61 if (_bondProp == NULL) { 60 62 _bondProp = vtkSmartPointer<vtkActor>::New(); 61 _bondProp->GetProperty()->BackfaceCullingOn(); 63 if (_backfaceCulling && _opacity == 1.0) 64 _bondProp->GetProperty()->BackfaceCullingOn(); 62 65 _bondProp->GetProperty()->EdgeVisibilityOff(); 63 66 _bondProp->GetProperty()->SetEdgeColor(_edgeColor[0], _edgeColor[1], _edgeColor[2]); -
trunk/packages/vizservers/vtkvis/RpStreamlines.cpp
r2331 r2332 32 32 _seedVisible(true) 33 33 { 34 _backfaceCulling = true; 34 35 _seedColor[0] = 1.0f; 35 36 _seedColor[1] = 1.0f; … … 61 62 break; 62 63 case TUBES: 63 _linesActor->GetProperty()->BackfaceCullingOn(); 64 if (_backfaceCulling && _opacity == 1.0) 65 _linesActor->GetProperty()->BackfaceCullingOn(); 64 66 _linesActor->GetProperty()->SetRepresentationToSurface(); 65 67 _linesActor->GetProperty()->EdgeVisibilityOff(); … … 437 439 tubeFilter->SetRadius(radius); 438 440 _pdMapper->SetInputConnection(_lineFilter->GetOutputPort()); 439 _linesActor->GetProperty()->BackfaceCullingOn(); 441 if (_backfaceCulling && _opacity == 1.0) 442 _linesActor->GetProperty()->BackfaceCullingOn(); 440 443 _linesActor->GetProperty()->SetRepresentationToSurface(); 441 444 _linesActor->GetProperty()->LightingOn(); … … 506 509 507 510 /** 511 * \brief Set opacity of this object 512 */ 513 void Streamlines::setOpacity(double opacity) 514 { 515 _opacity = opacity; 516 if (_linesActor != NULL) { 517 _linesActor->GetProperty()->SetOpacity(_opacity); 518 if (_opacity < 1.0) 519 _linesActor->GetProperty()->BackfaceCullingOff(); 520 else if (_backfaceCulling && _lineType == TUBES) 521 _linesActor->GetProperty()->BackfaceCullingOn(); 522 } 523 if (_seedActor != NULL) { 524 _seedActor->GetProperty()->SetOpacity(_opacity); 525 } 526 } 527 528 /** 508 529 * \brief Turn on/off rendering of this Streamlines 509 530 */ -
trunk/packages/vizservers/vtkvis/RpStreamlines.h
r2328 r2332 45 45 46 46 virtual void setLighting(bool state); 47 47 48 virtual void setOpacity(double opacity); 49 48 50 virtual void setVisibility(bool state); 49 51 -
trunk/packages/vizservers/vtkvis/RpVtkDataSet.cpp
r2320 r2332 17 17 #include <vtkProperty.h> 18 18 #include <vtkPointData.h> 19 #include <vtkCellData.h> 19 20 #include <vtkLookupTable.h> 20 21 … … 28 29 _visible(true) 29 30 { 30 _dataRange[0] = 0;31 _dataRange[1] = 1;32 for (int i = 0; i < 6; i++) {33 _bounds[i] = 0;34 }35 31 } 36 32 … … 123 119 _dataSet->SetPipelineInformation(NULL); 124 120 125 _dataSet->GetScalarRange(_dataRange);126 _dataSet->GetBounds(_bounds);127 128 121 TRACE("DataSet class: %s", _dataSet->GetClassName()); 129 TRACE("Scalar Range: %.12e, %.12e", _dataRange[0], _dataRange[1]); 122 #ifdef WANT_TRACE 123 double dataRange[2]; 124 getDataRange(dataRange); 125 double bounds[6]; 126 getBounds(bounds); 127 #endif 128 TRACE("Scalar Range: %.12e, %.12e", dataRange[0], dataRange[1]); 130 129 TRACE("DataSet bounds: %g %g %g %g %g %g", 131 _bounds[0], _bounds[1],132 _bounds[2], _bounds[3],133 _bounds[4], _bounds[5]);130 bounds[0], bounds[1], 131 bounds[2], bounds[3], 132 bounds[4], bounds[5]); 134 133 return true; 135 134 } … … 144 143 _dataSet = ds; 145 144 _dataSet->SetPipelineInformation(NULL); 146 _dataSet->GetScalarRange(_dataRange);147 _dataSet->GetBounds(_bounds);148 145 149 146 TRACE("DataSet class: %s", _dataSet->GetClassName()); 150 TRACE("Scalar Range: %.12e, %.12e", _dataRange[0], _dataRange[1]); 147 #ifdef WANT_TRACE 148 double dataRange[2]; 149 getDataRange(dataRange); 150 double bounds[6]; 151 getBounds(bounds); 152 #endif 153 TRACE("Scalar Range: %.12e, %.12e", dataRange[0], dataRange[1]); 151 154 TRACE("DataSet bounds: %g %g %g %g %g %g", 152 _bounds[0], _bounds[1],153 _bounds[2], _bounds[3],154 _bounds[4], _bounds[5]);155 bounds[0], bounds[1], 156 bounds[2], bounds[3], 157 bounds[4], bounds[5]); 155 158 return true; 156 159 } … … 184 187 return NULL; 185 188 } 186 _dataSet->GetScalarRange(_dataRange);187 _dataSet->GetBounds(_bounds);188 189 189 190 TRACE("DataSet class: %s", _dataSet->GetClassName()); 190 TRACE("Scalar Range: %.12e, %.12e", _dataRange[0], _dataRange[1]); 191 #ifdef WANT_TRACE 192 double dataRange[2]; 193 getDataRange(dataRange); 194 double bounds[6]; 195 getBounds(bounds); 196 #endif 197 TRACE("Scalar Range: %.12e, %.12e", dataRange[0], dataRange[1]); 198 TRACE("DataSet bounds: %g %g %g %g %g %g", 199 bounds[0], bounds[1], 200 bounds[2], bounds[3], 201 bounds[4], bounds[5]); 191 202 return _dataSet; 192 203 } … … 197 208 bool DataSet::is2D() const 198 209 { 199 return (_bounds[4] == 0. && _bounds[4] == _bounds[5]); 210 double bounds[6]; 211 getBounds(bounds); 212 return (bounds[4] == 0. && bounds[4] == bounds[5]); 200 213 } 201 214 … … 219 232 * \brief Get the underlying VTK DataSet subclass class name 220 233 */ 221 const char *DataSet::getVtkType() 234 const char *DataSet::getVtkType() const 222 235 { 223 236 return _dataSet->GetClassName(); … … 225 238 226 239 /** 240 * \brief Set the ative scalar array to the named field 241 */ 242 bool DataSet::setActiveScalar(const char *name) 243 { 244 bool found = false; 245 if (_dataSet != NULL) { 246 if (_dataSet->GetPointData() != NULL) { 247 if (_dataSet->GetPointData()->SetActiveScalars(name)) 248 found = true; 249 } 250 if (_dataSet->GetCellData() != NULL) { 251 if (_dataSet->GetCellData()->SetActiveScalars(name)) 252 found = true; 253 } 254 } 255 return found; 256 } 257 258 /** 259 * \brief Set the ative vector array to the named field 260 */ 261 bool DataSet::setActiveVector(const char *name) 262 { 263 bool found = false; 264 if (_dataSet != NULL) { 265 if (_dataSet->GetPointData() != NULL) { 266 if (_dataSet->GetPointData()->SetActiveVectors(name)) 267 found = true; 268 } 269 if (_dataSet->GetCellData() != NULL) { 270 if (_dataSet->GetCellData()->SetActiveVectors(name)) 271 found = true; 272 } 273 } 274 return found; 275 } 276 277 /** 227 278 * \brief Get the range of scalar values in the DataSet 228 279 */ 229 void DataSet::getDataRange(double minmax[2]) 230 { 231 memcpy(minmax, _dataRange, sizeof(double)*2); 280 void DataSet::getDataRange(double minmax[2]) const 281 { 282 _dataSet->GetScalarRange(minmax); 283 } 284 285 /** 286 * \brief Get the range of scalar values (or vector magnitudes) for 287 * the named field in the DataSet 288 */ 289 void DataSet::getDataRange(double minmax[2], const char *fieldName) const 290 { 291 if (_dataSet == NULL) 292 return; 293 if (_dataSet->GetPointData() != NULL && 294 _dataSet->GetPointData()->GetArray(fieldName) != NULL) { 295 _dataSet->GetPointData()->GetArray(fieldName)->GetRange(minmax, -1); 296 } else if (_dataSet->GetCellData() != NULL && 297 _dataSet->GetCellData()->GetArray(fieldName) != NULL) { 298 _dataSet->GetCellData()->GetArray(fieldName)->GetRange(minmax, -1); 299 } else if (_dataSet->GetFieldData() != NULL && 300 _dataSet->GetFieldData()->GetArray(fieldName) != NULL) { 301 _dataSet->GetFieldData()->GetArray(fieldName)->GetRange(minmax, -1); 302 } 303 } 304 305 /** 306 * \brief Get the range of vector magnitudes in the DataSet 307 */ 308 void DataSet::getVectorMagnitudeRange(double minmax[2]) const 309 { 310 if (_dataSet == NULL) 311 return; 312 if (_dataSet->GetPointData() != NULL && 313 _dataSet->GetPointData()->GetVectors() != NULL) { 314 _dataSet->GetPointData()->GetVectors()->GetRange(minmax, -1); 315 } else if (_dataSet->GetCellData() != NULL && 316 _dataSet->GetCellData()->GetVectors() != NULL) { 317 _dataSet->GetCellData()->GetVectors()->GetRange(minmax, -1); 318 } 319 } 320 321 /** 322 * \brief Get the range of a vector component in the DataSet 323 */ 324 void DataSet::getVectorComponentRange(double minmax[2], int component) const 325 { 326 if (_dataSet == NULL) 327 return; 328 if (_dataSet->GetPointData() != NULL || 329 _dataSet->GetPointData()->GetVectors() != NULL) { 330 _dataSet->GetPointData()->GetVectors()->GetRange(minmax, component); 331 } else if (_dataSet->GetCellData() != NULL && 332 _dataSet->GetCellData()->GetVectors() != NULL) { 333 _dataSet->GetCellData()->GetVectors()->GetRange(minmax, component); 334 } 232 335 } 233 336 … … 235 338 * \brief Get the bounds the DataSet 236 339 */ 237 void DataSet::getBounds(double bounds[6]) 238 { 239 memcpy(bounds, _bounds, sizeof(double)*6);340 void DataSet::getBounds(double bounds[6]) const 341 { 342 _dataSet->GetBounds(bounds); 240 343 } 241 344 … … 247 350 * \return the value of the nearest point or 0 if no scalar data available 248 351 */ 249 double DataSet::getDataValue(double x, double y, double z) 352 double DataSet::getDataValue(double x, double y, double z) const 250 353 { 251 354 if (_dataSet == NULL) -
trunk/packages/vizservers/vtkvis/RpVtkDataSet.h
r2290 r2332 43 43 vtkDataSet *getVtkDataSet(); 44 44 45 const char *getVtkType() ;45 const char *getVtkType() const; 46 46 47 void getDataRange(double minmax[2]);47 bool setActiveScalar(const char *name); 48 48 49 void getBounds(double bounds[6]);49 bool setActiveVector(const char *name); 50 50 51 double getDataValue(double x, double y, double z); 51 void getDataRange(double minmax[2]) const; 52 53 void getDataRange(double minmax[2], const char *fieldName) const; 54 55 void getVectorMagnitudeRange(double minmax[2]) const; 56 57 void getVectorComponentRange(double minmax[2], int component) const; 58 59 void getBounds(double bounds[6]) const; 60 61 double getDataValue(double x, double y, double z) const; 52 62 53 63 void setVisibility(bool state); … … 60 70 std::string _name; 61 71 vtkSmartPointer<vtkDataSet> _dataSet; 62 double _dataRange[2];63 double _bounds[6];64 72 bool _visible; 65 73 }; -
trunk/packages/vizservers/vtkvis/RpVtkGraphicsObject.h
r2328 r2332 26 26 27 27 #include "RpVtkDataSet.h" 28 #include "Trace.h" 28 29 29 30 namespace Rappture { … … 39 40 _opacity(1.0), 40 41 _edgeWidth(1.0f), 41 _lighting(true) 42 _lighting(true), 43 _backfaceCulling(false) 42 44 { 43 45 _color[0] = 1.0f; … … 229 231 if (getActor() != NULL) { 230 232 getActor()->GetProperty()->SetOpacity(opacity); 233 if (_backfaceCulling && _opacity < 1.0) { 234 getActor()->GetProperty()->BackfaceCullingOff(); 235 TRACE("Backface culling off"); 236 } else if (_backfaceCulling && _opacity == 1.0) { 237 getActor()->GetProperty()->BackfaceCullingOn(); 238 TRACE("Backface culling on"); 239 } 231 240 } else if (getAssembly() != NULL) { 232 241 vtkProp3DCollection *props = getAssembly()->GetParts(); … … 236 245 if (vtkActor::SafeDownCast(prop) != NULL) { 237 246 vtkActor::SafeDownCast(prop)->GetProperty()->SetOpacity(opacity); 247 if (_backfaceCulling && _opacity < 1.0) { 248 vtkActor::SafeDownCast(prop)->GetProperty()->BackfaceCullingOff(); 249 TRACE("Backface culling off"); 250 } else if (_backfaceCulling && _opacity == 1.0) { 251 vtkActor::SafeDownCast(prop)->GetProperty()->BackfaceCullingOn(); 252 TRACE("Backface culling on"); 253 } 238 254 } 239 255 } … … 557 573 558 574 /** 575 * \brief Toggle backface culling of prop 576 */ 577 virtual void setBackfaceCulling(bool state) 578 { 579 _backfaceCulling = state; 580 if (state && _opacity < 1.0) 581 return; 582 if (getActor() != NULL) { 583 getActor()->GetProperty()->SetBackfaceCulling((state ? 1 : 0)); 584 } else if (getAssembly() != NULL) { 585 vtkProp3DCollection *props = getAssembly()->GetParts(); 586 vtkProp3D *prop; 587 props->InitTraversal(); 588 while ((prop = props->GetNextProp3D()) != NULL) { 589 if (vtkActor::SafeDownCast(prop) != NULL) { 590 vtkActor::SafeDownCast(prop)->GetProperty()->SetBackfaceCulling((state ? 1 : 0)); 591 } 592 } 593 } 594 } 595 596 /** 559 597 * \brief Subclasses need to implement setting clipping planes in their mappers 560 598 */ … … 575 613 if (!_lighting) 576 614 property->LightingOff(); 615 if (_backfaceCulling && _opacity == 1.0) { 616 property->BackfaceCullingOn(); 617 } 577 618 } 578 619 } … … 590 631 float _edgeWidth; 591 632 bool _lighting; 633 bool _backfaceCulling; 592 634 593 635 vtkSmartPointer<vtkProp> _prop; -
trunk/packages/vizservers/vtkvis/RpVtkRenderer.cpp
r2329 r2332 2069 2069 2070 2070 /** 2071 * \brief Set opacity of Glyphs for the givenDataSet2072 */ 2073 void Renderer::setGlyphs Opacity(const DataSetId& id, double opacity)2071 * \brief Set the visibility of polygon edges for the specified DataSet 2072 */ 2073 void Renderer::setGlyphsEdgeVisibility(const DataSetId& id, bool state) 2074 2074 { 2075 2075 GlyphsHashmap::iterator itr; … … 2089 2089 2090 2090 do { 2091 itr->second->setEdgeVisibility(state); 2092 } while (doAll && ++itr != _glyphs.end()); 2093 2094 _needsRedraw = true; 2095 } 2096 2097 /** 2098 * \brief Set the RGB polygon edge color for the specified DataSet 2099 */ 2100 void Renderer::setGlyphsEdgeColor(const DataSetId& id, float color[3]) 2101 { 2102 GlyphsHashmap::iterator itr; 2103 2104 bool doAll = false; 2105 2106 if (id.compare("all") == 0) { 2107 itr = _glyphs.begin(); 2108 doAll = true; 2109 } else { 2110 itr = _glyphs.find(id); 2111 } 2112 if (itr == _glyphs.end()) { 2113 ERROR("Glyphs not found: %s", id.c_str()); 2114 return; 2115 } 2116 2117 do { 2118 itr->second->setEdgeColor(color); 2119 } while (doAll && ++itr != _glyphs.end()); 2120 2121 _needsRedraw = true; 2122 } 2123 2124 /** 2125 * \brief Set the polygon edge width for the specified DataSet (may be a no-op) 2126 * 2127 * If the OpenGL implementation/hardware does not support wide lines, 2128 * this function may not have an effect. 2129 */ 2130 void Renderer::setGlyphsEdgeWidth(const DataSetId& id, float edgeWidth) 2131 { 2132 GlyphsHashmap::iterator itr; 2133 2134 bool doAll = false; 2135 2136 if (id.compare("all") == 0) { 2137 itr = _glyphs.begin(); 2138 doAll = true; 2139 } else { 2140 itr = _glyphs.find(id); 2141 } 2142 if (itr == _glyphs.end()) { 2143 ERROR("Glyphs not found: %s", id.c_str()); 2144 return; 2145 } 2146 2147 do { 2148 itr->second->setEdgeWidth(edgeWidth); 2149 } while (doAll && ++itr != _glyphs.end()); 2150 2151 _needsRedraw = true; 2152 } 2153 2154 /** 2155 * \brief Turn Glyphs lighting on/off for the specified DataSet 2156 */ 2157 void Renderer::setGlyphsLighting(const DataSetId& id, bool state) 2158 { 2159 GlyphsHashmap::iterator itr; 2160 2161 bool doAll = false; 2162 2163 if (id.compare("all") == 0) { 2164 itr = _glyphs.begin(); 2165 doAll = true; 2166 } else { 2167 itr = _glyphs.find(id); 2168 } 2169 if (itr == _glyphs.end()) { 2170 ERROR("Glyphs not found: %s", id.c_str()); 2171 return; 2172 } 2173 2174 do { 2175 itr->second->setLighting(state); 2176 } while (doAll && ++itr != _glyphs.end()); 2177 _needsRedraw = true; 2178 } 2179 2180 /** 2181 * \brief Set opacity of Glyphs for the given DataSet 2182 */ 2183 void Renderer::setGlyphsOpacity(const DataSetId& id, double opacity) 2184 { 2185 GlyphsHashmap::iterator itr; 2186 2187 bool doAll = false; 2188 2189 if (id.compare("all") == 0) { 2190 itr = _glyphs.begin(); 2191 doAll = true; 2192 } else { 2193 itr = _glyphs.find(id); 2194 } 2195 if (itr == _glyphs.end()) { 2196 ERROR("Glyphs not found: %s", id.c_str()); 2197 return; 2198 } 2199 2200 do { 2091 2201 itr->second->setOpacity(opacity); 2092 2202 } while (doAll && ++itr != _glyphs.end()); … … 2146 2256 } while (doAll && ++itr != _glyphs.end()); 2147 2257 2148 _needsRedraw = true;2149 }2150 2151 /**2152 * \brief Turn Glyphs lighting on/off for the specified DataSet2153 */2154 void Renderer::setGlyphsLighting(const DataSetId& id, bool state)2155 {2156 GlyphsHashmap::iterator itr;2157 2158 bool doAll = false;2159 2160 if (id.compare("all") == 0) {2161 itr = _glyphs.begin();2162 doAll = true;2163 } else {2164 itr = _glyphs.find(id);2165 }2166 if (itr == _glyphs.end()) {2167 ERROR("Glyphs not found: %s", id.c_str());2168 return;2169 }2170 2171 do {2172 itr->second->setLighting(state);2173 } while (doAll && ++itr != _glyphs.end());2174 2258 _needsRedraw = true; 2175 2259 } … … 6368 6452 6369 6453 /** 6454 * \brief Control the use of two sided lighting 6455 */ 6456 void Renderer::setUseTwoSidedLighting(bool state) 6457 { 6458 _renderer->SetTwoSidedLighting(state ? 1 : 0); 6459 _needsRedraw = true; 6460 } 6461 6462 /** 6370 6463 * \brief Control the use of the depth peeling algorithm for transparency 6371 6464 */ -
trunk/packages/vizservers/vtkvis/RpVtkRenderer.h
r2329 r2332 172 172 void setClipPlane(Axis axis, double ratio, int direction); 173 173 174 void setUseTwoSidedLighting(bool state); 175 174 176 void setUseDepthPeeling(bool state); 175 177 … … 281 283 282 284 Glyphs *getGlyphs(const DataSetId& id); 285 286 void setGlyphsEdgeVisibility(const DataSetId& id, bool state); 287 288 void setGlyphsEdgeColor(const DataSetId& id, float color[3]); 289 290 void setGlyphsEdgeWidth(const DataSetId& id, float edgeWidth); 283 291 284 292 void setGlyphsLighting(const DataSetId& id, bool state); -
trunk/packages/vizservers/vtkvis/RpVtkRendererCmd.cpp
r2329 r2332 1351 1351 1352 1352 static int 1353 GlyphsEdgeVisibilityOp(ClientData clientData, Tcl_Interp *interp, int objc, 1354 Tcl_Obj *const *objv) 1355 { 1356 bool state; 1357 if (GetBooleanFromObj(interp, objv[2], &state) != TCL_OK) { 1358 return TCL_ERROR; 1359 } 1360 if (objc == 4) { 1361 const char *name = Tcl_GetString(objv[3]); 1362 g_renderer->setGlyphsEdgeVisibility(name, state); 1363 } else { 1364 g_renderer->setGlyphsEdgeVisibility("all", state); 1365 } 1366 return TCL_OK; 1367 } 1368 1369 static int 1353 1370 GlyphsLightingOp(ClientData clientData, Tcl_Interp *interp, int objc, 1354 1371 Tcl_Obj *const *objv) … … 1363 1380 } else { 1364 1381 g_renderer->setGlyphsLighting("all", state); 1382 } 1383 return TCL_OK; 1384 } 1385 1386 static int 1387 GlyphsLineColorOp(ClientData clientData, Tcl_Interp *interp, int objc, 1388 Tcl_Obj *const *objv) 1389 { 1390 float color[3]; 1391 if (GetFloatFromObj(interp, objv[2], &color[0]) != TCL_OK || 1392 GetFloatFromObj(interp, objv[3], &color[1]) != TCL_OK || 1393 GetFloatFromObj(interp, objv[4], &color[2]) != TCL_OK) { 1394 return TCL_ERROR; 1395 } 1396 if (objc == 6) { 1397 const char *name = Tcl_GetString(objv[5]); 1398 g_renderer->setGlyphsEdgeColor(name, color); 1399 } else { 1400 g_renderer->setGlyphsEdgeColor("all", color); 1401 } 1402 return TCL_OK; 1403 } 1404 1405 static int 1406 GlyphsLineWidthOp(ClientData clientData, Tcl_Interp *interp, int objc, 1407 Tcl_Obj *const *objv) 1408 { 1409 float width; 1410 if (GetFloatFromObj(interp, objv[2], &width) != TCL_OK) { 1411 return TCL_ERROR; 1412 } 1413 if (objc == 4) { 1414 const char *name = Tcl_GetString(objv[3]); 1415 g_renderer->setGlyphsEdgeWidth(name, width); 1416 } else { 1417 g_renderer->setGlyphsEdgeWidth("all", width); 1365 1418 } 1366 1419 return TCL_OK; … … 1479 1532 {"colormap", 1, GlyphsColorMapOp, 3, 4, "colorMapName ?dataSetNme?"}, 1480 1533 {"delete", 1, GlyphsDeleteOp, 2, 3, "?dataSetName?"}, 1481 {"lighting", 1, GlyphsLightingOp, 3, 4, "bool ?dataSetName?"}, 1534 {"edges", 1, GlyphsEdgeVisibilityOp, 3, 4, "bool ?dataSetName?"}, 1535 {"lighting", 3, GlyphsLightingOp, 3, 4, "bool ?dataSetName?"}, 1536 {"linecolor", 5, GlyphsLineColorOp, 5, 6, "r g b ?dataSetName?"}, 1537 {"linewidth", 5, GlyphsLineWidthOp, 3, 4, "width ?dataSetName?"}, 1482 1538 {"opacity", 1, GlyphsOpacityOp, 3, 4, "value ?dataSetName?"}, 1483 1539 {"scale", 2, GlyphsScaleOp, 3, 4, "scaleFactor ?dataSetName?"}, … … 2957 3013 2958 3014 static int 3015 RendererTwoSidedLightingOp(ClientData clientData, Tcl_Interp *interp, int objc, 3016 Tcl_Obj *const *objv) 3017 { 3018 bool state; 3019 if (GetBooleanFromObj(interp, objv[2], &state) != TCL_OK) { 3020 return TCL_ERROR; 3021 } 3022 g_renderer->setUseTwoSidedLighting(state); 3023 return TCL_OK; 3024 } 3025 3026 static int 2959 3027 RendererRenderOp(ClientData clientData, Tcl_Interp *interp, int objc, 2960 3028 Tcl_Obj *const *objv) … … 2965 3033 2966 3034 static Rappture::CmdSpec rendererOps[] = { 2967 {"clipplane", 1, RendererClipPlaneOp, 5, 5, "axis ratio direction"}, 2968 {"depthpeel", 1, RendererDepthPeelingOp, 3, 3, "bool"}, 2969 {"render", 1, RendererRenderOp, 2, 2, ""} 3035 {"clipplane", 1, RendererClipPlaneOp, 5, 5, "axis ratio direction"}, 3036 {"depthpeel", 1, RendererDepthPeelingOp, 3, 3, "bool"}, 3037 {"light2side", 1, RendererTwoSidedLightingOp, 3, 3, "bool"}, 3038 {"render", 1, RendererRenderOp, 2, 2, ""} 2970 3039 }; 2971 3040 static int nRendererOps = NumCmdSpecs(rendererOps); -
trunk/packages/vizservers/vtkvis/protocol.txt
r2329 r2332 15 15 renderer depthpeel <bool> 16 16 Set use of depth peeling algorithm for transparency 17 renderer light2side <bool> 18 Toggle use of two-sided lighting (controls if backfaces are lit with a 19 flipped normal) 17 20 renderer render 18 21 Force a new image to be rendered - use for advancing animation … … 112 115 glyphs colormap <colorMapName> <?dataSetName?> 113 116 glyphs delete <?dataSetName?> 117 glyphs edges <bool> <?datasetName?> 114 118 glyphs lighting <bool> <?datasetName?> 119 glyphs linecolor <r> <g> <b> <?datasetName?> 120 glyphs linewidth <val> <?datasetName?> 115 121 glyphs opacity <val> <?datasetName?> 116 122 glyphs scale <scaleFactor> <?datasetName?>
Note: See TracChangeset
for help on using the changeset viewer.