Revision: 76105
http://sourceforge.net/p/brlcad/code/76105
Author: starseeker
Date: 2020-06-10 19:47:33 +0000 (Wed, 10 Jun 2020)
Log Message:
-----------
Start working on the execution step
Modified Paths:
--------------
brlcad/branches/bioh/src/burst2/CMakeLists.txt
Added Paths:
-----------
brlcad/branches/bioh/src/burst2/execute.cpp
Modified: brlcad/branches/bioh/src/burst2/CMakeLists.txt
===================================================================
--- brlcad/branches/bioh/src/burst2/CMakeLists.txt 2020-06-10 19:24:32 UTC
(rev 76104)
+++ brlcad/branches/bioh/src/burst2/CMakeLists.txt 2020-06-10 19:47:33 UTC
(rev 76105)
@@ -13,6 +13,7 @@
set(burst_SOURCES
burst.cpp
idents.cpp
+ execute.cpp
${LDIR}/utf8.c
${LDIR}/linenoise.c
)
Added: brlcad/branches/bioh/src/burst2/execute.cpp
===================================================================
--- brlcad/branches/bioh/src/burst2/execute.cpp (rev 0)
+++ brlcad/branches/bioh/src/burst2/execute.cpp 2020-06-10 19:47:33 UTC (rev
76105)
@@ -0,0 +1,118 @@
+/* E X E C U T E . C P P
+ * BRL-CAD
+ *
+ * Copyright (c) 2004-2020 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 burst/execute.cpp
+ *
+ */
+
+#include "common.h"
+
+#include <cstdio>
+#include <fstream>
+#include <iostream>
+#include <sstream>
+#include <string>
+#include <regex>
+
+#include "bu/log.h"
+#include "bu/malloc.h"
+#include "bu/ptbl.h"
+#include "vmath.h"
+#include "raytrace.h"
+
+#include "./burst.h"
+
+#define WHITESPACE " \t"
+
+void
+prntTimer(struct burst_state *s, const char *str)
+{
+ (void) rt_read_timer(s->timer, TIMER_LEN-1);
+ bu_log("%s:\t%s\n", str == NULL ? "(null)" : str, s->timer);
+}
+
+
+void
+execute_run(struct burst_state *s)
+{
+ static int gottree = 0;
+ int loaderror = 0;
+ if (!bu_vls_strlen(&s->gedfile)) {
+ bu_log("No target file has been specified.");
+ return;
+ }
+ bu_log("Reading target data base");
+ rt_prep_timer();
+ if (s->rtip == RTI_NULL) {
+ s->rtip = rt_dirbuild(bu_vls_cstr(&s->gedfile), s->title, TITLE_LEN);
+ }
+ if (s->rtip == RTI_NULL) {
+ bu_log("Ray tracer failed to read the target file.");
+ return;
+ }
+ prntTimer(s, "dir");
+ /* Add air into int trees, must be set after rt_dirbuild() and before
+ * rt_gettree(). */
+ s->rtip->useair = 1;
+ if (!gottree) {
+ char *objline = bu_strdup(bu_vls_cstr(&s->objects));
+ char **av = (char **)bu_calloc(strlen(objline) + 1, sizeof(char *),
"argv array");
+ int ac = bu_argv_from_string(av, strlen(objline), objline);
+
+ rt_prep_timer();
+ for (int i = 0; i < ac; i++) {
+ const char *obj = av[i];
+ bu_log("Loading \"%s\"", obj);
+ if (rt_gettree(s->rtip, obj) != 0) {
+ bu_log("Bad object \"%s\".", obj);
+ loaderror = 1;
+ }
+ }
+ bu_free(objline, "objline copy");
+ bu_free(av, "av");
+
+ gottree = 1;
+ prntTimer(s, "load");
+ }
+ if (loaderror)
+ return;
+ if (s->rtip->needprep) {
+ bu_log("Prepping solids");
+ rt_prep_timer();
+ rt_prep(s->rtip);
+ prntTimer(s, "prep");
+ }
+ //gridInit();
+ if (s->nriplevels > 0) {
+ //spallInit();
+ }
+ //gridModel();
+ return;
+}
+
+/*
+ * 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/bioh/src/burst2/execute.cpp
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits