CAA基础之几何图形集介绍1

Different Types of Geometrical Sets
Geometrical Sets can be :

  • either standard "Geometrical Set" (GS)
  • or "Ordered Geometrical Sets " (OGS)

The Geometrical Set (GS) and the Ordered Geometrical Set (OGS) are both GSMTool features. This means that both of them are surfacic bodies, and contain surfacic or volumic geometrical features .

  • A Geometrical Set (GS) aggregates features created independantly. Each result of the created feature is visible.
  • An Ordered Geometrical Set (OGS) gives an other way to manage the links between features. An OGS keeps a linear view of the design in showing/using the order of creation . It uses the notion of current feature like in Part Body, it allows to visualize a state corresponding to the current feature. The edition at a step of the design becomes easier, some tools ,like for example scan , can be used to review step by step the design (similar as it is done in Part Design )

Once created up to three steps can be considered for insert features into a tool (GS or OGS)

    1. Aggregation of the feature in the Surfacic tool (InsertInProceduralView method)
      - If GS , the feature is aggregated at the end of the tool
      - If OGS , the feature is aggregated either at the end of the tool if the current feature is not in an OGS (for example in a PartBody) or after the current feature in the OGS.
      Warning: When the feature is aggregated in an OGS, it becomes the current feature
    2. Update
      once aggregated, the feature has to be update (Update method of CATISpecObject)
    3. Manage linearity in the OGS
      For features inserted in an OGS, the method insert of CATMmrLinearBodyServices need to be invoked
      This method checks the linearity of the Parent/Children relationship and if needed performed re-arrangement(Replace) to makes sure that created feature depends logically of just previouly created feature
       1 #include "CAAIMyFeature.h"    
       2  #include "CATISpecObject.h"    
       3  #include "CATIGSMTool.h"      
       4  #include "CATIGSProceduralView.h"  
       5  #include "CATMmrLinearBodyServices.h"
       6  ......
       7  HRESULT rc = S_OK ;  
       8  CAAIMyFeature * piMyFeature =.... 
       9  .... 
      10  CATISpecObject * pSpecObject = NULL ;
      11  rc = piMyFeature->QueryInterface(IID_CATISpecObject,
      12                                                   (void**) &pSpecObject);
      13  if ( SUCCEEDED(rc)) { 
      14 
      15    // 1/ Aggregate 
      16    CATIGSMProceduralView_var curobj = pSpecObject;
      17    if (NULL_var != curobj ) {
      18        rc = curobj->InsertInProceduralView();
      19    }
      20 
      21    // 2/ Update 
      22    CATTry  {    
      23        ispSpec -> Update();
      24     }
      25    CATCatch(CATError,error)    {
      26        rc = CATReturnError(error);
      27     }
      28    CATEndTry;
      29    
      30    // Test update / GetLastError  
      31    ... 
      32    // 3 / OGS 
      33    CATBoolean IsInsideOGS = FALSE ;
      34    CATISpecObject * pFatherCC = NULL ;
      35    pFatherCC = pSpecObject->GetFather();
      36    if ( NULL != pFatherCC )    {
      37       CATIGSMTool *piGSMToolFatherCC = NULL;
      38       rc = pFatherCC->QueryInterface ( IID_CATIGSMTool, (void**) &piGSMToolFather);
      39       if ( SUCCEEDED(rc) )    {
      40           int IsAnOGS = -1 ;
      41           piGSMToolFatherCC->GetType(IsAnOGS) ;
      42           if ( 1 == IsAnOGS ) {
      43             oIsInsideOGS = TRUE ;
      44             }
      45             piGSMToolFather->Release(); piGSMToolFather = NULL ;
      46         }  
      47         pFatherCC->Release();               pFatherCC = NULL ;
      48       }
      49       else 
      50         rc = E_FAIL ;
      51 
      52       pSpecObject->Release(); pSpecObject = NULL ;
      53     }
      54  
      55     if (  IsInsideOGS ) { 
      56       CATBaseUnknown_var spBUOn = pSpecObject;
      57       rc = CATMmrLinearBodyServices::Insert(spBUOnCC);
      58      }
      59  
      60     pSpecObject->Release(); pSpecObject = NULL ;
      61   } 
      62  .... 
      63   

       

posted @ 2017-03-01 18:59  一介草民李八千  阅读(359)  评论(0)    收藏  举报