[brlcad-commits] SF.net SVN: brlcad:[32564]

2008-08-29 Thread d_rossberg
Revision: 32564
  http://brlcad.svn.sourceforge.net/brlcad/?rev=32564&view=rev
Author:   d_rossberg
Date: 2008-08-29 14:59:21 + (Fri, 29 Aug 2008)

Log Message:
---
a little bit more output from the ray trace

Modified Paths:
--
rt^3/trunk/include/brlcad/common.h
rt^3/trunk/include/brlcad/raytrace.h
rt^3/trunk/src/coreInterface/ConstDatabase.cpp

Modified: rt^3/trunk/include/brlcad/common.h
===
--- rt^3/trunk/include/brlcad/common.h  2008-08-29 14:08:33 UTC (rev 32563)
+++ rt^3/trunk/include/brlcad/common.h  2008-08-29 14:59:21 UTC (rev 32564)
@@ -40,16 +40,78 @@
 
 
 namespace BRLCAD {
+struct Vector2D {
+double coordinates[2];
+
+Vector2D(void) {
+coordinates[0] = 0.;
+coordinates[1] = 0.;
+}
+
+Vector2D(const double vector[2]) {
+coordinates[0] = vector[0];
+coordinates[1] = vector[1];
+}
+
+Vector2D(double x,
+ double y) {
+coordinates[0] = x;
+coordinates[1] = y;
+}
+};
+
+
+struct Mapping2D {
+Vector2D point;
+Vector2D delta;
+
+Mapping2D(const Vector2D& pt,
+  const Vector2D& dl) : point(pt), delta(dl) {}
+};
+
+
 struct Vector3D {
 double coordinates[3];
+
+Vector3D(void) {
+coordinates[0] = 0.;
+coordinates[1] = 0.;
+coordinates[2] = 0.;
+}
+
+Vector3D(const double vector[3]) {
+coordinates[0] = vector[0];
+coordinates[1] = vector[1];
+coordinates[2] = vector[2];
+}
 };
 
+
 struct Ray3D {
 Vector3D origin;
 Vector3D direction;
 };
 
 
+struct Curvature3D {
+Vector3D minPrincipalDirection;
+double   minPrincipalCurvature;
+double   maxPrincipalCurvature;
+
+Curvature3D(const Vector3D& minDirection,
+double  minCurvature,
+double  maxCurvature) {
+minPrincipalDirection = minDirection;
+minPrincipalCurvature = minCurvature;
+maxPrincipalCurvature = maxCurvature;
+}
+
+Curvature3D(void) : minPrincipalDirection(),
+minPrincipalCurvature(0.),
+maxPrincipalCurvature(0.) {}
+};
+
+
 class StringCalback {
 public:
 virtual ~StringCalback(void) {}

Modified: rt^3/trunk/include/brlcad/raytrace.h
===
--- rt^3/trunk/include/brlcad/raytrace.h2008-08-29 14:08:33 UTC (rev 
32563)
+++ rt^3/trunk/include/brlcad/raytrace.h2008-08-29 14:59:21 UTC (rev 
32564)
@@ -30,14 +30,25 @@
 #ifndef BRLCAD_RAYTRACE_INCLUDED
 #define BRLCAD_RAYTRACE_INCLUDED
 
+#include "common.h"
 
+
 namespace BRLCAD {
 class Hit {
 public:
 virtual ~Hit(void) throw() {}
 
-virtual double DistanceIn(void) const throw()  = 0;
-virtual double DistanceOut(void) const throw() = 0;
+virtual const char* Name(void) const throw()= 0;
+virtual double  DistanceIn(void) const throw()  = 0;
+virtual double  DistanceOut(void) const throw() = 0;
+virtual Vector3DPointIn(void) const throw() = 0;
+virtual Vector3DPointOut(void) const throw()= 0;
+virtual Vector3DSurfaceNormaleIn(void) const throw()= 0;
+virtual Vector3DSurfaceNormaleOut(void) const throw()   = 0;
+virtual Curvature3D SurfaceCurvatureIn(void) const throw()  = 0;
+virtual Curvature3D SurfaceCurvatureOut(void) const throw() = 0;
+virtual Mapping2D   Surface2DMappingIn(void) const throw()  = 0;
+virtual Mapping2D   Surface2DMappingOut(void) const throw() = 0;
 
 protected:
 Hit(void) throw() {}

Modified: rt^3/trunk/src/coreInterface/ConstDatabase.cpp
===
--- rt^3/trunk/src/coreInterface/ConstDatabase.cpp  2008-08-29 14:08:33 UTC 
(rev 32563)
+++ rt^3/trunk/src/coreInterface/ConstDatabase.cpp  2008-08-29 14:59:21 UTC 
(rev 32564)
@@ -33,7 +33,6 @@
 
 #include 
 
-#include "common.h"
 #include "raytrace.h"
 
 
@@ -171,7 +170,7 @@
 
 
 Vector3D ConstDatabase::BoundingBoxMinima(void) const throw() {
-Vector3D ret = {0., 0., 0.};
+Vector3D ret;
 
 if (!SelectionIsEmpty()) {
 if (BU_SETJUMP)
@@ -191,7 +190,7 @@
 
 
 Vector3D ConstDatabase::BoundingBoxMaxima(void) const throw() {
-Vector3D ret = {0., 0., 0.};
+Vector3D ret;
 
 if (!SelectionIsEmpty()) {
 if (BU_SETJUMP)
@@ -307,45 +306,122 @@
 
 class ConstDatabaseHit : public Hit {
 public:
-ConstDatabaseHit(partition* pPartition) throw() : Hit(), 
m_pPartition(pPartition) {
-

[brlcad-commits] SF.net SVN: brlcad:[32563] brlcad/trunk/src/libtclcad/ged_obj.c

2008-08-29 Thread bob1961
Revision: 32563
  http://brlcad.svn.sourceforge.net/brlcad/?rev=32563&view=rev
Author:   bob1961
Date: 2008-08-29 14:08:33 + (Fri, 29 Aug 2008)

Log Message:
---
Add code to draw view axes (temporarily hardwired to always be on and drawn in 
center of view)

Modified Paths:
--
brlcad/trunk/src/libtclcad/ged_obj.c

Modified: brlcad/trunk/src/libtclcad/ged_obj.c
===
--- brlcad/trunk/src/libtclcad/ged_obj.c2008-08-29 12:58:26 UTC (rev 
32562)
+++ brlcad/trunk/src/libtclcad/ged_obj.c2008-08-29 14:08:33 UTC (rev 
32563)
@@ -3347,6 +3347,35 @@
 #endif
 DM_DRAW_POINT_2D(gdvp->gdv_dmp, 0.0, 0.0);
 
+/*XXX Whether or not and how things are drawn needs to be application 
settable.
+ *For the moment, things are hardwired.
+ */
+/*Draw view axes */
+{
+   point_t origin = {0.0, 0.0, 0.0};
+   int axes_color[3] = {100, 100, 255};
+   int axes_label_color[3] = {255, 255, 0};
+
+   dmo_drawAxes_cmd(gdvp->gdv_dmp,
+gdvp->gdv_view->gv_size,
+gdvp->gdv_view->gv_rotation,
+origin,
+0.25,
+axes_color,
+axes_label_color,
+0, /* line width */
+0, /* positive direction only */
+0, /* three colors (i.e. X-red, Y-green, Z-blue) */
+0, /* no ticks */
+0, /* tick len */
+0, /* major tick len */
+0, /* tick interval */
+0, /* ticks per major */
+NULL, /* tick color */
+NULL, /* major tick color */
+0 /* tick threshold */);
+}
+
 DM_DRAW_END(gdvp->gdv_dmp);
 }
 


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

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
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:[32562] brlcad/trunk/src/libged

2008-08-29 Thread bob1961
Revision: 32562
  http://brlcad.svn.sourceforge.net/brlcad/?rev=32562&view=rev
Author:   bob1961
Date: 2008-08-29 12:58:26 + (Fri, 29 Aug 2008)

Log Message:
---
Include missing header

Modified Paths:
--
brlcad/trunk/src/libged/ged_private.h
brlcad/trunk/src/libged/qray.h

Modified: brlcad/trunk/src/libged/ged_private.h
===
--- brlcad/trunk/src/libged/ged_private.h   2008-08-29 12:57:17 UTC (rev 
32561)
+++ brlcad/trunk/src/libged/ged_private.h   2008-08-29 12:58:26 UTC (rev 
32562)
@@ -30,8 +30,9 @@
 
 #include 
 
+#include "db.h"
+#include "mater.h"
 #include "ged.h"
-#include "db.h"
 
 __BEGIN_DECLS
 

Modified: brlcad/trunk/src/libged/qray.h
===
--- brlcad/trunk/src/libged/qray.h  2008-08-29 12:57:17 UTC (rev 32561)
+++ brlcad/trunk/src/libged/qray.h  2008-08-29 12:58:26 UTC (rev 32562)
@@ -26,6 +26,8 @@
  */
 /** @} */
 
+#include "ged.h"
+
 #ifndef SEEN_QRAY_H
 #define SEEN_QRAY_H
 


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

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
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:[32561] brlcad/trunk/src/libged/ged.c

2008-08-29 Thread bob1961
Revision: 32561
  http://brlcad.svn.sourceforge.net/brlcad/?rev=32561&view=rev
Author:   bob1961
Date: 2008-08-29 12:57:17 + (Fri, 29 Aug 2008)

Log Message:
---
Making sure ged_log and ged_result_string will initially contain an empty 
string instead of a null pointer (I wrongly assumed that bu_vls_init did this 
:-( ). This way, any callers of libged functions can harvest ged_log or 
ged_result_str without the need to check whether or not it contains a null 
pointer (i.e. it should always contain atleast an empty string assuming the 
application doesn't free the vls).

Modified Paths:
--
brlcad/trunk/src/libged/ged.c

Modified: brlcad/trunk/src/libged/ged.c
===
--- brlcad/trunk/src/libged/ged.c   2008-08-29 10:28:44 UTC (rev 32560)
+++ brlcad/trunk/src/libged/ged.c   2008-08-29 12:57:17 UTC (rev 32561)
@@ -102,6 +102,10 @@
 {
 bu_vls_init(&gedp->ged_log);
 bu_vls_init(&gedp->ged_result_str);
+
+bu_vls_extend(&gedp->ged_log, 1);
+bu_vls_extend(&gedp->ged_result_str, 1);
+
 ged_drawable_init(gedp->ged_gdp);
 }
 


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

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
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:[32560]

2008-08-29 Thread d_rossberg
Revision: 32560
  http://brlcad.svn.sourceforge.net/brlcad/?rev=32560&view=rev
Author:   d_rossberg
Date: 2008-08-29 10:28:44 + (Fri, 29 Aug 2008)

Log Message:
---
the core of ray trace

Modified Paths:
--
rt^3/trunk/include/brlcad/ConstDatabase.h
rt^3/trunk/include/brlcad/common.h
rt^3/trunk/src/coreInterface/ConstDatabase.cpp

Added Paths:
---
rt^3/trunk/include/brlcad/raytrace.h

Modified: rt^3/trunk/include/brlcad/ConstDatabase.h
===
--- rt^3/trunk/include/brlcad/ConstDatabase.h   2008-08-28 19:19:05 UTC (rev 
32559)
+++ rt^3/trunk/include/brlcad/ConstDatabase.h   2008-08-29 10:28:44 UTC (rev 
32560)
@@ -30,7 +30,8 @@
 #ifndef BRLCAD_CONSTDATABASE_INCLUDED
 #define BRLCAD_CONSTDATABASE_INCLUDED
 
-#include 
+#include 
+#include 
 
 
 struct rt_i;
@@ -57,6 +58,15 @@
 BRLCAD_COREINTERFACE_EXPORT voidListTopObjects(StringCalback& 
callback) const;
 //@}
 
+/// @name Accessing objects
+//@{
+BRLCAD_COREINTERFACE_EXPORT boolIsRegion(const char* 
objectName) const throw();
+/// returns the list of the objects contained in the combination \a 
objectName via call-backs
+/** To get a list of top level objects see ListTopObjects(). */
+BRLCAD_COREINTERFACE_EXPORT voidListObjects(const char*
objectName,
+StringCalback& 
callback) const;
+//@}
+
 /// @name Active set functions
 //@{
 /// add the database object \a objectName to the active set
@@ -71,13 +81,10 @@
 BRLCAD_COREINTERFACE_EXPORT Vector3DBoundingBoxMaxima(void) const 
throw();
 //@}
 
-/// @name Accessing objects
+/// @name Ray trace
 //@{
-BRLCAD_COREINTERFACE_EXPORT boolIsRegion(const char* 
objectName) const throw();
-/// returns the list of the objects contained in the combination \a 
objectName via call-backs
-/** To get a list of top level objects see ListTopObjects(). */
-BRLCAD_COREINTERFACE_EXPORT voidListObjects(const char*
objectName,
-StringCalback& 
callback) const;
+BRLCAD_COREINTERFACE_EXPORT voidShootRay(const Ray3D& ray,
+ HitCallback& 
callback) const throw();
 //@}
 
 private:

Modified: rt^3/trunk/include/brlcad/common.h
===
--- rt^3/trunk/include/brlcad/common.h  2008-08-28 19:19:05 UTC (rev 32559)
+++ rt^3/trunk/include/brlcad/common.h  2008-08-29 10:28:44 UTC (rev 32560)
@@ -39,12 +39,17 @@
 #endif
 
 
-struct Vector3D {
-double coordinates[3];
-};
+namespace BRLCAD {
+struct Vector3D {
+double coordinates[3];
+};
 
+struct Ray3D {
+Vector3D origin;
+Vector3D direction;
+};
 
-namespace BRLCAD {
+
 class StringCalback {
 public:
 virtual ~StringCalback(void) {}

Added: rt^3/trunk/include/brlcad/raytrace.h
===
--- rt^3/trunk/include/brlcad/raytrace.h(rev 0)
+++ rt^3/trunk/include/brlcad/raytrace.h2008-08-29 10:28:44 UTC (rev 
32560)
@@ -0,0 +1,69 @@
+/*  R A Y T R A C E . H
+ * BRL-CAD
+ *
+ * Copyright (c) 2008 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.
+ *
+ * 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.
+ *
+ * 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 raytrace.h
+ *
+ *  BRL-CAD core C++ interface:
+ *  declares some objects needed in the ray trace procedure
+ *
+ *  Origin -
+ *  TNO (Netherlands)
+ *  IABG mbH (Germany)
+ */
+
+#ifndef BRLCAD_RAYTRACE_INCLUDED
+#define BRLCAD_RAYTRACE_INCLUDED
+
+
+namespace BRLCAD {
+class Hit {
+public:
+virtual ~Hit(void) throw() {}
+
+virtual double DistanceIn(void) const throw()  = 0;
+virtual double DistanceOut(void) const throw() = 0;
+
+protected:
+Hit(void) throw() {}
+Hit(const Hit&) throw() {}
+const Hit& operator=(const Hit&) throw() {return *this;}
+};
+
+
+class HitCallback {
+public:
+virtual ~HitCallback(void) {}
+
+/** return true: