Revision: 54577
          http://brlcad.svn.sourceforge.net/brlcad/?rev=54577&view=rev
Author:   brlcad
Date:     2013-03-08 18:11:01 +0000 (Fri, 08 Mar 2013)
Log Message:
-----------
update examples to their latest sources

Modified Paths:
--------------
    brlcad/trunk/src/other/openNURBS/example_brep/example_brep.cpp
    brlcad/trunk/src/other/openNURBS/example_gl/example_gl.cpp
    brlcad/trunk/src/other/openNURBS/example_read/example_read.cpp
    brlcad/trunk/src/other/openNURBS/example_roundtrip/example_roundtrip.cpp
    brlcad/trunk/src/other/openNURBS/example_userdata/example_ud.cpp
    brlcad/trunk/src/other/openNURBS/example_userdata/example_userdata.cpp
    brlcad/trunk/src/other/openNURBS/example_write/example_write.cpp

Modified: brlcad/trunk/src/other/openNURBS/example_brep/example_brep.cpp
===================================================================
--- brlcad/trunk/src/other/openNURBS/example_brep/example_brep.cpp      
2013-03-08 18:03:04 UTC (rev 54576)
+++ brlcad/trunk/src/other/openNURBS/example_brep/example_brep.cpp      
2013-03-08 18:11:01 UTC (rev 54577)
@@ -1,17 +1,23 @@
-/* $Header: /src4/opennurbs/example_brep/example_brep.cpp 3     8/29/06 3:34p 
Dalelear $ */
 /* $NoKeywords: $ */
+/*
 //
-// Copyright (c) 1993-1998 Robert McNeel & Associates. All rights reserved.
-// Rhinoceros is a registered trademark of Robert McNeel & Assoicates.
+// Copyright (c) 1993-2011 Robert McNeel & Associates. All rights reserved.
+// OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
+// McNeel & Assoicates.
 //
 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
 //                             
+// For complete openNURBS copyright information see <http://www.opennurbs.org>.
+//
 ////////////////////////////////////////////////////////////////
+*/
 
+// uncomment the "ON_DLL_IMPORTS" define to use opennurbs as a Windows DLL
+//#define ON_DLL_IMPORTS
 #include "../opennurbs.h"
-#include "../opennurbs_staticlib_linking_pragmas.h"
+#include "../examples_linking_pragmas.h"
 
 // This example demonstrates two things:
 //
@@ -627,8 +633,7 @@
     = "OpenNURBS example showing how to create and write a simple b-rep";
 
 
-  int version = 4; // File can be read by Rhino 4 and Rhino 5
-  //int version = 5; // File can be read by Rhino 5
+  int version = 0; // version will be ON_BinaryArchive::CurrentArchiveVersion()
   model.Polish();
   const char* filename = "my_brep.3dm";
   bool rc = model.Write( filename, 

Modified: brlcad/trunk/src/other/openNURBS/example_gl/example_gl.cpp
===================================================================
--- brlcad/trunk/src/other/openNURBS/example_gl/example_gl.cpp  2013-03-08 
18:03:04 UTC (rev 54576)
+++ brlcad/trunk/src/other/openNURBS/example_gl/example_gl.cpp  2013-03-08 
18:11:01 UTC (rev 54577)
@@ -1,33 +1,47 @@
-/* $Header: /src4/opennurbs/example_gl/example_gl.cpp 5     8/30/06 2:55p 
Dalelear $ */
 /* $NoKeywords: $ */
+/*
 //
-// Copyright (c) 1993-1998 Robert McNeel & Associates. All rights reserved.
-// Rhinoceros is a registered trademark of Robert McNeel & Assoicates.
+// Copyright (c) 1993-2011 Robert McNeel & Associates. All rights reserved.
+// OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
+// McNeel & Assoicates.
 //
 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
 //                             
+// For complete openNURBS copyright information see <http://www.opennurbs.org>.
+//
 ////////////////////////////////////////////////////////////////
+*/
 
+// uncomment the "ON_DLL_IMPORTS" define to use opennurbs as a Windows DLL
+//#define ON_DLL_IMPORTS
 #include "../opennurbs.h"
+#include "../examples_linking_pragmas.h"
+
 #include "../opennurbs_gl.h"
-#include "../opennurbs_staticlib_linking_pragmas.h"
 
 #if defined(ON_COMPILER_MSC)
 
+#if ( _MSC_VER != 1400 )
 // Tested compilers:
-//   Microsoft Developer Studio 6.0
 //   Microsoft Visual Studio 2005
-//   Support for other Windows compilers is not available.
+//   Support for other compilers is not available.
+#error The OpenGL example is not supported on this compiler.
+// NOTE:
+//   Visual Studio 2005 / 8.0 was the last version of Visual
+//   studio to install the libraries and header files for
+//   Open GL auxillary functions.
+#endif
 
 #include <GL/GLaux.h>   // Open GL auxillary functions
+
 #define ON_EXAMPLE_GL_USE_GLAUX
 
 #elif defined(ON_COMPILER_XCODE)
 
 // Tested compilers:
-//   Apple XCode 2.4.1
+//   Apple Xcode 2.4.1
 //   Support for other Apple compilers is not available.
 #include <GLUT/glut.h>   // Open GL auxillary functions
 #define ON_EXAMPLE_GL_USE_GLUT
@@ -213,11 +227,11 @@
 // If you are using Apple's Xcode and you get a compile error
 // on the typedef below, then try using the commented out typedef.
 //
-// Apple's Xcode 2.4 likes this typedef with the (...)
-//typedef void (CALLBACK* RHINO_GL_NURBS_ERROR)(...);
+// Apple's Xcode 2.4 likes this typedef witht the (...)
+typedef void (CALLBACK* RHINO_GL_NURBS_ERROR)(...);
 //
-// Apple's Xcode 3.2 likes this typedef without the ()
-typedef void (CALLBACK* RHINO_GL_NURBS_ERROR)();
+// Apple's Xcode 3.2 likes this typedef witht the (...)
+//typedef void (CALLBACK* RHINO_GL_NURBS_ERROR)();
 #endif
 
 }

