├── external ├── pyTorchChamferDistance │ ├── __init__.py │ ├── .gitignore │ ├── chamfer_distance │ │ ├── __init__.py │ │ └── chamfer_distance.py │ ├── build │ │ ├── build.so │ │ ├── .ninja_deps │ │ ├── chamfer_distance.o │ │ ├── chamfer_distance.cuda.o │ │ ├── .ninja_log │ │ └── build.ninja │ ├── README.md │ └── LICENSE.md └── ldif │ ├── ldif2mesh │ ├── .gitignore │ ├── test-ldif.ply │ ├── test-sif.ply │ ├── extracted.occnet │ ├── test-ldif-output.ply │ ├── test-sif-output.ply │ ├── build-profile.sh │ ├── test.sh │ ├── get_cuda_version.py │ └── build.sh │ ├── gaps │ ├── .gitignore │ ├── vc │ │ ├── glut │ │ │ ├── glut32.dll │ │ │ └── glut32.lib │ │ ├── makefiles │ │ │ ├── Makefile.std │ │ │ ├── Makefile.pkgs │ │ │ └── Makefile.apps │ │ ├── Makefile │ │ └── README.txt │ ├── docs │ │ ├── makeall │ │ ├── Makefile │ │ ├── makepkg │ │ ├── headers │ │ │ ├── R3Graphics.header │ │ │ └── RNBasics.header │ │ ├── makepkg.awk │ │ └── index.html │ ├── apps │ │ ├── pfmview │ │ │ └── Makefile │ │ ├── img2img │ │ │ ├── Makefile │ │ │ └── img2img.cpp │ │ ├── msh2prp │ │ │ └── Makefile │ │ ├── prp2prp │ │ │ └── Makefile │ │ ├── msh2msh │ │ │ └── Makefile │ │ ├── mshinfo │ │ │ └── Makefile │ │ ├── mshalign │ │ │ └── Makefile │ │ ├── prpview │ │ │ └── Makefile │ │ ├── sfl2img │ │ │ └── Makefile │ │ ├── sfl2sfl │ │ │ └── Makefile │ │ ├── conf2conf │ │ │ └── Makefile │ │ ├── mshparam │ │ │ └── Makefile │ │ ├── ptsview │ │ │ └── Makefile │ │ ├── scninfo │ │ │ └── Makefile │ │ ├── scnview │ │ │ └── Makefile │ │ ├── sflinit │ │ │ └── Makefile │ │ ├── mshview │ │ │ └── Makefile │ │ ├── scn2cam │ │ │ └── Makefile │ │ ├── scn2grd │ │ │ └── Makefile │ │ ├── scn2img │ │ │ └── Makefile │ │ ├── scn2scn │ │ │ └── Makefile │ │ ├── sflprocess │ │ │ └── Makefile │ │ ├── sflinfo │ │ │ └── Makefile │ │ ├── sflview │ │ │ └── Makefile │ │ ├── confview │ │ │ └── Makefile │ │ ├── mshsegment │ │ │ └── Makefile │ │ ├── grdview │ │ │ └── Makefile │ │ ├── conf2img │ │ │ ├── Makefile │ │ │ └── RGBDSegmentation.h │ │ ├── gapsview │ │ │ └── Makefile │ │ ├── grd2msh │ │ │ └── Makefile │ │ ├── grd2pts │ │ │ └── Makefile │ │ ├── pfminfo │ │ │ ├── Makefile │ │ │ └── pfminfo.cpp │ │ ├── grd2grd │ │ │ └── Makefile │ │ ├── grd2txt │ │ │ └── Makefile │ │ ├── msh2df │ │ │ └── Makefile │ │ ├── msh2grd │ │ │ └── Makefile │ │ ├── msh2pts │ │ │ └── Makefile │ │ ├── pfm2pfm │ │ │ └── Makefile │ │ ├── qview │ │ │ ├── Makefile │ │ │ └── Occnet.h │ │ ├── Makefile.bak │ │ └── Makefile │ ├── pkgs │ │ ├── gaps.h │ │ ├── fglut │ │ │ ├── fglut.h │ │ │ ├── fglut.c │ │ │ ├── glut.h │ │ │ ├── freeglut.h │ │ │ ├── fglut.sln │ │ │ ├── AUTHORS │ │ │ ├── Makefile │ │ │ ├── freeglut_videoresize.c │ │ │ └── freeglut_overlay.c │ │ ├── R2Shapes │ │ │ ├── R2Draw.h │ │ │ ├── R2Io.h │ │ │ ├── R2Solid.h │ │ │ ├── R2Curve.cpp │ │ │ ├── R2Solid.cpp │ │ │ ├── R2Curve.h │ │ │ ├── R2Shape.cpp │ │ │ ├── Makefile │ │ │ ├── R2Shapes.cpp │ │ │ ├── R2Relate.h │ │ │ ├── R2Xform.cpp │ │ │ ├── R2Shape.h │ │ │ ├── R2Xform.h │ │ │ ├── R2Align.h │ │ │ ├── R2Halfspace.cpp │ │ │ ├── R2Shapes.h │ │ │ ├── R2Perp.cpp │ │ │ └── R2Parall.h │ │ ├── jpeg │ │ │ ├── jversion.h │ │ │ ├── jconfig.h │ │ │ ├── Makefile │ │ │ └── jchuff.h │ │ ├── RNMath │ │ │ ├── RNMatrix.cpp │ │ │ ├── Makefile │ │ │ ├── RNMath.cpp │ │ │ ├── RNMatrix.h │ │ │ ├── RNMath.h │ │ │ ├── RNDenseLUMatrix.h │ │ │ └── RNEquation.h │ │ ├── png │ │ │ ├── inffast.h │ │ │ ├── gzclose.c │ │ │ ├── Makefile │ │ │ └── uncompr.c │ │ ├── RNBasics │ │ │ ├── RNBase.cpp │ │ │ ├── RNFlags.cpp │ │ │ ├── Makefile │ │ │ ├── RNExtern.h │ │ │ ├── RNBasics.cpp │ │ │ ├── RNSvd.h │ │ │ ├── RNBase.h │ │ │ ├── RNError.h │ │ │ ├── RNMem.h │ │ │ ├── RNType.cpp │ │ │ ├── RNTime.h │ │ │ ├── RNBasics.h │ │ │ ├── RNHeap.h │ │ │ ├── RNMap.h │ │ │ └── RNType.h │ │ ├── RGBD │ │ │ ├── Makefile │ │ │ ├── RGBD.cpp │ │ │ ├── RGBDCamera.h │ │ │ └── RGBD.h │ │ ├── R3Graphics │ │ │ ├── Makefile │ │ │ ├── R3Graphics.cpp │ │ │ ├── R3Graphics.h │ │ │ ├── R2Viewport.cpp │ │ │ ├── R3Frustum.h │ │ │ ├── R3DirectionalLight.h │ │ │ └── R3SpotLight.h │ │ ├── R3Shapes │ │ │ ├── R3Solid.h │ │ │ ├── R3Surface.h │ │ │ ├── R3Solid.cpp │ │ │ ├── R3Surface.cpp │ │ │ ├── R3Draw.h │ │ │ ├── Makefile │ │ │ ├── R3Relate.h │ │ │ ├── R3Base.cpp │ │ │ ├── R3Curve.h │ │ │ ├── R3Shapes.cpp │ │ │ ├── R3Base.h │ │ │ ├── R3Curve.cpp │ │ │ ├── R3Xform.cpp │ │ │ ├── R3CatmullRomSpline.h │ │ │ ├── R3Xform.h │ │ │ └── R3Ray.cpp │ │ ├── R3Surfels │ │ │ ├── R3Surfels.cpp │ │ │ ├── Makefile │ │ │ └── R3SurfelFeatureEvaluation.h │ │ └── Makefile │ ├── Makefile │ ├── LICENSE.txt │ ├── makefiles │ │ ├── Makefile.std │ │ └── Makefile.pkgs │ └── README.txt │ ├── util │ ├── __init__.py │ ├── camera_util.py │ ├── gaps_util.py │ └── mesh_util.py │ └── representation │ └── quadrics.py ├── dataset ├── SUNRGBD │ ├── scene_67.json │ ├── scene_4696.json │ ├── scene_2461.json │ ├── preprocessed │ │ ├── layout_avg_file.pkl │ │ └── size_avg_category.pkl │ ├── scene_601.json │ ├── scene_2041.json │ ├── scene_4517.json │ ├── scene_907.json │ ├── scene_557.json │ ├── scene_194.json │ ├── scene_3420.json │ ├── scene_1490.json │ ├── scene_80.json │ ├── scene_3408.json │ ├── scene_4689.json │ ├── scene_5017.json │ ├── scene_769.json │ ├── scene_325.json │ ├── scene_576.json │ ├── scene_91.json │ ├── scene_51.json │ ├── scene_637.json │ └── scene_272.json └── FRONT3D │ └── split │ ├── val │ ├── desk.json │ ├── dresser.json │ └── bookshelf.json │ └── test │ ├── scene_3848.json │ └── demo_colormesh.json ├── figures └── teaser-compressed.jpg ├── requirements.txt ├── eval └── evaluate.sh ├── utils └── memory_util.py ├── ssr └── model │ ├── density.py │ ├── embed.py │ └── Attention_module.py └── .gitignore /external/pyTorchChamferDistance/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /external/ldif/ldif2mesh/.gitignore: -------------------------------------------------------------------------------- 1 | ldif2mesh 2 | -------------------------------------------------------------------------------- /external/pyTorchChamferDistance/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | ._* 3 | 4 | -------------------------------------------------------------------------------- /external/ldif/gaps/.gitignore: -------------------------------------------------------------------------------- 1 | pkgs/*/*.o 2 | apps/*/*.o 3 | lib/*/*.a 4 | bin/*/* 5 | -------------------------------------------------------------------------------- /dataset/SUNRGBD/scene_67.json: -------------------------------------------------------------------------------- 1 | [["67.pkl", 0, "sofa"], ["67.pkl", 1, "sofa"], ["67.pkl", 2, "sofa"]] -------------------------------------------------------------------------------- /dataset/SUNRGBD/scene_4696.json: -------------------------------------------------------------------------------- 1 | [["4696.pkl", 0, "sofa"], ["4696.pkl", 1, "sofa"], ["4696.pkl", 2, "table"]] -------------------------------------------------------------------------------- /external/pyTorchChamferDistance/chamfer_distance/__init__.py: -------------------------------------------------------------------------------- 1 | from .chamfer_distance import ChamferDistance 2 | -------------------------------------------------------------------------------- /figures/teaser-compressed.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaLi-Jack/SSR-code/HEAD/figures/teaser-compressed.jpg -------------------------------------------------------------------------------- /dataset/SUNRGBD/scene_2461.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | "2461.pkl", 4 | 8, 5 | "table" 6 | ] 7 | ] -------------------------------------------------------------------------------- /external/ldif/gaps/vc/glut/glut32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaLi-Jack/SSR-code/HEAD/external/ldif/gaps/vc/glut/glut32.dll -------------------------------------------------------------------------------- /external/ldif/gaps/vc/glut/glut32.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaLi-Jack/SSR-code/HEAD/external/ldif/gaps/vc/glut/glut32.lib -------------------------------------------------------------------------------- /external/ldif/ldif2mesh/test-ldif.ply: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaLi-Jack/SSR-code/HEAD/external/ldif/ldif2mesh/test-ldif.ply -------------------------------------------------------------------------------- /external/ldif/ldif2mesh/test-sif.ply: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaLi-Jack/SSR-code/HEAD/external/ldif/ldif2mesh/test-sif.ply -------------------------------------------------------------------------------- /external/ldif/ldif2mesh/extracted.occnet: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaLi-Jack/SSR-code/HEAD/external/ldif/ldif2mesh/extracted.occnet -------------------------------------------------------------------------------- /external/ldif/ldif2mesh/test-ldif-output.ply: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaLi-Jack/SSR-code/HEAD/external/ldif/ldif2mesh/test-ldif-output.ply -------------------------------------------------------------------------------- /external/ldif/ldif2mesh/test-sif-output.ply: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaLi-Jack/SSR-code/HEAD/external/ldif/ldif2mesh/test-sif-output.ply -------------------------------------------------------------------------------- /external/pyTorchChamferDistance/build/build.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaLi-Jack/SSR-code/HEAD/external/pyTorchChamferDistance/build/build.so -------------------------------------------------------------------------------- /dataset/SUNRGBD/preprocessed/layout_avg_file.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaLi-Jack/SSR-code/HEAD/dataset/SUNRGBD/preprocessed/layout_avg_file.pkl -------------------------------------------------------------------------------- /dataset/SUNRGBD/scene_601.json: -------------------------------------------------------------------------------- 1 | [["601.pkl", 0, "sofa"], ["601.pkl", 1, "sofa"], ["601.pkl", 2, "table"], ["601.pkl", 3, "sofa"], ["601.pkl", 4, "table"]] -------------------------------------------------------------------------------- /external/pyTorchChamferDistance/build/.ninja_deps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaLi-Jack/SSR-code/HEAD/external/pyTorchChamferDistance/build/.ninja_deps -------------------------------------------------------------------------------- /dataset/SUNRGBD/preprocessed/size_avg_category.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaLi-Jack/SSR-code/HEAD/dataset/SUNRGBD/preprocessed/size_avg_category.pkl -------------------------------------------------------------------------------- /external/ldif/gaps/docs/makeall: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | for pkg in RNBasics R2Shapes R3Shapes R3Graphics; do 4 | echo $pkg 5 | ./makepkg $pkg 6 | done 7 | 8 | -------------------------------------------------------------------------------- /external/pyTorchChamferDistance/build/chamfer_distance.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaLi-Jack/SSR-code/HEAD/external/pyTorchChamferDistance/build/chamfer_distance.o -------------------------------------------------------------------------------- /external/pyTorchChamferDistance/build/chamfer_distance.cuda.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaLi-Jack/SSR-code/HEAD/external/pyTorchChamferDistance/build/chamfer_distance.cuda.o -------------------------------------------------------------------------------- /dataset/SUNRGBD/scene_2041.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | "2041.pkl", 4 | 0, 5 | "table" 6 | ], 7 | [ 8 | "2041.pkl", 9 | 1, 10 | "sofa" 11 | ] 12 | ] -------------------------------------------------------------------------------- /dataset/SUNRGBD/scene_4517.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | "4517.pkl", 4 | 0, 5 | "sofa" 6 | ], 7 | [ 8 | "4517.pkl", 9 | 1, 10 | "sofa" 11 | ] 12 | ] -------------------------------------------------------------------------------- /dataset/SUNRGBD/scene_907.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | "907.pkl", 4 | 0 5 | ], 6 | [ 7 | "907.pkl", 8 | 1 9 | ], 10 | [ 11 | "907.pkl", 12 | 2 13 | ] 14 | ] -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | fvcore 2 | iopath 3 | tensorboard 4 | scikit-image 5 | matplotlib 6 | imageio 7 | plotly 8 | pandas 9 | opencv-python 10 | pyqt5 11 | pyyaml 12 | tqdm 13 | trimesh 14 | scipy 15 | setuptools==59.5.0 16 | joblib -------------------------------------------------------------------------------- /dataset/SUNRGBD/scene_557.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | "557.pkl", 4 | 0, 5 | "sofa" 6 | ], 7 | [ 8 | "557.pkl", 9 | 1, 10 | "sofa" 11 | ], 12 | [ 13 | "557.pkl", 14 | 2, 15 | "table" 16 | ] 17 | ] -------------------------------------------------------------------------------- /dataset/SUNRGBD/scene_194.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | "194.pkl", 4 | 0, 5 | "sofa" 6 | ], 7 | [ 8 | "194.pkl", 9 | 1, 10 | "sofa" 11 | ], 12 | [ 13 | "194.pkl", 14 | 3, 15 | "cabinet" 16 | ] 17 | ] -------------------------------------------------------------------------------- /dataset/SUNRGBD/scene_3420.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | "3420.pkl", 4 | 0, 5 | "sofa" 6 | ], 7 | [ 8 | "3420.pkl", 9 | 2, 10 | "sofa" 11 | ], 12 | [ 13 | "3420.pkl", 14 | 3, 15 | "table" 16 | ] 17 | ] -------------------------------------------------------------------------------- /dataset/SUNRGBD/scene_1490.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | "1490.pkl", 4 | 0 5 | ], 6 | [ 7 | "1490.pkl", 8 | 1 9 | ], 10 | [ 11 | "1490.pkl", 12 | 2 13 | ], 14 | [ 15 | "1490.pkl", 16 | 3 17 | ], 18 | [ 19 | "1490.pkl", 20 | 4 21 | ] 22 | ] -------------------------------------------------------------------------------- /eval/evaluate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/zsh 2 | config_path="$1" 3 | inference_cmd="python inference.py --config $config_path" 4 | evaluate_cmd="python eval/evaluate_front3d.py --config $config_path" 5 | evaluate_normal_cmd="python eval/evaluate_normal_consistency.py --config $config_path" 6 | eval $inference_cmd 7 | eval $evaluate_cmd 8 | eval $evaluate_normal_cmd 9 | -------------------------------------------------------------------------------- /dataset/FRONT3D/split/val/desk.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | "val/rgb/000345_rgb_001764.jpeg", 4 | "0", 5 | "desk" 6 | ], 7 | [ 8 | "val/rgb/000277_rgb_001419.jpeg", 9 | "1", 10 | "desk" 11 | ], 12 | [ 13 | "val/rgb/000414_rgb_002120.jpeg", 14 | "1", 15 | "desk" 16 | ] 17 | ] -------------------------------------------------------------------------------- /dataset/SUNRGBD/scene_80.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | "80.pkl", 4 | 0, 5 | "table" 6 | ], 7 | [ 8 | "80.pkl", 9 | 1, 10 | "sofa" 11 | ], 12 | [ 13 | "80.pkl", 14 | 2, 15 | "sofa" 16 | ], 17 | [ 18 | "80.pkl", 19 | 3, 20 | "sofa" 21 | ] 22 | ] -------------------------------------------------------------------------------- /dataset/SUNRGBD/scene_3408.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | "3408.pkl", 4 | 0, 5 | "sofa" 6 | ], 7 | [ 8 | "3408.pkl", 9 | 1, 10 | "table" 11 | ], 12 | [ 13 | "3408.pkl", 14 | 3, 15 | "sofa" 16 | ], 17 | [ 18 | "3408.pkl", 19 | 5, 20 | "table" 21 | ] 22 | ] -------------------------------------------------------------------------------- /dataset/SUNRGBD/scene_4689.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | "4689.pkl", 4 | 0, 5 | "sofa" 6 | ], 7 | [ 8 | "4689.pkl", 9 | 1, 10 | "sofa" 11 | ], 12 | [ 13 | "4689.pkl", 14 | 2, 15 | "sofa" 16 | ], 17 | [ 18 | "4689.pkl", 19 | 3, 20 | "table" 21 | ] 22 | ] -------------------------------------------------------------------------------- /dataset/FRONT3D/split/val/dresser.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | "val/rgb/000264_rgb_001339.jpeg", 4 | "0", 5 | "dresser" 6 | ], 7 | [ 8 | "val/rgb/000553_rgb_002819.jpeg", 9 | "2", 10 | "dresser" 11 | ], 12 | [ 13 | "val/rgb/000225_rgb_001112.jpeg", 14 | "4", 15 | "dresser" 16 | ] 17 | ] -------------------------------------------------------------------------------- /dataset/SUNRGBD/scene_5017.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | "5017.pkl", 4 | 0, 5 | "sofa" 6 | ], 7 | [ 8 | "5017.pkl", 9 | 1, 10 | "cabinet" 11 | ], 12 | [ 13 | "5017.pkl", 14 | 2, 15 | "cabinet" 16 | ], 17 | [ 18 | "5017.pkl", 19 | 4, 20 | "sofa" 21 | ] 22 | ] -------------------------------------------------------------------------------- /dataset/SUNRGBD/scene_769.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | "769.pkl", 4 | 5, 5 | "bed" 6 | ], 7 | [ 8 | "769.pkl", 9 | 12, 10 | "cabinet" 11 | ], 12 | [ 13 | "769.pkl", 14 | 8, 15 | "cabinet" 16 | ], 17 | [ 18 | "769.pkl", 19 | 7, 20 | "cabinet" 21 | ] 22 | ] -------------------------------------------------------------------------------- /external/ldif/gaps/apps/pfmview/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Application name and list of source files. 3 | # 4 | 5 | NAME=pfmview 6 | CCSRCS=$(NAME).cpp 7 | 8 | 9 | 10 | # 11 | # Dependency libraries 12 | # 13 | 14 | PKG_LIBS=-lR2Shapes -lRNBasics -ljpeg -lpng 15 | 16 | 17 | # 18 | # R3 application makefile 19 | # 20 | 21 | include ../../makefiles/Makefile.apps 22 | 23 | 24 | -------------------------------------------------------------------------------- /external/ldif/gaps/apps/img2img/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Package name and list of source files. 3 | # 4 | 5 | NAME=img2img 6 | CCSRCS=$(NAME).cpp 7 | 8 | 9 | # 10 | # Dependency libraries 11 | # 12 | 13 | PKG_LIBS=-lR2Shapes -lRNBasics -ljpeg -lpng 14 | 15 | 16 | # 17 | # R3 application makefile 18 | # 19 | 20 | include ../../makefiles/Makefile.apps 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /external/ldif/gaps/apps/msh2prp/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Application name and list of source files. 3 | # 4 | 5 | NAME=msh2prp 6 | CCSRCS=$(NAME).cpp 7 | 8 | 9 | # 10 | # Dependency libraries 11 | # 12 | 13 | PKG_LIBS=-lR3Shapes -lR2Shapes -lRNBasics -ljpeg -lpng 14 | 15 | 16 | # 17 | # R3 application makefile 18 | # 19 | 20 | include ../../makefiles/Makefile.apps 21 | 22 | 23 | -------------------------------------------------------------------------------- /external/ldif/gaps/apps/prp2prp/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Application name and list of source files. 3 | # 4 | 5 | NAME=prp2prp 6 | CCSRCS=$(NAME).cpp 7 | 8 | 9 | # 10 | # Dependency libraries 11 | # 12 | 13 | PKG_LIBS=-lR3Shapes -lR2Shapes -lRNBasics -ljpeg -lpng 14 | 15 | 16 | # 17 | # R3 application makefile 18 | # 19 | 20 | include ../../makefiles/Makefile.apps 21 | 22 | 23 | -------------------------------------------------------------------------------- /external/ldif/gaps/apps/msh2msh/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Application name and list of source files. 3 | # 4 | 5 | NAME=msh2msh 6 | CCSRCS=$(NAME).cpp 7 | 8 | 9 | 10 | # 11 | # Dependency libraries 12 | # 13 | 14 | PKG_LIBS=-lR3Shapes -lR2Shapes -lRNBasics -ljpeg -lpng 15 | 16 | 17 | # 18 | # R3 application makefile 19 | # 20 | 21 | include ../../makefiles/Makefile.apps 22 | 23 | 24 | -------------------------------------------------------------------------------- /external/ldif/gaps/apps/mshinfo/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Application name and list of source files. 3 | # 4 | 5 | NAME=mshinfo 6 | CCSRCS=$(NAME).cpp 7 | 8 | 9 | 10 | # 11 | # Dependency libraries 12 | # 13 | 14 | PKG_LIBS=-lR3Shapes -lR2Shapes -lRNBasics -ljpeg -lpng 15 | 16 | 17 | # 18 | # R3 application makefile 19 | # 20 | 21 | include ../../makefiles/Makefile.apps 22 | 23 | 24 | -------------------------------------------------------------------------------- /external/ldif/gaps/apps/mshalign/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Application name and list of source files. 3 | # 4 | 5 | NAME=mshalign 6 | CCSRCS=$(NAME).cpp 7 | 8 | 9 | 10 | # 11 | # Dependency libraries 12 | # 13 | 14 | PKG_LIBS=-lR3Shapes -lR2Shapes -lRNBasics -ljpeg -lpng 15 | 16 | 17 | # 18 | # R3 application makefile 19 | # 20 | 21 | include ../../makefiles/Makefile.apps 22 | 23 | 24 | -------------------------------------------------------------------------------- /external/ldif/gaps/apps/prpview/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Application name and list of source files. 3 | # 4 | 5 | NAME=prpview 6 | CCSRCS=$(NAME).cpp 7 | 8 | 9 | # 10 | # Dependency libraries 11 | # 12 | 13 | PKG_LIBS=-lR3Graphics -lR3Shapes -lR2Shapes -lRNBasics -ljpeg -lpng 14 | 15 | # 16 | # R3 application makefile 17 | # 18 | 19 | include ../../makefiles/Makefile.apps 20 | 21 | 22 | -------------------------------------------------------------------------------- /external/ldif/gaps/apps/sfl2img/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Application name and list of source files. 3 | # 4 | 5 | NAME=sfl2img 6 | CCSRCS=$(NAME).cpp 7 | 8 | 9 | 10 | # 11 | # Dependency libraries 12 | # 13 | 14 | PKG_LIBS=-lR3Surfels -lR3Shapes -lR2Shapes -lRNBasics -ljpeg -lpng 15 | 16 | # 17 | # R3 application makefile 18 | # 19 | 20 | include ../../makefiles/Makefile.apps 21 | 22 | 23 | -------------------------------------------------------------------------------- /external/ldif/gaps/apps/sfl2sfl/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Application name and list of source files. 3 | # 4 | 5 | NAME=sfl2sfl 6 | CCSRCS=$(NAME).cpp 7 | 8 | 9 | 10 | # 11 | # Dependency libraries 12 | # 13 | 14 | PKG_LIBS=-lR3Surfels -lR3Shapes -lR2Shapes -lRNBasics -ljpeg -lpng 15 | 16 | # 17 | # R3 application makefile 18 | # 19 | 20 | include ../../makefiles/Makefile.apps 21 | 22 | 23 | -------------------------------------------------------------------------------- /external/ldif/gaps/apps/conf2conf/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Application name and list of source files. 3 | # 4 | 5 | NAME=conf2conf 6 | CCSRCS=$(NAME).cpp 7 | 8 | 9 | 10 | # 11 | # Dependency libraries 12 | # 13 | 14 | PKG_LIBS=-lRGBD -lR3Shapes -lR2Shapes -lRNBasics -ljpeg -lpng 15 | 16 | 17 | # 18 | # R3 application makefile 19 | # 20 | 21 | include ../../makefiles/Makefile.apps 22 | 23 | 24 | -------------------------------------------------------------------------------- /external/ldif/gaps/apps/mshparam/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Application name and list of source files. 3 | # 4 | 5 | NAME=mshparam 6 | CCSRCS=$(NAME).cpp 7 | 8 | 9 | 10 | # 11 | # Dependency libraries 12 | # 13 | 14 | PKG_LIBS=-lR3Shapes -lR2Shapes -lRNBasics -ljpeg -lpng 15 | 16 | 17 | 18 | # 19 | # R3 application makefile 20 | # 21 | 22 | include ../../makefiles/Makefile.apps 23 | 24 | 25 | -------------------------------------------------------------------------------- /external/ldif/gaps/apps/ptsview/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Application name and list of source files. 3 | # 4 | 5 | NAME=ptsview 6 | CCSRCS=$(NAME).cpp 7 | 8 | 9 | 10 | # 11 | # Dependency libraries 12 | # 13 | 14 | PKG_LIBS=-lR3Graphics -lR3Shapes -lR2Shapes -lRNBasics -ljpeg -lpng 15 | 16 | # 17 | # R3 application makefile 18 | # 19 | 20 | include ../../makefiles/Makefile.apps 21 | 22 | 23 | -------------------------------------------------------------------------------- /external/ldif/gaps/apps/scninfo/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Application name and list of source files. 3 | # 4 | 5 | NAME=scninfo 6 | CCSRCS=$(NAME).cpp 7 | 8 | 9 | # 10 | # Dependency libraries 11 | # 12 | 13 | PKG_LIBS=-lR3Graphics -lR3Shapes -lR2Shapes -lRNBasics -ljpeg -lpng 14 | 15 | 16 | # 17 | # R3 application makefile 18 | # 19 | 20 | include ../../makefiles/Makefile.apps 21 | 22 | 23 | -------------------------------------------------------------------------------- /external/ldif/gaps/apps/scnview/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Application name and list of source files. 3 | # 4 | 5 | NAME=scnview 6 | CCSRCS=$(NAME).cpp 7 | 8 | 9 | # 10 | # Dependency libraries 11 | # 12 | 13 | PKG_LIBS=-lR3Graphics -lR3Shapes -lR2Shapes -lRNBasics -ljpeg -lpng 14 | 15 | 16 | # 17 | # R3 application makefile 18 | # 19 | 20 | include ../../makefiles/Makefile.apps 21 | 22 | 23 | -------------------------------------------------------------------------------- /external/ldif/gaps/apps/sflinit/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Application name and list of source files. 3 | # 4 | 5 | NAME=sflinit 6 | CCSRCS=$(NAME).cpp 7 | 8 | 9 | 10 | # 11 | # Dependency libraries 12 | # 13 | 14 | PKG_LIBS=-lR3Surfels -lR3Shapes -lR2Shapes -lRNBasics -ljpeg -lpng 15 | 16 | # 17 | # R3 application makefile 18 | # 19 | 20 | include ../../makefiles/Makefile.apps 21 | 22 | 23 | -------------------------------------------------------------------------------- /external/ldif/gaps/apps/mshview/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Application name and list of source files. 3 | # 4 | 5 | NAME=mshview 6 | CCSRCS=$(NAME).cpp 7 | 8 | 9 | 10 | # 11 | # Dependency libraries 12 | # 13 | 14 | PKG_LIBS=-lR3Graphics -lR3Shapes -lR2Shapes -lRNBasics -ljpeg -lpng 15 | 16 | 17 | # 18 | # R3 application makefile 19 | # 20 | 21 | include ../../makefiles/Makefile.apps 22 | 23 | 24 | -------------------------------------------------------------------------------- /external/ldif/gaps/apps/scn2cam/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Application name and list of source files. 3 | # 4 | 5 | NAME=scn2cam 6 | CCSRCS=$(NAME).cpp 7 | 8 | 9 | # 10 | # Dependency libraries 11 | # 12 | 13 | PKG_LIBS=-lR3Graphics -lR3Shapes -lR2Shapes -lRNBasics -ljpeg -lpng 14 | 15 | 16 | # 17 | # R3 application makefile 18 | # 19 | 20 | include ../../makefiles/Makefile.apps 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /external/ldif/gaps/apps/scn2grd/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Application name and list of source files. 3 | # 4 | 5 | NAME=scn2grd 6 | CCSRCS=$(NAME).cpp 7 | 8 | 9 | 10 | # 11 | # Dependency libraries 12 | # 13 | 14 | PKG_LIBS=-lR3Graphics -lR3Shapes -lR2Shapes -lRNBasics -ljpeg -lpng 15 | 16 | 17 | # 18 | # R3 application makefile 19 | # 20 | 21 | include ../../makefiles/Makefile.apps 22 | 23 | 24 | -------------------------------------------------------------------------------- /external/ldif/gaps/apps/scn2img/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Application name and list of source files. 3 | # 4 | 5 | NAME=scn2img 6 | CCSRCS=$(NAME).cpp 7 | 8 | 9 | # 10 | # Dependency libraries 11 | # 12 | 13 | PKG_LIBS=-lR3Graphics -lR3Shapes -lR2Shapes -lRNBasics -ljpeg -lpng 14 | 15 | 16 | # 17 | # R3 application makefile 18 | # 19 | 20 | include ../../makefiles/Makefile.apps 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /external/ldif/gaps/apps/scn2scn/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Application name and list of source files. 3 | # 4 | 5 | NAME=scn2scn 6 | CCSRCS=$(NAME).cpp 7 | 8 | 9 | 10 | # 11 | # Dependency libraries 12 | # 13 | 14 | PKG_LIBS=-lR3Graphics -lR3Shapes -lR2Shapes -lRNBasics -ljpeg -lpng 15 | 16 | 17 | # 18 | # R3 application makefile 19 | # 20 | 21 | include ../../makefiles/Makefile.apps 22 | 23 | 24 | -------------------------------------------------------------------------------- /external/ldif/gaps/apps/sflprocess/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Application name and list of source files. 3 | # 4 | 5 | NAME=sflprocess 6 | CCSRCS=$(NAME).cpp 7 | 8 | 9 | 10 | # 11 | # Dependency libraries 12 | # 13 | 14 | PKG_LIBS=-lR3Surfels -lR3Shapes -lR2Shapes -lRNBasics -ljpeg -lpng 15 | 16 | # 17 | # R3 application makefile 18 | # 19 | 20 | include ../../makefiles/Makefile.apps 21 | 22 | 23 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/gaps.h: -------------------------------------------------------------------------------- 1 | // Include file for gaps packages 2 | 3 | #ifndef __GAPS__H__ 4 | #define __GAPS__H__ 5 | 6 | 7 | // Include all packages 8 | 9 | #include "RNBasics/RNBasics.h" 10 | #include "R2Shapes/R2Shapes.h" 11 | #include "R3Shapes/R3Shapes.h" 12 | #include "R3Graphics/R3Graphics.h" 13 | 14 | 15 | #endif 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /external/ldif/gaps/apps/sflinfo/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Application name and list of source files. 3 | # 4 | 5 | NAME=sflinfo 6 | CCSRCS=$(NAME).cpp 7 | 8 | 9 | 10 | # 11 | # Dependency libraries 12 | # 13 | 14 | PKG_LIBS=-lR3Surfels -lR3Graphics -lR3Shapes -lR2Shapes -lRNBasics -ljpeg -lpng 15 | 16 | # 17 | # R3 application makefile 18 | # 19 | 20 | include ../../makefiles/Makefile.apps 21 | 22 | 23 | -------------------------------------------------------------------------------- /external/ldif/gaps/apps/sflview/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Application name and list of source files. 3 | # 4 | 5 | NAME=sflview 6 | CCSRCS=$(NAME).cpp 7 | 8 | 9 | 10 | # 11 | # Dependency libraries 12 | # 13 | 14 | PKG_LIBS=-lR3Surfels -lR3Graphics -lR3Shapes -lR2Shapes -lRNBasics -ljpeg -lpng 15 | 16 | # 17 | # R3 application makefile 18 | # 19 | 20 | include ../../makefiles/Makefile.apps 21 | 22 | 23 | -------------------------------------------------------------------------------- /external/ldif/gaps/apps/confview/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Application name and list of source files. 3 | # 4 | 5 | NAME=confview 6 | CCSRCS=$(NAME).cpp 7 | 8 | 9 | 10 | # 11 | # Dependency libraries 12 | # 13 | 14 | PKG_LIBS=-lRGBD -lR3Graphics -lR3Shapes -lR2Shapes -lRNBasics -ljpeg -lpng 15 | 16 | 17 | # 18 | # R3 application makefile 19 | # 20 | 21 | include ../../makefiles/Makefile.apps 22 | 23 | 24 | -------------------------------------------------------------------------------- /external/ldif/gaps/apps/mshsegment/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Application name and list of source files. 3 | # 4 | 5 | NAME=mshsegment 6 | CCSRCS=$(NAME).cpp segmentation.cpp 7 | 8 | 9 | 10 | # 11 | # Dependency libraries 12 | # 13 | 14 | PKG_LIBS=-lR3Shapes -lR2Shapes -lRNBasics -ljpeg -lpng 15 | 16 | 17 | 18 | # 19 | # R3 application makefile 20 | # 21 | 22 | include ../../makefiles/Makefile.apps 23 | 24 | 25 | -------------------------------------------------------------------------------- /external/ldif/gaps/apps/grdview/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Application name 3 | # 4 | 5 | NAME=grdview 6 | 7 | 8 | 9 | # 10 | # Source files. 11 | # 12 | 13 | CCSRCS=$(NAME).cpp 14 | 15 | 16 | 17 | # 18 | # Libraries 19 | # 20 | 21 | PKG_LIBS=-lR3Graphics -lR3Shapes -lR2Shapes -lRNBasics -lfglut -ljpeg -lpng 22 | 23 | 24 | 25 | # 26 | # Include standard makefile 27 | # 28 | 29 | include ../../makefiles/Makefile.apps 30 | 31 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/fglut/fglut.h: -------------------------------------------------------------------------------- 1 | // OpenGL GLUT include file 2 | 3 | 4 | // External include files 5 | 6 | #ifdef __APPLE__ 7 | // Use the native glut on mac 8 | # include "GLUT/glut.h" 9 | #else 10 | // Use this implementation 11 | # include "fglut/glut.h" 12 | #endif 13 | 14 | 15 | 16 | /* Initialization functions */ 17 | 18 | int R3InitGlut(void); 19 | void R3StopGlut(void); 20 | 21 | -------------------------------------------------------------------------------- /dataset/SUNRGBD/scene_325.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | "325.pkl", 4 | 0, 5 | "table" 6 | ], 7 | [ 8 | "325.pkl", 9 | 1, 10 | "sofa" 11 | ], 12 | [ 13 | "325.pkl", 14 | 2, 15 | "sofa" 16 | ], 17 | [ 18 | "325.pkl", 19 | 3, 20 | "sofa" 21 | ], 22 | [ 23 | "325.pkl", 24 | 4, 25 | "table" 26 | ] 27 | ] -------------------------------------------------------------------------------- /dataset/SUNRGBD/scene_576.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | "576.pkl", 4 | 0, 5 | "sofa" 6 | ], 7 | [ 8 | "576.pkl", 9 | 1, 10 | "sofa" 11 | ], 12 | [ 13 | "576.pkl", 14 | 2, 15 | "table" 16 | ], 17 | [ 18 | "576.pkl", 19 | 3, 20 | "sofa" 21 | ], 22 | [ 23 | "576.pkl", 24 | 6, 25 | "cabinet" 26 | ] 27 | ] -------------------------------------------------------------------------------- /external/ldif/gaps/apps/conf2img/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Application name and list of source files. 3 | # 4 | 5 | NAME=conf2img 6 | CCSRCS=$(NAME).cpp RGBDSegmentation.cpp segmentation.cpp 7 | 8 | 9 | 10 | # 11 | # Dependency libraries 12 | # 13 | 14 | PKG_LIBS=-lRGBD -lR3Graphics -lR3Shapes -lR2Shapes -lRNBasics -ljpeg -lpng 15 | 16 | 17 | # 18 | # R3 application makefile 19 | # 20 | 21 | include ../../makefiles/Makefile.apps 22 | 23 | 24 | -------------------------------------------------------------------------------- /external/ldif/gaps/apps/gapsview/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Application name 3 | # 4 | 5 | NAME=gapsview 6 | 7 | 8 | 9 | # 10 | # Source files. 11 | # 12 | 13 | CCSRCS=$(NAME).cpp R3PointSet.cpp 14 | 15 | 16 | 17 | # 18 | # Libraries 19 | # 20 | 21 | PKG_LIBS=-lR3Graphics -lR3Shapes -lR2Shapes -lRNBasics -lfglut -ljpeg -lpng 22 | 23 | 24 | 25 | # 26 | # Include standard makefile 27 | # 28 | 29 | include ../../makefiles/Makefile.apps 30 | 31 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/R2Shapes/R2Draw.h: -------------------------------------------------------------------------------- 1 | /* Include file for R2 draw utility */ 2 | #ifndef __R2__DRAW__H__ 3 | #define __R2__DRAW__H__ 4 | 5 | 6 | 7 | /* Begin namespace */ 8 | namespace gaps { 9 | 10 | 11 | 12 | inline void 13 | R2LoadPoint(const R2Point& point) 14 | { 15 | // Load vertex 16 | R2LoadPoint(point.Coords()); 17 | } 18 | 19 | 20 | 21 | // End namespace 22 | } 23 | 24 | 25 | // End include guard 26 | #endif 27 | -------------------------------------------------------------------------------- /external/ldif/gaps/apps/grd2msh/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Application name 3 | # 4 | 5 | NAME=grd2msh 6 | 7 | 8 | 9 | # 10 | # Source files. 11 | # 12 | 13 | CCSRCS=$(NAME).cpp 14 | 15 | 16 | 17 | # 18 | # Libraries 19 | # 20 | 21 | PKG_LIBS=-lR3Shapes -lR2Shapes -lRNBasics -ljpeg -lpng 22 | 23 | 24 | 25 | # 26 | # Include standard makefile 27 | # 28 | 29 | include ../../makefiles/Makefile.apps 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /external/ldif/gaps/apps/grd2pts/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Application name 3 | # 4 | 5 | NAME=grd2pts 6 | 7 | 8 | 9 | # 10 | # Source files. 11 | # 12 | 13 | CCSRCS=$(NAME).cpp 14 | 15 | 16 | 17 | # 18 | # Libraries 19 | # 20 | 21 | PKG_LIBS=-lR3Shapes -lR2Shapes -lRNBasics -ljpeg -lpng 22 | 23 | 24 | 25 | # 26 | # Include standard makefile 27 | # 28 | 29 | include ../../makefiles/Makefile.apps 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /external/pyTorchChamferDistance/build/.ninja_log: -------------------------------------------------------------------------------- 1 | # ninja log v5 2 | 0 9310 1585260485725113808 chamfer_distance.cuda.o c6e9a65e4c4bf099 3 | 0 9425 1585260485837113813 chamfer_distance.o 8c770363c98cba07 4 | 9425 9630 1585260486045113822 build.so dee18e7b2658d8eb 5 | 0 9468 1592244747834505918 chamfer_distance.cuda.o 4cd86194c31844cf 6 | 0 9715 1592244748082506102 chamfer_distance.o f86e6ae521d60c2c 7 | 9715 9963 1592244748330506283 build.so dee18e7b2658d8eb 8 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/jpeg/jversion.h: -------------------------------------------------------------------------------- 1 | /* 2 | * jversion.h 3 | * 4 | * Copyright (C) 1991-1998, Thomas G. Lane. 5 | * This file is part of the Independent JPEG Group's software. 6 | * For conditions of distribution and use, see the accompanying README file. 7 | * 8 | * This file contains software version identification. 9 | */ 10 | 11 | 12 | #define JVERSION "6b 27-Mar-1998" 13 | 14 | #define JCOPYRIGHT "Copyright (C) 1998, Thomas G. Lane" 15 | -------------------------------------------------------------------------------- /external/ldif/gaps/docs/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile for GAPS docs 3 | # 4 | 5 | opt: 6 | ./makeall 7 | 8 | debug: 9 | ./makeall 10 | 11 | release: 12 | mkdir -p ../release/docs 13 | cp Makefile ../release/docs 14 | cp makeall ../release/docs 15 | cp makepkg ../release/docs 16 | cp makepkg.awk ../release/docs 17 | cp -r headers ../release/docs 18 | cp ./*.html ../release/docs 19 | 20 | clean: 21 | - rm -f *~ *.html 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/RNMath/RNMatrix.cpp: -------------------------------------------------------------------------------- 1 | // Source file for abstract matrix class 2 | 3 | 4 | // Include files 5 | 6 | #include "RNMath.h" 7 | 8 | 9 | 10 | // Namespace 11 | 12 | namespace gaps { 13 | 14 | 15 | 16 | RNMatrix:: 17 | RNMatrix(void) 18 | { 19 | } 20 | 21 | 22 | 23 | RNMatrix:: 24 | RNMatrix(const RNMatrix& matrix) 25 | { 26 | } 27 | 28 | 29 | 30 | RNMatrix:: 31 | ~RNMatrix(void) 32 | { 33 | } 34 | 35 | 36 | 37 | } // namespace gaps 38 | -------------------------------------------------------------------------------- /external/ldif/gaps/apps/pfminfo/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Application name 3 | # 4 | 5 | NAME=pfminfo 6 | 7 | 8 | 9 | # 10 | # Source files 11 | # 12 | 13 | CCSRCS=$(NAME).cpp 14 | 15 | 16 | 17 | # 18 | # Libraries 19 | # 20 | 21 | PKG_LIBS=-lR2Shapes -lRNBasics -ljpeg -lpng 22 | 23 | 24 | 25 | # 26 | # Include standard makefile 27 | # 28 | 29 | include ../../makefiles/Makefile.apps 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /external/ldif/gaps/apps/grd2grd/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Application name 3 | # 4 | 5 | NAME=grd2grd 6 | 7 | 8 | 9 | # 10 | # Source files 11 | # 12 | 13 | CCSRCS=$(NAME).cpp 14 | 15 | 16 | 17 | # 18 | # Libraries 19 | # 20 | 21 | PKG_LIBS=-lR3Shapes -lR2Shapes -lRNBasics -ljpeg -lpng 22 | 23 | 24 | 25 | # 26 | # Include standard makefile 27 | # 28 | 29 | include ../../makefiles/Makefile.apps 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /external/ldif/gaps/apps/grd2txt/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Application name 3 | # 4 | 5 | NAME=grd2txt 6 | 7 | 8 | 9 | # 10 | # Source files 11 | # 12 | 13 | CCSRCS=$(NAME).cpp 14 | 15 | 16 | 17 | # 18 | # Libraries 19 | # 20 | 21 | PKG_LIBS=-lR3Shapes -lR2Shapes -lRNBasics -ljpeg -lpng 22 | 23 | 24 | 25 | # 26 | # Include standard makefile 27 | # 28 | 29 | include ../../makefiles/Makefile.apps 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /external/ldif/gaps/apps/msh2df/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Application name 3 | # 4 | 5 | NAME=msh2df 6 | 7 | 8 | 9 | # 10 | # Source files 11 | # 12 | 13 | CCSRCS=$(NAME).cpp 14 | 15 | 16 | 17 | # 18 | # Libraries 19 | # 20 | 21 | PKG_LIBS=-lR3Shapes -lR2Shapes -lRNBasics -ljpeg -lpng 22 | 23 | 24 | 25 | # 26 | # Include standard makefile 27 | # 28 | 29 | include ../../makefiles/Makefile.apps 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /external/ldif/gaps/apps/msh2grd/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Application name 3 | # 4 | 5 | NAME=msh2grd 6 | 7 | 8 | 9 | # 10 | # Source files 11 | # 12 | 13 | CCSRCS=$(NAME).cpp 14 | 15 | 16 | 17 | # 18 | # Libraries 19 | # 20 | 21 | PKG_LIBS=-lR3Shapes -lR2Shapes -lRNBasics -ljpeg -lpng 22 | 23 | 24 | 25 | # 26 | # Include standard makefile 27 | # 28 | 29 | include ../../makefiles/Makefile.apps 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /external/ldif/gaps/apps/msh2pts/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Application name 3 | # 4 | 5 | NAME=msh2pts 6 | 7 | 8 | 9 | # 10 | # Source files 11 | # 12 | 13 | CCSRCS=$(NAME).cpp 14 | 15 | 16 | 17 | # 18 | # Libraries 19 | # 20 | 21 | PKG_LIBS=-lR3Shapes -lR2Shapes -lRNBasics -ljpeg -lpng 22 | 23 | 24 | 25 | # 26 | # Include standard makefile 27 | # 28 | 29 | include ../../makefiles/Makefile.apps 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/fglut/fglut.c: -------------------------------------------------------------------------------- 1 | // Source file for fglut package stand-in 2 | 3 | 4 | 5 | // These are never used. They are just dummy functions 6 | // to compile and link when the native glut is used, and 7 | // thus the rest of the code in the fglut package is not 8 | // compiled 9 | 10 | 11 | 12 | int R3InitGlut(void) 13 | { 14 | // return OK status 15 | return 1; 16 | } 17 | 18 | 19 | 20 | void R3StopGlut(void) 21 | { 22 | } 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/png/inffast.h: -------------------------------------------------------------------------------- 1 | /* inffast.h -- header to use inffast.c 2 | * Copyright (C) 1995-2003, 2010 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* WARNING: this file should *not* be used by applications. It is 7 | part of the implementation of the compression library and is 8 | subject to change. Applications should only use zlib.h. 9 | */ 10 | 11 | void ZLIB_INTERNAL inflate_fast OF((z_streamp strm, unsigned start)); 12 | -------------------------------------------------------------------------------- /dataset/SUNRGBD/scene_91.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | "91.pkl", 4 | 0, 5 | "table" 6 | ], 7 | [ 8 | "91.pkl", 9 | 1, 10 | "sofa" 11 | ], 12 | [ 13 | "91.pkl", 14 | 2, 15 | "sofa" 16 | ], 17 | [ 18 | "91.pkl", 19 | 3, 20 | "sofa" 21 | ], 22 | [ 23 | "91.pkl", 24 | 4, 25 | "table" 26 | ], 27 | [ 28 | "91.pkl", 29 | 5, 30 | "table" 31 | ] 32 | ] -------------------------------------------------------------------------------- /dataset/SUNRGBD/scene_51.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | "51.pkl", 4 | 0, 5 | "chair" 6 | ], 7 | [ 8 | "51.pkl", 9 | 1, 10 | "chair" 11 | ], 12 | [ 13 | "51.pkl", 14 | 2, 15 | "chair" 16 | ], 17 | [ 18 | "51.pkl", 19 | 3, 20 | "chair" 21 | ], 22 | [ 23 | "51.pkl", 24 | 4, 25 | "chair" 26 | ], 27 | [ 28 | "51.pkl", 29 | 5, 30 | "table" 31 | ] 32 | ] -------------------------------------------------------------------------------- /dataset/SUNRGBD/scene_637.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | "637.pkl", 4 | 0, 5 | "sofa" 6 | ], 7 | [ 8 | "637.pkl", 9 | 1, 10 | "table" 11 | ], 12 | [ 13 | "637.pkl", 14 | 2, 15 | "sofa" 16 | ], 17 | [ 18 | "637.pkl", 19 | 3, 20 | "bookshelf" 21 | ], 22 | [ 23 | "637.pkl", 24 | 4, 25 | "bookshelf" 26 | ], 27 | [ 28 | "637.pkl", 29 | 5, 30 | "bookshelf" 31 | ] 32 | ] -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/RNMath/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Package name 3 | # 4 | 5 | NAME=RNMath 6 | 7 | 8 | 9 | # 10 | # List of source files 11 | # 12 | 13 | CCSRCS=$(NAME).cpp \ 14 | RNPolynomial.cpp RNAlgebraic.cpp RNEquation.cpp RNSystemOfEquations.cpp \ 15 | RNDenseLUMatrix.cpp RNDenseMatrix.cpp RNMatrix.cpp \ 16 | RNVector.cpp 17 | 18 | 19 | # 20 | # Dependencies 21 | # 22 | 23 | PKG_DEPENDENCIES = RNBasics 24 | 25 | 26 | 27 | # 28 | # PKG makefile 29 | # 30 | 31 | include ../../makefiles/Makefile.pkgs 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/RNBasics/RNBase.cpp: -------------------------------------------------------------------------------- 1 | /* Source file for GAPS base class */ 2 | 3 | 4 | 5 | /* Include files */ 6 | 7 | #include "RNBasics.h" 8 | 9 | 10 | 11 | // Namespace 12 | 13 | namespace gaps { 14 | 15 | 16 | 17 | /* Global variables */ 18 | 19 | RNMark RNmark = 1; 20 | 21 | 22 | 23 | int RNInitBase() 24 | { 25 | /* Return OK status */ 26 | return TRUE; 27 | } 28 | 29 | 30 | 31 | void RNStopBase() 32 | { 33 | } 34 | 35 | 36 | 37 | void RNBreakDebug(void) 38 | { 39 | } 40 | 41 | 42 | 43 | } // namespace gaps 44 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/RNBasics/RNFlags.cpp: -------------------------------------------------------------------------------- 1 | /* Source file for the GAPS flags class */ 2 | 3 | 4 | 5 | /* Include files */ 6 | 7 | #include "RNBasics.h" 8 | 9 | 10 | 11 | // Namespace 12 | 13 | namespace gaps { 14 | 15 | 16 | 17 | /* Public functions */ 18 | 19 | int 20 | RNInitFlags() 21 | { 22 | /* Return success */ 23 | return TRUE; 24 | } 25 | 26 | 27 | 28 | void 29 | RNStopFlags() 30 | { 31 | } 32 | 33 | 34 | 35 | RNFlags:: 36 | RNFlags(void) 37 | : flags(0) 38 | { 39 | } 40 | 41 | 42 | 43 | } // namespace gaps 44 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/RGBD/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Package name 3 | # 4 | 5 | NAME=RGBD 6 | 7 | 8 | 9 | # 10 | # List of source files 11 | # 12 | 13 | CCSRCS=RGBD.cpp \ 14 | RGBDTransform.cpp \ 15 | RGBDConfiguration.cpp \ 16 | RGBDSurface.cpp RGBDImage.cpp \ 17 | RGBDCamera.cpp RGBDUtil.cpp 18 | 19 | 20 | # 21 | # Dependencies 22 | # 23 | 24 | PKG_DEPENDENCIES = R3Shapes R2Shapes RNBasics jpeg png 25 | 26 | 27 | 28 | # 29 | # PKG makefile 30 | # 31 | 32 | include ../../makefiles/Makefile.pkgs 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /dataset/FRONT3D/split/test/scene_3848.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | "test/rgb/000751_rgb_003848.jpeg", 4 | "7", 5 | "table" 6 | ], 7 | [ 8 | "test/rgb/000751_rgb_003848.jpeg", 9 | "2", 10 | "chair" 11 | ], 12 | [ 13 | "test/rgb/000751_rgb_003848.jpeg", 14 | "3", 15 | "chair" 16 | ], 17 | [ 18 | "test/rgb/000751_rgb_003848.jpeg", 19 | "4", 20 | "chair" 21 | ], 22 | [ 23 | "test/rgb/000751_rgb_003848.jpeg", 24 | "5", 25 | "chair" 26 | ] 27 | ] -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/jpeg/jconfig.h: -------------------------------------------------------------------------------- 1 | /* jconfig.h. Generated automatically by configure. */ 2 | /* jconfig.cfg --- source file edited by configure script */ 3 | /* see jconfig.doc for explanations */ 4 | 5 | #define HAVE_PROTOTYPES 6 | #define HAVE_UNSIGNED_CHAR 7 | #define HAVE_UNSIGNED_SHORT 8 | #undef void 9 | #undef const 10 | #undef CHAR_IS_UNSIGNED 11 | #define HAVE_STDDEF_H 12 | #define HAVE_STDLIB_H 13 | #undef NEED_BSD_STRINGS 14 | #undef NEED_SYS_TYPES_H 15 | #undef NEED_FAR_POINTERS 16 | #undef NEED_SHORT_EXTERNAL_NAMES 17 | #undef INCOMPLETE_TYPES_BROKEN 18 | 19 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/RNBasics/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Package name 3 | # 4 | 5 | NAME=RNBasics 6 | 7 | 8 | 9 | # 10 | # List of source files 11 | # 12 | 13 | CCSRCS=$(NAME).cpp \ 14 | RNTime.cpp \ 15 | RNGrfx.cpp RNRgb.cpp \ 16 | RNMap.cpp RNHeap.cpp RNQueue.cpp RNArray.cpp \ 17 | RNSvd.cpp RNIntval.cpp RNScalar.cpp \ 18 | RNType.cpp \ 19 | RNFlags.cpp \ 20 | RNFile.cpp RNMem.cpp \ 21 | RNError.cpp \ 22 | RNBase.cpp \ 23 | json.cpp 24 | 25 | 26 | 27 | # 28 | # PKG makefile 29 | # 30 | 31 | include ../../makefiles/Makefile.pkgs 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/R2Shapes/R2Io.h: -------------------------------------------------------------------------------- 1 | /* Include file for input/output utility */ 2 | #ifndef __R2__IO__H__ 3 | #define __R2__IO__H__ 4 | 5 | 6 | 7 | /* Begin namespace */ 8 | namespace gaps { 9 | 10 | 11 | 12 | /* Function declarations */ 13 | 14 | RNArray *R2ReadSpans(RNArray& spans, const char *filename); 15 | RNArray *R2ReadWiseFile(RNArray& spans, const char *filename); 16 | RNArray *R2ReadXFigFile(RNArray& spans, const char *filename); 17 | 18 | 19 | 20 | // End namespace 21 | } 22 | 23 | 24 | // End include guard 25 | #endif 26 | -------------------------------------------------------------------------------- /external/ldif/gaps/apps/img2img/img2img.cpp: -------------------------------------------------------------------------------- 1 | // Source file for the image conversion program 2 | 3 | 4 | // Include files 5 | 6 | namespace gaps {} 7 | using namespace gaps; 8 | #include "R2Shapes/R2Shapes.h" 9 | 10 | 11 | 12 | int main(int argc, char **argv) 13 | { 14 | // Check arguments 15 | if (argc != 3) { 16 | RNFail("Usage: img2img inputfile outputfile\n"); 17 | return 1; 18 | } 19 | 20 | // Read and write image file 21 | R2Image image; 22 | if (!image.Read(argv[1])) return -1; 23 | if (!image.Write(argv[2])) return -1; 24 | return 0; 25 | } 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /external/ldif/gaps/apps/pfm2pfm/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Application name 3 | # 4 | 5 | NAME=pfm2pfm 6 | 7 | 8 | 9 | # 10 | # Source files 11 | # 12 | 13 | CCSRCS=$(NAME).cpp 14 | 15 | 16 | 17 | # 18 | # Compile flags 19 | # 20 | 21 | #USER_CFLAGS=-DRN_USE_CSPARSE 22 | 23 | 24 | 25 | # 26 | # Libraries 27 | # 28 | 29 | #PKG_LIBS=-lR2Shapes -lRNMath -lRNBasics -ljpeg -lpng -lCSparse 30 | PKG_LIBS=-lR2Shapes -lRNMath -lRNBasics -ljpeg -lpng 31 | 32 | 33 | 34 | # 35 | # Include standard makefile 36 | # 37 | 38 | include ../../makefiles/Makefile.apps 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /external/ldif/util/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /dataset/SUNRGBD/scene_272.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | "272.pkl", 4 | 0, 5 | "sofa" 6 | ], 7 | [ 8 | "272.pkl", 9 | 1, 10 | "sofa" 11 | ], 12 | [ 13 | "272.pkl", 14 | 2, 15 | "sofa" 16 | ], 17 | [ 18 | "272.pkl", 19 | 3, 20 | "sofa" 21 | ], 22 | [ 23 | "272.pkl", 24 | 4, 25 | "chair" 26 | ], 27 | [ 28 | "272.pkl", 29 | 5, 30 | "sofa" 31 | ], 32 | [ 33 | "272.pkl", 34 | 6, 35 | "sofa" 36 | ], 37 | [ 38 | "272.pkl", 39 | 7, 40 | "table" 41 | ] 42 | ] -------------------------------------------------------------------------------- /dataset/FRONT3D/split/test/demo_colormesh.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | "test/rgb/001228_rgb_006282.jpeg", 4 | "0", 5 | "night_stand" 6 | ], 7 | [ 8 | "test/rgb/001511_rgb_007790.jpeg", 9 | "1", 10 | "bed" 11 | ], 12 | [ 13 | "test/rgb/000648_rgb_003297.jpeg", 14 | "2", 15 | "chair" 16 | ], 17 | [ 18 | "test/rgb/000643_rgb_003267.jpeg", 19 | "0", 20 | "sofa" 21 | ], 22 | [ 23 | "test/rgb/000654_rgb_003335.jpeg", 24 | "6", 25 | "chair" 26 | ], 27 | [ 28 | "test/rgb/001124_rgb_005750.jpeg", 29 | "0", 30 | "sofa" 31 | ] 32 | ] -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/R3Graphics/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Package name 3 | # 4 | 5 | NAME=R3Graphics 6 | 7 | 8 | 9 | # 10 | # List of source files 11 | # 12 | 13 | CCSRCS=$(NAME).cpp \ 14 | R3Scene.cpp R3SceneNode.cpp R3SceneElement.cpp R3SceneReference.cpp \ 15 | R3Viewer.cpp R3Frustum.cpp R3Camera.cpp R2Viewport.cpp \ 16 | R3AreaLight.cpp R3SpotLight.cpp R3PointLight.cpp R3DirectionalLight.cpp R3Light.cpp \ 17 | R3Material.cpp R3Brdf.cpp R2Texture.cpp 18 | 19 | 20 | 21 | # 22 | # Dependencies 23 | # 24 | 25 | PKG_DEPENDENCIES = R3Shapes R2Shapes RNBasics 26 | 27 | 28 | 29 | # 30 | # PKG makefile 31 | # 32 | 33 | include ../../makefiles/Makefile.pkgs 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/R2Shapes/R2Solid.h: -------------------------------------------------------------------------------- 1 | /* Include file for the R2 solid class */ 2 | #ifndef __R2__SOLID__H__ 3 | #define __R2__SOLID__H__ 4 | 5 | 6 | 7 | /* Begin namespace */ 8 | namespace gaps { 9 | 10 | 11 | 12 | /* Initialization functions */ 13 | 14 | int R2InitSolid(); 15 | void R2StopSolid(); 16 | 17 | 18 | 19 | /* Class definition */ 20 | 21 | class R2Solid : public R2Shape { 22 | public: 23 | // Constructors/destructors ??? 24 | R2Solid(void); 25 | ~R2Solid(void); 26 | 27 | // Shape property functions/operators 28 | const RNBoolean IsSolid(void) const; 29 | }; 30 | 31 | 32 | 33 | // End namespace 34 | } 35 | 36 | 37 | // End include guard 38 | #endif 39 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/R3Shapes/R3Solid.h: -------------------------------------------------------------------------------- 1 | /* Include file for the R3 solid class */ 2 | #ifndef __R3__SOLID__H__ 3 | #define __R3__SOLID__H__ 4 | 5 | 6 | 7 | /* Begin namespace */ 8 | namespace gaps { 9 | 10 | 11 | 12 | /* Initialization functions */ 13 | 14 | int R3InitSolid(); 15 | void R3StopSolid(); 16 | 17 | 18 | 19 | /* Class definition */ 20 | 21 | class R3Solid : public R3Shape { 22 | public: 23 | // Constructors/destructors ??? 24 | R3Solid(void); 25 | ~R3Solid(void); 26 | 27 | // Shape property functions/operators 28 | const RNBoolean IsSolid(void) const; 29 | }; 30 | 31 | 32 | 33 | // End namespace 34 | } 35 | 36 | 37 | // End include guard 38 | #endif 39 | -------------------------------------------------------------------------------- /external/ldif/gaps/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile for GAPS 3 | # 4 | 5 | 6 | 7 | # 8 | # Make targets 9 | # 10 | 11 | opt: 12 | $(MAKE) target "TARGET=$@" 13 | 14 | debug: 15 | $(MAKE) target "TARGET=$@" 16 | 17 | mesa: 18 | $(MAKE) target "TARGET=$@" 19 | 20 | clean: 21 | $(MAKE) target "TARGET=$@" 22 | 23 | release: pkgs apps docs makefiles vc 24 | mkdir -p release 25 | cp README.txt release 26 | cp LICENSE.txt release 27 | cp Makefile release 28 | cp -r makefiles release 29 | $(MAKE) target "TARGET=$@" 30 | 31 | target: 32 | cd pkgs; $(MAKE) $(TARGET) 33 | cd apps; $(MAKE) $(TARGET) 34 | cd vc; $(MAKE) $(TARGET) 35 | # cd docs; $(MAKE) $(TARGET) 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /external/ldif/ldif2mesh/build-profile.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # This command only builds 15 | ./build.sh "-lineinfo" 16 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/R3Shapes/R3Surface.h: -------------------------------------------------------------------------------- 1 | /* Include file for the R3 surface class */ 2 | #ifndef __R3__SURFACE__H__ 3 | #define __R3__SURFACE__H__ 4 | 5 | 6 | 7 | /* Begin namespace */ 8 | namespace gaps { 9 | 10 | 11 | 12 | /* Initialization functions */ 13 | 14 | int R3InitSurface(); 15 | void R3StopSurface(); 16 | 17 | 18 | 19 | /* Class definition */ 20 | 21 | class R3Surface : public R3Shape { 22 | public: 23 | // Constructors/destructors ??? 24 | R3Surface(void); 25 | ~R3Surface(void); 26 | 27 | // Shape property functions/operators 28 | const RNBoolean IsSurface(void) const; 29 | }; 30 | 31 | 32 | 33 | // End namespace 34 | } 35 | 36 | 37 | // End include guard 38 | #endif 39 | -------------------------------------------------------------------------------- /external/ldif/util/camera_util.py: -------------------------------------------------------------------------------- 1 | import torch 2 | 3 | 4 | def roll_pitch_yaw_to_rotation_matrices(roll_pitch_yaw): 5 | # Converts roll-pitch-yaw angles to rotation matrices. 6 | # (ldif.util.camera_util.roll_pitch_yaw_to_rotation_matrices) 7 | cosines = torch.cos(roll_pitch_yaw) 8 | sines = torch.sin(roll_pitch_yaw) 9 | cx, cy, cz = cosines.unbind(-1) 10 | sx, sy, sz = sines.unbind(-1) 11 | rotation = torch.stack( 12 | [cz * cy, cz * sy * sx - sz * cx, cz * sy * cx + sz * sx, 13 | sz * cy, sz * sy * sx + cz * cx, sz * sy * cx - cz * sx, 14 | -sy, cy * sx, cy * cx], -1 15 | ) 16 | rotation = torch.reshape(rotation, [rotation.shape[0], -1, 3, 3]) 17 | return rotation 18 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/R2Shapes/R2Curve.cpp: -------------------------------------------------------------------------------- 1 | /* Source file for the R2 curve class */ 2 | 3 | 4 | 5 | /* Include files */ 6 | 7 | #include "R2Shapes.h" 8 | 9 | 10 | 11 | // Namespace 12 | 13 | namespace gaps { 14 | 15 | 16 | 17 | /* Public functions */ 18 | 19 | int 20 | R2InitCurve() 21 | { 22 | /* Return success */ 23 | return TRUE; 24 | } 25 | 26 | 27 | 28 | void 29 | R2StopCurve() 30 | { 31 | } 32 | 33 | 34 | 35 | R2Curve:: 36 | R2Curve(void) 37 | { 38 | } 39 | 40 | 41 | 42 | R2Curve:: 43 | ~R2Curve(void) 44 | { 45 | } 46 | 47 | 48 | 49 | const RNBoolean R2Curve:: 50 | IsCurve(void) const 51 | { 52 | // All curve shapes are curves 53 | return TRUE; 54 | } 55 | 56 | 57 | 58 | } // namespace gaps 59 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/R2Shapes/R2Solid.cpp: -------------------------------------------------------------------------------- 1 | /* Source file for the R2 solid class */ 2 | 3 | 4 | 5 | /* Include files */ 6 | 7 | #include "R2Shapes.h" 8 | 9 | 10 | 11 | // Namespace 12 | 13 | namespace gaps { 14 | 15 | 16 | 17 | /* Public functions */ 18 | 19 | int 20 | R2InitSolid() 21 | { 22 | /* Return success */ 23 | return TRUE; 24 | } 25 | 26 | 27 | 28 | void 29 | R2StopSolid() 30 | { 31 | } 32 | 33 | 34 | 35 | R2Solid:: 36 | R2Solid(void) 37 | { 38 | } 39 | 40 | 41 | 42 | R2Solid:: 43 | ~R2Solid(void) 44 | { 45 | } 46 | 47 | 48 | 49 | const RNBoolean R2Solid:: 50 | IsSolid(void) const 51 | { 52 | // All solid shapes are solids 53 | return TRUE; 54 | } 55 | 56 | 57 | 58 | } // namespace gaps 59 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/R3Shapes/R3Solid.cpp: -------------------------------------------------------------------------------- 1 | /* Source file for the R3 solid class */ 2 | 3 | 4 | 5 | /* Include files */ 6 | 7 | #include "R3Shapes.h" 8 | 9 | 10 | 11 | // Namespace 12 | 13 | namespace gaps { 14 | 15 | 16 | 17 | /* Public functions */ 18 | 19 | int 20 | R3InitSolid() 21 | { 22 | /* Return success */ 23 | return TRUE; 24 | } 25 | 26 | 27 | 28 | void 29 | R3StopSolid() 30 | { 31 | } 32 | 33 | 34 | 35 | R3Solid:: 36 | R3Solid(void) 37 | { 38 | } 39 | 40 | 41 | 42 | R3Solid:: 43 | ~R3Solid(void) 44 | { 45 | } 46 | 47 | 48 | 49 | const RNBoolean R3Solid:: 50 | IsSolid(void) const 51 | { 52 | // All solid shapes are solids 53 | return TRUE; 54 | } 55 | 56 | 57 | 58 | 59 | } // namespace gaps 60 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/fglut/glut.h: -------------------------------------------------------------------------------- 1 | #ifndef __GLUT_H__ 2 | #define __GLUT_H__ 3 | 4 | /* 5 | * glut.h 6 | * 7 | * The freeglut library include file 8 | * 9 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 10 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 11 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 12 | * PAWEL W. OLSZTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 13 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 14 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | */ 16 | 17 | #include "freeglut_std.h" 18 | 19 | /*** END OF FILE ***/ 20 | 21 | #endif /* __GLUT_H__ */ 22 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/R3Shapes/R3Surface.cpp: -------------------------------------------------------------------------------- 1 | /* Source file for the R3 surface class */ 2 | 3 | 4 | 5 | /* Include files */ 6 | 7 | #include "R3Shapes.h" 8 | 9 | 10 | 11 | // Namespace 12 | 13 | namespace gaps { 14 | 15 | 16 | 17 | /* Public functions */ 18 | 19 | int 20 | R3InitSurface() 21 | { 22 | /* Return success */ 23 | return TRUE; 24 | } 25 | 26 | 27 | 28 | void 29 | R3StopSurface() 30 | { 31 | } 32 | 33 | 34 | 35 | R3Surface:: 36 | R3Surface(void) 37 | { 38 | } 39 | 40 | 41 | 42 | R3Surface:: 43 | ~R3Surface(void) 44 | { 45 | } 46 | 47 | 48 | 49 | const RNBoolean R3Surface:: 50 | IsSurface(void) const 51 | { 52 | // All surface shapes are surfaces 53 | return TRUE; 54 | } 55 | 56 | 57 | 58 | 59 | } // namespace gaps 60 | -------------------------------------------------------------------------------- /external/ldif/gaps/vc/makefiles/Makefile.std: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile setup for GAPS 3 | # 4 | 5 | 6 | 7 | # 8 | # Targets 9 | # 10 | 11 | OBJS=$(CCSRCS:.C=.obj) $(CCSRCS:.c=.obj) 12 | INCS=$(HSRCS) $(CCSRCS:.C=.h) 13 | 14 | 15 | 16 | # 17 | # C flags 18 | # 19 | 20 | CC=cl 21 | BASE_CFLAGS=$(USER_CFLAGS) /TP /W3 -I. -I../../pkgs 22 | DEBUG_CFLAGS=-Zi $(BASE_CFLAGS) 23 | OPT_CFLAGS=-Ox -DNDEBUG $(BASE_CFLAGS) 24 | CFLAGS=$(DEBUG_CFLAGS) 25 | 26 | 27 | 28 | # 29 | # Directories 30 | # 31 | 32 | RELEASE_DIR=../../release 33 | EXE_DIR=../../bin/win32 34 | LIB_DIR=../../lib/win32 35 | 36 | 37 | 38 | # 39 | # Default rules 40 | # 41 | 42 | .SUFFIXES: .c .C .obj 43 | 44 | .C.obj: 45 | $(CC) $(CFLAGS) -c $< 46 | 47 | .c.obj: 48 | $(CC) $(CFLAGS) -c $< 49 | 50 | 51 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/fglut/freeglut.h: -------------------------------------------------------------------------------- 1 | #ifndef __FREEGLUT_H__ 2 | #define __FREEGLUT_H__ 3 | 4 | /* 5 | * freeglut.h 6 | * 7 | * The freeglut library include file 8 | * 9 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 10 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 11 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 12 | * PAWEL W. OLSZTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 13 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 14 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | */ 16 | 17 | #include "freeglut_std.h" 18 | #include "freeglut_ext.h" 19 | 20 | /*** END OF FILE ***/ 21 | 22 | #endif /* __FREEGLUT_H__ */ 23 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/RNBasics/RNExtern.h: -------------------------------------------------------------------------------- 1 | /* Include file for external stuff */ 2 | #ifndef __RN__EXTERN__H__ 3 | #define __RN__EXTERN__H__ 4 | 5 | 6 | 7 | /* Usual C include files */ 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | 19 | 20 | /* Standard library include files */ 21 | 22 | #include 23 | #include 24 | 25 | 26 | 27 | /* Machine dependent include files */ 28 | 29 | #if (RN_OS == RN_WINDOWS) 30 | # include 31 | # include 32 | #else 33 | # include 34 | # include 35 | # include 36 | #endif 37 | 38 | 39 | 40 | // End include guard 41 | #endif 42 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/png/gzclose.c: -------------------------------------------------------------------------------- 1 | /* gzclose.c -- zlib gzclose() function 2 | * Copyright (C) 2004, 2010 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | #include "gzguts.h" 7 | 8 | /* gzclose() is in a separate file so that it is linked in only if it is used. 9 | That way the other gzclose functions can be used instead to avoid linking in 10 | unneeded compression or decompression routines. */ 11 | int ZEXPORT gzclose(file) 12 | gzFile file; 13 | { 14 | #ifndef NO_GZCOMPRESS 15 | gz_statep state; 16 | 17 | if (file == NULL) 18 | return Z_STREAM_ERROR; 19 | state = (gz_statep)file; 20 | 21 | return state->mode == GZ_READ ? gzclose_r(file) : gzclose_w(file); 22 | #else 23 | return gzclose_r(file); 24 | #endif 25 | } 26 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/RNMath/RNMath.cpp: -------------------------------------------------------------------------------- 1 | /* Source file for GAPS math module */ 2 | 3 | 4 | 5 | /* Include files */ 6 | 7 | #include "RNMath.h" 8 | 9 | 10 | 11 | /* Private variables */ 12 | 13 | static int RNmath_active_count = 0; 14 | 15 | 16 | 17 | // Namespace 18 | 19 | namespace gaps { 20 | 21 | 22 | 23 | int RNInitMath(void) 24 | { 25 | // Check whether are already initialized 26 | if ((RNmath_active_count++) > 0) return TRUE; 27 | 28 | // Initialize submodules 29 | RNSeedRandomScalar(); 30 | 31 | // Return OK status 32 | return TRUE; 33 | } 34 | 35 | 36 | 37 | void RNStopMath(void) 38 | { 39 | // Check whether have been initialized 40 | if ((--RNmath_active_count) > 0) return; 41 | 42 | // Stop submodules 43 | // ??? 44 | } 45 | 46 | 47 | 48 | } // namespace gaps 49 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/RGBD/RGBD.cpp: -------------------------------------------------------------------------------- 1 | /* Source file for GAPS rgbd module */ 2 | 3 | 4 | 5 | /* Include files */ 6 | 7 | #include "RGBD.h" 8 | 9 | 10 | 11 | // Namespace 12 | 13 | namespace gaps { 14 | 15 | 16 | 17 | /* Private variables */ 18 | 19 | static int RGBD_active_count = 0; 20 | 21 | 22 | 23 | int RGBDInit(void) 24 | { 25 | // Check whether are already initialized 26 | if ((RGBD_active_count++) > 0) return TRUE; 27 | 28 | // Initialize dependencies 29 | if (!R3InitShapes()) return FALSE; 30 | 31 | // return OK status 32 | return TRUE; 33 | } 34 | 35 | 36 | 37 | void RGBDStop(void) 38 | { 39 | // Check whether have been initialized 40 | if ((--RGBD_active_count) > 0) return; 41 | 42 | // Stop dependencies 43 | R3StopShapes(); 44 | } 45 | 46 | 47 | 48 | } // namespace gaps 49 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/RNBasics/RNBasics.cpp: -------------------------------------------------------------------------------- 1 | /* Source file for GAPS basics module */ 2 | 3 | 4 | 5 | /* Include files */ 6 | 7 | #include "RNBasics.h" 8 | 9 | 10 | 11 | // Namespace 12 | 13 | namespace gaps { 14 | 15 | 16 | 17 | /* Private variables */ 18 | 19 | static int RNbasics_active_count = 0; 20 | 21 | 22 | 23 | int RNInitBasics(void) 24 | { 25 | // Check whether are already initialized 26 | if ((RNbasics_active_count++) > 0) return TRUE; 27 | 28 | // Initialize submodules 29 | RNSeedRandomScalar(); 30 | 31 | // Return OK status 32 | return TRUE; 33 | } 34 | 35 | 36 | 37 | void RNStopBasics(void) 38 | { 39 | // Check whether have been initialized 40 | if ((--RNbasics_active_count) > 0) return; 41 | 42 | // Stop submodules 43 | // ??? 44 | } 45 | 46 | 47 | 48 | } // namespace gaps 49 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/R2Shapes/R2Curve.h: -------------------------------------------------------------------------------- 1 | /* Include file for the R2 curve class */ 2 | #ifndef __R2__CURVE__H__ 3 | #define __R2__CURVE__H__ 4 | 5 | 6 | 7 | /* Begin namespace */ 8 | namespace gaps { 9 | 10 | 11 | 12 | /* Initialization functions */ 13 | 14 | int R2InitCurve(); 15 | void R2StopCurve(); 16 | 17 | 18 | 19 | /* Class definition */ 20 | 21 | class R2Curve : public R2Shape { 22 | public: 23 | // Constructors/destructors ??? 24 | R2Curve(void); 25 | ~R2Curve(void); 26 | 27 | // Shape property functions/operators 28 | const RNBoolean IsCurve(void) const; 29 | 30 | // Curve property functions/operators 31 | // virtual const R2Point Start(void) const = 0; 32 | // virtual const R2Point End(void) const = 0; 33 | }; 34 | 35 | 36 | 37 | // End namespace 38 | } 39 | 40 | 41 | // End include guard 42 | #endif 43 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/R2Shapes/R2Shape.cpp: -------------------------------------------------------------------------------- 1 | /* Source file for the R2 shape class */ 2 | 3 | 4 | 5 | /* Include files */ 6 | 7 | #include "R2Shapes.h" 8 | 9 | 10 | 11 | // Namespace 12 | 13 | namespace gaps { 14 | 15 | 16 | 17 | /* Public draw flags */ 18 | 19 | const R2DrawFlags R2_EDGES_DRAW_FLAG (0x001); 20 | const R2DrawFlags R2_SURFACES_DRAW_FLAG (0x002); 21 | const R2DrawFlags R2_NULL_DRAW_FLAGS (0x000); 22 | const R2DrawFlags R2_EVERYTHING_DRAW_FLAGS (0xFFF); 23 | const R2DrawFlags R2_DEFAULT_DRAW_FLAGS (R2_EVERYTHING_DRAW_FLAGS); 24 | 25 | 26 | 27 | /* Public functions */ 28 | 29 | int 30 | R2InitShape() 31 | { 32 | /* Return success */ 33 | return TRUE; 34 | } 35 | 36 | 37 | 38 | void 39 | R2StopShape() 40 | { 41 | } 42 | 43 | 44 | 45 | } // namespace gaps 46 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/R3Surfels/R3Surfels.cpp: -------------------------------------------------------------------------------- 1 | /* Source file for GAPS surfels module */ 2 | 3 | 4 | 5 | /* Include files */ 6 | 7 | #include "R3Surfels.h" 8 | 9 | 10 | 11 | // Namespace 12 | 13 | namespace gaps { 14 | 15 | 16 | 17 | /* Private variables */ 18 | 19 | static int R3surfels_active_count = 0; 20 | 21 | 22 | 23 | int R3InitSurfels(void) 24 | { 25 | // Check whether are already initialized 26 | if ((R3surfels_active_count++) > 0) return TRUE; 27 | 28 | // Initialize dependencies 29 | if (!R3InitShapes()) return FALSE; 30 | 31 | // return OK status 32 | return TRUE; 33 | } 34 | 35 | 36 | 37 | void R3StopSurfels(void) 38 | { 39 | // Check whether have been initialized 40 | if ((--R3surfels_active_count) > 0) return; 41 | 42 | // Stop dependencies 43 | R3StopShapes(); 44 | } 45 | 46 | 47 | 48 | } // namespace gaps 49 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/RNMath/RNMatrix.h: -------------------------------------------------------------------------------- 1 | // Include file for abstract matrix class 2 | #ifndef __RN__MATRIX__H__ 3 | #define __RN__MATRIX__H__ 4 | 5 | 6 | 7 | // Begin namespace 8 | namespace gaps { 9 | 10 | 11 | 12 | // Class definition 13 | 14 | class RNMatrix { 15 | public: 16 | // Constructor/destructor 17 | RNMatrix(void); 18 | RNMatrix(const RNMatrix& matrix); 19 | virtual ~RNMatrix(void); 20 | 21 | // Entry access 22 | virtual int NRows(void) const = 0; 23 | virtual int NColumns(void) const = 0; 24 | virtual RNScalar Value(int i, int j) const = 0; 25 | virtual void SetValue(int i, int j, RNScalar value) = 0; 26 | 27 | // Property functions/operators 28 | virtual RNBoolean IsDense(void) const = 0; 29 | virtual RNBoolean IsSparse(void) const = 0; 30 | }; 31 | 32 | 33 | 34 | // End namespace 35 | } 36 | 37 | 38 | // End include guard 39 | #endif 40 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/R2Shapes/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Package name 3 | # 4 | 5 | NAME=R2Shapes 6 | 7 | 8 | 9 | # 10 | # List of source files 11 | # 12 | 13 | CCSRCS=R2Shapes.cpp \ 14 | R2Draw.cpp R2Io.cpp R2Kdtree.cpp \ 15 | R2Dist.cpp R2Cont.cpp R2Isect.cpp R2Parall.cpp R2Perp.cpp R2Relate.cpp R2Align.cpp \ 16 | R2Grid.cpp R2PixelDatabase.cpp \ 17 | R2Polyline.cpp R2Arc.cpp R2Curve.cpp \ 18 | R2Polygon.cpp R2Circle.cpp R2Box.cpp R2Solid.cpp \ 19 | R2Shape.cpp \ 20 | R2Affine.cpp R2Xform.cpp R2Crdsys.cpp R2Diad.cpp R3Matrix.cpp \ 21 | R2Halfspace.cpp R2Span.cpp R2Ray.cpp R2Line.cpp R2Point.cpp R2Vector.cpp \ 22 | R2Image.cpp 23 | 24 | 25 | # 26 | # Dependencies 27 | # 28 | 29 | PKG_DEPENDENCIES = RNBasics jpeg png 30 | 31 | 32 | 33 | # 34 | # PKG makefile 35 | # 36 | 37 | include ../../makefiles/Makefile.pkgs 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /external/ldif/gaps/vc/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile for GAPS visual studio release 3 | # 4 | 5 | 6 | # 7 | # Set up options, etc. 8 | # 9 | 10 | RELEASE_DIR=../release 11 | 12 | 13 | 14 | # 15 | # Make targets 16 | # 17 | 18 | opt: 19 | 20 | debug: 21 | 22 | mesa: 23 | 24 | release: 25 | mkdir -p $(RELEASE_DIR)/vc 26 | cp vc.sln $(RELEASE_DIR)/vc 27 | cp -r glut $(RELEASE_DIR)/vc 28 | mkdir -p $(RELEASE_DIR)/bin 29 | mkdir -p $(RELEASE_DIR)/lib 30 | mkdir -p $(RELEASE_DIR)/bin/win32 31 | mkdir -p $(RELEASE_DIR)/lib/win32 32 | cp glut/glut32.dll $(RELEASE_DIR)/bin/win32 33 | cp glut/glut32.lib $(RELEASE_DIR)/lib/win32 34 | cp Makefile $(RELEASE_DIR)/vc 35 | cp README.txt $(RELEASE_DIR)/vc 36 | 37 | clean: 38 | - rm -f -r Debug Release ../bin/win32/*.exe ../bin/win32/*.ilk ../bin/win32/*.pdb ../lib/win32/*.lib vc.ncb vc.suo vc.sdf *~ 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/RNMath/RNMath.h: -------------------------------------------------------------------------------- 1 | // Include file for RNMath package 2 | #ifndef __RN__MATH__H__ 3 | #define __RN__MATH__H__ 4 | 5 | 6 | 7 | // Dependency include files 8 | 9 | #include "RNBasics/RNBasics.h" 10 | 11 | 12 | 13 | // Declarations 14 | 15 | namespace gaps { 16 | class RNVector; 17 | class RNMatrix; 18 | class RNDenseMatrix; 19 | class RNPolynomial; 20 | class RNPolynomialTerm; 21 | class RNAlgebraic; 22 | typedef RNAlgebraic RNExpression; 23 | class RNEquation; 24 | class RNSystemOfEquations; 25 | } 26 | 27 | 28 | 29 | // Matrix classes 30 | 31 | #include "RNLapack.h" 32 | #include "RNVector.h" 33 | #include "RNMatrix.h" 34 | #include "RNDenseMatrix.h" 35 | #include "RNDenseLUMatrix.h" 36 | 37 | 38 | // Expression and equation classes 39 | 40 | #include "RNPolynomial.h" 41 | #include "RNAlgebraic.h" 42 | #include "RNEquation.h" 43 | #include "RNSystemOfEquations.h" 44 | 45 | 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/png/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Package name 3 | # 4 | 5 | NAME=png 6 | 7 | 8 | 9 | # 10 | # List of source files 11 | # 12 | 13 | # JPEG library source files 14 | PNG_CSRCS = \ 15 | png.c \ 16 | pngset.c \ 17 | pngget.c \ 18 | pngrutil.c \ 19 | pngtrans.c \ 20 | pngwutil.c \ 21 | pngread.c \ 22 | pngrio.c \ 23 | pngwio.c \ 24 | pngwrite.c \ 25 | pngrtran.c \ 26 | pngwtran.c \ 27 | pngmem.c \ 28 | pngerror.c \ 29 | pngpread.c 30 | 31 | ZLIB_CSRCS = \ 32 | adler32.c \ 33 | compress.c \ 34 | crc32.c \ 35 | deflate.c \ 36 | gzclose.c \ 37 | gzlib.c \ 38 | gzread.c \ 39 | gzwrite.c \ 40 | infback.c \ 41 | inffast.c \ 42 | inflate.c \ 43 | inftrees.c \ 44 | trees.c \ 45 | uncompr.c \ 46 | zutil.c 47 | 48 | CSRCS = $(PNG_CSRCS) $(ZLIB_CSRCS) 49 | 50 | 51 | 52 | # 53 | # GAPS library makefile 54 | # 55 | 56 | include ../../makefiles/Makefile.pkgs 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/RNBasics/RNSvd.h: -------------------------------------------------------------------------------- 1 | // Include file for SVD functions 2 | #ifndef __RN__SVD__H__ 3 | #define __RN__SVD__H__ 4 | 5 | 6 | 7 | /* Begin namespace */ 8 | namespace gaps { 9 | 10 | 11 | 12 | // Function to perform singular value decomposition 13 | 14 | extern void RNSvdDecompose(int m, int n, 15 | const RNScalar *a, 16 | RNScalar *u, RNScalar *w, RNScalar *vt); 17 | 18 | 19 | 20 | // Function to perform back substitution 21 | 22 | extern void RNSvdBacksubstitute(int m, int n, 23 | const RNScalar *u, const RNScalar *w, const RNScalar *vt, const RNScalar *b, 24 | RNScalar *x, RNScalar eps = RN_EPSILON); 25 | 26 | 27 | 28 | // Function to solve system of equations by SVD and back substitution 29 | 30 | extern void RNSvdSolve(int m, int n, 31 | const RNScalar *a, const RNScalar *b, 32 | RNScalar *x, RNScalar eps = RN_EPSILON); 33 | 34 | 35 | 36 | // End namespace 37 | } 38 | 39 | 40 | // End include guard 41 | #endif 42 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/fglut/fglut.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fglut", "fglut.vcxproj", "{245FD70C-6B13-4581-B674-838551C69144}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Win32 = Debug|Win32 9 | Release|Win32 = Release|Win32 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {245FD70C-6B13-4581-B674-838551C69144}.Debug|Win32.ActiveCfg = Debug|Win32 13 | {245FD70C-6B13-4581-B674-838551C69144}.Debug|Win32.Build.0 = Debug|Win32 14 | {245FD70C-6B13-4581-B674-838551C69144}.Release|Win32.ActiveCfg = Release|Win32 15 | {245FD70C-6B13-4581-B674-838551C69144}.Release|Win32.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/fglut/AUTHORS: -------------------------------------------------------------------------------- 1 | Pawel W. Olszta 2 | the person to be blamed for freeglut 3 | 4 | Andreas Umbach 5 | the first person to contribute to the freeglut project, 6 | contributed the cube and sphere geometry code 7 | 8 | Steve Baker 9 | joystick code (from his great PLIB), numerous hints 10 | tips on the freeglut usability 11 | and for taking the project over when Pawel bowed out 12 | 13 | Christopher John Purnell 14 | Don Heyse 15 | Dave McClurg 16 | John F. Fay 17 | Norman Vine 18 | Daniel Wagner 19 | Sven Panne 20 | contributing the project, using the product, and generally keeping it going 21 | 22 | Brian Paul 23 | Eric Sandall 24 | giving us the oomph! to make an official release 25 | 26 | James 'J.C.' Jones 27 | designing the new website 28 | 29 | ...and all the opengl-gamedev-l people that made Pawel start this project :) 30 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/RNBasics/RNBase.h: -------------------------------------------------------------------------------- 1 | /* Include file for GAPS basics */ 2 | #ifndef __RN__BASE__H__ 3 | #define __RN__BASE__H__ 4 | 5 | 6 | 7 | /* Begin namespace */ 8 | namespace gaps { 9 | 10 | 11 | 12 | /* Initialization functions */ 13 | 14 | int RNInitBase(); 15 | void RNStopBase(); 16 | 17 | 18 | 19 | /* Class definition */ 20 | 21 | class RNBase {}; 22 | 23 | 24 | 25 | /* TRUE/FALSE constant definitions */ 26 | 27 | typedef int RNBoolean; 28 | #ifndef TRUE 29 | #define TRUE 1 30 | #endif 31 | #ifndef FALSE 32 | #define FALSE 0 33 | #endif 34 | 35 | 36 | 37 | /* Programming convenience macros */ 38 | 39 | #define brcase break; case 40 | 41 | 42 | 43 | /* Standard types */ 44 | 45 | typedef int RNMark; 46 | 47 | 48 | 49 | /* Global variables */ 50 | 51 | extern RNMark RNmark; 52 | 53 | 54 | 55 | /* Useful functions */ 56 | 57 | extern void RNBreakDebug(void); 58 | 59 | 60 | 61 | // End namespace 62 | } 63 | 64 | 65 | // End include guard 66 | #endif 67 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/R2Shapes/R2Shapes.cpp: -------------------------------------------------------------------------------- 1 | /* Source file for GAPS shapes module */ 2 | 3 | 4 | 5 | /* Include files */ 6 | 7 | #include "R2Shapes.h" 8 | 9 | 10 | 11 | // Namespace 12 | 13 | namespace gaps { 14 | 15 | 16 | 17 | /* Private variables */ 18 | 19 | static int R2shapes_active_count = 0; 20 | 21 | 22 | 23 | int R2InitShapes(void) 24 | { 25 | // Check whether are already initialized 26 | if ((R2shapes_active_count++) > 0) return TRUE; 27 | 28 | // Initialize dependencies 29 | if (!RNInitBasics()) return FALSE; 30 | 31 | // Initialize submodules 32 | if (!R2InitCircle()) return FALSE; 33 | 34 | // return OK status 35 | return TRUE; 36 | } 37 | 38 | 39 | 40 | void R2StopShapes(void) 41 | { 42 | // Check whether have been initialized 43 | if ((--R2shapes_active_count) > 0) return; 44 | 45 | // Stop submodules 46 | R2StopCircle(); 47 | 48 | // Stop dependencies 49 | RNStopBasics(); 50 | } 51 | 52 | 53 | 54 | } // namespace gaps 55 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/RNBasics/RNError.h: -------------------------------------------------------------------------------- 1 | /* Include file for GAPS error utility */ 2 | #ifndef __RN__ERROR__H__ 3 | #define __RN__ERROR__H__ 4 | 5 | 6 | 7 | /* Begin namespace */ 8 | namespace gaps { 9 | 10 | 11 | 12 | /* Initialization functions */ 13 | 14 | int RNInitError(); 15 | void RNStopError(); 16 | 17 | 18 | 19 | /* Error file functions */ 20 | 21 | void RNSetErrorFile(FILE *fp); 22 | void RNSetErrorLevel(int level); 23 | 24 | 25 | 26 | /* Error reporting functions */ 27 | 28 | void RNAbort(const char *fmt, ...); 29 | void RNFail(const char *fmt, ...); 30 | void RNWarning(const char *fmt, ...); 31 | 32 | 33 | 34 | // End namespace 35 | } 36 | 37 | 38 | 39 | /* Define my own assert function */ 40 | 41 | #ifdef assert 42 | # undef assert 43 | #endif 44 | 45 | #ifdef NDEBUG 46 | #define assert(__x__) 47 | #else 48 | #define assert(__x__) \ 49 | if (!(__x__)) RNAbort("Assertion error %s at line %d in file %s", #__x__, __LINE__, __FILE__) 50 | #endif 51 | 52 | 53 | 54 | // End include guard 55 | #endif 56 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/R3Graphics/R3Graphics.cpp: -------------------------------------------------------------------------------- 1 | /* Source file for GAPS graphics module */ 2 | 3 | 4 | 5 | /* Include files */ 6 | 7 | #include "R3Graphics.h" 8 | 9 | 10 | 11 | // Namespace 12 | 13 | namespace gaps { 14 | 15 | 16 | 17 | /* Private variables */ 18 | 19 | static int R3graphics_active_count = 0; 20 | 21 | 22 | 23 | int R3InitGraphics(void) 24 | { 25 | // Check whether are already initialized 26 | if ((R3graphics_active_count++) > 0) return TRUE; 27 | 28 | // Initialize dependencies 29 | if (!R3InitShapes()) return FALSE; 30 | 31 | // Initialize submodules 32 | if (!R3InitMaterial()) return FALSE; 33 | 34 | // return OK status 35 | return TRUE; 36 | } 37 | 38 | 39 | 40 | void R3StopGraphics(void) 41 | { 42 | // Check whether have been initialized 43 | if ((--R3graphics_active_count) > 0) return; 44 | 45 | // Stop submodules 46 | R3StopMaterial(); 47 | 48 | // Stop dependencies 49 | R3StopShapes(); 50 | } 51 | 52 | 53 | 54 | } // namespace gaps 55 | -------------------------------------------------------------------------------- /external/pyTorchChamferDistance/README.md: -------------------------------------------------------------------------------- 1 | # Chamfer Distance for pyTorch 2 | 3 | This is an implementation of the Chamfer Distance as a module for pyTorch. It is written as a custom C++/CUDA extension. 4 | 5 | As it is using pyTorch's [JIT compilation](https://pytorch.org/tutorials/advanced/cpp_extension.html), there are no additional prerequisite steps that have to be taken. Simply import the module as shown below; CUDA and C++ code will be compiled on the first run. 6 | 7 | ### Usage 8 | ```python 9 | from chamfer_distance import ChamferDistance 10 | chamfer_dist = ChamferDistance() 11 | 12 | #... 13 | # points and points_reconstructed are n_points x 3 matrices 14 | 15 | dist1, dist2 = chamfer_dist(points, points_reconstructed) 16 | loss = (torch.mean(dist1)) + (torch.mean(dist2)) 17 | 18 | 19 | #... 20 | ``` 21 | 22 | ### Integration 23 | This code has been integrated into the [Kaolin](https://github.com/NVIDIAGameWorks/kaolin) library for 3D Deep Learning by NVIDIAGameWorks. You should probably take a look at it if you are working on anything 3D :) 24 | -------------------------------------------------------------------------------- /external/ldif/gaps/vc/README.txt: -------------------------------------------------------------------------------- 1 | To compile, you should be able to open vc.sln and "Rebuild Solution. 2 | 3 | ------------------------------------------------------------------------ 4 | 5 | This file contains notes about settings made when creating the vc.sln file. 6 | 7 | All: 8 | General: Output Directory = $(SolutionDir)/$(ConfigurationName)/$(ProjectName) 9 | General: Intermediate Directory = $(SolutionDir)/$(ConfigurationName)/$(ProjectName) 10 | Input: Additional Dependencies = R3Graphics.lib R3Shapes.lib R2Shapes.lib RNBasics.lib jpeg.lib glut32.lib glu32.lib opengl32.lib 11 | C/C++: General: Additional Include Directories = ../../pkgs 12 | C/C++: Advanced: Comple as C++ Code (Set TP explicitly) --- except jpeg, png, fglut 13 | C/C++: Advanced: Disable Specific warnings 4244, 4267, 4996 14 | 15 | For pkgs: 16 | Librarian: General: Output File = ../../lib/win32/${ProjectName}.lib 17 | 18 | For apps: 19 | Linker: General:Additional Library Directories = ../../lib/win32 20 | Linker: General: Output file = ../../bin/win32/$(ProjectName).exe 21 | -------------------------------------------------------------------------------- /external/ldif/gaps/apps/qview/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | # Application name 16 | # 17 | 18 | NAME=qview 19 | 20 | 21 | 22 | # 23 | # Source files. 24 | # 25 | 26 | CCSRCS=$(NAME).cpp R3QuadricSet.cpp R3Quadric.cpp 27 | 28 | 29 | 30 | # 31 | # Libraries 32 | # 33 | 34 | PKG_LIBS=-lR3Graphics -lR3Shapes -lR2Shapes -lRNBasics -lfglut -ljpeg -lpng 35 | 36 | 37 | 38 | # 39 | # Include standard makefile 40 | # 41 | 42 | include ../../makefiles/Makefile.apps 43 | 44 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/R2Shapes/R2Relate.h: -------------------------------------------------------------------------------- 1 | /* Include file for R2 miscelleaneous relationship utility */ 2 | #ifndef __R2__RELATE__H__ 3 | #define __R2__RELATE__H__ 4 | 5 | 6 | 7 | /* Begin namespace */ 8 | namespace gaps { 9 | 10 | 11 | 12 | /* Miscellaneous relationship function declarations */ 13 | 14 | RNAngle R2InteriorAngle(const R2Vector& vector1, const R2Vector& vector2); 15 | RNAngle R2InteriorAngle(const R2Vector& vector, const R2Line& line); 16 | RNAngle R2InteriorAngle(const R2Vector& vector, const R2Ray& ray); 17 | RNAngle R2InteriorAngle(const R2Vector& vector, const R2Span& span); 18 | 19 | RNArea R2IntersectionArea(const R2Box& box1, const R2Box& box2); 20 | RNArea R2IntersectionArea(const R2Circle& circle1, const R2Circle& circle2); 21 | 22 | RNBoolean R2Abuts(const R2Box& box1, const R2Box& box2); 23 | 24 | int R2Splits(const R2Line& line, const R2Span& span); 25 | int R2Splits(const R2Line& line, const R2Span& span, R2Span *below_result, R2Span *above_result = NULL); 26 | 27 | 28 | 29 | // End namespace 30 | } 31 | 32 | 33 | // End include guard 34 | #endif 35 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/fglut/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile for freeglut library 3 | # 4 | 5 | 6 | 7 | # 8 | # Package name and list of source files. 9 | # 10 | 11 | NAME=fglut 12 | FGLUT_CSRCS = \ 13 | freeglut_callbacks.c \ 14 | freeglut_cursor.c \ 15 | freeglut_display.c \ 16 | freeglut_ext.c \ 17 | freeglut_font.c \ 18 | freeglut_glutfont_definitions.c \ 19 | freeglut_font_data.c \ 20 | freeglut_stroke_roman.c \ 21 | freeglut_stroke_mono_roman.c \ 22 | freeglut_gamemode.c \ 23 | freeglut_geometry.c \ 24 | freeglut_init.c \ 25 | freeglut_input_devices.c \ 26 | freeglut_spaceball.c \ 27 | freeglut_joystick.c \ 28 | freeglut_main.c \ 29 | freeglut_menu.c \ 30 | freeglut_misc.c \ 31 | freeglut_overlay.c \ 32 | freeglut_state.c \ 33 | freeglut_structure.c \ 34 | freeglut_teapot.c \ 35 | freeglut_videoresize.c \ 36 | freeglut_window.c 37 | 38 | ifeq ("$(shell uname -s)", "Darwin") 39 | CSRCS = $(NAME).c 40 | else 41 | CSRCS=$(FGLUT_CSRCS) 42 | endif 43 | 44 | 45 | 46 | # 47 | # R3 library makefile 48 | # 49 | 50 | include ../../makefiles/Makefile.pkgs 51 | 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/R3Shapes/R3Draw.h: -------------------------------------------------------------------------------- 1 | /* Include file for R3 draw utility */ 2 | #ifndef __R3__DRAW__H__ 3 | #define __R3__DRAW__H__ 4 | 5 | 6 | 7 | /* Begin namespace */ 8 | namespace gaps { 9 | 10 | 11 | 12 | /* Inline macros */ 13 | 14 | #define R3LoadRgb RNLoadRgb 15 | 16 | 17 | 18 | /* Inline functions */ 19 | 20 | inline void 21 | R3LoadNormal(const R3Vector& normal) 22 | { 23 | // Load normal vector 24 | R3LoadNormal(normal.Coords()); 25 | } 26 | 27 | 28 | 29 | inline void 30 | R3LoadPoint(const R3Point& point) 31 | { 32 | // Load vertex 33 | R3LoadPoint(point.Coords()); 34 | } 35 | 36 | 37 | 38 | inline void 39 | R3LoadTextureCoords(const R2Point& texcoords) 40 | { 41 | // Set texture coordinate (within R3BeginXXX and R3EndXXX) 42 | R3LoadTextureCoords(texcoords.Coords()); 43 | } 44 | 45 | 46 | 47 | inline void 48 | R3DrawText(const R3Point& p, const char *str) 49 | { 50 | // Draw text at point 51 | R3DrawText(p.X(), p.Y(), p.Z(), str); 52 | } 53 | 54 | 55 | 56 | // End namespace 57 | } 58 | 59 | 60 | // End include guard 61 | #endif 62 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/jpeg/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Package name 3 | # 4 | 5 | NAME=jpeg 6 | 7 | 8 | 9 | # 10 | # List of source files 11 | # 12 | 13 | # library object files common to compression and decompression 14 | COMSRCS= jcomapi.c jutils.c jerror.c jmemmgr.c jmemnobs.c 15 | 16 | # compression library object files 17 | CLIBSRCS= jcapimin.c jcapistd.c jctrans.c jcparam.c \ 18 | jdatadst.c jcinit.c jcmaster.c jcmarker.c jcmainct.c \ 19 | jcprepct.c jccoefct.c jccolor.c jcsample.c jchuff.c \ 20 | jcphuff.c jcdctmgr.c jfdctfst.c jfdctflt.c \ 21 | jfdctint.c 22 | 23 | # decompression library object files 24 | DLIBSRCS= jdapimin.c jdapistd.c jdtrans.c jdatasrc.c \ 25 | jdmaster.c jdinput.c jdmarker.c jdhuff.c jdphuff.c \ 26 | jdmainct.c jdcoefct.c jdpostct.c jddctmgr.c \ 27 | jidctfst.c jidctflt.c jidctint.c jidctred.c \ 28 | jdsample.c jdcolor.c jquant1.c jquant2.c jdmerge.c 29 | 30 | # JPEG library source files 31 | CSRCS=$(CLIBSRCS) $(DLIBSRCS) $(COMSRCS) 32 | 33 | 34 | 35 | # 36 | # GAPS library makefile 37 | # 38 | 39 | include ../../makefiles/Makefile.pkgs 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /external/ldif/gaps/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2007 Thomas Funkhouser 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/RNBasics/RNMem.h: -------------------------------------------------------------------------------- 1 | /* Include file for GAPS mem utility */ 2 | #ifndef __RN__MEMORY__H__ 3 | #define __RN__MEMORY__H__ 4 | 5 | 6 | 7 | /* Begin namespace */ 8 | namespace gaps { 9 | 10 | 11 | 12 | /* Initialization functions */ 13 | 14 | int RNInitMem(); 15 | void RNStopMem(); 16 | 17 | 18 | 19 | /* Memory allocation/deallocation functions */ 20 | 21 | #if FALSE 22 | 23 | void *operator new(size_t size); 24 | void *operator new(size_t size, size_t extra); 25 | void operator delete(void *data); 26 | 27 | #endif 28 | 29 | 30 | 31 | /* Standard memory manipulation functions */ 32 | 33 | #define RN_SWAP_BUFFER_SIZE 1024 34 | void RNSwap(void *node1, void *node2, void *buffer, int size); 35 | void RNCopy(const void *src, void *dst, int size); 36 | void RNZero(void *data, int size); 37 | int RNCompare(const void *src1, const void *src2, int size); 38 | 39 | 40 | 41 | /* String copy function */ 42 | 43 | char *RNStrdup(const char *str); 44 | 45 | 46 | 47 | /* Memory usage statistics */ 48 | 49 | long RNMaxMemoryUsage(void); 50 | 51 | 52 | 53 | // End namespace 54 | } 55 | 56 | 57 | // End include guard 58 | #endif 59 | -------------------------------------------------------------------------------- /external/ldif/gaps/docs/makepkg: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | # usage : makepkg name 3 | 4 | # Create header 5 | echo "" > $1.html 6 | echo "" >> $1.html 7 | echo " $1 Package " >> $1.html 8 | echo "" >> $1.html 9 | echo "" >> $1.html 10 | echo "

