Browse Source

Remove deprecated empty-node-path behavior

rdb 10 years ago
parent
commit
84c0fbd1b1
1 changed files with 1 additions and 98 deletions
  1. 1 98
      panda/src/pgraph/nodePath.cxx

+ 1 - 98
panda/src/pgraph/nodePath.cxx

@@ -71,7 +71,6 @@
 #include "pStatCollector.h"
 #include "pStatTimer.h"
 #include "modelNode.h"
-#include "py_panda.h"
 #include "bam.h"
 #include "bamWriter.h"
 
@@ -83,68 +82,6 @@ TypeHandle NodePath::_type_handle;
 PStatCollector NodePath::_get_transform_pcollector("*:NodePath:get_transform");
 PStatCollector NodePath::_verify_complete_pcollector("*:NodePath:verify_complete");
 
-#ifdef HAVE_PYTHON
-#include "py_panda.h"
-#ifndef CPPPARSER
-extern EXPCL_PANDA_PUTIL Dtool_PyTypedObject Dtool_BamWriter;
-extern EXPCL_PANDA_PUTIL Dtool_PyTypedObject Dtool_BamReader;
-#endif  // CPPPARSER
-#endif  // HAVE_PYTHON
-
-// ***Begin temporary transition code for operator bool
-enum EmptyNodePathType {
-  ENP_future,
-  ENP_transition,
-  ENP_deprecated,
-  ENP_notify,
-};
-
-ostream &operator << (ostream &out, EmptyNodePathType enp) {
-  switch (enp) {
-  case ENP_future:
-    return out << "future";
-  case ENP_transition:
-    return out << "transition";
-  case ENP_deprecated:
-    return out << "deprecated";
-  case ENP_notify:
-    return out << "notify";
-  }
-  return out << "**invalid EmptyNodePathType value (" << (int)enp << ")**";
-}
-
-istream &operator >> (istream &in, EmptyNodePathType &enp) {
-  string word;
-  in >> word;
-  if (word == "future") {
-    enp = ENP_future;
-  } else if (word == "transition") {
-    enp = ENP_transition;
-  } else if (word == "deprecated") {
-    enp = ENP_deprecated;
-  } else if (word == "notify") {
-    enp = ENP_notify;
-  } else {
-    pgraph_cat.warning()
-      << "Invalid EmptyNodePathType value (\"" << word << "\")\n";
-    enp = ENP_transition;
-  }
-  return in;
-}
-
-static ConfigVariableEnum<EmptyNodePathType> empty_node_path
-("empty-node-path", ENP_future,
- PRC_DESC("This is a temporary transition variable to control the behavior "
-          "of a NodePath when it is used as a boolean false.  Set this to "
-          "'deprecated' to preserve the original behavior: every NodePath "
-          "evaluates true, even an empty NodePath.  Set it to 'future' to "
-          "support the new behavior: non-empty NodePaths evaluate true, "
-          "and empty NodePaths evaluate false.  Set it to 'transition' to "
-          "raise an exception if an empty NodePath is used as a boolean."));
-
-// ***End temporary transition code for operator bool
-
-
 ////////////////////////////////////////////////////////////////////
 //     Function: NodePath::Constructor
 //       Access: Published
@@ -185,41 +122,7 @@ NodePath(const NodePath &parent, PandaNode *child_node,
 ////////////////////////////////////////////////////////////////////
 NodePath::
 operator bool () const {
-  switch (empty_node_path) {
-  case ENP_future:
-    return !is_empty();
-
-  case ENP_deprecated:
-    return true;
-
-  case ENP_notify:
-    {
-      const char *msg = "NodePath being used as a Boolean (talk to Zac)";
-#ifdef HAVE_PYTHON
-      PyErr_Warn(PyExc_FutureWarning, (char *)msg);
-#endif
-      return !is_empty();
-    }
-
-
-  case ENP_transition:
-    if (!is_empty()) {
-      return true;
-    }
-
-    {
-      const char *message = "Using an empty NodePath as a boolean value.  Because the meaning of this operation is changing, you should avoid doing this to avoid ambiguity, or set the config variable empty-node-path to 'future' or 'deprecated' to specify the desired behavior.";
-      pgraph_cat.warning()
-        << message << "\n";
-#ifdef HAVE_PYTHON
-      PyErr_Warn(PyExc_FutureWarning, (char *)message);
-#endif
-    }
-    return true;
-  }
-
-  nassertr(false, true);
-  return true;
+  return !is_empty();
 }
 
 ////////////////////////////////////////////////////////////////////