Skip to content

Commit 1945131

Browse files
committed
initial commit
1 parent 7e7439d commit 1945131

21 files changed

+1769
-2
lines changed

LICENSE

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
PotreeConverter
3+
http://potree.org
4+
5+
Copyright (c) 2011-2014, Markus Sch�tz
6+
All rights reserved.
7+
8+
Redistribution and use in source and binary forms, with or without
9+
modification, are permitted provided that the following conditions are met:
10+
11+
1. Redistributions of source code must retain the above copyright notice, this
12+
list of conditions and the following disclaimer.
13+
2. Redistributions in binary form must reproduce the above copyright notice,
14+
this list of conditions and the following disclaimer in the documentation
15+
and/or other materials provided with the distribution.
16+
17+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
21+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24+
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27+
28+
The views and conclusions contained in the software and documentation are those
29+
of the authors and should not be interpreted as representing official policies,
30+
either expressed or implied, of the FreeBSD Project.
31+

Potree.sln

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 2012
4+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xyzrgb2bin", "xyzrgb2bin\xyzrgb2bin.vcxproj", "{7080321E-E05D-4362-B16C-2FB0DEDB676D}"
5+
EndProject
6+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PotreeConverter", "PotreeConverter\PotreeConverter.vcxproj", "{DEAD3B19-F85D-46F3-9935-C8D0EDE0A872}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Mixed Platforms = Debug|Mixed Platforms
11+
Debug|Win32 = Debug|Win32
12+
Debug|x64 = Debug|x64
13+
Release|Mixed Platforms = Release|Mixed Platforms
14+
Release|Win32 = Release|Win32
15+
Release|x64 = Release|x64
16+
EndGlobalSection
17+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
18+
{7080321E-E05D-4362-B16C-2FB0DEDB676D}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
19+
{7080321E-E05D-4362-B16C-2FB0DEDB676D}.Debug|Mixed Platforms.Build.0 = Debug|Win32
20+
{7080321E-E05D-4362-B16C-2FB0DEDB676D}.Debug|Win32.ActiveCfg = Debug|Win32
21+
{7080321E-E05D-4362-B16C-2FB0DEDB676D}.Debug|Win32.Build.0 = Debug|Win32
22+
{7080321E-E05D-4362-B16C-2FB0DEDB676D}.Debug|x64.ActiveCfg = Debug|x64
23+
{7080321E-E05D-4362-B16C-2FB0DEDB676D}.Debug|x64.Build.0 = Debug|x64
24+
{7080321E-E05D-4362-B16C-2FB0DEDB676D}.Release|Mixed Platforms.ActiveCfg = Release|Win32
25+
{7080321E-E05D-4362-B16C-2FB0DEDB676D}.Release|Mixed Platforms.Build.0 = Release|Win32
26+
{7080321E-E05D-4362-B16C-2FB0DEDB676D}.Release|Win32.ActiveCfg = Release|Win32
27+
{7080321E-E05D-4362-B16C-2FB0DEDB676D}.Release|Win32.Build.0 = Release|Win32
28+
{7080321E-E05D-4362-B16C-2FB0DEDB676D}.Release|x64.ActiveCfg = Release|x64
29+
{7080321E-E05D-4362-B16C-2FB0DEDB676D}.Release|x64.Build.0 = Release|x64
30+
{DEAD3B19-F85D-46F3-9935-C8D0EDE0A872}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
31+
{DEAD3B19-F85D-46F3-9935-C8D0EDE0A872}.Debug|Mixed Platforms.Build.0 = Debug|Win32
32+
{DEAD3B19-F85D-46F3-9935-C8D0EDE0A872}.Debug|Win32.ActiveCfg = Debug|Win32
33+
{DEAD3B19-F85D-46F3-9935-C8D0EDE0A872}.Debug|Win32.Build.0 = Debug|Win32
34+
{DEAD3B19-F85D-46F3-9935-C8D0EDE0A872}.Debug|x64.ActiveCfg = Debug|Win32
35+
{DEAD3B19-F85D-46F3-9935-C8D0EDE0A872}.Release|Mixed Platforms.ActiveCfg = Release|Win32
36+
{DEAD3B19-F85D-46F3-9935-C8D0EDE0A872}.Release|Mixed Platforms.Build.0 = Release|Win32
37+
{DEAD3B19-F85D-46F3-9935-C8D0EDE0A872}.Release|Win32.ActiveCfg = Release|Win32
38+
{DEAD3B19-F85D-46F3-9935-C8D0EDE0A872}.Release|Win32.Build.0 = Release|Win32
39+
{DEAD3B19-F85D-46F3-9935-C8D0EDE0A872}.Release|x64.ActiveCfg = Release|Win32
40+
EndGlobalSection
41+
GlobalSection(SolutionProperties) = preSolution
42+
HideSolutionNode = FALSE
43+
EndGlobalSection
44+
EndGlobal
+92
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup Label="ProjectConfigurations">
4+
<ProjectConfiguration Include="Debug|Win32">
5+
<Configuration>Debug</Configuration>
6+
<Platform>Win32</Platform>
7+
</ProjectConfiguration>
8+
<ProjectConfiguration Include="Release|Win32">
9+
<Configuration>Release</Configuration>
10+
<Platform>Win32</Platform>
11+
</ProjectConfiguration>
12+
</ItemGroup>
13+
<PropertyGroup Label="Globals">
14+
<ProjectGuid>{DEAD3B19-F85D-46F3-9935-C8D0EDE0A872}</ProjectGuid>
15+
<RootNamespace>PotreeConverter</RootNamespace>
16+
</PropertyGroup>
17+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
18+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
19+
<ConfigurationType>Application</ConfigurationType>
20+
<UseDebugLibraries>true</UseDebugLibraries>
21+
<PlatformToolset>v110</PlatformToolset>
22+
<CharacterSet>MultiByte</CharacterSet>
23+
</PropertyGroup>
24+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
25+
<ConfigurationType>Application</ConfigurationType>
26+
<UseDebugLibraries>false</UseDebugLibraries>
27+
<PlatformToolset>v110</PlatformToolset>
28+
<WholeProgramOptimization>true</WholeProgramOptimization>
29+
<CharacterSet>MultiByte</CharacterSet>
30+
</PropertyGroup>
31+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
32+
<ImportGroup Label="ExtensionSettings">
33+
</ImportGroup>
34+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
35+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
36+
</ImportGroup>
37+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
38+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
39+
</ImportGroup>
40+
<PropertyGroup Label="UserMacros" />
41+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
42+
<OutDir>bin\$(Configuration)\</OutDir>
43+
<IntDir>obj\$(Configuration)\</IntDir>
44+
</PropertyGroup>
45+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
46+
<OutDir>bin\$(Configuration)\</OutDir>
47+
<IntDir>obj\$(Configuration)\</IntDir>
48+
</PropertyGroup>
49+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
50+
<ClCompile>
51+
<WarningLevel>Level3</WarningLevel>
52+
<Optimization>Disabled</Optimization>
53+
<AdditionalIncludeDirectories>./include</AdditionalIncludeDirectories>
54+
</ClCompile>
55+
<Link>
56+
<GenerateDebugInformation>true</GenerateDebugInformation>
57+
</Link>
58+
</ItemDefinitionGroup>
59+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
60+
<ClCompile>
61+
<WarningLevel>Level3</WarningLevel>
62+
<Optimization>MaxSpeed</Optimization>
63+
<FunctionLevelLinking>true</FunctionLevelLinking>
64+
<IntrinsicFunctions>true</IntrinsicFunctions>
65+
<AdditionalIncludeDirectories>./include</AdditionalIncludeDirectories>
66+
</ClCompile>
67+
<Link>
68+
<GenerateDebugInformation>true</GenerateDebugInformation>
69+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
70+
<OptimizeReferences>true</OptimizeReferences>
71+
</Link>
72+
</ItemDefinitionGroup>
73+
<ItemGroup>
74+
<ClCompile Include="include\PotreeConverter.cpp" />
75+
<ClCompile Include="src\GridCell.cpp" />
76+
<ClCompile Include="src\main.cpp" />
77+
<ClCompile Include="src\SparseGrid.cpp" />
78+
</ItemGroup>
79+
<ItemGroup>
80+
<ClInclude Include="include\AABB.h" />
81+
<ClInclude Include="include\GridCell.h" />
82+
<ClInclude Include="include\GridIndex.h" />
83+
<ClInclude Include="include\Point.h" />
84+
<ClInclude Include="include\PotreeConverter.h" />
85+
<ClInclude Include="include\SparseGrid.h" />
86+
<ClInclude Include="include\stuff.h" />
87+
<ClInclude Include="include\Vector3.h" />
88+
</ItemGroup>
89+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
90+
<ImportGroup Label="ExtensionTargets">
91+
</ImportGroup>
92+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup>
4+
<Filter Include="Source Files">
5+
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
6+
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
7+
</Filter>
8+
<Filter Include="Header Files">
9+
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
10+
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
11+
</Filter>
12+
<Filter Include="Resource Files">
13+
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
14+
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
15+
</Filter>
16+
</ItemGroup>
17+
<ItemGroup>
18+
<ClCompile Include="src\GridCell.cpp">
19+
<Filter>Source Files</Filter>
20+
</ClCompile>
21+
<ClCompile Include="src\main.cpp">
22+
<Filter>Source Files</Filter>
23+
</ClCompile>
24+
<ClCompile Include="src\SparseGrid.cpp">
25+
<Filter>Source Files</Filter>
26+
</ClCompile>
27+
<ClCompile Include="include\PotreeConverter.cpp">
28+
<Filter>Source Files</Filter>
29+
</ClCompile>
30+
</ItemGroup>
31+
<ItemGroup>
32+
<ClInclude Include="include\AABB.h">
33+
<Filter>Header Files</Filter>
34+
</ClInclude>
35+
<ClInclude Include="include\GridCell.h">
36+
<Filter>Header Files</Filter>
37+
</ClInclude>
38+
<ClInclude Include="include\GridIndex.h">
39+
<Filter>Header Files</Filter>
40+
</ClInclude>
41+
<ClInclude Include="include\Point.h">
42+
<Filter>Header Files</Filter>
43+
</ClInclude>
44+
<ClInclude Include="include\SparseGrid.h">
45+
<Filter>Header Files</Filter>
46+
</ClInclude>
47+
<ClInclude Include="include\Vector3.h">
48+
<Filter>Header Files</Filter>
49+
</ClInclude>
50+
<ClInclude Include="include\PotreeConverter.h">
51+
<Filter>Header Files</Filter>
52+
</ClInclude>
53+
<ClInclude Include="include\stuff.h">
54+
<Filter>Header Files</Filter>
55+
</ClInclude>
56+
</ItemGroup>
57+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup />
4+
</Project>

PotreeConverter/include/AABB.h

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
2+
3+
#ifndef AABB_H
4+
#define AABB_H
5+
6+
#include "Vector3.h"
7+
#include "Point.h"
8+
9+
#include <math.h>
10+
#include <algorithm>
11+
12+
using std::min;
13+
using std::max;
14+
using std::endl;
15+
16+
class AABB{
17+
18+
public:
19+
Vector3 min;
20+
Vector3 max;
21+
Vector3 size;
22+
23+
AABB(){
24+
min = Vector3(std::numeric_limits<float>::max());
25+
max = Vector3(-std::numeric_limits<float>::max());
26+
size = Vector3(std::numeric_limits<float>::max());
27+
}
28+
29+
AABB(Vector3 min, Vector3 max){
30+
this->min = min;
31+
this->max = max;
32+
size = max-min;
33+
}
34+
35+
bool isInside(const Point &p){
36+
if(min.x <= p.x && p.x <= max.x){
37+
if(min.y <= p.y && p.y <= max.y){
38+
if(min.z <= p.z && p.z <= max.z){
39+
return true;
40+
}
41+
}
42+
}
43+
44+
return false;
45+
}
46+
47+
friend ostream &operator<<( ostream &output, const AABB &value ){
48+
output << "min: " << value.min << endl;
49+
output << "max: " << value.max << endl;
50+
output << "size: " << value.size << endl;
51+
return output;
52+
}
53+
54+
};
55+
56+
57+
58+
#endif

PotreeConverter/include/GridCell.h

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
2+
#ifndef GRID_CELL_H
3+
#define GRID_CELL_H
4+
5+
#include "Point.h"
6+
#include "GridIndex.h"
7+
8+
#include <math.h>
9+
#include <vector>
10+
11+
using std::min;
12+
using std::max;
13+
using std::vector;
14+
15+
#define MAX_FLOAT std::numeric_limits<float>::max()
16+
17+
class SparseGrid;
18+
19+
20+
class GridCell{
21+
public:
22+
vector<Point> points;
23+
vector<GridCell*> neighbours;
24+
SparseGrid *grid;
25+
26+
GridCell();
27+
28+
GridCell(SparseGrid *grid, GridIndex &index);
29+
30+
float minGap(const Point &p);
31+
32+
void add(Point p);
33+
34+
float minGapAtArea(const Point &p);
35+
};
36+
37+
#endif

PotreeConverter/include/GridIndex.h

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
2+
3+
#ifndef GRID_INDEX_H
4+
#define GRID_INDEX_H
5+
6+
7+
class GridIndex{
8+
public:
9+
int i,j,k;
10+
11+
GridIndex(){
12+
i = 0;
13+
j = 0;
14+
k = 0;
15+
}
16+
17+
GridIndex(int i, int j, int k){
18+
this->i = i;
19+
this->j = j;
20+
this->k = k;
21+
}
22+
23+
bool operator<(const GridIndex& b) const{
24+
if(i < b.i){
25+
return true;
26+
}else if(i == b.i && j < b.j){
27+
return true;
28+
}else if(i == b.i && j == b.j && k < b.k){
29+
return true;
30+
}
31+
32+
return false;
33+
}
34+
35+
friend ostream &operator<<( ostream &output, const GridIndex &value ){
36+
output << "[" << value.i << ", " << value.j << ", " << value.k << "]" ;
37+
return output;
38+
}
39+
40+
};
41+
42+
43+
44+
#endif

0 commit comments

Comments
 (0)