76 lines
3.1 KiB
C++
76 lines
3.1 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 CreatePRCCubesDef.h
|
|
*
|
|
* Includes and defines variable used in the rest of the project.
|
|
*
|
|
***********************************************************************************************************************/
|
|
|
|
|
|
#include "CreatePRCCubesDef.h"
|
|
|
|
//######################################################################################################################
|
|
A3DStatus setEntityName(A3DEntity* pEntity, const A3DUTF8Char* pName)
|
|
{
|
|
A3DStatus iRet = A3D_SUCCESS;
|
|
if (pEntity != NULL)
|
|
{
|
|
A3DRootBaseData sBaseData;
|
|
A3D_INITIALIZE_DATA(A3DRootBaseData, sBaseData);
|
|
CHECK_RET(A3DRootBaseGet(pEntity, &sBaseData));
|
|
A3DUTF8Char* pTmpStr = sBaseData.m_pcName;
|
|
sBaseData.m_pcName = (A3DUTF8Char*) pName;
|
|
CHECK_RET(A3DRootBaseSet(pEntity, &sBaseData));
|
|
sBaseData.m_pcName = pTmpStr;
|
|
CHECK_RET(A3DRootBaseGet(nullptr, &sBaseData));
|
|
}
|
|
return iRet;
|
|
}
|
|
|
|
//######################################################################################################################
|
|
A3DStatus addEntityAttributes(A3DEntity* pEntity, A3DUns32 uiAttributeSize, A3DMiscAttribute** ppAttributes)
|
|
{
|
|
A3DStatus iRet = A3D_SUCCESS;
|
|
|
|
if (pEntity != NULL)
|
|
{
|
|
CHECK_RET(A3DRootBaseAttributeAppend(pEntity, uiAttributeSize, ppAttributes));
|
|
}
|
|
|
|
return iRet;
|
|
}
|
|
|
|
|
|
//######################################################################################################################
|
|
A3DStatus getPOLocationOrigin(A3DAsmProductOccurrence* pPO, A3DVector3dData* pOutPos)
|
|
{
|
|
A3DStatus iRet = A3D_SUCCESS;
|
|
if (pOutPos == 0) return A3D_ERROR;
|
|
|
|
A3DAsmProductOccurrenceData sPOData;
|
|
A3D_INITIALIZE_DATA(A3DAsmProductOccurrenceData, sPOData);
|
|
CHECK_RET(A3DAsmProductOccurrenceGet(pPO, &sPOData));
|
|
|
|
if (sPOData.m_pLocation)
|
|
{
|
|
A3DMiscCartesianTransformationData sTransforamationData;
|
|
A3D_INITIALIZE_DATA(A3DMiscCartesianTransformationData, sTransforamationData);
|
|
CHECK_RET(A3DMiscCartesianTransformationGet(sPOData.m_pLocation, &sTransforamationData));
|
|
pOutPos->m_dX = sTransforamationData.m_sOrigin.m_dX;
|
|
pOutPos->m_dY = sTransforamationData.m_sOrigin.m_dY;
|
|
pOutPos->m_dZ = sTransforamationData.m_sOrigin.m_dZ;
|
|
}
|
|
|
|
return iRet;
|
|
}
|