[cgma-dev] r1782 - in cgm/trunk/geom: . OCC facet virtual

janehu at mcs.anl.gov janehu at mcs.anl.gov
Mon Apr 28 13:09:47 CDT 2008


Author: janehu
Date: 2008-04-28 13:09:47 -0500 (Mon, 28 Apr 2008)
New Revision: 1782

Modified:
   cgm/trunk/geom/Body.cpp
   cgm/trunk/geom/BodySM.hpp
   cgm/trunk/geom/GeometryModifyTool.cpp
   cgm/trunk/geom/GeometryModifyTool.hpp
   cgm/trunk/geom/OCC/OCCModifyEngine.cpp
   cgm/trunk/geom/OCC/OCCQueryEngine.cpp
   cgm/trunk/geom/OCC/OCCSurface.cpp
   cgm/trunk/geom/facet/FacetBody.hpp
   cgm/trunk/geom/virtual/CompositeBody.hpp
   cgm/trunk/geom/virtual/PartitionBody.hpp
Log:
worked on deleting free edge and vertices, still has some left, investgating.

Modified: cgm/trunk/geom/Body.cpp
===================================================================
--- cgm/trunk/geom/Body.cpp	2008-04-28 17:27:52 UTC (rev 1781)
+++ cgm/trunk/geom/Body.cpp	2008-04-28 18:09:47 UTC (rev 1782)
@@ -193,8 +193,19 @@
   DLIList<RefVolume*> volumes;
   ref_volumes(volumes);
   while (volumes.size())
+  {
     if (!volumes.pop()->is_sheet())
-      return CUBIT_FALSE;
+    {   
+      //OCC sheet body just has one face or shell, not like Acis
+      BodySM* bodysm = get_body_sm_ptr();
+      if (bodysm == NULL)
+      {
+        PRINT_ERROR("Body %d is invalid -- no attached BodySM.\n", this->id());
+        return CUBIT_FALSE;
+      }
+      return bodysm->is_sheet_body();
+    }
+  }
   return CUBIT_TRUE;
 }
  

Modified: cgm/trunk/geom/BodySM.hpp
===================================================================
--- cgm/trunk/geom/BodySM.hpp	2008-04-28 17:27:52 UTC (rev 1781)
+++ cgm/trunk/geom/BodySM.hpp	2008-04-28 18:09:47 UTC (rev 1782)
@@ -74,6 +74,7 @@
 
       CubitBox bounding_box();
       
+      virtual CubitBoolean is_sheet_body() = 0; 
    protected: 
 
    private:

Modified: cgm/trunk/geom/GeometryModifyTool.cpp
===================================================================
--- cgm/trunk/geom/GeometryModifyTool.cpp	2008-04-28 17:27:52 UTC (rev 1781)
+++ cgm/trunk/geom/GeometryModifyTool.cpp	2008-04-28 18:09:47 UTC (rev 1782)
@@ -1425,7 +1425,6 @@
 //
 // Creation Date : 03/29/97
 //-------------------------------------------------------------------------
-/*
 RefVolume*
 GeometryModifyTool::make_RefVolume( DLIList<RefFace*>& ref_face_list) const
 {
@@ -1465,13 +1464,14 @@
    }
 
      // Use the Lump to make a RefVolume
+    CubitBoolean modified;
     RefVolume* ref_volume_ptr =
-      GeometryQueryTool::instance()->make_RefVolume(lump_ptr);
+      GeometryQueryTool::instance()->make_RefVolume(lump_ptr, modified);
 
      // Return the new RefVolume
    return ref_volume_ptr ;
 }
-*/
+
 //-------------------------------------------------------------------------
 // Purpose       : This function takes a list of RefVolumes to create a
 //                 Body. The underlying representation of the Body is

Modified: cgm/trunk/geom/GeometryModifyTool.hpp
===================================================================
--- cgm/trunk/geom/GeometryModifyTool.hpp	2008-04-28 17:27:52 UTC (rev 1781)
+++ cgm/trunk/geom/GeometryModifyTool.hpp	2008-04-28 18:09:47 UTC (rev 1782)
@@ -916,7 +916,7 @@
     *  made for some reason.
     */
 
-//  RefVolume* make_RefVolume(DLIList<RefFace*>& ref_face_list) const ;
+  RefVolume* make_RefVolume(DLIList<RefFace*>& ref_face_list) const ;
   /**<  \return  RefVlume*
     *  \return - A pointer to a newly created RefVlume
     *  \arg ref_volume_type

Modified: cgm/trunk/geom/OCC/OCCModifyEngine.cpp
===================================================================
--- cgm/trunk/geom/OCC/OCCModifyEngine.cpp	2008-04-28 17:27:52 UTC (rev 1781)
+++ cgm/trunk/geom/OCC/OCCModifyEngine.cpp	2008-04-28 18:09:47 UTC (rev 1782)
@@ -1632,16 +1632,7 @@
           else if(fuser.IsDeleted(face))
           {
             TopoDS_Face null_face;
-            int k = OCCSurface::update_OCC_entity(face, null_face, &fuser);
-            std::map<int, TopologyBridge*>::iterator it =  
-                OCCQueryEngine::instance()->OccToCGM->find(k);
-            TopologyBridge* tb = NULL;
-            if (it != OCCQueryEngine::instance()->OccToCGM->end())
-     	    {
-              OCCQueryEngine::instance()->OccToCGM->erase(k);
-              tb = (*it).second;
-              delete tb;
-   	    }
+            OCCSurface::update_OCC_entity(face, null_face, &fuser);
           }
         }
       } 

Modified: cgm/trunk/geom/OCC/OCCQueryEngine.cpp
===================================================================
--- cgm/trunk/geom/OCC/OCCQueryEngine.cpp	2008-04-28 17:27:52 UTC (rev 1781)
+++ cgm/trunk/geom/OCC/OCCQueryEngine.cpp	2008-04-28 18:09:47 UTC (rev 1782)
@@ -2447,8 +2447,10 @@
   int k = OCCMap->Find(old_shape);
   assert (k > 0 && k <= iTotalTBCreated);
 
-  if (!new_shape.IsNull() && !old_shape.IsSame(new_shape)&& 
-      OCCMap->IsBound(new_shape)) 
+  OCCMap->UnBind(old_shape);
+
+  if ((!new_shape.IsNull() && !old_shape.IsSame(new_shape)&& 
+      OCCMap->IsBound(new_shape))|| new_shape.IsNull()) 
   //already has a TB built on new_shape
   {
     //delete the second TB corresponding to old_shape
@@ -2462,8 +2464,7 @@
     }
   }
 
-  OCCMap->UnBind(old_shape);
-  if(!new_shape.IsNull())
+  else
     OCCMap->Bind(new_shape, k);
   return k;
 }

Modified: cgm/trunk/geom/OCC/OCCSurface.cpp
===================================================================
--- cgm/trunk/geom/OCC/OCCSurface.cpp	2008-04-28 17:27:52 UTC (rev 1781)
+++ cgm/trunk/geom/OCC/OCCSurface.cpp	2008-04-28 18:09:47 UTC (rev 1782)
@@ -853,25 +853,12 @@
      for(Ex.Init(wire); Ex.More();Ex.Next())
      {
        TopoDS_Edge edge = Ex.Current();
-       shape.Nullify();
        shapes.Assign(op->Modified(edge));
        shape.Nullify();
        if (shapes.Extent() > 0)
          shape = shapes.First();
        else if (op->IsDeleted(edge))
-       {
-         int k = OCCQueryEngine::instance()->update_OCC_map(edge, shape);
-         std::map<int, TopologyBridge*>::iterator it =
-                OCCQueryEngine::instance()->OccToCGM->find(k);
-         TopologyBridge* tb = NULL;
-         if (it != OCCQueryEngine::instance()->OccToCGM->end())
-         {
-           OCCQueryEngine::instance()->OccToCGM->erase(k);
-           tb = (*it).second;
-           delete tb;
-         }
-       }    
-
+         ; 
        else 
          continue;
 
@@ -879,9 +866,9 @@
        {
          shape.Orientation(
           shape.Orientation()==TopAbs_FORWARD? TopAbs_REVERSED:TopAbs_FORWARD);
-         OCCQueryEngine::instance()->update_OCC_map(edge, shape); 
        }
-  
+       OCCQueryEngine::instance()->update_OCC_map(edge, shape); 
+
        //update vertex
        TopoDS_Vertex vertex = Ex.CurrentVertex();
        shapes.Assign(op->Modified(vertex));
@@ -892,18 +879,7 @@
          OCCQueryEngine::instance()->update_OCC_map(vertex, shape);
        }
        else if(op->IsDeleted(vertex))
-       {
-         int k = OCCQueryEngine::instance()->update_OCC_map(vertex, shape);
-         std::map<int, TopologyBridge*>::iterator it =
-                OCCQueryEngine::instance()->OccToCGM->find(k);
-         TopologyBridge* tb = NULL;
-         if (it != OCCQueryEngine::instance()->OccToCGM->end())
-         {
-           OCCQueryEngine::instance()->OccToCGM->erase(k);
-           tb = (*it).second;
-           delete tb;
-         }
-       }
+         OCCQueryEngine::instance()->update_OCC_map(vertex, shape);
      }
   }
   return CUBIT_SUCCESS;

Modified: cgm/trunk/geom/facet/FacetBody.hpp
===================================================================
--- cgm/trunk/geom/facet/FacetBody.hpp	2008-04-28 17:27:52 UTC (rev 1781)
+++ cgm/trunk/geom/facet/FacetBody.hpp	2008-04-28 18:09:47 UTC (rev 1782)
@@ -191,6 +191,7 @@
   
   virtual CubitPointContainment point_containment( const CubitVector& pos );
 
+  virtual CubitBoolean is_sheet_body(){return CUBIT_FALSE;}
 protected: 
   
 private:

Modified: cgm/trunk/geom/virtual/CompositeBody.hpp
===================================================================
--- cgm/trunk/geom/virtual/CompositeBody.hpp	2008-04-28 17:27:52 UTC (rev 1781)
+++ cgm/trunk/geom/virtual/CompositeBody.hpp	2008-04-28 18:09:47 UTC (rev 1782)
@@ -78,6 +78,7 @@
     
     void combine( CompositeBody* other );
     
+    CubitBoolean is_sheet_body(){return CUBIT_FALSE;}
   private:
   
     CompositeLump* firstLump;

Modified: cgm/trunk/geom/virtual/PartitionBody.hpp
===================================================================
--- cgm/trunk/geom/virtual/PartitionBody.hpp	2008-04-28 17:27:52 UTC (rev 1781)
+++ cgm/trunk/geom/virtual/PartitionBody.hpp	2008-04-28 18:09:47 UTC (rev 1782)
@@ -100,7 +100,8 @@
     void transform(const CubitTransformMatrix&) {}
     
     void get_all_children( DLIList<PartitionEntity*>& list );
-
+  
+    virtual CubitBoolean is_sheet_body(){return CUBIT_FALSE;}
   protected:
     
   private:




More information about the cgma-dev mailing list