$1 Package

" >> $1.html 11 | echo >> $1.html 12 | echo >> $1.html 13 | echo >> $1.html 14 | 15 | # Create description 16 | if [ -e headers/$1.header ]; then 17 | # Read description, list of classes, and examples from header 18 | cat headers/$1.header >> $1.html 19 | fi 20 | 21 | # Create class members 22 | awk -f makepkg.awk ../pkgs/$1/*.h >> $1.html 23 | sed -e "s/RNFoobar/$1/g" < $1.html > $1.html.new 24 | mv $1.html.new $1.html 25 | echo >> $1.html 26 | echo >> $1.html 27 | echo >> $1.html 28 | 29 | # Create trailer 30 | echo "
" >> $1.html 31 | echo 'Click this to go back to list of GAPS packages.' >> $1.html 32 | echo "

" >> $1.html 33 | echo "" >> $1.html 34 | echo "

funk@cs.princeton.edu
" >> $1.html 35 | echo >> $1.html 36 | echo "" >> $1.html 37 | echo >> $1.html 38 | echo >> $1.html 39 | echo >> $1.html 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/R3Shapes/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Package name 3 | # 4 | 5 | NAME=R3Shapes 6 | 7 | 8 | 9 | # 10 | # List of source files 11 | # 12 | 13 | CCSRCS=$(NAME).cpp \ 14 | R3Draw.cpp \ 15 | R3MeshSearchTree.cpp R3MeshPropertySet.cpp R3MeshProperty.cpp \ 16 | R3Isect.cpp R3Cont.cpp R3Dist.cpp R3Parall.cpp R3Perp.cpp R3Relate.cpp R3Align.cpp R3Kdtree.cpp \ 17 | R3CatmullRomSpline.cpp R3Polyline.cpp R3Curve.cpp \ 18 | R3Mesh.cpp R3Rectangle.cpp R3Ellipse.cpp R3Circle.cpp R3TriangleArray.cpp R3Triangle.cpp R3Surface.cpp \ 19 | R3Ellipsoid.cpp R3Sphere.cpp R3Cone.cpp R3Cylinder.cpp R3OrientedBox.cpp R3Box.cpp R3Solid.cpp \ 20 | R3Shape.cpp \ 21 | R3Affine.cpp R3Xform.cpp R3Crdsys.cpp R3Triad.cpp R3Quaternion.cpp R4Matrix.cpp \ 22 | R3PlanarGrid.cpp R3Grid.cpp \ 23 | R3Halfspace.cpp R3Plane.cpp R3Span.cpp R3Ray.cpp R3Line.cpp R3Point.cpp R3Vector.cpp \ 24 | R3Base.cpp \ 25 | ply.cpp 26 | 27 | 28 | # 29 | # Dependencies 30 | # 31 | 32 | PKG_DEPENDENCIES = R2Shapes RNBasics 33 | 34 | 35 | 36 | # 37 | # PKG makefile 38 | # 39 | 40 | include ../../makefiles/Makefile.pkgs 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /external/pyTorchChamferDistance/LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) [year] [fullname] 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/R3Shapes/R3Relate.h: -------------------------------------------------------------------------------- 1 | /* Include file for R3 miscelleaneous relationship utility */ 2 | #ifndef __R3__RELATE__H__ 3 | #define __R3__RELATE__H__ 4 | 5 | 6 | 7 | /* Begin namespace */ 8 | namespace gaps { 9 | 10 | 11 | 12 | /* Miscellaneous relationship function declarations */ 13 | 14 | R3Point R3Interpolate(const R3Point& point1, const R3Point& point2, RNScalar t1, RNScalar t2, RNScalar t); 15 | 16 | RNAngle R3InteriorAngle(const R3Vector& vector1, const R3Vector& vector2); 17 | RNAngle R3InteriorAngle(const R3Vector& vector, const R3Line& line); 18 | RNAngle R3InteriorAngle(const R3Vector& vector, const R3Ray& ray); 19 | RNAngle R3InteriorAngle(const R3Vector& vector, const R3Span& span); 20 | RNAngle R3InteriorAngle(const R3Vector& vector, const R3Plane& plane); 21 | 22 | RNBoolean R3Abuts(const R3Box& box1, const R3Box& box2); 23 | 24 | int R3Splits(const R3Plane& plane, const R3Span& span); 25 | int R3Splits(const R3Plane& plane, const R3Span& span, R3Span *below_result, R3Span *above_result = NULL); 26 | int R3Splits(const R3Plane& plane, const R3Triangle& triangle); 27 | 28 | 29 | 30 | // End namespace 31 | } 32 | 33 | 34 | // End include guard 35 | #endif 36 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/RNMath/RNDenseLUMatrix.h: -------------------------------------------------------------------------------- 1 | // Include file for abstract matrix class 2 | #ifndef __RN__DENSE__LU__MATRIX__H__ 3 | #define __RN__DENSE__LU__MATRIX__H__ 4 | 5 | 6 | 7 | // Begin namespace 8 | namespace gaps { 9 | 10 | 11 | 12 | // Class definition 13 | 14 | class RNDenseLUMatrix : public RNDenseMatrix { 15 | public: 16 | // Constructor/destructor 17 | RNDenseLUMatrix(void); 18 | RNDenseLUMatrix(int _nrows, int _ncols, RNScalar *_values = NULL); 19 | RNDenseLUMatrix(const RNDenseLUMatrix& matrix); 20 | RNDenseLUMatrix(const RNDenseMatrix& matrix); 21 | RNDenseLUMatrix(const RNMatrix& matrix); 22 | virtual ~RNDenseLUMatrix(void); 23 | 24 | // Property functions/operators 25 | virtual RNScalar Determinant(void) const; 26 | virtual RNDenseMatrix Inverse(void) const; 27 | 28 | // Factoring functions/operations 29 | int DecomposeLU(RNDenseMatrix& L, RNDenseMatrix& U) const; 30 | 31 | protected: 32 | // Utility functions 33 | void Decompose(void); 34 | void BackSubstitute(RNDenseMatrix &b, RNDenseMatrix &x) const; 35 | 36 | private: 37 | int *pivots; 38 | }; 39 | 40 | 41 | 42 | // End namespace 43 | } 44 | 45 | 46 | // End include guard 47 | #endif 48 | -------------------------------------------------------------------------------- /external/ldif/ldif2mesh/test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2020 Google LLC 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # https://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | set -e 16 | set -x 17 | 18 | gaps=../gaps/bin/x86_64/ 19 | rm test-ldif-output.ply || true 20 | rm test-sif-output.ply || true 21 | ./build.sh 22 | ./ldif2mesh test-ldif.txt extracted.occnet test-grid.grd -resolution 128 23 | ${gaps}/grd2msh test-grid.grd test-ldif-output.ply -threshold -0.07 24 | rm test-grid.grd 25 | ./ldif2mesh test-sif.txt extracted.occnet test-grid.grd -resolution 128 26 | ${gaps}/grd2msh test-grid.grd test-sif-output.ply -threshold -0.07 27 | rm test-grid.grd 28 | ${gaps}/mshview test-ldif-output.ply test-sif-output.ply -back 29 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/R3Shapes/R3Base.cpp: -------------------------------------------------------------------------------- 1 | /* Source file for GAPS basics */ 2 | 3 | 4 | 5 | /* Include files */ 6 | 7 | #include "R3Shapes.h" 8 | 9 | 10 | 11 | // Namespace 12 | 13 | namespace gaps { 14 | 15 | 16 | 17 | /* Public draw flags */ 18 | 19 | #if FALSE 20 | 21 | const R3DrawFlags R3_EDGES_DRAW_FLAG (0x001); 22 | const R3DrawFlags R3_SURFACES_DRAW_FLAG (0x002); 23 | const R3DrawFlags R3_SURFACE_NORMALS_DRAW_FLAG (0x010); 24 | const R3DrawFlags R3_SURFACE_TEXTURE_DRAW_FLAG (0x020); 25 | const R3DrawFlags R3_VERTEX_NORMALS_DRAW_FLAG (0x100); 26 | const R3DrawFlags R3_VERTEX_TEXTURE_COORDS_DRAW_FLAG (0x200); 27 | 28 | const R3DrawFlags R3_NULL_DRAW_FLAGS (0x000); 29 | const R3DrawFlags R3_EVERYTHING_DRAW_FLAGS (0xFFF); 30 | const R3DrawFlags R3_DEFAULT_DRAW_FLAGS (R3_EVERYTHING_DRAW_FLAGS & 31 | ~R3_VERTEX_TEXTURE_COORDS_DRAW_FLAG & 32 | ~R3_EDGES_DRAW_FLAG); 33 | #endif 34 | 35 | 36 | 37 | int R3InitBase() 38 | { 39 | /* Return OK status */ 40 | return TRUE; 41 | } 42 | 43 | 44 | 45 | void R3StopBase() 46 | { 47 | } 48 | 49 | 50 | 51 | } // namespace gaps 52 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/R3Shapes/R3Curve.h: -------------------------------------------------------------------------------- 1 | /* Include file for the R3 curve class */ 2 | #ifndef __R3__CURVE__H__ 3 | #define __R3__CURVE__H__ 4 | 5 | 6 | 7 | /* Begin namespace */ 8 | namespace gaps { 9 | 10 | 11 | 12 | /* Initialization functions */ 13 | 14 | int R3InitCurve(); 15 | void R3StopCurve(); 16 | 17 | 18 | 19 | /* Class definition */ 20 | 21 | class R3Curve : public R3Shape { 22 | public: 23 | // Constructors/destructors ??? 24 | R3Curve(void); 25 | virtual ~R3Curve(void); 26 | 27 | // Curve properties 28 | virtual const RNScalar StartParameter(void) const = 0; 29 | virtual const RNScalar EndParameter(void) const = 0; 30 | virtual const R3Point StartPosition(void) const; 31 | virtual const R3Point EndPosition(void) const; 32 | 33 | // Point access 34 | virtual R3Point PointPosition(RNScalar u) const = 0; 35 | virtual R3Vector PointDerivative(RNScalar u) const = 0; 36 | virtual R3Vector PointDirection(RNScalar u) const; 37 | 38 | // Shape property functions/operators 39 | const RNBoolean IsCurve(void) const; 40 | }; 41 | 42 | 43 | 44 | // End namespace 45 | } 46 | 47 | 48 | // End include guard 49 | #endif 50 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/R3Shapes/R3Shapes.cpp: -------------------------------------------------------------------------------- 1 | /* Source file for GAPS shapes module */ 2 | 3 | 4 | 5 | /* Include files */ 6 | 7 | #include "R3Shapes.h" 8 | 9 | 10 | 11 | // Namespace 12 | 13 | namespace gaps { 14 | 15 | 16 | 17 | /* Public 3DR variables -- must be set by the application ??? */ 18 | 19 | #if (RN_3D_GRFX == RN_3DR) 20 | R3dHandle_t R3dr_rc = NULL; 21 | G3dHandle_t R3dr_gc = NULL; 22 | #endif 23 | 24 | 25 | 26 | /* Private variables */ 27 | 28 | static int R3shapes_active_count = 0; 29 | 30 | 31 | 32 | int R3InitShapes(void) 33 | { 34 | // Check whether are already initialized 35 | if ((R3shapes_active_count++) > 0) return TRUE; 36 | 37 | // Initialize dependencies 38 | if (!R2InitShapes()) return FALSE; 39 | 40 | // Initialize submodules 41 | if (!R3InitCircle()) return FALSE; 42 | 43 | // return OK status 44 | return TRUE; 45 | } 46 | 47 | 48 | 49 | void R3StopShapes(void) 50 | { 51 | // Check whether have been initialized 52 | if ((--R3shapes_active_count) > 0) return; 53 | 54 | // Stop submodules 55 | R3StopCircle(); 56 | 57 | // Stop dependencies 58 | R2StopShapes(); 59 | } 60 | 61 | 62 | 63 | } // namespace gaps 64 | -------------------------------------------------------------------------------- /external/ldif/gaps/makefiles/Makefile.std: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile setup for GAPS 3 | # 4 | 5 | 6 | 7 | # 8 | # Targets 9 | # 10 | 11 | OBJS=$(CCSRCS:.cpp=.o) $(CSRCS:.c=.o) 12 | INCS=$(HSRCS) $(CCSRCS:.cpp=.h) $(CSRCS:.c=.h) 13 | 14 | 15 | 16 | # 17 | # Get the operating system and architecture type 18 | # 19 | 20 | OS=$(shell uname -s) 21 | ARCH=$(shell uname -m) 22 | 23 | 24 | 25 | # 26 | # C flags 27 | # 28 | 29 | #ifeq ("$(findstring CYGWIN,$(OS))", "CYGWIN") 30 | #OS_CFLAGS=-Wl,-stack_size,0x100000000 31 | #endif 32 | 33 | CC=g++ 34 | BASE_CFLAGS=$(USER_CFLAGS) $(OS_CFLAGS) -Wall -I. -I../../pkgs 35 | DEBUG_CFLAGS=$(BASE_CFLAGS) -g 36 | OPT_CFLAGS=$(BASE_CFLAGS) -O3 -DNDEBUG 37 | CFLAGS=$(DEBUG_CFLAGS) 38 | 39 | #ifeq ("$(OS)","Darwin") 40 | # BASE_CFLAGS=$(USER_CFLAGS) $(OS_CFLAGS) -Wall -I. -I../../pkgs -Wno-deprecated-declarations 41 | #endif 42 | 43 | 44 | 45 | # 46 | # Directories 47 | # 48 | 49 | RELEASE_DIR=../../release 50 | EXE_DIR=../../bin/$(ARCH) 51 | LIB_DIR=../../lib/$(ARCH) 52 | 53 | 54 | 55 | # 56 | # Default rules 57 | # 58 | 59 | .SUFFIXES: .cpp .C .c .o 60 | 61 | .cpp.o: 62 | $(CC) $(CFLAGS) -c $< 63 | 64 | .C.o: 65 | $(CC) $(CFLAGS) -c $< 66 | 67 | .c.o: 68 | gcc $(CFLAGS) -c $< 69 | 70 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/R3Graphics/R3Graphics.h: -------------------------------------------------------------------------------- 1 | /* Include file for R3 graphics module */ 2 | #ifndef __R3__GRAPHICS__H__ 3 | #define __R3__GRAPHICS__H__ 4 | 5 | 6 | 7 | /* Class declarations */ 8 | 9 | namespace gaps { 10 | class R3Scene; 11 | class R3SceneNode; 12 | class R3SceneElement; 13 | } 14 | 15 | 16 | 17 | /* Dependency include files */ 18 | 19 | #include "R3Shapes/R3Shapes.h" 20 | 21 | 22 | 23 | /* Material include files */ 24 | 25 | #include "R3Brdf.h" 26 | #include "R2Texture.h" 27 | #include "R3Material.h" 28 | 29 | 30 | 31 | /* Light include files */ 32 | 33 | #include "R3Light.h" 34 | #include "R3DirectionalLight.h" 35 | #include "R3PointLight.h" 36 | #include "R3SpotLight.h" 37 | #include "R3AreaLight.h" 38 | 39 | 40 | 41 | /* Viewing include files */ 42 | 43 | #include "R2Viewport.h" 44 | #include "R3Camera.h" 45 | #include "R3Frustum.h" 46 | #include "R3Viewer.h" 47 | 48 | 49 | 50 | /* Scene include files */ 51 | 52 | #include "R3SceneReference.h" 53 | #include "R3SceneElement.h" 54 | #include "R3SceneNode.h" 55 | #include "R3Scene.h" 56 | 57 | 58 | 59 | /* Initialization functions */ 60 | 61 | namespace gaps{ 62 | int R3InitGraphics(void); 63 | void R3StopGraphics(void); 64 | } 65 | 66 | 67 | 68 | #endif 69 | 70 | 71 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/R3Surfels/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Package name 3 | # 4 | 5 | NAME=R3Surfels 6 | 7 | 8 | 9 | # 10 | # List of source files 11 | # 12 | 13 | CCSRCS=$(NAME).cpp \ 14 | R3Surfel.cpp \ 15 | R3SurfelBlock.cpp \ 16 | R3SurfelDatabase.cpp \ 17 | R3SurfelConstraint.cpp \ 18 | R3SurfelPoint.cpp \ 19 | R3SurfelPointSet.cpp \ 20 | R3SurfelPointGraph.cpp \ 21 | R3SurfelNode.cpp \ 22 | R3SurfelNodeSet.cpp \ 23 | R3SurfelTree.cpp \ 24 | R3SurfelScan.cpp \ 25 | R3SurfelImage.cpp \ 26 | R3SurfelFeature.cpp \ 27 | R3SurfelFeatureSet.cpp \ 28 | R3SurfelFeatureVector.cpp \ 29 | R3SurfelFeatureEvaluation.cpp \ 30 | R3SurfelObject.cpp \ 31 | R3SurfelObjectSet.cpp \ 32 | R3SurfelObjectProperty.cpp \ 33 | R3SurfelObjectRelationship.cpp \ 34 | R3SurfelLabel.cpp \ 35 | R3SurfelLabelSet.cpp \ 36 | R3SurfelLabelProperty.cpp \ 37 | R3SurfelLabelRelationship.cpp \ 38 | R3SurfelLabelAssignment.cpp \ 39 | R3SurfelScene.cpp \ 40 | R3SurfelUtils.cpp \ 41 | R3SurfelViewer.cpp 42 | 43 | 44 | # 45 | # Dependencies 46 | # 47 | 48 | PKG_DEPENDENCIES = R3Shapes R2Shapes RNBasics 49 | 50 | 51 | 52 | # 53 | # PKG makefile 54 | # 55 | 56 | include ../../makefiles/Makefile.pkgs 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/R3Shapes/R3Base.h: -------------------------------------------------------------------------------- 1 | /* Include file for GAPS basic stuff */ 2 | #ifndef __R3__BASE__H__ 3 | #define __R3__BASE__H__ 4 | 5 | 6 | 7 | /* Begin namespace */ 8 | namespace gaps { 9 | 10 | 11 | 12 | /* Initialization functions */ 13 | 14 | int R3InitBase(); 15 | void R3StopBase(); 16 | 17 | 18 | 19 | /* Class definition */ 20 | 21 | class R3Base {}; 22 | 23 | 24 | 25 | /* Draw flags definition */ 26 | 27 | typedef RNFlags R3DrawFlags; 28 | #define R3_NULL_DRAW_FLAGS (0x000) 29 | #define R3_EDGES_DRAW_FLAG (0x001) 30 | #define R3_SURFACES_DRAW_FLAG (0x002) 31 | #define R3_SURFACE_NORMALS_DRAW_FLAG (0x010) 32 | #define R3_SURFACE_TEXTURE_DRAW_FLAG (0x020) 33 | #define R3_SURFACE_MATERIAL_DRAW_FLAG (0x040) 34 | #define R3_VERTEX_NORMALS_DRAW_FLAG (0x100) 35 | #define R3_VERTEX_TEXTURE_COORDS_DRAW_FLAG (0x200) 36 | #define R3_VERTEX_COLORS_DRAW_FLAG (0x400) 37 | #define R3_EVERYTHING_DRAW_FLAGS (0x773) 38 | #define R3_DEFAULT_DRAW_FLAGS (R3_EVERYTHING_DRAW_FLAGS & ~R3_EDGES_DRAW_FLAG) 39 | 40 | #define R3_VERTEX_SHARED_FLAG (0x1000) 41 | 42 | 43 | 44 | // End namespace 45 | } 46 | 47 | 48 | // End include guard 49 | #endif 50 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/R2Shapes/R2Xform.cpp: -------------------------------------------------------------------------------- 1 | /* Source file for the R2 transformation class */ 2 | 3 | 4 | 5 | /* Include files */ 6 | 7 | #include "R2Shapes.h" 8 | 9 | 10 | 11 | // Namespace 12 | 13 | namespace gaps { 14 | 15 | 16 | 17 | /* Public functions */ 18 | 19 | int 20 | R2InitTransformation() 21 | { 22 | /* Return success */ 23 | return TRUE; 24 | } 25 | 26 | 27 | 28 | void 29 | R2StopTransformation() 30 | { 31 | } 32 | 33 | 34 | 35 | R2Transformation:: 36 | ~R2Transformation(void) 37 | { 38 | } 39 | 40 | 41 | 42 | const RNBoolean R2Transformation:: 43 | IsMirrored(void) const 44 | { 45 | // Return whether transformation is mirrored (default is FALSE) 46 | return FALSE; 47 | } 48 | 49 | 50 | 51 | const RNBoolean R2Transformation:: 52 | IsLinear(void) const 53 | { 54 | // Return whether transformation is linear (default is FALSE) 55 | return FALSE; 56 | } 57 | 58 | 59 | 60 | const RNBoolean R2Transformation:: 61 | IsAffine(void) const 62 | { 63 | // Return whether transformation is affine (default is FALSE) 64 | return FALSE; 65 | } 66 | 67 | 68 | 69 | const RNBoolean R2Transformation:: 70 | IsIsotropic(void) const 71 | { 72 | // Return whether transformation is isotropic (default is FALSE) 73 | return FALSE; 74 | } 75 | 76 | 77 | 78 | } // namespace gaps 79 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/R3Shapes/R3Curve.cpp: -------------------------------------------------------------------------------- 1 | /* Source file for the R3 curve class */ 2 | 3 | 4 | 5 | /* Include files */ 6 | 7 | #include "R3Shapes.h" 8 | 9 | 10 | 11 | // Namespace 12 | 13 | namespace gaps { 14 | 15 | 16 | 17 | /* Public functions */ 18 | 19 | int 20 | R3InitCurve() 21 | { 22 | /* Return success */ 23 | return TRUE; 24 | } 25 | 26 | 27 | 28 | void 29 | R3StopCurve() 30 | { 31 | } 32 | 33 | 34 | 35 | R3Curve:: 36 | R3Curve(void) 37 | { 38 | } 39 | 40 | 41 | 42 | R3Curve:: 43 | ~R3Curve(void) 44 | { 45 | } 46 | 47 | 48 | 49 | const R3Point R3Curve:: 50 | StartPosition(void) const 51 | { 52 | // Return position at start of curve 53 | return PointPosition(StartParameter()); 54 | } 55 | 56 | 57 | 58 | const R3Point R3Curve:: 59 | EndPosition(void) const 60 | { 61 | // Return position at end of curve 62 | return PointPosition(EndParameter()); 63 | } 64 | 65 | 66 | 67 | R3Vector R3Curve:: 68 | PointDirection(RNScalar u) const 69 | { 70 | // Return tangent direction of curve at parametric value u 71 | R3Vector direction = PointDerivative(u); 72 | direction.Normalize(); 73 | return direction; 74 | } 75 | 76 | 77 | 78 | const RNBoolean R3Curve:: 79 | IsCurve(void) const 80 | { 81 | // All curve shapes are curves 82 | return TRUE; 83 | } 84 | 85 | 86 | 87 | } // namespace gaps 88 | -------------------------------------------------------------------------------- /external/ldif/util/gaps_util.py: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # Lint as: python3 15 | """Utilties for working with the GAPS geometric processing library.""" 16 | 17 | import os 18 | import numpy as np 19 | 20 | 21 | # LDIF is an internal package, should be imported last. 22 | # pylint: disable=g-bad-import-order 23 | from . import file_util 24 | from .file_util import log 25 | # pylint: enable=g-bad-import-order 26 | 27 | 28 | def read_pts_file(path): 29 | """Reads a .pts or a .sdf point samples file.""" 30 | _, ext = os.path.splitext(path) 31 | assert ext in ['.sdf', '.pts'] 32 | l = 4 if ext == '.sdf' else 6 33 | with file_util.open_file(path, 'rb') as f: 34 | points = np.fromfile(f, dtype=np.float32) 35 | points = np.reshape(points, [-1, l]) 36 | return points 37 | -------------------------------------------------------------------------------- /external/ldif/gaps/vc/makefiles/Makefile.pkgs: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile for GAPS packages 3 | # 4 | 5 | 6 | 7 | # 8 | # Before this Makefile is included ... 9 | # $(NAME) should be module name 10 | # $(CCSRCS) should list C++ source files 11 | # $(CSRCS) should list C source files 12 | # 13 | # For example ... 14 | # NAME=foo 15 | # CCSRCS=$(NAME).C \ 16 | # foo1.C foo2.C foo3.C 17 | # CSRCS=foo4.c foo5.c 18 | # 19 | 20 | 21 | # 22 | # Set up compiler options, etc. 23 | # 24 | 25 | include ../../scripts/Makefile.std 26 | 27 | 28 | 29 | # 30 | # Set up target name 31 | # 32 | 33 | LIB=${LIB_DIR}/$(NAME).lib 34 | 35 | 36 | 37 | # 38 | # Make targets 39 | # 40 | 41 | opt: 42 | $(MAKE) $(LIB) "CFLAGS=$(OPT_CFLAGS)" 43 | 44 | debug: 45 | $(MAKE) $(LIB) "CFLAGS=$(DEBUG_CFLAGS)" 46 | 47 | $(LIB): $(CCSRCS) $(CSRCS) $(OSRCS) $(OBJS) 48 | mkdir -p $(LIB_DIR) 49 | lib /OUT:$(LIB) $(OBJS) 50 | 51 | release: 52 | mkdir -p $(RELEASE_DIR)/pkgs 53 | mkdir $(RELEASE_DIR)/pkgs/$(NAME)1 54 | cp *.[cCIh] $(RELEASE_DIR)/pkgs/$(NAME)1 55 | cp Makefile $(RELEASE_DIR)/pkgs/$(NAME)1 56 | rm -r -f $(RELEASE_DIR)/pkgs/$(NAME) 57 | mv $(RELEASE_DIR)/pkgs/$(NAME)1 $(RELEASE_DIR)/pkgs/$(NAME) 58 | 59 | clean: 60 | - rm -f *~ *.obj $(LIB) 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile for GAPS pkgs 3 | # 4 | 5 | 6 | # 7 | # Library file names 8 | # 9 | 10 | ARCH=$(shell uname -m) 11 | LIB_DIR=../lib/$(ARCH) 12 | LIB=$(LIB_DIR)/libgaps.a 13 | PKG_LIBS= \ 14 | $(LIB_DIR)/libRGBD.a \ 15 | $(LIB_DIR)/libR3Surfels.a \ 16 | $(LIB_DIR)/libR3Graphics.a \ 17 | $(LIB_DIR)/libR3Shapes.a \ 18 | $(LIB_DIR)/libR2Shapes.a \ 19 | $(LIB_DIR)/libRNMath.a \ 20 | $(LIB_DIR)/libRNBasics.a \ 21 | $(LIB_DIR)/libfglut.a \ 22 | $(LIB_DIR)/libjpeg.a \ 23 | $(LIB_DIR)/libpng.a 24 | 25 | 26 | # 27 | # Make targets 28 | # 29 | 30 | opt: 31 | $(MAKE) target "TARGET=$@" 32 | rm -f $(LIB) 33 | ar ur $(LIB) $(PKG_LIBS) 34 | 35 | debug: 36 | $(MAKE) target "TARGET=$@" 37 | rm -f $(LIB) 38 | ar ur $(LIB) $(PKG_LIBS) 39 | 40 | mesa: 41 | $(MAKE) target "TARGET=$@" 42 | 43 | clean: 44 | $(MAKE) target "TARGET=$@" 45 | 46 | release: 47 | mkdir -p ../release/pkgs 48 | cp Makefile ../release/pkgs 49 | $(MAKE) target "TARGET=$@" 50 | 51 | target: 52 | cd RNBasics; $(MAKE) $(TARGET) 53 | cd RNMath; $(MAKE) $(TARGET) 54 | cd R2Shapes; $(MAKE) $(TARGET) 55 | cd R3Shapes; $(MAKE) $(TARGET) 56 | cd R3Graphics; $(MAKE) $(TARGET) 57 | cd R3Surfels; $(MAKE) $(TARGET) 58 | cd RGBD; $(MAKE) $(TARGET) 59 | cd fglut; $(MAKE) $(TARGET) 60 | cd jpeg; $(MAKE) $(TARGET) 61 | cd png; $(MAKE) $(TARGET) 62 | 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/R2Shapes/R2Shape.h: -------------------------------------------------------------------------------- 1 | /* Include file for the R2 shape class */ 2 | #ifndef __R2__SHAPE__H__ 3 | #define __R2__SHAPE__H__ 4 | 5 | 6 | 7 | /* Begin namespace */ 8 | namespace gaps { 9 | 10 | 11 | 12 | /* Initialization functions */ 13 | 14 | int R2InitShape(); 15 | void R2StopShape(); 16 | 17 | 18 | 19 | /* Draw flags definition */ 20 | 21 | typedef RNFlags R2DrawFlags; 22 | extern const R2DrawFlags R2_EDGES_DRAW_FLAG; 23 | extern const R2DrawFlags R2_SURFACES_DRAW_FLAG; 24 | extern const R2DrawFlags R2_NULL_DRAW_FLAGS; 25 | extern const R2DrawFlags R2_EVERYTHING_DRAW_FLAGS; 26 | extern const R2DrawFlags R2_DEFAULT_DRAW_FLAGS; 27 | 28 | 29 | 30 | /* Class definition */ 31 | 32 | class R2Shape /* : public R2Base */ { 33 | public: 34 | // Constructors/destructors 35 | virtual ~R2Shape(void) {}; 36 | 37 | // Draw functions/operators 38 | virtual void Draw(const R2DrawFlags draw_flags = R2_DEFAULT_DRAW_FLAGS) const = 0; 39 | void Outline(void) const { Draw(R2_EDGES_DRAW_FLAG); }; 40 | }; 41 | 42 | 43 | 44 | /* Shape type enumeration ??? */ 45 | 46 | enum { 47 | R2_POINT_CLASS_ID = 1, 48 | R2_LINE_CLASS_ID = 2, 49 | R2_RAY_CLASS_ID = 3, 50 | R2_SPAN_CLASS_ID = 4, 51 | R2_POLYGON_CLASS_ID = 6 52 | }; 53 | 54 | 55 | 56 | // End namespace 57 | } 58 | 59 | 60 | // End include guard 61 | #endif 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/RNBasics/RNType.cpp: -------------------------------------------------------------------------------- 1 | /* Source file for GAPS class types */ 2 | 3 | 4 | 5 | /* Include files */ 6 | 7 | #include "RNBasics.h" 8 | 9 | 10 | 11 | // Namespace 12 | 13 | namespace gaps { 14 | 15 | 16 | 17 | /* Public variables */ 18 | 19 | const RNClassType RNnull_class_type(RN_NULL_CLASS_ID, ""); 20 | 21 | 22 | 23 | /* Private variables */ 24 | 25 | static RNClassID RNnclass_ids = 0; 26 | 27 | 28 | 29 | int RNInitClassType() 30 | { 31 | /* Return OK status */ 32 | return TRUE; 33 | } 34 | 35 | 36 | 37 | void RNStopClassType() 38 | { 39 | } 40 | 41 | 42 | 43 | RNClassType:: 44 | RNClassType(RNClassID id, const char *name) 45 | { 46 | // Initialize class type 47 | this->id = id; 48 | if (!name) this->name = NULL; 49 | else { 50 | this->name = new char[strlen(name) + 1]; 51 | assert(this->name); 52 | strcpy(this->name, name); 53 | } 54 | } 55 | 56 | 57 | 58 | RNClassType:: 59 | RNClassType(const char *name) 60 | { 61 | // Initialize class type 62 | id = ++RNnclass_ids; 63 | if (!name) this->name = NULL; 64 | else { 65 | this->name = new char[strlen(name) + 1]; 66 | assert(this->name); 67 | strcpy(this->name, name); 68 | } 69 | } 70 | 71 | 72 | 73 | RNClassType:: 74 | ~RNClassType(void) 75 | { 76 | // Free name 77 | if (name) delete [] name; 78 | } 79 | 80 | 81 | 82 | } // namespace gaps 83 | 84 | -------------------------------------------------------------------------------- /external/ldif/ldif2mesh/get_cuda_version.py: -------------------------------------------------------------------------------- 1 | # Lint as: python3 2 | """A shell utility to get the CUDA version.""" 3 | 4 | import subprocess as sp 5 | 6 | # nvcc output for Cuda 11 7 | # nvcc: NVIDIA (R) Cuda compiler driver 8 | # Copyright (c) 2005-2020 NVIDIA Corporation 9 | # Built on Mon_Nov_30_19:08:53_PST_2020 10 | # Cuda compilation tools, release 11.2, V11.2.67 11 | # Build cuda_11.2.r11.2/compiler.29373293_0 12 | 13 | # nvcc output for Cuda 10 14 | # output = "nvcc: NVIDIA (R) Cuda compiler driver\n" \ 15 | # "Copyright (c) 2005-2019 NVIDIA Corporation\n" \ 16 | # "Built on Sun_Jul_28_19:07:16_PDT_2019\n" \ 17 | # "Cuda compilation tools, release 10.1, V10.1.243\n" 18 | 19 | def get_cuda_version(): 20 | try: 21 | output = sp.check_output(['nvcc', '-V']).decode('utf-8') 22 | lines = output.split('\n') 23 | if output.find('V11') < 0: 24 | version_str = lines[-2].split(',')[1].split(' ')[-1] 25 | else: 26 | version_str = lines[-3].split(',')[1].split(' ')[-1] 27 | 28 | major_version = int(version_str.split('.')[0]) 29 | minor_version = int(version_str.split('.')[1]) 30 | return major_version, minor_version 31 | except Exception as e: 32 | raise ValueError(f'Failed to get cuda version with error: {e}') 33 | 34 | if __name__ == '__main__': 35 | major, minor = get_cuda_version() 36 | print(major) 37 | print(minor) 38 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/R3Graphics/R2Viewport.cpp: -------------------------------------------------------------------------------- 1 | /* Source file for the viewport class */ 2 | 3 | 4 | 5 | /* Include files */ 6 | 7 | #include "R3Graphics.h" 8 | 9 | 10 | 11 | // Namespace 12 | 13 | namespace gaps { 14 | 15 | 16 | 17 | /* Public variables */ 18 | 19 | R2Viewport R2default_viewport(0, 0, 128, 128); 20 | 21 | 22 | 23 | int R3InitViewport() 24 | { 25 | /* Return OK status */ 26 | return TRUE; 27 | } 28 | 29 | 30 | 31 | void R3StopViewport() 32 | { 33 | } 34 | 35 | 36 | 37 | R2Viewport:: 38 | R2Viewport(void) 39 | { 40 | } 41 | 42 | 43 | 44 | R2Viewport:: 45 | R2Viewport (int xmin, int ymin, int width, int height) 46 | : xmin(xmin), 47 | ymin(ymin), 48 | width(width), 49 | height(height) 50 | { 51 | } 52 | 53 | 54 | 55 | void R2Viewport:: 56 | Move(int xmin, int ymin) 57 | { 58 | // Set viewport variables 59 | this->xmin = xmin; 60 | this->ymin = ymin; 61 | } 62 | 63 | 64 | 65 | void R2Viewport:: 66 | Resize(int width, int height) 67 | { 68 | // Set viewport variables 69 | this->width = width; 70 | this->height = height; 71 | } 72 | 73 | 74 | 75 | void R2Viewport:: 76 | Resize(int xmin, int ymin, int width, int height) 77 | { 78 | // Set viewport variables 79 | this->xmin = xmin; 80 | this->ymin = ymin; 81 | this->width = width; 82 | this->height = height; 83 | } 84 | 85 | 86 | 87 | } // namespace gaps 88 | -------------------------------------------------------------------------------- /dataset/FRONT3D/split/val/bookshelf.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | "val/rgb/000344_rgb_001763.jpeg", 4 | "2", 5 | "bookshelf" 6 | ], 7 | [ 8 | "val/rgb/000279_rgb_001422.jpeg", 9 | "5", 10 | "bookshelf" 11 | ], 12 | [ 13 | "val/rgb/000269_rgb_001372.jpeg", 14 | "2", 15 | "bookshelf" 16 | ], 17 | [ 18 | "val/rgb/000269_rgb_001373.jpeg", 19 | "3", 20 | "bookshelf" 21 | ], 22 | [ 23 | "val/rgb/000311_rgb_001604.jpeg", 24 | "1", 25 | "bookshelf" 26 | ], 27 | [ 28 | "val/rgb/000339_rgb_001737.jpeg", 29 | "0", 30 | "bookshelf" 31 | ], 32 | [ 33 | "val/rgb/000513_rgb_002622.jpeg", 34 | "6", 35 | "bookshelf" 36 | ], 37 | [ 38 | "val/rgb/000504_rgb_002585.jpeg", 39 | "1", 40 | "bookshelf" 41 | ], 42 | [ 43 | "val/rgb/000327_rgb_001670.jpeg", 44 | "1", 45 | "bookshelf" 46 | ], 47 | [ 48 | "val/rgb/000138_rgb_000700.jpeg", 49 | "6", 50 | "bookshelf" 51 | ], 52 | [ 53 | "val/rgb/000428_rgb_002199.jpeg", 54 | "5", 55 | "bookshelf" 56 | ], 57 | [ 58 | "val/rgb/000442_rgb_002256.jpeg", 59 | "2", 60 | "bookshelf" 61 | ], 62 | [ 63 | "val/rgb/000516_rgb_002633.jpeg", 64 | "3", 65 | "bookshelf" 66 | ] 67 | ] -------------------------------------------------------------------------------- /external/ldif/util/mesh_util.py: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # Lint as: python3 15 | """Utilities for working with meshes.""" 16 | 17 | import io 18 | 19 | import trimesh 20 | 21 | 22 | def serialize(mesh): 23 | mesh_str = trimesh.exchange.ply.export_ply( 24 | mesh, encoding='binary', vertex_normal=False) 25 | return mesh_str 26 | 27 | 28 | def deserialize(mesh_str): 29 | mesh_ply_file_obj = io.BytesIO(mesh_str) 30 | mesh = trimesh.Trimesh(**trimesh.exchange.ply.load_ply(mesh_ply_file_obj)) 31 | return mesh 32 | 33 | 34 | def remove_small_components(mesh, min_volume=5e-05): 35 | """Removes all components with volume below the specified threshold.""" 36 | if mesh.is_empty: 37 | return mesh 38 | out = [m for m in mesh.split(only_watertight=False) if m.volume > min_volume] 39 | if not out: 40 | return mesh 41 | return trimesh.util.concatenate(out) 42 | 43 | -------------------------------------------------------------------------------- /external/ldif/gaps/apps/Makefile.bak: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile for GAPS apps 3 | # 4 | 5 | opt: 6 | $(MAKE) target "TARGET=$@" 7 | 8 | debug: 9 | $(MAKE) target "TARGET=$@" 10 | 11 | mesa: 12 | $(MAKE) target "TARGET=$@" 13 | 14 | clean: 15 | $(MAKE) target "TARGET=$@" 16 | 17 | release: 18 | mkdir -p ../release/apps 19 | cp Makefile ../release/apps 20 | $(MAKE) target "TARGET=$@" 21 | 22 | target: 23 | cd img2img; $(MAKE) $(TARGET) 24 | cd msh2msh; $(MAKE) $(TARGET) 25 | cd msh2grd; $(MAKE) $(TARGET) 26 | cd msh2pts; $(MAKE) $(TARGET) 27 | cd msh2prp; $(MAKE) $(TARGET) 28 | cd msh2df; $(MAKE) $(TARGET) 29 | cd mshalign; $(MAKE) $(TARGET) 30 | cd mshsegment; $(MAKE) $(TARGET) 31 | cd mshparam; $(MAKE) $(TARGET) 32 | cd mshinfo; $(MAKE) $(TARGET) 33 | cd mshview; $(MAKE) $(TARGET) 34 | cd grdview; $(MAKE) $(TARGET) 35 | cd grd2grd; $(MAKE) $(TARGET) 36 | cd grd2msh; $(MAKE) $(TARGET) 37 | cd grd2pts; $(MAKE) $(TARGET) 38 | cd grd2txt; $(MAKE) $(TARGET) 39 | cd prp2prp; $(MAKE) $(TARGET) 40 | cd prpview; $(MAKE) $(TARGET) 41 | cd scninfo; $(MAKE) $(TARGET) 42 | cd scn2scn; $(MAKE) $(TARGET) 43 | cd scn2cam; $(MAKE) $(TARGET) 44 | cd scn2img; $(MAKE) $(TARGET) 45 | cd scnview; $(MAKE) $(TARGET) 46 | cd pfm2pfm; $(MAKE) $(TARGET) 47 | cd confview; $(MAKE) $(TARGET) 48 | cd conf2img; $(MAKE) $(TARGET) 49 | cd conf2conf; $(MAKE) $(TARGET) 50 | cd sflinfo; $(MAKE) $(TARGET) 51 | cd sflview; $(MAKE) $(TARGET) 52 | cd gapsview; $(MAKE) $(TARGET) 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | cd qview; $(MAKE) $(TARGET) 63 | -------------------------------------------------------------------------------- /external/ldif/gaps/apps/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile for GAPS apps 3 | # 4 | 5 | opt: 6 | $(MAKE) target "TARGET=$@" 7 | 8 | debug: 9 | $(MAKE) target "TARGET=$@" 10 | 11 | mesa: 12 | $(MAKE) target "TARGET=$@" 13 | 14 | clean: 15 | $(MAKE) target "TARGET=$@" 16 | 17 | release: 18 | mkdir -p ../release/apps 19 | cp Makefile ../release/apps 20 | $(MAKE) target "TARGET=$@" 21 | 22 | target: 23 | cd img2img; $(MAKE) $(TARGET) 24 | cd msh2msh; $(MAKE) $(TARGET) 25 | cd msh2grd; $(MAKE) $(TARGET) 26 | cd msh2pts; $(MAKE) $(TARGET) 27 | cd msh2prp; $(MAKE) $(TARGET) 28 | cd msh2df; $(MAKE) $(TARGET) 29 | cd mshalign; $(MAKE) $(TARGET) 30 | cd mshsegment; $(MAKE) $(TARGET) 31 | cd mshparam; $(MAKE) $(TARGET) 32 | cd mshinfo; $(MAKE) $(TARGET) 33 | cd mshview; $(MAKE) $(TARGET) 34 | cd grdview; $(MAKE) $(TARGET) 35 | cd grd2grd; $(MAKE) $(TARGET) 36 | cd grd2msh; $(MAKE) $(TARGET) 37 | cd grd2pts; $(MAKE) $(TARGET) 38 | cd grd2txt; $(MAKE) $(TARGET) 39 | cd prp2prp; $(MAKE) $(TARGET) 40 | cd prpview; $(MAKE) $(TARGET) 41 | cd scninfo; $(MAKE) $(TARGET) 42 | cd scn2scn; $(MAKE) $(TARGET) 43 | cd scn2cam; $(MAKE) $(TARGET) 44 | cd scn2img; $(MAKE) $(TARGET) 45 | cd scnview; $(MAKE) $(TARGET) 46 | cd pfm2pfm; $(MAKE) $(TARGET) 47 | cd confview; $(MAKE) $(TARGET) 48 | cd conf2img; $(MAKE) $(TARGET) 49 | cd conf2conf; $(MAKE) $(TARGET) 50 | cd sflinfo; $(MAKE) $(TARGET) 51 | cd sflview; $(MAKE) $(TARGET) 52 | cd gapsview; $(MAKE) $(TARGET) 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | cd ptsview; $(MAKE) $(TARGET) 63 | cd qview; $(MAKE) $(TARGET) 64 | -------------------------------------------------------------------------------- /external/ldif/gaps/README.txt: -------------------------------------------------------------------------------- 1 | GAPS Users - 2 | 3 | This directory contains all code for the GAPS software library. 4 | There are several subdirectories: 5 | 6 | pkgs - source and include files for all packages (software libraries). 7 | apps - source files for several application and example programs. 8 | makefiles - unix-style make file definitions 9 | vc - visual studio solution files 10 | lib - archive library (.lib) files (created during compilation). 11 | bin - executable files (created during compilation). 12 | 13 | If you are using linux or cygwin and have gcc and OpenGL development 14 | libraries installed, or if you are using MAC OS X with the xcode 15 | development environment, you should be able to compile all the code by 16 | typing "make clean; make" in this directory. If you are using Windows 17 | Visual Studio 10 or later, then you should be able to open the 18 | solution file vc.sln in the vc subdirectory and then "Rebuild 19 | Solution." For other development platforms, you should edit the shared 20 | compilation settings in the makefiles/Makefiles.std to meet your needs. 21 | 22 | To write a program that uses the GAPS pkgs, then you should include 23 | "-I XXX/gaps/pkgs" in your compile flags (CFLAGS) and "-L 24 | XXX/gaps/lib" in your link flags (LDFLAGS), where XXX is the directory 25 | where you installed the gaps software. 26 | 27 | The software is distributed under the MIT license (see LICENSE.txt) 28 | and thus can be used for any purpose without warranty, any liability, 29 | or any suport of any kind. 30 | 31 | - Tom Funkhouser 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /external/ldif/gaps/docs/headers/R3Graphics.header: -------------------------------------------------------------------------------- 1 |

Description:

2 | 3 | The R3Graphics package supports classes for basic computer graphics: 4 | 3D viewing, camera control, surface material properties, lighting, and scene graphs. 5 |

6 | 7 | 8 |


List of Classes:

9 | 10 |
11 |
Camera and viewport control: 12 |
13 |
R2Viewport - 2D screen viewport. 14 |
R3Camera - 3D camera (view frustum). 15 |
R3Viewer - Mapping from 3D camera to 2D viewport. 16 |
  17 |
18 | 19 |
Surface material properties: 20 |
21 |
R3Brdf - 3D bidirection reflectance distribution function. 22 |
R2Texture - 2D surface texture. 23 |
R3Material - 3D material properties (brdf, texture, and texture transformation). 24 |
R3Model - a set of 3D triangles with material properties. 25 |
  26 |
27 | 28 |
Lights: 29 |
30 |
R3Light - Light abstract class. 31 |
R3DirectionalLight - Directional light. 32 |
R3PointLight - Point light. 33 |
R3SpotLight - Spot light. 34 |
  35 |
36 | 37 |
Scene graphs: 38 |
39 |
R3Scene - scene graph. 40 |
R3SceneNode - scene graph node. 41 |
  42 |
43 |
44 |

45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /external/ldif/gaps/makefiles/Makefile.pkgs: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile for GAPS packages 3 | # 4 | 5 | 6 | 7 | # 8 | # Before this Makefile is included ... 9 | # $(NAME) should be module name 10 | # $(CCSRCS) should list C++ source files 11 | # $(CSRCS) should list C source files 12 | # 13 | # For example ... 14 | # NAME=foo 15 | # CCSRCS=$(NAME).cpp \ 16 | # foo1.cpp foo2.cpp foo3.cpp 17 | # CSRCS=foo4.c foo5.c 18 | # 19 | 20 | 21 | # 22 | # Set up compiler options, etc. 23 | # 24 | 25 | include ../../makefiles/Makefile.std 26 | 27 | 28 | 29 | # 30 | # Set up target name 31 | # 32 | 33 | LIB=$(LIB_DIR)/lib$(NAME).a 34 | 35 | 36 | 37 | # 38 | # Make targets 39 | # 40 | 41 | opt: 42 | $(MAKE) $(LIB) "CFLAGS=$(OPT_CFLAGS)" 43 | 44 | debug: 45 | $(MAKE) $(LIB) "CFLAGS=$(DEBUG_CFLAGS)" 46 | 47 | mesa: 48 | $(MAKE) $(LIB) "CFLAGS=$(OPT_CFLAGS) -DUSE_MESA" 49 | 50 | $(LIB): $(CCSRCS) $(CSRCS) $(OSRCS) $(OBJS) $(DEPENDENCIES) 51 | mkdir -p $(LIB_DIR) 52 | rm -f $(LIB) 53 | ar ur $(LIB) $(OBJS) $(USER_OBJS) 54 | 55 | release: 56 | mkdir -p $(RELEASE_DIR)/pkgs 57 | mkdir $(RELEASE_DIR)/pkgs/$(NAME)1 58 | cp *\.[!o]* $(RELEASE_DIR)/pkgs/$(NAME)1 59 | cp Makefile $(RELEASE_DIR)/pkgs/$(NAME)1 60 | # cp $(NAME).vcxproj $(RELEASE_DIR)/pkgs/$(NAME)1 61 | rm -r -f $(RELEASE_DIR)/pkgs/$(NAME) 62 | mv $(RELEASE_DIR)/pkgs/$(NAME)1 $(RELEASE_DIR)/pkgs/$(NAME) 63 | 64 | clean: 65 | - rm -f *~ *.o $(LIB) 66 | 67 | 68 | 69 | # 70 | # Dependencies 71 | # 72 | 73 | $(OBJS) : Makefile *.h $(foreach pkg, $(PKG_DEPENDENCIES), ../$(pkg)/*.h) $(USER_DEPENDENCIES) 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /utils/memory_util.py: -------------------------------------------------------------------------------- 1 | import os 2 | import psutil 3 | 4 | 5 | def get_gpu_mem_info(gpu_id=0): 6 | """ 7 | show gpu memory (MB) 8 | :param gpu_id: gpu index 9 | :return: total memory, used memory, free memory 10 | """ 11 | import pynvml 12 | pynvml.nvmlInit() 13 | if gpu_id < 0 or gpu_id >= pynvml.nvmlDeviceGetCount(): 14 | print(f'gpu_id {gpu_id} not exist!') 15 | return 0, 0, 0 16 | 17 | handler = pynvml.nvmlDeviceGetHandleByIndex(gpu_id) 18 | meminfo = pynvml.nvmlDeviceGetMemoryInfo(handler) 19 | total = round(meminfo.total / 1024 / 1024, 2) 20 | used = round(meminfo.used / 1024 / 1024, 2) 21 | free = round(meminfo.free / 1024 / 1024, 2) 22 | return total, used, free 23 | 24 | 25 | def get_cpu_mem_info(): 26 | """ 27 | show all virtual memory in this computer (MB) 28 | :return: mem_total, mem_free, mem_process_used 29 | """ 30 | mem_total = round(psutil.virtual_memory().total / 1024 / 1024, 2) 31 | mem_free = round(psutil.virtual_memory().available / 1024 / 1024, 2) 32 | mem_process_used = round(psutil.Process(os.getpid()).memory_info().rss / 1024 / 1024, 2) 33 | return mem_total, mem_free, mem_process_used 34 | 35 | 36 | if __name__ == "__main__": 37 | gpu_id = 0 38 | gpu_mem_total, gpu_mem_used, gpu_mem_free = get_gpu_mem_info(gpu_id) 39 | print(f'gpu {gpu_id}: total {gpu_mem_total} MB, used {gpu_mem_used} MB, free {gpu_mem_free} MB') 40 | 41 | cpu_mem_total, cpu_mem_free, cpu_mem_process_used = get_cpu_mem_info() 42 | print(f'computer : total {cpu_mem_total} MB, used {cpu_mem_process_used} MB, free {cpu_mem_free} MB') 43 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/R3Shapes/R3Xform.cpp: -------------------------------------------------------------------------------- 1 | /* Source file for the R3 transformation class */ 2 | 3 | 4 | 5 | /* Include files */ 6 | 7 | #include "R3Shapes.h" 8 | 9 | 10 | 11 | // Namespace 12 | 13 | namespace gaps { 14 | 15 | 16 | 17 | /* Public functions */ 18 | 19 | int 20 | R3InitTransformation() 21 | { 22 | /* Return success */ 23 | return TRUE; 24 | } 25 | 26 | 27 | 28 | void 29 | R3StopTransformation() 30 | { 31 | } 32 | 33 | 34 | 35 | R3Transformation:: 36 | ~R3Transformation(void) 37 | { 38 | } 39 | 40 | 41 | 42 | const RNBoolean R3Transformation:: 43 | IsIdentity(void) const 44 | { 45 | // Return whether transformation is identity (default is FALSE) 46 | return FALSE; 47 | } 48 | 49 | 50 | 51 | const RNBoolean R3Transformation:: 52 | IsMirrored(void) const 53 | { 54 | // Return whether transformation is mirrored (default is FALSE) 55 | return FALSE; 56 | } 57 | 58 | 59 | 60 | const RNBoolean R3Transformation:: 61 | IsLinear(void) const 62 | { 63 | // Return whether transformation is linear (default is FALSE) 64 | return FALSE; 65 | } 66 | 67 | 68 | 69 | const RNBoolean R3Transformation:: 70 | IsAffine(void) const 71 | { 72 | // Return whether transformation is affine (default is FALSE) 73 | return FALSE; 74 | } 75 | 76 | 77 | 78 | const RNBoolean R3Transformation:: 79 | IsIsotropic(void) const 80 | { 81 | // Return whether transformation is isotropic (default is FALSE) 82 | return FALSE; 83 | } 84 | 85 | 86 | 87 | const RNScalar R3Transformation:: 88 | ScaleFactor(void) const 89 | { 90 | // Return identity scaling 91 | return 1.0; 92 | } 93 | 94 | 95 | 96 | } // namespace gaps 97 | -------------------------------------------------------------------------------- /ssr/model/density.py: -------------------------------------------------------------------------------- 1 | import torch.nn as nn 2 | import torch 3 | 4 | 5 | class Density(nn.Module): 6 | def __init__(self, params_init={}): 7 | super().__init__() 8 | for p in params_init: 9 | param = nn.Parameter(torch.tensor(params_init[p])) 10 | setattr(self, p, param) 11 | 12 | def forward(self, sdf, beta=None): 13 | return self.density_func(sdf, beta=beta) 14 | 15 | 16 | # translation sdf to density 17 | class LaplaceDensity(Density): # alpha * Laplace(loc=0, scale=beta).cdf(-sdf) 18 | def __init__(self, params_init={}, beta_min=0.0001): 19 | super().__init__(params_init=params_init) 20 | self.beta_min = torch.tensor(beta_min).cuda() 21 | 22 | def density_func(self, sdf, beta=None): 23 | if beta is None: 24 | beta = self.get_beta() 25 | 26 | alpha = 1 / beta 27 | return alpha * (0.5 + 0.5 * sdf.sign() * torch.expm1(-sdf.abs() / beta)) 28 | 29 | def get_beta(self): 30 | beta = self.beta.abs() + self.beta_min.to(self.beta.device) 31 | return beta 32 | 33 | 34 | class AbsDensity(Density): # like NeRF++ 35 | def density_func(self, sdf, beta=None): 36 | return torch.abs(sdf) 37 | 38 | 39 | class SimpleDensity(Density): # like NeRF 40 | def __init__(self, params_init={}, noise_std=1.0): 41 | super().__init__(params_init=params_init) 42 | self.noise_std = noise_std 43 | 44 | def density_func(self, sdf, beta=None): 45 | if self.training and self.noise_std > 0.0: 46 | noise = torch.randn(sdf.shape).cuda() * self.noise_std 47 | sdf = sdf + noise 48 | return torch.relu(sdf) 49 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/RNBasics/RNTime.h: -------------------------------------------------------------------------------- 1 | /* Include file for GAPS wallclock time class */ 2 | #ifndef __RN__TIME__H__ 3 | #define __RN__TIME__H__ 4 | 5 | 6 | 7 | /* Begin namespace */ 8 | namespace gaps { 9 | 10 | 11 | 12 | /* Initialization functions */ 13 | 14 | int RNInitTime(); 15 | void RNStopTime(); 16 | 17 | 18 | 19 | /* Class definition */ 20 | 21 | class RNTime /* : public RNBase */ { 22 | public: 23 | // Constructor functions 24 | RNTime(void); 25 | RNTime(const RNTime& tm); 26 | 27 | // Relationship functions/operators 28 | RNScalar Elapsed(const RNTime& tm) const; 29 | RNScalar Elapsed(void) const; 30 | 31 | // Arithmetic operators 32 | RNScalar operator-(const RNTime& tm) const; 33 | 34 | // Manipulation functions/operators 35 | void Read(void); 36 | 37 | private: 38 | # if (RN_OS == RN_WINDOWS) 39 | LARGE_INTEGER timefreq; 40 | LARGE_INTEGER timevalue; 41 | # elif (RN_OS == OLD_RN_WINDOWS) 42 | DWORD timevalue; 43 | # else 44 | struct timeval timevalue; 45 | # endif 46 | }; 47 | 48 | 49 | 50 | /* Public functions */ 51 | 52 | RNTime RNCurrentTime(void); 53 | void RNSleep(RNScalar seconds); 54 | 55 | 56 | 57 | /* Inline functions */ 58 | 59 | inline void RNTime:: 60 | Read (void) 61 | { 62 | /* Read the current time */ 63 | # if (RN_OS == RN_WINDOWS) 64 | QueryPerformanceCounter(&timevalue); 65 | # elif (RN_OS == OLD_RN_WINDOWS) 66 | timevalue = GetTickCount(); 67 | # else 68 | gettimeofday(&timevalue, NULL); 69 | # endif 70 | } 71 | 72 | 73 | 74 | // End namespace 75 | } 76 | 77 | 78 | // End include guard 79 | #endif 80 | -------------------------------------------------------------------------------- /ssr/model/embed.py: -------------------------------------------------------------------------------- 1 | import torch 2 | 3 | """ Positional encoding embedding. Code was taken from https://github.com/bmild/nerf. """ 4 | 5 | class Embedder: 6 | def __init__(self, **kwargs): 7 | self.kwargs = kwargs 8 | self.create_embedding_fn() 9 | 10 | def create_embedding_fn(self): 11 | embed_fns = [] 12 | d = self.kwargs['input_dims'] 13 | out_dim = 0 14 | if self.kwargs['include_input']: 15 | embed_fns.append(lambda x: x) 16 | out_dim += d 17 | 18 | max_freq = self.kwargs['max_freq_log2'] 19 | N_freqs = self.kwargs['num_freqs'] 20 | 21 | if self.kwargs['log_sampling']: 22 | freq_bands = 2. ** torch.linspace(0., max_freq, N_freqs) 23 | else: 24 | freq_bands = torch.linspace(2.**0., 2.**max_freq, N_freqs) 25 | 26 | for freq in freq_bands: 27 | for p_fn in self.kwargs['periodic_fns']: 28 | embed_fns.append(lambda x, p_fn=p_fn, 29 | freq=freq: p_fn(x * freq)) 30 | out_dim += d 31 | 32 | self.embed_fns = embed_fns 33 | self.out_dim = out_dim 34 | 35 | def embed(self, inputs): 36 | return torch.cat([fn(inputs) for fn in self.embed_fns], -1) 37 | 38 | def get_embedder(multires, input_dims=3): 39 | embed_kwargs = { 40 | 'include_input': True, 41 | 'input_dims': input_dims, 42 | 'max_freq_log2': multires-1, 43 | 'num_freqs': multires, 44 | 'log_sampling': True, 45 | 'periodic_fns': [torch.sin, torch.cos], 46 | } 47 | 48 | embedder_obj = Embedder(**embed_kwargs) 49 | def embed(x, eo=embedder_obj): return eo.embed(x) 50 | return embed, embedder_obj.out_dim 51 | -------------------------------------------------------------------------------- /external/ldif/gaps/vc/makefiles/Makefile.apps: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile for GAPS applications 3 | # 4 | 5 | 6 | 7 | # 8 | # Before this Makefile is included ... 9 | # $(NAME) should be module name 10 | # $(CCSRCS) should list C++ source files 11 | # 12 | # For example ... 13 | # NAME=foo 14 | # CCSRCS=$(NAME).C \ 15 | # foo1.C foo2.C foo3.C 16 | # 17 | 18 | 19 | # 20 | # Set up compiler options, etc. 21 | # 22 | 23 | include ../../scripts/Makefile.std 24 | 25 | 26 | 27 | # 28 | # Set up target executable 29 | # 30 | 31 | EXE=$(EXE_DIR)/$(NAME).exe 32 | 33 | 34 | 35 | # 36 | # Set up link options 37 | # 38 | 39 | BASE_LDFLAGS=$(USER_LDFLAGS) /link /libpath:$(LIB_DIR) 40 | DEBUG_LDFLAGS=$(BASE_LDFLAGS) -Zi 41 | OPT_LDFLAGS=$(BASE_LDFLAGS) -Ox 42 | LDFLAGS=$(DEBUG_LDFLAGS) 43 | 44 | 45 | 46 | # 47 | # Set up libs 48 | # 49 | 50 | OPENGL_LIBS=glut32.lib glu32.lib opengl32.lib 51 | STD_LIBS =wsock32.lib user32.lib gdi32.lib advapi32.lib 52 | LIBS=$(USER_LIBS) $(PKG_LIBS) $(OPENGL_LIBS) $(STD_LIBS) 53 | 54 | 55 | 56 | # 57 | # Make targets 58 | # 59 | 60 | opt: 61 | $(MAKE) $(EXE) "CFLAGS=$(OPT_CFLAGS)" "LDFLAGS=$(OPT_LDFLAGS)" 62 | 63 | debug: 64 | $(MAKE) $(EXE) "CFLAGS=$(DEBUG_CFLAGS)" "LDFLAGS=$(DEBUG_LDFLAGS)" 65 | 66 | $(EXE): $(OBJS) $(LIBDIR) 67 | mkdir -p $(EXE_DIR) 68 | $(CC) -o $(EXE) $(OBJS) $(LDFLAGS) $(LIBS) 69 | 70 | release: 71 | mkdir -p $(RELEASE_DIR)/apps 72 | mkdir $(RELEASE_DIR)/apps/$(NAME)1 73 | cp *.[cCIh] $(RELEASE_DIR)/apps/$(NAME)1 74 | cp Makefile $(RELEASE_DIR)/apps/$(NAME)1 75 | rm -r -f $(RELEASE_DIR)/apps/$(NAME) 76 | mv $(RELEASE_DIR)/apps/$(NAME)1 $(RELEASE_DIR)/apps/$(NAME) 77 | 78 | clean: 79 | - rm -f *~ *.obj $(EXE) 80 | 81 | 82 | 83 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/jpeg/jchuff.h: -------------------------------------------------------------------------------- 1 | /* 2 | * jchuff.h 3 | * 4 | * Copyright (C) 1991-1997, Thomas G. Lane. 5 | * This file is part of the Independent JPEG Group's software. 6 | * For conditions of distribution and use, see the accompanying README file. 7 | * 8 | * This file contains declarations for Huffman entropy encoding routines 9 | * that are shared between the sequential encoder (jchuff.c) and the 10 | * progressive encoder (jcphuff.c). No other modules need to see these. 11 | */ 12 | 13 | /* The legal range of a DCT coefficient is 14 | * -1024 .. +1023 for 8-bit data; 15 | * -16384 .. +16383 for 12-bit data. 16 | * Hence the magnitude should always fit in 10 or 14 bits respectively. 17 | */ 18 | 19 | #if BITS_IN_JSAMPLE == 8 20 | #define MAX_COEF_BITS 10 21 | #else 22 | #define MAX_COEF_BITS 14 23 | #endif 24 | 25 | /* Derived data constructed for each Huffman table */ 26 | 27 | typedef struct { 28 | unsigned int ehufco[256]; /* code for each symbol */ 29 | char ehufsi[256]; /* length of code for each symbol */ 30 | /* If no code has been allocated for a symbol S, ehufsi[S] contains 0 */ 31 | } c_derived_tbl; 32 | 33 | /* Short forms of external names for systems with brain-damaged linkers. */ 34 | 35 | #ifdef NEED_SHORT_EXTERNAL_NAMES 36 | #define jpeg_make_c_derived_tbl jMkCDerived 37 | #define jpeg_gen_optimal_table jGenOptTbl 38 | #endif /* NEED_SHORT_EXTERNAL_NAMES */ 39 | 40 | /* Expand a Huffman table definition into the derived format */ 41 | EXTERN(void) jpeg_make_c_derived_tbl 42 | JPP((j_compress_ptr cinfo, jboolean isDC, int tblno, 43 | c_derived_tbl ** pdtbl)); 44 | 45 | /* Generate an optimal table definition given the specified counts */ 46 | EXTERN(void) jpeg_gen_optimal_table 47 | JPP((j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[])); 48 | -------------------------------------------------------------------------------- /external/ldif/gaps/apps/qview/Occnet.h: -------------------------------------------------------------------------------- 1 | // Copyright 2020 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // Include file for Occnet Class. 15 | // // This is a stub for now. 16 | // Class definition 17 | #ifndef OCCNET_H 18 | #define OCCNET_H 19 | 20 | class OccNet { 21 | public: 22 | OccNet(void); 23 | 24 | void SetShapeEmbedding(const RNScalar* embedding); 25 | RNScalar Evaluate(const R3Point& position); 26 | 27 | virtual int ReadFile(const char* filename); 28 | 29 | private: 30 | std::vector sample_resize_fc_weights; 31 | std::vector sample_resize_fc_biases; 32 | std::vector fc1_weights; 33 | std::vector fc1_biases; 34 | std::vector fc2_weights; 35 | std::vector fc2_biases; 36 | float cbn1_running_mean; 37 | float cbn1_running_variance; 38 | float cbn2_running_mean; 39 | float cbn2_running_variance; 40 | float cbnf_running_mean; 41 | float cbnf_running_variance; 42 | std::vector final_activation_weights; 43 | std::vector final_activation_bias; 44 | }; 45 | 46 | inline void SetShapeEmbedding(const RNScalar* embedding) { return; } 47 | 48 | inline RNScalar OccNet::Evaluate(const R3Point& position) { return 0.0; } 49 | 50 | #endif // OCCNET_H 51 | -------------------------------------------------------------------------------- /external/ldif/gaps/docs/makepkg.awk: -------------------------------------------------------------------------------- 1 | # Make html file with class documentation 2 | # NOTE: Does not insert inherited members 3 | 4 | $0~"class " && $0~"{" { 5 | # Parse package name and class name 6 | pkg_name = "RNFoobar"; 7 | class_name = $2; 8 | 9 | # Print class name 10 | printf "


