[brlcad-commits] SF.net SVN: brlcad:[69989] brlcad/trunk

2017-07-24 Thread starseeker--- via brlcad-commits
Revision: 69989
  http://sourceforge.net/p/brlcad/code/69989
Author:   starseeker
Date: 2017-07-24 16:47:23 + (Mon, 24 Jul 2017)
Log Message:
---
Set up to build some form of libbrlcad.  Static build completes, but shared 
isn't happy.  Also need to figure out what to do about src/other requirements 
with respect to bundling these bundling libraries.

Modified Paths:
--
brlcad/trunk/misc/CMake/BRLCAD_Targets.cmake
brlcad/trunk/src/CMakeLists.txt
brlcad/trunk/src/libfft/CMakeLists.txt

Modified: brlcad/trunk/misc/CMake/BRLCAD_Targets.cmake
===
--- brlcad/trunk/misc/CMake/BRLCAD_Targets.cmake2017-07-22 18:36:50 UTC 
(rev 69988)
+++ brlcad/trunk/misc/CMake/BRLCAD_Targets.cmake2017-07-24 16:47:23 UTC 
(rev 69989)
@@ -383,39 +383,32 @@
   GET_FLAGS_AND_DEFINITIONS(${libname} "${libslist}" NO_DLL CFLAGS L_C_FLAGS 
CXXFLAGS L_CXX_FLAGS DEFINES L_GENERAL_DEFINES)
   SET_FLAGS_AND_DEFINITIONS("${srcslist};${L_SHARED_SRCS};${L_STATIC_SRCS}" 
CFLAGS "${L_C_FLAGS}" CXXFLAGS "${L_CXX_FLAGS}" DEFINES "${L_GENERAL_DEFINES}")
 
+  # Local copy of srcslist in case manipulation is needed
+set(lsrcslist ${srcslist})
+
   # If we're going to have a specified subfolder, prepare the appropriate 
string:
   if(L_FOLDER)
 set(SUBFOLDER "/${L_FOLDER}")
   endif(L_FOLDER)
 
