Changeset 2814 for trunk/packages/vizservers
- Timestamp:
- Mar 6, 2012, 12:58:23 PM (13 years ago)
- Location:
- trunk/packages/vizservers/nanovis
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/vizservers/nanovis/ParticleSystem.cpp
r2809 r2814 79 79 void *ParticleSystem::dataLoadMain(void *data) 80 80 { 81 ParticleSystem * particleSystem = (ParticleSystem*)data;81 ParticleSystem *particleSystem = (ParticleSystem *)data; 82 82 CircularFifo<float*, 10>& queue = particleSystem->_queue; 83 83 … … 90 90 91 91 int curIndex = startIndex; 92 float flowWidth = particleSystem->_flowWidth;93 float flowHeight = particleSystem->_flowHeight;94 float flowDepth = particleSystem->_flowDepth;92 int flowWidth = particleSystem->_flowWidth; 93 int flowHeight = particleSystem->_flowHeight; 94 int flowDepth = particleSystem->_flowDepth; 95 95 96 96 const char* fileNameFormat = particleSystem->_fileNameFormat.c_str(); … … 108 108 sprintf(buff, fileNameFormat, curIndex); 109 109 //std::string path = vrFilePath::getInstance()->getPath(buff); 110 #ifdef WANT_TRACE 110 111 float t = clock() /(float) CLOCKS_PER_SEC; 112 #endif 111 113 LoadProcessedFlowRaw(buff, flowWidth, flowHeight, flowDepth, queue.array[tail]); 114 #ifdef WANT_TRACE 112 115 float ti = clock() / (float) CLOCKS_PER_SEC; 113 printf("%f\n",ti - t); 116 TRACE("LoadProcessedFlowRaw time: %f\n", ti - t); 117 #endif 114 118 queue.push(); 115 119 TRACE("%d loaded\n", curIndex); … … 1073 1077 #ifdef WANT_TRACE 1074 1078 float t = clock() /(float) CLOCKS_PER_SEC; 1079 #endif 1075 1080 _vectorFields[0]->updatePixels(data); 1081 #ifdef WANT_TRACE 1076 1082 float ti = clock() / (float) CLOCKS_PER_SEC; 1077 TRACE(" pixels %f\n",ti - t);1083 TRACE("updatePixels time: %f\n", ti - t); 1078 1084 #endif 1079 1085 _queue.pop(); … … 1174 1180 for (unsigned int i = 0; i < _emitters.size(); ++i) { 1175 1181 // TBD.. 1176 unsigned int numOfNewParticles = randomRange(_emitters[i]->_minNumOfNewParticles, _emitters[i]->_maxNumOfNewParticles) * deltaT;1182 unsigned int numOfNewParticles = (unsigned int)(randomRange(_emitters[i]->_minNumOfNewParticles, _emitters[i]->_maxNumOfNewParticles) * deltaT); 1177 1183 for (unsigned int k = 0; k < numOfNewParticles; ++k) { 1178 1184 float3 position = _emitters[i]->_position; -
trunk/packages/vizservers/nanovis/ParticleSystemFactory.cpp
r2805 r2814 114 114 pointSize = (float) atof(attrs[i + 1]); 115 115 } else if (!strcmp(attrs[i], "vector-field-x")) { 116 fieldWidth = (float) atof(attrs[i + 1]);116 fieldWidth = atoi(attrs[i + 1]); 117 117 } else if (!strcmp(attrs[i], "vector-field-y")) { 118 fieldHeight = (float) atof(attrs[i + 1]);118 fieldHeight = atoi(attrs[i + 1]); 119 119 } else if (!strcmp(attrs[i], "vector-field-z")) { 120 fieldDepth = (float) atof(attrs[i + 1]);120 fieldDepth = atoi(attrs[i + 1]); 121 121 } else if (!strcmp(attrs[i], "sort-enabled")) { 122 122 if (!strcmp(attrs[i + 1], "true")) -
trunk/packages/vizservers/nanovis/PointSet.cpp
r2798 r2814 52 52 int index; 53 53 float d = _max - _min; 54 for ( /*empty*/; c <= end; c = (PCA::Cluster*)((char *)c+sizeof(PCA::Cluster))){54 for (; c <= end; c = (PCA::Cluster*)((char *)c+sizeof(PCA::Cluster))){ 55 55 points = c->points; 56 56 numOfPoints = c->numOfPoints; 57 57 58 58 for (int i = 0; i < numOfPoints; ++i) { 59 index = ( points[i].value - _min) / d * (colorCount - 1);59 index = (int)((points[i].value - _min) / d * (colorCount - 1)); 60 60 if (index >= colorCount) { 61 61 index = colorCount - 1;
Note: See TracChangeset
for help on using the changeset viewer.