Modified: brlcad/trunk/src/other/openNURBS/example_read/example_read.cpp
===================================================================
--- brlcad/trunk/src/other/openNURBS/example_read/example_read.cpp      
2013-03-08 18:03:04 UTC (rev 54576)
+++ brlcad/trunk/src/other/openNURBS/example_read/example_read.cpp      
2013-03-08 18:11:01 UTC (rev 54577)
@@ -1,14 +1,20 @@
-/* $Header: /src4/opennurbs/example_read/example_read.cpp 2     8/29/06 1:43p 
Dalelear $ */
 /* $NoKeywords: $ */
+/*
 //
-// Copyright (c) 1993-1998 Robert McNeel & Associates. All rights reserved.
-// Rhinoceros is a registered trademark of Robert McNeel & Assoicates.
+// Copyright (c) 1993-2011 Robert McNeel & Associates. All rights reserved.
+// OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
+// McNeel & Assoicates.
 //
 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
 //                             
+// For complete openNURBS copyright information see <http://www.opennurbs.org>.
+//
 ////////////////////////////////////////////////////////////////
+*/             
+
+////////////////////////////////////////////////////////////////
 //
 //  example_read.cpp  
 // 
@@ -18,9 +24,231 @@
 //
 ////////////////////////////////////////////////////////////////////////
 
+// uncomment the "ON_DLL_IMPORTS" define to use opennurbs as a Windows DLL
+//#define ON_DLL_IMPORTS
 #include "../opennurbs.h"
-#include "../opennurbs_staticlib_linking_pragmas.h"
+#include "../examples_linking_pragmas.h"
 
