Revision: 56678
          http://sourceforge.net/p/brlcad/code/56678
Author:   starseeker
Date:     2013-08-07 19:46:46 +0000 (Wed, 07 Aug 2013)
Log Message:
-----------
Start working on bspline curves.  Add control vertices.

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 19:31:26 UTC (rev 
56677)
+++ brlcad/trunk/src/conv/step/ON_Brep.cpp      2013-08-07 19:46:46 UTC (rev 
56678)
@@ -88,6 +88,24 @@
        coord_vals->AddNode(znode);
 }
 
+void
+ON_NurbsCurveCV_to_EntityAggregate(ON_NurbsCurve *incrv, SdaiB_spline_curve 
*step_crv, Registry *registry, InstMgr *instance_list) {
+       EntityAggregate *control_pnts = step_crv->control_points_list_();
+       ON_3dPoint cv_pnt;
+       for (int i = 0; i < incrv->CVCount(); i++) {
+               SdaiCartesian_point *step_cartesian = (SdaiCartesian_point 
*)registry->ObjCreate("CARTESIAN_POINT");
+               instance_list->Append(step_cartesian, completeSE);
+               incrv->GetCV(i, cv_pnt);
+               ON_3dPoint_to_Cartesian_point(&(cv_pnt), step_cartesian);
+               control_pnts->AddNode(new EntityNode((SDAI_Application_instance 
*)step_cartesian));
+       }
+}
+#if 0
+void
+ON_RationalNurbsCurve_to_EntityAggregate(ON_NurbsCurve *incrv, 
SdaiRational_B_spline_curve *step_crv) {
+}
+#endif
+
 bool ON_BRep_to_STEP(ON_Brep *brep, Registry *registry, InstMgr *instance_list)
 {
        std::vector<STEPentity *> cartesian_pnts;
@@ -167,6 +185,16 @@
                if (n_curve && !curve_converted) {
                        std::cout << "Have NurbsCurve\n";
                        //MakePiecewiseBezier
+                       if (n_curve->IsRational()) {
+                               three_dimensional_curves.at(i) = 
registry->ObjCreate("RATIONAL_B_SPLINE_CURVE");
+                       } else {
+                               three_dimensional_curves.at(i) = 
registry->ObjCreate("B_SPLINE_CURVE");
+                               SdaiB_spline_curve *curr_curve = 
(SdaiB_spline_curve *)three_dimensional_curves.at(i);
+                               curr_curve->degree_(n_curve->Degree());
+                               ON_NurbsCurveCV_to_EntityAggregate(n_curve, 
curr_curve, registry, instance_list);
+                       }
+
+                       instance_list->Append(three_dimensional_curves.at(i), 
completeSE);
                }
 
                /* Whatever this is, if it's not a supported type and it does 
have

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