Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
81dd021
Fix a couple of logic errors.
abellgithub May 11, 2017
a771d40
Close #23
abellgithub May 11, 2017
37a7d70
Change char * to void * in PlyFile, eliminating much cashing and alig…
abellgithub May 12, 2017
4f7fab1
Change char * to void * in PlyFile, eliminating alignment
abellgithub May 12, 2017
01741dd
Merge remote-tracking branch 'origin/master'
abellgithub May 15, 2017
b3f0da5
Break SurfaceTrimmer driver off so that algorithm can be used indepen…
abellgithub May 15, 2017
20c25cb
Add necessary header file.
abellgithub May 15, 2017
c3486d9
Actually use templates for polynomial solution and eliminate access a…
abellgithub May 15, 2017
def8b6c
Remove dead includes from SurfaceTrimmer.
abellgithub May 26, 2017
50052d3
Break args out from functionality of PoissonRecon.
abellgithub May 26, 2017
88220a2
Remove unused template argument.
abellgithub May 30, 2017
7627691
Remove unused template argument in SparseNodeData.
abellgithub May 30, 2017
74898dc
Merge remote-tracking branch 'origin/master'
abellgithub May 30, 2017
22b4dc1
Remove unused template arg from DensityEstimator.
abellgithub May 30, 2017
54de11a
Remove debug and single-function implementation.
abellgithub May 30, 2017
4f18dd6
Split PoissonRecon into pieces.
abellgithub May 31, 2017
182a7c0
Remove point input from PoissonRecon.
abellgithub Jun 7, 2017
96ee785
Remove unused inCorePoints.
abellgithub Jun 8, 2017
99636ca
Remove dead code.
abellgithub Jun 8, 2017
73122c8
Provide a more-generic output mechanism.
abellgithub Jun 16, 2017
ad14e9d
Remove dead code.
abellgithub Jun 16, 2017
725d5fd
Lots of casts to make compiler happy.
abellgithub Jul 26, 2017
b6f129d
Solution converted to VS2017
markloyman Aug 17, 2017
088a82d
Fixed compilation errors in Visual Studio 2017
markloyman Aug 17, 2017
a5af1eb
MyMesh thread safety
markloyman Aug 17, 2017
cd81b68
Warning fixes
markloyman Aug 17, 2017
63d19dc
missing reset() in MemoryPointSource
markloyman Aug 17, 2017
7aea5e7
Merge pull request #1 from markloyman/input-output
abellgithub Aug 22, 2017
282b104
Format updates after Mark Loyman's changes.
abellgithub Aug 22, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*.sw*
*.sdf
*.suo
/Obj/
Expand Down
14 changes: 11 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,22 @@ PR_SOURCE=CmdLineParser.cpp Factor.cpp Geometry.cpp MarchingCubes.cpp PlyFile.cp
SR_SOURCE=CmdLineParser.cpp Factor.cpp Geometry.cpp MarchingCubes.cpp PlyFile.cpp SSDRecon.cpp
ST_SOURCE=CmdLineParser.cpp Factor.cpp Geometry.cpp MarchingCubes.cpp PlyFile.cpp SurfaceTrimmer.cpp

CFLAGS += -fopenmp -Wno-deprecated -Wno-write-strings -std=c++11
LFLAGS += -lgomp -lstdc++
CFLAGS += -Wno-deprecated -Wno-write-strings -std=c++11
LFLAGS += -lstdc++

#
# OpenMP
#
ifndef NO_OPENMP
CFLAGS += -fopenmp
LFLAGS += -lgomp
endif

CFLAGS_DEBUG = -DDEBUG -g3
LFLAGS_DEBUG =

CFLAGS_RELEASE = -O3 -DRELEASE -funroll-loops -ffast-math
LFLAGS_RELEASE = -O3
LFLAGS_RELEASE = -O3

SRC = Src/
BIN = Bin/Linux/
Expand Down
14 changes: 7 additions & 7 deletions PoissonRecon.vcxproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
Expand Down Expand Up @@ -30,23 +30,23 @@
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
Expand Down Expand Up @@ -108,7 +108,7 @@
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;NOMINMAX;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
Expand Down Expand Up @@ -157,7 +157,7 @@
</Midl>
<ClCompile>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;NOMINMAX;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
Expand Down
10 changes: 5 additions & 5 deletions SSDRecon.vcxproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
Expand Down Expand Up @@ -30,23 +30,23 @@
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
Expand Down
8 changes: 4 additions & 4 deletions Src/Allocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of
conditions and the following disclaimer. Redistributions in binary form must reproduce
the above copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the distribution.
in the documentation and/or other materials provided with the distribution.

Neither the name of the Johns Hopkins University nor the names of its contributors
may be used to endorse or promote products derived from this software without specific
prior written permission.
prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
Expand Down Expand Up @@ -148,7 +148,7 @@ class Allocator
if( elements>blockSize ) fprintf( stderr , "[ERROR] Allocator: elements bigger than block-size: %d>%d\n" , elements , blockSize ) , exit( 0 );
if( remains<elements )
{
if( index==memory.size()-1 )
if( index==(int)(memory.size()-1))
{
mem = new T[blockSize];
if( !mem ) fprintf( stderr , "[ERROR] Failed to allocate memory\n" ) , exit(0);
Expand Down
10 changes: 6 additions & 4 deletions Src/Array.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of
conditions and the following disclaimer. Redistributions in binary form must reproduce
the above copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the distribution.
in the documentation and/or other materials provided with the distribution.

Neither the name of the Johns Hopkins University nor the names of its contributors
may be used to endorse or promote products derived from this software without specific
prior written permission.
prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
Expand All @@ -29,6 +29,7 @@ DAMAGE.
#ifndef ARRAY_INCLUDED
#define ARRAY_INCLUDED

#include <stdlib.h>
#include <vector>

#ifdef _WIN64
Expand All @@ -51,7 +52,8 @@ void* aligned_malloc( size_t size , size_t align )
// Add align-1 to the start of the address and then zero out at most of the first align-1 bits.
amem = ( char* )( ( (size_t)( ( (char*)amem ) + (align-1) ) ) & ~( align-1 ) );
// Pre-write the actual address
( ( void** ) amem )[-1] = mem;
void **vmem = reinterpret_cast<void **>(amem);
vmem[-1] = mem;
return amem;
}
void aligned_free( void* mem ) { free( ( ( void** )mem )[-1] ); }
Expand Down
21 changes: 10 additions & 11 deletions Src/CmdLineParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of
conditions and the following disclaimer. Redistributions in binary form must reproduce
the above copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the distribution.
in the documentation and/or other materials provided with the distribution.

Neither the name of the Johns Hopkins University nor the names of its contributors
may be used to endorse or promote products derived from this software without specific
prior written permission.
prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
Expand Down Expand Up @@ -162,26 +162,25 @@ void cmdLineStrings::writeValue(char* str)
}