+static bool Dump3dmFileHelper( 
+        const wchar_t* sFileName, // full name of file
+        ON_TextLog& dump
+        )
+{
+  dump.Print("====== FILENAME: %ls\n",sFileName);
+  ON_Workspace ws;
+  FILE* fp = ws.OpenFile( sFileName, L"rb" ); // file automatically closed by 
~ON_Workspace()
+  if ( !fp ) {
+    dump.Print("**ERROR** Unable to open file.\n");
+    return false;
+  }
+
+  ON_BinaryFile file( ON::read3dm, fp );
+
+  int version = 0;
+  ON_String comment_block;
+  ON_BOOL32 rc = file.Read3dmStartSection( &version, comment_block );
+  if (!rc) {
+    dump.Print("**ERROR** Read3dmStartSection() failed\n");
+    return false;
+  }
+  dump.Print("====== VERSION: %d\n",version );
+  dump.Print("====== COMMENT BLOCK:\n",version );
+  dump.PushIndent();
+  dump.Print(comment_block);
+  dump.PopIndent();
+  dump.Print("====== CHUNKS:\n",version );
+  unsigned int typecode;
+  while ( !file.AtEnd() ) {
+    typecode = file.Dump3dmChunk( dump, 0 );
+    if ( !typecode )
+      break;
+    if ( typecode == TCODE_ENDOFFILE )
+      break;
+  }
+  dump.Print("====== FINISHED: %ls\n",sFileName);
+
+  return true;
+}
+
+/*
+Returns:
+  True if .3dm file was successfully read into an ONX_Model class.
+*/
+static bool ReadFileHelper( 
+  const wchar_t* sFileName,
+  bool bVerboseTextDump,
+  bool bChunkDump,
+  ON_TextLog& dump
+  )
+{
+  if ( bChunkDump )
+  {
+    return Dump3dmFileHelper(sFileName,dump);
+  }
+
+  ONX_Model model;
+
+  dump.Print("\nOpenNURBS Archive File:  %ls\n", sFileName );
+
+  // open file containing opennurbs archive
+  FILE* archive_fp = ON::OpenFile( sFileName, L"rb");
+  if ( !archive_fp ) 
+  {
+    dump.Print("  Unable to open file.\n" );
+    return false;
+  }
+
+  dump.PushIndent();
+
+  // create achive object from file pointer
+  ON_BinaryFile archive( ON::read3dm, archive_fp );
+
+  // read the contents of the file into "model"
+  bool rc = model.Read( archive, &dump );
+
+  // close the file
+  ON::CloseFile( archive_fp );
+
+  // print diagnostic
+  if ( rc )
+    dump.Print("Successfully read.\n");
+  else
+    dump.Print("Errors during reading.\n");
+
+  // see if everything is in good shape
+  if ( model.IsValid(&dump) )
+  {
+    dump.Print("Model is valid.\n");
+  }
+  else
+  {
+    dump.Print("Model is not valid.\n");
+  }
+
+  // create a text dump of the model
+  if ( bVerboseTextDump )
+  {
+    dump.PushIndent();
+    model.Dump(dump);
+    dump.PopIndent();
+  }
+
+  // destroy this model
+  model.Destroy();
+
+  dump.PopIndent();
+
+  return rc;
+}
+
+/*
+Returns:
+  Number of files read.
+*/
+static int ReadDirectoryHelper( 
+  int directory_depth,
+  int maximum_directory_depth,
+  const wchar_t* directory_name,
+  const wchar_t* file_name_filter,
+  bool bVerboseTextDump,
+  bool bChunkDump,
+  ON_TextLog& dump
+  )
+{
+  int file_count = 0;
+  if ( directory_depth <= maximum_directory_depth )
+  {
+    if ( 0 == file_name_filter || 0 == file_name_filter[0] )
+      file_name_filter = L"*.3dm";
+
+    // read files in this directory
+    ON_FileIterator file_it;
+    for ( const wchar_t* file_name = file_it.FirstFile( directory_name, 
file_name_filter );
+          0 != file_name;
+          file_name = file_it.NextFile()
+        )
+    {
+      if ( file_it.CurrentFileIsDirectory() )
+        continue;      
+      
+      if ( file_it.CurrentFileIsHidden() )
+        continue;
+
+      ON_wString full_path;
+      if ( !file_it.GetCurrentFullPathFileName(full_path) )
+        continue;
+      
+      if ( !ON::IsOpenNURBSFile(full_path) )
+        continue;
+
+      if ( ReadFileHelper(full_path,bVerboseTextDump,bChunkDump,dump) )
+        file_count++;
+    }
+
+    // read files in subdirectories
+    if ( directory_depth < maximum_directory_depth )
+    {
+      ON_FileIterator dir_it;
+      for ( const wchar_t* subdirectory_name = dir_it.FirstFile( 
directory_name, 0 );
+            0 != subdirectory_name;
+            subdirectory_name = dir_it.NextFile()
+          )
+      {
+        if ( false == dir_it.CurrentFileIsDirectory() )
+          continue;
+
+        if ( dir_it.CurrentFileIsHidden() )
+          continue;
+
+        ON_wString full_path;
+        if ( !dir_it.GetCurrentFullPathFileName(full_path) )
+          continue;
+      
+        file_count += ReadDirectoryHelper(
+                            directory_depth + 1,
+                            maximum_directory_depth,
+                            full_path,
+                            file_name_filter,
+                            bVerboseTextDump,
+                            bChunkDump,
+                            dump
+                            );
+      }
+    }
+  }
+
+  return file_count;
+}
+
+
+static void print_help(const char* example_read_exe_name)
+{
+  if ( 0 == example_read_exe_name || 0 == example_read_exe_name[0])
+    example_read_exe_name = "example_read";
+
+  printf("\n");
+  printf("SYNOPSIS:\n");
+  printf("  %s [-out:outputfilename.txt] [-c] [-r] <file or directory 
names>\n",example_read_exe_name );
+  printf("\n");
+  printf("DESCRIPTION:\n");
+  printf("  If a file is listed, it is read as an opennurbs model file.\n");
+  printf("  If a directory is listed, all .3dm files in that directory\n");
+  printf("  are read as opennurbs model files.\n");
+  printf("\n");
+  printf("  Available options:\n");
+  printf("    -out:outputfilename.txt\n");
+  printf("      The output is written to the named file.\n");
+  printf("    -chunkdump\n");
+  printf("      Does a chunk dump instead of reading the file's contents.\n");
+  printf("    -recursive\n");
+  printf("      Recursivly reads files in subdirectories.\n");
+  printf("\n");
+  printf("EXAMPLE:\n");
+  printf("  %s -out:list.txt -resursive 
.../example_files\n",example_read_exe_name);
+  printf("  with read all the opennurbs .3dm files in the\n"); 
+  printf("  example_files/ directory and subdirectories.\n");
+}
+
 int main( int argc, const char *argv[] )
 {
   // If you are using OpenNURBS as a Windows DLL, then you MUST use
@@ -28,10 +256,24 @@
   // as a Windows DLL, then you may use either ON::OpenFile() or fopen()
   // to open the file.
 
+  const char* example_read_exe_name = 0;
+  if ( argc >= 1 && 0 != argv && 0 != argv[0] && 0 != argv[0][0] )
+  {
+    on_splitpath(argv[0],0,0,&example_read_exe_name,0);
+  }
+  if ( 0 == example_read_exe_name || 0 == example_read_exe_name[0] )
+  {
+#if defined(ON_OS_WINDOWS)
+    example_read_exe_name = "example_read.exe";
+#else
+    example_read_exe_name = "example_read";
+#endif
+  }
+
   int argi;
   if ( argc < 2 ) 
   {
-    printf("Syntax: %s [-out:outputfilename.txt] file1.3dm file2.3dm 
...\n",argv[0] );
+    print_help(example_read_exe_name);
     return 0;
   }
 
@@ -40,91 +282,118 @@
 
   // default dump is to stdout
   ON_TextLog dump_to_stdout;
+  dump_to_stdout.SetIndentSize(2);
   ON_TextLog* dump = &dump_to_stdout;
   FILE* dump_fp = 0;
 
-  ONX_Model model;
-
   bool bVerboseTextDump = true;
 
+  bool bChunkDump = false;
+
+
+  int maximum_directory_depth = 0;
+
+  int file_count = 0;
+
   for ( argi = 1; argi < argc; argi++ ) 
   {
     const char* arg = argv[argi];
 
     // check for -out or /out option
-    if ( ( 0 == strncmp(arg,"-out:",5) || 0 == strncmp(arg,"/out:",5) ) 
+    if ( (    0 == strncmp(arg,"-out:",5) || 0 == strncmp(arg,"-out:",5)
+#if defined(ON_OS_WINDOWS)
+           || 0 == strncmp(arg,"/out:",5) 
+#endif
+         ) 
          && arg[5] )
     {
       // change destination of dump file
-      const char* sDumpFilename = arg+5;
-      FILE* text_fp = ON::OpenFile(sDumpFilename,"w");
-      if ( text_fp )
+      if ( dump != &dump_to_stdout )
       {
+        delete dump;
+        dump = 0;
+      }
         if ( dump_fp )
         {
-          delete dump;
           ON::CloseFile(dump_fp);
         }
+
+      const char* sDumpFilename = arg+5;
+      FILE* text_fp = ON::OpenFile(sDumpFilename,"w");
+      if ( text_fp )
+      {
         dump_fp = text_fp;
         dump = new ON_TextLog(dump_fp);
-      }
-      continue;
+        dump->SetIndentSize(2);
     }
 
-    const char* sFileName = arg;
+      if ( 0 == dump )
+        dump = &dump_to_stdout;
 
-    dump->Print("\nOpenNURBS Archive File:  %s\n", sFileName );
+      continue;
+    }
 
-    // open file containing opennurbs archive
-    FILE* archive_fp = ON::OpenFile( sFileName, "rb");
-    if ( !archive_fp ) 
+    // check for -chunkdump or /chunkdump option
+    if (    0 == strcmp(arg,"-C") 
+         || 0 == strcmp(arg,"-c") 
+         || 0 == strcmp(arg,"-chunk") 
+         || 0 == strcmp(arg,"-chunkdump") 
+#if defined(ON_OS_WINDOWS)
+         || 0 == strcmp(arg,"/C") 
+         || 0 == strcmp(arg,"/c") 
+         || 0 == strcmp(arg,"/chunk") 
+         || 0 == strcmp(arg,"/chunkdump") 
+#endif
+         )
     {
-      dump->Print("  Unable to open file.\n" );
+      bChunkDump = true;
       continue;
     }
 
-    dump->PushIndent();
+    // check for -recursive or /recursive option
+    if (    0 == strcmp(arg,"-R") 
+         || 0 == strcmp(arg,"-r") 
+         || 0 == strcmp(arg,"-recurse") 
+         || 0 == strcmp(arg,"-recursive") 
+#if defined(ON_OS_WINDOWS)
+         || 0 == strcmp(arg,"/R") 
+         || 0 == strcmp(arg,"/r") 
+         || 0 == strcmp(arg,"/recurse") 
+         || 0 == strcmp(arg,"/recursive") 
+#endif
+         )
+    {
+      maximum_directory_depth = 32;
+      continue;
+    }
 
-    // create achive object from file pointer
-    ON_BinaryFile archive( ON::read3dm, archive_fp );
+    ON_wString ws_arg = arg;
+    const wchar_t* wchar_arg = ws_arg;
 
-    // read the contents of the file into "model"
-    bool rc = model.Read( archive, dump );
-
-    // close the file
-    ON::CloseFile( archive_fp );
-
-    // print diagnostic
-    if ( rc )
-      dump->Print("Successfully read.\n");
+    if ( ON::IsDirectory(wchar_arg) )
+    {
+      file_count += ReadDirectoryHelper( 0, maximum_directory_depth, 
wchar_arg, 0, bVerboseTextDump, bChunkDump, *dump );
+    }
     else
-      dump->Print("Errors during reading.\n");
-
-    // see if everything is in good shape
-    if ( model.IsValid(dump) )
-      dump->Print("Model is valid.\n");
-    else
-      dump->Print("Model is not valid.\n");
-
-    // create a text dump of the model
-    if ( bVerboseTextDump )
     {
-      dump->PushIndent();
-      model.Dump(*dump);
-      dump->PopIndent();
+      if ( ReadFileHelper( wchar_arg, bVerboseTextDump, bChunkDump, *dump ) )
+        file_count++;
     }
 
-    // destroy this model
-    model.Destroy();
+  }
 
-    dump->PopIndent();
+  dump->Print("%s read %d opennurbs model 
files.\n",example_read_exe_name,file_count);
+  if ( dump != &dump_to_stdout )
+  {
+    delete dump;
+    dump = 0;
   }
 
   if ( dump_fp )
   {
     // close the text dump file
-    delete dump;
     ON::CloseFile( dump_fp );
+    dump_fp = 0;
   }
   
   // OPTIONAL: Call just before your application exits to clean

Modified: 
brlcad/trunk/src/other/openNURBS/example_roundtrip/example_roundtrip.cpp
===================================================================
--- brlcad/trunk/src/other/openNURBS/example_roundtrip/example_roundtrip.cpp    
2013-03-08 18:03:04 UTC (rev 54576)
+++ brlcad/trunk/src/other/openNURBS/example_roundtrip/example_roundtrip.cpp    
2013-03-08 18:11:01 UTC (rev 54577)
@@ -1,5 +1,7 @@
+// uncomment the "ON_DLL_IMPORTS" define to use opennurbs as a Windows DLL
+//#define ON_DLL_IMPORTS
 #include "../opennurbs.h"
-#include "../opennurbs_staticlib_linking_pragmas.h"
+#include "../examples_linking_pragmas.h"
 
 int main( int argc, const char *argv[] )
 {
@@ -105,9 +107,7 @@
     }
     */
 
-    // create a text dump of the model
-    int version = 4; // File can be read by Rhino 4 and Rhino 5
-    //int version = 5; // File can be read by Rhino 5
+    int version = 0; // write current Rhino file
 
     ON_String outfile = sFileName;
     int len = outfile.Length() - 4;

Modified: brlcad/trunk/src/other/openNURBS/example_userdata/example_ud.cpp
===================================================================
--- brlcad/trunk/src/other/openNURBS/example_userdata/example_ud.cpp    
2013-03-08 18:03:04 UTC (rev 54576)
+++ brlcad/trunk/src/other/openNURBS/example_userdata/example_ud.cpp    
2013-03-08 18:11:01 UTC (rev 54577)
@@ -1,3 +1,5 @@
+// uncomment the "ON_DLL_IMPORTS" define to use opennurbs as a Windows DLL
+//#define ON_DLL_IMPORTS
 #include "../opennurbs.h"
 #include "example_ud.h"
 
@@ -48,7 +50,7 @@
   const wchar_t* s = m_str;
   if ( 0 == s ) 
     s = L"";
-  text_log.Print("m_str: %S\n",s);
+  text_log.Print("m_str: %ls\n",s);
   text_log.Print("m_sn: %d\n",m_sn);
   text_log.PopIndent();
 }

Modified: brlcad/trunk/src/other/openNURBS/example_userdata/example_userdata.cpp
===================================================================
--- brlcad/trunk/src/other/openNURBS/example_userdata/example_userdata.cpp      
2013-03-08 18:03:04 UTC (rev 54576)
+++ brlcad/trunk/src/other/openNURBS/example_userdata/example_userdata.cpp      
2013-03-08 18:11:01 UTC (rev 54577)
@@ -1,5 +1,7 @@
+// uncomment the "ON_DLL_IMPORTS" define to use opennurbs as a Windows DLL
+//#define ON_DLL_IMPORTS
 #include "../opennurbs.h"
-#include "../opennurbs_staticlib_linking_pragmas.h"
+#include "../examples_linking_pragmas.h"
 
 // This example demonstrates how to attach customized "user data"
 // to any class derived from ON_Object.  In particular, you can
@@ -179,8 +181,7 @@
   mo.m_object = &point;
   mo.m_bDeleteObject = false;
 
-  int version = 4; // File can be read by Rhino 4 and Rhino 5
-  //int version = 5; // File can be read by Rhino 5
+  int version = 0; // version will be ON_BinaryArchive::CurrentArchiveVersion()
 
   model.Polish();
   model.Write( filename, version, "example_userdata.cpp file" );
@@ -252,7 +253,7 @@
 
   // When the point is saved to a file, the virtual ON_Object::Write() is
   // called to write the attached user data.
-  const char* filename = "point_with_user_Data.3dm";
+  const char* filename = "my_point_with_user_data.3dm";
   write_file( filename, point );
 
   // When the point is read from a file, the virtual ON_Object::Read() is

Modified: brlcad/trunk/src/other/openNURBS/example_write/example_write.cpp
===================================================================
--- brlcad/trunk/src/other/openNURBS/example_write/example_write.cpp    
2013-03-08 18:03:04 UTC (rev 54576)
+++ brlcad/trunk/src/other/openNURBS/example_write/example_write.cpp    
2013-03-08 18:11:01 UTC (rev 54577)
@@ -1,18 +1,24 @@
-/* $Header: /src4/opennurbs/example_write/example_write.cpp 6     12/05/06 
9:39a Dalelear $ */
 /* $NoKeywords: $ */
+/*
 //
-// Copyright (c) 1993-2000 Robert McNeel & Associates. All rights reserved.
-// Rhinoceros is a registered trademark of Robert McNeel & Assoicates.
+// Copyright (c) 1993-2011 Robert McNeel & Associates. All rights reserved.
+// OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
+// McNeel & Assoicates.
 //
 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
 //                             
+// For complete openNURBS copyright information see <http://www.opennurbs.org>.
+//
 ////////////////////////////////////////////////////////////////
+*/
 
 
+// uncomment the "ON_DLL_IMPORTS" define to use opennurbs as a Windows DLL
+//#define ON_DLL_IMPORTS
 #include "../opennurbs.h"
-#include "../opennurbs_staticlib_linking_pragmas.h"
+#include "../examples_linking_pragmas.h"
 
 #include "../example_userdata/example_ud.h"
 
@@ -1192,10 +1198,8 @@
   // version 5 is the OpenNURBS format (released September 2009) and is used 
by Rhino 5.x
 
   // version to write
-  int version = 4; // File can be read by Rhino 4 and Rhino 5
-  //int version = 5; // File can be read by Rhino 5
+  int version = 0; // version will be ON_BinaryArchive::CurrentArchiveVersion()
 
-
   // errors printed to stdout
   ON_TextLog error_log;
 

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


------------------------------------------------------------------------------
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester  
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the  
endpoint security space. For insight on selecting the right partner to 
tackle endpoint security challenges, access the full report. 
http://p.sf.net/sfu/symantec-dev2dev
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to