Revision: 56733
http://sourceforge.net/p/brlcad/code/56733
Author: brlcad
Date: 2013-08-10 05:36:22 +0000 (Sat, 10 Aug 2013)
Log Message:
-----------
add macros for testing whether an object is invalid (not within our defined
range of INFINITY to -INFINITY
Modified Paths:
--------------
brlcad/trunk/include/vmath.h
Modified: brlcad/trunk/include/vmath.h
===================================================================
--- brlcad/trunk/include/vmath.h 2013-08-10 01:22:15 UTC (rev 56732)
+++ brlcad/trunk/include/vmath.h 2013-08-10 05:36:22 UTC (rev 56733)
@@ -304,8 +304,31 @@
*/
typedef fastf_t plane_t[ELEMENTS_PER_PLANE];
+/**
+ * Evaluates truthfully whether a number is not within valid range of
+ * INFINITY to -INFINITY inclusive.
+ */
+#define INVALID(n) (!((n) >= -INFINITY && (n) <= INFINITY))
/**
+ * Evaluates truthfully whether all components of a vector are not
+ * within a valid range.
+ */
+#define VINVALID(v) (INVALID((v)[X]) || INVALID((v)[Y]) || INVALID((v)[Z]))
+
+/**
+ * Evaluates truthfully whether all components of a 2D vector are not
+ * within a valid range.
+ */
+#define V2INVALID(v) (INVALID((v)[X]) || INVALID((v)[Y]))
+
+/**
+ * Evaluates truthfully whether all components of a 4D vector are not
+ * within a valid range.
+ */
+#define HINVALID(v) (INVALID((v)[X]) || INVALID((v)[Y]) || INVALID((v)[Z]) ||
INVALID((v)[W]))
+
+/**
* Return truthfully whether a value is within a specified epsilon
* distance from zero.
*/
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits