Revision: 41404
          http://brlcad.svn.sourceforge.net/brlcad/?rev=41404&view=rev
Author:   erikgreenwald
Date:     2010-11-19 14:23:10 +0000 (Fri, 19 Nov 2010)

Log Message:
-----------
cleaning up some merge issues

Added Paths:
-----------
    brlcad/branches/bottie/src/proc-db/wavy.c

Removed Paths:
-------------
    brlcad/branches/bottie/m4/OpenGL.m4

Deleted: brlcad/branches/bottie/m4/OpenGL.m4
===================================================================
--- brlcad/branches/bottie/m4/OpenGL.m4 2010-11-18 22:16:33 UTC (rev 41403)
+++ brlcad/branches/bottie/m4/OpenGL.m4 2010-11-19 14:23:10 UTC (rev 41404)
@@ -1,299 +0,0 @@
-# Game/graphics/multimedia oriented m4 package for autoconf/aclocal.
-# 
-# Copyright 2000-2007 Erik Greenwald <[email protected]>
-# 
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
-# 2. 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.
-# This product includes software developed by Erik Greenwald.
-# 
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND
-# ANY 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 REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
-#
-# $Id: OpenGL.m4,v 1.16 2007/11/20 00:12:26 erik Exp $
-#
-# thumbs up to 'famp' at http://famp.sourceforge.net for providing an 
-# example of how this is done.
-#
-# AC_SUBST's both GL_CFLAGS and GL_LIBS, and sets have_GL
-#
-# oct 26, 2000 
-# * Changed CONFIGURE_OPENGL to AM_PATH_OPENGL for consistancy
-# -Erik Greenwald <[email protected]>
-
-#
-# AM_PATH_OPENGL([ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]])
-#
-
-AC_DEFUN([AM_PATH_OPENGL],
-[
-  AC_REQUIRE([AC_PROG_CC])
-  AC_REQUIRE([AC_CANONICAL_TARGET])
-
-dnl I think this should be target for cross compilers, but krissa's busted
-dnl install pukes on that. The things I do for pretty girls *sigh*
-case $target in
-       *-*-cygwin* | *-*-mingw*)
-               ;;
-       *)
-               # X and X-extra not needed for cyggy stuff
-               AC_REQUIRE([AC_PATH_X])
-               AC_REQUIRE([AC_PATH_XTRA])
-               ;;
-esac
-
-  GL_CFLAGS=""
-  GL_LIBS=""
-
-  GLXEXTRALIBSTUFF="-lX11 -lXext -lXt"
-
-  AC_LANG_SAVE
-  AC_LANG_C
-
-  if ! test x"$no_x" = xyes; then
-    GL_CFLAGS="$X_CFLAGS"
-    GL_X_LIBS="$X_PRE_LIBS $X_LIBS $GLXEXTRALIBSTUFF $X_EXTRA_LIBS $LIBM"
-  fi
-
-  AC_ARG_WITH(gl-prefix,    
-    [  --with-gl-prefix=PFX     Prefix where OpenGL is installed],
-    [
-      GL_CFLAGS="-I$withval/include"
-      GL_LIBS="-L$withval/lib"
-    ])
-
-  AC_ARG_WITH(gl-includes,    
-    [  --with-gl-includes=DIR   where the OpenGL includes are installed],
-    [
-      GL_CFLAGS="-I$withval"
-    ])
-
-  AC_ARG_WITH(gl-libraries,    
-    [  --with-gl-libraries=DIR  where the OpenGL libraries are installed],
-    [
-      GL_LIBS="-L$withval"
-    ])
-
-  saved_CFLAGS="$CFLAGS"
-  saved_LIBS="$LIBS"
-  AC_LANG_SAVE
-  AC_LANG_C
-  have_GL=no
-
-  exec 8>&AC_FD_MSG
-dnl  exec AC_FD_MSG>/dev/null
-
-dnl windows is fucking retarded. It can't cope with searchlib because of
-dnl stupid WINGDAPI APIENTRY crap. :( So we punt.
-dnl Also, Mrs Krissa had an issue with -I/usr/X11R6/include showing up on
-dnl her compile line and pharking things up for link phase, so we clear that.
-case "$target" in
-       *-*-cygwin* | *-*-mingw32*)
-               GL_CFLAGS=""
-               GL_LIBS="-lopengl32"
-               have_GL=yes
-               ;;
-       *-apple-darwin*)
-               GL_LIBS="-framework GLUT -framework OpenGL -framework Carbon 
-lobjc"
-               have_GL=yes
-               ;;
-       *)
-               AC_SEARCH_LIBS(glFrustum,
-                       [GL MesaGL Mesa3d opengl opengl32],
-                       [
-                               have_GL=yes
-                               GL_LIBS="$GL_LIBS $LIBS"
-                       ],
-                       AC_ERROR(Need OpenGL),
-                       $GL_LIBS $GL_X_LIBS)
-               ;;
-esac
-
-  LIBS="$saved_LIBS"
-  CFLAGS="$saved_CFLAGS"
-
-  exec AC_FD_MSG>&8
-  AC_LANG_RESTORE
-
-  if test "$have_GL" = "yes"; then
-     ifelse([$1], , :, [$1])     
-  else
-     GL_CFLAGS=""
-     GL_LIBS=""
-     ifelse([$2], , :, [$2])
-  fi
-  AC_SUBST(GL_CFLAGS)
-  AC_SUBST(GL_LIBS)
-])
-
-AC_DEFUN([AM_PATH_GLU],
-[
-  dnl *** bring in opengl as a dependancy ***
-  AM_PATH_OPENGL
-
-  GLU_CFLAGS=""
-  GLU_LIBS=""
-
-  AC_LANG_SAVE
-  AC_LANG_C
-
-  AC_ARG_WITH(glu-prefix,    
-    [  --with-glu-prefix=PFX     Prefix where GLU is installed],
-    [
-      GLU_CFLAGS="-I$withval/include"
-      GLU_LIBS="-L$withval/lib"
-    ])
-
-  AC_ARG_WITH(glu-includes,    
-    [  --with-glu-includes=DIR   where the GLU includes are installed],
-    [
-      GLU_CFLAGS="-I$withval"
-    ])
-
-  AC_ARG_WITH(glu-libraries,    
-    [  --with-glu-libraries=DIR  where the GLU libraries are installed],
-    [
-      GLU_LIBS="-L$withval"
-    ])
-
-  saved_CFLAGS="$CFLAGS"
-  saved_LIBS="$LIBS"
-  AC_LANG_SAVE
-  AC_LANG_C
-  have_GL=no
-
-  exec 8>&AC_FD_MSG
-dnl  exec AC_FD_MSG>/dev/null
-
-case "$target" in
-       *-*-cygwin* | *-*-mingw32*)
-               GLU_CFLAGS=""
-               GLU_LIBS="-lGLU32"
-               have_GLU=yes
-               ;;
-       *-apple-darwin*)
-               dnl apple gets glut by default
-               GLU_LIBS="$GL_LIBS"
-               have_GLU=yes
-               ;;
-       *)
-               AC_SEARCH_LIBS(gluPerspective,
-                       [GLU MesaGLU glu glu32],
-                       [
-                               have_GLU=yes
-                               GLU_LIBS="$GLU_LIBS $LIBS"
-                       ],
-                       AC_ERROR(Need GLU),
-                       $GLU_LIBS)
-               ;;
-esac
-
-  LIBS="$saved_LIBS"
-  CFLAGS="$saved_CFLAGS"
-
-  exec AC_FD_MSG>&8
-  AC_LANG_RESTORE
-
-  if test "$have_GLU" = "yes"; then
-     ifelse([$1], , :, [$1])     
-  else
-     GLU_CFLAGS=""
-     GLU_LIBS=""
-     ifelse([$2], , :, [$2])
-  fi
-  AC_SUBST(GLU_CFLAGS)
-  AC_SUBST(GLU_LIBS)
-])
-
-AC_DEFUN([AM_PATH_GLUT],
-[
-  dnl *** bring in glu as a dependancy ***
-  AM_PATH_GLU
-
-  GLUT_CFLAGS=""
-  GLUT_LIBS=""
-
-  AC_LANG_SAVE
-  AC_LANG_C
-
-  AC_ARG_WITH(glut-prefix,    
-    [  --with-glut-prefix=PFX     Prefix where glut is installed],
-    [
-      GLUT_CFLAGS="-I$withval/include"
-      GLUT_LIBS="-L$withval/lib"
-    ])
-
-  AC_ARG_WITH(glut-includes,    
-    [  --with-glut-includes=DIR   where the glut includes are installed],
-    [
-      GLUT_CFLAGS="-I$withval"
-    ])
-
-  AC_ARG_WITH(glut-libraries,    
-    [  --with-glut-libraries=DIR  where the glut libraries are installed],
-    [
-      GLUT_LIBS="-L$withval"
-    ])
-
-  saved_CFLAGS="$CFLAGS"
-  saved_LIBS="$LIBS"
-  AC_LANG_SAVE
-  AC_LANG_C
-  have_GL=no
-
-  exec 8>&AC_FD_MSG
-dnl  exec AC_FD_MSG>/dev/null
-
-case "$target" in
-       *-*-cygwin* | *-*-mingw32*)
-               GLUT_CFLAGS=""
-               GLUT_LIBS="-lGLUT32"
-               have_GLUT=yes
-               ;;
-       *-apple-darwin*)
-               GLUT_LIBS="-framework GLUT $GL_LIBS"
-               have_GLUT=yes
-               ;;
-       *)
-               AC_SEARCH_LIBS(glutInit,
-                       [glut],
-                       [
-                               have_GLUT=yes
-                               GLUT_LIBS="$GLUT_LIBS $LIBS"
-                       ],
-                       AC_ERROR(Need GLUT),
-                       $GLUT_LIBS)
-               ;;
-esac
-
-  LIBS="$saved_LIBS"
-  CFLAGS="$saved_CFLAGS"
-
-  exec AC_FD_MSG>&8
-  AC_LANG_RESTORE
-
-  if test "$have_GLUT" = "yes"; then
-     ifelse([$1], , :, [$1])     
-  else
-     GLUT_CFLAGS=""
-     GLUT_LIBS=""
-     ifelse([$2], , :, [$2])
-  fi
-  AC_SUBST(GLUT_CFLAGS)
-  AC_SUBST(GLUT_LIBS)
-])
-

Added: brlcad/branches/bottie/src/proc-db/wavy.c
===================================================================
--- brlcad/branches/bottie/src/proc-db/wavy.c                           (rev 0)
+++ brlcad/branches/bottie/src/proc-db/wavy.c   2010-11-19 14:23:10 UTC (rev 
41404)
@@ -0,0 +1,126 @@
+/*                          W A V Y . C
+ * BRL-CAD
+ *
+ * Copyright (c) 1991-2010 United States Government as represented by
+ * the U.S. Army Research Laboratory.
+ *
+ * This program 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.
+ *
+ * This program 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.
+ *
+ * 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.
+ */
+/** @file wavy.c
+ *
+ * Create a random wavy surface spline model database.
+ *
+ */
+
+#include "common.h"
+
+#include <stdlib.h>
+#include <math.h>
+#include "bio.h"
+
+#include "bu.h"
+#include "vmath.h"             /* BRL-CAD Vector macros */
+#include "nurb.h"              /* BRL-CAD Spline data structures */
+#include "raytrace.h"
+#include "wdb.h"
+
+
+/* Interpoate the data using b-splines */
+struct face_g_snurb **
+interpolate_data(fastf_t *grid)
+{
+    struct face_g_snurb **surfs;
+    struct face_g_snurb *srf;
+    fastf_t rt_nurb_par_edge();
+
+    BU_GETSTRUCT(srf, face_g_snurb);
+
+    rt_nurb_sinterp(srf, 4, grid, 10, 10);
+    rt_nurb_kvnorm(&srf->u);
+    rt_nurb_kvnorm(&srf->v);
+
+    surfs = (struct face_g_snurb **)bu_calloc(2, sizeof(struct face_g_snurb 
*), "surfaces");
+    surfs[0] = srf;
+    surfs[1] = NULL;
+    
+    return surfs;
+}
+
+
+int
+main(int argc, char **argv)
+{
+    char *id_name = "wavy database";
+    char *nurb_name = "wavy";
+    int i, j;
+    fastf_t hscale;
+    struct rt_wdb *outfp;
+    fastf_t grid[10][10][3];
+    struct face_g_snurb **surfaces;
+
+    outfp = wdb_fopen("wavy.g");
+
+    hscale = 2.5;
+
+    while ((i=bu_getopt(argc, argv, "dh:")) != EOF) {
+       switch (i) {
+           case 'd':
+               rt_g.debug |= DEBUG_MEM | DEBUG_MEM_FULL;
+               break;
+           case 'h':
+               hscale = atof(bu_optarg);
+               break;
+           default:
+               bu_exit(1, "Usage: %s [-d]\n", *argv);
+       }
+    }
+
+    /* Create the database header record.  this solid will consist of
+     * three surfaces a top surface, bottom surface, and the sides (so
+     * that it will be closed).
+     */
+
+    mk_id(outfp, id_name);
+
+    for (i = 0; i < 10; i++) {
+       for (j = 0; j < 10; j++) {
+           fastf_t v;
+
+           v = (hscale * drand48()) + 10.0;
+
+           grid[i][j][0] = i;
+           grid[i][j][1] = j;
+           grid[i][j][2] = v;
+       }
+    }
+
+    surfaces = interpolate_data(&grid[0][0][0]);
+
+    mk_bspline(outfp, nurb_name, surfaces);
+
+    wdb_close(outfp);
+    bu_log("Geometry saved to 'wavy.g'\n");
+
+    return 0;
+}
+
+/*
+ * Local Variables:
+ * mode: C
+ * tab-width: 8
+ * indent-tabs-mode: t
+ * c-file-style: "stroustrup"
+ * End:
+ * ex: shiftwidth=4 tabstop=8
+ */


Property changes on: brlcad/branches/bottie/src/proc-db/wavy.c
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native


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

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to