#include "CATBaseUnknown.h"
#include "CATMechanicalModeler.h"
#include "CATBoolean.h"
#include "CATUnicodeString.h"
#include "CATIContainer.h"
#include "CATISpecObject.h"
#include "CATImportSettingBehavior.h"
class CATIProduct;
class CATIBRepAccess_var;
class CATICkeParm_var;
class CATPathElement;
/**
* Class to manage inter and intra part copy as result.
* <b>Role:</b>This class allows to simulate a copy/paste special as result (with link or not) in a easier way than
* @href CATICutAndPastable .
* <b>Usage :</b>Use a constructor to give the input object and target, then use the @href #Run method then the @href #GetResult method.
*/
class ExportedByCATMechanicalModeler CATMmrInterPartCopy
{
public :
/**
* Constructor with a source feature and a target feature for the copy.
* @param iObjectToCopy
* a curve, line, surface, plane, point, sketch, solid feature set
* @param iTarget
* a part, solid or surfacic feature set
*/
CATMmrInterPartCopy(const CATISpecObject_var[$ iObjectToCopy ,const CATISpecObject_var& iTarget)]
/**
* Constructor with a source subelement and a target feature for the copy.
* @param iElementToCopy
* a rsur, redge, vertex obtained from selection of a subelement
* @param iTarget
* a part, solid or surfacic feature set
*/
CATMmrInterPartCopy(const CATIBRepAccess_var[$ iElementToCopy ,const CATISpecObject_var& iTarget)]
/**
* Constructor with a source parameter and a target feature for the copy.
* @param iElementToCopy
* a cke parameter
* @param iTarget
* Target is a part, solid or surfacic feature set
*/
CATMmrInterPartCopy(const CATICkeParm_var[$ iElementToCopy ,const CATISpecObject_var& iTarget)]
/**
* Constructor with a source path and a target path.
* @param iObject
* path may contain (product instance +) part + feature or subelement
* @param iTarget
* Target path may contain a product instance, a part, solid or surfacic feature set
*
*/
CATMmrInterPartCopy(CATPathElement* iObject ,CATPathElement* iTarget);
/**
* Selects the product instance of the object.
* <br><b>Role:</b> for contextual link, you may specify the instance of the source part.
* It can also be specified with the constructor with pathelement.
* @param iProd
* the selected instance will be used to determine the product context
* @return
* S_OK if instance is accepted, E_FAIL otherwise
*/
HRESULT SetSourceInstance(CATIProduct* iProd);
/**
* Selects the product instance of the target.
* <br><b>Role:</b> for contextual link, you may specify the instance of the target part.
* It can also be specified with the constructor with pathelement.
* @param iProd
* the selected product instance used as a context for the contextual link
* @return
* S_OK if instance is accepted, E_FAIL otherwise
*/
HRESULT SetTargetInstance(CATIProduct* iProd);
/**
* Sets the link option (with or without link) to override default setting (keep link).
* @param iMode
* TRUE to keep the link, FALSE otherwise
* @return
* S_OK if mode is accepted, E_FAIL otherwise
*/
HRESULT SetLinkMode(CATBoolean iMode);
/**
* Computes the copy according to specified input.
* <br><b>Role:</b> after constructing the class, select link mode if needed
* and then use method Run before getting the result with @href #GetResult .
* @param oString
* Error Message
* @return
* S_OK if copy is done, E_FAIL otherwise
*/
HRESULT Run(CATUnicodeString* oString = NULL);
/**
* Retrieves the result computed with @href #Run .
* @param oResult
* result of the copy (if ok).
* @return
* S_OK if result exists, E_FAIL otherwise
*/
HRESULT GetResult(CATISpecObject_var[$ oResult)]
/**
* Returns creation status.
* <br><b>Role:</b> sometimes the result does not need to be created if it already exists. In this case, this method
* returns S_FALSE.
* @param oResult
* status
* @return
* S_OK if object was created, S_FALSE if result already existed, E_FAIL otherwise
*/
HRESULT GetCreationStatus();