Changeset 2972 for trunk/packages/vizservers
- Timestamp:
- Apr 16, 2012 12:14:03 PM (12 years ago)
- Location:
- trunk/packages/vizservers
- Files:
-
- 3 deleted
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/vizservers/configure
r2886 r2972 16267 16267 16268 16268 16269 ac_config_files="$ac_config_files Makefile nanoscale/Makefile nanoscale/renderservers.tcl nanovis/Makefile nanovis/newmat11/Makefile nanovis/R2/src/Makefile nanovis/vr util/Makefile nanovis/vrmath/Makefile nanovis/imgLoaders/Makefile nanovis/transfer-function/Makefile pymolproxy/Makefile vtkvis/Doxyfile vtkvis/Makefile start_viz.sh start_nanoscale.sh"16269 ac_config_files="$ac_config_files Makefile nanoscale/Makefile nanoscale/renderservers.tcl nanovis/Makefile nanovis/newmat11/Makefile nanovis/R2/src/Makefile nanovis/vrmath/Makefile nanovis/imgLoaders/Makefile nanovis/transfer-function/Makefile pymolproxy/Makefile vtkvis/Doxyfile vtkvis/Makefile start_viz.sh start_nanoscale.sh" 16270 16270 16271 16271 cat >confcache <<\_ACEOF … … 16873 16873 "nanovis/newmat11/Makefile") CONFIG_FILES="$CONFIG_FILES nanovis/newmat11/Makefile" ;; 16874 16874 "nanovis/R2/src/Makefile") CONFIG_FILES="$CONFIG_FILES nanovis/R2/src/Makefile" ;; 16875 "nanovis/vrutil/Makefile") CONFIG_FILES="$CONFIG_FILES nanovis/vrutil/Makefile" ;;16876 16875 "nanovis/vrmath/Makefile") CONFIG_FILES="$CONFIG_FILES nanovis/vrmath/Makefile" ;; 16877 16876 "nanovis/imgLoaders/Makefile") CONFIG_FILES="$CONFIG_FILES nanovis/imgLoaders/Makefile" ;; -
trunk/packages/vizservers/configure.in
r2886 r2972 399 399 nanovis/newmat11/Makefile \ 400 400 nanovis/R2/src/Makefile \ 401 nanovis/vrutil/Makefile \402 401 nanovis/vrmath/Makefile \ 403 402 nanovis/imgLoaders/Makefile \ -
trunk/packages/vizservers/nanovis/Axis.h
r2953 r2972 4 4 5 5 #include <stdlib.h> 6 #include <string.h> 6 7 7 8 #include <cmath> -
trunk/packages/vizservers/nanovis/Makefile.in
r2967 r2972 44 44 VRMATH_LIB = $(VRMATH_DIR)/vrmath.a 45 45 VRMATH_LIB_SPEC = $(VRMATH_LIB) 46 VRUTIL_DIR = ./vrutil47 VRUTIL_INC_SPEC = -I$(srcdir)/$(VRUTIL_DIR)/include48 VRUTIL_LIB = $(VRUTIL_DIR)/vrutil.a49 VRUTIL_LIB_SPEC = $(VRUTIL_LIB)50 46 R2_DIR = ./R2 51 47 R2_INC_SPEC = -I$(srcdir)/$(R2_DIR)/include … … 69 65 $(MAT_LIB_SPEC) \ 70 66 $(VRMATH_LIB_SPEC) \ 71 $(VRUTIL_LIB_SPEC) \72 67 $(TCL_LIB_SPEC) \ 73 68 $(CG_LIB_SPEC) \ … … 84 79 $(MAT_INC_SPEC) \ 85 80 $(VRMATH_INC_SPEC) \ 86 $(VRUTIL_INC_SPEC) \87 81 $(TCL_INC_SPEC) \ 88 82 $(FF_INC_SPEC) \ … … 202 196 endif 203 197 204 .PHONY: all install install-resources install-shaders install-nanovis clean distclean newmat11 R2 imgloaders vrmath vrutiltransfer-function205 206 all: newmat11 R2 imgloaders vrmath vrutilnanovis198 .PHONY: all install install-resources install-shaders install-nanovis clean distclean newmat11 R2 imgloaders vrmath transfer-function 199 200 all: newmat11 R2 imgloaders vrmath nanovis 207 201 208 202 install: install-nanovis install-resources install-shaders … … 211 205 R2: $(R2_LIB) 212 206 vrmath: $(VRMATH_LIB) 213 vrutil: $(VRUTIL_LIB)214 207 imgloaders: $(IMG_LIB) 215 208 … … 220 213 $(MAKE) -C $(VRMATH_DIR) all 221 214 222 $(VRUTIL_LIB):223 $(MAKE) -C $(VRUTIL_DIR) all224 225 215 $(R2_LIB): 226 216 $(MAKE) -C $(R2_DIR)/src all … … 229 219 $(MAKE) -C $(IMG_DIR) all 230 220 231 nanovis: $(MAT_LIB) $(R2_LIB) $(IMG_LIB) $(VRMATH_LIB) $( VRUTIL_LIB) $(OBJS)221 nanovis: $(MAT_LIB) $(R2_LIB) $(IMG_LIB) $(VRMATH_LIB) $(OBJS) 232 222 $(CXX) $(CXX_SWITCHES) -o $@ $^ $(LIBS) 233 223 … … 268 258 $(MAKE) -C $(MAT_DIR) clean 269 259 $(MAKE) -C $(VRMATH_DIR) clean 270 $(MAKE) -C $(VRUTIL_DIR) clean271 260 $(MAKE) -C $(R2_DIR)/src clean 272 261 $(MAKE) -C $(IMG_DIR) clean … … 276 265 $(MAKE) -C $(MAT_DIR) distclean 277 266 $(MAKE) -C $(VRMATH_DIR) distclean 278 $(MAKE) -C $(VRUTIL_DIR) distclean279 267 $(MAKE) -C $(R2_DIR)/src distclean 280 268 $(MAKE) -C $(IMG_DIR) distclean -
trunk/packages/vizservers/nanovis/NvShader.cpp
r2971 r2972 52 52 CGprofile profile, const char *entryPoint) 53 53 { 54 const char *path = R2FilePath::getInstance()->getPath(fileName);55 if (path == NULL) {54 std::string path = R2FilePath::getInstance()->getPath(fileName); 55 if (path.empty()) { 56 56 ERROR("can't find program \"%s\"\n", fileName); 57 57 } 58 TRACE("cg program compiling: %s\n", path );58 TRACE("cg program compiling: %s\n", path.c_str()); 59 59 CGprogram program; 60 program = cgCreateProgramFromFile(context, CG_SOURCE, path , profile,60 program = cgCreateProgramFromFile(context, CG_SOURCE, path.c_str(), profile, 61 61 entryPoint, NULL); 62 62 cgGLLoadProgram(program); … … 65 65 ERROR("Error message: %s\n", cgGetLastListing(context)); 66 66 } 67 TRACE("successfully compiled program: %s\n", path); 68 delete [] path; 67 TRACE("successfully compiled program: %s\n", path.c_str()); 69 68 return program; 70 69 } -
trunk/packages/vizservers/nanovis/ParticleSystem.cpp
r2964 r2972 11 11 #include <Cg/cgGL.h> 12 12 13 #include <vrutil/vrFilePath.h> 13 #include <R2/R2FilePath.h> 14 14 15 #include <Image.h> 15 16 #include <ImageLoader.h> … … 83 84 if (tail != -1) { 84 85 sprintf(buff, fileNameFormat, curIndex); 85 //std::string path = vrFilePath::getInstance()->getPath(buff);86 //std::string path = R2FilePath::getInstance()->getPath(buff); 86 87 #ifdef WANT_TRACE 87 88 float t = clock() /(float) CLOCKS_PER_SEC; … … 284 285 } 285 286 286 std::string path = vrFilePath::getInstance()->getPath("arrows.bmp");287 std::string path = R2FilePath::getInstance()->getPath("arrows.bmp"); 287 288 288 289 if (!path.empty()) { … … 418 419 _context = NvShader::getCgContext(); 419 420 420 std::string path = vrFilePath::getInstance()->getPath("distance.cg");421 std::string path = R2FilePath::getInstance()->getPath("distance.cg"); 421 422 _distanceInitFP = 422 423 cgCreateProgramFromFile(_context, CG_SOURCE, path.c_str(), … … 435 436 cgGLLoadProgram(_distanceSortLookupFP); 436 437 437 path = vrFilePath::getInstance()->getPath("mergesort.cg");438 path = R2FilePath::getInstance()->getPath("mergesort.cg"); 438 439 _sortRecursionFP = 439 440 cgCreateProgramFromFile(_context, CG_SOURCE, path.c_str(), … … 453 454 _seStepParam = cgGetNamedParameter(_sortEndFP, "step"); 454 455 455 path = vrFilePath::getInstance()->getPath("passthrough.cg");456 path = R2FilePath::getInstance()->getPath("passthrough.cg"); 456 457 _passthroughFP = 457 458 cgCreateProgramFromFile(_context, CG_SOURCE, path.c_str(), … … 462 463 _biasParam = cgGetNamedParameter(_passthroughFP, "bias"); 463 464 464 path = vrFilePath::getInstance()->getPath("moveparticles.cg");465 path = R2FilePath::getInstance()->getPath("moveparticles.cg"); 465 466 _moveParticlesFP = 466 467 cgCreateProgramFromFile(_context, CG_SOURCE, path.c_str(), … … 474 475 _mpScale= cgGetNamedParameter(_moveParticlesFP, "scale"); 475 476 476 path = vrFilePath::getInstance()->getPath("particlevp.cg");477 path = R2FilePath::getInstance()->getPath("particlevp.cg"); 477 478 _particleVP = 478 479 cgCreateProgramFromFile(_context, CG_SOURCE, path.c_str(), … … 484 485 _mvCurrentTimeParam = cgGetNamedParameter(_particleVP, "currentTime"); 485 486 486 path = vrFilePath::getInstance()->getPath("particlefp.cg");487 path = R2FilePath::getInstance()->getPath("particlefp.cg"); 487 488 _particleFP = 488 489 cgCreateProgramFromFile(_context, CG_SOURCE, path.c_str(), … … 491 492 _vectorParticleParam = cgGetNamedParameter(_particleVP, "vfield"); 492 493 493 path = vrFilePath::getInstance()->getPath("moveparticles.cg");494 path = R2FilePath::getInstance()->getPath("moveparticles.cg"); 494 495 _initParticlePosFP = 495 496 cgCreateProgramFromFile(_context, CG_SOURCE, path.c_str(), … … 1603 1604 if (_drawBBoxEnabled) drawUnitBox(); 1604 1605 glColor3f(1, 1, 1); 1606 1605 1607 glDepthMask(GL_FALSE); 1606 1608 glEnable(GL_BLEND); … … 1609 1611 glBlendFunc(GL_SRC_ALPHA, GL_ONE); 1610 1612 #else 1611 glEnable(GL_ALPHA_TEST);1612 //glAlphaFunc(GL_GEQUAL, 0.5);1613 1613 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 1614 1614 #endif 1615 glEnable(GL_ALPHA_TEST); 1616 glAlphaFunc(GL_GREATER, 0.6); 1617 1615 1618 glEnable(GL_POINT_SPRITE_ARB); 1616 1619 glPointSize(_pointSize); … … 1619 1622 1620 1623 #ifndef TEST 1621 _arrows->activate(); //_arrows->bind(0);1624 _arrows->activate(); 1622 1625 glEnable(GL_TEXTURE_2D); 1623 //glPointParameterfARB( GL_POINT_FADE_THRESHOLD_SIZE_ARB, 60.0f ); 1624 glPointParameterfARB( GL_POINT_FADE_THRESHOLD_SIZE_ARB, 0.0f ); 1625 1626 glPointParameterfARB( GL_POINT_SIZE_MIN_ARB, 1.0f); 1627 glPointParameterfARB( GL_POINT_SIZE_MAX_ARB, 100.0f); 1628 glTexEnvf( GL_POINT_SPRITE_ARB, GL_COORD_REPLACE_ARB, GL_TRUE ); 1626 glPointParameterfARB(GL_POINT_FADE_THRESHOLD_SIZE_ARB, 0.0f); 1627 1628 glPointParameterfARB(GL_POINT_SIZE_MIN_ARB, 1.0f); 1629 glPointParameterfARB(GL_POINT_SIZE_MAX_ARB, 100.0f); 1630 glTexEnvf(GL_POINT_SPRITE_ARB, GL_COORD_REPLACE_ARB, GL_TRUE); 1629 1631 1630 1632 cgGLBindProgram(_particleVP); -
trunk/packages/vizservers/nanovis/ParticleSystemFactory.cpp
r2822 r2972 5 5 #include <expat.h> 6 6 7 #include < vrutil/vrFilePath.h>7 #include <R2/R2FilePath.h> 8 8 9 9 #include "ParticleSystemFactory.h" … … 144 144 char buff[256]; 145 145 sprintf(buff, fileName.c_str(), startIndex); 146 std::string path = vrFilePath::getInstance()->getPath(buff);146 std::string path = R2FilePath::getInstance()->getPath(buff); 147 147 if (path.size()) { 148 148 std::string dir; … … 169 169 } 170 170 } else { 171 std::string path = vrFilePath::getInstance()->getPath(fileName.c_str());171 std::string path = R2FilePath::getInstance()->getPath(fileName.c_str()); 172 172 _newParticleSystem = 173 173 new ParticleSystem(width, height, path.c_str(), -
trunk/packages/vizservers/nanovis/PointSetRenderer.cpp
r2953 r2972 17 17 { 18 18 _shader = new PointShader(); 19 const char *path = R2FilePath::getInstance()->getPath("particle2.bmp");20 if (path == NULL) {21 ERROR(" pointset file not found - %s\n", path);19 std::string path = R2FilePath::getInstance()->getPath("particle2.bmp"); 20 if (path.empty()) { 21 ERROR("Particle image not found\n"); 22 22 return; 23 23 } 24 24 25 25 ImageLoader *loader = ImageLoaderFactory::getInstance()->createLoader("bmp"); 26 Image *image = loader->load(path, Image::IMG_RGBA); 27 delete [] path; 26 Image *image = loader->load(path.c_str(), Image::IMG_RGBA); 28 27 unsigned char *bytes = (unsigned char *)image->getImageBuffer(); 29 28 if (bytes) { … … 40 39 4, image->getImageBuffer()); 41 40 } else { 42 ERROR(" fail to load image [%s]\n", "particle2.bmp");41 ERROR("Failed to load particle image\n"); 43 42 } 44 43 -
trunk/packages/vizservers/nanovis/R2/include/R2/R2FilePath.h
r2877 r2972 4 4 5 5 #include <list> 6 7 #include <R2/R2string.h> 6 #include <string> 8 7 9 8 class R2FilePath … … 17 16 * @return return full path of the file, but if not found, return "" 18 17 */ 19 const char *getPath(const char *fileName);18 std::string getPath(const char *fileName); 20 19 21 20 /** … … 31 30 32 31 private: 33 typedef std::list< R2string> R2stringList;34 typedef std::list< R2string>::iterator R2stringListIter;32 typedef std::list<std::string> StringList; 33 typedef std::list<std::string>::iterator StringListIter; 35 34 36 35 /// application directory 37 static R2string _curDirectory;36 static std::string _curDirectory; 38 37 39 38 /// R2FilePath instance … … 41 40 42 41 /// all default file paths 43 R2stringList _pathList;42 StringList _pathList; 44 43 }; 45 44 -
trunk/packages/vizservers/nanovis/R2/include/R2/R2Fonts.h
r2841 r2972 4 4 5 5 #include <vector> 6 #include <string> 6 7 7 8 #include <R2/R2.h> 8 9 #include <R2/R2Object.h> 9 #include <R2/R2string.h>10 10 11 11 class R2Fonts : public R2Object 12 12 { 13 13 struct R2FontAttributes { 14 char *_fontName;14 std::string _fontName; 15 15 int _textureWidth; 16 16 int _textureHeight; … … 29 29 R2CharInfo _chars[256]; 30 30 }; 31 31 32 32 typedef std::vector<R2FontAttributes> R2FontVector; 33 33 -
trunk/packages/vizservers/nanovis/R2/src/Makefile.in
r2896 r2972 44 44 R2IndexBuffer.o \ 45 45 R2Object.o \ 46 R2VertexBuffer.o \ 47 R2string.o 46 R2VertexBuffer.o 48 47 49 48 R2LIB = R2.a -
trunk/packages/vizservers/nanovis/R2/src/R2FilePath.cpp
r2857 r2972 13 13 #include "Trace.h" 14 14 15 R2string R2FilePath::_curDirectory;15 std::string R2FilePath::_curDirectory; 16 16 R2FilePath R2FilePath::_instance; 17 17 18 char seps[] = ":";18 static char seps[] = ":"; 19 19 20 20 R2FilePath::R2FilePath() … … 22 22 char buff[BUFSIZ+2]; 23 23 #ifdef _WIN32 24 _getcwd(buff, 255);24 _getcwd(buff, sizeof(buff)-1); 25 25 #else 26 if (getcwd(buff, BUFSIZ) == NULL) {26 if (getcwd(buff, sizeof(buff)-1) == NULL) { 27 27 ERROR("can't get current working directory\n"); 28 28 } … … 37 37 R2FilePath::setPath(const char *filePath) 38 38 { 39 char buff[25 5];39 char buff[256]; 40 40 41 41 if (filePath == NULL) { … … 55 55 if (*p == '/') { 56 56 if (*last == '/' || *last == '\\') { 57 _pathList.push_back( R2string(p));57 _pathList.push_back(std::string(p)); 58 58 } else { 59 _pathList.push_back( R2string(p) + "/");59 _pathList.push_back(std::string(p) + "/"); 60 60 } 61 61 } else { 62 62 if (*last == '/' || *last == '\\') { 63 _pathList.push_back(_curDirectory + R2string(p));63 _pathList.push_back(_curDirectory + std::string(p)); 64 64 } else { 65 _pathList.push_back(_curDirectory + R2string(p) + "/");65 _pathList.push_back(_curDirectory + std::string(p) + "/"); 66 66 } 67 67 } … … 76 76 } 77 77 78 const char * 78 std::string 79 79 R2FilePath::getPath(const char* fileName) 80 80 { 81 R2string path;81 std::string path; 82 82 83 R2stringListIter iter; 84 int nameLength = strlen(fileName); 85 for (iter = _pathList.begin(); iter != _pathList.end(); ++iter) { 86 char *path; 83 for (StringListIter iter = _pathList.begin(); 84 iter != _pathList.end(); ++iter) { 85 path = *iter + std::string(fileName); 87 86 88 path = new char[strlen((char *)(*iter)) + 1 + nameLength + 1]; 89 //sprintf(path, "%s/%s", (char *)(*iter), fileName); 90 sprintf(path, "%s%s", (char *)(*iter), fileName); 91 if (access(path, R_OK) == 0) { 87 if (access(path.c_str(), R_OK) == 0) { 92 88 return path; 89 } else { 90 path = ""; 93 91 } 94 delete [] path;95 92 } 96 return NULL;93 return path; 97 94 } 98 95 99 96 void 100 R2FilePath::setWorkingDirectory(int argc, const char **argv)97 R2FilePath::setWorkingDirectory(int argc, const char **argv) 101 98 { 102 char buff[25 5];99 char buff[256]; 103 100 104 101 strcpy(buff, argv[0]); 105 102 for (int i = strlen(buff) - 1; i >= 0; --i) { 106 103 if (buff[i] == '\\' || buff[i] == '/') { 107 buff[i] = '/'; 108 buff[i + 1] = '\0'; 104 buff[i] = '/'; 105 buff[i + 1] = '\0'; 109 106 break; 110 107 } -
trunk/packages/vizservers/nanovis/R2/src/R2Fonts.cpp
r2953 r2972 34 34 unsigned int i; 35 35 for (i = 0; i < _fonts.size(); ++i) { 36 if (strcmp(_fonts[i]._fontName , fontName) == 0) {36 if (strcmp(_fonts[i]._fontName.c_str(), fontName) == 0) { 37 37 _fontIndex = i; 38 38 break; … … 142 142 bool bSuccess = false; 143 143 144 const char *path = R2FilePath::getInstance()->getPath(fontFileName);145 if (path == NULL) {144 std::string path = R2FilePath::getInstance()->getPath(fontFileName); 145 if (path.empty()) { 146 146 return false; 147 147 } 148 std::ifstream fsInput(path , std::ios::binary);148 std::ifstream fsInput(path.c_str(), std::ios::binary); 149 149 if (fsInput) { 150 sFont._fontName = new char [strlen(fontName)+1]; 151 strcpy(sFont._fontName, fontName); 150 sFont._fontName = fontName; 152 151 153 152 // make sure this file is the correct type by checking the header … … 230 229 fsInput.close(); 231 230 } 232 delete [] path;233 231 return bSuccess; 234 232 } -
trunk/packages/vizservers/nanovis/VelocityArrowsSlice.cpp
r2964 r2972 62 62 createRenderTarget(); 63 63 64 const char *path = R2FilePath::getInstance()->getPath("arrows.bmp");65 if ( path != NULL) {64 std::string path = R2FilePath::getInstance()->getPath("arrows.bmp"); 65 if (!path.empty()) { 66 66 ImageLoader *loader = ImageLoaderFactory::getInstance()->createLoader("bmp"); 67 67 if (loader != NULL) { 68 Image *image = loader->load(path, Image::IMG_RGBA); 69 delete [] path; 68 Image *image = loader->load(path.c_str(), Image::IMG_RGBA); 70 69 if (image != NULL) { 71 70 unsigned char *bytes = (unsigned char *)image->getImageBuffer(); … … 79 78 delete image; 80 79 } else { 81 ERROR("Failed to load image: arrows.bmp\n");80 ERROR("Failed to load arrows image\n"); 82 81 } 83 82 delete loader; 84 83 } else { 85 delete [] path; 86 ERROR("Couldn't find loader for arrows.bmp\n"); 84 ERROR("Couldn't find loader for arrows image\n"); 87 85 } 88 86 } else { 89 ERROR("Couldn't find path to arrows.bmp\n");87 ERROR("Couldn't find arrows image\n"); 90 88 } 91 89 -
trunk/packages/vizservers/nanovis/VolumeRenderer.cpp
r2932 r2972 19 19 #include <sys/time.h> 20 20 21 #include <vector> 22 21 23 #include <GL/glew.h> 22 24 #include <GL/glut.h> … … 24 26 #include <tcl.h> 25 27 26 #include <vector>27 28 #include <R2/R2string.h>29 28 #include <R2/R2FilePath.h> 30 29 … … 45 44 initShaders(); 46 45 47 const char *path = R2FilePath::getInstance()->getPath("Font.bmp");48 if (path == NULL) {46 std::string path = R2FilePath::getInstance()->getPath("Font.bmp"); 47 if (path.empty()) { 49 48 ERROR("can't find Font.bmp\n"); 50 assert(path != NULL); 51 } 52 initFont(path); 53 delete [] path; 49 assert(!path.empty()); 50 } 51 initFont(path.c_str()); 54 52 _volumeInterpolator = new VolumeInterpolator(); 55 53 } -
trunk/packages/vizservers/nanovis/nanovis.cpp
r2962 r2972 47 47 #include <R2/R2FilePath.h> 48 48 #include <R2/R2Fonts.h> 49 50 #include <vrutil/vrFilePath.h>51 49 52 50 #include <BMPImageLoaderImpl.h> … … 781 779 doExit(1); 782 780 } 783 784 vrFilePath::getInstance()->setPath(path);785 781 786 782 ImageLoaderFactory::getInstance()->addLoaderImpl("bmp", new BMPImageLoaderImpl()); … … 2359 2355 2360 2356 R2FilePath::getInstance()->setWorkingDirectory(argc, (const char**) argv); 2361 vrFilePath::getInstance()->setWorkingDirectory(argc, (const char**) argv);2362 2357 2363 2358 #ifdef XINETD
Note: See TracChangeset
for help on using the changeset viewer.