Revision: 57849
          http://sourceforge.net/p/brlcad/code/57849
Author:   starseeker
Date:     2013-09-23 22:41:50 +0000 (Mon, 23 Sep 2013)
Log Message:
-----------
Begin working on the core of comb support.  Need to pass in more info, or 
something isn't being build correctly with the maps, but getting there.

Modified Paths:
--------------
    brlcad/trunk/src/conv/step/g-step/Assembly_Product.cpp
    brlcad/trunk/src/conv/step/g-step/Comb_Tree.cpp

Modified: brlcad/trunk/src/conv/step/g-step/Assembly_Product.cpp
===================================================================
--- brlcad/trunk/src/conv/step/g-step/Assembly_Product.cpp      2013-09-23 
22:14:43 UTC (rev 57848)
+++ brlcad/trunk/src/conv/step/g-step/Assembly_Product.cpp      2013-09-23 
22:41:50 UTC (rev 57849)
@@ -216,6 +216,8 @@
     RT_CK_DB_INTERNAL(&comb_intern);
     struct rt_comb_internal *comb = (struct rt_comb_internal 
*)(comb_intern.idb_ptr);
     for (int j = (int)BU_PTBL_LEN(children) - 1; j >= 0; j--){
+       STEPentity *orig_transform = Identity_AXIS2_PLACEMENT_3D(registry, 
instance_list);
+       STEPentity *curr_transform = NULL;
        struct directory *curr_dp = (struct directory *)BU_PTBL_GET(children, 
j);
        bu_log("%s under %s: ", curr_dp->d_namep, dp->d_namep);
        union tree *curr_node = db_find_named_leaf(comb->tree, 
curr_dp->d_namep);
@@ -223,10 +225,35 @@
        if(curr_matrix) {
            bu_log(" - found matrix over %s in %s\n", curr_dp->d_namep, 
dp->d_namep);
            bn_mat_print(curr_dp->d_namep, curr_matrix);
-           (void)Mat_to_Rep(curr_matrix, registry, instance_list);
+           curr_transform = Mat_to_Rep(curr_matrix, registry, instance_list);
        } else {
+           curr_transform = Identity_AXIS2_PLACEMENT_3D(registry, 
instance_list);
            bu_log("identity matrix\n");
        }
+       if (curr_transform) {
+           SdaiItem_defined_transformation *item_transform = 
(SdaiItem_defined_transformation 
*)registry->ObjCreate("ITEM_DEFINED_TRANSFORMATION");
+           item_transform->name_("''");
+           item_transform->description_("''");
+           
item_transform->transform_item_1_((SdaiRepresentation_item_ptr)orig_transform);
+           
item_transform->transform_item_2_((SdaiRepresentation_item_ptr)curr_transform);
+           instance_list->Append((STEPentity *)item_transform, completeSE);
+           SdaiNext_assembly_usage_occurrence *usage = 
(SdaiNext_assembly_usage_occurrence 
*)registry->ObjCreate("NEXT_ASSEMBLY_USAGE_OCCURRENCE");
+           usage->id_("''");
+           usage->name_("''");
+           usage->description_("''");
+           usage->reference_designator_("''");
+           usage->relating_product_definition_((SdaiProduct_definition 
*)comb_to_step->find(dp)->second);
+           usage->related_product_definition_((SdaiProduct_definition 
*)comb_to_step->find(curr_dp)->second);
+           instance_list->Append((STEPentity *)usage, completeSE);
+           SdaiProduct_definition_shape *pshape = 
(SdaiProduct_definition_shape *)registry->ObjCreate("PRODUCT_DEFINITION_SHAPE");
+           pshape->name_("''");
+           pshape->description_("''");
+           SdaiCharacterized_product_definition *cpd = new 
SdaiCharacterized_product_definition(usage);
+           pshape->definition_(new SdaiCharacterized_definition(cpd));
+           instance_list->Append((STEPentity *)pshape, completeSE);
+       } else {
+           bu_log("non-uniform scaling detected: %s/%s\n", dp->d_namep, 
curr_dp->d_namep);
+       }
     }
     rt_db_free_internal(&comb_intern);
 }

Modified: brlcad/trunk/src/conv/step/g-step/Comb_Tree.cpp
===================================================================
--- brlcad/trunk/src/conv/step/g-step/Comb_Tree.cpp     2013-09-23 22:14:43 UTC 
(rev 57848)
+++ brlcad/trunk/src/conv/step/g-step/Comb_Tree.cpp     2013-09-23 22:41:50 UTC 
(rev 57849)
@@ -91,8 +91,8 @@
 {
     STEPentity *toplevel_comb = NULL;
 
-    std::map<struct directory *, STEPentity *> brep_to_step;
-    std::map<struct directory *, STEPentity *> comb_to_step;
+    std::map<struct directory *, STEPentity *> *brep_to_step = new 
std::map<struct directory *, STEPentity *>;
+    std::map<struct directory *, STEPentity *> *comb_to_step = new 
std::map<struct directory *, STEPentity *>;
     std::set<struct directory *> non_wrapper_combs;
 
 
@@ -104,7 +104,7 @@
        struct rt_db_internal brep_intern;
        rt_db_get_internal(&brep_intern, curr_dp, wdbp->dbip, bn_mat_identity, 
&rt_uniresource);
        RT_CK_DB_INTERNAL(&brep_intern);
-       brep_to_step[curr_dp] = ON_BRep_to_STEP(curr_dp, &brep_intern, 
registry, instance_list);
+       (*brep_to_step)[curr_dp] = ON_BRep_to_STEP(curr_dp, &brep_intern, 
registry, instance_list);
        bu_log("Brep: %s\n", curr_dp->d_namep);
     }
 
@@ -113,7 +113,7 @@
     struct bu_ptbl *combs = db_search_path_obj(comb_search, dp, wdbp);
     for (int j = (int)BU_PTBL_LEN(combs) - 1; j >= 0; j--){
        struct directory *curr_dp = (struct directory *)BU_PTBL_GET(combs, j);
-       comb_to_step[curr_dp] = Comb_to_STEP(curr_dp, registry, instance_list);
+       (*comb_to_step)[curr_dp] = Comb_to_STEP(curr_dp, registry, 
instance_list);
        non_wrapper_combs.insert(curr_dp);
        bu_log("Comb non-wrapper: %s\n", curr_dp->d_namep);
     }
@@ -137,10 +137,10 @@
        bu_free(comb_child, "free search result");
        union tree *curr_node = db_find_named_leaf(comb->tree, child->d_namep);
        if (!(curr_node->tr_l.tl_mat)) {
-           comb_to_step[curr_dp] = brep_to_step.find(child)->second;
+           (*comb_to_step)[curr_dp] = brep_to_step->find(child)->second;
            bu_log("Comb wrapper: %s\n", curr_dp->d_namep);
        }else{
-           comb_to_step[curr_dp] = Comb_to_STEP(curr_dp, registry, 
instance_list);
+           (*comb_to_step)[curr_dp] = Comb_to_STEP(curr_dp, registry, 
instance_list);
            non_wrapper_combs.insert(curr_dp);
            bu_log("Comb non-wrapper (matrix over primitive): %s\n", 
curr_dp->d_namep);
        }
@@ -157,7 +157,7 @@
     for (std::set<struct directory *>::iterator it=non_wrapper_combs.begin(); 
it != non_wrapper_combs.end(); ++it) {
        bu_log("look for matrices in %s\n", (*it)->d_namep);
        struct bu_ptbl *comb_children = 
db_search_path_obj(comb_children_search, (*it), wdbp);
-       Add_Assembly_Product((*it), wdbp->dbip, comb_children, &comb_to_step, 
registry, instance_list);
+       Add_Assembly_Product((*it), wdbp->dbip, comb_children, comb_to_step, 
registry, instance_list);
        bu_ptbl_free(comb_children);
        bu_free(comb_children, "free search result");
     }

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to