%s

\n\n", 11 | class_name, pkg_name, class_name, class_name; 12 | 13 | # Print base classes 14 | printf "
\n"; 15 | printf "

Base Classes:

\n"; 16 | printf "
\n"; 17 | printf "

Public Base Classes:

\n"; 18 | printf "
\n"; 19 | found = 0; 20 | split($0, s0); 21 | for (i = 3; i <= NF; i++) { 22 | if (s0[i] == "public") { 23 | printf "
%s\n", $(i+1), $(i+1) 24 | found = 1; 25 | } 26 | } 27 | if (!found) printf "
\tNone\n"; 28 | printf "
\n"; 29 | printf "

\n"; 30 | 31 | # Print member functions 32 | printf "

Member Functions:

\n"; 33 | printf "
\n"; 34 | active = 0; 35 | first = 1; 36 | } 37 | 38 | $0~"};" { 39 | if (!first) printf "
\n"; 40 | printf "
\n"; 41 | printf "\n\n\n\n"; 42 | printf "

\n"; 43 | active = 0; 44 | } 45 | 46 | { 47 | sub("\r$", ""); 48 | if ($1 == "public:") { 49 | active = 1; 50 | } 51 | else if (($1 == "protected:") || ($1 == "private:")) { 52 | active = 0; 53 | } 54 | else if (active) { 55 | if ($1 == "//") { 56 | split($0, s0) 57 | if (!first) printf "\n"; 58 | printf "

