This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @brief Get distance from a point to line | |
* | |
* @param p0 The point | |
* @param p1 Starting point of line | |
* @param p2 End point of line | |
* | |
* @return distance*distance | |
*/ | |
float pointLineDistance(const glm::vec2 &p0, const glm::vec2 &p1, const glm::vec2 &p2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vec4 uvToEye(vec2 texCoord, float z) //screen to camera coordinate | |
{ | |
const vec4 viewport = vec4(0, 0, 1, 1); | |
vec3 ndcPos; | |
//ndcPos.xy = ((2.0 * texCoord.xy)-(2.0*viewport.xy))/(viewport.zw)-1; | |
ndcPos.xy = 2 * (texCoord.xy) - vec2(1.0, 1.0); | |
ndcPos.z = (2.0 * z - 1.0); | |
vec4 clipPos; | |
//clipPos.w = camMats.projMat[3][2]/ (ndcPos.z - (camMats.projMat[2][2]/camMats.projMat[2][3])); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Tkinter, Tkconstants, tkFileDialog | |
import DFS_BFS | |
class TkFileDialogExample(Tkinter.Frame): | |
adjPath = '' | |
infoPath = '' | |
res = [] | |
def __init__(self, root): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cuh | |
void *dDensSum; | |
void *dDensCount; | |
cu:init() | |
gpuErrchk(cudaMalloc((void**)&dDensSum, sizeof(float))); | |
gpuErrchk(cudaMalloc((void**)&dDensCount, sizeof(int))); | |
cu:~Points() | |
gpuErrchk(cudaFree(dDensSum)) | |
gpuErrchk(cudafree(dDensCount)) | |
cu: //Copy back to CPU |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#This python file is used to search the tree | |
from collections import deque | |
class GraphSearcher: | |
res = [] | |
flag = []; | |
adjMat = []; | |
nodeNames = []; | |
def init(self, fileName, nodeNameFile): | |
#reset everything | |
self.res = [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include <vector> | |
#include <sstream> | |
std::string RESET = "\033[0m" ; | |
std::string BLACK = "\033[30m"; /* Black */ | |
std::string RED = "\033[31m"; /* Red */ | |
std::string GREEN = "\033[32m"; /* Green */ | |
std::string YELLOW = "\033[33m"; /* Yellow */ | |
std::string BLUE = "\033[34m"; /* Blue */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//This part of code should be in the else block of mouseMoveEvent() function of glMain.cpp | |
const int dx = x - _mouseX; | |
const int dy = y - _mouseY; | |
int fviewport[]={0,0,1,1}; | |
double projection[16]; | |
double modelview[16]; | |
glGetDoublev( GL_MODELVIEW_MATRIX, modelview ); | |
glGetDoublev( GL_PROJECTION_MATRIX, projection ); |
NewerOlder