char* GetFileExtension(char* fileName){
std::string GetFileExtension(const std::string& fileName)
{
char* fileNameCopy;
char* ext=NULL;
char* temp;
std::string ext;

fileNameCopy=new char[strlen(fileName)+1];
fileNameCopy=new char[fileName.size() + 1];
assert(fileNameCopy);
strcpy(fileNameCopy,fileName);
strcpy(fileNameCopy,fileName.data());
temp=strtok(fileNameCopy,".");
while(temp!=NULL)
{
if(ext!=NULL){delete[] ext;}
ext=new char[strlen(temp)+1];
assert(ext);
strcpy(ext,temp);
ext = temp;
temp=strtok(NULL,".");
}
delete[] fileNameCopy;
return ext;
}

char* GetLocalFileName(char* fileName){
char* fileNameCopy;
char* name=NULL;
Expand Down
12 changes: 6 additions & 6 deletions Src/CmdLineParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of
conditions and the following disclaimer. Redistributions in binary form must reproduce
the above copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the distribution.
in the documentation and/or other materials provided with the distribution.

Neither the name of the Johns Hopkins University nor the names of its contributors
may be used to endorse or promote products derived from this software without specific
prior written permission.
prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
Expand All @@ -28,9 +28,9 @@ DAMAGE.

#ifndef CMD_LINE_PARSER_INCLUDED
#define CMD_LINE_PARSER_INCLUDED
#include <cstdlib>
#include <string>
#include <stdarg.h>
#include <string.h>


#ifdef WIN32
int strcasecmp(char* c1,char* c2);
Expand Down Expand Up @@ -112,7 +112,7 @@ class cmdLineStringArray : public cmdLineReadable {
// the values of "r" appropriately. Parameters start with "--"
void cmdLineParse(int argc, char **argv,int num,cmdLineReadable** r,int dumpError=1);

char* GetFileExtension(char* fileName);
std::string GetFileExtension(const std::string& fileName);
char* GetLocalFileName(char* fileName);
char** ReadWords(const char* fileName,int& cnt);

Expand Down
10 changes: 5 additions & 5 deletions Src/CmdLineParser.inl
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of
conditions and the following disclaimer. Redistributions in binary form must reproduce
the above copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the distribution.
in the documentation and/or other materials provided with the distribution.

Neither the name of the Johns Hopkins University nor the names of its contributors
may be used to endorse or promote products derived from this software without specific
prior written permission.
prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
Expand Down Expand Up @@ -44,7 +44,7 @@ int cmdLineIntArray<Dim>::read(char** argv,int argc)
{
if(argc>=Dim)
{
for(int i=0;i<Dim;i++) values[i]=atoi(argv[i]);
for(int i=0;i<Dim;i++) values[i]=std::atoi(argv[i]);
set=true;
return Dim;
}
Expand Down Expand Up @@ -79,7 +79,7 @@ int cmdLineFloatArray<Dim>::read(char** argv,int argc)
{
if(argc>=Dim)
{
for(int i=0;i<Dim;i++) values[i]=(float)atof(argv[i]);
for(int i=0;i<Dim;i++) values[i]=(float)std::atof(argv[i]);
set=true;
return Dim;
}
Expand Down
26 changes: 22 additions & 4 deletions Src/Geometry.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of
conditions and the following disclaimer. Redistributions in binary form must reproduce
the above copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the distribution.
in the documentation and/or other materials provided with the distribution.

Neither the name of the Johns Hopkins University nor the names of its contributors
may be used to endorse or promote products derived from this software without specific
prior written permission.
prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
Expand Down Expand Up @@ -78,6 +78,15 @@ struct XForm3x3
}
Real& operator() ( int i , int j ){ return coords[i][j]; }
const Real& operator() ( int i , int j ) const { return coords[i][j]; }
template<class _Real>
operator XForm3x3<_Real>() const
{
XForm3x3<_Real> out;
for( int i=0 ; i<3 ; i++ )
for( int j=0 ; j<3 ; j++ )
out.coords[i][j] = static_cast<_Real>(coords[i][j]);
return out;
}
template< class _Real > Point3D< _Real > operator * ( const Point3D< _Real >& p ) const
{
Point3D< _Real > q;
Expand Down Expand Up @@ -135,6 +144,15 @@ struct XForm4x4
}
return q;
}
template<class _Real>
operator XForm4x4<_Real>() const
{
XForm4x4<_Real> out;
for( int i=0 ; i<4 ; i++ )
for( int j=0 ; j<4 ; j++ )
out.coords[i][j] = static_cast<_Real>(coords[i][j]);
return out;
}
XForm4x4 operator * ( const XForm4x4& m ) const
{
XForm4x4 n;
Expand Down Expand Up @@ -258,7 +276,7 @@ class Triangle{
}
return Area()/d;
}

};
class CoredPointIndex
{
Expand Down
Loading