"; 59 | for (i = 2; i <= NF; i++) printf " %s", s0[i]; 60 | printf ":

\n"; 61 | printf "
\n"; 62 | first = 0; 63 | } 64 | else { 65 | print "
" $0; 66 | } 67 | } 68 | } 69 | 70 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/R3Graphics/R3Frustum.h: -------------------------------------------------------------------------------- 1 | // Include file for R3 view frustum class 2 | #ifndef __R3__FRUSTUM__H__ 3 | #define __R3__FRUSTUM__H__ 4 | 5 | 6 | 7 | /* Begin namespace */ 8 | namespace gaps { 9 | 10 | 11 | 12 | //////////////////////////////////////////////////////////////////////// 13 | // Class definition 14 | //////////////////////////////////////////////////////////////////////// 15 | 16 | struct R3Frustum { 17 | public: 18 | // Constructor 19 | R3Frustum(void); 20 | R3Frustum(const R3Camera& camera); 21 | R3Frustum(const R3Point& viewpoint, const R3Vector& towards, 22 | const R3Vector& up, RNAngle xfov, RNAngle yfov, 23 | RNLength neardist, RNLength fardist); 24 | 25 | // Property functions 26 | const R3Camera& Camera(void) const; 27 | const R3Halfspace& Halfspace(int dir, int dim) const; 28 | 29 | // Manipulation functions 30 | void SetCamera(const R3Camera& camera); 31 | 32 | // Intersection/containment functions 33 | RNBoolean Intersects(const R3Point& point) const; 34 | RNBoolean Intersects(const R3Span& span) const; 35 | RNBoolean Intersects(const R3Box& box) const; 36 | RNBoolean Contains(const R3Point& point) const; 37 | RNBoolean Contains(const R3Span& span) const; 38 | RNBoolean Contains(const R3Box& box) const; 39 | 40 | // Draw function 41 | void Draw(void) const; 42 | 43 | public: 44 | R3Camera camera; 45 | R3Halfspace halfspaces[2][3]; 46 | }; 47 | 48 | 49 | 50 | // Inline functions 51 | 52 | inline const R3Camera& R3Frustum:: 53 | Camera(void) const 54 | { 55 | // Return camera 56 | return camera; 57 | } 58 | 59 | 60 | 61 | inline const R3Halfspace& R3Frustum:: 62 | Halfspace(int dir, int dim) const 63 | { 64 | // Return halfspace 65 | return halfspaces[dir][dim]; 66 | } 67 | 68 | 69 | 70 | // End namespace 71 | } 72 | 73 | 74 | // End include guard 75 | #endif 76 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/R3Shapes/R3CatmullRomSpline.h: -------------------------------------------------------------------------------- 1 | /* Include file for the Catmull Rom spline class */ 2 | #ifndef __R3__CATMULL_ROM_SPLINE__H__ 3 | #define __R3__CATMULL_ROM_SPLINE__H__ 4 | 5 | 6 | 7 | /* Begin namespace */ 8 | namespace gaps { 9 | 10 | 11 | 12 | /* Class definition */ 13 | 14 | class R3CatmullRomSpline : public R3Polyline { 15 | public: 16 | // Constructor functions 17 | R3CatmullRomSpline(void); 18 | R3CatmullRomSpline(const R3CatmullRomSpline& curve); 19 | R3CatmullRomSpline(const RNArray& points, RNScalar tao = 0.5); 20 | R3CatmullRomSpline(const R3Point *points, int npoints, RNScalar tao = 0.5); 21 | R3CatmullRomSpline(const R3Point *points, const RNScalar *parameters, int npoints, RNScalar tao = 0.5); 22 | virtual ~R3CatmullRomSpline(void); 23 | 24 | // Spline properties 25 | int Order(void) const; 26 | 27 | // Vertex properties 28 | virtual R3Vector VertexDerivative(int k) const; 29 | 30 | // Point access 31 | virtual R3Point PointPosition(RNScalar u) const; 32 | virtual R3Vector PointDerivative(RNScalar u) const; 33 | 34 | // Draw functions 35 | virtual void Outline(const R3DrawFlags flags = R3_DEFAULT_DRAW_FLAGS) const; 36 | virtual void Outline(RNScalar sample_spacing) const; 37 | 38 | public: 39 | // Utility functions 40 | RNScalar BlendingWeight(RNScalar t, int k) const; 41 | RNScalar BlendingWeightDerivative(RNScalar t, int k) const; 42 | R3Point PhantomVertexPosition(int i, int j) const; 43 | 44 | private: 45 | // Upkeep functions 46 | virtual void UpdateBBox(void); 47 | 48 | private: 49 | RNScalar tao; 50 | }; 51 | 52 | 53 | 54 | /* Inline functions */ 55 | 56 | inline int R3CatmullRomSpline:: 57 | Order(void) const 58 | { 59 | // Return order of polynomial 60 | return 3; 61 | } 62 | 63 | 64 | 65 | // End namespace 66 | } 67 | 68 | 69 | // End include guard 70 | #endif 71 | -------------------------------------------------------------------------------- /external/ldif/gaps/apps/conf2img/RGBDSegmentation.h: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////// 2 | // Include file for RGBD segmentation functions 3 | //////////////////////////////////////////////////////////////////////// 4 | #ifndef __RGBD_SEGMENTATION__H__ 5 | #define __RGBD_SEGMENTATION__H__ 6 | 7 | 8 | 9 | ////////////////////////////////////////////////////////////////////// 10 | // Include files 11 | //////////////////////////////////////////////////////////////////////// 12 | 13 | #include "RGBD/RGBD.h" 14 | #include "segmentation.h" 15 | 16 | 17 | 18 | ////////////////////////////////////////////////////////////////////// 19 | // Namespace 20 | //////////////////////////////////////////////////////////////////////// 21 | 22 | namespace gaps { 23 | 24 | 25 | 26 | //////////////////////////////////////////////////////////////////////// 27 | // Parameters 28 | //////////////////////////////////////////////////////////////////////// 29 | 30 | extern double max_depth; 31 | extern double max_neighbor_distance_factor; 32 | extern double max_neighbor_normal_angle; 33 | extern double max_neighbor_color_difference; 34 | 35 | 36 | 37 | //////////////////////////////////////////////////////////////////////// 38 | // Segmentation functions 39 | //////////////////////////////////////////////////////////////////////// 40 | 41 | extern int 42 | RGBDCreateSegmentationChannel(const R2Grid& depth_image, 43 | const R2Grid& px_image, const R2Grid& py_image, const R2Grid& pz_image, const R2Grid& boundary_image, 44 | const R2Grid& nx_image, const R2Grid& ny_image, const R2Grid& nz_image, const R2Grid& radius_image, 45 | const R2Image& color_image, R2Grid& output_segmentation_image, 46 | const R3Point& viewpoint, const R3Vector& towards, const R3Vector& up, 47 | const char *output_segmentation_filename = NULL); 48 | 49 | 50 | 51 | } // end namespace 52 | 53 | 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/RNBasics/RNBasics.h: -------------------------------------------------------------------------------- 1 | /* Include file for GAPS basics module */ 2 | #ifndef __RN__BASICS__H__ 3 | #define __RN__BASICS__H__ 4 | 5 | 6 | 7 | /* Compatibility switch include files */ 8 | 9 | #include "RNBasics/RNCompat.h" 10 | 11 | 12 | 13 | /* External include files */ 14 | 15 | #include "RNBasics/RNExtern.h" 16 | 17 | 18 | 19 | /* Base class for GAPS modules */ 20 | 21 | #include "RNBasics/RNBase.h" 22 | 23 | 24 | 25 | /* Error reporting include files */ 26 | 27 | #include "RNBasics/RNError.h" 28 | 29 | 30 | 31 | /* Memory management include files */ 32 | 33 | #include "RNBasics/RNMem.h" 34 | 35 | 36 | 37 | /* File management include files */ 38 | 39 | #include "RNBasics/RNFile.h" 40 | 41 | 42 | 43 | /* Basic bitflags include files */ 44 | 45 | #include "RNBasics/RNFlags.h" 46 | 47 | 48 | 49 | /* Class type include files */ 50 | 51 | #include "RNBasics/RNType.h" 52 | 53 | 54 | 55 | /* Math include files */ 56 | 57 | #include "RNBasics/RNScalar.h" 58 | #include "RNBasics/RNIntval.h" 59 | 60 | 61 | 62 | /* Dynamic array include files */ 63 | 64 | #include "RNBasics/RNArray.h" 65 | #include "RNBasics/RNQueue.h" 66 | #include "RNBasics/RNHeap.h" 67 | #include "RNBasics/RNMap.h" 68 | 69 | 70 | 71 | /* Graphics utility include files */ 72 | 73 | #include "RNBasics/RNGrfx.h" 74 | #include "RNBasics/RNRgb.h" 75 | 76 | 77 | 78 | /* OS utility include files */ 79 | 80 | #include "RNBasics/RNTime.h" 81 | 82 | 83 | 84 | /* SVD stuff */ 85 | 86 | #include "RNBasics/RNSvd.h" 87 | 88 | 89 | 90 | /* JSON stuff */ 91 | 92 | #include "RNBasics/json.h" 93 | 94 | 95 | 96 | /* Initialization functions */ 97 | 98 | namespace gaps { 99 | int RNInitBasics(void); 100 | void RNStopBasics(void); 101 | } 102 | 103 | 104 | 105 | #endif 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/R2Shapes/R2Xform.h: -------------------------------------------------------------------------------- 1 | /* Include file for the R2 transformation class */ 2 | #ifndef __R2__TRANSFORMATION__H__ 3 | #define __R2__TRANSFORMATION__H__ 4 | 5 | 6 | 7 | /* Begin namespace */ 8 | namespace gaps { 9 | 10 | 11 | 12 | /* Initialization functions */ 13 | 14 | int R2InitTransformation(); 15 | void R2StopTransformation(); 16 | 17 | 18 | 19 | /* Class definition */ 20 | 21 | class R2Transformation /* : public R2Base */ { 22 | public: 23 | // Destructor function 24 | virtual ~R2Transformation(void); 25 | 26 | // Property functions/operators 27 | virtual const RNBoolean IsMirrored(void) const; 28 | virtual const RNBoolean IsLinear(void) const; 29 | virtual const RNBoolean IsAffine(void) const; 30 | virtual const RNBoolean IsIsotropic(void) const; 31 | 32 | // Application functions/operators 33 | virtual void Apply(R2Vector& vector) const = 0; 34 | virtual void Apply(R2Point& point) const = 0; 35 | virtual void Apply(R2Transformation& transformation) const = 0; 36 | virtual void Apply(R2Affine& affine) const = 0; 37 | virtual void ApplyInverse(R2Vector& vector) const = 0; 38 | virtual void ApplyInverse(R2Point& point) const = 0; 39 | virtual void ApplyInverse(R2Transformation& transformation) const = 0; 40 | virtual void ApplyInverse(R2Affine& affine) const = 0; 41 | 42 | // Manipulation functions/operators 43 | virtual void Reset(const R2Transformation& transformation) = 0; 44 | virtual void Transform(const R2Transformation& transformation) = 0; 45 | virtual void InverseTransform(const R2Transformation& transformation) = 0; 46 | 47 | // Draw functions/operators 48 | virtual void Load(void) const = 0; 49 | virtual void Draw(void) const = 0; 50 | virtual void Push(void) const = 0; 51 | virtual void Pop(void) const = 0; 52 | }; 53 | 54 | 55 | 56 | // End namespace 57 | } 58 | 59 | 60 | // End include guard 61 | #endif 62 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/R3Surfels/R3SurfelFeatureEvaluation.h: -------------------------------------------------------------------------------- 1 | /* Include file for the R3 surfel feature evaluation functions */ 2 | #ifndef __R3__SURFEL__FEATURE_EVALUATION__H__ 3 | #define __R3__SURFEL__FEATURE_EVALUATION__H__ 4 | 5 | 6 | 7 | //////////////////////////////////////////////////////////////////////// 8 | // NAMESPACE 9 | //////////////////////////////////////////////////////////////////////// 10 | 11 | namespace gaps { 12 | 13 | 14 | 15 | //////////////////////////////////////////////////////////////////////// 16 | // POINTSET FEATURE DEFINITIONS 17 | //////////////////////////////////////////////////////////////////////// 18 | 19 | class R3SurfelPointSetFeature : public R3SurfelFeature { 20 | public: 21 | R3SurfelPointSetFeature(const char *name = NULL, RNScalar minimum = -FLT_MAX, RNScalar maximum = FLT_MAX, RNScalar weight = 1); 22 | virtual ~R3SurfelPointSetFeature(void); 23 | virtual int Type(void) const; 24 | virtual int UpdateFeatureVector(R3SurfelObject *object, R3SurfelFeatureVector& vector) const; 25 | }; 26 | 27 | class R3SurfelOverheadGridFeature : public R3SurfelFeature { 28 | public: 29 | R3SurfelOverheadGridFeature(const char *filename, const char *featurename = NULL, RNScalar minimum = -FLT_MAX, RNScalar maximum = FLT_MAX, RNScalar weight = 1); 30 | virtual ~R3SurfelOverheadGridFeature(void); 31 | virtual int Type(void) const; 32 | virtual int UpdateFeatureVector(R3SurfelObject *object, R3SurfelFeatureVector& vector) const; 33 | 34 | public: 35 | char *filename; 36 | R3Matrix world_to_grid_matrix; 37 | int grid_resolution[2]; 38 | FILE *fp; 39 | }; 40 | 41 | 42 | 43 | //////////////////////////////////////////////////////////////////////// 44 | // TOP-LEVEL FUNCTIONS 45 | //////////////////////////////////////////////////////////////////////// 46 | 47 | int CreateFeatures(R3SurfelScene *scene); 48 | int EvaluateFeatures(R3SurfelScene *scene); 49 | 50 | 51 | 52 | // End namespace 53 | } 54 | 55 | 56 | // End include guard 57 | #endif 58 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/RNBasics/RNHeap.h: -------------------------------------------------------------------------------- 1 | // Include file for a heap 2 | #ifndef __RN__HEAP__H__ 3 | #define __RN__HEAP__H__ 4 | 5 | 6 | 7 | /* Begin namespace */ 8 | namespace gaps { 9 | 10 | 11 | 12 | // Class definition 13 | 14 | template 15 | class RNHeap { 16 | public: 17 | // Constructor functions 18 | RNHeap(RNScalar (*value_callback)(PtrType, void *), 19 | PtrType **(*entry_callback)(PtrType, void *) = NULL, 20 | void *callback_data = NULL, int least_first = TRUE); 21 | RNHeap(PtrType base, RNScalar *value_ptr, PtrType **entry_ptr = NULL, int least_first = TRUE); 22 | RNHeap(int value_offset, int entry_offset = -1, int least_first = TRUE); 23 | ~RNHeap(void); 24 | 25 | // Data access functions 26 | int IsEmpty(void) const; 27 | int NEntries(void) const; 28 | PtrType Kth(int k) const; 29 | PtrType operator[](int k) const; 30 | PtrType Peek(void) const; 31 | 32 | // Manipulation functions 33 | void Empty(void); 34 | void Sort(int n = -1); 35 | void Truncate(int n, RNBoolean sort = TRUE); 36 | void Remove(PtrType data); 37 | void Update(PtrType data); 38 | void Push(PtrType data); 39 | PtrType Pop(void); 40 | 41 | // Debug functions 42 | int IsValid(void); 43 | 44 | protected: 45 | // Update functions 46 | RNScalar Value(int i) const; 47 | int Compare(int i, int j) const; 48 | void Swap(int i, int j); 49 | void Sort(int n, int left, int right); 50 | int BubbleUp(int i); 51 | int BubbleDown(int i); 52 | 53 | private: 54 | PtrType *entries; 55 | int nentries; 56 | int nallocated; 57 | int value_offset; 58 | int entry_offset; 59 | RNScalar (*value_callback)(PtrType, void *); 60 | PtrType **(*entry_callback)(PtrType, void *); 61 | void *callback_data; 62 | int least_first; 63 | }; 64 | 65 | 66 | 67 | // End namespace 68 | } 69 | 70 | 71 | // Include files 72 | 73 | #include "RNHeap.cpp" 74 | 75 | 76 | // End include guard 77 | #endif 78 | 79 | 80 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/RGBD/RGBDCamera.h: -------------------------------------------------------------------------------- 1 | // Include file for RGBDCamera class 2 | #ifndef __RGBD__CAMERA__H__ 3 | #define __RGBD__CAMERA__H__ 4 | 5 | 6 | 7 | //////////////////////////////////////////////////////////////////////// 8 | // Namespace 9 | //////////////////////////////////////////////////////////////////////// 10 | 11 | namespace gaps { 12 | 13 | 14 | 15 | //////////////////////////////////////////////////////////////////////// 16 | // Class definition 17 | //////////////////////////////////////////////////////////////////////// 18 | 19 | class RGBDCamera { 20 | public: 21 | // Constructors/destructors 22 | RGBDCamera(void); 23 | RGBDCamera(const RGBDCamera& camera); 24 | ~RGBDCamera(void); 25 | 26 | // Parameter manipulation functions 27 | void SetUndistortedParameters(void); 28 | 29 | // Input/output functions 30 | int ReadScanNetFile(const char *filename); 31 | int ReadMatterportFile(const char *filename); 32 | int WriteScanNetFile(const char *filename) const; 33 | int WriteMatterportFile(const char *filename) const; 34 | 35 | public: 36 | // Input data 37 | int colorWidth; 38 | int colorHeight; 39 | int depthWidth; 40 | int depthHeight; 41 | double fx_color; 42 | double fy_color; 43 | double mx_color; 44 | double my_color; 45 | double k1_color; 46 | double k2_color; 47 | double k3_color; 48 | double k4_color; 49 | double p1_color; 50 | double p2_color; 51 | double fx_depth; 52 | double fy_depth; 53 | double mx_depth; 54 | double my_depth; 55 | double k1_depth; 56 | double k2_depth; 57 | double k3_depth; 58 | double k4_depth; 59 | double p1_depth; 60 | double p2_depth; 61 | R4Matrix depthToColorExtrinsics; 62 | char *deviceId; 63 | char *deviceName; 64 | char *sceneLabel; 65 | char *sceneType; 66 | int numDepthFrames; 67 | int numColorFrames; 68 | int numIMUmeasurements; 69 | }; 70 | 71 | 72 | 73 | // End namespace 74 | } 75 | 76 | 77 | // End include guard 78 | #endif 79 | -------------------------------------------------------------------------------- /external/ldif/gaps/apps/pfminfo/pfminfo.cpp: -------------------------------------------------------------------------------- 1 | // Source file for the image info program 2 | 3 | 4 | 5 | // Include files 6 | 7 | namespace gaps {} 8 | using namespace gaps; 9 | #include "R2Shapes/R2Shapes.h" 10 | 11 | 12 | 13 | // Program variables 14 | 15 | static char *input_name = NULL; 16 | static int print_verbose = 0; 17 | 18 | 19 | 20 | static int 21 | PrintBasicInfo(const R2Grid *grid) 22 | { 23 | printf("Basic info:\n"); 24 | printf(" Resolution = %d %d\n", grid->XResolution(), grid->YResolution()); 25 | printf(" Spacing = %g\n", grid->GridToWorldScaleFactor()); 26 | printf(" Cardinality = %d\n", grid->Cardinality()); 27 | RNInterval grid_range = grid->Range(); 28 | printf(" Minimum = %g\n", grid_range.Min()); 29 | printf(" Maximum = %g\n", grid_range.Max()); 30 | printf(" L1Norm = %g\n", grid->L1Norm()); 31 | printf(" L2Norm = %g\n", grid->L2Norm()); 32 | fflush(stdout); 33 | 34 | // Return success 35 | return 1; 36 | } 37 | 38 | 39 | 40 | static int 41 | ParseArgs(int argc, char **argv) 42 | { 43 | // Parse arguments 44 | argc--; argv++; 45 | while (argc > 0) { 46 | if ((*argv)[0] == '-') { 47 | if (!strcmp(*argv, "-v")) print_verbose = 1; 48 | else { RNFail("Invalid program argument: %s", *argv); exit(1); } 49 | } 50 | else { 51 | if (!input_name) input_name = *argv; 52 | else { RNFail("Invalid program argument: %s", *argv); exit(1); } 53 | } 54 | argv++; argc--; 55 | } 56 | 57 | // Check input filename 58 | if (!input_name) { 59 | RNFail("Usage: pfminfo inputfile [options]\n"); 60 | return 0; 61 | } 62 | 63 | // Return OK status 64 | return 1; 65 | } 66 | 67 | 68 | 69 | int 70 | main(int argc, char **argv) 71 | { 72 | // Parse program arguments 73 | if (!ParseArgs(argc, argv)) exit(-1); 74 | 75 | // Read grid 76 | R2Grid *grid = new R2Grid(); 77 | if (!grid->Read(input_name)) exit(-1); 78 | 79 | // Print info 80 | if (!PrintBasicInfo(grid)) exit(-1); 81 | 82 | // Return success 83 | return 0; 84 | } 85 | -------------------------------------------------------------------------------- /external/ldif/ldif2mesh/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2020 Google LLC 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # https://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | #cd $(dirname $0) 16 | 17 | # Get the cuda version to figure out which architectures 18 | # to build for: 19 | version=($(python get_cuda_version.py)) 20 | major_version=${version[0]} 21 | minor_version=${version[1]} 22 | echo "Major version is ${major_version} and minor version is ${minor_version}" 23 | 24 | # Support for Pascal (10-series cards, P100). Requires at least CUDA 8. 25 | # We don't support less than this. 26 | targets="-gencode=arch=compute_60,code=sm_60 \ 27 | -gencode=arch=compute_61,code=sm_61 \ 28 | -gencode=arch=compute_62,code=sm_62" 29 | 30 | # Support for Volta (e.g. V100). Requires CUDA 9. 31 | if [[ $major_version -ge 9 ]]; then 32 | echo "Adding CUDA 9 Targets." 33 | targets="${targets} \ 34 | -gencode=arch=compute_70,code=sm_70 \ 35 | -gencode=arch=compute_72,code=sm_72" 36 | fi 37 | 38 | # Support for Turing (e.g. RTX 2080 Ti). Requires CUDA 10. 39 | if [[ $major_version -ge 10 ]]; then 40 | echo "Adding CUDA 10 Targets." 41 | targets="${targets} \ 42 | -gencode=arch=compute_75,code=sm_75" 43 | fi 44 | 45 | # Support for Ampere (e.g. RTX 3090). Requires CUDA 11. 46 | if [[ $major_version -ge 11 ]]; then 47 | echo "Adding CUDA 11 Targets." 48 | targets="${targets} \ 49 | -gencode=arch=compute_86,code=sm_86" 50 | fi 51 | 52 | nvcc -Xptxas -O3 \ 53 | ${targets} \ 54 | --ptxas-options=-v -maxrregcount 63 $1 \ 55 | ldif2mesh.cu -o ldif2mesh --std c++11 56 | -------------------------------------------------------------------------------- /external/ldif/gaps/docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | GAPS Documentation 3 | 4 | 5 | 6 |

GAPS

7 | 8 |

GAPS is a software toolkit for geometric analysis of 3D scenes.

9 | 10 |

It contains the following four packages ...

11 |
    12 |
  • RNBasics - Simple common stuff (e.g., memory allocation, error reporting, dynamic arrays, etc). 13 |
  • R2Shapes - 2D geometry and images (e.g., points, vectors, lines, images, etc.). 14 |
  • R3Shapes - 3D geometry (e.g., points, vectors, lines, planes, boxes, meshes, etc.). 15 |
  • R3Graphics - 3D scene display utilities (e.g., cameras, viewports, brdfs, textures, scene graphs, etc.) 16 |
17 | 18 |

.. and several example applications:

19 |
    20 |
  • grd2grd - Process 3D grids (and convert between formats).
  • 22 |
  • grd2msh - Extract an isosurface from a grid.
  • 23 |
  • grd2pts - Extract a point set from a grid.
  • 24 |
  • grd2txt - Convert a grid file (.grd) to an ASCII text file (.txt).
  • 25 |
  • grdview - View a grid file (.grd) interactively with OpenGL.
  • 26 |
  • msh2msh - Process 3D meshes (and convert between formats).
  • 27 |
  • msh2msh - Rasterize a mesh into a 3D grid.
  • 28 |
  • msh2pts - Extract a point set from a mesh.
  • 29 |
  • mshview - View a mesh file (.msh) interactively with OpenGL.
  • 30 |
31 | 32 |

Please view the README file for more information about compiling and linking.

33 | 34 |
35 |
funk@cs.princeton.edu
36 | 37 | 38 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/RGBD/RGBD.h: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////// 2 | // Include file for RGBD classes 3 | //////////////////////////////////////////////////////////////////////// 4 | 5 | #ifndef __RGBD__H__ 6 | #define __RGBD__H__ 7 | 8 | 9 | 10 | //////////////////////////////////////////////////////////////////////// 11 | // Dependency include files 12 | //////////////////////////////////////////////////////////////////////// 13 | 14 | #include "R3Shapes/R3Shapes.h" 15 | 16 | 17 | 18 | //////////////////////////////////////////////////////////////////////// 19 | // RGBD pre-declarations 20 | //////////////////////////////////////////////////////////////////////// 21 | 22 | namespace gaps { 23 | class RGBDImage; 24 | class RGBDSurface; 25 | class RGBDConfiguration; 26 | } 27 | 28 | 29 | 30 | //////////////////////////////////////////////////////////////////////// 31 | // Constant definitions 32 | //////////////////////////////////////////////////////////////////////// 33 | 34 | #define RGBD_RED_CHANNEL 0 35 | #define RGBD_GREEN_CHANNEL 1 36 | #define RGBD_BLUE_CHANNEL 2 37 | #define RGBD_DEPTH_CHANNEL 3 38 | #define RGBD_CATEGORY_CHANNEL 4 39 | #define RGBD_INSTANCE_CHANNEL 5 40 | #define RGBD_USER_CHANNEL 6 41 | 42 | #define RGBD_BORDER_BOUNDARY 0x1 43 | #define RGBD_SILHOUETTE_BOUNDARY 0x2 44 | #define RGBD_SHADOW_BOUNDARY 0x4 45 | 46 | #define RGBD_NO_COLOR_SCHEME 0 47 | #define RGBD_PHOTO_COLOR_SCHEME 1 48 | #define RGBD_RENDER_COLOR_SCHEME 2 49 | #define RGBD_INDEX_COLOR_SCHEME 3 50 | #define RGBD_HIGHLIGHT_COLOR_SCHEME 4 51 | 52 | #define RGBD_NO_SELECTION 0 53 | #define RGBD_IMAGE_SELECTION 1 54 | #define RGBD_SURFACE_SELECTION 2 55 | 56 | 57 | 58 | //////////////////////////////////////////////////////////////////////// 59 | // RGBD include files 60 | //////////////////////////////////////////////////////////////////////// 61 | 62 | #include "RGBDCamera.h" 63 | #include "RGBDImage.h" 64 | #include "RGBDSurface.h" 65 | #include "RGBDConfiguration.h" 66 | #include "RGBDTransform.h" 67 | #include "RGBDUtil.h" 68 | 69 | 70 | 71 | #endif 72 | -------------------------------------------------------------------------------- /ssr/model/Attention_module.py: -------------------------------------------------------------------------------- 1 | import torch 2 | import torch.nn as nn 3 | import torch.nn.functional as F 4 | 5 | 6 | class Attention_RoI_Module(nn.Module): 7 | def __init__(self,img_feat_channel=256,global_dim=256,global_detach=True): 8 | super(Attention_RoI_Module,self).__init__() 9 | self.global_detach = global_detach 10 | self.channel_mlp = nn.Sequential( 11 | nn.Linear(in_features=global_dim, out_features=img_feat_channel), 12 | nn.ReLU(), 13 | nn.Linear(in_features=img_feat_channel, out_features=img_feat_channel), 14 | nn.ReLU(), 15 | nn.Linear(in_features=img_feat_channel, out_features=img_feat_channel), 16 | nn.Sigmoid(), 17 | ) 18 | self.post_conv=nn.Sequential( 19 | nn.Conv2d(in_channels=img_feat_channel, out_channels=img_feat_channel, kernel_size=5,padding=2), 20 | nn.ReLU(), 21 | nn.Conv2d(in_channels=img_feat_channel, out_channels=img_feat_channel, kernel_size=5,padding=2), 22 | nn.ReLU(), 23 | nn.Conv2d(in_channels=img_feat_channel, out_channels=img_feat_channel, kernel_size=5,padding=2), 24 | nn.ReLU(), 25 | nn.Conv2d(in_channels=img_feat_channel, out_channels=img_feat_channel, kernel_size=5,padding=2), 26 | ) 27 | self.pre_conv=nn.Sequential( 28 | nn.Conv2d(in_channels=img_feat_channel, out_channels=img_feat_channel, kernel_size=1), 29 | nn.ReLU(), 30 | nn.Conv2d(in_channels=img_feat_channel, out_channels=img_feat_channel, kernel_size=1), 31 | ) 32 | 33 | 34 | def forward(self,img_feat,global_feat,bdb_grid): 35 | roi_feat = self.pre_conv(img_feat) # keep the same size 36 | if self.global_detach: 37 | global_feat=global_feat.detach() 38 | channel_wise_weight=self.channel_mlp(global_feat) 39 | out_feat=channel_wise_weight.unsqueeze(2).unsqueeze(3)*roi_feat 40 | out_feat=self.post_conv(out_feat)+roi_feat 41 | ret_dict={ 42 | "roi_feat":out_feat, 43 | } 44 | ret_dict['channel_atten_weight']=channel_wise_weight 45 | return ret_dict 46 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/R2Shapes/R2Align.h: -------------------------------------------------------------------------------- 1 | // Include file for alignment utility functions 2 | #ifndef __R2__ALIGN__H__ 3 | #define __R2__ALIGN__H__ 4 | 5 | 6 | 7 | /* Begin namespace */ 8 | namespace gaps { 9 | 10 | 11 | 12 | // Functions to align RNArray of points 13 | 14 | R2Point R2Centroid(const RNArray& points, const RNScalar *weights = NULL); 15 | R2Diad R2PrincipleAxes(const R2Point& centroid, const RNArray& points, const RNScalar *weights = NULL, RNScalar *variances = NULL); 16 | RNLength R2AverageDistance(const R2Point& center, const RNArray& points, const RNScalar *weights = NULL); 17 | R2Affine R2NormalizationTransformation(const RNArray& points, 18 | RNBoolean align_center = TRUE, RNBoolean align_rotation = TRUE, int align_scale = 1); 19 | RNScalar R2AlignError(const RNArray& points1, const RNArray& points2, 20 | const R3Matrix& matrix = R3identity_matrix, const RNScalar* weights = NULL); 21 | R3Matrix R2AlignPoints(const RNArray& points1, const RNArray& points2, const RNScalar* weights = NULL, 22 | RNBoolean align_center = TRUE, RNBoolean align_rotation = TRUE, int align_scale = 1); 23 | 24 | 25 | 26 | // Functions to align C array of points 27 | 28 | R2Point R2Centroid(int npoints, R2Point *points, const RNScalar *weights = NULL); 29 | R2Diad R2PrincipleAxes(const R2Point& centroid, int npoints, R2Point *points, const RNScalar *weights = NULL, RNScalar *variances = NULL); 30 | RNLength R2AverageDistance(const R2Point& center, int npoints, R2Point *points, const RNScalar *weights = NULL); 31 | R2Affine R2NormalizationTransformation(int npoints, R2Point *points, 32 | RNBoolean align_center = TRUE, RNBoolean align_rotation = TRUE, int align_scale = 1); 33 | RNScalar R2AlignError(int npoints, R2Point *points1, R2Point *points2, 34 | const R3Matrix& matrix = R3identity_matrix, RNScalar* weights = NULL); 35 | R3Matrix R2AlignPoints(int npoints, R2Point *points1, R2Point *points2, const RNScalar* weights = NULL, 36 | RNBoolean align_center = TRUE, RNBoolean align_rotation = TRUE, int align_scale = 1); 37 | 38 | 39 | 40 | // End namespace 41 | } 42 | 43 | 44 | // End include guard 45 | #endif 46 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/R3Shapes/R3Xform.h: -------------------------------------------------------------------------------- 1 | /* Include file for the R3 transformation class */ 2 | #ifndef __R3__TRANSFORMATION__H__ 3 | #define __R3__TRANSFORMATION__H__ 4 | 5 | 6 | 7 | /* Begin namespace */ 8 | namespace gaps { 9 | 10 | 11 | 12 | /* Initialization functions */ 13 | 14 | int R3InitTransformation(); 15 | void R3StopTransformation(); 16 | 17 | 18 | 19 | /* Class definition */ 20 | 21 | class R3Transformation /* : public R3Base */ { 22 | public: 23 | // Destructor function 24 | virtual ~R3Transformation(void); 25 | 26 | // Property functions/operators 27 | virtual const RNBoolean IsIdentity(void) const; 28 | virtual const RNBoolean IsMirrored(void) const; 29 | virtual const RNBoolean IsLinear(void) const; 30 | virtual const RNBoolean IsAffine(void) const; 31 | virtual const RNBoolean IsIsotropic(void) const; 32 | 33 | // Application functions/operators 34 | virtual void Apply(R3Vector& vector) const = 0; 35 | virtual void Apply(R3Point& point) const = 0; 36 | virtual void Apply(R3Transformation& transformation) const = 0; 37 | virtual void Apply(R3Affine& affine) const = 0; 38 | virtual void ApplyInverse(R3Vector& vector) const = 0; 39 | virtual void ApplyInverse(R3Point& point) const = 0; 40 | virtual void ApplyInverse(R3Transformation& transformation) const = 0; 41 | virtual void ApplyInverse(R3Affine& affine) const = 0; 42 | virtual void ApplyInverseTranspose(R3Vector& vector) const = 0; 43 | virtual void ApplyTranspose(R3Vector& vector) const = 0; 44 | 45 | // Manipulation functions/operators 46 | virtual void Reset(const R3Transformation& transformation) = 0; 47 | virtual void Transform(const R3Transformation& transformation) = 0; 48 | virtual void InverseTransform(const R3Transformation& transformation) = 0; 49 | 50 | // Draw functions/operators 51 | virtual void Load(void) const = 0; 52 | virtual void Draw(void) const = 0; 53 | virtual void Push(void) const = 0; 54 | virtual void Pop(void) const = 0; 55 | 56 | // Do not use these ??? 57 | virtual const RNScalar ScaleFactor(void) const; 58 | }; 59 | 60 | 61 | 62 | // End namespace 63 | } 64 | 65 | 66 | // End include guard 67 | #endif 68 | -------------------------------------------------------------------------------- /external/pyTorchChamferDistance/build/build.ninja: -------------------------------------------------------------------------------- 1 | ninja_required_version = 1.3 2 | cxx = c++ 3 | nvcc = /usr/local/cuda/bin/nvcc 4 | 5 | cflags = -DTORCH_EXTENSION_NAME=build -DTORCH_API_INCLUDE_EXTENSION_H -isystem /home/ynie1/Software/miniconda3/envs/Total3D/lib/python3.6/site-packages/torch/include -isystem /home/ynie1/Software/miniconda3/envs/Total3D/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -isystem /home/ynie1/Software/miniconda3/envs/Total3D/lib/python3.6/site-packages/torch/include/TH -isystem /home/ynie1/Software/miniconda3/envs/Total3D/lib/python3.6/site-packages/torch/include/THC -isystem /usr/local/cuda/include -isystem /home/ynie1/Software/miniconda3/envs/Total3D/include/python3.6m -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -std=c++11 6 | cuda_flags = -DTORCH_EXTENSION_NAME=build -DTORCH_API_INCLUDE_EXTENSION_H -isystem /home/ynie1/Software/miniconda3/envs/Total3D/lib/python3.6/site-packages/torch/include -isystem /home/ynie1/Software/miniconda3/envs/Total3D/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -isystem /home/ynie1/Software/miniconda3/envs/Total3D/lib/python3.6/site-packages/torch/include/TH -isystem /home/ynie1/Software/miniconda3/envs/Total3D/lib/python3.6/site-packages/torch/include/THC -isystem /usr/local/cuda/include -isystem /home/ynie1/Software/miniconda3/envs/Total3D/include/python3.6m -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' -std=c++11 7 | ldflags = -shared -L/usr/local/cuda/lib64 -lcudart 8 | 9 | rule compile 10 | command = $cxx -MMD -MF $out.d $cflags -c $in -o $out 11 | depfile = $out.d 12 | deps = gcc 13 | 14 | rule cuda_compile 15 | command = $nvcc $cuda_flags -c $in -o $out 16 | 17 | rule link 18 | command = $cxx $in $ldflags -o $out 19 | 20 | build chamfer_distance.o: compile /home/ynie1/Projects/Total3DUnderstanding/external/pyTorchChamferDistance/chamfer_distance/chamfer_distance.cpp 21 | build chamfer_distance.cuda.o: cuda_compile /home/ynie1/Projects/Total3DUnderstanding/external/pyTorchChamferDistance/chamfer_distance/chamfer_distance.cu 22 | 23 | build build.so: link chamfer_distance.o chamfer_distance.cuda.o 24 | 25 | default build.so 26 | 27 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/fglut/freeglut_videoresize.c: -------------------------------------------------------------------------------- 1 | /* 2 | * freeglut_videoresize.c 3 | * 4 | * Video resize functions (as defined by GLUT API) 5 | * 6 | * Copyright (c) 1999-2000 Pawel W. Olszta. All Rights Reserved. 7 | * Written by Pawel W. Olszta, 8 | * Creation date: Thu Dec 16 1999 9 | * 10 | * Permission is hereby granted, free of charge, to any person obtaining a 11 | * copy of this software and associated documentation files (the "Software"), 12 | * to deal in the Software without restriction, including without limitation 13 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 14 | * and/or sell copies of the Software, and to permit persons to whom the 15 | * Software is furnished to do so, subject to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be included 18 | * in all copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 21 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 23 | * PAWEL W. OLSZTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 24 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 26 | */ 27 | 28 | #include "freeglut.h" 29 | #include "freeglut_internal.h" 30 | 31 | /* 32 | * NOTE: functions declared in this file probably will not be implemented. 33 | */ 34 | 35 | /* -- INTERFACE FUNCTIONS -------------------------------------------------- */ 36 | 37 | int FGAPIENTRY glutVideoResizeGet( GLenum eWhat ) { return( 0x00 ); } 38 | void FGAPIENTRY glutSetupVideoResizing( void ) { /* Not implemented */ } 39 | void FGAPIENTRY glutStopVideoResizing( void ) { /* Not implemented */ } 40 | void FGAPIENTRY glutVideoResize( int x, int y, int w, int h ) { /* Not implemented */ } 41 | void FGAPIENTRY glutVideoPan( int x, int y, int w, int h ) { /* Not implemented */ } 42 | 43 | /*** END OF FILE ***/ 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /external/pyTorchChamferDistance/chamfer_distance/chamfer_distance.py: -------------------------------------------------------------------------------- 1 | 2 | import torch 3 | 4 | from torch.utils.cpp_extension import load 5 | cd = load(name="build", 6 | sources=["external/pyTorchChamferDistance/chamfer_distance/chamfer_distance.cpp", 7 | "external/pyTorchChamferDistance/chamfer_distance/chamfer_distance.cu"], 8 | build_directory="external/pyTorchChamferDistance/build") 9 | 10 | class ChamferDistanceFunction(torch.autograd.Function): 11 | @staticmethod 12 | def forward(ctx, xyz1, xyz2): 13 | batchsize, n, _ = xyz1.size() 14 | _, m, _ = xyz2.size() 15 | xyz1 = xyz1.contiguous() 16 | xyz2 = xyz2.contiguous() 17 | dist1 = torch.zeros(batchsize, n) 18 | dist2 = torch.zeros(batchsize, m) 19 | 20 | idx1 = torch.zeros(batchsize, n, dtype=torch.int) 21 | idx2 = torch.zeros(batchsize, m, dtype=torch.int) 22 | 23 | if not xyz1.is_cuda: 24 | cd.forward(xyz1, xyz2, dist1, dist2, idx1, idx2) 25 | else: 26 | dist1 = dist1.cuda() 27 | dist2 = dist2.cuda() 28 | idx1 = idx1.cuda() 29 | idx2 = idx2.cuda() 30 | cd.forward_cuda(xyz1, xyz2, dist1, dist2, idx1, idx2) 31 | 32 | ctx.save_for_backward(xyz1, xyz2, idx1, idx2) 33 | 34 | return dist1, dist2, idx1, idx2 35 | 36 | @staticmethod 37 | def backward(ctx, graddist1, graddist2, *args): 38 | xyz1, xyz2, idx1, idx2 = ctx.saved_tensors 39 | 40 | graddist1 = graddist1.contiguous() 41 | graddist2 = graddist2.contiguous() 42 | 43 | gradxyz1 = torch.zeros(xyz1.size()) 44 | gradxyz2 = torch.zeros(xyz2.size()) 45 | 46 | if not graddist1.is_cuda: 47 | cd.backward(xyz1, xyz2, gradxyz1, gradxyz2, graddist1, graddist2, idx1, idx2) 48 | else: 49 | gradxyz1 = gradxyz1.cuda() 50 | gradxyz2 = gradxyz2.cuda() 51 | cd.backward_cuda(xyz1, xyz2, gradxyz1, gradxyz2, graddist1, graddist2, idx1, idx2) 52 | 53 | return gradxyz1, gradxyz2 54 | 55 | 56 | class ChamferDistance(torch.nn.Module): 57 | def forward(self, xyz1, xyz2): 58 | return ChamferDistanceFunction.apply(xyz1, xyz2) 59 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/png/uncompr.c: -------------------------------------------------------------------------------- 1 | /* uncompr.c -- decompress a memory buffer 2 | * Copyright (C) 1995-2003, 2010 Jean-loup Gailly. 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* @(#) $Id$ */ 7 | 8 | #define ZLIB_INTERNAL 9 | #include "zlib.h" 10 | 11 | /* =========================================================================== 12 | Decompresses the source buffer into the destination buffer. sourceLen is 13 | the byte length of the source buffer. Upon entry, destLen is the total 14 | size of the destination buffer, which must be large enough to hold the 15 | entire uncompressed data. (The size of the uncompressed data must have 16 | been saved previously by the compressor and transmitted to the decompressor 17 | by some mechanism outside the scope of this compression library.) 18 | Upon exit, destLen is the actual size of the compressed buffer. 19 | 20 | uncompress returns Z_OK if success, Z_MEM_ERROR if there was not 21 | enough memory, Z_BUF_ERROR if there was not enough room in the output 22 | buffer, or Z_DATA_ERROR if the input data was corrupted. 23 | */ 24 | int ZEXPORT uncompress (dest, destLen, source, sourceLen) 25 | Bytef *dest; 26 | uLongf *destLen; 27 | const Bytef *source; 28 | uLong sourceLen; 29 | { 30 | z_stream stream; 31 | int err; 32 | 33 | stream.next_in = (Bytef*)source; 34 | stream.avail_in = (uInt)sourceLen; 35 | /* Check for source > 64K on 16-bit machine: */ 36 | if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR; 37 | 38 | stream.next_out = dest; 39 | stream.avail_out = (uInt)*destLen; 40 | if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR; 41 | 42 | stream.zalloc = (alloc_func)0; 43 | stream.zfree = (free_func)0; 44 | 45 | err = inflateInit(&stream); 46 | if (err != Z_OK) return err; 47 | 48 | err = inflate(&stream, Z_FINISH); 49 | if (err != Z_STREAM_END) { 50 | inflateEnd(&stream); 51 | if (err == Z_NEED_DICT || (err == Z_BUF_ERROR && stream.avail_in == 0)) 52 | return Z_DATA_ERROR; 53 | return err; 54 | } 55 | *destLen = stream.total_out; 56 | 57 | err = inflateEnd(&stream); 58 | return err; 59 | } 60 | -------------------------------------------------------------------------------- /external/ldif/representation/quadrics.py: -------------------------------------------------------------------------------- 1 | import torch 2 | import torch.nn.functional as F 3 | from external.ldif.util import camera_util 4 | 5 | 6 | def sample_quadric_surface(quadric, center, samples): 7 | # Sample the quadric surfaces and the RBFs in world space, and composite them. 8 | # (ldif.representation.quadrics.sample_quadric_surface) 9 | samples = samples - center.unsqueeze(2) 10 | homogeneous_sample_coords = F.pad(samples, [0, 1], "constant", 1) 11 | half_distance = torch.matmul(quadric, homogeneous_sample_coords.transpose(-1, -2)) 12 | half_distance = half_distance.transpose(-1, -2) 13 | algebraic_distance = torch.sum(homogeneous_sample_coords * half_distance, -1, keepdim=True) 14 | return algebraic_distance 15 | 16 | def decode_covariance_roll_pitch_yaw(radius, invert=False): 17 | # Converts 6-D radus vectors to the corresponding covariance matrices. 18 | # (ldif.representation.quadrics.decode_covariance_roll_pitch_yaw 19 | d = 1.0 / (radius[..., :3] + 1e-8) if invert else radius[..., :3] 20 | diag = torch.diag_embed(d) 21 | rotation = camera_util.roll_pitch_yaw_to_rotation_matrices(radius[..., 3:6]) 22 | return torch.matmul(torch.matmul(rotation, diag), rotation.transpose(-1, -2)) 23 | 24 | def sample_cov_bf(center, radius, samples): 25 | # Samples gaussian radial basis functions at specified coordinates. 26 | # (ldif.representation.quadrics.sample_cov_bf) 27 | diff = samples - center.unsqueeze(2) 28 | x, y, z = diff.unbind(-1) 29 | 30 | inv_cov = decode_covariance_roll_pitch_yaw(radius, invert=True) 31 | inv_cov = torch.reshape(inv_cov, [inv_cov.shape[0], -1, 1, 9]) 32 | c00, c01, c02, _, c11, c12, _, _, c22 = inv_cov.unbind(-1) 33 | dist = (x * (c00 * x + c01 * y + c02 * z) 34 | + y * (c01 * x + c11 * y + c12 * z) 35 | + z * (c02 * x + c12 * y + c22 * z)) 36 | dist = torch.exp(-0.5 * dist) 37 | return dist.unsqueeze(-1) 38 | 39 | def compute_shape_element_influences(quadrics, centers, radii, samples): 40 | # compute shape element influences (ldif.representation.quadrics.compute_shape_element_influences) 41 | sampled_quadrics = sample_quadric_surface(quadrics, centers, samples) 42 | sampled_rbfs = sample_cov_bf(centers, radii, samples) 43 | return sampled_quadrics, sampled_rbfs -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/R2Shapes/R2Halfspace.cpp: -------------------------------------------------------------------------------- 1 | /* Source file for the GAPS halfspace class */ 2 | 3 | 4 | 5 | /* Include files */ 6 | 7 | #include "R2Shapes.h" 8 | 9 | 10 | 11 | // Namespace 12 | 13 | namespace gaps { 14 | 15 | 16 | 17 | /* Public variables */ 18 | 19 | const R2Halfspace R2null_halfspace(0.0, 0.0, 0.0); 20 | const R2Halfspace R2posx_halfspace(1.0, 0.0, 0.0); 21 | const R2Halfspace R2posy_halfspace(0.0, 1.0, 0.0); 22 | const R2Halfspace R2negx_halfspace(-1.0, 0.0, 0.0); 23 | const R2Halfspace R2negy_halfspace(0.0, -1.0, 0.0); 24 | 25 | 26 | 27 | /* Public functions */ 28 | 29 | int 30 | R2InitHalfspace() 31 | { 32 | /* Return success */ 33 | return TRUE; 34 | } 35 | 36 | 37 | 38 | void 39 | R2StopHalfspace() 40 | { 41 | } 42 | 43 | 44 | 45 | R2Halfspace:: 46 | R2Halfspace (void) 47 | { 48 | } 49 | 50 | 51 | 52 | R2Halfspace:: 53 | R2Halfspace (const R2Halfspace& halfspace) 54 | : line(halfspace.line) 55 | { 56 | } 57 | 58 | 59 | 60 | R2Halfspace:: 61 | R2Halfspace(RNScalar a, RNScalar b, RNScalar c) 62 | : line(a, b, c) 63 | { 64 | } 65 | 66 | 67 | 68 | R2Halfspace:: 69 | R2Halfspace(const RNScalar a[3]) 70 | : line(a) 71 | { 72 | } 73 | 74 | 75 | 76 | R2Halfspace:: 77 | R2Halfspace(const R2Point& point, const R2Vector& normal) 78 | : line(point, R2Vector(-normal.Y(), normal.X())) 79 | { 80 | } 81 | 82 | 83 | 84 | R2Halfspace:: 85 | R2Halfspace(const R2Point& point1, const R2Point& point2) 86 | : line(point1, point2) 87 | { 88 | } 89 | 90 | 91 | 92 | R2Halfspace:: 93 | R2Halfspace(const R2Line& line, int ) 94 | : line(line) 95 | { 96 | } 97 | 98 | 99 | 100 | void R2Halfspace:: 101 | Mirror (const R2Line& line) 102 | { 103 | // Mirror halfspace with respect to line 104 | this->line.Mirror(line); 105 | } 106 | 107 | 108 | 109 | void R2Halfspace:: 110 | Transform (const R2Transformation& transformation) 111 | { 112 | // Transform halfspace 113 | line.Transform(transformation); 114 | } 115 | 116 | 117 | 118 | void R2Halfspace:: 119 | InverseTransform (const R2Transformation& transformation) 120 | { 121 | // Transform halfspace 122 | line.InverseTransform(transformation); 123 | } 124 | 125 | 126 | 127 | } // namespace gaps 128 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/RNBasics/RNMap.h: -------------------------------------------------------------------------------- 1 | /* Include file for the GAPS map class */ 2 | #ifndef __RN__MAP__H__ 3 | #define __RN__MAP__H__ 4 | 5 | 6 | 7 | /* Begin namespace */ 8 | namespace gaps { 9 | 10 | 11 | 12 | /* Library initialization functions */ 13 | 14 | int RNInitMap(); 15 | void RNStopMap(); 16 | 17 | 18 | 19 | /* Support class */ 20 | 21 | template 22 | struct RNMapComparator { 23 | public: 24 | RNMapComparator(int (*compare_function)(KeyType, KeyType) = NULL) : compare_function(compare_function) {}; 25 | bool operator()(KeyType a, KeyType b) const { 26 | if (compare_function) { return ((*compare_function)(a, b) < 0) ? true: false; } 27 | else { return a < b; } 28 | }; 29 | private: 30 | int (*compare_function)(KeyType, KeyType); 31 | }; 32 | 33 | 34 | 35 | /* Class definition */ 36 | 37 | template 38 | class RNMap { 39 | public: 40 | // Constructor/destructor functions 41 | RNMap(void); 42 | RNMap(int (*compare)(KeyType, KeyType)); 43 | RNMap(const RNMap& map); 44 | ~RNMap(void); 45 | 46 | // Property functions/operations 47 | int NEntries(void) const; 48 | 49 | // Data access functions/operators 50 | RNBoolean Find(KeyType key, ValueType *value = NULL) const; 51 | 52 | // Manipulation functions 53 | void Empty(void); 54 | void Insert(KeyType key, ValueType value); 55 | void Replace(KeyType key, ValueType value); 56 | void Remove(KeyType key); 57 | 58 | // Manipulation operators 59 | RNMap& operator=(const RNMap& map); 60 | 61 | public: 62 | std::map > *m; 63 | }; 64 | 65 | 66 | 67 | /* A useful derived class definition */ 68 | 69 | template 70 | class RNSymbolTable : public RNMap { 71 | public: 72 | // Constructor/destructor functions 73 | RNSymbolTable(void) : RNMap() {}; 74 | }; 75 | 76 | 77 | 78 | // End namespace 79 | } 80 | 81 | 82 | /* Templated member functions */ 83 | 84 | #include "RNMap.cpp" 85 | 86 | 87 | 88 | // End include guard 89 | #endif 90 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/fglut/freeglut_overlay.c: -------------------------------------------------------------------------------- 1 | /* 2 | * freeglut_overlay.c 3 | * 4 | * Overlay management functions (as defined by GLUT API) 5 | * 6 | * Copyright (c) 1999-2000 Pawel W. Olszta. All Rights Reserved. 7 | * Written by Pawel W. Olszta, 8 | * Creation date: Thu Dec 16 1999 9 | * 10 | * Permission is hereby granted, free of charge, to any person obtaining a 11 | * copy of this software and associated documentation files (the "Software"), 12 | * to deal in the Software without restriction, including without limitation 13 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 14 | * and/or sell copies of the Software, and to permit persons to whom the 15 | * Software is furnished to do so, subject to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be included 18 | * in all copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 21 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 23 | * PAWEL W. OLSZTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 24 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 26 | */ 27 | 28 | #include "freeglut.h" 29 | #include "freeglut_internal.h" 30 | 31 | /* 32 | * NOTE: functions declared in this file probably will not be implemented. 33 | */ 34 | 35 | /* -- INTERFACE FUNCTIONS -------------------------------------------------- */ 36 | 37 | void FGAPIENTRY glutEstablishOverlay( void ) { /* Not implemented */ } 38 | void FGAPIENTRY glutRemoveOverlay( void ) { /* Not implemented */ } 39 | void FGAPIENTRY glutUseLayer( GLenum layer ) { /* Not implemented */ } 40 | void FGAPIENTRY glutPostOverlayRedisplay( void ) { /* Not implemented */ } 41 | void FGAPIENTRY glutPostWindowOverlayRedisplay( int ID ) { /* Not implemented */ } 42 | void FGAPIENTRY glutShowOverlay( void ) { /* Not implemented */ } 43 | void FGAPIENTRY glutHideOverlay( void ) { /* Not implemented */ } 44 | 45 | /*** END OF FILE ***/ 46 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/R2Shapes/R2Shapes.h: -------------------------------------------------------------------------------- 1 | /* Include file for R2 shapes module */ 2 | #ifndef __R2__SHAPES__H__ 3 | #define __R2__SHAPES__H__ 4 | 5 | 6 | 7 | /* Dependency include files */ 8 | 9 | #include "RNBasics/RNBasics.h" 10 | 11 | 12 | 13 | /* Class declarations */ 14 | 15 | namespace gaps { 16 | class R2Vector; 17 | class R2Point; 18 | class R2Line; 19 | class R2Ray; 20 | class R2Span; 21 | class R2Halfspace; 22 | class R3Matrix; 23 | class R2Diad; 24 | class R2CoordSystem; 25 | class R2Transformation; 26 | class R2Affine; 27 | class R2Arc; 28 | class R2Polyline; 29 | class R2Box; 30 | class R2Circle; 31 | class R2Polygon; 32 | class R2Grid; 33 | class R2PixelDatabase; 34 | } 35 | 36 | 37 | /* Image include files */ 38 | 39 | #include "R2Image.h" 40 | 41 | 42 | 43 | /* Primitive shape include files */ 44 | 45 | #include "R2Vector.h" 46 | #include "R2Point.h" 47 | #include "R2Line.h" 48 | #include "R2Ray.h" 49 | #include "R2Span.h" 50 | #include "R2Halfspace.h" 51 | 52 | 53 | 54 | /* Transformation include files */ 55 | 56 | #include "R3Matrix.h" 57 | #include "R2Diad.h" 58 | #include "R2Crdsys.h" 59 | #include "R2Xform.h" 60 | #include "R2Affine.h" 61 | 62 | 63 | 64 | /* Abstract shape include file */ 65 | 66 | #include "R2Shape.h" 67 | 68 | 69 | 70 | /* Solid shapes include files */ 71 | 72 | #include "R2Solid.h" 73 | #include "R2Box.h" 74 | #include "R2Circle.h" 75 | #include "R2Polygon.h" 76 | 77 | 78 | 79 | /* Curve shapes include files */ 80 | 81 | #include "R2Curve.h" 82 | #include "R2Arc.h" 83 | #include "R2Polyline.h" 84 | 85 | 86 | 87 | /* Image/grid include files */ 88 | 89 | #include "R2Grid.h" 90 | #include "R2PixelDatabase.h" 91 | 92 | 93 | /* Shape relationship include files */ 94 | 95 | #include "R2Perp.h" 96 | #include "R2Parall.h" 97 | #include "R2Dist.h" 98 | #include "R2Cont.h" 99 | #include "R2Isect.h" 100 | #include "R2Relate.h" 101 | #include "R2Align.h" 102 | 103 | 104 | 105 | /* Closest point search include files */ 106 | 107 | #include "R2Kdtree.h" 108 | 109 | 110 | 111 | /* Shape utility include files */ 112 | 113 | #include "R2Draw.h" 114 | #include "R2Io.h" 115 | 116 | 117 | 118 | /* Initialization functions */ 119 | 120 | namespace gaps { 121 | int R2InitShapes(void); 122 | void R2StopShapes(void); 123 | } 124 | 125 | 126 | 127 | #endif 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/R3Graphics/R3DirectionalLight.h: -------------------------------------------------------------------------------- 1 | /* Include file for the R3 light class */ 2 | #ifndef __R3__DIRECTIONAL__LIGHT__H__ 3 | #define __R3__DIRECTIONAL__LIGHT__H__ 4 | 5 | 6 | 7 | /* Begin namespace */ 8 | namespace gaps { 9 | 10 | 11 | 12 | /* Initialization functions */ 13 | 14 | int R3InitDirectionalLight(); 15 | void R3StopDirectionalLight(); 16 | 17 | 18 | 19 | /* Class definition */ 20 | 21 | class R3DirectionalLight : public R3Light { 22 | public: 23 | // Constructor functions 24 | R3DirectionalLight(void); 25 | R3DirectionalLight(const R3DirectionalLight& light); 26 | R3DirectionalLight(const R3Vector& direction, const RNRgb& color, 27 | RNScalar intensity = 1.0, RNBoolean active = TRUE); 28 | 29 | // Property functions/operators 30 | const R3Vector& Direction(void) const; 31 | 32 | // Manipulation functions/operations 33 | virtual void SetDirection(const R3Vector& direction); 34 | virtual void Transform(const R3Transformation& transformation); 35 | 36 | // Geometry evaluation functions 37 | virtual RNScalar IntensityAtPoint(const R3Point& point) const; 38 | virtual R3Vector DirectionFromPoint(const R3Point& point) const; 39 | virtual RNScalar RadiusOfInfluence(RNScalar intensity) const; 40 | virtual R3Sphere SphereOfInfluence(RNScalar intensity) const; 41 | 42 | // Reflection evaluation functions 43 | virtual RNRgb Reflection(const R3Brdf& brdf, const R3Point& eye, 44 | const R3Point& point, const R3Vector& normal) const; 45 | virtual RNRgb DiffuseReflection(const R3Brdf& brdf, 46 | const R3Point& point, const R3Vector& normal) const; 47 | virtual RNRgb SpecularReflection(const R3Brdf& brdf, const R3Point& eye, 48 | const R3Point& point, const R3Vector& normal) const; 49 | 50 | // Draw functions/operations 51 | virtual void Draw(int i) const; 52 | 53 | // Class type definitions 54 | RN_CLASS_TYPE_DECLARATIONS(R3DirectionalLight); 55 | 56 | private: 57 | R3Vector direction; 58 | }; 59 | 60 | 61 | 62 | /* Public variables */ 63 | 64 | extern R3DirectionalLight R3null_directional_light; 65 | extern R3DirectionalLight R3default_directional_light; 66 | 67 | 68 | 69 | /* Inline functions */ 70 | 71 | inline const R3Vector& R3DirectionalLight:: 72 | Direction(void) const 73 | { 74 | // Return direction 75 | return direction; 76 | } 77 | 78 | 79 | 80 | // End namespace 81 | } 82 | 83 | 84 | // End include guard 85 | #endif 86 | -------------------------------------------------------------------------------- /external/ldif/gaps/docs/headers/RNBasics.header: -------------------------------------------------------------------------------- 1 |

