CATGSMUseItf Interface CATIGSMUseProceduralView

Usage: an implementation of this interface is supplied and you must use it as is. You should not reimplement it.


interface CATIGSMUseProceduralView

Insertion of current feature in document.
Role: Allows you to append Shape Design features in a Geometrical Set.
Note : Once appended , the feature should be updated

What does InsertInProceduralView method ?
This method aggregates the feature on a GSMTool in a following way

 
    Checks that the feature in not already aggregated , if yes does nothing 
    Checks if Input father  argument is a GSMTool in which features can be aggregated (not external, not private,..)    
    If InputFather is not specify or if not acceptable GSMTool 
        Retrieve Current GSMTool in Part 
        If no current  GSMTool,   create a GSMTool type of "standard" Geometrical Set and set it as Current     
    Insert the feature in the current GSMTool (Geometrical Sets or Ordered Geometrical Set) 
 

Note: Only "standard" geometrical Set is created on the fly when it is needed

Different Types of Geometrical Sets
Geometrical Sets can be :

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 .

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 CATIMmiMechanicalFeature)
  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
 #include "CAAIMyFeature.h"    
 #include "CATIMmiMechanicalFeature.h"    
 #include "CATIGSMUseTool.h"      
 #include "CATIGSProceduralView.h"  
 #include "CATMmrLinearBodyServices.h"
 ......
 HRESULT rc = S_OK ;  
 CAAIMyFeature * piMyFeature =.... 
 .... 
 CATIMmiMechanicalFeature * pSpecObject = NULL ;
 rc = piMyFeature->QueryInterface(IID_CATIMmiMechanicalFeature,
                                                  (void**) &pSpecObject);
 if ( SUCCEEDED(rc)) { 

   // 1/ Aggregate 
   CATIGSMUseProceduralView_var curobj = pSpecObject;
   if (NULL_var != curobj ) {
       rc = curobj->InsertInProceduralView();
   }

   // 2/ Update 
   CATTry  {	
       ispSpec -> Update();
    }
   CATCatch(CATError,error)    {
       rc = CATReturnError(error);
    }
   CATEndTry;
   
   // Test update / GetLastError  
   ... 
   // 3 / OGS 
   CATBoolean IsInsideOGS = FALSE ;
   CATIMmiMechanicalFeature * pFatherCC = NULL ;
   pFatherCC = pSpecObject->GetFather();
   if ( NULL != pFatherCC )    {
      CATIGSMUseTool *piGSMToolFatherCC = NULL;
      rc = pFatherCC->QueryInterface ( IID_CATIGSMUseTool, (void**) &piGSMToolFather);
      if ( SUCCEEDED(rc) )    {
          int IsAnOGS = -1 ;
          piGSMToolFatherCC->GetType(IsAnOGS) ;
          if ( 1 == IsAnOGS ) {
            oIsInsideOGS = TRUE ;
            }
            piGSMToolFather->Release(); piGSMToolFather = NULL ;
        }  
        pFatherCC->Release();               pFatherCC = NULL ;
      }
      else 
        rc = E_FAIL ;

      pSpecObject->Release(); pSpecObject = NULL ;
    }
 
    if (  IsInsideOGS ) { 
      CATBaseUnknown_var spBUOn = pSpecObject;
      rc = CATMmrLinearBodyServices::Insert(spBUOnCC);
     }
 
    pSpecObject->Release(); pSpecObject = NULL ;
  } 
 .... 
  
See also:
, , ,


Method Index


o InsertInProceduralView(CATIMmiMechanicalFeature_var&,CATBoolean,CATIMmiMechanicalFeature_var&)
Insertion of current feature in document.

Methods


o InsertInProceduralView
public virtual InsertInProceduralView( const father=NULL_var,
const bSetAsCurrent=TRUE,
const BeforeFeature=NULL_var)
Insertion of current feature in document.
If father==NULL_var then the Current feature is used as reference for inserting. You can find the current feature with the interface CATIPrtManagement.
The interface set this object as current object for the Part feature if bSetAsCurrent is TRUE (default value).
If object is already inserted, nothing is done.
Parameters:
father
The destination of current feature
bSetAsCurrent
Boolean value (TRUE or FALSE)
BeforeFeature
Before Feature / Use only for inserting in PartBody

This object is included in the file: CATIGSMUseProceduralView.h
If needed, your Imakefile.mk should include the module: CATGSMUseItf

Copyright © 1999-2014, Dassault Systèmes. All rights reserved.