Commit [r62432] Maximize Restore History

Sync through r62428

starseeker 2014-08-27

1 2 3 > >> (Page 1 of 3)
removed /brlcad/branches/dm-work/src/other/poly2tri/readme.txt
removed /brlcad/branches/dm-work/src/other/poly2tri/waf
changed /brlcad/branches/dm-work/src/librt/primitives/hrt/hrt.c
changed /brlcad/branches/dm-work/doc/docbook/system/man1/en/g-vrml.xml
changed /brlcad/branches/dm-work/src/librt/primitives/brep/brep_debug.h
changed /brlcad/branches/dm-work/src/other/poly2tri/poly2tri/sweep/sweep.cc
changed /brlcad/branches/dm-work/doc/docbook/system/man1/en/g-nmg.xml
changed /brlcad/branches/dm-work/src/libtclcad/cmdhist_obj.c
changed /brlcad/branches/dm-work/src/gtools/gdiff2/merge.c
changed /brlcad/branches/dm-work/src/other/poly2tri/poly2tri/common/shapes.h
changed /brlcad/branches/dm-work/doc/docbook/system/man1/en/g-var.xml
changed /brlcad/branches/dm-work/src/libbrep/opennurbs_ext.cpp
changed /brlcad/branches/dm-work/doc/docbook/system/man1/en/g-raw.xml
changed /brlcad/branches/dm-work/src/libtclcad/tclcad.c
changed /brlcad/branches/dm-work/doc/docbook/system/man1/en/g-x3d.xml
changed /brlcad/branches/dm-work/doc/docbook/system/man1/en/g-tankill.xml
changed /brlcad/branches/dm-work/src/libtclcad/tclcadAutoPath.c
changed /brlcad/branches/dm-work/src/libged/polyclip.cpp
changed /brlcad/branches/dm-work/src/conv/3dm/conv3dm-g.cpp
changed /brlcad/branches/dm-work/src/other/poly2tri.dist
changed /brlcad/branches/dm-work/src/libbrep/PullbackCurve.h
copied /brlcad/branches/dm-work/src/other/poly2tri/wscript -> /brlcad/branches/dm-work/src/conv/step/step-g/GeometricSet.h
copied /brlcad/branches/dm-work/src/libtclcad/tclcad_eval.c -> /brlcad/branches/dm-work/src/conv/step/step-g/GeometricSetSelect.cpp
/brlcad/branches/dm-work/src/librt/primitives/hrt/hrt.c Diff Switch to side-by-side view
Loading...
/brlcad/branches/dm-work/doc/docbook/system/man1/en/g-vrml.xml Diff Switch to side-by-side view
Loading...
/brlcad/branches/dm-work/src/librt/primitives/brep/brep_debug.h Diff Switch to side-by-side view
Loading...
/brlcad/branches/dm-work/src/other/poly2tri/poly2tri/sweep/sweep.cc Diff Switch to side-by-side view
Loading...
/brlcad/branches/dm-work/doc/docbook/system/man1/en/g-nmg.xml Diff Switch to side-by-side view
Loading...
/brlcad/branches/dm-work/src/libtclcad/cmdhist_obj.c Diff Switch to side-by-side view
Loading...
/brlcad/branches/dm-work/src/gtools/gdiff2/merge.c Diff Switch to side-by-side view
Loading...
/brlcad/branches/dm-work/src/other/poly2tri/poly2tri/common/shapes.h Diff Switch to side-by-side view
Loading...
/brlcad/branches/dm-work/doc/docbook/system/man1/en/g-var.xml Diff Switch to side-by-side view
Loading...
/brlcad/branches/dm-work/src/libbrep/opennurbs_ext.cpp Diff Switch to side-by-side view
Loading...
/brlcad/branches/dm-work/doc/docbook/system/man1/en/g-raw.xml Diff Switch to side-by-side view
Loading...
/brlcad/branches/dm-work/src/libtclcad/tclcad.c Diff Switch to side-by-side view
Loading...
/brlcad/branches/dm-work/doc/docbook/system/man1/en/g-x3d.xml Diff Switch to side-by-side view
Loading...
/brlcad/branches/dm-work/doc/docbook/system/man1/en/g-tankill.xml Diff Switch to side-by-side view
Loading...
/brlcad/branches/dm-work/src/libtclcad/tclcadAutoPath.c Diff Switch to side-by-side view
Loading...
/brlcad/branches/dm-work/src/libged/polyclip.cpp Diff Switch to side-by-side view
Loading...
/brlcad/branches/dm-work/src/conv/3dm/conv3dm-g.cpp Diff Switch to side-by-side view
Loading...
/brlcad/branches/dm-work/src/other/poly2tri.dist Diff Switch to side-by-side view
Loading...
/brlcad/branches/dm-work/src/libbrep/PullbackCurve.h Diff Switch to side-by-side view
Loading...
/brlcad/branches/dm-work/src/other/poly2tri/wscript to /brlcad/branches/dm-work/src/conv/step/step-g/GeometricSet.h
--- a/brlcad/branches/dm-work/src/other/poly2tri/wscript
+++ b/brlcad/branches/dm-work/src/conv/step/step-g/GeometricSet.h
@@ -1,47 +1,70 @@
-#!/usr/bin/env python
-# encoding: utf-8
-# waf 1.6.10
+/*                 GeometricSet.h
+ * BRL-CAD
+ *
+ * Copyright (c) 1994-2014 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 GeometricSet.h
+ *
+ * Class definition used to convert STEP "GeometricSet" to BRL-CAD BREP
+ * structures.
+ *
+ */
 
-VERSION='0.3.3'
-import sys
-APPNAME='p2t'
-top = '.'
-out = 'build'
+#ifndef CONV_STEP_STEP_G_GEOMETRICSET_H
+#define CONV_STEP_STEP_G_GEOMETRICSET_H
 
-CPP_SOURCES = ['poly2tri/common/shapes.cc',
-               'poly2tri/sweep/cdt.cc',
-               'poly2tri/sweep/advancing_front.cc',
-               'poly2tri/sweep/sweep_context.cc',
-               'poly2tri/sweep/sweep.cc',
-               'testbed/main.cc']
+#include "GeometricRepresentationItem.h"
 
-from waflib.Tools.compiler_cxx import cxx_compiler
-cxx_compiler['win32'] = ['g++']
+// forward declaration of class
+class GeometricSetSelect;
+class STEPWrapper;
+class ON_Brep;
 
-#Platform specific libs
-if sys.platform == 'win32':
-    # MS Windows
-    sys_libs = ['glfw', 'opengl32']
-elif sys.platform == 'darwin':
-    # Apple OSX
-    sys_libs = ['glfw']
-else:
-    # GNU/Linux, BSD, etc
-    sys_libs = ['glfw', 'GL']
+typedef list<GeometricSetSelect *> LIST_OF_GEOMETRIC_SET_SELECT;
 
-def options(opt):
-  print('  set_options')
-  opt.load('compiler_cxx')
+class GeometricSet: public GeometricRepresentationItem
+{
+private:
+    static string entityname;
+    static EntityInstanceFunc GetInstance;
 
-def configure(conf):
-  print('  calling the configuration')
-  conf.load('compiler_cxx')
-  conf.env.CXXFLAGS = ['-O3', '-ffast-math']
-  conf.env.DEFINES_P2T = ['P2T']
-  conf.env.LIB_P2T = sys_libs
-  if sys.platform == 'darwin':
-    conf.env.FRAMEWORK = ['OpenGL', 'Cocoa']
+protected:
+    LIST_OF_GEOMETRIC_SET_SELECT elements;
 
-def build(bld):
-  print('  building')
-  bld.program(features = 'cxx cxxprogram', source=CPP_SOURCES, target = 'p2t', uselib = 'P2T')+public:
+    GeometricSet();
+    GeometricSet(STEPWrapper *sw, int step_id);
+    virtual ~GeometricSet();
+    bool Load(STEPWrapper *sw, SDAI_Application_instance *sse);
+    virtual bool LoadONBrep(ON_Brep *brep);
+    virtual void Print(int level);
+
+    //static methods
+    static STEPEntity *Create(STEPWrapper *sw, SDAI_Application_instance *sse);
+};
+
+#endif /* CONV_STEP_STEP_G_GEOMETRICSET_H */
+
+/*
+ * Local Variables:
+ * tab-width: 8
+ * mode: C
+ * indent-tabs-mode: t
+ * c-file-style: "stroustrup"
+ * End:
+ * ex: shiftwidth=4 tabstop=8
+ */
/brlcad/branches/dm-work/src/libtclcad/tclcad_eval.c to /brlcad/branches/dm-work/src/conv/step/step-g/GeometricSetSelect.cpp
--- a/brlcad/branches/dm-work/src/libtclcad/tclcad_eval.c
+++ b/brlcad/branches/dm-work/src/conv/step/step-g/GeometricSetSelect.cpp
@@ -1,14 +1,14 @@
-/*               T C L C A D _ E V A L _ T C L . C
+/*                 GeometricSetSelect.cpp
  * BRL-CAD
  *
- * Copyright (c) 2014 United States Government as represented by
+ * Copyright (c) 1994-2012 United States Government as represented by
  * the U.S. Army Research Laboratory.
  *
- * This library is free software; you can redistribute it and/or
+ * 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 library is distributed in the hope that it will be useful, but
+ * 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.
@@ -17,83 +17,151 @@
  * License along with this file; see the file named COPYING for more
  * information.
  */