Description:

2 | 3 | The RNBasics package supports simple data types (RNScalar, RNInterval, 4 | RNArray, RNQueue, RNHeap) and support several OS-dependent functions 5 | (RNTime, RNMem, RNError). 6 | 7 | The RNArray, RNQueue, and RNHeap classes are implemented as templates 8 | that store collections of a specified data type (like STL classes). 9 | The storage allocation for these containers is dynamic -- it expands 10 | and contracts as entries are inserted and removed. Once a container 11 | has been constructed, entries and the data stored in them can be 12 | accessed, rearranged, or modified via member functions or iteration 13 | macros. For example, an array of three strings could be constructed 14 | and manipulated as follows: 15 | 16 |
17 |     // Construct the array
18 |     RNArray<char *> array;   // Creates an empty array
19 |     array.Insert("String1");       // Insert the 1st string
20 |     array.Insert("String2");       // Insert the 2nd string
21 |     array.Insert("String3");       // Insert the 3rd string
22 | 
23 |     // Access entries
24 |     char *data;
25 |     data = array.Head();           // data == "String1"
26 |     data = array.Tail();           // data == "String3"
27 |     data = array.Kth(0);           // data == "String1"
28 |     data = array.Kth(1);           // data == "String2"
29 |     data = array[1];               // data == "String2"
30 | 
31 |     // Access all entries
32 |     for (int i = 0; i < array.NEntries(); i++) {
33 |       char *data = array[i]
34 |       printf("%s/n", data);       
35 |     }
36 | 
37 |     // Manipulate the array
38 |     array.Reverse();               // Reverse the order of entries
39 |     array.RemoveKth(1);            // Remove the 2nd entry (first entry is at index 0)
40 |     array.InsertKth("String2", 1); // Re-insert string in 2nd entry
41 | 
42 |

