94 lines
3.1 KiB
C++
94 lines
3.1 KiB
C++
/***********************************************************************************************************************
|
|
*
|
|
* Copyright (c) 2010 - 2025 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.
|
|
*
|
|
***********************************************************************************************************************/
|
|
|
|
#include <A3DSDKIncludes.h>
|
|
#include "PRC2XML.h"
|
|
|
|
|
|
|
|
//######################################################################################################################
|
|
A3DStatus traverseMarkupDefinition(const A3DMkpMarkup* pMarkup, _TiXmlElement* setting)
|
|
{
|
|
A3DMarkupDefinitionData sData;
|
|
A3D_INITIALIZE_DATA(A3DMarkupDefinitionData, sData);
|
|
|
|
A3DEEntityType eType = kA3DTypeUnknown;
|
|
A3DStatus iRet = A3DEntityGetType(pMarkup, &eType);
|
|
|
|
|
|
_TiXmlElement* markup = NULL;
|
|
iRet = A3DMarkupDefinitionGet((A3DMarkupDefinition*)pMarkup, &sData);
|
|
if(iRet != A3D_SUCCESS)
|
|
{
|
|
markup->SetAttribute("error", A3DMiscGetErrorMsg(iRet));
|
|
return iRet;
|
|
}
|
|
|
|
A3DMDPosition2DData sPosition;
|
|
A3DVector2dData sOffsetAnchorPoint;
|
|
A3DBool bIsScreenLocation=FALSE;
|
|
A3D_INITIALIZE_DATA(A3DMDPosition2DData, sPosition);
|
|
A3D_INITIALIZE_DATA(A3DVector2dData, sOffsetAnchorPoint);
|
|
A3DMarkupPositionIsScreenLocation((A3DMarkupDefinition*)pMarkup,
|
|
&bIsScreenLocation,
|
|
&sPosition,
|
|
&sOffsetAnchorPoint);
|
|
if(bIsScreenLocation)
|
|
{
|
|
markup = new _TiXmlElement("A3DMkpMarkupDefinitionData");
|
|
setting->LinkEndChild(markup);
|
|
markup->SetAttribute("PositionIsScreenLocation", bIsScreenLocation);
|
|
markup->SetDoubleAttribute("position2Dx ", sPosition.m_sPosition.m_dX);
|
|
markup->SetDoubleAttribute("position2Dy ", sPosition.m_sPosition.m_dY);
|
|
markup->SetDoubleAttribute("offsetAnchorPoint2Dx ", sOffsetAnchorPoint.m_dX);
|
|
markup->SetDoubleAttribute("offsetAnchorPoint2Dy ", sOffsetAnchorPoint.m_dY);
|
|
}
|
|
A3DMarkupDefinitionGet(NULL, &sData);
|
|
|
|
if(eType == kA3DTypeMkpMarkup)
|
|
{
|
|
setting->SetAttribute("data", "no definition");
|
|
return A3D_SUCCESS;
|
|
}
|
|
|
|
if(!bIsScreenLocation)
|
|
{
|
|
markup = new _TiXmlElement("A3DMkpMarkupDefinitionData");
|
|
setting->LinkEndChild(markup);
|
|
}
|
|
|
|
if(eType == kA3DTypeMarkupText)
|
|
{
|
|
return traverseMarkupText(pMarkup, markup);
|
|
}
|
|
else if(eType == kA3DTypeMarkupRichText)
|
|
{
|
|
return traverseMarkupRichText(pMarkup, markup);
|
|
}
|
|
else if(eType == kA3DTypeMarkupDatum)
|
|
{
|
|
return traverseMarkupDatum(pMarkup, markup);
|
|
}
|
|
else if(eType == kA3DTypeMarkupGDT)
|
|
{
|
|
return traverseMarkupGDT(pMarkup, markup);
|
|
}
|
|
else if(eType == kA3DTypeMarkupDimension)
|
|
{
|
|
return traverseMarkupDimension(pMarkup, markup);
|
|
}
|
|
else
|
|
{
|
|
markup->SetAttribute("specific_data", "not yet implemented");
|
|
return A3D_NOT_IMPLEMENTED;
|
|
}
|
|
}
|