118 lines
4.5 KiB
C++
118 lines
4.5 KiB
C++
/***********************************************************************************************************************
|
|
*
|
|
* Copyright (c) 2010 - 2022 by Tech Soft 3D, Inc.
|
|
* The information contained herein is confidential and proprietary to Tech Soft 3D, Inc., and considered a trade secret
|
|
* as defined under civil and criminal statutes. Tech Soft 3D shall pursue its civil and criminal remedies in the event
|
|
* of unauthorized use or misappropriation of its trade secrets. Use of this information by anyone other than authorized
|
|
* employees of Tech Soft 3D, Inc. is granted only under a written non-disclosure agreement, expressly prescribing the
|
|
* scope and manner of such use.
|
|
*
|
|
***********************************************************************************************************************/
|
|
/**
|
|
* Sample CreatePRCCubes
|
|
* file CreateLinkedItem.cpp
|
|
* This file is containing the function allowing to create linked items.
|
|
*
|
|
*
|
|
***********************************************************************************************************************/
|
|
#include "CreateMarkups.h"
|
|
|
|
//######################################################################################################################
|
|
//
|
|
// Linked Items
|
|
//
|
|
//######################################################################################################################
|
|
// Create a a link mparkup / entity
|
|
static A3DStatus stCreateLinkedItem(A3DEntity* pEntity, A3DAsmProductOccurrence *pPOTarget,
|
|
A3DMiscMarkupLinkedItem ** ppMLI)
|
|
{
|
|
A3DStatus iRet = A3D_SUCCESS;
|
|
|
|
A3DMiscMarkupLinkedItemData sMLIData;
|
|
A3D_INITIALIZE_DATA(A3DMiscMarkupLinkedItemData, sMLIData);
|
|
|
|
sMLIData.m_pTargetProductOccurrence = pPOTarget;
|
|
sMLIData.m_pReference = pEntity;
|
|
CHECK_RET(A3DMiscMarkupLinkedItemCreate(&sMLIData, ppMLI));
|
|
|
|
return iRet;
|
|
}
|
|
|
|
//######################################################################################################################
|
|
|
|
A3DStatus createMarkupLinkedItemOnProduct(A3DAsmProductOccurrence* pPO, A3DAsmProductOccurrence *pPOTarget,
|
|
A3DMiscMarkupLinkedItem ** ppMLI)
|
|
{
|
|
A3DStatus iRet = A3D_SUCCESS;
|
|
|
|
// pPo: setting a non-null reference
|
|
// m_pTargetProductOccurrence: setting the target ProductOccurrence to NULL if the reference is at the same level as the PO,
|
|
// or to the level above if the PO tree has several levels
|
|
iRet = (stCreateLinkedItem(pPO, pPOTarget, ppMLI));
|
|
|
|
return iRet;
|
|
}
|
|
|
|
A3DStatus createMarkupLinkedItemOnEntity(A3DEntity* pEntity,
|
|
A3DAsmProductOccurrence * pPOTarget,
|
|
A3DMiscMarkupLinkedItem ** ppMLI)
|
|
{
|
|
A3DStatus iRet = A3D_SUCCESS;
|
|
|
|
CHECK_RET(stCreateLinkedItem(pEntity, pPOTarget, ppMLI));
|
|
|
|
return iRet;
|
|
}
|
|
|
|
A3DStatus createMarkupLinkedItemOnTopo(A3DEntity* pEntity, A3DEEntityType eTopoItemType,
|
|
A3DUns32 uiAdditionalIndexesSize,
|
|
A3DUns32* puiAdditionalIndexes,
|
|
A3DAsmProductOccurrence* pPOTarget,
|
|
A3DMiscMarkupLinkedItem ** ppMLI)
|
|
{
|
|
A3DStatus iRet = A3D_SUCCESS;
|
|
|
|
A3DMiscReferenceOnTopologyData sReferenceOnTopologyData;
|
|
A3D_INITIALIZE_DATA(A3DMiscReferenceOnTopologyData, sReferenceOnTopologyData);
|
|
|
|
sReferenceOnTopologyData.m_eTopoItemType = eTopoItemType; // kA3DTypeTopoFace;
|
|
sReferenceOnTopologyData.m_pBrepData = pEntity;
|
|
sReferenceOnTopologyData.m_uiSize = uiAdditionalIndexesSize;
|
|
sReferenceOnTopologyData.m_puiAdditionalIndexes = puiAdditionalIndexes;
|
|
|
|
A3DMiscReferenceOnTopology* pReferenceOnTopoItem;
|
|
CHECK_RET(A3DMiscReferenceOnTopologyCreate(&sReferenceOnTopologyData, &pReferenceOnTopoItem));
|
|
|
|
// create MarkupLinkedItem
|
|
CHECK_RET(stCreateLinkedItem(pReferenceOnTopoItem, pPOTarget, ppMLI));
|
|
|
|
return iRet;
|
|
}
|
|
|
|
A3DStatus createMarkupLinkedItemOnTess(A3DEntity* pEntity, A3DEEntityType eTessItemType,
|
|
A3DUns32 uiAdditionalIndexesSize,
|
|
A3DUns32* puiAdditionalIndexes,
|
|
A3DAsmProductOccurrence* pPOTarget,
|
|
A3DMiscMarkupLinkedItem ** ppMLI)
|
|
{
|
|
A3DStatus iRet = A3D_SUCCESS;
|
|
|
|
A3DMiscReferenceOnTessData sReferenceOnTessData;
|
|
A3D_INITIALIZE_DATA(A3DMiscReferenceOnTessData, sReferenceOnTessData);
|
|
|
|
sReferenceOnTessData.m_eTopoItemType = eTessItemType; // kA3DTypeTessFace / kA3DTypeTessEdge / kA3DTypeTessVertex;
|
|
sReferenceOnTessData.m_pPolyBrepModel = pEntity;
|
|
sReferenceOnTessData.m_pTargetProductOccurrence = pPOTarget;
|
|
sReferenceOnTessData.m_uiSize = uiAdditionalIndexesSize;
|
|
sReferenceOnTessData.m_puiAdditionalIndexes = puiAdditionalIndexes;
|
|
|
|
A3DMiscReferenceOnTess* pReferenceOnTessItem;
|
|
CHECK_RET(A3DMiscReferenceOnTessCreate(&sReferenceOnTessData, &pReferenceOnTessItem));
|
|
|
|
*ppMLI = (A3DMiscMarkupLinkedItem*)pReferenceOnTessItem;
|
|
|
|
return iRet;
|
|
}
|
|
|
|
|