-/** @file tclcad_eval.c
+/** @file step/GeometricSetSelect.cpp
  *
- * Functions for escaping and evaluating TCL commands.
+ * Routines to convert STEP "GeometricSetSelect" to BRL-CAD BREP
+ * structures.
  *
  */
 
-#include "common.h"
+#include "STEPWrapper.h"
+#include "Factory.h"
+#include "Axis2Placement.h"
 
-#include <stdarg.h>
-#include <string.h>
+#include "GeometricSetSelect.h"
+#include "Point.h"
+#include "Curve.h"
+#include "Surface.h"
 
-#include "tclcad_private.h"
+#define CLASSNAME "GeometricSetSelect"
+#define ENTITYNAME "Geometric_Set_Select"
+string GeometricSetSelect::entityname = Factory::RegisterClass(ENTITYNAME,(FactoryMethod)GeometricSetSelect::Create);
 
+GeometricSetSelect::GeometricSetSelect() {
+    step = NULL;
+    id = 0;
+    element = NULL;
+    type = GeometricSetSelect::UNKNOWN;
+}
 
-int
-tclcad_eval_var(Tcl_Interp *interp, int preserve_result,
-		const char *command, ...)
-{
-    int result;
+GeometricSetSelect::GeometricSetSelect(STEPWrapper *sw,int step_id) {
+    step = sw;
+    id = step_id;
+    element = NULL;
+    type = GeometricSetSelect::UNKNOWN;
+}
 
-    Tcl_DString script;
-    Tcl_DStringInit(&script);
-    Tcl_DStringAppend(&script, command, -1);
+GeometricSetSelect::~GeometricSetSelect() {
+}
 
-    {
-	va_list arguments;
-	const char *arg;
+Point *
+GeometricSetSelect::GetPointElement() {
+    return dynamic_cast<Point *>(element);
+}
 
-	va_start(arguments, command);
+Curve *
+GeometricSetSelect::GetCurveElement() {
+    return dynamic_cast<Curve *>(element);
+}
 
-	while ((arg = va_arg(arguments, const char *)))
-	    Tcl_DStringAppendElement(&script, arg);
+Surface *
+GeometricSetSelect::GetSurfaceElement() {
+    return dynamic_cast<Surface *>(element);
+}
 
-	va_end(arguments);
+bool
+GeometricSetSelect::Load(STEPWrapper *sw,SDAI_Select *sse) {
+    step=sw;
+
+    if (element == NULL) {
+	SdaiGeometric_set_select *v = (SdaiGeometric_set_select *) sse;
+
+	if (v->IsPoint()) {
+	    SdaiPoint *point_select = *v;
+	    Point *aPoint = dynamic_cast<Point *>(Factory::CreateObject(sw, (SDAI_Application_instance *)point_select));
+	    type = GeometricSetSelect::POINT;
+	    element = aPoint;
+	} else if (v->IsCurve()) {
+	    SdaiCurve *curve_select = *v;
+	    Curve *aCurve = dynamic_cast<Curve *>(Factory::CreateObject(sw, (SDAI_Application_instance *)curve_select));
+	    type = GeometricSetSelect::CURVE;
+	    element = aCurve;
+	} else if (v->IsSurface()) {
+	    SdaiSurface *surface_select = *v;
+	    Surface *aSurface = dynamic_cast<Surface *>(Factory::CreateObject(sw, (SDAI_Application_instance *)surface_select));
+	    type = GeometricSetSelect::SURFACE;
+	    element = aSurface;
+	} else {
+	    type = GeometricSetSelect::UNKNOWN;
+	    element = NULL;
+	}
     }
 
-    if (!preserve_result) {
-	result = Tcl_Eval(interp, Tcl_DStringValue(&script));
-    } else {
-	Tcl_Obj *saved_result = Tcl_GetObjResult(interp);
-	Tcl_IncrRefCount(saved_result);
-	result = Tcl_Eval(interp, Tcl_DStringValue(&script));
-	Tcl_SetObjResult(interp, saved_result);
-	Tcl_DecrRefCount(saved_result);
-    }
-
-    Tcl_DStringFree(&script);
-    return result;
+    return true;
 }
 
+void
+GeometricSetSelect::Print(int level) {
+    TAB(level); std::cout << CLASSNAME << ":" << entityname << "(";
+    std::cout << "ID:" << STEPid() << ")" << std::endl;
 
-int
-tclcad_eval(Tcl_Interp *interp, const char *command, const char *arg)
-{
-    if (arg)
-	return tclcad_eval_var(interp, 0, command, arg, NULL);
-    else
-	return tclcad_eval_var(interp, 0, command, NULL);
+    TAB(level); std::cout << "Attributes:" << std::endl;
+    //todo: expand out to print actual select type
+    TAB(level+1); std::cout << "definition: ";
+
+    if (type == GeometricSetSelect::POINT) {
+	std::cout << "GeometricSetSelect::POINT" << std::endl;
+	Point *aPoint = dynamic_cast<Point *>(element);
+	if (aPoint) {
+	    aPoint->Print(level+2);
+	} else {
+	    TAB(level+2); std::cout << "POINT == NULL" << std::endl;
+	}
+    } else if (type == GeometricSetSelect::CURVE) {
+	std::cout << "GeometricSetSelect::CURVE" << std::endl;
+	Curve *aCurve = dynamic_cast<Curve *>(element);
+	if (aCurve) {
+	    aCurve->Print(level+2);
+	} else {
+	    TAB(level+2); std::cout << "CURVE == NULL" << std::endl;
+	}
+    } else if (type == GeometricSetSelect::SURFACE) {
+	std::cout << "GeometricSetSelect::SURFACE" << std::endl;
+	Surface *aSurface = dynamic_cast<Surface *>(element);
+	if (aSurface) {
+	    aSurface->Print(level+2);
+	} else {
+	    TAB(level+2); std::cout << "SURFACE == NULL" << std::endl;
+	}
+    } else {
+	std::cout << "UNKNOWN" << std::endl;
+    }
 }
 
-
-int
-tclcad_eval_quiet(Tcl_Interp *interp, const char *command, const char *arg)
+STEPEntity *
+GeometricSetSelect::GetInstance(STEPWrapper *sw, int id)
 {
-    if (arg)
-	return tclcad_eval_var(interp, 1, command, arg, NULL);
-    else
-	return tclcad_eval_var(interp, 1, command, NULL);
+    return new GeometricSetSelect(sw, id);
 }
 
+STEPEntity *
+GeometricSetSelect::Create(STEPWrapper *sw, SDAI_Application_instance *sse)
+{
+    return STEPEntity::CreateEntity(sw, sse, GetInstance, CLASSNAME);
+}
 
-/*
- * Local Variables:
- * tab-width: 8
- * mode: C
- * indent-tabs-mode: t
- * c-file-style: "stroustrup"
- * End:
- * ex: shiftwidth=4 tabstop=8
- */
+bool
+GeometricSetSelect::LoadONBrep(ON_Brep *brep)
+{
+    std::cerr << "Error: ::LoadONBrep(ON_Brep *brep<" << std::hex << brep << std::dec << ">) not implemented for " << entityname << std::endl;
+    return false;
+}
+
+// Local Variables:
+// tab-width: 8
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: t
+// c-file-style: "stroustrup"
+// End:
+// ex: shiftwidth=4 tabstop=8
1 2 3 > >> (Page 1 of 3)