Changeset 4889 for nanovis/branches/1.1
- Timestamp:
- Dec 19, 2014, 10:00:34 PM (10 years ago)
- Location:
- nanovis/branches/1.1
- Files:
-
- 22 deleted
- 83 edited
- 22 copied
Legend:
- Unmodified
- Added
- Removed
-
nanovis/branches/1.1
- Property svn:mergeinfo changed
/trunk/packages/vizservers/nanovis merged: 3611-3614,3617-3618
- Property svn:mergeinfo changed
-
nanovis/branches/1.1/Axis.cpp
r3502 r4889 12 12 13 13 #include "Axis.h" 14 15 using namespace nv; 14 16 15 17 inline bool DEFINED(double x) { -
nanovis/branches/1.1/Axis.h
r3502 r4889 5 5 * Authors: George A. Howlett <gah@purdue.edu> 6 6 */ 7 #ifndef AXIS_H8 #define AXIS_H7 #ifndef NV_AXIS_H 8 #define NV_AXIS_H 9 9 10 10 #include <stdlib.h> … … 19 19 #define NAN (std::numeric_limits<double>::quiet_NaN()) 20 20 #endif 21 22 namespace nv { 21 23 22 24 class Axis; … … 409 411 }; 410 412 413 } 414 411 415 #endif -
nanovis/branches/1.1/AxisRange.h
r3502 r4889 5 5 * Authors: George A. Howlett <gah@purdue.edu> 6 6 */ 7 #ifndef AXIS_RANGE_H8 #define AXIS_RANGE_H7 #ifndef NV_AXIS_RANGE_H 8 #define NV_AXIS_RANGE_H 9 9 10 10 #include <string.h> 11 12 namespace nv { 11 13 12 14 class AxisRange … … 81 83 }; 82 84 85 } 86 83 87 #endif -
nanovis/branches/1.1/BucketSort.cpp
r3502 r4889 5 5 */ 6 6 7 #include <vrmath/Vector3f.h> 8 #include <vrmath/Matrix4x4d.h> 9 7 10 #include "BucketSort.h" 8 11 9 12 using namespace PCA; 10 11 #include <vrmath/Vector3f.h> 12 #include <vrmath/Matrix4x4d.h> 13 using namespace vrmath; 13 14 14 15 void … … 23 24 { 24 25 if (clusterAccel == 0) { 25 26 return; 26 27 } 27 28 Cluster* cluster = clusterAccel->startPointerCluster[level - 1]; … … 29 30 Cluster* end = &(cluster[clusterAccel->numOfClusters[level - 1] - 1]); 30 31 31 Vector3f pos;32 32 for (; c <= end; c = (Cluster*) ((char *)c + sizeof(Cluster))) { 33 pos = cameraMat.transform(c->centroid); 34 addBucket(c, pos.length()*_invMaxLength); 33 Vector4f pt = cameraMat.transform(Vector4f(c->centroid, 1)); 34 Vector3f pos(pt.x, pt.y, pt.z); 35 addBucket(c, pos.length()*_invMaxLength); 35 36 } 36 37 } -
nanovis/branches/1.1/BucketSort.h
r3502 r4889 4 4 * 5 5 */ 6 #ifndef BUCKETSORT_H7 #define BUCKETSORT_H6 #ifndef PCA_BUCKETSORT_H 7 #define PCA_BUCKETSORT_H 8 8 9 9 #include <vector> -
nanovis/branches/1.1/Chain.cpp
r2923 r4889 27 27 28 28 #include "Chain.h" 29 30 using namespace nv; 29 31 30 32 typedef int (QSortCompareProc) (const void *, const void *); -
nanovis/branches/1.1/Chain.h
r2923 r4889 22 22 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 23 */ 24 #ifndef CHAIN_H 25 #define CHAIN_H 24 #ifndef NV_CHAIN_H 25 #define NV_CHAIN_H 26 27 namespace nv { 26 28 27 29 /** … … 143 145 }; 144 146 147 } 148 145 149 #endif -
nanovis/branches/1.1/CircularQueue.h
r2877 r4889 14 14 * @author Kjell Hedström, hedstrom@kjellkod.cc */ 15 15 16 #ifndef CIRCULARFIFO_H _17 #define CIRCULARFIFO_H _16 #ifndef CIRCULARFIFO_H 17 #define CIRCULARFIFO_H 18 18 19 19 /** Circular Fifo (a.k.a. Circular Buffer) … … 181 181 } 182 182 183 #endif /* CIRCULARFIFO_H_ */183 #endif -
nanovis/branches/1.1/CmdProc.h
r3502 r4889 4 4 * 5 5 */ 6 /* 7 *------------------------------------------------------------------------------- 8 * 9 * CmdSpec.h -- 10 * 11 * Generic function prototype of CmdOptions. 12 * 13 *------------------------------------------------------------------------------- 14 */ 15 16 #ifndef CMDSPEC_H 17 #define CMDSPEC_H 6 #ifndef RAPPTURE_CMDPROC_H 7 #define RAPPTURE_CMDPROC_H 18 8 19 9 namespace Rappture { 20 10 21 /* 22 *------------------------------------------------------------------------------- 23 * 24 * CmdSpec -- 25 * 26 * Structure to specify a set of operations for a Tcl command. 27 * This is passed to the Blt_GetOp procedure to look 28 * for a function pointer associated with the operation name. 29 * 30 *------------------------------------------------------------------------------- 11 /** 12 * Structure to specify a set of operations for a Tcl command. 13 * This is passed to the Blt_GetOp procedure to look 14 * for a function pointer associated with the operation name. 31 15 */ 32 16 typedef struct { 33 const char *name; /* Name of operation */34 int minChars; /* Minimum # characters to disambiguate */17 const char *name; /**< Name of operation */ 18 int minChars; /**< Minimum # characters to disambiguate */ 35 19 Tcl_ObjCmdProc *proc; 36 int minArgs; /* Minimum # args required */37 int maxArgs; /* Maximum # args required */38 const char *usage; /* Usage message */20 int minArgs; /**< Minimum # args required */ 21 int maxArgs; /**< Maximum # args required */ 22 const char *usage; /**< Usage message */ 39 23 } CmdSpec; 40 24 41 25 typedef enum { 42 CMDSPEC_ARG0, /* Op is the first argument. */43 CMDSPEC_ARG1, /* Op is the second argument. */44 CMDSPEC_ARG2, /* Op is the third argument. */45 CMDSPEC_ARG3, /* Op is the fourth argument. */46 CMDSPEC_ARG4 /* Op is the fifth argument. */26 CMDSPEC_ARG0, /**< Op is the first argument. */ 27 CMDSPEC_ARG1, /**< Op is the second argument. */ 28 CMDSPEC_ARG2, /**< Op is the third argument. */ 29 CMDSPEC_ARG3, /**< Op is the fourth argument. */ 30 CMDSPEC_ARG4 /**< Op is the fifth argument. */ 47 31 } CmdSpecIndex; 48 32 … … 58 42 } 59 43 60 #endif /* CMDSPEC_H */44 #endif -
nanovis/branches/1.1/Command.cpp
r4881 r4889 55 55 #include "Grid.h" 56 56 #include "HeightMap.h" 57 #include "NvCamera.h" 58 #include "NvZincBlendeReconstructor.h" 57 #include "Camera.h" 58 #include "ZincBlendeVolume.h" 59 #include "ZincBlendeReconstructor.h" 59 60 #include "Unirect.h" 60 61 #include "Volume.h" … … 1282 1283 if ((nBytes > 5) && (strncmp(bytes, "<HDR>", 5) == 0)) { 1283 1284 TRACE("ZincBlende Stream loading..."); 1284 volume = NvZincBlendeReconstructor::getInstance()->loadFromMemory(buf.bytes());1285 volume = ZincBlendeReconstructor::getInstance()->loadFromMemory(buf.bytes()); 1285 1286 if (volume == NULL) { 1286 1287 Tcl_AppendResult(interp, "can't get volume instance", (char *)NULL); -
nanovis/branches/1.1/Command.h
r4874 r4889 9 9 * Leif Delgass <ldelgass@purdue.edu> 10 10 */ 11 #ifndef COMMAND_H12 #define COMMAND_H11 #ifndef NV_COMMAND_H 12 #define NV_COMMAND_H 13 13 14 14 #include <unistd.h> … … 19 19 class Buffer; 20 20 } 21 class Volume;22 21 23 22 namespace nv { 24 23 25 24 class ReadBuffer; 25 class Volume; 26 26 27 27 extern ssize_t SocketWrite(const void *bytes, size_t len); -
nanovis/branches/1.1/ContourLineFilter.cpp
r3492 r4889 14 14 #include "ContourLineFilter.h" 15 15 16 using namespace nv; 16 17 using namespace nv::graphics; 17 18 using namespace vrmath; -
nanovis/branches/1.1/ContourLineFilter.h
r3492 r4889 1 1 /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ 2 #ifndef CONTOURLINEFILTER_H3 #define CONTOURLINEFILTER_H2 #ifndef NV_CONTOURLINEFILTER_H 3 #define NV_CONTOURLINEFILTER_H 4 4 5 5 #include <list> … … 9 9 #include <vrmath/Vector3f.h> 10 10 #include <vrmath/Vector4f.h> 11 12 namespace nv { 11 13 12 14 class ContourLineFilter … … 60 62 }; 61 63 64 } 65 62 66 #endif -
nanovis/branches/1.1/ConvexPolygon.cpp
r3502 r4889 21 21 #include "Trace.h" 22 22 23 using namespace nv; 23 24 using namespace vrmath; 24 25 -
nanovis/branches/1.1/ConvexPolygon.h
r3502 r4889 1 1 /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ 2 2 /* 3 * ---------------------------------------------------------------------- 4 * ConvexPolygon.h: convex polygon class 3 * Copyright (c) 2004-2013 HUBzero Foundation, LLC 5 4 * 6 * ====================================================================== 7 * AUTHOR: Wei Qiao <qiaow@purdue.edu> 8 * Purdue Rendering and Perceptualization Lab (PURPL) 9 * 10 * Copyright (c) 2004-2013 HUBzero Foundation, LLC 11 * 12 * See the file "license.terms" for information on usage and 13 * redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. 14 * ====================================================================== 5 * Authors: 6 * Wei Qiao <qiaow@purdue.edu> 15 7 */ 16 #ifndef _CONVEX_POLYGON_H_17 #define _CONVEX_POLYGON_H_8 #ifndef NV_CONVEX_POLYGON_H 9 #define NV_CONVEX_POLYGON_H 18 10 19 11 #include <assert.h> … … 25 17 26 18 #include "Plane.h" 19 20 namespace nv { 27 21 28 22 typedef std::vector<vrmath::Vector4f> VertexVector; … … 71 65 }; 72 66 67 } 68 73 69 #endif -
nanovis/branches/1.1/Flow.cpp
r4874 r4889 20 20 #include "FlowParticles.h" 21 21 #include "FlowBox.h" 22 #include " NvLIC.h"22 #include "LIC.h" 23 23 #include "VelocityArrowsSlice.h" 24 #include "NvParticleRenderer.h"25 24 #include "Switch.h" 26 25 #include "Unirect.h" -
nanovis/branches/1.1/Flow.h
r4612 r4889 9 9 * Leif Delgass <ldelgass@purdue.edu> 10 10 */ 11 12 #ifndef FLOW_H 13 #define FLOW_H 11 #ifndef NV_FLOW_H 12 #define NV_FLOW_H 14 13 15 14 #include <tr1/unordered_map> … … 25 24 #include "FlowParticles.h" 26 25 #include "FlowBox.h" 27 #include "NvLIC.h" 28 #include "NvParticleRenderer.h" 26 #include "LIC.h" 29 27 #include "Unirect.h" 30 28 #include "Volume.h" 31 29 #include "TransferFunction.h" 30 31 namespace nv { 32 32 33 33 struct FlowValues { … … 253 253 }; 254 254 255 } 256 255 257 #endif -
nanovis/branches/1.1/FlowBox.cpp
r3567 r4889 21 21 #include "Trace.h" 22 22 23 using namespace nv; 23 24 using namespace vrmath; 24 25 -
nanovis/branches/1.1/FlowBox.h
r3568 r4889 9 9 * Leif Delgass <ldelgass@purdue.edu> 10 10 */ 11 #ifndef FLOWBOX_H12 #define FLOWBOX_H11 #ifndef NV_FLOWBOX_H 12 #define NV_FLOWBOX_H 13 13 14 14 #include <string> … … 21 21 #include "Switch.h" 22 22 #include "Volume.h" 23 24 namespace nv { 23 25 24 26 struct FlowBoxValues { … … 71 73 }; 72 74 75 } 76 73 77 #endif -
nanovis/branches/1.1/FlowCmd.cpp
r4884 r4889 37 37 #include "Switch.h" 38 38 #include "TransferFunction.h" 39 #include " NvLIC.h"39 #include "LIC.h" 40 40 #include "Unirect.h" 41 41 #include "VelocityArrowsSlice.h" -
nanovis/branches/1.1/FlowCmd.h
r4874 r4889 1 1 /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ 2 2 /* 3 * ---------------------------------------------------------------------- 4 * FlowCmd.h 3 * Copyright (c) 2004-2013 HUBzero Foundation, LLC 5 4 * 6 * This modules creates the Tcl interface to the nanovis server. The 7 * communication protocol of the server is the Tcl language. Commands 8 * given to the server by clients are executed in a safe interpreter and 9 * the resulting image rendered offscreen is returned as BMP-formatted 10 * image data. 11 * 12 * ====================================================================== 13 * AUTHOR: Wei Qiao <qiaow@purdue.edu> 14 * Insoo Woo <iwoo@purdue.edu> 15 * Michael McLennan <mmclennan@purdue.edu> 16 * Purdue Rendering and Perceptualization Lab (PURPL) 17 * 18 * Copyright (c) 2004-2013 HUBzero Foundation, LLC 19 * 20 * See the file "license.terms" for information on usage and 21 * redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. 22 * ====================================================================== 5 * Authors: 6 * Wei Qiao <qiaow@purdue.edu> 7 * Insoo Woo <iwoo@purdue.edu> 8 * Michael McLennan <mmclennan@purdue.edu> 23 9 */ 24 #ifndef FLOWCMD_H25 #define FLOWCMD_H10 #ifndef NV_FLOWCMD_H 11 #define NV_FLOWCMD_H 26 12 27 13 #include <tcl.h> -
nanovis/branches/1.1/FlowParticles.cpp
r4612 r4889 19 19 #include "Trace.h" 20 20 21 using namespace nv; 21 22 using namespace vrmath; 22 23 23 24 FlowParticles::FlowParticles(const char *name) : 24 25 _name(name), 25 _renderer(new NvParticleRenderer(NMESH, NMESH))26 _renderer(new ParticleRenderer(NMESH, NMESH)) 26 27 { 27 28 _sv.position.value = 0.0f; -
nanovis/branches/1.1/FlowParticles.h
r4612 r4889 9 9 * Leif Delgass <ldelgass@purdue.edu> 10 10 */ 11 #ifndef FLOWPARTICLES_H12 #define FLOWPARTICLES_H11 #ifndef NV_FLOWPARTICLES_H 12 #define NV_FLOWPARTICLES_H 13 13 14 14 #include <cassert> … … 21 21 #include "FlowTypes.h" 22 22 #include "Switch.h" 23 #include " NvParticleRenderer.h"23 #include "ParticleRenderer.h" 24 24 #include "Volume.h" 25 26 namespace nv { 25 27 26 28 struct FlowParticlesValues { … … 96 98 */ 97 99 std::string _name; 98 NvParticleRenderer *_renderer; ///< Particle renderer100 nv::ParticleRenderer *_renderer; ///< Particle renderer 99 101 FlowParticlesValues _sv; 100 102 … … 102 104 }; 103 105 106 } 107 104 108 #endif -
nanovis/branches/1.1/FlowTypes.h
r3567 r4889 9 9 * Leif Delgass <ldelgass@purdue.edu> 10 10 */ 11 #ifndef FLOWTYPES_H 12 #define FLOWTYPES_H 11 #ifndef NV_FLOWTYPES_H 12 #define NV_FLOWTYPES_H 13 14 namespace nv { 13 15 14 16 struct FlowColor { … … 30 32 #define ABSPOS 1 31 33 34 } 35 32 36 #endif -
nanovis/branches/1.1/GradientFilter.cpp
r3559 r4889 14 14 #include "GradientFilter.h" 15 15 16 using namespace nv; 17 16 18 #ifndef SQR 17 19 #define SQR(a) ((a) * (a)) … … 95 97 #endif 96 98 97 int 98 getNextPowerOfTwo(int n) 99 { 100 int i; 101 102 i = 1; 103 while (i < n) { 104 i *= 2; 105 } 106 107 return i; 108 } 109 110 static unsigned char getVoxel8(int x, int y, int z) 99 static unsigned char 100 getVoxel8(int x, int y, int z) 111 101 { 112 102 return ((unsigned char*)g_volData)[z * g_numOfSlices[0] * g_numOfSlices[1] + … … 115 105 } 116 106 117 static unsigned short getVoxel16(int x, int y, int z) 107 static unsigned short 108 getVoxel16(int x, int y, int z) 118 109 { 119 110 return ((unsigned short*)g_volData)[z * g_numOfSlices[0] * g_numOfSlices[1] + … … 122 113 } 123 114 124 static float getVoxelFloat(int x, int y, int z) 115 static float 116 getVoxelFloat(int x, int y, int z) 125 117 { 126 118 return ((float*)g_volData)[z * g_numOfSlices[0] * g_numOfSlices[1] + … … 129 121 } 130 122 131 static float getVoxel(int x, int y, int z, DataType dataType) 123 static float 124 getVoxel(int x, int y, int z, nv::DataType dataType) 132 125 { 133 126 switch (dataType) { 134 case DATRAW_UCHAR: 135 return (float)getVoxel8(x, y, z); 136 break; 137 case DATRAW_USHORT: 138 return (float)getVoxel16(x, y, z); 139 break; 140 case DATRAW_FLOAT : 141 return (float)getVoxelFloat(x, y, z); 142 break; 143 default: 144 ERROR("Unsupported data type"); 145 exit(1); 146 break; 127 case nv::DATRAW_UCHAR: 128 return (float)getVoxel8(x, y, z); 129 break; 130 case nv::DATRAW_USHORT: 131 return (float)getVoxel16(x, y, z); 132 break; 133 case nv::DATRAW_FLOAT: 134 return (float)getVoxelFloat(x, y, z); 135 break; 136 default: 137 ERROR("Unsupported data type"); 138 exit(1); 147 139 } 148 140 return 0.0; 149 141 } 150 142 151 void computeGradients(float *gradients, void *volData, int *sizes, 152 float *spacing, DataType dataType) 153 { 154 ::g_volData = volData; 143 void 144 nv::computeGradients(float *gradients, void *volData, int *sizes, 145 float *spacing, DataType dataType) 146 { 147 g_volData = volData; 155 148 g_numOfSlices[0] = sizes[0]; 156 149 g_numOfSlices[1] = sizes[1]; … … 309 302 } 310 303 311 void filterGradients(float *gradients, int *sizes) 304 void 305 nv::filterGradients(float *gradients, int *sizes) 312 306 { 313 307 int i, j, k, idz, idy, idx, gi, ogi, filterWidth, n, borderDist[3]; … … 444 438 } 445 439 446 void quantize8(float *grad, unsigned char *data) 440 static void 441 quantize8(float *grad, unsigned char *data) 447 442 { 448 443 float len; … … 464 459 } 465 460 466 void quantize16(float *grad, unsigned short *data) 461 static void 462 quantize16(float *grad, unsigned short *data) 467 463 { 468 464 float len; … … 484 480 } 485 481 486 void quantizeFloat(float *grad, float *data) 482 static void 483 quantizeFloat(float *grad, float *data) 487 484 { 488 485 float len; … … 504 501 } 505 502 506 void quantizeGradients(float *gradientsIn, void *gradientsOut, 507 int *sizes, DataType dataType) 503 void 504 nv::quantizeGradients(float *gradientsIn, void *gradientsOut, 505 int *sizes, DataType dataType) 508 506 { 509 507 int idx, idy, idz, di; -
nanovis/branches/1.1/GradientFilter.h
r3502 r4889 4 4 * 5 5 */ 6 #ifndef GRADIENT_FILTER_H 7 #define GRADIENT_FILTER_H 6 #ifndef NV_GRADIENT_FILTER_H 7 #define NV_GRADIENT_FILTER_H 8 9 namespace nv { 8 10 9 11 typedef enum { … … 21 23 int *sizes, DataType dataType); 22 24 25 } 26 23 27 #endif -
nanovis/branches/1.1/Grid.cpp
r4874 r4889 13 13 #include "Trace.h" 14 14 15 using namespace nv; 15 16 using namespace nv::util; 16 17 -
nanovis/branches/1.1/Grid.h
r3502 r4889 4 4 * 5 5 */ 6 #ifndef GRID_H7 #define GRID_H6 #ifndef NV_GRID_H 7 #define NV_GRID_H 8 8 9 9 #include <util/Fonts.h> … … 11 11 #include "Axis.h" 12 12 #include "AxisRange.h" 13 14 namespace nv { 13 15 14 16 class RGBA … … 74 76 }; 75 77 78 } 76 79 77 80 #endif -
nanovis/branches/1.1/HeightMap.cpp
r4874 r4889 15 15 #include "Texture1D.h" 16 16 17 using namespace nv; 18 using namespace nv::graphics; 19 using namespace vrmath; 20 17 21 bool HeightMap::updatePending = false; 18 22 double HeightMap::valueMin = 0.0; 19 23 double HeightMap::valueMax = 1.0; 20 21 using namespace nv::graphics;22 using namespace vrmath;23 24 24 25 HeightMap::HeightMap() : … … 38 39 _heights(NULL) 39 40 { 40 _shader = new NvShader();41 _shader = new Shader(); 41 42 _shader->loadFragmentProgram("heightcolor.cg", "main"); 42 43 } -
nanovis/branches/1.1/HeightMap.h
r4612 r4889 4 4 * 5 5 */ 6 #ifndef HEIGHTMAP_H7 #define HEIGHTMAP_H6 #ifndef NV_HEIGHTMAP_H 7 #define NV_HEIGHTMAP_H 8 8 9 9 #include <graphics/Geometry.h> … … 12 12 13 13 #include "TransferFunction.h" 14 #include " NvShader.h"14 #include "Shader.h" 15 15 #include "AxisRange.h" 16 17 namespace nv { 16 18 17 19 class Grid; … … 130 132 TransferFunction *_transferFunc; 131 133 float _opacity; 132 NvShader *_shader;134 Shader *_shader; 133 135 int *_indexBuffer; 134 136 int _indexCount; … … 145 147 }; 146 148 149 } 150 147 151 #endif -
nanovis/branches/1.1/LIC.cpp
r3611 r4889 1 1 /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ 2 2 /* 3 * ----------------------------------------------------------------------4 * NvLIC.h: line integral convolution class5 *6 * ======================================================================7 * AUTHOR: Insoo Woo <iwoo@purdue.edu, Wei Qiao <qiaow@purdue.edu>8 * Purdue Rendering and Perceptualization Lab (PURPL)9 *10 3 * Copyright (c) 2004-2013 HUBzero Foundation, LLC 11 4 * 12 * See the file "license.terms" for information on usage and13 * redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.14 * ======================================================================5 * Authors: 6 * Insoo Woo <iwoo@purdue.edu> 7 * Wei Qiao <qiaow@purdue.edu> 15 8 */ 16 9 #include <stdlib.h> … … 22 15 23 16 #include "LIC.h" 24 #include " NvShader.h"17 #include "Shader.h" 25 18 #include "Trace.h" 26 19 … … 111 104 glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fboOrig); 112 105 113 _renderVelShader = new NvShader();106 _renderVelShader = new Shader(); 114 107 _renderVelShader->loadFragmentProgram("render_vel.cg", "main"); 115 108 -
nanovis/branches/1.1/LIC.h
r3611 r4889 1 1 /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ 2 2 /* 3 * ----------------------------------------------------------------------4 * NvLIC.h: line integral convolution class5 *6 * ======================================================================7 * AUTHOR: Wei Qiao <qiaow@purdue.edu>8 * Purdue Rendering and Perceptualization Lab (PURPL)9 *10 3 * Copyright (c) 2004-2013 HUBzero Foundation, LLC 11 4 * 12 * See the file "license.terms" for information on usage and 13 * redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. 14 * ====================================================================== 5 * Authors: 6 * Wei Qiao <qiaow@purdue.edu> 15 7 */ 16 8 #ifndef NV_LIC_H … … 22 14 23 15 #include "Volume.h" 24 #include " NvShader.h"16 #include "Shader.h" 25 17 26 18 namespace nv { … … 84 76 private: 85 77 /** 86 * @brief the normal vector of the NvLIC plane,78 * @brief the normal vector of the LIC plane, 87 79 * the inherited Vector3 location is its center 88 80 */ … … 111 103 GLuint _disListID; 112 104 113 NvShader *_renderVelShader;105 Shader *_renderVelShader; 114 106 115 107 GLuint _colorTex, _patternTex, _magTex; -
nanovis/branches/1.1/Makefile.in
r4874 r4889 104 104 OBJS = \ 105 105 Axis.o \ 106 Camera.o \ 106 107 Chain.o \ 107 108 CmdProc.o \ 109 ColorTableShader.o \ 108 110 Command.o \ 109 111 ContourLineFilter.o \ … … 116 118 Grid.o \ 117 119 HeightMap.o \ 118 NvCamera.o \ 119 NvColorTableShader.o \ 120 NvLIC.o \ 121 NvParticleAdvectionShader.o \ 122 NvParticleRenderer.o \ 123 NvRegularVolumeShader.o \ 124 NvShader.o \ 125 NvStdVertexShader.o \ 126 NvVolumeShader.o \ 127 NvZincBlendeReconstructor.o \ 128 NvZincBlendeVolumeShader.o \ 120 LIC.o \ 121 ParticleAdvectionShader.o \ 122 ParticleRenderer.o \ 129 123 PerfQuery.o \ 130 124 Plane.o \ … … 132 126 ReadBuffer.o \ 133 127 ReaderCommon.o \ 128 RegularVolumeShader.o \ 134 129 RenderVertexArray.o \ 130 Shader.o \ 131 StdVertexShader.o \ 135 132 Switch.o \ 136 133 Texture1D.o \ … … 144 141 VolumeInterpolator.o \ 145 142 VolumeRenderer.o \ 143 VolumeShader.o \ 146 144 VtkReader.o \ 145 ZincBlendeReconstructor.o \ 147 146 ZincBlendeVolume.o \ 147 ZincBlendeVolumeShader.o \ 148 148 dxReader.o \ 149 149 md5.o \ … … 271 271 Axis.o: Axis.cpp Axis.h Chain.h 272 272 BucketSort.o: BucketSort.cpp BucketSort.h $(VRMATH_DIR)/include/vrmath/Vector3f.h $(VRMATH_DIR)/include/vrmath/Vector4f.h $(VRMATH_DIR)/include/vrmath/Matrix4x4d.h PCASplit.h 273 Camera.o: Camera.cpp Camera.h config.h $(VRMATH_DIR)/include/vrmath/Matrix4x4d.h 273 274 Chain.o: Chain.cpp Chain.h 274 275 CmdProc.o: CmdProc.cpp CmdProc.h 275 Command.o: Command.cpp nanovis.h nanovisServer.h ReadBuffer.h config.h define.h FlowCmd.h CmdProc.h Trace.h PlaneRenderer.h dxReader.h Grid.h HeightMap.h NvCamera.h NvZincBlendeReconstructor.h Unirect.h Volume.h VolumeRenderer.h 276 ColorTableShader.o: ColorTableShader.cpp ColorTableShader.h Shader.h 277 Command.o: Command.cpp nanovis.h nanovisServer.h ReadBuffer.h config.h define.h FlowCmd.h CmdProc.h Trace.h PlaneRenderer.h dxReader.h Grid.h HeightMap.h Camera.h ZincBlendeReconstructor.h Unirect.h Volume.h VolumeRenderer.h 276 278 ContourLineFilter.o: ContourLineFilter.cpp ContourLineFilter.h 277 279 ConvexPolygon.o: ConvexPolygon.cpp ConvexPolygon.h $(VRMATH_DIR)/include/vrmath/Vector4f.h $(VRMATH_DIR)/include/vrmath/Matrix4x4d.h Plane.h 278 Flow.o: Flow.cpp Flow.h FlowCmd.h FlowTypes.h FlowBox.h FlowParticles.h NvLIC.h VelocityArrowsSlice.h Switch.h Unirect.h Volume.h TransferFunction.h Trace.h280 Flow.o: Flow.cpp Flow.h FlowCmd.h FlowTypes.h FlowBox.h FlowParticles.h LIC.h VelocityArrowsSlice.h Switch.h Unirect.h Volume.h TransferFunction.h Trace.h 279 281 FlowBox.o: FlowBox.cpp FlowBox.h FlowTypes.h Switch.h Trace.h Volume.h $(VRMATH_DIR)/include/vrmath/Vector3f.h $(VRMATH_DIR)/include/vrmath/Vector4f.h $(VRMATH_DIR)/include/vrmath/Matrix4x4d.h 280 FlowCmd.o: FlowCmd.cpp FlowCmd.h FlowParticles.h FlowBox.h FlowTypes.h Command.h Switch.h Trace.h TransferFunction.h nanovis.h nanovisServer.h CmdProc.h NvLIC.h Unirect.h Volume.h VelocityArrowsSlice.h $(VRMATH_DIR)/include/vrmath/Vector3f.h281 FlowParticles.o: FlowParticles.cpp FlowParticles.h FlowTypes.h FlowCmd.h Switch.h Trace.h NvParticleRenderer.h Volume.h $(VRMATH_DIR)/include/vrmath/Vector3f.h $(VRMATH_DIR)/include/vrmath/Vector4f.h282 <FlowCmd.o: FlowCmd.cpp FlowCmd.h FlowParticles.h FlowBox.h FlowTypes.h Command.h Switch.h Trace.h TransferFunction.h nanovis.h nanovisServer.h CmdProc.h LIC.h Unirect.h Volume.h VelocityArrowsSlice.h $(VRMATH_DIR)/include/vrmath/Vector3f.h 283 FlowParticles.o: FlowParticles.cpp FlowParticles.h FlowTypes.h FlowCmd.h Switch.h Trace.h ParticleRenderer.h Volume.h $(VRMATH_DIR)/include/vrmath/Vector3f.h $(VRMATH_DIR)/include/vrmath/Vector4f.h 282 284 GradientFilter.o: GradientFilter.cpp GradientFilter.h 283 285 Grid.o: Grid.cpp Grid.h Axis.h Chain.h 284 286 HeightMap.o: HeightMap.cpp HeightMap.h 285 NvCamera.o: NvCamera.cpp NvCamera.h config.h $(VRMATH_DIR)/include/vrmath/Matrix4x4d.h 286 NvColorTableShader.o: NvColorTableShader.cpp NvColorTableShader.h NvShader.h 287 NvLIC.o: NvLIC.cpp NvLIC.h define.h 288 NvParticleAdvectionShader.o: NvParticleAdvectionShader.cpp NvParticleAdvectionShader.h NvShader.h 289 NvParticleRenderer.o: NvParticleRenderer.cpp NvParticleRenderer.h define.h 290 NvRegularVolumeShader.o: NvRegularVolumeShader.cpp NvRegularVolumeShader.h NvVolumeShader.h NvShader.h 291 NvShader.o: NvShader.cpp NvShader.h 292 NvStdVertexShader.o: NvStdVertexShader.cpp NvStdVertexShader.h NvShader.h 293 NvVolumeShader.o: NvVolumeShader.cpp NvVolumeShader.h NvShader.h 294 NvZincBlendeReconstructor.o: NvZincBlendeReconstructor.cpp NvZincBlendeReconstructor.h ZincBlendeVolume.h Volume.h $(VRMATH_DIR)/include/vrmath/Vector3f.h 295 NvZincBlendeVolumeShader.o: NvZincBlendeVolumeShader.cpp NvZincBlendeVolumeShader.h NvVolumeShader.h NvShader.h 287 LIC.o: LIC.cpp LIC.h define.h 288 ParticleAdvectionShader.o: ParticleAdvectionShader.cpp ParticleAdvectionShader.h Shader.h 296 289 ParticleEmitter.o: ParticleEmitter.cpp ParticleEmitter.h 297 ParticleSystem.o: ParticleSystem.cpp ParticleSystem.h DataLoader.h 290 ParticleRenderer.o: ParticleRenderer.cpp ParticleRenderer.h define.h 291 ParticleSystem.o: ParticleSystem.cpp ParticleSystem.h 298 292 ParticleSystemFactory.o: ParticleSystemFactory.cpp ParticleSystemFactory.h 299 293 PCASplit.o: PCASplit.cpp PCASplit.h … … 306 300 ReadBuffer.o: ReadBuffer.cpp ReadBuffer.h Trace.h 307 301 ReaderCommon.o: ReaderCommon.cpp ReaderCommon.h GradientFilter.h $(VRMATH_DIR)/include/vrmath/Vector3f.h 302 RegularVolumeShader.o: RegularVolumeShader.cpp RegularVolumeShader.h VolumeShader.h Shader.h 308 303 RenderVertexArray.o: RenderVertexArray.cpp RenderVertexArray.h 304 Shader.o: Shader.cpp Shader.h 305 StdVertexShader.o: StdVertexShader.cpp StdVertexShader.h Shader.h 309 306 Switch.o: Switch.cpp Switch.h 310 307 Texture1D.o: Texture1D.cpp Texture1D.h … … 317 314 Volume.o: Volume.cpp Volume.h config.h define.h 318 315 VolumeInterpolator.o: VolumeInterpolator.cpp VolumeInterpolator.h Volume.h 319 VolumeRenderer.o: VolumeRenderer.cpp VolumeRenderer.h 316 VolumeRenderer.o: VolumeRenderer.cpp VolumeRenderer.h ConvexPolygon.h Volume.h nanovis.h Trace.h Plane.h StdVertexShader.h Shader.h 317 VolumeShader.o: VolumeShader.cpp VolumeShader.h Shader.h 320 318 VtkReader.o: VtkReader.h Trace.h Volume.h $(VRMATH_DIR)/include/vrmath/Vector3f.h ReaderCommon.h nanovis.h 319 ZincBlendeReconstructor.o: ZincBlendeReconstructor.cpp ZincBlendeReconstructor.h ZincBlendeVolume.h Volume.h $(VRMATH_DIR)/include/vrmath/Vector3f.h 321 320 ZincBlendeVolume.o: ZincBlendeVolume.cpp ZincBlendeVolume.h config.h define.h 322 dxReader.o: dxReader.cpp ReaderCommon.h config.h nanovis.h Unirect.h ZincBlendeVolume.h NvZincBlendeReconstructor.h 321 ZincBlendeVolumeShader.o: ZincBlendeVolumeShader.cpp ZincBlendeVolumeShader.h VolumeShader.h Shader.h 322 dxReader.o: dxReader.cpp ReaderCommon.h config.h nanovis.h Unirect.h ZincBlendeVolume.h ZincBlendeReconstructor.h 323 323 md5.o: md5.h 324 nanovis.o: nanovis.cpp nanovis.h nanovisServer.h config.h define.h Command.h Flow.h Grid.h HeightMap.h NvCamera.h NvLIC.h NvZincBlendeReconstructor.h PerfQuery.h PlaneRenderer.h PointSetRenderer.h PointSet.h Switch.h Trace.h Unirect.h VelocityArrowsSlice.h VolumeInterpolator.h VolumeRenderer.h ZincBlendeVolume.h Axis.h Chain.h325 nanovisServer.o: nanovisServer.cpp nanovisServer.h config.h nanovis.h define.h Command.h NvShader.h Trace.h324 nanovis.o: nanovis.cpp nanovis.h nanovisServer.h config.h define.h Command.h Flow.h Grid.h HeightMap.h Camera.h LIC.h ZincBlendeReconstructor.h PerfQuery.h PlaneRenderer.h PointSetRenderer.h PointSet.h Switch.h Trace.h Unirect.h VelocityArrowsSlice.h VolumeInterpolator.h VolumeRenderer.h ZincBlendeVolume.h Axis.h Chain.h 325 nanovisServer.o: nanovisServer.cpp nanovisServer.h config.h nanovis.h define.h Command.h ReadBuffer.h Shader.h Trace.h -
nanovis/branches/1.1/PCASplit.cpp
r3502 r4889 12 12 #include <newmatio.h> // need matrix output routines 13 13 #include <newmatrc.h> 14 15 #include "PCASplit.h"16 17 using namespace vrmath;18 19 14 #ifdef use_namespace 20 15 using namespace NEWMAT; // access NEWMAT namespace 21 16 #endif 22 17 18 #include "PCASplit.h" 19 #include "Trace.h" 20 21 using namespace vrmath; 23 22 using namespace PCA; 24 23 -
nanovis/branches/1.1/PCASplit.h
r3502 r4889 4 4 * 5 5 */ 6 #ifndef PCA_ SPLIT_H7 #define PCA_ SPLIT_H6 #ifndef PCA_PCASPLIT_H 7 #define PCA_PCASPLIT_H 8 8 9 9 #include <memory.h> -
nanovis/branches/1.1/ParticleEmitter.cpp
r3502 r4889 5 5 */ 6 6 #include "ParticleEmitter.h" 7 8 using namespace nv; 7 9 8 10 ParticleEmitter::ParticleEmitter() : -
nanovis/branches/1.1/ParticleEmitter.h
r3502 r4889 4 4 * 5 5 */ 6 #ifndef PARTICLEEMITTER_H7 #define PARTICLEEMITTER_H6 #ifndef NV_PARTICLEEMITTER_H 7 #define NV_PARTICLEEMITTER_H 8 8 9 9 #include <string> … … 11 11 #include <vrmath/Vector3f.h> 12 12 13 namespace nv { 14 13 15 class ParticleEmitter 14 16 { 15 17 public: 16 ParticleEmitter();18 ParticleEmitter(); 17 19 18 20 void setName(const std::string& name); … … 84 86 } 85 87 88 } 89 86 90 #endif -
nanovis/branches/1.1/ParticleRenderer.cpp
r3611 r4889 19 19 using namespace nv; 20 20 21 NvParticleAdvectionShader *ParticleRenderer::_advectionShader = NULL;21 ParticleAdvectionShader *ParticleRenderer::_advectionShader = NULL; 22 22 ParticleAdvectionShaderInstance shaderInstance; 23 23 … … 103 103 104 104 if (_advectionShader == NULL) { 105 _advectionShader = new NvParticleAdvectionShader();105 _advectionShader = new ParticleAdvectionShader(); 106 106 } 107 107 } -
nanovis/branches/1.1/ParticleRenderer.h
r3611 r4889 14 14 #include <vrmath/Vector4f.h> 15 15 16 #include " NvParticleAdvectionShader.h"16 #include "ParticleAdvectionShader.h" 17 17 #include "RenderVertexArray.h" 18 18 … … 84 84 } 85 85 86 static NvParticleAdvectionShader *_advectionShader;86 static ParticleAdvectionShader *_advectionShader; 87 87 88 88 private: -
nanovis/branches/1.1/ParticleSystem.cpp
r3502 r4889 27 27 #include "ParticleSystem.h" 28 28 #include "ParticleEmitter.h" 29 #include "DataLoader.h"30 29 #include "Texture2D.h" 31 30 #include "Texture3D.h" 32 #include " NvShader.h"31 #include "Shader.h" 33 32 #include "Trace.h" 34 33 34 using namespace nv; 35 35 using namespace nv::util; 36 36 … … 423 423 { 424 424 // TBD... 425 _context = NvShader::getCgContext();425 _context = Shader::getCgContext(); 426 426 427 427 std::string path = FilePath::getInstance()->getPath("distance.cg"); … … 987 987 988 988 glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, _atlas_fbo); 989 _streamVertices-> Read(_atlasWidth, _atlasHeight);989 _streamVertices->read(_atlasWidth, _atlasHeight); 990 990 glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); 991 991 _currentStreamlineIndex++; … … 1096 1096 1097 1097 glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, psys_fbo[_destPosIndex]); 1098 _vertices-> Read(_width, _height);1098 _vertices->read(_width, _height); 1099 1099 glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); 1100 1100 } else { 1101 1101 glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, psys_fbo[_currentPosIndex]); 1102 _vertices-> Read(_width, _height);1102 _vertices->read(_width, _height); 1103 1103 glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); 1104 1104 } … … 1110 1110 for (unsigned int k = 0; k < numOfNewParticles; ++k) { 1111 1111 vrmath::Vector3f position = _emitters[i]->_position; 1112 position += _emitters[i]->_maxPositionOffset * 1113 vrmath::Vector3f(randomRange(-1.0f, 1.0f), randomRange(-1.0f, 1.0f), randomRange(-1.0f, 1.0f)); 1114 1112 position += 1113 _emitters[i]->_maxPositionOffset.scale(vrmath::Vector3f(randomRange(-1.0f, 1.0f), 1114 randomRange(-1.0f, 1.0f), 1115 randomRange(-1.0f, 1.0f))); 1115 1116 float lifetime = randomRange(_emitters[i]->_minLifeTime, _emitters[i]->_maxLifeTime); 1116 1117 … … 1581 1582 //glEnableClientState(GL_COLOR_ARRAY); 1582 1583 1583 _streamVertices-> SetPointer(0);1584 _streamVertices->setPointer(0); 1584 1585 //glColorPointer(4, GL_FLOAT, 0, 0); 1585 1586 … … 1653 1654 glEnableClientState(GL_VERTEX_ARRAY); 1654 1655 //glEnableClientState(GL_COLOR_ARRAY); 1655 _vertices-> SetPointer(0);1656 _vertices->setPointer(0); 1656 1657 //glBindBufferARB(GL_ARRAY_BUFFER, _colorBufferID); 1657 1658 //glColorPointer(4, GL_FLOAT, 0, 0); … … 1691 1692 glEnableClientState(GL_VERTEX_ARRAY); 1692 1693 //glEnableClientState(GL_COLOR_ARRAY); 1693 _vertices-> SetPointer(0);1694 _vertices->setPointer(0); 1694 1695 //glBindBufferARB(GL_ARRAY_BUFFER, _colorBufferID); 1695 1696 //glColorPointer(4, GL_FLOAT, 0, 0); … … 1718 1719 //glEnableClientState(GL_COLOR_ARRAY); 1719 1720 glPointSize(10); 1720 _vertices-> SetPointer(0);1721 _vertices->setPointer(0); 1721 1722 //glBindBufferARB(GL_ARRAY_BUFFER, _colorBufferID); 1722 1723 //glColorPointer(4, GL_FLOAT, 0, 0); … … 1725 1726 1726 1727 glPointSize(1); 1727 _vertices-> SetPointer(0);1728 _vertices->setPointer(0); 1728 1729 //glBindBufferARB(GL_ARRAY_BUFFER, _colorBufferID); 1729 1730 //glColorPointer(4, GL_FLOAT, 0, 0); -
nanovis/branches/1.1/ParticleSystem.h
r3502 r4889 4 4 * 5 5 */ 6 #ifndef PARTICLESYSTEM_H7 #define PARTICLESYSTEM_H6 #ifndef NV_PARTICLESYSTEM_H 7 #define NV_PARTICLESYSTEM_H 8 8 9 9 #include <vector> … … 23 23 24 24 #include "CircularQueue.h" 25 26 namespace nv { 25 27 26 28 struct NewParticle { … … 47 49 }; 48 50 49 namespace std 50 { 51 template <> 52 struct greater<ActiveParticle> { 53 bool operator() (const ActiveParticle& left, const ActiveParticle& right) 54 { 55 return left.timeOfDeath > right.timeOfDeath; 56 } 57 }; 58 } 51 struct particle_greater { 52 bool operator() (const ActiveParticle& left, const ActiveParticle& right) 53 { 54 return (left.timeOfDeath > right.timeOfDeath); 55 } 56 }; 59 57 60 58 struct color4 { … … 171 169 172 170 priority_queue_vector<int, std::greater<int> > _availableIndices; 173 priority_queue_vector<ActiveParticle, std::greater<ActiveParticle>> _activeParticles;171 priority_queue_vector<ActiveParticle, particle_greater > _activeParticles; 174 172 std::vector<NewParticle> _newParticles; 175 173 … … 409 407 } 410 408 409 } 410 411 411 #endif -
nanovis/branches/1.1/ParticleSystemFactory.cpp
r3502 r4889 15 15 #include "Trace.h" 16 16 17 using namespace nv; 17 18 using namespace nv::util; 18 19 -
nanovis/branches/1.1/ParticleSystemFactory.h
r3502 r4889 4 4 * 5 5 */ 6 #ifndef PARTICLESYSTEMFACTORY_H7 #define PARTICLESYSTEMFACTORY_H6 #ifndef NV_PARTICLESYSTEMFACTORY_H 7 #define NV_PARTICLESYSTEMFACTORY_H 8 8 9 9 #include <string> 10 10 11 11 #include <expat.h> 12 13 namespace nv { 12 14 13 15 class ParticleSystem; … … 32 34 }; 33 35 36 } 37 34 38 #endif -
nanovis/branches/1.1/PerfQuery.cpp
r3502 r4889 17 17 18 18 #include "PerfQuery.h" 19 20 using namespace nv; 19 21 20 22 PerfQuery::PerfQuery() -
nanovis/branches/1.1/PerfQuery.h
r3502 r4889 16 16 * ====================================================================== 17 17 */ 18 #ifndef PERFQUERY_H19 #define PERFQUERY_H18 #ifndef NV_PERFQUERY_H 19 #define NV_PERFQUERY_H 20 20 21 21 #include <stdio.h> … … 24 24 25 25 #include "Trace.h" 26 27 namespace nv { 26 28 27 29 class PerfQuery … … 68 70 } 69 71 } 72 73 } 74 70 75 #endif 71 76 -
nanovis/branches/1.1/Plane.h
r3502 r4889 14 14 * ====================================================================== 15 15 */ 16 #ifndef PLANE_H17 #define PLANE_H16 #ifndef NV_PLANE_H 17 #define NV_PLANE_H 18 18 19 19 #include <vrmath/Vector3f.h> -
nanovis/branches/1.1/PlaneRenderer.cpp
r4612 r4889 1 1 /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ 2 2 /* 3 * ----------------------------------------------------------------------4 * PlaneRenderer.cpp : PlaneRenderer class for volume visualization5 *6 * ======================================================================7 * AUTHOR: Wei Qiao <qiaow@purdue.edu>8 * Purdue Rendering and Perceptualization Lab (PURPL)9 *10 3 * Copyright (c) 2004-2013 HUBzero Foundation, LLC 11 4 * 12 * See the file "license.terms" for information on usage and 13 * redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. 14 * ====================================================================== 5 * Authors: 6 * Wei Qiao <qiaow@purdue.edu> 15 7 */ 16 8 … … 20 12 #include "Trace.h" 21 13 14 using namespace nv; 15 22 16 PlaneRenderer::PlaneRenderer(int width, int height) : 23 17 _activePlane(-1), … … 25 19 _renderWidth(width), 26 20 _renderHeight(height), 27 _shader(new NvColorTableShader())21 _shader(new ColorTableShader()) 28 22 { 29 23 _plane.clear(); -
nanovis/branches/1.1/PlaneRenderer.h
r3502 r4889 1 1 /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ 2 2 /* 3 * ----------------------------------------------------------------------4 * PlaneRenderer.h : PlaneRenderer class for 2D visualization5 *6 * ======================================================================7 * AUTHOR: Wei Qiao <qiaow@purdue.edu>8 * Purdue Rendering and Perceptualization Lab (PURPL)9 *10 3 * Copyright (c) 2004-2013 HUBzero Foundation, LLC 11 4 * 12 * See the file "license.terms" for information on usage and 13 * redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. 14 * ====================================================================== 5 * Authors: 6 * Wei Qiao <qiaow@purdue.edu> 15 7 */ 16 #ifndef PLANE_RENDERER_H17 #define PLANE_RENDERER_H8 #ifndef NV_PLANE_RENDERER_H 9 #define NV_PLANE_RENDERER_H 18 10 19 11 #include <vector> 20 12 21 #include " NvColorTableShader.h"13 #include "ColorTableShader.h" 22 14 #include "TransferFunction.h" 23 15 #include "Texture2D.h" 16 17 namespace nv { 24 18 25 19 class PlaneRenderer … … 52 46 int _renderHeight; 53 47 54 NvColorTableShader *_shader;48 ColorTableShader *_shader; 55 49 }; 56 50 51 } 52 57 53 #endif -
nanovis/branches/1.1/PointSet.cpp
r3502 r4889 12 12 #include "PointSet.h" 13 13 #include "PCASplit.h" 14 15 using namespace nv; 14 16 15 17 void -
nanovis/branches/1.1/PointSet.h
r3502 r4889 4 4 * 5 5 */ 6 #ifndef POINT_SET_H7 #define POINT_SET_H6 #ifndef NV_POINT_SET_H 7 #define NV_POINT_SET_H 8 8 9 9 #include <vrmath/Vector3f.h> … … 11 11 12 12 #include "PCASplit.h" 13 14 namespace nv { 13 15 14 16 class PointSet … … 87 89 }; 88 90 91 } 92 89 93 #endif -
nanovis/branches/1.1/PointSetRenderer.cpp
r3502 r4889 14 14 #include "PCASplit.h" 15 15 16 using namespace nv; 16 17 using namespace nv::util; 18 using namespace vrmath; 19 using namespace PCA; 17 20 18 21 #define USE_TEXTURE … … 50 53 delete loader; 51 54 delete image; 52 _bucketSort = new PCA::BucketSort(1024);55 _bucketSort = new BucketSort(1024); 53 56 } 54 57 … … 57 60 } 58 61 59 void PointSetRenderer::renderPoints(P CA::Point *points, int length)62 void PointSetRenderer::renderPoints(Point *points, int length) 60 63 { 61 P CA::Point *p = points;64 Point *p = points; 62 65 for (int i = 0; i < length; ++i, ++p) { 63 66 glColor4f(p->color.x, p->color.y, p->color.z, p->color.w); … … 66 69 } 67 70 68 void PointSetRenderer::renderCluster( PCA::ClusterList** bucket, int size, int level)71 void PointSetRenderer::renderCluster(ClusterList** bucket, int size, int level) 69 72 { 70 73 float quadratic[] = { 1.0f, 0.0f, 0.01f }; … … 82 85 glBegin(GL_POINTS); 83 86 84 PCA::ClusterList *p;87 ClusterList *p; 85 88 for (int i = size - 1; i >= 0; --i) { 86 89 p = bucket[i]; … … 107 110 } 108 111 109 void PointSetRenderer::render( PCA::ClusterAccel *cluster, const Matrix4x4d& mat,112 void PointSetRenderer::render(ClusterAccel *cluster, const Matrix4x4d& mat, 110 113 int sortLevel, const Vector3f& scale, const Vector3f& origin) 111 114 { … … 130 133 glPushMatrix(); 131 134 float s = 1.0f / scale.x; 132 Vector3 shift(origin.x + scale.x * 0.5, origin.x + scale.x * 0.5, origin.x + scale.x * 0.5);135 Vector3f shift(origin.x + scale.x * 0.5, origin.x + scale.x * 0.5, origin.x + scale.x * 0.5); 133 136 glScalef(s, scale.y / scale.x * s, scale.z / scale.x * s); 134 137 -
nanovis/branches/1.1/PointSetRenderer.h
r3502 r4889 4 4 * 5 5 */ 6 #ifndef POINT_SET_RENDERER_H7 #define POINT_SET_RENDERER_H6 #ifndef NV_POINT_SET_RENDERER_H 7 #define NV_POINT_SET_RENDERER_H 8 8 9 9 #include <vrmath/Vector3f.h> … … 14 14 #include "PointShader.h" 15 15 #include "Texture2D.h" 16 17 namespace nv { 16 18 17 19 class PointSetRenderer … … 34 36 }; 35 37 38 } 39 36 40 #endif -
nanovis/branches/1.1/PointShader.cpp
r3502 r4889 6 6 #include "PointShader.h" 7 7 8 using namespace nv; 9 8 10 PointShader::PointShader() : 9 NvShader(),11 Shader(), 10 12 _scale(1.0f), 11 13 _normal(NULL) … … 29 31 //setVPTextureParameter("normal", _normal->getGraphicsObjectID()); 30 32 31 NvShader::bind();33 Shader::bind(); 32 34 } 33 35 … … 36 38 //disableVPTextureParameter("normal"); 37 39 38 NvShader::unbind();40 Shader::unbind(); 39 41 } -
nanovis/branches/1.1/PointShader.h
r3502 r4889 4 4 * 5 5 */ 6 #ifndef POINTSHADER_H7 #define POINTSHADER_H6 #ifndef NV_POINTSHADER_H 7 #define NV_POINTSHADER_H 8 8 9 #include " NvShader.h"9 #include "Shader.h" 10 10 #include "Texture3D.h" 11 11 12 class PointShader : public NvShader 12 namespace nv { 13 14 class PointShader : public Shader 13 15 { 14 16 public: … … 33 35 private: 34 36 float _scale; 35 float _scale;36 37 Texture3D *_normal; 37 38 }; 38 39 40 } 41 39 42 #endif -
nanovis/branches/1.1/ReaderCommon.cpp
r3580 r4889 4 4 * 5 5 */ 6 7 #include <cstdlib> 8 9 #include <vrmath/Vector3f.h> 10 6 11 #include "ReaderCommon.h" 7 12 #include "GradientFilter.h" 8 13 9 #include <vrmath/Vector3f.h> 10 11 #include "stdlib.h" 12 14 using namespace nv; 13 15 using namespace vrmath; 14 16 15 17 float * 16 merge(float *scalar, float *gradient, int size)18 nv::merge(float *scalar, float *gradient, int size) 17 19 { 18 20 float *data = (float *)malloc(sizeof(float) * 4 * size); … … 43 45 */ 44 46 void 45 n ormalizeScalar(float *data, int count, int stride, double vmin, double vmax)47 nv::normalizeScalar(float *data, int count, int stride, double vmin, double vmax) 46 48 { 47 49 double dv = vmax - vmin; … … 82 84 */ 83 85 float * 84 computeGradient(float *data,85 int nx, int ny, int nz,86 float dx, float dy, float dz,87 float min, float max)86 nv::computeGradient(float *data, 87 int nx, int ny, int nz, 88 float dx, float dy, float dz, 89 float min, float max) 88 90 { 89 91 int npts = nx * ny * nz; … … 123 125 */ 124 126 void 125 computeSimpleGradient(float *data,126 int nx, int ny, int nz,127 float dx, float dy, float dz)127 nv::computeSimpleGradient(float *data, 128 int nx, int ny, int nz, 129 float dx, float dy, float dz) 128 130 { 129 131 bool clampToEdge = true; -
nanovis/branches/1.1/ReaderCommon.h
r3574 r4889 4 4 * 5 5 */ 6 #ifndef DX_READER_COMMON_H 7 #define DX_READER_COMMON_H 6 #ifndef NV_READER_COMMON_H 7 #define NV_READER_COMMON_H 8 9 namespace nv { 8 10 9 11 extern float * … … 24 26 float dx = 1.0f, float dy = 1.0f, float dz = 1.0f); 25 27 28 } 29 26 30 #endif -
nanovis/branches/1.1/RenderVertexArray.cpp
r3502 r4889 42 42 #include "RenderVertexArray.h" 43 43 #include "Trace.h" 44 45 using namespace nv; 44 46 45 47 RenderVertexArray::RenderVertexArray(int nverts, GLint size, GLenum type) : -
nanovis/branches/1.1/RenderVertexArray.h
r3502 r4889 1 1 /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ 2 2 /* 3 * ---------------------------------------------------------------------- 4 * Render to vertex array class 3 * Copyright (c) 2004-2013 HUBzero Foundation, LLC 5 4 * 6 * ====================================================================== 7 * AUTHOR: Wei Qiao <qiaow@purdue.edu> 8 * Purdue Rendering and Perceptualization Lab (PURPL) 9 * 10 * Copyright (c) 2004-2013 HUBzero Foundation, LLC 11 * 12 * See the file "license.terms" for information on usage and 13 * redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. 14 * ====================================================================== 5 * Author: 6 * Wei Qiao <qiaow@purdue.edu> 15 7 */ 16 #ifndef RENDERVERTEXARRAY_H17 #define RENDERVERTEXARRAY_H8 #ifndef NV_RENDERVERTEXARRAY_H 9 #define NV_RENDERVERTEXARRAY_H 18 10 19 11 #include <GL/glew.h> 20 12 #include <GL/gl.h> 13 14 namespace nv { 21 15 22 16 class RenderVertexArray … … 44 38 }; 45 39 40 } 41 46 42 #endif -
nanovis/branches/1.1/Switch.h
r2877 r4889 28 28 */ 29 29 30 #ifndef SWITCH_H31 #define SWITCH_H30 #ifndef RAPPTURE_SWITCH_H 31 #define RAPPTURE_SWITCH_H 32 32 33 33 #ifdef HAVE_STDDEF_H … … 133 133 } 134 134 135 #endif /* BLT_SWITCH_H */135 #endif -
nanovis/branches/1.1/Texture1D.cpp
r3561 r4889 21 21 #include "Texture1D.h" 22 22 #include "Trace.h" 23 24 using namespace nv; 23 25 24 26 Texture1D::Texture1D() : -
nanovis/branches/1.1/Texture1D.h
r3502 r4889 14 14 * ====================================================================== 15 15 */ 16 #ifndef TEXTURE1D_H17 #define TEXTURE1D_H16 #ifndef NV_TEXTURE1D_H 17 #define NV_TEXTURE1D_H 18 18 19 19 #include <GL/glew.h> 20 21 namespace nv { 20 22 21 23 class Texture1D … … 68 70 }; 69 71 72 } 73 70 74 #endif -
nanovis/branches/1.1/Texture2D.cpp
r3561 r4889 22 22 #include "Texture2D.h" 23 23 #include "Trace.h" 24 25 using namespace nv; 24 26 25 27 Texture2D::Texture2D() : -
nanovis/branches/1.1/Texture2D.h
r3502 r4889 14 14 * ====================================================================== 15 15 */ 16 #ifndef TEXTURE2D_H17 #define TEXTURE2D_H16 #ifndef NV_TEXTURE2D_H 17 #define NV_TEXTURE2D_H 18 18 19 19 #include <GL/glew.h> 20 21 namespace nv { 20 22 21 23 class Texture2D … … 77 79 }; 78 80 81 } 82 79 83 #endif -
nanovis/branches/1.1/Texture3D.cpp
r3561 r4889 22 22 #include "Texture3D.h" 23 23 #include "Trace.h" 24 25 using namespace nv; 24 26 25 27 Texture3D::Texture3D() : -
nanovis/branches/1.1/Texture3D.h
r3502 r4889 14 14 * ====================================================================== 15 15 */ 16 #ifndef TEXTURE3D_H17 #define TEXTURE3D_H16 #ifndef NV_TEXTURE3D_H 17 #define NV_TEXTURE3D_H 18 18 19 19 #include <GL/glew.h> 20 21 namespace nv { 20 22 21 23 class Texture3D … … 86 88 }; 87 89 90 } 91 88 92 #endif -
nanovis/branches/1.1/TransferFunction.cpp
r4819 r4889 22 22 #include "TransferFunction.h" 23 23 24 using namespace nv; 24 25 using namespace vrmath; 25 26 -
nanovis/branches/1.1/TransferFunction.h
r4819 r4889 14 14 * ====================================================================== 15 15 */ 16 #ifndef TRANSFER_FUNCTION_H17 #define TRANSFER_FUNCTION_H16 #ifndef NV_TRANSFER_FUNCTION_H 17 #define NV_TRANSFER_FUNCTION_H 18 18 19 19 #include <string> … … 22 22 23 23 #include "Texture1D.h" 24 25 namespace nv { 24 26 25 27 class TransferFunction … … 78 80 }; 79 81 82 } 83 80 84 #endif -
nanovis/branches/1.1/Unirect.h
r4877 r4889 5 5 * Author: George A. Howlett <gah@purdue.edu> 6 6 */ 7 #ifndef UNIRECT_H8 #define UNIRECT_H7 #ifndef RAPPTURE_UNIRECT_H 8 #define RAPPTURE_UNIRECT_H 9 9 10 10 #include <float.h> -
nanovis/branches/1.1/VelocityArrowsSlice.cpp
r3502 r4889 19 19 #include "nanovis.h" 20 20 #include "VelocityArrowsSlice.h" 21 #include "NvShader.h" 22 #include "NvCamera.h" 23 21 #include "Shader.h" 22 #include "Camera.h" 23 24 using namespace nv; 24 25 using namespace nv::util; 25 26 using namespace vrmath; … … 423 424 tan(NanoVis::getCamera()->fov() * 0.5) * NanoVis::winHeight * 0.5); 424 425 _particleShader.setGLStateMatrixVPParameter("modelview", 425 NvShader::MODELVIEW_MATRIX,426 NvShader::MATRIX_IDENTITY);426 Shader::MODELVIEW_MATRIX, 427 Shader::MATRIX_IDENTITY); 427 428 _particleShader.setGLStateMatrixVPParameter("mvp", 428 NvShader::MODELVIEW_PROJECTION_MATRIX,429 NvShader::MATRIX_IDENTITY);429 Shader::MODELVIEW_PROJECTION_MATRIX, 430 Shader::MATRIX_IDENTITY); 430 431 431 432 glEnableClientState(GL_VERTEX_ARRAY); -
nanovis/branches/1.1/VelocityArrowsSlice.h
r3502 r4889 4 4 * 5 5 */ 6 #ifndef VELOCITY_ARROW_SLICE_H7 #define VELOCITY_ARROW_SLICE_H6 #ifndef NV_VELOCITY_ARROW_SLICE_H 7 #define NV_VELOCITY_ARROW_SLICE_H 8 8 9 9 #include <vector> … … 12 12 13 13 #include "Texture2D.h" 14 #include "NvShader.h" 14 #include "Shader.h" 15 16 namespace nv { 15 17 16 18 class VelocityArrowsSlice … … 103 105 float _maxPointSize; 104 106 105 NvShader _queryVelocityFP; 106 107 NvShader _particleShader; 107 Shader _queryVelocityFP; 108 Shader _particleShader; 108 109 109 110 int _renderTargetWidth; … … 135 136 }; 136 137 138 } 139 137 140 #endif -
nanovis/branches/1.1/Volume.cpp
r4818 r4889 24 24 #include "Trace.h" 25 25 26 using namespace nv; 26 27 using namespace vrmath; 27 28 -
nanovis/branches/1.1/Volume.h
r4818 r4889 1 1 /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ 2 2 /* 3 * ---------------------------------------------------------------------- 4 * Volume.h: 3d volume class 3 * Copyright (c) 2004-2013 HUBzero Foundation, LLC 5 4 * 6 * ====================================================================== 7 * AUTHOR: Wei Qiao <qiaow@purdue.edu> 8 * Purdue Rendering and Perceptualization Lab (PURPL) 9 * 10 * Copyright (c) 2004-2013 HUBzero Foundation, LLC 11 * 12 * See the file "license.terms" for information on usage and 13 * redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. 14 * ====================================================================== 5 * Author: 6 * Wei Qiao <qiaow@purdue.edu> 15 7 */ 16 #ifndef VOLUME_H17 #define VOLUME_H8 #ifndef NV_VOLUME_H 9 #define NV_VOLUME_H 18 10 19 11 #include <cstring> … … 26 18 #include "AxisRange.h" 27 19 #include "TransferFunction.h" 20 21 namespace nv { 28 22 29 23 struct CutPlane { … … 479 473 } 480 474 475 } 476 481 477 #endif -
nanovis/branches/1.1/VolumeInterpolator.cpp
r4874 r4889 16 16 #include "Trace.h" 17 17 18 using namespace nv; 18 19 using namespace vrmath; 19 20 -
nanovis/branches/1.1/VolumeInterpolator.h
r3502 r4889 4 4 * 5 5 */ 6 #ifndef VOLUME_INTERPOLATOR_H7 #define VOLUME_INTERPOLATOR_H6 #ifndef NV_VOLUME_INTERPOLATOR_H 7 #define NV_VOLUME_INTERPOLATOR_H 8 8 9 9 #include <vector> 10 10 11 11 #include "Volume.h" 12 13 namespace nv { 12 14 13 15 class VolumeInterpolator … … 64 66 } 65 67 68 } 69 66 70 #endif 67 71 -
nanovis/branches/1.1/VolumeRenderer.cpp
r4818 r4889 28 28 #include "Plane.h" 29 29 #include "ConvexPolygon.h" 30 #include " NvStdVertexShader.h"30 #include "StdVertexShader.h" 31 31 #include "Trace.h" 32 32 33 using namespace nv; 33 34 using namespace vrmath; 34 35 … … 52 53 void VolumeRenderer::initShaders() 53 54 { 54 _cutplaneShader = new NvShader();55 _cutplaneShader = new Shader(); 55 56 _cutplaneShader->loadVertexProgram("cutplane_vp.cg", "main"); 56 57 _cutplaneShader->loadFragmentProgram("cutplane_fp.cg", "main"); 57 58 58 59 //standard vertex program 59 _stdVertexShader = new NvStdVertexShader();60 _stdVertexShader = new StdVertexShader(); 60 61 61 62 //volume rendering shader: one cubic volume 62 _regularVolumeShader = new NvRegularVolumeShader();63 _regularVolumeShader = new RegularVolumeShader(); 63 64 64 65 //volume rendering shader: one zincblende orbital volume. … … 70 71 //The engine is already capable of rendering multiple volumes and combine them. Thus, we just invoke this shader on 71 72 //S, P, D and SS orbitals with different transfor functions. The result is a multi-orbital rendering. 72 _zincBlendeShader = new NvZincBlendeVolumeShader();73 _zincBlendeShader = new ZincBlendeVolumeShader(); 73 74 } 74 75 … … 286 287 glScalef(volScaling.x, volScaling.y, volScaling.z); 287 288 _cutplaneShader->setGLStateMatrixVPParameter("modelViewProjMatrix", 288 NvShader::MODELVIEW_PROJECTION_MATRIX);289 Shader::MODELVIEW_PROJECTION_MATRIX); 289 290 glPopMatrix(); 290 291 -
nanovis/branches/1.1/VolumeRenderer.h
r3502 r4889 1 1 /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ 2 2 /* 3 * ---------------------------------------------------------------------- 4 * VolumeRenderer.h : VolumeRenderer class for volume visualization 3 * Copyright (c) 2004-2013 HUBzero Foundation, LLC 5 4 * 6 * ====================================================================== 7 * AUTHOR: Wei Qiao <qiaow@purdue.edu> 8 * Purdue Rendering and Perceptualization Lab (PURPL) 9 * 10 * Copyright (c) 2004-2013 HUBzero Foundation, LLC 11 * 12 * See the file "license.terms" for information on usage and 13 * redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. 14 * ====================================================================== 5 * Authors: 6 * Wei Qiao <qiaow@purdue.edu> 15 7 */ 16 #ifndef _VOLUME_RENDERER_H_17 #define _VOLUME_RENDERER_H_8 #ifndef NV_VOLUME_RENDERER_H 9 #define NV_VOLUME_RENDERER_H 18 10 19 11 #include <vrmath/Matrix4x4d.h> … … 21 13 #include "Volume.h" 22 14 #include "VolumeInterpolator.h" 23 #include "NvRegularVolumeShader.h" 24 #include "NvZincBlendeVolumeShader.h" 25 #include "NvStdVertexShader.h" 15 #include "RegularVolumeShader.h" 16 #include "ZincBlendeVolumeShader.h" 17 #include "StdVertexShader.h" 18 19 namespace nv { 26 20 27 21 class VolumeRenderer … … 85 79 * Shader for single slice cutplane render 86 80 */ 87 NvShader *_cutplaneShader;81 Shader *_cutplaneShader; 88 82 89 83 /** 90 84 * Shader for rendering a single cubic volume 91 85 */ 92 NvRegularVolumeShader *_regularVolumeShader;86 RegularVolumeShader *_regularVolumeShader; 93 87 94 88 /** … … 106 100 * same space. 107 101 */ 108 NvZincBlendeVolumeShader *_zincBlendeShader;102 ZincBlendeVolumeShader *_zincBlendeShader; 109 103 110 104 /** 111 105 * standard vertex shader 112 106 */ 113 NvStdVertexShader *_stdVertexShader;107 StdVertexShader *_stdVertexShader; 114 108 }; 115 109 110 } 111 116 112 #endif -
nanovis/branches/1.1/VtkReader.cpp
r4612 r4889 20 20 #include "Volume.h" 21 21 #include "Trace.h" 22 23 using namespace nv; 22 24 23 25 enum FieldType { … … 181 183 182 184 Volume * 183 load_vtk_volume_stream(Rappture::Outcome& result, const char *tag, std::iostream& fin)185 nv::load_vtk_volume_stream(Rappture::Outcome& result, const char *tag, std::iostream& fin) 184 186 { 185 187 TRACE("Enter tag:%s", tag); -
nanovis/branches/1.1/VtkReader.h
r3503 r4889 4 4 * 5 5 */ 6 #ifndef VTKREADER_H7 #define VTKREADER_H6 #ifndef NV_VTKREADER_H 7 #define NV_VTKREADER_H 8 8 9 9 #include <iostream> 10 10 11 11 namespace Rappture { 12 12 class Outcome; 13 13 } 14 15 namespace nv { 16 14 17 class Volume; 15 18 … … 17 20 load_vtk_volume_stream(Rappture::Outcome& status, const char *tag, std::iostream& fin); 18 21 22 } 23 19 24 #endif -
nanovis/branches/1.1/ZincBlendeReconstructor.cpp
r3611 r4889 6 6 * Insoo Woo <iwoo@purdue.edu> 7 7 */ 8 #include <stdio.h> 9 #include <string.h> 10 #include <stdlib.h> 8 #include <cstdio> 9 #include <cstring> 10 #include <cstdlib> 11 #include <fstream> 11 12 12 13 #include <vrmath/Vector3f.h> … … 372 373 373 374 ZincBlendeVolume * 374 ZincBlendeReconstructor::loadFromMemory( void *dataBlock)375 ZincBlendeReconstructor::loadFromMemory(const void *dataBlock) 375 376 { 376 377 ZincBlendeVolume *volume = NULL; … … 380 381 int version = 1; 381 382 382 unsigned char *stream = (unsigned char *)dataBlock;383 const unsigned char *stream = (const unsigned char *)dataBlock; 383 384 char str[5][20]; 384 385 do { … … 472 473 } 473 474 474 void ZincBlendeReconstructor::getLine( unsigned char*& stream)475 void ZincBlendeReconstructor::getLine(const unsigned char*& stream) 475 476 { 476 477 char ch; -
nanovis/branches/1.1/ZincBlendeReconstructor.h
r3611 r4889 9 9 #define NV_ZINC_BLENDE_RECONSTRUCTOR_H 10 10 11 #include <stdio.h> 12 #include <ostream> 13 #include <sstream> 14 #include <fstream> 11 #include <istream> 15 12 16 13 #include <vrmath/Vector3f.h> … … 35 32 ZincBlendeVolume *loadFromStream(std::istream& stream); 36 33 37 ZincBlendeVolume *loadFromMemory( void *dataBlock);34 ZincBlendeVolume *loadFromMemory(const void *dataBlock); 38 35 39 36 /** … … 67 64 */ 68 65 void getLine(std::istream& stream); 69 void getLine( unsigned char*& stream);66 void getLine(const unsigned char*& stream); 70 67 71 68 char buff[255]; -
nanovis/branches/1.1/ZincBlendeVolume.cpp
r3502 r4889 21 21 #include "ZincBlendeVolume.h" 22 22 23 using namespace nv; 23 24 using namespace vrmath; 24 25 -
nanovis/branches/1.1/ZincBlendeVolume.h
r3502 r4889 1 1 /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ 2 2 /* 3 * ---------------------------------------------------------------------- 4 * ZincBlendeVolume.h: 3d zincblende volume class, a subclass of Volume. 5 * It contains two cubic volumes. 3 * Copyright (c) 2004-2013 HUBzero Foundation, LLC 6 4 * 7 * ====================================================================== 8 * AUTHOR: Wei Qiao <qiaow@purdue.edu> 9 * Purdue Rendering and Perceptualization Lab (PURPL) 10 * 11 * Copyright (c) 2004-2013 HUBzero Foundation, LLC 12 * 13 * See the file "license.terms" for information on usage and 14 * redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. 15 * ====================================================================== 5 * Authors: 6 * Wei Qiao <qiaow@purdue.edu> 16 7 */ 17 #ifndef _ZINCBLENDE_VOLUME_H_18 #define _ZINCBLENDE_VOLUME_H_8 #ifndef NV_ZINCBLENDE_VOLUME_H 9 #define NV_ZINCBLENDE_VOLUME_H 19 10 20 11 #include <vrmath/Vector3f.h> … … 22 13 #include "Volume.h" 23 14 15 namespace nv { 16 17 /** 18 * \brief 3D ZincBlende volume, contains two cubic volumes 19 */ 24 20 class ZincBlendeVolume : public Volume 25 21 { … … 36 32 }; 37 33 34 } 35 38 36 #endif -
nanovis/branches/1.1/dxReader.cpp
r4821 r4889 39 39 #include "config.h" 40 40 #include "nanovis.h" 41 #include "dxReader.h" 41 42 #include "Unirect.h" 42 43 #include "Volume.h" 43 #include "ZincBlendeVolume.h" 44 #include "NvZincBlendeReconstructor.h" 44 45 using namespace nv; 45 46 46 47 /** … … 57 58 */ 58 59 Volume * 59 load_dx_volume_stream(Rappture::Outcome& result, const char *tag,60 std::iostream& fin)60 nv::load_dx_volume_stream(Rappture::Outcome& result, const char *tag, 61 std::iostream& fin) 61 62 { 62 63 TRACE("Enter tag:%s", tag); -
nanovis/branches/1.1/dxReader.h
r3502 r4889 10 10 11 11 namespace Rappture { 12 12 class Outcome; 13 13 } 14 15 namespace nv { 16 14 17 class Volume; 15 18 … … 18 21 std::iostream& fin); 19 22 23 } 24 20 25 #endif -
nanovis/branches/1.1/nanovis.cpp
r4879 r4889 49 49 #include "Grid.h" 50 50 #include "HeightMap.h" 51 #include " NvCamera.h"52 #include " NvLIC.h"53 #include " NvShader.h"51 #include "Camera.h" 52 #include "LIC.h" 53 #include "Shader.h" 54 54 #include "PlaneRenderer.h" 55 55 #include "Texture2D.h" … … 84 84 Fonts *NanoVis::fonts; 85 85 int NanoVis::updir = Y_POS; 86 NvCamera *NanoVis::cam = NULL;86 Camera *NanoVis::cam = NULL; 87 87 RenderContext *NanoVis::renderContext = NULL; 88 88 … … 106 106 VolumeRenderer *NanoVis::volRenderer = NULL; 107 107 VelocityArrowsSlice *NanoVis::velocityArrowsSlice = NULL; 108 NvLIC *NanoVis::licRenderer = NULL;108 LIC *NanoVis::licRenderer = NULL; 109 109 PlaneRenderer *NanoVis::planeRenderer = NULL; 110 110 Grid *NanoVis::grid = NULL; … … 466 466 void cgErrorCallback(void) 467 467 { 468 if (! NvShader::printErrorInfo()) {468 if (!Shader::printErrorInfo()) { 469 469 TRACE("Cg error, exiting..."); 470 470 exit(1); … … 541 541 ImageLoaderFactory::getInstance()->addLoaderImpl("bmp", new BMPImageLoaderImpl()); 542 542 543 NvShader::initCg();544 NvShader::setErrorCallback(cgErrorCallback);543 Shader::initCg(); 544 Shader::setErrorCallback(cgErrorCallback); 545 545 546 546 fonts = new Fonts(); … … 549 549 550 550 velocityArrowsSlice = new VelocityArrowsSlice; 551 licRenderer = new NvLIC(NMESH, NPIX, NPIX, _licAxis, _licSlice);551 licRenderer = new LIC(NMESH, NPIX, NPIX, _licAxis, _licSlice); 552 552 553 553 grid = new Grid(); … … 570 570 571 571 //create the camera with default setting 572 cam = new NvCamera(0, 0, winWidth, winHeight,573 572 cam = new Camera(0, 0, winWidth, winHeight, 573 def_eye_x, def_eye_y, def_eye_z); 574 574 575 575 glEnable(GL_TEXTURE_2D); -
nanovis/branches/1.1/nanovis.h
r4886 r4889 40 40 class Fonts; 41 41 } 42 }43 42 44 class NvCamera;43 class Camera; 45 44 class Flow; 46 45 class Grid; 47 46 class HeightMap; 48 class NvLIC; 49 class NvParticleRenderer; 47 class LIC; 50 48 class PlaneRenderer; 51 49 class Texture2D; … … 91 89 static void removeAllData(); 92 90 93 static const NvCamera *getCamera()91 static const Camera *getCamera() 94 92 { 95 93 return cam; … … 156 154 static unsigned char *screenBuffer; 157 155 static Texture2D *legendTexture; 158 static nv::util::Fonts *fonts;156 static util::Fonts *fonts; 159 157 static int updir; 160 static NvCamera *cam;161 static nv::graphics::RenderContext *renderContext;158 static Camera *cam; 159 static graphics::RenderContext *renderContext; 162 160 163 161 static TransferFunctionHashmap tfTable; ///< maps transfunc name to TransferFunction object … … 172 170 static VolumeRenderer *volRenderer; 173 171 static VelocityArrowsSlice *velocityArrowsSlice; 174 static NvLIC *licRenderer;172 static LIC *licRenderer; 175 173 static PlaneRenderer *planeRenderer; 176 174 static Grid *grid; … … 186 184 }; 187 185 186 } 187 188 188 #endif -
nanovis/branches/1.1/nanovisServer.cpp
r4883 r4889 36 36 #include "Command.h" 37 37 #include "ReadBuffer.h" 38 #include " NvShader.h"38 #include "Shader.h" 39 39 #include "Trace.h" 40 40 … … 334 334 NanoVis::removeAllData(); 335 335 336 NvShader::exitCg();336 Shader::exitCg(); 337 337 338 338 //close log file … … 493 493 void shaderErrorCallback(void) 494 494 { 495 if (! NvShader::printErrorInfo()) {495 if (!Shader::printErrorInfo()) { 496 496 TRACE("Shader error, exiting..."); 497 497 exitService(1); … … 574 574 TRACE("File descriptors: in %d out %d log %d", g_fdIn, g_fdOut, fileno(g_fLog)); 575 575 576 /* This synchronizes the client with the server, so that the client 577 * doesn't start writing commands before the server is ready. It could 578 * also be used to supply information about the server (version, memory 579 * size, etc). */ 576 580 fprintf(g_fOut, "NanoVis %s (build %s)\n", NANOVIS_VERSION_STRING, SVN_VERSION); 577 581 fflush(g_fOut); … … 634 638 635 639 // Override callback with one that cleans up server on exit 636 NvShader::setErrorCallback(shaderErrorCallback);640 Shader::setErrorCallback(shaderErrorCallback); 637 641 638 642 if (!NanoVis::initGL()) { -
nanovis/branches/1.1/vrmath/include/vrmath/Vector3f.h
r3567 r4889 48 48 Vector3f normalize() const; 49 49 50 Vector3f scale( Vector3f& sc) const;50 Vector3f scale(const Vector3f& sc) const; 51 51 52 52 Vector3f scale(float scale) const; … … 236 236 } 237 237 238 inline Vector3f Vector3f::scale( Vector3f& sc) const238 inline Vector3f Vector3f::scale(const Vector3f& sc) const 239 239 { 240 240 return Vector3f(x * sc.x, y * sc.y, z * sc.z);
Note: See TracChangeset
for help on using the changeset viewer.