Changeset 2951
- Timestamp:
- Apr 9, 2012 8:25:40 AM (12 years ago)
- Location:
- trunk/packages/vizservers/nanovis
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/vizservers/nanovis/Makefile.in
r2949 r2951 121 121 NvColorTableShader.o \ 122 122 NvEventLog.o \ 123 NvFlowVisRenderer.o \124 123 NvLIC.o \ 125 124 NvParticleAdvectionShader.o \ … … 179 178 ifdef NOTDEF 180 179 OBJS += DataLoader.o \ 180 NvFlowVisRenderer.o \ 181 181 ParticleEmitter.o \ 182 182 ParticleSystem.o \ -
trunk/packages/vizservers/nanovis/NvLIC.cpp
r2920 r2951 30 30 31 31 NvLIC::NvLIC(int size, int width, int height, int axis, 32 const Vector3&offset) :32 float offset) : 33 33 Renderable(Vector3(0.0f, 0.0f, 0.0f)), 34 34 _width(width), … … 265 265 case 0 : 266 266 // TBD.. 267 glTexCoord3f(_offset .x, 0., 0.); glVertex2f(0., 0.);268 glTexCoord3f(_offset .x, 1., 0.); glVertex2f(_size, 0.);269 glTexCoord3f(_offset .x, 1., 1.); glVertex2f(_size, _size);270 glTexCoord3f(_offset .x, 0., 1.); glVertex2f(0., _size);267 glTexCoord3f(_offset, 0., 0.); glVertex2f(0., 0.); 268 glTexCoord3f(_offset, 1., 0.); glVertex2f(_size, 0.); 269 glTexCoord3f(_offset, 1., 1.); glVertex2f(_size, _size); 270 glTexCoord3f(_offset, 0., 1.); glVertex2f(0., _size); 271 271 break; 272 272 case 1 : 273 273 // TBD.. 274 glTexCoord3f(0., _offset .y, 0.); glVertex2f(0., 0.);275 glTexCoord3f(1., _offset .y, 0.); glVertex2f(_size, 0.);276 glTexCoord3f(1., _offset .y, 1.); glVertex2f(_size, _size);277 glTexCoord3f(0., _offset .y, 1.); glVertex2f(0., _size);274 glTexCoord3f(0., _offset, 0.); glVertex2f(0., 0.); 275 glTexCoord3f(1., _offset, 0.); glVertex2f(_size, 0.); 276 glTexCoord3f(1., _offset, 1.); glVertex2f(_size, _size); 277 glTexCoord3f(0., _offset, 1.); glVertex2f(0., _size); 278 278 break; 279 279 case 2 : 280 glTexCoord3f(0., 0., _offset .z); glVertex2f(0., 0.);281 glTexCoord3f(1., 0., _offset .z); glVertex2f(_size, 0.);282 glTexCoord3f(1., 1., _offset .z); glVertex2f(_size, _size);283 glTexCoord3f(0., 1., _offset .z); glVertex2f(0., _size);280 glTexCoord3f(0., 0., _offset); glVertex2f(0., 0.); 281 glTexCoord3f(1., 0., _offset); glVertex2f(_size, 0.); 282 glTexCoord3f(1., 1., _offset); glVertex2f(_size, _size); 283 glTexCoord3f(0., 1., _offset); glVertex2f(0., _size); 284 284 break; 285 285 } … … 459 459 case 0: 460 460 glNormal3f(1, 0, 0); 461 glTexCoord2f(0, 0); glVertex3f(_offset .x, 0, 0);462 glTexCoord2f(1, 0); glVertex3f(_offset .x, 1, 0);463 glTexCoord2f(1, 1); glVertex3f(_offset .x, 1, 1);464 glTexCoord2f(0, 1); glVertex3f(_offset .x, 0, 1);461 glTexCoord2f(0, 0); glVertex3f(_offset, 0, 0); 462 glTexCoord2f(1, 0); glVertex3f(_offset, 1, 0); 463 glTexCoord2f(1, 1); glVertex3f(_offset, 1, 1); 464 glTexCoord2f(0, 1); glVertex3f(_offset, 0, 1); 465 465 break; 466 466 case 1: 467 467 glNormal3f(0, 1, 0); 468 glTexCoord2f(0, 0); glVertex3f(0, _offset .y, 0);469 glTexCoord2f(1, 0); glVertex3f(1, _offset .y, 0);470 glTexCoord2f(1, 1); glVertex3f(1, _offset .y, 1);471 glTexCoord2f(0, 1); glVertex3f(0, _offset .y, 1);468 glTexCoord2f(0, 0); glVertex3f(0, _offset, 0); 469 glTexCoord2f(1, 0); glVertex3f(1, _offset, 0); 470 glTexCoord2f(1, 1); glVertex3f(1, _offset, 1); 471 glTexCoord2f(0, 1); glVertex3f(0, _offset, 1); 472 472 break; 473 473 case 2: 474 474 glNormal3f(0, 0, 1); 475 glTexCoord2f(0, 0); glVertex3f(0, 0, _offset .z);476 glTexCoord2f(1, 0); glVertex3f(1, 0, _offset .z);477 glTexCoord2f(1, 1); glVertex3f(1, 1, _offset .z);478 glTexCoord2f(0, 1); glVertex3f(0, 1, _offset .z);475 glTexCoord2f(0, 0); glVertex3f(0, 0, _offset); 476 glTexCoord2f(1, 0); glVertex3f(1, 0, _offset); 477 glTexCoord2f(1, 1); glVertex3f(1, 1, _offset); 478 glTexCoord2f(0, 1); glVertex3f(0, 1, _offset); 479 479 break; 480 480 } … … 530 530 531 531 void 532 NvLIC::setOffset(float v) 533 { 534 switch (_axis) { 535 case 0 : _offset.x = v; break; 536 case 1 : _offset.y = v; break; 537 case 2 : _offset.z = v; break; 538 } 532 NvLIC::setOffset(float offset) 533 { 534 _offset = offset; 539 535 getSlice(); 540 536 } -
trunk/packages/vizservers/nanovis/NvLIC.h
r2920 r2951 32 32 public: 33 33 NvLIC(int size, int width, int height, int axis, 34 const Vector3&offset);34 float offset); 35 35 ~NvLIC(); 36 36 … … 100 100 // plane to fit the actual dimensions 101 101 Vector3 _origin; 102 Vector3 _offset; // [0,1] offset could be x, y, or z 103 // direction 102 float _offset; // [0,1] offset of _axis plane 104 103 int _axis; 105 104 -
trunk/packages/vizservers/nanovis/nanovis.cpp
r2930 r2951 133 133 Texture2D *NanoVis::legendTexture = NULL; 134 134 NvColorTableRenderer *NanoVis::colorTableRenderer = NULL; 135 135 #ifdef notdef 136 136 NvFlowVisRenderer *NanoVis::flowVisRenderer = NULL; 137 #endif 137 138 VelocityArrowsSlice *NanoVis::velocityArrowsSlice = NULL; 138 139 … … 149 150 150 151 Tcl_Interp *NanoVis::interp; 151 Tcl_DString NanoVis::cmdbuffer;152 152 153 153 //frame buffer for final rendering … … 236 236 // Image based flow visualization slice location 237 237 // FLOW 238 float NanoVis::_licSliceX = 0.5f; 239 float NanoVis::_licSliceY = 0.5f; 240 float NanoVis::_licSliceZ = 0.5f; 238 float NanoVis::_licSlice = 0.5f; 241 239 int NanoVis::_licAxis = 2; // z axis 242 240 243 staticvoid244 removeAllData()241 void 242 NanoVis::removeAllData() 245 243 { 246 244 // … … 365 363 { 366 364 TRACE("in doExit\n"); 367 removeAllData();365 NanoVis::removeAllData(); 368 366 369 367 NvShader::exitCg(); … … 555 553 resizeOffscreenBuffer(old_width, old_height); 556 554 555 delete legendTexture; 556 legendTexture = NULL; 557 557 TRACE("leaving renderLegend\n"); 558 delete legendTexture;559 558 return TCL_OK; 560 559 } … … 710 709 #endif 711 710 712 void NanoVis::initParticle()713 {714 flowVisRenderer->initialize();715 licRenderer->makePatterns();716 }717 718 711 static 719 712 void cgErrorCallback(void) … … 798 791 colorTableRenderer = new NvColorTableRenderer(); 799 792 colorTableRenderer->setFonts(fonts); 800 793 #ifdef notdef 801 794 flowVisRenderer = new NvFlowVisRenderer(NMESH, NMESH); 802 795 #endif 803 796 velocityArrowsSlice = new VelocityArrowsSlice; 804 797 805 licRenderer = new NvLIC(NMESH, NPIX, NPIX, _licAxis, 806 Vector3(_licSliceX, _licSliceY, _licSliceZ)); 798 licRenderer = new NvLIC(NMESH, NPIX, NPIX, _licAxis, _licSlice); 807 799 808 800 grid = new Grid(); … … 1343 1335 #endif 1344 1336 1345 staticvoid1346 draw3dAxis()1337 void 1338 NanoVis::draw3dAxis() 1347 1339 { 1348 1340 glPushAttrib(GL_ENABLE_BIT); … … 1761 1753 1762 1754 #ifdef notdef 1755 void NanoVis::initParticle() 1756 { 1757 flowVisRenderer->initialize(); 1758 licRenderer->makePatterns(); 1759 } 1760 1763 1761 static 1764 1762 void addVectorField(const char* filename, const char* vf_name, … … 2117 2115 2118 2116 // Read and execute as many commands as we can from stdin... 2119 2117 Tcl_DString cmdbuffer; 2118 Tcl_DStringInit(&cmdbuffer); 2120 2119 int nCommands = 0; 2121 2120 bool isComplete = false; … … 2373 2372 NvInitEventLog(); 2374 2373 #endif 2375 Tcl_DStringInit(&NanoVis::cmdbuffer);2376 2374 NanoVis::interp = initTcl(); 2377 2375 NanoVis::resizeOffscreenBuffer(NanoVis::winWidth, NanoVis::winHeight); -
trunk/packages/vizservers/nanovis/nanovis.h
r2930 r2951 79 79 static void displayOffscreenBuffer(); 80 80 static void display(); 81 static void draw3dAxis(); 81 82 static void idle(); 82 83 static void update(); 84 static void removeAllData(); 83 85 84 86 static void pan(float dx, float dy); … … 89 91 static void setVolumeRanges(); 90 92 static void setHeightmapRanges(); 91 93 #ifdef notdef 92 94 static void initParticle(); 93 95 #endif 94 96 static void ppmWrite(const char *prefix); 95 97 static void sendDataToClient(const char *command, const char *data, … … 155 157 static int renderWindow; 156 158 static unsigned char *screenBuffer; 159 static Texture2D *legendTexture; 157 160 static Grid *grid; 158 161 static R2Fonts *fonts; … … 161 164 static graphics::RenderContext *renderContext; 162 165 166 static Tcl_HashTable tfTable; 163 167 static Tcl_HashTable volumeTable; 164 165 static std::vector<NvVectorField *> flow;166 168 static Tcl_HashTable flowTable; 169 static Tcl_HashTable heightmapTable; 170 167 171 static double magMin, magMax; 168 172 static float xMin, xMax, yMin, yMax, zMin, zMax, wMin, wMax; 169 173 static float xOrigin, yOrigin, zOrigin; 170 174 175 static NvColorTableRenderer *colorTableRenderer; 171 176 static VolumeRenderer *volRenderer; 177 #ifdef notdef 172 178 static NvFlowVisRenderer *flowVisRenderer; 179 #endif 173 180 static VelocityArrowsSlice *velocityArrowsSlice; 174 181 static NvLIC *licRenderer; … … 183 190 #endif 184 191 185 static Tcl_HashTable tfTable;186 static Texture2D *legendTexture;187 static NvColorTableRenderer *colorTableRenderer;188 189 static std::vector<HeightMap *> heightMap;190 static Tcl_HashTable heightmapTable;191 192 192 static Tcl_Interp *interp; 193 static Tcl_DString cmdbuffer;194 193 195 194 private: 196 static float _licSliceX; 197 static float _licSliceY; 198 static float _licSliceZ; 199 static int _licAxis; /* 0:x, 1:y, 2:z */ 195 static float _licSlice; ///< Slice position [0,1] 196 static int _licAxis; ///< Slice axis: 0:x, 1:y, 2:z 200 197 201 198 //frame buffer for final rendering
Note: See TracChangeset
for help on using the changeset viewer.