43 | 44 | Other support functions include: 45 | 46 |

53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/R2Shapes/R2Perp.cpp: -------------------------------------------------------------------------------- 1 | /* Source file for GAPS perpendicular utility */ 2 | 3 | 4 | 5 | /* Include files */ 6 | 7 | #include "R2Shapes.h" 8 | 9 | 10 | 11 | // Namespace 12 | 13 | namespace gaps { 14 | 15 | 16 | 17 | RNBoolean R2Perpendicular(const R2Vector& vector1, const R2Vector& vector2) 18 | { 19 | // Normalized vectors ??? 20 | // Return whether vector1 and vector2 are perpendicular 21 | return RNIsZero(vector1.Dot(vector2)); 22 | } 23 | 24 | 25 | 26 | RNBoolean R2Perpendicular(const R2Vector& vector, const R2Line& line) 27 | { 28 | // Return whether vector and line are perpendicular 29 | return R2Perpendicular(vector, line.Vector()); 30 | } 31 | 32 | 33 | 34 | RNBoolean R2Perpendicular(const R2Vector& vector, const R2Ray& ray) 35 | { 36 | // Return whether vector and ray are perpendicular 37 | return R2Perpendicular(vector, ray.Vector()); 38 | } 39 | 40 | 41 | 42 | RNBoolean R2Perpendicular(const R2Vector& vector, const R2Span& span) 43 | { 44 | // Return whether vector and span are perpendicular 45 | return R2Perpendicular(vector, span.Vector()); 46 | } 47 | 48 | 49 | 50 | RNBoolean R2Perpendicular(const R2Line& line1, const R2Line& line2) 51 | { 52 | // Return whether line1 and line2 are perpendicular 53 | return R2Perpendicular(line1.Vector(), line2.Vector()); 54 | } 55 | 56 | 57 | 58 | RNBoolean R2Perpendicular(const R2Line& line, const R2Ray& ray) 59 | { 60 | // Return whether line and ray are perpendicular 61 | return R2Perpendicular(line.Vector(), ray.Vector()); 62 | } 63 | 64 | 65 | 66 | RNBoolean R2Perpendicular(const R2Line& line, const R2Span& span) 67 | { 68 | // Return whether line and span are perpendicular 69 | return R2Perpendicular(line.Vector(), span.Vector()); 70 | } 71 | 72 | 73 | 74 | RNBoolean R2Perpendicular(const R2Ray& ray1, const R2Ray& ray2) 75 | { 76 | // Return whether ray1 and ray2 are perpendicular 77 | return R2Perpendicular(ray1.Vector(), ray2.Vector()); 78 | } 79 | 80 | 81 | 82 | RNBoolean R2Perpendicular(const R2Ray& ray, const R2Span& span) 83 | { 84 | // Return whether ray and span are perpendicular 85 | return R2Perpendicular(ray.Vector(), span.Vector()); 86 | } 87 | 88 | 89 | 90 | RNBoolean R2Perpendicular(const R2Span& span1, const R2Span& span2) 91 | { 92 | // Return whether span1 and span2 are perpendicular 93 | return R2Perpendicular(span1.Vector(), span2.Vector()); 94 | } 95 | 96 | 97 | 98 | } // namespace gaps 99 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/R3Graphics/R3SpotLight.h: -------------------------------------------------------------------------------- 1 | /* Include file for the R3 light class */ 2 | #ifndef __R3__SPOT__LIGHT__H__ 3 | #define __R3__SPOT__LIGHT__H__ 4 | 5 | 6 | 7 | /* Begin namespace */ 8 | namespace gaps { 9 | 10 | 11 | 12 | /* Initialization functions */ 13 | 14 | int R3InitSpotLight(); 15 | void R3StopSpotLight(); 16 | 17 | 18 | 19 | /* Class definition */ 20 | 21 | class R3SpotLight : public R3PointLight { 22 | public: 23 | // Constructor functions 24 | R3SpotLight(void); 25 | R3SpotLight(const R3SpotLight& light); 26 | R3SpotLight(const R3Point& position, const R3Vector& direction, 27 | const RNRgb& color, RNScalar dropoffrate = 0.0, RNAngle cutoffangle = 0.785398, 28 | RNScalar intensity = 1.0, RNBoolean active = TRUE, 29 | RNScalar ca = 0, RNScalar la = 0, RNScalar qa = 1); 30 | 31 | // Property functions/operators 32 | const R3Vector& Direction(void) const; 33 | const RNScalar DropOffRate(void) const; 34 | const RNAngle CutOffAngle(void) const; 35 | 36 | // Manipulation functions/operations 37 | virtual void SetDirection(const R3Vector& direction); 38 | virtual void SetDropOffRate(RNScalar dropoffrate); 39 | virtual void SetCutOffAngle(RNAngle cutoffangle); 40 | virtual void Transform(const R3Transformation& transformation); 41 | 42 | // Evaluation functions 43 | virtual RNScalar IntensityAtPoint(const R3Point& point) const; 44 | 45 | // Draw functions/operations 46 | virtual void Draw(int i) const; 47 | 48 | // Class type definitions 49 | RN_CLASS_TYPE_DECLARATIONS(R3SpotLight); 50 | 51 | private: 52 | R3Vector direction; 53 | RNScalar dropoffrate; 54 | RNAngle cutoffangle; 55 | }; 56 | 57 | 58 | 59 | /* Public variables */ 60 | 61 | extern R3SpotLight R3null_spot_light; 62 | 63 | 64 | 65 | /* Inline functions */ 66 | 67 | inline const R3Vector& R3SpotLight:: 68 | Direction(void) const 69 | { 70 | // Return direction 71 | return direction; 72 | } 73 | 74 | 75 | 76 | inline const RNScalar R3SpotLight:: 77 | DropOffRate(void) const 78 | { 79 | // Return drop off rate 80 | return dropoffrate; 81 | } 82 | 83 | 84 | 85 | inline const RNAngle R3SpotLight:: 86 | CutOffAngle(void) const 87 | { 88 | // Return cut off angle 89 | return cutoffangle; 90 | } 91 | 92 | 93 | 94 | // End namespace 95 | } 96 | 97 | 98 | // End include guard 99 | #endif 100 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/R3Shapes/R3Ray.cpp: -------------------------------------------------------------------------------- 1 | /* Source file for the GAPS ray class */ 2 | 3 | 4 | 5 | /* Include files */ 6 | 7 | #include "R3Shapes.h" 8 | 9 | 10 | 11 | // Namespace 12 | 13 | namespace gaps { 14 | 15 | 16 | 17 | /* Public variables */ 18 | 19 | const R3Ray R3null_ray(0.0, 0.0, 0.0, 0.0, 0.0, 0.0); 20 | const R3Ray R3posx_ray(0.0, 0.0, 0.0, 1.0, 0.0, 0.0); 21 | const R3Ray R3posy_ray(0.0, 0.0, 0.0, 0.0, 1.0, 0.0); 22 | const R3Ray R3posz_ray(0.0, 0.0, 0.0, 0.0, 0.0, 1.0); 23 | const R3Ray R3negx_ray(0.0, 0.0, 0.0, -1.0, 0.0, 0.0); 24 | const R3Ray R3negy_ray(0.0, 0.0, 0.0, 0.0, -1.0, 0.0); 25 | const R3Ray R3negz_ray(0.0, 0.0, 0.0, 0.0, 0.0, -1.0); 26 | 27 | 28 | 29 | /* Public functions */ 30 | 31 | int R3InitRay() 32 | { 33 | /* Return success */ 34 | return TRUE; 35 | } 36 | 37 | 38 | 39 | void R3StopRay() 40 | { 41 | } 42 | 43 | 44 | 45 | R3Ray:: 46 | R3Ray(void) 47 | { 48 | } 49 | 50 | 51 | 52 | R3Ray:: 53 | R3Ray(const R3Ray& ray) 54 | : line(ray.line) 55 | { 56 | } 57 | 58 | 59 | 60 | R3Ray:: 61 | R3Ray(const R3Point& point, const R3Vector& vector, RNBoolean normalized) 62 | : line(point, vector, normalized) 63 | { 64 | } 65 | 66 | 67 | 68 | R3Ray:: 69 | R3Ray(const R3Point& point1, const R3Point& point2) 70 | : line(point1, point2) 71 | { 72 | } 73 | 74 | 75 | 76 | R3Ray:: 77 | R3Ray(RNCoord x1, RNCoord y1, RNCoord z1, RNCoord x2, RNCoord y2, RNCoord z2) 78 | : line(x1, y1, z1, x2, y2, z2) 79 | { 80 | } 81 | 82 | 83 | 84 | const R3Point R3Ray:: 85 | Point(RNScalar t) const 86 | { 87 | // Return point along span 88 | return (Start() + Vector() * t); 89 | } 90 | 91 | 92 | 93 | const RNScalar R3Ray:: 94 | T(const R3Point& point) const 95 | { 96 | // Return parametric value of closest point on ray 97 | if (IsZero()) return 0.0; 98 | RNScalar denom = Vector().Dot(Vector()); 99 | assert(RNIsNotZero(denom)); 100 | R3Vector topoint = point - Start(); 101 | return (Vector().Dot(topoint) / denom); 102 | } 103 | 104 | 105 | 106 | void R3Ray:: 107 | Transform (const R3Transformation& transformation) 108 | { 109 | // Transform line 110 | line.Transform(transformation); 111 | } 112 | 113 | 114 | 115 | void R3Ray:: 116 | InverseTransform (const R3Transformation& transformation) 117 | { 118 | // Transform line 119 | line.InverseTransform(transformation); 120 | } 121 | 122 | 123 | 124 | } // namespace gaps 125 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/R2Shapes/R2Parall.h: -------------------------------------------------------------------------------- 1 | /* Include file for GAPS parallel utility */ 2 | #ifndef __R2__PARALLEL__H__ 3 | #define __R2__PARALLEL__H__ 4 | 5 | 6 | 7 | /* Begin namespace */ 8 | namespace gaps { 9 | 10 | 11 | 12 | /* Function declarations */ 13 | 14 | RNBoolean R2Parallel(const R2Vector& vector1, const R2Vector& vector2); 15 | RNBoolean R2Parallel(const R2Vector& vector, const R2Line& line); 16 | RNBoolean R2Parallel(const R2Vector& vector, const R2Ray& ray); 17 | RNBoolean R2Parallel(const R2Vector& vector, const R2Span& span); 18 | 19 | RNBoolean R2Parallel(const R2Line& line, const R2Vector& vector); 20 | RNBoolean R2Parallel(const R2Line& line1, const R2Line& line2); 21 | RNBoolean R2Parallel(const R2Line& line, const R2Ray& ray); 22 | RNBoolean R2Parallel(const R2Line& line, const R2Span& span); 23 | 24 | RNBoolean R2Parallel(const R2Ray& ray, const R2Vector& vector); 25 | RNBoolean R2Parallel(const R2Ray& ray, const R2Line& line); 26 | RNBoolean R2Parallel(const R2Ray& ray1, const R2Ray& ray2); 27 | RNBoolean R2Parallel(const R2Ray& ray, const R2Span& span); 28 | 29 | RNBoolean R2Parallel(const R2Span& span, const R2Vector& vector); 30 | RNBoolean R2Parallel(const R2Span& span, const R2Line& line); 31 | RNBoolean R2Parallel(const R2Span& span, const R2Ray& ray); 32 | RNBoolean R2Parallel(const R2Span& span1, const R2Span& span2); 33 | 34 | 35 | 36 | /* Inline functions */ 37 | 38 | inline RNBoolean R2Parallel(const R2Line& line, const R2Vector& vector) 39 | { 40 | // Parallel is commutative 41 | return R2Parallel(vector, line); 42 | } 43 | 44 | 45 | 46 | inline RNBoolean R2Parallel(const R2Ray& ray, const R2Vector& vector) 47 | { 48 | // Parallel is commutative 49 | return R2Parallel(vector, ray); 50 | } 51 | 52 | 53 | 54 | inline RNBoolean R2Parallel(const R2Ray& ray, const R2Line& line) 55 | { 56 | // Parallel is commutative 57 | return R2Parallel(line, ray); 58 | } 59 | 60 | 61 | 62 | inline RNBoolean R2Parallel(const R2Span& span, const R2Vector& vector) 63 | { 64 | // Parallel is commutative 65 | return R2Parallel(vector, span); 66 | } 67 | 68 | 69 | 70 | inline RNBoolean R2Parallel(const R2Span& span, const R2Line& line) 71 | { 72 | // Parallel is commutative 73 | return R2Parallel(line, span); 74 | } 75 | 76 | 77 | 78 | inline RNBoolean R2Parallel(const R2Span& span, const R2Ray& ray) 79 | { 80 | // Parallel is commutative 81 | return R2Parallel(ray, span); 82 | } 83 | 84 | 85 | 86 | // End namespace 87 | } 88 | 89 | 90 | // End include guard 91 | #endif 92 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/RNMath/RNEquation.h: -------------------------------------------------------------------------------- 1 | // Include file for equation class 2 | #ifndef __RN__EQUATION__H__ 3 | #define __RN__EQUATION__H__ 4 | 5 | 6 | 7 | //////////////////////////////////////////////////////////////////////// 8 | // Begin namespace 9 | //////////////////////////////////////////////////////////////////////// 10 | 11 | namespace gaps { 12 | 13 | 14 | 15 | //////////////////////////////////////////////////////////////////////// 16 | // Class definition 17 | //////////////////////////////////////////////////////////////////////// 18 | 19 | class RNEquation : public RNExpression { 20 | public: 21 | // Constructor/destructor 22 | RNEquation(void); 23 | RNEquation(RNPolynomial *polynomial); 24 | RNEquation(RNAlgebraic *algebraic); 25 | RNEquation(RNScalar c, int nv, const int *v = NULL, const RNScalar *e = NULL, RNBoolean already_sorted = FALSE); 26 | RNEquation(int operation, RNAlgebraic *operand1, RNAlgebraic *operand2); 27 | RNEquation(const RNPolynomial& polynomial, int dummy); 28 | RNEquation(const RNExpression& expression, int dummy); 29 | RNEquation(const RNEquation& equation); 30 | virtual ~RNEquation(void); 31 | 32 | // Access functions 33 | RNSystemOfEquations *SystemOfEquations(void) const; 34 | int SystemIndex(void) const; 35 | 36 | // Evaluation functions 37 | RNScalar EvaluateResidual(const RNScalar *x) const; 38 | 39 | private: 40 | friend class RNSystemOfEquations; 41 | RNSystemOfEquations *system; 42 | int system_index; 43 | 44 | public: 45 | // Temporary 46 | RNScalar ResidualThreshold(void) const { return residual_threshold; }; 47 | void SetResidualThreshold(RNScalar threshold) { this->residual_threshold = threshold; }; 48 | RNScalar residual_threshold; 49 | }; 50 | 51 | 52 | 53 | //////////////////////////////////////////////////////////////////////// 54 | // Inline functions 55 | //////////////////////////////////////////////////////////////////////// 56 | 57 | inline RNSystemOfEquations *RNEquation:: 58 | SystemOfEquations(void) const 59 | { 60 | // Return system of equations this equation belongs to 61 | return system; 62 | } 63 | 64 | 65 | 66 | inline int RNEquation:: 67 | SystemIndex(void) const 68 | { 69 | // Return index of this equation in its system of equations 70 | return system_index; 71 | } 72 | 73 | 74 | 75 | inline RNScalar RNEquation:: 76 | EvaluateResidual(const RNScalar *x) const 77 | { 78 | // Evaluate expression 79 | return Evaluate(x); 80 | } 81 | 82 | 83 | 84 | // End namespace 85 | } 86 | 87 | 88 | // End include guard 89 | #endif 90 | -------------------------------------------------------------------------------- /external/ldif/gaps/pkgs/RNBasics/RNType.h: -------------------------------------------------------------------------------- 1 | /* Include file GAPS class type identifier */ 2 | #ifndef __RN__TYPE__H__ 3 | #define __RN__TYPE__H__ 4 | 5 | 6 | 7 | /* Begin namespace */ 8 | namespace gaps { 9 | 10 | 11 | 12 | /* Initialization functions */ 13 | 14 | int RNInitClassType(); 15 | void RNStopClassType(); 16 | 17 | 18 | 19 | /* Type definitions */ 20 | 21 | typedef int RNClassID; 22 | 23 | 24 | 25 | /* Class definition */ 26 | 27 | class RNClassType { 28 | public: 29 | // Constructor functions 30 | RNClassType(RNClassID id, const char *name); 31 | RNClassType(const char *name); 32 | ~RNClassType(void); 33 | 34 | // Property functions 35 | const RNClassID ID(void) const; 36 | const char *Name(void) const; 37 | 38 | private: 39 | RNClassID id; 40 | char *name; 41 | }; 42 | 43 | 44 | 45 | /* Public constants */ 46 | 47 | #define RN_UNKNOWN_CLASS_ID (-1) 48 | #define RN_NULL_CLASS_ID (0) 49 | 50 | 51 | 52 | /* Public variables */ 53 | 54 | extern const RNClassType RNnull_class_type; 55 | 56 | 57 | 58 | /* Useful macros */ 59 | 60 | #define RN_CLASS_TYPE_DECLARATIONS(__class) \ 61 | virtual const RNClassID ClassID(void) const; \ 62 | virtual const char *ClassName(void) const; \ 63 | virtual const RNClassType& ClassType(void) const; \ 64 | static const RNClassID CLASS_ID(void); \ 65 | static const char * CLASS_NAME(void); \ 66 | static const RNClassType& CLASS_TYPE(void) 67 | 68 | #define RN_CLASS_TYPE_DEFINITIONS(__class) \ 69 | const RNClassType __class ## _class_type ( #__class ); \ 70 | const RNClassID __class::ClassID(void) const { return CLASS_ID(); } \ 71 | const char *__class::ClassName(void) const { return CLASS_NAME(); } \ 72 | const RNClassType& __class::ClassType(void) const { return CLASS_TYPE(); } \ 73 | const RNClassID __class::CLASS_ID(void) { return CLASS_TYPE().ID(); } \ 74 | const char * __class::CLASS_NAME(void) { return CLASS_TYPE().Name(); } \ 75 | const RNClassType& __class::CLASS_TYPE(void) { return __class ## _class_type; } 76 | 77 | 78 | 79 | 80 | /* Inline functions */ 81 | 82 | inline const RNClassID RNClassType:: 83 | ID(void) const 84 | { 85 | // Return class id 86 | return id; 87 | } 88 | 89 | 90 | 91 | inline const char *RNClassType:: 92 | Name(void) const 93 | { 94 | // Return class name 95 | return name; 96 | } 97 | 98 | 99 | 100 | // End namespace 101 | } 102 | 103 | 104 | // End include guard 105 | #endif 106 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | pip-wheel-metadata/ 24 | share/python-wheels/ 25 | *.egg-info/ 26 | .installed.cfg 27 | *.egg 28 | MANIFEST 29 | 30 | # PyInstaller 31 | # Usually these files are written by a python script from a template 32 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 33 | *.manifest 34 | *.spec 35 | 36 | # Installer logs 37 | pip-log.txt 38 | pip-delete-this-directory.txt 39 | 40 | # Unit test / coverage reports 41 | htmlcov/ 42 | .tox/ 43 | .nox/ 44 | .coverage 45 | .coverage.* 46 | .cache 47 | nosetests.xml 48 | coverage.xml 49 | *.cover 50 | *.py,cover 51 | .hypothesis/ 52 | .pytest_cache/ 53 | 54 | # Translations 55 | *.mo 56 | *.pot 57 | 58 | # Django stuff: 59 | *.log 60 | local_settings.py 61 | db.sqlite3 62 | db.sqlite3-journal 63 | 64 | # Flask stuff: 65 | instance/ 66 | .webassets-cache 67 | 68 | # Scrapy stuff: 69 | .scrapy 70 | 71 | # Sphinx documentation 72 | docs/_build/ 73 | 74 | # PyBuilder 75 | target/ 76 | 77 | # Jupyter Notebook 78 | .ipynb_checkpoints 79 | 80 | # IPython 81 | profile_default/ 82 | ipython_config.py 83 | 84 | # pyenv 85 | .python-version 86 | 87 | # pipenv 88 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 89 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 90 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 91 | # install all needed dependencies. 92 | #Pipfile.lock 93 | 94 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 95 | __pypackages__/ 96 | 97 | # Celery stuff 98 | celerybeat-schedule 99 | celerybeat.pid 100 | 101 | # SageMath parsed files 102 | *.sage.py 103 | 104 | # Environments 105 | .env 106 | .venv 107 | env/ 108 | venv/ 109 | ENV/ 110 | env.bak/ 111 | venv.bak/ 112 | 113 | # Spyder project settings 114 | .spyderproject 115 | .spyproject 116 | 117 | # Rope project settings 118 | .ropeproject 119 | 120 | # mkdocs documentation 121 | /site 122 | 123 | # mypy 124 | .mypy_cache/ 125 | .dmypy.json 126 | dmypy.json 127 | 128 | # Pyre type checker 129 | .pyre/ 130 | *.pyc 131 | 132 | # mycode 133 | data/ 134 | output/ 135 | .vscode/ 136 | --------------------------------------------------------------------------------