Revision: 56668
          http://sourceforge.net/p/brlcad/code/56668
Author:   starseeker
Date:     2013-08-07 15:47:22 +0000 (Wed, 07 Aug 2013)
Log Message:
-----------
Tweaks, start figuring out how to get at and format curve information

Modified Paths:
--------------
    brlcad/trunk/src/conv/step/ON_Brep.cpp

Modified: brlcad/trunk/src/conv/step/ON_Brep.cpp
===================================================================
--- brlcad/trunk/src/conv/step/ON_Brep.cpp      2013-08-07 15:16:35 UTC (rev 
56667)
+++ brlcad/trunk/src/conv/step/ON_Brep.cpp      2013-08-07 15:47:22 UTC (rev 
56668)
@@ -62,25 +62,36 @@
 
 bool ON_BRep_to_STEP(ON_Brep *brep, Registry *registry, InstMgr *instance_list)
 {
-       STEPentity ** vertex_cartesian_pt_array = new 
STEPentity*[brep->m_V.Count()];
-       STEPentity ** vertex_pt_array = new STEPentity*[brep->m_V.Count()];
-       STEPentity ** bspline_curve_array = new STEPentity*[brep->m_E.Count()];
-       STEPentity ** edge_curve_array = new STEPentity*[brep->m_E.Count()];
-       STEPentity ** oriented_edge_array = new 
STEPentity*[2*brep->m_E.Count()];
-       STEPentity ** edge_loop_array = new STEPentity*[brep->m_L.Count()];
-       STEPentity ** outer_bounds_array = new STEPentity*[brep->m_F.Count()];
-       STEPentity ** surface_array = new STEPentity*[brep->m_S.Count()];
-       STEPentity ** faces_array = new STEPentity*[brep->m_F.Count()];
-       STEPentity *closed_shell = new STEPentity;
-       STEPentity *manifold_solid_brep = new STEPentity;
-       STEPentity *advanced_brep = new STEPentity;
+       std::vector<STEPentity *> cartesian_pnts;
+       std::vector<STEPentity *> vertex_pnts;
+       std::vector<STEPentity *> three_dimensional_curves;
+       std::vector<STEPentity *> edge_curves;
+       std::vector<STEPentity *> oriented_edges;
+       std::vector<STEPentity *> edge_loops;
+       std::vector<STEPentity *> outer_bounds;
+       std::vector<STEPentity *> surfaces;
+       std::vector<STEPentity *> faces;
+       //STEPentity *closed_shell = new STEPentity;
+       //STEPentity *manifold_solid_brep = new STEPentity;
+       //STEPentity *advanced_brep = new STEPentity;
 
+       /* Set initial container capacities */
+       cartesian_pnts.resize(brep->m_V.Count(), NULL);
+       vertex_pnts.resize(brep->m_V.Count(), NULL);
+       three_dimensional_curves.resize(brep->m_C3.Count(), NULL);
+       edge_curves.resize(brep->m_E.Count(), NULL);
+       oriented_edges.resize(2*(brep->m_E.Count()), NULL);
+       edge_loops.resize(brep->m_L.Count(), NULL);
+       outer_bounds.resize(brep->m_F.Count(), NULL);
+       surfaces.resize(brep->m_S.Count(), NULL);
+       faces.resize(brep->m_F.Count(), NULL);
+
         // Set up vertices and associated cartesian points
        for (int i = 0; i < brep->m_V.Count(); ++i) {
                 // Cartesian points (actual 3D geometry)
-               vertex_cartesian_pt_array[i] = 
registry->ObjCreate("CARTESIAN_POINT");
-               instance_list->Append(vertex_cartesian_pt_array[i], completeSE);
-               RealAggregate_ptr coord_vals = ((SdaiCartesian_point 
*)vertex_cartesian_pt_array[i])->coordinates_();
+               cartesian_pnts.at(i) = registry->ObjCreate("CARTESIAN_POINT");
+               instance_list->Append(cartesian_pnts.at(i), completeSE);
+               RealAggregate_ptr coord_vals = ((SdaiCartesian_point 
*)cartesian_pnts.at(i))->coordinates_();
                 RealNode *xnode = new RealNode();
                 xnode->value = brep->m_V[i].Point().x;
                coord_vals->AddNode(xnode);
@@ -91,8 +102,40 @@
                 znode->value = brep->m_V[i].Point().z;
                coord_vals->AddNode(znode);
                 // Vertex points (topological, references actual 3D geometry)
-               vertex_pt_array[i] = registry->ObjCreate("VERTEX_POINT");
-               ((SdaiVertex_point 
*)vertex_pt_array[i])->vertex_geometry_((const 
SdaiPoint_ptr)vertex_cartesian_pt_array[i]);
-               instance_list->Append(vertex_pt_array[i], completeSE);
+               vertex_pnts.at(i) = registry->ObjCreate("VERTEX_POINT");
+               ((SdaiVertex_point 
*)vertex_pnts.at(i))->vertex_geometry_((const SdaiPoint_ptr)vertex_pnts.at(i));
+               instance_list->Append(vertex_pnts.at(i), completeSE);
        }
+#if 0
+       // 3D curves
+       for (int i = 0; i < brep->m_C3.Count(); ++i) {
+               int curve_converted = 0;
+               ON_Curve* curve = brep->m_C3[i];
+               /* Supported curve types */
+               ON_ArcCurve *a_curve = ON_ArcCurve::Cast(curve);
+               ON_BezierCurve *b_curve = ON_BezierCurve::Cast(curve);
+               ON_LineCurve *l_curve = ON_LineCurve::Cast(curve);
+               ON_NurbsCurve *n_curve = ON_NurbsCurve::Cast(curve);
+               ON_PolyLineCurve *pl_curve = ON_PolyLineCurve::Cast(curve);
+               ON_PolyCurve *p_curve = ON_PolyCurve::Cast(curve);
+
+               if (a_curve && !curve_converted) {
+               }
+               if (l_curve && !curve_converted) {
+               }
+               if (p_curve && !curve_converted) {
+               }
+               if (pl_curve && !curve_converted) {
+               }
+               if (b_curve && !curve_converted) {
+               }
+               if (n_curve && !curve_converted) {
+               }
+
+               /* Whatever this is, if it's not a supported type and it does 
have
+                * a NURBS form, use that */
+
+       }
+#endif
+       return true;
 }

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

Reply via email to