-  # Based on the options, define libraries as either stand-alone builds
-  # or dependencies on OBJECT library builds
-  if(NOT USE_OBJECT_LIBS OR L_SHARED_SRCS OR L_STATIC_SRCS)
-if(BUILD_SHARED_LIBS OR L_SHARED)
-  add_library(${libname} SHARED ${srcslist} ${L_SHARED_SRCS})
-  GET_FLAGS_AND_DEFINITIONS(${libname} "${libslist}" ONLY_DLL DEFINES 
L_DLL_DEFINES)
-  foreach(dll_define ${L_DLL_DEFINES})
-   set_property(TARGET ${libname} APPEND PROPERTY COMPILE_DEFINITIONS 
"${dll_define}")
-  endforeach(dll_define ${L_DLL_DEFINES})
-endif(BUILD_SHARED_LIBS OR L_SHARED)
-if(BUILD_STATIC_LIBS OR L_STATIC)
-  add_library(${libname}-static STATIC ${srcslist} ${L_STATIC_SRCS})
-endif(BUILD_STATIC_LIBS OR L_STATIC)
-  else(NOT USE_OBJECT_LIBS OR L_SHARED_SRCS OR L_STATIC_SRCS)
-add_library(${libname}-obj OBJECT ${srcslist})
+  # If we need it, set up the OBJECT library build
+  if(USE_OBJECT_LIBS)
+add_library(${libname}-obj OBJECT ${lsrcslist})
+set(lsrcslist $)
 set_target_properties(${libname}-obj PROPERTIES FOLDER "BRL-CAD OBJECT 
Libraries${SUBFOLDER}")
-if(BUILD_SHARED_LIBS OR L_SHARED)
-  add_library(${libname} SHARED $)
-  GET_FLAGS_AND_DEFINITIONS(${libname} "${libslist}" ONLY_DLL DEFINES 
L_DLL_DEFINES)
-  foreach(dll_define ${L_DLL_DEFINES})
-   set_property(TARGET ${libname} APPEND PROPERTY COMPILE_DEFINITIONS 
"${dll_define}")
-  endforeach(dll_define ${L_DLL_DEFINES})
-endif(BUILD_SHARED_LIBS OR L_SHARED)
-if(BUILD_STATIC_LIBS OR L_STATIC)
-  add_library(${libname}-static STATIC $)
-endif(BUILD_STATIC_LIBS OR L_STATIC)
-  endif(NOT USE_OBJECT_LIBS OR L_SHARED_SRCS OR L_STATIC_SRCS)
+  endif(USE_OBJECT_LIBS)
 
+  if(BUILD_SHARED_LIBS)
+add_library(${libname} SHARED ${lsrcslist}  ${L_SHARED_SRCS})
+GET_FLAGS_AND_DEFINITIONS(${libname} "${libslist}" ONLY_DLL DEFINES 
L_DLL_DEFINES)
+foreach(dll_define ${L_DLL_DEFINES})
+  set_property(TARGET ${libname} APPEND PROPERTY COMPILE_DEFINITIONS 
"${dll_define}")
+endforeach(dll_define ${L_DLL_DEFINES})
+  endif(BUILD_SHARED_LIBS)
+  if(BUILD_STATIC_LIBS)
+add_library(${libname}-static STATIC ${lsrcslist} ${L_STATIC_SRCS})
+  endif(BUILD_STATIC_LIBS)
+
   # Make sure we don't end up with outputs named liblib...
   set(possible_targets ${libname} ${libname}-static)
   foreach(pt ${possible_targets})

Modified: brlcad/trunk/src/CMakeLists.txt
===
--- brlcad/trunk/src/CMakeLists.txt 2017-07-22 18:36:50 UTC (rev 69988)
+++ brlcad/trunk/src/CMakeLists.txt 2017-07-24 16:47:23 UTC (rev 69989)
@@ -66,7 +66,7 @@
 # Level 3 directories contain BRL-CAD's executables.  Setting
 # the BRLCAD_ENABLE_TARGETS level to 3 will enable all programs.
 
-# FIXME: Ideally these should all be in the above list,
+# FIXME: Ideally these should all be in the below list,
 # need to fix them on Windows.
 if(NOT WIN32)
   set(non_win32_dirs remrt rttherm)
@@ -147,22 +147,27 @@
   endforeach(subdir ${level_${current_level}_dirs})
 endwhile(${current_level} LESS ${HIGHEST_TARGET_LEVEL})
 
-# This corresponds roughly to the libbrlcad definition in
-# the autotools build.  It needs CMake 2.8.8 plus changes
-# to the BRLCAD_ADDLIB macro to define OBJECT add_library
-# targets, and is commented out for now, but this is the
-# starting point for a "proper" libbrlcad
-#if(${HIGHEST_TARGET_LEVEL} GREATER 1)
-#  add_library(libbrlcad STATIC
-#$
-#$
-#$
-#$
-#$
-#$
-#)
-#  target_link_libraries(libbrlcad ${

[brlcad-commits] SF.net SVN: brlcad:[69990] brlcad/trunk/src

2017-07-24 Thread starseeker--- via brlcad-commits
Revision: 69990
  http://sourceforge.net/p/brlcad/code/69990
Author:   starseeker
Date: 2017-07-24 18:34:19 + (Mon, 24 Jul 2017)
Log Message:
---
rename invert in a few files to avoid conflicts

Modified Paths:
--
brlcad/trunk/src/libgcv/bottess.c
brlcad/trunk/src/libicv/rot.c

Modified: brlcad/trunk/src/libgcv/bottess.c
===
--- brlcad/trunk/src/libgcv/bottess.c   2017-07-24 16:47:23 UTC (rev 69989)
+++ brlcad/trunk/src/libgcv/bottess.c   2017-07-24 18:34:19 UTC (rev 69990)
@@ -301,7 +301,7 @@
 
 
 union tree *
-invert(union tree *tree)
+_tree_invert(union tree *tree)
 {
 struct soup_s *s;
 unsigned long int i;
@@ -468,7 +468,7 @@
case OP_INTERSECT:
return compose(tr->tr_b.tb_left, tr->tr_b.tb_right, INSIDE, SAME, 
INSIDE);
case OP_SUBTRACT:
-   return invert(compose(tr->tr_b.tb_left, invert(tr->tr_b.tb_right), 
OUTSIDE, OPPOSITE, INSIDE));
+   return _tree_invert(compose(tr->tr_b.tb_left, 
_tree_invert(tr->tr_b.tb_right), OUTSIDE, OPPOSITE, INSIDE));
default:
bu_bomb("bottess evaluate(): bad op (second pass, CSG)\n");
 }

Modified: brlcad/trunk/src/libicv/rot.c
===
--- brlcad/trunk/src/libicv/rot.c   2017-07-24 16:47:23 UTC (rev 69989)
+++ brlcad/trunk/src/libicv/rot.c   2017-07-24 18:34:19 UTC (rev 69990)
@@ -49,6 +49,7 @@
 #include "bu/malloc.h"
 #include "bn.h"
 
+/* TODO: Yuck... why are we using globals for all this?? */
 
 ssize_t buflines, scanbytes;
 ssize_t firsty = -1;   /* first "y" scanline in buffer */
@@ -59,7 +60,7 @@
 ssize_t nxin = 512;
 ssize_t nyin = 512;
 ssize_t yin, xout, yout;
-int plus90, minus90, reverse, invert;
+int plus90, minus90, reverse, rot_invert;
 size_t pixbytes = 1;
 
 
@@ -86,7 +87,7 @@
reverse++;
break;
case 'i':
-   invert++;
+   rot_invert++;
break;
case '#':
pixbytes = atoi(bu_optarg);
@@ -397,7 +398,7 @@
}
outplace += buflines*pixbytes;
}
-   } else if (invert) {
+   } else if (rot_invert) {
for (y = lasty+1; (ssize_t)y > firsty; y--) {
yout = (nyin - 1) - y + 1;
outbyte = yout * scanbytes;

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
BRL-CAD Source Commits mailing list
brlcad-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-commits


[brlcad-commits] SF.net SVN: brlcad:[69991] brlcad/trunk/src/other/openNURBS

2017-07-24 Thread brlcad--- via brlcad-commits
Revision: 69991
  http://sourceforge.net/p/brlcad/code/69991
Author:   brlcad
Date: 2017-07-24 18:49:21 + (Mon, 24 Jul 2017)
Log Message:
---
spelling while browsing

Modified Paths:
--
brlcad/trunk/src/other/openNURBS/example_read/example_read.cpp
brlcad/trunk/src/other/openNURBS/opennurbs_planesurface.cpp

Modified: brlcad/trunk/src/other/openNURBS/example_read/example_read.cpp
===
--- brlcad/trunk/src/other/openNURBS/example_read/example_read.cpp  
2017-07-24 18:34:19 UTC (rev 69990)
+++ brlcad/trunk/src/other/openNURBS/example_read/example_read.cpp  
2017-07-24 18:49:21 UTC (rev 69991)
@@ -277,7 +277,7 @@
 return 0;
   }
 
-  // Call once in your application to initialze opennurbs library
+  // Call once in your application to initialize opennurbs library
   ON::Begin();
 
   // default dump is to stdout

Modified: brlcad/trunk/src/other/openNURBS/opennurbs_planesurface.cpp
===
--- brlcad/trunk/src/other/openNURBS/opennurbs_planesurface.cpp 2017-07-24 
18:34:19 UTC (rev 69990)
+++ brlcad/trunk/src/other/openNURBS/opennurbs_planesurface.cpp 2017-07-24 
18:49:21 UTC (rev 69991)
@@ -589,7 +589,7 @@
 const ON_Interval* tdomain  // second parameter sub_domain
 ) const
 {
-  // for planes, global serach is fast and returns same answer as local search
+  // for planes, global search is fast and returns same answer as local search
   return GetClosestPoint(test_point,s,t,0.0,sdomain,tdomain);
 }
 

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
BRL-CAD Source Commits mailing list
brlcad-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-commits


[brlcad-commits] SF.net SVN: brlcad:[69992] brlcad/trunk/CMakeLists.txt

2017-07-24 Thread brlcad--- via brlcad-commits
Revision: 69992
  http://sourceforge.net/p/brlcad/code/69992
Author:   brlcad
Date: 2017-07-24 19:04:01 + (Mon, 24 Jul 2017)
Log Message:
---
missing trailing newline

Modified Paths:
--
brlcad/trunk/CMakeLists.txt

Modified: brlcad/trunk/CMakeLists.txt
===
--- brlcad/trunk/CMakeLists.txt 2017-07-24 18:49:21 UTC (rev 69991)
+++ brlcad/trunk/CMakeLists.txt 2017-07-24 19:04:01 UTC (rev 69992)
@@ -2727,7 +2727,8 @@
   if ((name == 0) || (strlen(name) == 0)) name = \"unknown\";
   printf(\"%s\", name);
   return 0;
-}")
+}
+")
 file(WRITE "${CMAKE_BINARY_DIR}/CMakeTmp/report_username.c" 
"${report_username_src}")
 # Add definition HAVE_UNISTD_H to try_run
 try_run(RU_RESULT RU_COMPILED "${CMAKE_BINARY_DIR}/CMakeTmp"

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
BRL-CAD Source Commits mailing list
brlcad-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-commits


[brlcad-commits] SF.net SVN: brlcad:[69993] brlcad/trunk/src/CMakeLists.txt

2017-07-24 Thread starseeker--- via brlcad-commits
Revision: 69993
  http://sourceforge.net/p/brlcad/code/69993
Author:   starseeker
Date: 2017-07-24 19:44:57 + (Mon, 24 Jul 2017)
Log Message:
---
without multispectral the build works, although the shared library has a lot of 
unresolved symbols... may need to OBJECT-ify some of the src/other builds and 
hook them in...

Modified Paths:
--
brlcad/trunk/src/CMakeLists.txt

Modified: brlcad/trunk/src/CMakeLists.txt
===
--- brlcad/trunk/src/CMakeLists.txt 2017-07-24 19:04:01 UTC (rev 69992)
+++ brlcad/trunk/src/CMakeLists.txt 2017-07-24 19:44:57 UTC (rev 69993)
@@ -155,16 +155,21 @@
 set(wl 1)
 math(EXPR cml "${current_level} + 1")
 while(${wl} LESS ${cml})
-  message("libs: ${level_${wl}_dirs}")
   foreach(llib ${level_${wl}_dirs})
-   if(TARGET ${llib})
+   if(TARGET ${llib} AND NOT "${llib}" STREQUAL "libmultispectral")
  set(libbrlcad_objs ${libbrlcad_objs} $)
-   endif(TARGET ${llib})
+   endif(TARGET ${llib} AND NOT "${llib}" STREQUAL "libmultispectral")
   endforeach(llib ${level_${wl}_dirs})
   math(EXPR wl "${wl} + 1")
 endwhile(${wl} LESS ${cml})
-add_library(libbrlcad-shared-${current_level} SHARED ${libbrlcad_objs})
-add_library(libbrlcad-static-${current_level} STATIC ${libbrlcad_objs})
+if("${current_level}" EQUAL 1)
+  add_library(libbrlcad-core SHARED ${libbrlcad_objs})
+  add_library(libbrlcad-core-static STATIC ${libbrlcad_objs})
+endif("${current_level}" EQUAL 1)
+if("${current_level}" EQUAL 2)
+  add_library(libbrlcad SHARED ${libbrlcad_objs})
+  add_library(libbrlcad-static STATIC ${libbrlcad_objs})
+endif("${current_level}" EQUAL 2)
 math(EXPR current_level "${current_level} + 1")
   endwhile(${current_level} LESS ${HIGHEST_TARGET_LEVEL})
 endif(BRLCAD_BUILD_LIBBRLCAD AND USE_OBJECT_LIBS)

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
BRL-CAD Source Commits mailing list
brlcad-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-commits


[brlcad-commits] SF.net SVN: brlcad:[69994] brlcad/trunk/src/libgcv/plugins/gdal/gdal.cpp

2017-07-24 Thread starseeker--- via brlcad-commits
Revision: 69994
  http://sourceforge.net/p/brlcad/code/69994
Author:   starseeker
Date: 2017-07-24 20:45:54 + (Mon, 24 Jul 2017)
Log Message:
---
Having gotten the OK from Tom to use MIT licensing, start working his code from 
https://github.com/tbrowder/brlcad-usgs-topo-tools into a GCV plugin.

Modified Paths:
--
brlcad/trunk/src/libgcv/plugins/gdal/gdal.cpp

Modified: brlcad/trunk/src/libgcv/plugins/gdal/gdal.cpp
===
--- brlcad/trunk/src/libgcv/plugins/gdal/gdal.cpp   2017-07-24 19:44:57 UTC 
(rev 69993)
+++ brlcad/trunk/src/libgcv/plugins/gdal/gdal.cpp   2017-07-24 20:45:54 UTC 
(rev 69994)
@@ -1,21 +1,27 @@
-/*   G D A L . C P P
+/* G D A L . C P P
  * BRL-CAD
  *
- * Copyright (c) 2017 United States Government as represented by
- * the U.S. Army Research Laboratory.
+ * Copyright (c) 2013 Tom Browder
+ * Copyright (c) 2017 United States Government as represented by the U.S. Army
+ * Research Laboratory.
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
  *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
  *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this file; see the file named COPYING for more
- * information.
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
  */
 /** @file gdal.cpp
  *
@@ -35,13 +41,225 @@
 #include 
 #include 
 
+/* GDAL headers */
 #include 
+#include  // GDALDataset
+#include 
+#include 
 
 #include "raytrace.h"
 #include "gcv/api.h"
 #include "gcv/util.h"
 
+struct gdal_state {
+OGRSpatialReference *sp;
+GDALDataset *dataset;
+bool info;
+bool debug;
+int scalex;
+int scaley;
+int scalez;
+double adfGeoTransform[6];
+int az;
+int el;
+int pixsize;
+};
+
+HIDDEN void
+gdal_state_init(struct gdal_state *gs)
+{
+int i = 0;
+if(!gs) return;
+gs->sp = NULL;
+gs->dataset = NULL;
+gs->info = false;
+gs->debug = false;
+gs->scalex = 1;
+gs->scaley = 1;
+gs->scalez = 1;
+for(i = 0; i < 6; i++) gs->adfGeoTransform[i] = 0.0;
+gs->az = 35;
+gs->el = 35;
+gs->pixsize = 512 * 3;
+}
+
+std::string
+_gdal_get_spaces(const int n)
+{
+std::string s("");
+for (int i = 0; i < n; ++i)s += "  ";
+return s;
+}
+
+void
+_gdal_show_node_and_children(const OGRSpatialReference* sp,
+   const OGR_SRSNode* parent, const char* pname, const int level)
+{
+std::string spaces = _gdal_get_spaces(level);
+int nc = parent->GetChildCount();
+printf("  %s%s [%d children]:\n", spaces.c_str(), pname, nc);
+for (int j = 0; j < nc; ++j) {
+   const char* cname = sp->GetAttrValue(pname, j);
+   // the child may be a  parent
+   const OGR_SRSNode* cnode = sp->GetAttrNode(cname);
+   if (cnode) {
+   _gdal_show_node_and_children(sp, cnode, cname, level+1);
+   } else {
+   bu_log("%d: '%s'\n", j, cname);
+   }
+}
+}
+
+
 HIDDEN int
+get_dataset_info(struct gdal_state *gs)
+{
+// Getting Dataset Information
+// ---
+//
+// As described in the GDAL Data Model, a GDALDataset contains a
+// list of raster bands, all pertaining to the same area, and having
+// the same resolution. It also has metadata, a coordinate system, a
+// georeferencing transform, size of raster and various other
+// information.
+
+// adfGeoTransform[0] /* top left x */
+// adfGeoTransform[1] /* w-e pixel resolution */
+// adfGeoTra